Skip the tests if the rseq syscall is unavailable
[librseq.git] / configure.ac
CommitLineData
2cbca301
MJ
1# SPDX-License-Identifier: MIT
2#
3# Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
4#
5
6AC_PREREQ(2.59)
7AC_INIT([librseq],[0.1.0-pre],[mathieu dot desnoyers at efficios dot com], [], [https://github.com/compudj/librseq/])
8
9# Following the numbering scheme proposed by libtool for the library version
10# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
11AC_SUBST([RSEQ_LIBRARY_VERSION], [0:0:0])
12
13AC_CONFIG_HEADERS([include/config.h])
14AC_CONFIG_AUX_DIR([config])
15AC_CONFIG_MACRO_DIR([m4])
16
17AC_CANONICAL_TARGET
18AC_CANONICAL_HOST
19
20AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip nostdinc])
21AM_MAINTAINER_MODE([enable])
22
23# Enable silent rules if available (Introduced in AM 1.11)
24m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
2cbca301
MJ
26# Checks for C compiler
27AC_USE_SYSTEM_EXTENSIONS
28AC_PROG_CC
29AC_PROG_CC_STDC
30AC_PROG_CXX
31
32# Checks for programs.
33AC_PROG_AWK
34AC_PROG_MAKE_SET
35
36LT_INIT
37
38# Checks for typedefs, structures, and compiler characteristics.
39AC_C_INLINE
40AC_TYPE_INT32_T
41AC_TYPE_INT64_T
42AC_TYPE_OFF_T
43AC_TYPE_SIZE_T
44AC_TYPE_UINT32_T
45AC_TYPE_UINT64_T
46
47AX_C___ATTRIBUTE__
48AS_IF([test "x$ax_cv___attribute__" = "xyes"],
49 [:],
50 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
51
52AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
53
54AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
55
56# Checks for library functions.
57AC_FUNC_MMAP
58AC_FUNC_FORK
59AC_CHECK_FUNCS([ \
60 memset \
61 strerror \
62])
63
64# AC_FUNC_MALLOC causes problems when cross-compiling.
65#AC_FUNC_MALLOC
66
67# Check for headers
68AC_HEADER_STDBOOL
69AC_CHECK_HEADERS([ \
70 limits.h \
71 stddef.h \
72])
73
74AC_CHECK_HEADER([linux/rseq.h])
75AS_IF([test "x${ac_cv_header_linux_rseq_h}" != "xyes"], [
76 AC_MSG_ERROR([Cannot find 'linux/rseq.h'.])
77])
78
2cbca301
MJ
79AM_CPPFLAGS="-include config.h"
80AC_SUBST(AM_CPPFLAGS)
81
82AM_CFLAGS="-Wall -Wextra $AM_CFLAGS"
83AC_SUBST(AM_CFLAGS)
84
85AC_CONFIG_FILES([
86 Makefile
6146efae
MD
87 doc/Makefile
88 doc/man/Makefile
2cbca301
MJ
89 include/Makefile
90 src/Makefile
2cbca301 91 src/librseq.pc
b848736e 92 tests/Makefile
544cdc88 93 tests/utils/Makefile
2cbca301
MJ
94])
95
96AC_OUTPUT
aa4ed6d6
MJ
97
98#
99# Mini-report on what will be built.
100#
101
102PPRINT_INIT
103PPRINT_SET_INDENT(1)
104PPRINT_SET_TS(38)
105
106AS_ECHO
107AS_ECHO("${PPRINT_COLOR_BLDBLU}librseq $PACKAGE_VERSION${PPRINT_COLOR_RST}")
108AS_ECHO
109
110PPRINT_SUBTITLE([Features])
111
112PPRINT_PROP_STRING([Target architecture], $host_cpu)
113
aa4ed6d6
MJ
114report_bindir="`eval eval echo $bindir`"
115report_libdir="`eval eval echo $libdir`"
116
117# Print the bindir and libdir this `make install' will install into.
118AS_ECHO
119PPRINT_SUBTITLE([Install directories])
120PPRINT_PROP_STRING([Binaries], [$report_bindir])
121PPRINT_PROP_STRING([Libraries], [$report_libdir])
This page took 0.038207 seconds and 4 git commands to generate.