diff --git a/config/kernel.m4 b/config/kernel.m4 index 2557033adc08..7743fdab0b1e 100644 --- a/config/kernel.m4 +++ b/config/kernel.m4 @@ -275,8 +275,9 @@ AC_DEFUN([ZFS_AC_SPL], [ splsrc0="/var/lib/dkms/spl/${VERSION}/build" splsrc1="/usr/src/spl-${VERSION}/${LINUX_VERSION}" splsrc2="/usr/src/spl-${VERSION}" - splsrc3="../spl/" - splsrc4="$LINUX" + splsrc3="../spl" + splsrc4="../../spl" + splsrc5="$LINUX" AC_MSG_CHECKING([spl source directory]) AS_IF([test -z "${splsrc}"], [ @@ -290,6 +291,8 @@ AC_DEFUN([ZFS_AC_SPL], [ splsrc=$(readlink -f "${splsrc3}") ], [ test -e "${splsrc4}/spl.release.in" ], [ splsrc=${splsrc4} + ], [ test -e "${splsrc5}/spl.release.in" ], [ + splsrc=${splsrc5} ], [ splsrc="[Not found]" ]) @@ -327,6 +330,8 @@ AC_DEFUN([ZFS_AC_SPL], [ splbuild="${splsrc}/${LINUX_VERSION}" ], [ test -e "${splsrc}/spl_config.h" ], [ splbuild="${splsrc}" + ], [ find -L "${splsrc}" -name spl_config.h 2> /dev/null | grep -wq spl_config.h ], [ + splbuild=$(find -L "${splsrc}" -name spl_config.h | sed 's,/spl_config.h,,') ], [ splbuild="[Not found]" ])