]> granicus.if.org Git - zfs/commitdiff
Check sourcelink is set before passing to readlink
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 14 Jul 2010 19:37:31 +0000 (12:37 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 14 Jul 2010 19:44:37 +0000 (12:44 -0700)
When no source was found in any of the expected paths treat
this as fatal and provide the user with a hint as to what
they should do.

config/kernel.m4

index 4cea344ccd136bcf98b7a388ebb5abced3a1a31c..9bf63d4272d4ea307f24626a6dc11b4df47a4a2a 100644 (file)
@@ -84,13 +84,14 @@ AC_DEFUN([ZFS_AC_KERNEL], [
                                     2>/dev/null | grep -v obj | tail -1)
                fi
 
-               if test -e $sourcelink; then
+               if test -n "$sourcelink" && test -e ${sourcelink}; then
                        kernelsrc=`readlink -f ${sourcelink}`
                else
                        AC_MSG_RESULT([Not found])
                        AC_MSG_ERROR([
-                       *** Please specify the location of the kernel source
-                       *** with the '--with-linux=PATH' option])
+       *** 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
        else
                if test "$kernelsrc" = "NONE"; then
@@ -206,8 +207,9 @@ AC_DEFUN([ZFS_AC_SPL], [
                else
                        AC_MSG_RESULT([Not found])
                        AC_MSG_ERROR([
-                       *** Please specify the location of the spl source
-                       *** with the '--with-spl=PATH' option])
+       *** Please make sure the spl devel package for your distribution
+       *** is installed then try again.  If that fails you can specify the
+       *** location of the spl source with the '--with-spl=PATH' option.])
                fi
        else
                if test "$splsrc" = "NONE"; then