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 <david.chen@osnexus.com>
This commit is contained in:
Chunwei Chen 2017-05-24 15:42:34 -07:00 committed by Brian Behlendorf
parent 3bda331ba8
commit ac48361c0c
1 changed files with 2 additions and 1 deletions

View File

@ -113,6 +113,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
if test "$kernelsrc" = "NONE"; then if test "$kernelsrc" = "NONE"; then
kernsrcver=NONE kernsrcver=NONE
fi fi
withlinux=yes
fi fi
AC_MSG_RESULT([$kernelsrc]) AC_MSG_RESULT([$kernelsrc])
@ -125,7 +126,7 @@ AC_DEFUN([SPL_AC_KERNEL], [
AC_MSG_CHECKING([kernel build directory]) AC_MSG_CHECKING([kernel build directory])
if test -z "$kernelbuild"; then 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` kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu} kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}