Bundle libseccomp 2.3.1
[linux-seccomp.git] / libseccomp / configure.ac
CommitLineData
8befd5cc
MG
1dnl ####
2dnl # Seccomp Library
3dnl #
4
5dnl #
6dnl # This library is free software; you can redistribute it and/or modify it
7dnl # under the terms of version 2.1 of the GNU Lesser General Public License
8dnl # as published by the Free Software Foundation.
9dnl #
10dnl # This library is distributed in the hope that it will be useful, but
11dnl # WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
13dnl # General Public License for more details.
14dnl #
15dnl # You should have received a copy of the GNU Lesser General Public License
16dnl # along with this library; if not, see <http://www.gnu.org/licenses>.
17dnl #
18
19dnl ####
20dnl libseccomp defines
21dnl ####
22AC_INIT([libseccomp], [2.3.1])
23
24dnl ####
25dnl autoconf configuration
26dnl ####
27AC_CONFIG_AUX_DIR([build-aux])
28AC_CONFIG_HEADERS([configure.h])
29AC_CONFIG_MACRO_DIR([m4])
30
31dnl ####
32dnl automake configuration
33dnl ####
34dnl NOTE: Automake < 1.12 didn't have serial-tests and gives an error if it
35dnl sees this, but for automake >= 1.13 serial-tests is required so we have to
36dnl include it. Solution is to test for the version of automake (by running
37dnl an external command) and provide it if necessary. Note we have to do this
38dnl entirely using m4 macros since automake queries this macro by running
39dnl 'autoconf --trace ...'.
40m4_define([serial_tests], [
41 m4_esyscmd([automake --version |
42 head -1 |
43 awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
44 ])
45])
46dnl # NOTE: do not [quote] this parameter
47AM_INIT_AUTOMAKE(-Wall foreign subdir-objects tar-pax serial_tests)
48
49dnl ####
50dnl build tools
51dnl ####
52AC_PROG_CC
53AM_PROG_CC_C_O
54m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
55
56dnl ####
57dnl libtool configuration
58dnl ####
59LT_INIT([shared pic-only])
60
61dnl ####
62dnl enable silent builds by default
63dnl ####
64m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
65
66dnl ####
67dnl build flags
68dnl ####
69AM_CPPFLAGS="-I\${top_srcdir}/include"
70AM_CFLAGS="-Wall"
71AM_LDFLAGS="-Wl,-z -Wl,relro"
72AC_SUBST([AM_CPPFLAGS])
73AC_SUBST([AM_CFLAGS])
74AC_SUBST([AM_LDFLAGS])
75
76dnl ####
77dnl check build system seccomp awareness
78dnl ####
79AC_CHECK_HEADERS_ONCE([linux/seccomp.h])
80
81dnl ####
82dnl version information
83dnl ####
84VERSION_MAJOR=$(echo ${VERSION} | cut -d'.' -f 1)
85VERSION_MINOR=$(echo ${VERSION} | cut -d'.' -f 2)
86VERSION_MICRO=$(echo ${VERSION} | cut -d'.' -f 3)
87AC_SUBST([VERSION_MAJOR])
88AC_SUBST([VERSION_MINOR])
89AC_SUBST([VERSION_MICRO])
90
91dnl ####
92dnl cython checks
93dnl ####
94AC_CHECK_PROG(have_cython, cython, "yes", "no")
95AS_IF([test "$have_cython" = yes], [
96 AS_ECHO("checking cython version... $(cython -V 2>&1 | cut -d' ' -f 3)")
97 CYTHON_VER_MAJ=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 1);
98 CYTHON_VER_MIN=$(cython -V 2>&1 | cut -d' ' -f 3 | cut -d'.' -f 2);
99],[
100 CYTHON_VER_MAJ=0
101 CYTHON_VER_MIN=0
102])
103
104dnl ####
105dnl python binding checks
106dnl ####
107AC_ARG_ENABLE([python],
108 [AS_HELP_STRING([--enable-python],
109 [build the python bindings, requires cython])])
110AS_IF([test "$enable_python" = yes], [
111 # cython version check
112 AS_IF([test "$CYTHON_VER_MAJ" -eq 0 -a "$CYTHON_VER_MIN" -lt 16], [
113 AC_MSG_ERROR([python bindings require cython 0.16 or higher])
114 ])
115])
116AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
117AC_DEFINE_UNQUOTED([ENABLE_PYTHON],
118 [$(test "$enable_python" = yes && echo 1 || echo 0)],
119 [Python bindings build flag.])
120
121dnl ####
122dnl coverity checks
123dnl ####
124AC_CHECK_PROG(have_coverity, cov-build, "yes", "no")
125AM_CONDITIONAL(COVERITY, test "$have_coverity" = yes)
126
127dnl ####
128dnl version dependent files
129dnl ####
130AC_CONFIG_FILES([
131 libseccomp.pc
132 include/seccomp.h
133])
134
135dnl ####
136dnl makefiles
137dnl ####
138AC_CONFIG_FILES([
139 Makefile
140 include/Makefile
141 src/Makefile
142 src/python/Makefile
143 tools/Makefile
144 tests/Makefile
145 doc/Makefile
146])
147
148dnl ####
149dnl done
150dnl ####
151AC_OUTPUT
This page took 0.018153 seconds and 4 git commands to generate.