]> granicus.if.org Git - spl/commitdiff
Check sourcelink is set before passing to readlink
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jul 2010 20:25:34 +0000 (13:25 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 1 Jul 2010 20:52:04 +0000 (13:52 -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/spl-build.m4
configure

index 09e4b55eb1dd162fcdbbe27f62486cbb64c17544..89b7162c3836d53ca4a5133b6e22eb342a546fe6 100644 (file)
@@ -117,13 +117,14 @@ AC_DEFUN([SPL_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
index 979c388002b3bab4b18f8968880f94ad7d069920..9d5d93542746c5cb18a9f1fcf6dc0ada3ec8db02 100755 (executable)
--- a/configure
+++ b/configure
@@ -11504,17 +11504,19 @@ $as_echo_n "checking kernel source directory... " >&6; }
                                     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
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error:
-                       *** Please specify the location of the kernel source
-                       *** with the '--with-linux=PATH' option" >&5
+       *** 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." >&5
 $as_echo "$as_me: error:
-                       *** Please specify the location of the kernel source
-                       *** with the '--with-linux=PATH' option" >&2;}
+       *** 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." >&2;}
    { (exit 1); exit 1; }; }
                fi
        else
@@ -14974,17 +14976,19 @@ $as_echo_n "checking kernel source directory... " >&6; }
                                     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
                        { $as_echo "$as_me:$LINENO: result: Not found" >&5
 $as_echo "Not found" >&6; }
                        { { $as_echo "$as_me:$LINENO: error:
-                       *** Please specify the location of the kernel source
-                       *** with the '--with-linux=PATH' option" >&5
+       *** 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." >&5
 $as_echo "$as_me: error:
-                       *** Please specify the location of the kernel source
-                       *** with the '--with-linux=PATH' option" >&2;}
+       *** 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." >&2;}
    { (exit 1); exit 1; }; }
                fi
        else