blob: 2d2f90fd5cf8e800db355350222c519bf4431d37 [file] [log] [blame]
Thomas Jaroschc634cb92008-06-03 15:02:18 +02001define([_XTABLES_VERSION_MAJOR], 1)
2define([_XTABLES_VERSION_MINOR], 4)
3define([_XTABLES_VERSION_PATCH], 1)
Patrick McHardy73cf45b2008-06-16 15:12:40 +02004define([_XTABLES_VERSION_EXTRA], .1)
Jan Engelhardtf82070f2008-01-20 13:14:00 +00005
Thomas Jaroschc634cb92008-06-03 15:02:18 +02006define([_XTABLES_VERSION],_XTABLES_VERSION_MAJOR._XTABLES_VERSION_MINOR._XTABLES_VERSION_PATCH[]_XTABLES_VERSION_EXTRA)
7
8AC_INIT([iptables], _XTABLES_VERSION)
Jan Engelhardtf82070f2008-01-20 13:14:00 +00009AC_CONFIG_HEADERS([config.h])
10AC_PROG_INSTALL
11AM_INIT_AUTOMAKE
12AC_PROG_CC
13AM_PROG_CC_C_O
14AC_DISABLE_STATIC
15AC_PROG_LIBTOOL
16
Jan Engelhardtf82070f2008-01-20 13:14:00 +000017AC_ARG_WITH([kernel],
18 AS_HELP_STRING([--with-kernel=PATH],
19 [Path to kernel source/build directory]),
20 [kbuilddir="$withval"; ksourcedir="$withval";])
21AC_ARG_WITH([kbuild],
22 AS_HELP_STRING([--with-kbuild=PATH],
23 [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
24 [kbuilddir="$withval"])
25AC_ARG_WITH([ksource],
26 AS_HELP_STRING([--with-ksource=PATH],
27 [Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
28 [ksourcedir="$withval"])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010029AC_ARG_WITH([xtlibdir],
30 AS_HELP_STRING([--with-xtlibdir=PATH],
Jan Engelhardtd31a6592008-02-11 14:11:14 +010031 [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010032 [xtlibdir="$withval"],
Jan Engelhardtd31a6592008-02-11 14:11:14 +010033 [xtlibdir="${libexecdir}/xtables"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000034AC_ARG_ENABLE([devel],
35 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010036 [Install Xtables development headers]),
37 [enable_devel="$enableval"], [enable_devel="yes"])
38AC_ARG_ENABLE([libipq],
39 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardtf82070f2008-01-20 13:14:00 +000040
41AC_CHECK_HEADER([netinet/ip6.h], [], [AC_MSG_ERROR(but we need that for IPv6)])
Jan Engelhardt2c570e72008-06-05 19:54:48 +020042AC_CHECK_HEADER([linux/dccp.h])
43
44blacklist_modules="";
45if test "$ac_cv_header_linux_dccp_h" != "yes"; then
46 blacklist_modules="$blacklist_modules dccp";
47fi;
48AC_SUBST([blacklist_modules])
49
Jan Engelhardtee3228a2008-06-23 11:37:08 +020050AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
51AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
52AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
53AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000054
55regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
Jan Engelhardt7a236f42008-03-03 12:30:41 +010056 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000057 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020058 -Winline -pipe \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010059 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010060kinclude_CFLAGS="";
61if [[ -n "$kbuilddir" ]]; then
62 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
63fi;
64if [[ -n "$ksourcedir" ]]; then
65 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
66fi;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000067
Jan Engelhardtb95fc082008-04-15 09:13:17 +020068AC_SUBST([regular_CFLAGS])
69AC_SUBST([kinclude_CFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000070AC_SUBST([kbuilddir])
71AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010072AC_SUBST([xtlibdir])
Thomas Jaroschc634cb92008-06-03 15:02:18 +020073
74XTABLES_VERSION_MAJOR=_XTABLES_VERSION_MAJOR
75XTABLES_VERSION_MINOR=_XTABLES_VERSION_MINOR
76XTABLES_VERSION_PATCH=_XTABLES_VERSION_PATCH
77XTABLES_VERSION_EXTRA=_XTABLES_VERSION_EXTRA
78AC_SUBST([XTABLES_VERSION_MAJOR])
79AC_SUBST([XTABLES_VERSION_MINOR])
80AC_SUBST([XTABLES_VERSION_PATCH])
81AC_SUBST([XTABLES_VERSION_EXTRA])
82
Jan Engelhardt493c7122008-04-15 11:15:16 +020083AC_OUTPUT([Makefile extensions/GNUmakefile libipq/Makefile include/xtables.h])