6 dnl # This library is free software; you can redistribute it and/or modify it
7 dnl # under the terms of version 2.1 of the GNU Lesser General Public License
8 dnl # as published by the Free Software Foundation.
10 dnl # This library is distributed in the hope that it will be useful, but
11 dnl # WITHOUT ANY WARRANTY; without even the implied warranty of
12 dnl # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
13 dnl # General Public License for more details.
15 dnl # You should have received a copy of the GNU Lesser General Public License
16 dnl # along with this library; if not, see <http://www.gnu.org/licenses>.
20 dnl libseccomp defines
22 AC_INIT([libseccomp], [2.3.1])
25 dnl autoconf configuration
27 AC_CONFIG_AUX_DIR([build-aux])
28 AC_CONFIG_HEADERS([configure.h])
29 AC_CONFIG_MACRO_DIR([m4])
32 dnl automake configuration
34 dnl NOTE: Automake < 1.12 didn't have serial-tests and gives an error if it
35 dnl sees this, but for automake >= 1.13 serial-tests is required so we have to
36 dnl include it. Solution is to test for the version of automake (by running
37 dnl an external command) and provide it if necessary. Note we have to do this
38 dnl entirely using m4 macros since automake queries this macro by running
39 dnl 'autoconf --trace ...'.
40 m4_define([serial_tests], [
41 m4_esyscmd([automake --version |
43 awk '{split ($NF,a,"."); if (a[1] == 1 && a[2] >= 12) { print "serial-tests" }}'
46 dnl # NOTE: do not [quote] this parameter
47 AM_INIT_AUTOMAKE(-Wall foreign subdir-objects tar-pax serial_tests)
54 m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
57 dnl libtool configuration
59 LT_INIT([shared pic-only])
62 dnl enable silent builds by default
64 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
69 AM_CPPFLAGS="-I\${top_srcdir}/include"
71 AM_LDFLAGS="-Wl,-z -Wl,relro"
72 AC_SUBST([AM_CPPFLAGS])
74 AC_SUBST([AM_LDFLAGS])
77 dnl check build system seccomp awareness
79 AC_CHECK_HEADERS_ONCE([linux/seccomp.h])
82 dnl version information
84 VERSION_MAJOR=$(echo ${VERSION} | cut -d'.' -f 1)
85 VERSION_MINOR=$(echo ${VERSION} | cut -d'.' -f 2)
86 VERSION_MICRO=$(echo ${VERSION} | cut -d'.' -f 3)
87 AC_SUBST([VERSION_MAJOR])
88 AC_SUBST([VERSION_MINOR])
89 AC_SUBST([VERSION_MICRO])
94 AC_CHECK_PROG(have_cython, cython, "yes", "no")
95 AS_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);
105 dnl python binding checks
107 AC_ARG_ENABLE([python],
108 [AS_HELP_STRING([--enable-python],
109 [build the python bindings, requires cython])])
110 AS_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])
116 AM_CONDITIONAL([ENABLE_PYTHON], [test "$enable_python" = yes])
117 AC_DEFINE_UNQUOTED([ENABLE_PYTHON],
118 [$(test "$enable_python" = yes && echo 1 || echo 0)],
119 [Python bindings build flag.])
124 AC_CHECK_PROG(have_coverity, cov-build, "yes", "no")
125 AM_CONDITIONAL(COVERITY, test "$have_coverity" = yes)
128 dnl version dependent files