blob: 656bd372224de9767ca75eb47acac1af52efc3f7 [file] [log] [blame]
Jan Engelhardtf82070f2008-01-20 13:14:00 +00001
Pablo Neira Ayusoca6ccdb2009-03-24 12:54:31 +01002AC_INIT([iptables], [1.4.3.1])
Thomas Jaroschc634cb92008-06-03 15:02:18 +02003
Jan Engelhardtdacafa52009-01-27 20:56:23 +01004# See libtool.info "Libtool's versioning system"
Jan Engelhardtc4edfa62009-03-30 00:44:46 +02005libxtables_vcurrent=2
Jan Engelhardtdacafa52009-01-27 20:56:23 +01006libxtables_vage=0
7
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 Engelhardtf82070f2008-01-20 13:14:00 +000034AC_ARG_ENABLE([devel],
35 AS_HELP_STRING([--enable-devel],
Jan Engelhardt77f15382008-02-11 15:01:03 +010036 [Install Xtables development headers]),
37 [enable_devel="$enableval"], [enable_devel="yes"])
38AC_ARG_ENABLE([libipq],
39 AS_HELP_STRING([--enable-libipq], [Build and install libipq]))
Jan Engelhardt126c1362008-08-04 18:37:38 +020040AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=PATH],
41 [Path to the pkgconfig directory [[LIBDIR/pkgconfig]]]),
42 [pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000043
Jan Engelhardt2c570e72008-06-05 19:54:48 +020044AC_CHECK_HEADER([linux/dccp.h])
45
46blacklist_modules="";
47if test "$ac_cv_header_linux_dccp_h" != "yes"; then
48 blacklist_modules="$blacklist_modules dccp";
49fi;
50AC_SUBST([blacklist_modules])
51
Jan Engelhardtee3228a2008-06-23 11:37:08 +020052AM_CONDITIONAL([ENABLE_STATIC], [test "$enable_static" = "yes"])
53AM_CONDITIONAL([ENABLE_SHARED], [test "$enable_shared" = "yes"])
54AM_CONDITIONAL([ENABLE_DEVEL], [test "$enable_devel" = "yes"])
55AM_CONDITIONAL([ENABLE_LIBIPQ], [test "$enable_libipq" = "yes"])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000056
57regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
Jan Engelhardt7a236f42008-03-03 12:30:41 +010058 -D_REENTRANT -Wall -Waggregate-return -Wmissing-declarations \
Jan Engelhardtf82070f2008-01-20 13:14:00 +000059 -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
Jan Engelhardt8b7c64d2008-04-15 11:48:25 +020060 -Winline -pipe \
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010061 -DXTABLES_LIBDIR=\\\"\${xtlibdir}\\\" -DXTABLES_INTERNAL";
Jan Engelhardtca7cd662008-02-11 01:23:01 +010062kinclude_CFLAGS="";
63if [[ -n "$kbuilddir" ]]; then
64 kinclude_CFLAGS="$kinclude_CFLAGS -I $kbuilddir/include";
65fi;
66if [[ -n "$ksourcedir" ]]; then
67 kinclude_CFLAGS="$kinclude_CFLAGS -I $ksourcedir/include";
68fi;
Jan Engelhardtf82070f2008-01-20 13:14:00 +000069
Jan Engelhardtb95fc082008-04-15 09:13:17 +020070AC_SUBST([regular_CFLAGS])
71AC_SUBST([kinclude_CFLAGS])
Jan Engelhardtf82070f2008-01-20 13:14:00 +000072AC_SUBST([kbuilddir])
73AC_SUBST([ksourcedir])
Jan Engelhardt21b41ee2008-02-11 01:02:00 +010074AC_SUBST([xtlibdir])
Jan Engelhardt126c1362008-08-04 18:37:38 +020075AC_SUBST([pkgconfigdir])
Jan Engelhardtdacafa52009-01-27 20:56:23 +010076AC_SUBST([libxtables_vcurrent])
77AC_SUBST([libxtables_vage])
78libxtables_vmajor=$(($libxtables_vcurrent - $libxtables_vage));
79AC_SUBST([libxtables_vmajor])
Thomas Jaroschc634cb92008-06-03 15:02:18 +020080
Jan Engelhardtf567ac92009-02-12 15:01:37 +010081AC_CONFIG_FILES([Makefile extensions/GNUmakefile include/Makefile
82 libipq/Makefile
Jan Engelhardt51bc8362009-02-11 16:40:29 +010083 include/xtables.h include/iptables/internal.h libiptc.pc xtables.pc])
Jan Engelhardt0086b8b2009-01-07 15:11:59 +010084AC_OUTPUT