Make Missing Modules.symvers Fatal
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 7 Mar 2011 21:03:48 +0000 (13:03 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 7 Mar 2011 21:09:20 +0000 (13:09 -0800)
Detect early on in configure if the Modules.symvers file is missing.
Without this file there will be build failures later and it's best
to catch this early and provide a useful error.  In this case the
most likely problem is the kernel-devel packages are not installed.
It may also be possible that they are using an unbuilt custom kernel
in which case they must build the kernel first.

Closes #127

config/kernel.m4
configure

index 8b4a5c7..2b4df70 100644 (file)
@@ -61,6 +61,14 @@ AC_DEFUN([ZFS_AC_MODULE_SYMVERS], [
                else
                        LINUX_SYMBOLS=Module.symvers
                fi
+
+               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+                       AC_MSG_ERROR([
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If your building with a custom kernel make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source.])
+               fi
        else
                LINUX_SYMBOLS=NONE
        fi
index 352b683..ea6e1bc 100755 (executable)
--- a/configure
+++ b/configure
@@ -11964,6 +11964,20 @@ $as_echo_n "checking kernel file name for module symbols... " >&6; }
                else
                        LINUX_SYMBOLS=Module.symvers
                fi
+
+               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+                       { { $as_echo "$as_me:$LINENO: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If your building with a custom kernel make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." >&5
+$as_echo "$as_me: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If your building with a custom kernel make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." >&2;}
+   { (exit 1); exit 1; }; }
+               fi
        else
                LINUX_SYMBOLS=NONE
        fi
@@ -15955,6 +15969,20 @@ $as_echo_n "checking kernel file name for module symbols... " >&6; }
                else
                        LINUX_SYMBOLS=Module.symvers
                fi
+
+               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+                       { { $as_echo "$as_me:$LINENO: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If your building with a custom kernel make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." >&5
+$as_echo "$as_me: error:
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If your building with a custom kernel make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." >&2;}
+   { (exit 1); exit 1; }; }
+               fi
        else
                LINUX_SYMBOLS=NONE
        fi