blob: 42fb728c1c19f0ebbbb1639ac3325d6f61c0811e [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001
Pablo Neira Ayusoe6403fd2008-03-02 13:40:26 +01002AC_INIT([iptables], [1.4.1])
Jan Engelhardtf82070f2008-01-20 13:14:00 +00003AC_CONFIG_HEADERS([config.h])
4AC_PROG_INSTALL
5AM_INIT_AUTOMAKE
6AC_PROG_CC
7AM_PROG_CC_C_O
8AC_DISABLE_STATIC
9AC_PROG_LIBTOOL
10
Jan Engelhardtf82070f2008-01-20 13:14:00 +000011AC_ARG_WITH([kernel],
12 AS_HELP_STRING([--with-kernel=PATH],
13 [Path to kernel source/build directory]),
14 [kbuilddir="$withval"; ksourcedir="$withval";])
15AC_ARG_WITH([kbuild],
16 AS_HELP_STRING([--with-kbuild=PATH],
17 [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
18 [kbuilddir="$withval"])
19AC_ARG_WITH([ksource],
20 AS_HELP_STRING([--with-ksource=PATH],
21 [Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
22 [ksourcedir="$withval"])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010023AC_ARG_WITH([xtlibdir],
24 AS_HELP_STRING([--with-xtlibdir=PATH],
Jan Engelhardtd31a6592008-02-11 14:11:14 +010025 [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010026 [xtlibdir="$withval"],
Jan Engelhardtd31a6592008-02-11 14:11:14 +010027 [xtlibdir="${libexecdir}/xtables"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000028AC_ARG_ENABLE([devel],
29 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010030 [Install Xtables development headers]),
31 [enable_devel="$enableval"], [enable_devel="yes"])
32AC_ARG_ENABLE([libipq],
33 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardtf82070f2008-01-20 13:14:00 +000034
35AC_CHECK_HEADER([netinet/ip6.h], [], [AC_MSG_ERROR(but we need that for IPv6)])
36AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" == "yes"])
37AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" == "yes"])
38AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" == "yes"])
Jan Engelhardt77f15382008-02-11 15:01:03 +010039AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" == "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000040
41regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
Jan Engelhardt7a236f42008-03-03 12:30:41 +010042 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000043 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
44 -Winline -pipe -DIPTABLES_VERSION=\\\"$PACKAGE_VERSION\\\" \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010045 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010046kinclude_CFLAGS="";
47if [[ -n "$kbuilddir" ]]; then
48 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
49fi;
50if [[ -n "$ksourcedir" ]]; then
51 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
52fi;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000053
Jan Engelhardtfb6209a2008-01-29 13:32:07 +000054AC_SUBST([regular_CFLAGS kinclude_CFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000055AC_SUBST([kbuilddir])
56AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010057AC_SUBST([xtlibdir])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000058AC_OUTPUT([Makefile extensions/GNUmakefile libipq/Makefile])