blob: f5b55719ed49365cd5c671e3d59613585119bb52 [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001
Pablo Neira Ayusob5508d22009-04-06 13:09:17 +02002AC_INIT([iptables], [1.4.3.2])
Thomas Jaroschc634cb92008-06-03 15:02:18 +02003
Jan Engelhardtdacafa52009-01-27 20:56:23 +01004# See libtool.info "Libtool's versioning system"
Jan Engelhardtc4edfa62009-03-30 00:44:46 +02005libxtables_vcurrent=2
Jan Engelhardtdacafa52009-01-27 20:56:23 +01006libxtables_vage=0
7
Jan Engelhardtf82070f2008-01-20 13:14:00 +00008AC_CONFIG_HEADERS([config.h])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +01009AC_CONFIG_MACRO_DIR([m4])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000010AC_PROG_INSTALL
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010011AM_INIT_AUTOMAKE([-Wall])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000012AC_PROG_CC
13AM_PROG_CC_C_O
14AC_DISABLE_STATIC
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010015AM_PROG_LIBTOOL
Jan Engelhardtf82070f2008-01-20 13:14:00 +000016
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 Engelhardta094eb02009-04-03 22:37:49 +020034AC_ARG_ENABLE([ipv4],
35 AS_HELP_STRING([--disable-ipv4], [Do not build iptables]),
36 [enable_ipv4="$enableval"], [enable_ipv4="yes"])
Jan Engelhardt8e586132009-04-03 22:28:34 +020037AC_ARG_ENABLE([ipv6],
38 AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]),
39 [enable_ipv6="$enableval"], [enable_ipv6="yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000040AC_ARG_ENABLE([devel],
41 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010042 [Install Xtables development headers]),
43 [enable_devel="$enableval"], [enable_devel="yes"])
44AC_ARG_ENABLE([libipq],
45 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardt126c1362008-08-04 18:37:38 +020046AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
47 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
48 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000049
Jan Engelhardt2c570e72008-06-05 19:54:48 +020050AC_CHECK_HEADER([linux/dccp.h])
51
52blacklist_modules="";
53if test "$ac_cv_header_linux_dccp_h" != "yes"; then
54 blacklist_modules="$blacklist_modules dccp";
55fi;
56AC_SUBST([blacklist_modules])
57
Jan Engelhardtee3228a2008-06-23 11:37:08 +020058AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
59AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
Jan Engelhardta094eb02009-04-03 22:37:49 +020060AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"])
Jan Engelhardt8e586132009-04-03 22:28:34 +020061AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
Jan Engelhardtee3228a2008-06-23 11:37:08 +020062AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
63AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000064
65regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
Jan Engelhardt7a236f42008-03-03 12:30:41 +010066 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000067 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020068 -Winline -pipe \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010069 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010070kinclude_CFLAGS="";
71if [[ -n "$kbuilddir" ]]; then
72 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
73fi;
74if [[ -n "$ksourcedir" ]]; then
75 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
76fi;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000077
Jan Engelhardtb95fc082008-04-15 09:13:17 +020078AC_SUBST([regular_CFLAGS])
79AC_SUBST([kinclude_CFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000080AC_SUBST([kbuilddir])
81AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010082AC_SUBST([xtlibdir])
Jan Engelhardt126c1362008-08-04 18:37:38 +020083AC_SUBST([pkgconfigdir])
Jan Engelhardtdacafa52009-01-27 20:56:23 +010084AC_SUBST([libxtables_vcurrent])
85AC_SUBST([libxtables_vage])
86libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
87AC_SUBST([libxtables_vmajor])
Thomas Jaroschc634cb92008-06-03 15:02:18 +020088
Jan Engelhardtf567ac92009-02-12 15:01:37 +010089AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
90 libipq/Makefile
Jan Engelhardt51bc8362009-02-11 16:40:29 +010091 include/xtables.h include/iptables/internal.h libiptc.pc xtables.pc])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010092AC_OUTPUT