]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
Build and source kernel directories v5.0-pre9
authorJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 25 Oct 2010 20:44:31 +0000 (22:44 +0200)
committerJozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Mon, 25 Oct 2010 20:44:31 +0000 (22:44 +0200)
Fall back to the build directory if the source directory is not specified.
Check that it looks like as a source directory.

configure.ac

index 0bff3326b1244addeb3837627e5ae2f56a911ec1..38164cf2e5465316f488e7a13a70544effcb765d 100644 (file)
@@ -19,7 +19,7 @@ AC_ARG_WITH([kbuild],
             [KBUILDDIR="$withval";])
 AC_ARG_WITH([ksource],
             AS_HELP_STRING([--with-ksource=PATH],
-                           [Path to kernel source directory]),
+                           [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)
@@ -34,9 +34,15 @@ fi
 
 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 source directory $ksourcedir])
+fi
 
 if test ! -e "$kbuilddir/.config"
 then