From fd921c2e0c36c0c658031bc8bf4a3f912a3349f7 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Wed, 30 Jun 2010 09:47:57 -0700 Subject: Linux-2.6.33 compat, check for UTS_RELEASE It seems the upstream community moved the definition of UTS_RELEASE yet again as of linux-2.6.33. Update the build system to check in all three possible locations where your kernel version may be defined. $kernelbuild/include/linux/version.h $kernelbuild/include/linux/utsrelease.h $kernelbuild/include/generated/utsrelease.h --- config/spl-build.m4 | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'config') diff --git a/config/spl-build.m4 b/config/spl-build.m4 index 6f312e25a..c6f47b68f 100644 --- a/config/spl-build.m4 +++ b/config/spl-build.m4 @@ -146,28 +146,30 @@ AC_DEFUN([SPL_AC_KERNEL], [ AC_MSG_RESULT([$kernelbuild]) AC_MSG_CHECKING([kernel source version]) - if test -r $kernelbuild/include/linux/version.h && - fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then - - kernsrcver=`(echo "#include "; - echo "kernsrcver=UTS_RELEASE") | - cpp -I $kernelbuild/include | - grep "^kernsrcver=" | cut -d \" -f 2` - - elif test -r $kernelbuild/include/linux/utsrelease.h && - fgrep -q UTS_RELEASE $kernelbuild/include/linux/utsrelease.h; then + utsrelease1=$kernelbuild/include/linux/version.h + utsrelease2=$kernelbuild/include/linux/utsrelease.h + utsrelease3=$kernelbuild/include/generated/utsrelease.h + if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then + utsrelease=linux/version.h + elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then + utsrelease=linux/utsrelease.h + elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then + utsrelease=generated/utsrelease.h + fi - kernsrcver=`(echo "#include "; + if test "$utsrelease"; then + kernsrcver=`(echo "#include <$utsrelease>"; echo "kernsrcver=UTS_RELEASE") | cpp -I $kernelbuild/include | grep "^kernsrcver=" | cut -d \" -f 2` - fi - if test -z "$kernsrcver"; then + if test -z "$kernsrcver"; then + AC_MSG_RESULT([Not found]) + AC_MSG_ERROR([*** Cannot determine kernel version.]) + fi + else AC_MSG_RESULT([Not found]) - AC_MSG_ERROR([ - *** Cannot determine the version of the linux kernel source. - *** Please prepare the kernel before running this script]) + AC_MSG_ERROR([*** Cannot find UTS_RELEASE definition.]) fi AC_MSG_RESULT([$kernsrcver]) -- cgit v1.2.3