1 2 AC_INIT([iptables], [1.4.11.1]) 3 4 # See libtool.info "Libtool's versioning system" 5 libxtables_vcurrent=6 6 libxtables_vage=0 7 8 AC_CONFIG_HEADERS([config.h]) 9 AC_CONFIG_MACRO_DIR([m4]) 10 AC_PROG_INSTALL 11 AM_INIT_AUTOMAKE([-Wall]) 12 AC_PROG_CC 13 AM_PROG_CC_C_O 14 AC_DISABLE_STATIC 15 AM_PROG_LIBTOOL 16 17 AC_ARG_WITH([kernel], 18 AS_HELP_STRING([--with-kernel=PATH], 19 [Path to kernel source/build directory]), 20 [kbuilddir="$withval"; ksourcedir="$withval";]) 21 AC_ARG_WITH([kbuild], 22 AS_HELP_STRING([--with-kbuild=PATH], 23 [Path to kernel build directory [[/lib/modules/CURRENT/build]]]), 24 [kbuilddir="$withval"]) 25 AC_ARG_WITH([ksource], 26 AS_HELP_STRING([--with-ksource=PATH], 27 [Path to kernel source directory [[/lib/modules/CURRENT/source]]]), 28 [ksourcedir="$withval"]) 29 AC_ARG_WITH([xtlibdir], 30 AS_HELP_STRING([--with-xtlibdir=PATH], 31 [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]), 32 [xtlibdir="$withval"], 33 [xtlibdir="${libexecdir}/xtables"]) 34 AC_ARG_ENABLE([ipv4], 35 AS_HELP_STRING([--disable-ipv4], [Do not build iptables]), 36 [enable_ipv4="$enableval"], [enable_ipv4="yes"]) 37 AC_ARG_ENABLE([ipv6], 38 AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]), 39 [enable_ipv6="$enableval"], [enable_ipv6="yes"]) 40 AC_ARG_ENABLE([largefile], 41 AS_HELP_STRING([--disable-largefile], [Do not build largefile support]), 42 [enable_largefile="$enableval"], 43 [enable_largefile="yes"; 44 largefile_cppflags='-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64']) 45 AC_ARG_ENABLE([devel], 46 AS_HELP_STRING([--enable-devel], 47 [Install Xtables development headers]), 48 [enable_devel="$enableval"], [enable_devel="yes"]) 49 AC_ARG_ENABLE([libipq], 50 AS_HELP_STRING([--enable-libipq], [Build and install libipq])) 51 AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], 52 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), 53 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) 54 55 libiptc_LDFLAGS2=""; 56 AX_CHECK_LINKER_FLAGS([-Wl,--no-as-needed], 57 [libiptc_LDFLAGS2="-Wl,--no-as-needed"]) 58 AC_SUBST([libiptc_LDFLAGS2]) 59 60 blacklist_modules=""; 61 62 AC_CHECK_HEADER([linux/dccp.h]) 63 if test "$ac_cv_header_linux_dccp_h" != "yes"; then 64 blacklist_modules="$blacklist_modules dccp"; 65 fi; 66 67 AC_CHECK_HEADER([linux/ip_vs.h]) 68 if test "$ac_cv_header_linux_ip_vs_h" != "yes"; then 69 blacklist_modules="$blacklist_modules ipvs"; 70 fi; 71 72 AC_SUBST([blacklist_modules]) 73 74 AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"]) 75 AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"]) 76 AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"]) 77 AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"]) 78 AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"]) 79 AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"]) 80 AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"]) 81 82 PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], 83 [nfnetlink=1], [nfnetlink=0]) 84 AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) 85 86 regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ 87 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ 88 -Winline -pipe"; 89 regular_CPPFLAGS="${largefile_cppflags} -D_REENTRANT \ 90 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL"; 91 kinclude_CPPFLAGS=""; 92 if [[ -n "$kbuilddir" ]]; then 93 kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$kbuilddir/include"; 94 fi; 95 if [[ -n "$ksourcedir" ]]; then 96 kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$ksourcedir/include"; 97 fi; 98 pkgdatadir='${datadir}/xtables'; 99 100 AC_SUBST([regular_CFLAGS]) 101 AC_SUBST([regular_CPPFLAGS]) 102 AC_SUBST([kinclude_CPPFLAGS]) 103 AC_SUBST([kbuilddir]) 104 AC_SUBST([ksourcedir]) 105 AC_SUBST([xtlibdir]) 106 AC_SUBST([pkgconfigdir]) 107 AC_SUBST([pkgdatadir]) 108 AC_SUBST([libxtables_vcurrent]) 109 AC_SUBST([libxtables_vage]) 110 libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage)); 111 AC_SUBST([libxtables_vmajor]) 112 113 AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile 114 iptables/Makefile iptables/xtables.pc 115 libipq/Makefile libiptc/Makefile libiptc/libiptc.pc utils/Makefile 116 include/xtables.h include/iptables/internal.h]) 117 AC_OUTPUT 118