Merge commit 'refs/top-bases/linux-have-fm' into linux-have-fm

This commit is contained in:
Brian Behlendorf 2010-03-08 14:56:37 -08:00
commit bbc110f362
1 changed files with 8 additions and 2 deletions

View File

@ -76,8 +76,14 @@ AC_DEFUN([ZFS_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}`