From 0d32c5c070f817229110f92d7b31df9a3e4eeec5 Mon Sep 17 00:00:00 2001 From: Jozsef Kadlecsik Date: Sun, 24 Oct 2010 21:42:48 +0200 Subject: Fixes, cleanups, comments - More comments added to the code - ICMP and ICMPv6 support added to the hash:ip,port, hash:ip,port,ip and hash:ip,port,net types - hash:net and hash:ip,port,net types are reworked - hash:net,port type added - Wrong direction parameters fixed in hash:ip,port - Helps and manpage are updated - More tests added - Ugly macros are rewritten to functions in parse.c (Holger Eitzenberger) - resize related bug in hash types fixed (Holger Eitzenberger) - autoreconf patches by Jan Engelhardt applied - netlink patch minimalized: dumping can be initialized by a second parsing of the message (thanks to David and Patrick for the suggestion) - IPv4/IPv6 address attributes are introduced in order to fix the context (suggested by David) --- configure.ac | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7622ac4..38164cf 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,9 @@ dnl Boilerplate AC_INIT([ipset], [5.0], [kadlec@blackhole.kfki.hu]) -AC_CANONICAL_SYSTEM +AC_CANONICAL_TARGET +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER([config.h]) -AM_INIT_AUTOMAKE([-Wall -Werror foreign]) +AM_INIT_AUTOMAKE([-Wall -Werror foreign subdir-objects]) dnl Shortcut: Linux supported alone case $target in @@ -12,10 +13,14 @@ esac dnl Additional arguments dnl Kernel build directory or source tree -AC_ARG_WITH([kernel], - AS_HELP_STRING([--with-kernel=PATH], - [Path to kernel source/build directory]), - [KBUILDDIR="$withval";]) +AC_ARG_WITH([kbuild], + AS_HELP_STRING([--with-kbuild=PATH], + [Path to kernel build directory]), + [KBUILDDIR="$withval";]) +AC_ARG_WITH([ksource], + AS_HELP_STRING([--with-ksource=PATH], + [Path to kernel source directory, if not the same as the kernel build directory]), + [KSOURCEDIR="$withval";]) AM_CONDITIONAL(WITH_KBUILDDIR, test "$KBUILDDIR" != "") AC_SUBST(KBUILDDIR) @@ -27,9 +32,16 @@ else kbuilddir="/lib/modules/`uname -r`/build" fi -if test ! -e "$kbuilddir/include/linux/netfilter/nfnetlink.h" +if test -n "$KSOURCEDIR"; then + ksourcedir="$KSOURCEDIR" +elif test -e "$kbuilddir/include/linux/netfilter/nfnetlink.h"; then + ksourcedir="$kbuilddir" +else + ksourcedir="/lib/modules/$(uname -r)/source" +fi +if test ! -e "$ksourcedir/include/linux/netfilter/nfnetlink.h" then - AC_MSG_ERROR([Invalid kernel build directory $kbuilddir]) + AC_MSG_ERROR([Invalid kernel source directory $ksourcedir]) fi if test ! -e "$kbuilddir/.config" @@ -45,11 +57,11 @@ then fi dnl Check kernel dependencies: nfnetlink.h -NFNL_CB_CONST="`./check_const $kbuilddir/include/linux/netfilter/nfnetlink.h`" +NFNL_CB_CONST="`./check_const $ksourcedir/include/linux/netfilter/nfnetlink.h`" AC_SUBST(NFNL_CB_CONST) dnl Check kernel dependencies: netlink.h -NETLINK_DUMP_CONST="`./check_const $kbuilddir/include/linux/netlink.h`" +NETLINK_DUMP_CONST="`./check_const $ksourcedir/include/linux/netlink.h`" AC_SUBST(NETLINK_DUMP_CONST) dnl Maximal number of sets supported by the kernel, default 256 @@ -98,15 +110,13 @@ AM_CONDITIONAL([DISABLE_EXTRA_FLAGS], [test "x$extra_flags" = xno]) dnl Checks for programs AC_PROG_CC -AC_PROG_LIBTOOL +AM_PROG_CC_C_O +LT_INIT AC_PROG_INSTALL AC_PROG_LN_S dnl Checks for libraries -AC_CHECK_LIB([mnl], [mnl_socket_open]) -if test x"${ac_cv_lib_mnl_mnl_socket_open}" = xno; then - AC_MSG_ERROR(libmnl not found) -fi +PKG_CHECK_MODULES([libmnl], [libmnl >= 1]) dnl Checks for header files -- cgit v1.2.3