aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/spl-build.m410
-rwxr-xr-xconfigure20
2 files changed, 24 insertions, 6 deletions
diff --git a/config/spl-build.m4 b/config/spl-build.m4
index e2e2112e7..9d0361028 100644
--- a/config/spl-build.m4
+++ b/config/spl-build.m4
@@ -104,8 +104,14 @@ AC_DEFUN([SPL_AC_KERNEL], [
AC_MSG_CHECKING([kernel source directory])
if test -z "$kernelsrc"; then
- sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* \
- 2>/dev/null | grep -v obj | tail -1`
+ headersdir="/lib/modules/$(uname -r)/build"
+ if test -e "$headersdir"; then
+ sourcelink=$(readlink -f "$headersdir")
+ else
+ sourcelink=$(ls -1d /usr/src/kernels/* \
+ /usr/src/linux-* \
+ 2>/dev/null | grep -v obj | tail -1)
+ fi
if test -e ${sourcelink}; then
kernelsrc=`readlink -f ${sourcelink}`
diff --git a/configure b/configure
index 99c064d43..98b92a9d0 100755
--- a/configure
+++ b/configure
@@ -18971,8 +18971,14 @@ fi;
echo "$as_me:$LINENO: checking kernel source directory" >&5
echo $ECHO_N "checking kernel source directory... $ECHO_C" >&6
if test -z "$kernelsrc"; then
- sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* \
- 2>/dev/null | grep -v obj | tail -1`
+ headersdir="/lib/modules/$(uname -r)/build"
+ if test -e "$headersdir"; then
+ sourcelink=$(readlink -f "$headersdir")
+ else
+ sourcelink=$(ls -1d /usr/src/kernels/* \
+ /usr/src/linux-* \
+ 2>/dev/null | grep -v obj | tail -1)
+ fi
if test -e ${sourcelink}; then
kernelsrc=`readlink -f ${sourcelink}`
@@ -22317,8 +22323,14 @@ fi;
echo "$as_me:$LINENO: checking kernel source directory" >&5
echo $ECHO_N "checking kernel source directory... $ECHO_C" >&6
if test -z "$kernelsrc"; then
- sourcelink=`ls -1d /usr/src/kernels/* /usr/src/linux-* \
- 2>/dev/null | grep -v obj | tail -1`
+ headersdir="/lib/modules/$(uname -r)/build"
+ if test -e "$headersdir"; then
+ sourcelink=$(readlink -f "$headersdir")
+ else
+ sourcelink=$(ls -1d /usr/src/kernels/* \
+ /usr/src/linux-* \
+ 2>/dev/null | grep -v obj | tail -1)
+ fi
if test -e ${sourcelink}; then
kernelsrc=`readlink -f ${sourcelink}`