From ac48361c0c16f36407643f931f92162145618865 Mon Sep 17 00:00:00 2001 From: Chunwei Chen Date: Wed, 24 May 2017 15:42:34 -0700 Subject: [PATCH] config: allow --with-linux without --with-linux-obj 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 --- config/spl-build.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/spl-build.m4 b/config/spl-build.m4 index b5aa7adac..7569988da 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -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}