diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-10-19 12:51:38 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-10-19 12:51:38 +0200 |
commit | d6484ee2f3b256ec2a011bad383175388fd4ee05 (patch) | |
tree | 226e7be552be4b02ed94397fb3e468f3559ebaa2 | |
parent | 9bff2f93cbea33842229b6c2f150cb76ff53d8e0 (diff) |
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 <jengelh@medozas.de>
-rw-r--r-- | configure.ac | 23 |
1 files changed, 14 insertions, 9 deletions
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 |