]> git.proxmox.com Git - mirror_spl.git/commitdiff
config: allow --with-linux without --with-linux-obj
authorChunwei Chen <david.chen@osnexus.com>
Wed, 24 May 2017 22:42:34 +0000 (15:42 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 25 May 2017 17:12:50 +0000 (10:12 -0700)
Don't use `uname -r` to determine kernel build directory when the user
specified kernel source with --with-linux. Otherwise, the user is forced
to use --with-linux-obj even if they are the same directory, which is
very counterintuitive.

Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
config/spl-build.m4

index b5aa7adac54fbebdca04f0f1128ff84660a1e8c0..7569988daee87b4fd49329e191bb8fa806e01da6 100644 (file)
@@ -113,6 +113,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
                if test "$kernelsrc" = "NONE"; then
                        kernsrcver=NONE
                fi
+               withlinux=yes
        fi
 
        AC_MSG_RESULT([$kernelsrc])
@@ -125,7 +126,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
 
        AC_MSG_CHECKING([kernel build directory])
        if test -z "$kernelbuild"; then
-               if test -e "/lib/modules/$(uname -r)/build"; then
+               if test x$withlinux != xyes -a -e "/lib/modules/$(uname -r)/build"; then
                        kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
                elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}