blob: 5679098c979de78ca3fea559f8ee6ca8bdae665a [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001
Pablo Neira Ayuso5df067f2011-09-01 18:30:42 +02002AC_INIT([iptables], [1.4.12.1])
Thomas Jaroschc634cb92008-06-03 15:02:18 +02003
Jan Engelhardtdacafa52009-01-27 20:56:23 +01004# See libtool.info "Libtool's versioning system"
Jan Engelhardtf6677b52011-06-22 15:42:48 +02005libxtables_vcurrent=7
Jan Engelhardtbf971282009-11-03 19:55:11 +01006libxtables_vage=0
Jan Engelhardtdacafa52009-01-27 20:56:23 +01007
Jan Engelhardtde26cd22011-12-18 20:21:27 +01008AC_CONFIG_AUX_DIR([build-aux])
Jan Engelhardtf82070f2008-01-20 13:14:00 +00009AC_CONFIG_HEADERS([config.h])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010010AC_CONFIG_MACRO_DIR([m4])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000011AC_PROG_INSTALL
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010012AM_INIT_AUTOMAKE([-Wall])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000013AC_PROG_CC
14AM_PROG_CC_C_O
15AC_DISABLE_STATIC
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010016AM_PROG_LIBTOOL
Jan Engelhardtf82070f2008-01-20 13:14:00 +000017
Jan Engelhardtf82070f2008-01-20 13:14:00 +000018AC_ARG_WITH([kernel],
19 AS_HELP_STRING([--with-kernel=PATH],
20 [Path to kernel source/build directory]),
21 [kbuilddir="$withval"; ksourcedir="$withval";])
22AC_ARG_WITH([kbuild],
23 AS_HELP_STRING([--with-kbuild=PATH],
24 [Path to kernel build directory [[/lib/modules/CURRENT/build]]]),
25 [kbuilddir="$withval"])
26AC_ARG_WITH([ksource],
27 AS_HELP_STRING([--with-ksource=PATH],
28 [Path to kernel source directory [[/lib/modules/CURRENT/source]]]),
29 [ksourcedir="$withval"])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010030AC_ARG_WITH([xtlibdir],
31 AS_HELP_STRING([--with-xtlibdir=PATH],
Jan Engelhardtd31a6592008-02-11 14:11:14 +010032 [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]),
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010033 [xtlibdir="$withval"],
Jan Engelhardt411a4e52011-07-04 12:44:43 +020034 [xtlibdir="${libdir}/xtables"])
Jan Engelhardta094eb02009-04-03 22:37:49 +020035AC_ARG_ENABLE([ipv4],
36 AS_HELP_STRING([--disable-ipv4], [Do not build iptables]),
37 [enable_ipv4="$enableval"], [enable_ipv4="yes"])
Jan Engelhardt8e586132009-04-03 22:28:34 +020038AC_ARG_ENABLE([ipv6],
39 AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]),
40 [enable_ipv6="$enableval"], [enable_ipv6="yes"])
Karl Hiramoto967cb712010-05-10 17:50:41 +020041AC_ARG_ENABLE([largefile],
42 AS_HELP_STRING([--disable-largefile], [Do not build largefile support]),
43 [enable_largefile="$enableval"],
44 [enable_largefile="yes";
Jan Engelhardt8e336252011-06-01 02:16:05 +020045 largefile_cppflags='-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000046AC_ARG_ENABLE([devel],
47 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010048 [Install Xtables development headers]),
49 [enable_devel="$enableval"], [enable_devel="yes"])
50AC_ARG_ENABLE([libipq],
51 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardt126c1362008-08-04 18:37:38 +020052AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
53 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
54 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000055
Jan Engelhardt655ae6b2010-09-13 16:06:50 +020056libiptc_LDFLAGS2="";
57AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed],
58 [libiptc_LDFLAGS2="-Wl,--no-as-needed"])
59AC_SUBST([libiptc_LDFLAGS2])
60
Jan Engelhardt2c570e72008-06-05 19:54:48 +020061blacklist_modules="";
Hannes Ederc36d05e2010-07-23 12:51:26 +020062
Jan Engelhardt3c871012011-06-24 20:16:48 +020063AC_CHECK_HEADERS([linux/dccp.h linux/ip_vs.h linux/magic.h linux/proc_fs.h])
Jan Engelhardt2c570e72008-06-05 19:54:48 +020064if test "$ac_cv_header_linux_dccp_h" != "yes"; then
65 blacklist_modules="$blacklist_modules dccp";
66fi;
Hannes Ederc36d05e2010-07-23 12:51:26 +020067if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
68 blacklist_modules="$blacklist_modules ipvs";
69fi;
70
Jan Engelhardt2c570e72008-06-05 19:54:48 +020071AC_SUBST([blacklist_modules])
Jan Engelhardt4d8656a2011-07-22 12:25:43 +020072AC_CHECK_SIZEOF([struct ip6_hdr], [], [#include <netinet/ip6.h>])
Jan Engelhardt2c570e72008-06-05 19:54:48 +020073
Jan Engelhardtee3228a2008-06-23 11:37:08 +020074AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
75AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
Jan Engelhardta094eb02009-04-03 22:37:49 +020076AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"])
Jan Engelhardt8e586132009-04-03 22:28:34 +020077AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
Karl Hiramoto967cb712010-05-10 17:50:41 +020078AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"])
Jan Engelhardtee3228a2008-06-23 11:37:08 +020079AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
80AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000081
Jan Engelhardtdb6d0272010-03-27 12:48:55 +010082PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
83 [nfnetlink=1], [nfnetlink=0])
84AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
85
Jan Engelhardt8e336252011-06-01 02:16:05 +020086regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000087 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Jan Engelhardt8e336252011-06-01 02:16:05 +020088 -Winline -pipe";
89regular_CPPFLAGS="${largefile_cppflags} -D_REENTRANT \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010090 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardt5085c3a2011-06-01 02:20:40 +020091kinclude_CPPFLAGS="";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010092if [[ -n "$kbuilddir" ]]; then
Jan Engelhardt5085c3a2011-06-01 02:20:40 +020093 kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$kbuilddir/include";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010094fi;
95if [[ -n "$ksourcedir" ]]; then
Jan Engelhardt5085c3a2011-06-01 02:20:40 +020096 kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$ksourcedir/include";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010097fi;
Jan Engelhardtdb6d0272010-03-27 12:48:55 +010098pkgdatadir='${datadir}/xtables';
Jan Engelhardtf82070f2008-01-20 13:14:00 +000099
Jan Engelhardtb95fc082008-04-15 09:13:17 +0200100AC_SUBST([regular_CFLAGS])
Jan Engelhardt8e336252011-06-01 02:16:05 +0200101AC_SUBST([regular_CPPFLAGS])
Jan Engelhardt5085c3a2011-06-01 02:20:40 +0200102AC_SUBST([kinclude_CPPFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +0000103AC_SUBST([kbuilddir])
104AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +0100105AC_SUBST([xtlibdir])
Jan Engelhardt126c1362008-08-04 18:37:38 +0200106AC_SUBST([pkgconfigdir])
Jan Engelhardtdb6d0272010-03-27 12:48:55 +0100107AC_SUBST([pkgdatadir])
Jan Engelhardtdacafa52009-01-27 20:56:23 +0100108AC_SUBST([libxtables_vcurrent])
109AC_SUBST([libxtables_vage])
110libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
111AC_SUBST([libxtables_vmajor])
Thomas Jaroschc634cb92008-06-03 15:02:18 +0200112
Jan Engelhardtf567ac92009-02-12 15:01:37 +0100113AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
Jan Engelhardt033e25a2011-06-07 14:02:37 +0200114 iptables/Makefile iptables/xtables.pc
Jan Engelhardt4982fe42011-08-08 02:38:41 +0200115 libipq/Makefile libipq/libipq.pc
Jan Engelhardtb8c42ec2011-12-18 02:52:15 +0100116 libiptc/Makefile libiptc/libiptc.pc
117 libiptc/libip4tc.pc libiptc/libip6tc.pc
118 libxtables/Makefile utils/Makefile
Jan Engelhardt033e25a2011-06-07 14:02:37 +0200119 include/xtables.h include/iptables/internal.h])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +0100120AC_OUTPUT