Add configure report
[librseq.git] / configure.ac
1 # SPDX-License-Identifier: MIT
2 #
3 # Copyright (C) 2019 Michael Jeanson <mjeanson@efficios.com>
4 #
5
6 AC_PREREQ(2.59)
7 AC_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
11 AC_SUBST([RSEQ_LIBRARY_VERSION], [0:0:0])
12
13 AC_CONFIG_HEADERS([include/config.h])
14 AC_CONFIG_AUX_DIR([config])
15 AC_CONFIG_MACRO_DIR([m4])
16
17 AC_CANONICAL_TARGET
18 AC_CANONICAL_HOST
19
20 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip nostdinc])
21 AM_MAINTAINER_MODE([enable])
22
23 # Enable silent rules if available (Introduced in AM 1.11)
24 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
25
26 AC_REQUIRE_AUX_FILE([tap-driver.sh])
27
28 # Checks for C compiler
29 AC_USE_SYSTEM_EXTENSIONS
30 AC_PROG_CC
31 AC_PROG_CC_STDC
32 AC_PROG_CXX
33
34 # Checks for programs.
35 AC_PROG_AWK
36 AC_PROG_MAKE_SET
37
38 LT_INIT
39
40 # Checks for typedefs, structures, and compiler characteristics.
41 AC_C_INLINE
42 AC_TYPE_INT32_T
43 AC_TYPE_INT64_T
44 AC_TYPE_OFF_T
45 AC_TYPE_SIZE_T
46 AC_TYPE_UINT32_T
47 AC_TYPE_UINT64_T
48
49 AX_C___ATTRIBUTE__
50 AS_IF([test "x$ax_cv___attribute__" = "xyes"],
51 [:],
52 [AC_MSG_ERROR([The compiler does not support __attribute__ extensions])])
53
54 AX_PTHREAD(,[AC_MSG_ERROR([Could not configure pthreads support])])
55
56 AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
57
58 # Checks for library functions.
59 AC_FUNC_MMAP
60 AC_FUNC_FORK
61 AC_CHECK_FUNCS([ \
62 memset \
63 strerror \
64 ])
65
66 # AC_FUNC_MALLOC causes problems when cross-compiling.
67 #AC_FUNC_MALLOC
68
69 # Check for headers
70 AC_HEADER_STDBOOL
71 AC_CHECK_HEADERS([ \
72 limits.h \
73 stddef.h \
74 ])
75
76 AC_CHECK_HEADER([linux/rseq.h])
77 AS_IF([test "x${ac_cv_header_linux_rseq_h}" != "xyes"], [
78 AC_MSG_ERROR([Cannot find 'linux/rseq.h'.])
79 ])
80
81 AC_CHECK_HEADER([linux/cpu_opv.h])
82 AH_TEMPLATE([HAVE_CPU_OPV], [Defined to 1 if we have cpu_opv headers.])
83 AS_IF([test "x${ac_cv_header_linux_cpu_opv_h}" = "xyes"], [
84 AC_DEFINE(HAVE_CPU_OPV, 1)
85 ])
86 AM_CONDITIONAL([HAVE_CPU_OPV], [test "x${ac_cv_header_linux_cpu_opv_h}" = "xyes"])
87
88 AM_CPPFLAGS="-include config.h"
89 AC_SUBST(AM_CPPFLAGS)
90
91 AM_CFLAGS="-Wall -Wextra $AM_CFLAGS"
92 AC_SUBST(AM_CFLAGS)
93
94 AC_CONFIG_FILES([
95 Makefile
96 include/Makefile
97 src/Makefile
98 tests/Makefile
99 src/librseq.pc
100 ])
101
102 AC_OUTPUT
103
104 #
105 # Mini-report on what will be built.
106 #
107
108 PPRINT_INIT
109 PPRINT_SET_INDENT(1)
110 PPRINT_SET_TS(38)
111
112 AS_ECHO
113 AS_ECHO("${PPRINT_COLOR_BLDBLU}librseq $PACKAGE_VERSION${PPRINT_COLOR_RST}")
114 AS_ECHO
115
116 PPRINT_SUBTITLE([Features])
117
118 PPRINT_PROP_STRING([Target architecture], $host_cpu)
119
120 # SMP support enabled/disabled
121 test "x${ac_cv_header_linux_cpu_opv_h}" = "xyes" && value=1 || value=0
122 PPRINT_PROP_BOOL([CPU OPV support], $value)
123
124 report_bindir="`eval eval echo $bindir`"
125 report_libdir="`eval eval echo $libdir`"
126
127 # Print the bindir and libdir this `make install' will install into.
128 AS_ECHO
129 PPRINT_SUBTITLE([Install directories])
130 PPRINT_PROP_STRING([Binaries], [$report_bindir])
131 PPRINT_PROP_STRING([Libraries], [$report_libdir])
This page took 0.032748 seconds and 5 git commands to generate.