Check kernel source directory for SPL
authorRichard Yao <ryao@cs.stonybrook.edu>
Sat, 25 Aug 2012 22:32:54 +0000 (18:32 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sun, 26 Aug 2012 20:49:09 +0000 (13:49 -0700)
ZFS fails to build when SPL is built into the kernel on unless
--with-spl=/path/to/kernel/sources is specified. We fallback to the
kernel sources directory when SPL is not found elsewhere to resolve
that.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closed #896

config/kernel.m4
configure

index c08b6a2..efb408c 100644 (file)
@@ -302,6 +302,13 @@ AC_DEFUN([ZFS_AC_SPL], [
                        sourcelink=../spl
                ])
 
+               dnl #
+               dnl # Look in the kernel directory
+               dnl #
+               AS_IF([test -z "$sourcelink" || test ! -e $sourcelink/spl_config.h], [
+                       sourcelink="$LINUX"
+               ])
+
                AS_IF([test -e $sourcelink/spl_config.h], [
                        splsrc=`readlink -f ${sourcelink}`
                ], [
index 83fc2a8..714aaad 100755 (executable)
--- a/configure
+++ b/configure
 fi
 
 
+                                                               if test -z "$sourcelink" || test ! -e $sourcelink/spl_config.h; then
+
+                       sourcelink="$LINUX"
+
+fi
+
+
                if test -e $sourcelink/spl_config.h; then
 
                        splsrc=`readlink -f ${sourcelink}`
 fi
 
 
+                                                               if test -z "$sourcelink" || test ! -e $sourcelink/spl_config.h; then
+
+                       sourcelink="$LINUX"
+
+fi
+
+
                if test -e $sourcelink/spl_config.h; then
 
                        splsrc=`readlink -f ${sourcelink}`