1 define([_XTABLES_VERSION_MAJOR], 1)
2 define([_XTABLES_VERSION_MINOR], 4)
3 define([_XTABLES_VERSION_PATCH], 1)
4 define([_XTABLES_VERSION_EXTRA], .1)
6 define([_XTABLES_VERSION],_XTABLES_VERSION_MAJOR._XTABLES_VERSION_MINOR._XTABLES_VERSION_PATCH[]_XTABLES_VERSION_EXTRA)
8 AC_INIT([iptables], _XTABLES_VERSION)
9 AC_CONFIG_HEADERS([config.h])
18 AS_HELP_STRING([--with-kernel=PATH],
19 [Path to kernel source/build directory]),
20 [kbuilddir="$withval"; ksourcedir="$withval";])
22 AS_HELP_STRING([--with-kbuild=PATH],
23 [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
24 [kbuilddir="$withval"])
25 AC_ARG_WITH([ksource],
26 AS_HELP_STRING([--with-ksource=PATH],
27 [Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
28 [ksourcedir="$withval"])
29 AC_ARG_WITH([xtlibdir],
30 AS_HELP_STRING([--with-xtlibdir=PATH],
31 [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
32 [xtlibdir="$withval"],
33 [xtlibdir="${libexecdir}/xtables"])
34 AC_ARG_ENABLE([devel],
35 AS_HELP_STRING([--enable-devel],
36 [Install Xtables development headers]),
37 [enable_devel="$enableval"], [enable_devel="yes"])
38 AC_ARG_ENABLE([libipq],
39 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
41 AC_CHECK_HEADER([netinet/ip6.h], [], [AC_MSG_ERROR(but we need that for IPv6)])
42 AC_CHECK_HEADER([linux/dccp.h])
45 if test "$ac_cv_header_linux_dccp_h" != "yes"; then
46 blacklist_modules="$blacklist_modules dccp";
48 AC_SUBST([blacklist_modules])
50 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" == "yes"])
51 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" == "yes"])
52 AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" == "yes"])
53 AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" == "yes"])
55 regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
56 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
57 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
59 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
61 if [[ -n "$kbuilddir" ]]; then
62 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
64 if [[ -n "$ksourcedir" ]]; then
65 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
68 AC_SUBST([regular_CFLAGS])
69 AC_SUBST([kinclude_CFLAGS])
71 AC_SUBST([ksourcedir])
74 XTABLES_VERSION_MAJOR=_XTABLES_VERSION_MAJOR
75 XTABLES_VERSION_MINOR=_XTABLES_VERSION_MINOR
76 XTABLES_VERSION_PATCH=_XTABLES_VERSION_PATCH
77 XTABLES_VERSION_EXTRA=_XTABLES_VERSION_EXTRA
78 AC_SUBST([XTABLES_VERSION_MAJOR])
79 AC_SUBST([XTABLES_VERSION_MINOR])
80 AC_SUBST([XTABLES_VERSION_PATCH])
81 AC_SUBST([XTABLES_VERSION_EXTRA])
83 AC_OUTPUT([Makefile extensions/GNUmakefile libipq/Makefile include/xtables.h])