Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 1 | |
Pablo Neira Ayuso | e6403fd | 2008-03-02 13:40:26 +0100 | [diff] [blame] | 2 | AC_INIT([iptables], [1.4.1]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 3 | AC_CONFIG_HEADERS([config.h]) |
| 4 | AC_PROG_INSTALL |
| 5 | AM_INIT_AUTOMAKE |
| 6 | AC_PROG_CC |
| 7 | AM_PROG_CC_C_O |
| 8 | AC_DISABLE_STATIC |
| 9 | AC_PROG_LIBTOOL |
| 10 | |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 11 | AC_ARG_WITH([kernel], |
| 12 | AS_HELP_STRING([--with-kernel=PATH], |
| 13 | [Path to kernel source/build directory]), |
| 14 | [kbuilddir="$withval"; ksourcedir="$withval";]) |
| 15 | AC_ARG_WITH([kbuild], |
| 16 | AS_HELP_STRING([--with-kbuild=PATH], |
| 17 | [Path to kernel build directory [[/lib/modules/CURRENT/build]]]), |
| 18 | [kbuilddir="$withval"]) |
| 19 | AC_ARG_WITH([ksource], |
| 20 | AS_HELP_STRING([--with-ksource=PATH], |
| 21 | [Path to kernel source directory [[/lib/modules/CURRENT/source]]]), |
| 22 | [ksourcedir="$withval"]) |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 23 | AC_ARG_WITH([xtlibdir], |
| 24 | AS_HELP_STRING([--with-xtlibdir=PATH], |
Jan Engelhardt | d31a659 | 2008-02-11 14:11:14 +0100 | [diff] [blame] | 25 | [Path where to install Xtables extensions [[LIBEXECDIR/xtables]]]), |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 26 | [xtlibdir="$withval"], |
Jan Engelhardt | d31a659 | 2008-02-11 14:11:14 +0100 | [diff] [blame] | 27 | [xtlibdir="${libexecdir}/xtables"]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 28 | AC_ARG_ENABLE([devel], |
| 29 | AS_HELP_STRING([--enable-devel], |
Jan Engelhardt | 77f1538 | 2008-02-11 15:01:03 +0100 | [diff] [blame] | 30 | [Install Xtables development headers]), |
| 31 | [enable_devel="$enableval"], [enable_devel="yes"]) |
| 32 | AC_ARG_ENABLE([libipq], |
| 33 | AS_HELP_STRING([--enable-libipq], [Build and install libipq])) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 34 | |
| 35 | AC_CHECK_HEADER([netinet/ip6.h], [], [AC_MSG_ERROR(but we need that for IPv6)]) |
| 36 | AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" == "yes"]) |
| 37 | AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" == "yes"]) |
| 38 | AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" == "yes"]) |
Jan Engelhardt | 77f1538 | 2008-02-11 15:01:03 +0100 | [diff] [blame] | 39 | AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" == "yes"]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 40 | |
| 41 | regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \ |
Jan Engelhardt | 7a236f4 | 2008-03-03 12:30:41 +0100 | [diff] [blame] | 42 | -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \ |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 43 | -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ |
Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame^] | 44 | -Winline -pipe \ |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 45 | -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL"; |
Jan Engelhardt | ca7cd66 | 2008-02-11 01:23:01 +0100 | [diff] [blame] | 46 | kinclude_CFLAGS=""; |
| 47 | if [[ -n "$kbuilddir" ]]; then |
| 48 | kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include"; |
| 49 | fi; |
| 50 | if [[ -n "$ksourcedir" ]]; then |
| 51 | kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include"; |
| 52 | fi; |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 53 | |
Jan Engelhardt | b95fc08 | 2008-04-15 09:13:17 +0200 | [diff] [blame] | 54 | AC_SUBST([regular_CFLAGS]) |
| 55 | AC_SUBST([kinclude_CFLAGS]) |
Jan Engelhardt | f82070f | 2008-01-20 13:14:00 +0000 | [diff] [blame] | 56 | AC_SUBST([kbuilddir]) |
| 57 | AC_SUBST([ksourcedir]) |
Jan Engelhardt | 21b41ee | 2008-02-11 01:02:00 +0100 | [diff] [blame] | 58 | AC_SUBST([xtlibdir]) |
Jan Engelhardt | 493c712 | 2008-04-15 11:15:16 +0200 | [diff] [blame] | 59 | AC_OUTPUT([Makefile extensions/GNUmakefile libipq/Makefile include/xtables.h]) |