blob: c94fefab3356eeac6a81c77749bee322688edc20 [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001
Patrick McHardy63fc6252010-05-21 12:48:13 +02002AC_INIT([iptables], [1.4.8])
Thomas Jaroschc634cb92008-06-03 15:02:18 +02003
Jan Engelhardtdacafa52009-01-27 20:56:23 +01004# See libtool.info "Libtool's versioning system"
Jan Engelhardt11c2dd52010-06-07 12:00:24 +02005libxtables_vcurrent=5
Jan Engelhardtbf971282009-11-03 19:55:11 +01006libxtables_vage=0
Jan Engelhardtdacafa52009-01-27 20:56:23 +01007
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"])
Karl Hiramoto967cb712010-05-10 17:50:41 +020040AC_ARG_ENABLE([largefile],
41 AS_HELP_STRING([--disable-largefile], [Do not build largefile support]),
42 [enable_largefile="$enableval"],
43 [enable_largefile="yes";
44 largefile_cflags='-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000045AC_ARG_ENABLE([devel],
46 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010047 [Install Xtables development headers]),
48 [enable_devel="$enableval"], [enable_devel="yes"])
49AC_ARG_ENABLE([libipq],
50 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardt126c1362008-08-04 18:37:38 +020051AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
52 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
53 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000054
Jan Engelhardt2c570e72008-06-05 19:54:48 +020055blacklist_modules="";
Hannes Ederc36d05e2010-07-23 12:51:26 +020056
57AC_CHECK_HEADER([linux/dccp.h])
Jan Engelhardt2c570e72008-06-05 19:54:48 +020058if test "$ac_cv_header_linux_dccp_h" != "yes"; then
59 blacklist_modules="$blacklist_modules dccp";
60fi;
Hannes Ederc36d05e2010-07-23 12:51:26 +020061
62AC_CHECK_HEADER([linux/ip_vs.h])
63if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then
64 blacklist_modules="$blacklist_modules ipvs";
65fi;
66
Jan Engelhardt2c570e72008-06-05 19:54:48 +020067AC_SUBST([blacklist_modules])
68
Jan Engelhardtee3228a2008-06-23 11:37:08 +020069AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
70AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
Jan Engelhardta094eb02009-04-03 22:37:49 +020071AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"])
Jan Engelhardt8e586132009-04-03 22:28:34 +020072AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"])
Karl Hiramoto967cb712010-05-10 17:50:41 +020073AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"])
Jan Engelhardtee3228a2008-06-23 11:37:08 +020074AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
75AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000076
Jan Engelhardtdb6d0272010-03-27 12:48:55 +010077PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0],
78 [nfnetlink=1], [nfnetlink=0])
79AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1])
80
Karl Hiramoto967cb712010-05-10 17:50:41 +020081regular_CFLAGS="${largefile_cflags} \
Jan Engelhardt7a236f42008-03-03 12:30:41 +010082 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000083 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020084 -Winline -pipe \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010085 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010086kinclude_CFLAGS="";
87if [[ -n "$kbuilddir" ]]; then
88 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
89fi;
90if [[ -n "$ksourcedir" ]]; then
91 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
92fi;
Jan Engelhardtdb6d0272010-03-27 12:48:55 +010093pkgdatadir='${datadir}/xtables';
Jan Engelhardtf82070f2008-01-20 13:14:00 +000094
Jan Engelhardtb95fc082008-04-15 09:13:17 +020095AC_SUBST([regular_CFLAGS])
96AC_SUBST([kinclude_CFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000097AC_SUBST([kbuilddir])
98AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010099AC_SUBST([xtlibdir])
Jan Engelhardt126c1362008-08-04 18:37:38 +0200100AC_SUBST([pkgconfigdir])
Jan Engelhardtdb6d0272010-03-27 12:48:55 +0100101AC_SUBST([pkgdatadir])
Jan Engelhardtdacafa52009-01-27 20:56:23 +0100102AC_SUBST([libxtables_vcurrent])
103AC_SUBST([libxtables_vage])
104libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
105AC_SUBST([libxtables_vmajor])
Thomas Jaroschc634cb92008-06-03 15:02:18 +0200106
Jan Engelhardtf567ac92009-02-12 15:01:37 +0100107AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
Jan Engelhardtdb6d0272010-03-27 12:48:55 +0100108 libipq/Makefile utils/Makefile
Jan Engelhardt51bc8362009-02-11 16:40:29 +0100109 include/xtables.h include/iptables/internal.h libiptc.pc xtables.pc])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +0100110AC_OUTPUT