Merge commit 'refs/top-bases/linux-kernel-device' into linux-kernel-device

This commit is contained in:
Brian Behlendorf 2010-07-01 20:47:19 -07:00
commit 60c4cb77c7
1 changed files with 21 additions and 19 deletions

View File

@ -114,28 +114,30 @@ AC_DEFUN([ZFS_AC_KERNEL], [
AC_MSG_RESULT([$kernelbuild]) AC_MSG_RESULT([$kernelbuild])
AC_MSG_CHECKING([kernel source version]) AC_MSG_CHECKING([kernel source version])
if test -r $kernelbuild/include/linux/version.h && utsrelease1=$kernelbuild/include/linux/version.h
fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then utsrelease2=$kernelbuild/include/linux/utsrelease.h
utsrelease3=$kernelbuild/include/generated/utsrelease.h
kernsrcver=`(echo "#include <linux/version.h>"; if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
echo "kernsrcver=UTS_RELEASE") | utsrelease=linux/version.h
cpp -I $kernelbuild/include | elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
grep "^kernsrcver=" | cut -d \" -f 2` utsrelease=linux/utsrelease.h
elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
elif test -r $kernelbuild/include/linux/utsrelease.h && utsrelease=generated/utsrelease.h
fgrep -q UTS_RELEASE $kernelbuild/include/linux/utsrelease.h; then
kernsrcver=`(echo "#include <linux/utsrelease.h>";
echo "kernsrcver=UTS_RELEASE") |
cpp -I $kernelbuild/include |
grep "^kernsrcver=" | cut -d \" -f 2`
fi fi
if test "$utsrelease"; then
kernsrcver=`(echo "#include <$utsrelease>";
echo "kernsrcver=UTS_RELEASE") |
cpp -I $kernelbuild/include |
grep "^kernsrcver=" | cut -d \" -f 2`
if test -z "$kernsrcver"; then if test -z "$kernsrcver"; then
AC_MSG_RESULT([Not found]) AC_MSG_RESULT([Not found])
AC_MSG_ERROR([ AC_MSG_ERROR([*** Cannot determine kernel version.])
*** Cannot determine the version of the linux kernel source. fi
*** Please prepare the kernel before running this script]) else
AC_MSG_RESULT([Not found])
AC_MSG_ERROR([*** Cannot find UTS_RELEASE definition.])
fi fi
AC_MSG_RESULT([$kernsrcver]) AC_MSG_RESULT([$kernsrcver])