blob: eefcdac9e43c8b08e512ffae9da2d0e3b62ca835 [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001
Pablo Neira Ayusoca6ccdb2009-03-24 12:54:31 +01002AC_INIT([iptables], [1.4.3.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 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 Engelhardt8e586132009-04-03 22:28:34 +020034AC_ARG_ENABLE([ipv6],
35 AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]),
36 [enable_ipv6="$enableval"], [enable_ipv6="yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000037AC_ARG_ENABLE([devel],
38 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010039 [Install Xtables development headers]),
40 [enable_devel="$enableval"], [enable_devel="yes"])
41AC_ARG_ENABLE([libipq],
42 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardt126c1362008-08-04 18:37:38 +020043AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
44 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
45 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000046
Jan Engelhardt2c570e72008-06-05 19:54:48 +020047AC_CHECK_HEADER([linux/dccp.h])
48
49blacklist_modules="";
50if test "$ac_cv_header_linux_dccp_h" != "yes"; then
51 blacklist_modules="$blacklist_modules dccp";
52fi;
53AC_SUBST([blacklist_modules])
54
Jan Engelhardtee3228a2008-06-23 11:37:08 +020055AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
56AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
Jan Engelhardt8e586132009-04-03 22:28:34 +020057AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
Jan Engelhardtee3228a2008-06-23 11:37:08 +020058AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
59AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000060
61regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
Jan Engelhardt7a236f42008-03-03 12:30:41 +010062 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000063 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020064 -Winline -pipe \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010065 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010066kinclude_CFLAGS="";
67if [[ -n "$kbuilddir" ]]; then
68 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
69fi;
70if [[ -n "$ksourcedir" ]]; then
71 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
72fi;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000073
Jan Engelhardtb95fc082008-04-15 09:13:17 +020074AC_SUBST([regular_CFLAGS])
75AC_SUBST([kinclude_CFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000076AC_SUBST([kbuilddir])
77AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010078AC_SUBST([xtlibdir])
Jan Engelhardt126c1362008-08-04 18:37:38 +020079AC_SUBST([pkgconfigdir])
Jan Engelhardtdacafa52009-01-27 20:56:23 +010080AC_SUBST([libxtables_vcurrent])
81AC_SUBST([libxtables_vage])
82libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
83AC_SUBST([libxtables_vmajor])
Thomas Jaroschc634cb92008-06-03 15:02:18 +020084
Jan Engelhardtf567ac92009-02-12 15:01:37 +010085AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
86 libipq/Makefile
Jan Engelhardt51bc8362009-02-11 16:40:29 +010087 include/xtables.h include/iptables/internal.h libiptc.pc xtables.pc])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010088AC_OUTPUT