lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame] | 1 | |
| 2 | AC_INIT([iptables], [1.4.3.2]) |
| 3 | |
| 4 | # See libtool.info "Libtool's versioning system" |
| 5 | libxtables_vcurrent=2 |
| 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([devel], |
| 41 | AS_HELP_STRING([--enable-devel], |
| 42 | [Install Xtables development headers]), |
| 43 | [enable_devel="$enableval"], [enable_devel="yes"]) |
| 44 | AC_ARG_ENABLE([libipq], |
| 45 | AS_HELP_STRING([--enable-libipq], [Build and install libipq])) |
| 46 | AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH], |
| 47 | [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]), |
| 48 | [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig']) |
| 49 | |
| 50 | AC_CHECK_HEADER([linux/dccp.h]) |
| 51 | |
| 52 | blacklist_modules=""; |
| 53 | if test "$ac_cv_header_linux_dccp_h" != "yes"; then |
| 54 | blacklist_modules="$blacklist_modules dccp"; |
| 55 | fi; |
| 56 | AC_SUBST([blacklist_modules]) |
| 57 | |
| 58 | AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"]) |
| 59 | AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"]) |
| 60 | AM_CONDITIONAL([ENABLE_IPV4], [test "$enable_ipv4" = "yes"]) |
| 61 | AM_CONDITIONAL([ENABLE_IPV6], [test "$enable_ipv6" = "yes"]) |
| 62 | AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"]) |
| 63 | AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"]) |
| 64 | |
| 65 | regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \ |
| 66 | -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \ |
| 67 | -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ |
| 68 | -Winline -pipe \ |
| 69 | -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL"; |
| 70 | kinclude_CFLAGS=""; |
| 71 | if [[ "$enable_static" = yes ]]; then |
| 72 | regular_CFLAGS="$regular_CFLAGS -DNO_SHARED_LIBS=1"; |
| 73 | fi |
| 74 | if [[ -n "$kbuilddir" ]]; then |
| 75 | kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include"; |
| 76 | fi; |
| 77 | if [[ -n "$ksourcedir" ]]; then |
| 78 | kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include"; |
| 79 | fi; |
| 80 | |
| 81 | AC_SUBST([regular_CFLAGS]) |
| 82 | AC_SUBST([kinclude_CFLAGS]) |
| 83 | AC_SUBST([kbuilddir]) |
| 84 | AC_SUBST([ksourcedir]) |
| 85 | AC_SUBST([xtlibdir]) |
| 86 | AC_SUBST([pkgconfigdir]) |
| 87 | AC_SUBST([libxtables_vcurrent]) |
| 88 | AC_SUBST([libxtables_vage]) |
| 89 | libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage)); |
| 90 | AC_SUBST([libxtables_vmajor]) |
| 91 | |
| 92 | AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile |
| 93 | libipq/Makefile |
| 94 | include/xtables.h include/iptables/internal.h libiptc.pc xtables.pc]) |
| 95 | AC_OUTPUT |