]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
Verify --with-linux source directory exists
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 30 Nov 2012 03:26:19 +0000 (19:26 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 29 Nov 2012 23:05:54 +0000 (15:05 -0800)
Previously this check was only performed when ./configure was
attempting to autodetect your kernel source directory.  But we
should also handle the case where --with-linux was provided
and is obviously wrong.  This way we catch the error before
invoking make and compiling the source with an incorrect
autoconf results.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #162

config/spl-build.m4

index 957d46c48b8018a2c595c580256195016efe7f7e..e8ecbc6547d427e20fe18e23e83d531ded436a10 100644 (file)
@@ -141,11 +141,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
                if test -n "$sourcelink" && test -e ${sourcelink}; then
                        kernelsrc=`readlink -f ${sourcelink}`
                else
-                       AC_MSG_RESULT([Not found])
-                       AC_MSG_ERROR([
-       *** Please make sure the kernel devel package for your distribution
-       *** is installed then try again.  If that fails you can specify the
-       *** location of the kernel source with the '--with-linux=PATH' option.])
+                       kernelsrc="[Not found]"
                fi
        else
                if test "$kernelsrc" = "NONE"; then
@@ -154,6 +150,13 @@ AC_DEFUN([SPL_AC_KERNEL], [
        fi
 
        AC_MSG_RESULT([$kernelsrc])
+       if test ! -d "$kernelsrc"; then
+               AC_MSG_ERROR([
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed then try again.  If that fails you can specify the
+       *** location of the kernel source with the '--with-linux=PATH' option.])
+       fi
+
        AC_MSG_CHECKING([kernel build directory])
        if test -z "$kernelbuild"; then
                if test -e "/lib/modules/$(uname -r)/build"; then