From 9bff2f93cbea33842229b6c2f150cb76ff53d8e0 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Oct 2010 11:02:26 +0200 Subject: build: resolve autoreconf/libtoolize suggestions libtoolize: Consider adding "AC_CONFIG_MACRO_DIR([m4])" to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. libtoolize: Consider adding "-I m4" to ACLOCAL_AMFLAGS in Makefile.am. Signed-off-by: Jan Engelhardt --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 7622ac4..34f0889 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,7 @@ dnl Boilerplate AC_INIT([ipset], [5.0], [kadlec@blackhole.kfki.hu]) AC_CANONICAL_SYSTEM +AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE([-Wall -Werror foreign]) -- cgit v1.2.3 From d6484ee2f3b256ec2a011bad383175388fd4ee05 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Oct 2010 12:51:38 +0200 Subject: build: add separate option for kernel source directory The build directory is not necessarily the same as the source directory. Signed-off-by: Jan Engelhardt --- configure.ac | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 34f0889..906ef84 100644 --- a/configure.ac +++ b/configure.ac @@ -13,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]), + [KSOURCEDIR="$withval";]) AM_CONDITIONAL(WITH_KBUILDDIR, test "$KBUILDDIR" != "") AC_SUBST(KBUILDDIR) @@ -28,9 +32,10 @@ else kbuilddir="/lib/modules/`uname -r`/build" fi -if test ! -e "$kbuilddir/include/linux/netfilter/nfnetlink.h" -then - AC_MSG_ERROR([Invalid kernel build directory $kbuilddir]) +if test -n "$KSOURCEDIR"; then + ksourcedir="$KSOURCEDIR" +else + ksourcedir="/lib/modules/$(uname -r)/source" fi if test ! -e "$kbuilddir/.config" @@ -46,11 +51,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 -- cgit v1.2.3 From 7607e809e947dbdc89de84cbad960e5aa0accc91 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Oct 2010 16:02:04 +0200 Subject: build: use libmnl's pkgconfig files libmnl installs .pc files that we can directly use and which are preferable over AC_CHECK_LIB. Also make sure that libipset.so is linked with libmnl, otherwise linking errors can ensue when a program tries to link to libipset. Furthermore, remove the now-unused LIBS variable. Signed-off-by: Jan Engelhardt --- configure.ac | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 906ef84..99129ea 100644 --- a/configure.ac +++ b/configure.ac @@ -109,10 +109,7 @@ 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 From 6fd3b2350dae31d16166d66e7e143f78b5d5b6e3 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Oct 2010 18:01:19 +0200 Subject: build: use subdir-objects and CC_C_O Signed-off-by: Jan Engelhardt --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 99129ea..b86ec14 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_INIT([ipset], [5.0], [kadlec@blackhole.kfki.hu]) AC_CANONICAL_SYSTEM 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 @@ -104,6 +104,7 @@ AM_CONDITIONAL([DISABLE_EXTRA_FLAGS], [test "x$extra_flags" = xno]) dnl Checks for programs AC_PROG_CC +AM_PROG_CC_C_O AC_PROG_LIBTOOL AC_PROG_INSTALL AC_PROG_LN_S -- cgit v1.2.3 From 554784c070ba034a2a5dae867480f91ec242a27a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Oct 2010 18:03:03 +0200 Subject: build: run autoupdate AC_CANONICAL_SYSTEM is deprecated in favor of calling one or more of AC_CANONICAL_{BUILD,HOST,TARGET}. Since configure.ac only uses $target, only AC_CANONICAL_TARGET is needed. Signed-off-by: Jan Engelhardt --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index b86ec14..0bff332 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ 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 subdir-objects]) @@ -105,7 +105,7 @@ AM_CONDITIONAL([DISABLE_EXTRA_FLAGS], [test "x$extra_flags" = xno]) dnl Checks for programs AC_PROG_CC AM_PROG_CC_C_O -AC_PROG_LIBTOOL +LT_INIT AC_PROG_INSTALL AC_PROG_LN_S -- cgit v1.2.3