Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 1 | |
Patrick McHardy | c960bde | 2011-06-08 15:26:17 +0200 | [diff] [blame] | 2 | AC_INIT([iptables], [1.4.11.1]) |
Thomas Jarosch | c634cb9 | 2008-06-03 15:02:18 +0200 | [diff] [blame] | 3 | |
Jan Engelhardt | dacafa5 | 2009-01-27 20:56:23 +0100 | [diff] [blame] | 4 | # See libtool.info "Libtool's versioning system" |
Jan Engelhardt | 3a32dcb | 2011-04-14 13:34:18 +0200 | [diff] [blame] | 5 | libxtables_vcurrent=6 |
Jan Engelhardt | bf97128 | 2009-11-03 19:55:11 +0100 | [diff] [blame] | 6 | libxtables_vage=0 |
Jan Engelhardt | dacafa5 | 2009-01-27 20:56:23 +0100 | [diff] [blame] | 7 | |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 8 | AC_CONFIG_HEADERS([config.h]) |
Jan Engelhardt | 0086b8b | 2009-01-07 15:11:59 +0100 | [diff] [blame] | 9 | AC_CONFIG_MACRO_DIR([m4]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 10 | AC_PROG_INSTALL |
Jan Engelhardt | 0086b8b | 2009-01-07 15:11:59 +0100 | [diff] [blame] | 11 | AM_INIT_AUTOMAKE([-Wall]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 12 | AC_PROG_CC |
| 13 | AM_PROG_CC_C_O |
| 14 | AC_DISABLE_STATIC |
Jan Engelhardt | 0086b8b | 2009-01-07 15:11:59 +0100 | [diff] [blame] | 15 | AM_PROG_LIBTOOL |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 16 | |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 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"]) |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 29 | AC_ARG_WITH([xtlibdir], |
| 30 | AS_HELP_STRING([--with-xtlibdir=PATH], |
Jan Engelhardt | d31a659 | 2008-02-11 14:11:14 +0100 | [diff] [blame] | 31 | [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]), |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 32 | [xtlibdir="$withval"], |
Jan Engelhardt | d31a659 | 2008-02-11 14:11:14 +0100 | [diff] [blame] | 33 | [xtlibdir="${libexecdir}/xtables"]) |
Jan Engelhardt | a094eb0 | 2009-04-03 22:37:49 +0200 | [diff] [blame] | 34 | AC_ARG_ENABLE([ipv4], |
| 35 | AS_HELP_STRING([--disable-ipv4], [Do not build iptables]), |
| 36 | [enable_ipv4="$enableval"], [enable_ipv4="yes"]) |
Jan Engelhardt | 8e58613 | 2009-04-03 22:28:34 +0200 | [diff] [blame] | 37 | AC_ARG_ENABLE([ipv6], |
| 38 | AS_HELP_STRING([--disable-ipv6], [Do not build ip6tables]), |
| 39 | [enable_ipv6="$enableval"], [enable_ipv6="yes"]) |
Karl Hiramoto | 967cb71 | 2010-05-10 17:50:41 +0200 | [diff] [blame] | 40 | AC_ARG_ENABLE([largefile], |
| 41 | AS_HELP_STRING([--disable-largefile], [Do not build largefile support]), |
| 42 | [enable_largefile="$enableval"], |
| 43 | [enable_largefile="yes"; |
Jan Engelhardt | 8e33625 | 2011-06-01 02:16:05 +0200 | [diff] [blame] | 44 | largefile_cppflags='-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64']) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 45 | AC_ARG_ENABLE([devel], |
| 46 | AS_HELP_STRING([--enable-devel], |
Jan Engelhardt | 77f1538 | 2008-02-11 15:01:03 +0100 | [diff] [blame] | 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])) |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 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']) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 54 | |
Jan Engelhardt | 655ae6b | 2010-09-13 16:06:50 +0200 | [diff] [blame] | 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 | |
Jan Engelhardt | 2c570e7 | 2008-06-05 19:54:48 +0200 | [diff] [blame] | 60 | blacklist_modules=""; |
Hannes Eder | c36d05e | 2010-07-23 12:51:26 +0200 | [diff] [blame] | 61 | |
| 62 | AC_CHECK_HEADER([linux/dccp.h]) |
Jan Engelhardt | 2c570e7 | 2008-06-05 19:54:48 +0200 | [diff] [blame] | 63 | if test "$ac_cv_header_linux_dccp_h" != "yes"; then |
| 64 | blacklist_modules="$blacklist_modules dccp"; |
| 65 | fi; |
Hannes Eder | c36d05e | 2010-07-23 12:51:26 +0200 | [diff] [blame] | 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 | |
Jan Engelhardt | 2c570e7 | 2008-06-05 19:54:48 +0200 | [diff] [blame] | 72 | AC_SUBST([blacklist_modules]) |
| 73 | |
Jan Engelhardt | ee3228a | 2008-06-23 11:37:08 +0200 | [diff] [blame] | 74 | AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"]) |
| 75 | AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"]) |
Jan Engelhardt | a094eb0 | 2009-04-03 22:37:49 +0200 | [diff] [blame] | 76 | AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"]) |
Jan Engelhardt | 8e58613 | 2009-04-03 22:28:34 +0200 | [diff] [blame] | 77 | AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"]) |
Karl Hiramoto | 967cb71 | 2010-05-10 17:50:41 +0200 | [diff] [blame] | 78 | AM_CONDITIONAL([ENABLE_LARGEFILE], [test "$enable_largefile" = "yes"]) |
Jan Engelhardt | ee3228a | 2008-06-23 11:37:08 +0200 | [diff] [blame] | 79 | AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"]) |
| 80 | AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 81 | |
Jan Engelhardt | db6d027 | 2010-03-27 12:48:55 +0100 | [diff] [blame] | 82 | PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], |
| 83 | [nfnetlink=1], [nfnetlink=0]) |
| 84 | AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) |
| 85 | |
Jan Engelhardt | 8e33625 | 2011-06-01 02:16:05 +0200 | [diff] [blame] | 86 | regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 87 | -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ |
Jan Engelhardt | 8e33625 | 2011-06-01 02:16:05 +0200 | [diff] [blame] | 88 | -Winline -pipe"; |
| 89 | regular_CPPFLAGS="${largefile_cppflags} -D_REENTRANT \ |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 90 | -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL"; |
Jan Engelhardt | 5085c3a | 2011-06-01 02:20:40 +0200 | [diff] [blame] | 91 | kinclude_CPPFLAGS=""; |
Jan Engelhardt | ca7cd66 | 2008-02-11 01:23:01 +0100 | [diff] [blame] | 92 | if [[ -n "$kbuilddir" ]]; then |
Jan Engelhardt | 5085c3a | 2011-06-01 02:20:40 +0200 | [diff] [blame] | 93 | kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$kbuilddir/include"; |
Jan Engelhardt | ca7cd66 | 2008-02-11 01:23:01 +0100 | [diff] [blame] | 94 | fi; |
| 95 | if [[ -n "$ksourcedir" ]]; then |
Jan Engelhardt | 5085c3a | 2011-06-01 02:20:40 +0200 | [diff] [blame] | 96 | kinclude_CPPFLAGS="$kinclude_CPPFLAGS -I$ksourcedir/include"; |
Jan Engelhardt | ca7cd66 | 2008-02-11 01:23:01 +0100 | [diff] [blame] | 97 | fi; |
Jan Engelhardt | db6d027 | 2010-03-27 12:48:55 +0100 | [diff] [blame] | 98 | pkgdatadir='${datadir}/xtables'; |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 99 | |
Jan Engelhardt | b95fc08 | 2008-04-15 09:13:17 +0200 | [diff] [blame] | 100 | AC_SUBST([regular_CFLAGS]) |
Jan Engelhardt | 8e33625 | 2011-06-01 02:16:05 +0200 | [diff] [blame] | 101 | AC_SUBST([regular_CPPFLAGS]) |
Jan Engelhardt | 5085c3a | 2011-06-01 02:20:40 +0200 | [diff] [blame] | 102 | AC_SUBST([kinclude_CPPFLAGS]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 103 | AC_SUBST([kbuilddir]) |
| 104 | AC_SUBST([ksourcedir]) |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 105 | AC_SUBST([xtlibdir]) |
Jan Engelhardt | 126c136 | 2008-08-04 18:37:38 +0200 | [diff] [blame] | 106 | AC_SUBST([pkgconfigdir]) |
Jan Engelhardt | db6d027 | 2010-03-27 12:48:55 +0100 | [diff] [blame] | 107 | AC_SUBST([pkgdatadir]) |
Jan Engelhardt | dacafa5 | 2009-01-27 20:56:23 +0100 | [diff] [blame] | 108 | AC_SUBST([libxtables_vcurrent]) |
| 109 | AC_SUBST([libxtables_vage]) |
| 110 | libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage)); |
| 111 | AC_SUBST([libxtables_vmajor]) |
Thomas Jarosch | c634cb9 | 2008-06-03 15:02:18 +0200 | [diff] [blame] | 112 | |
Jan Engelhardt | f567ac9 | 2009-02-12 15:01:37 +0100 | [diff] [blame] | 113 | AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile |
Jan Engelhardt | 033e25a | 2011-06-07 14:02:37 +0200 | [diff] [blame] | 114 | iptables/Makefile iptables/xtables.pc |
Jan Engelhardt | 5c8f5b6 | 2011-06-07 11:42:03 +0200 | [diff] [blame] | 115 | libipq/Makefile libiptc/Makefile libiptc/libiptc.pc utils/Makefile |
Jan Engelhardt | 033e25a | 2011-06-07 14:02:37 +0200 | [diff] [blame] | 116 | include/xtables.h include/iptables/internal.h]) |
Jan Engelhardt | 0086b8b | 2009-01-07 15:11:59 +0100 | [diff] [blame] | 117 | AC_OUTPUT |