]> git.proxmox.com Git - mirror_zfs.git/commitdiff
config: allow --with-linux without --with-linux-obj
authorChunwei Chen <david.chen@osnexus.com>
Wed, 24 May 2017 23:02:04 +0000 (16:02 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 25 May 2017 17:14:13 +0000 (10:14 -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>
Requires-spl: refs/pull/617/head

config/kernel.m4

index c96c8b17fd626538c756a6bc3952a07b4619bbef..324ab816f6a697bd8a9d8283f717ad3e4e92a9e5 100644 (file)
@@ -202,6 +202,7 @@ AC_DEFUN([ZFS_AC_KERNEL], [
                AS_IF([test "$kernelsrc" = "NONE"], [
                        kernsrcver=NONE
                ])
+               withlinux=yes
        ])
 
        AC_MSG_RESULT([$kernelsrc])
@@ -214,7 +215,7 @@ AC_DEFUN([ZFS_AC_KERNEL], [
 
        AC_MSG_CHECKING([kernel build directory])
        AS_IF([test -z "$kernelbuild"], [
-               AS_IF([test -e "/lib/modules/$(uname -r)/build"], [
+               AS_IF([test x$withlinux != xyes -a -e "/lib/modules/$(uname -r)/build"], [
                        kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
                ], [test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}], [
                        kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}