summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-06-30 09:47:57 -0700
committerBrian Behlendorf <[email protected]>2010-06-30 12:48:18 -0700
commitfd921c2e0c36c0c658031bc8bf4a3f912a3349f7 (patch)
tree9f118bab4e5897bc790800c7e75cb021a0cb55ba /configure
parent1e48754059046c01ac8e35c8686e2d1940d984f9 (diff)
Linux-2.6.33 compat, check <generated/utsrelease.h> 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
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure82
1 files changed, 44 insertions, 38 deletions
diff --git a/configure b/configure
index cd227c18a..47611aeec 100755
--- a/configure
+++ b/configure
@@ -11542,32 +11542,35 @@ $as_echo "$kernelbuild" >&6; }
{ $as_echo "$as_me:$LINENO: checking kernel source version" >&5
$as_echo_n "checking kernel source version... " >&6; }
- if test -r $kernelbuild/include/linux/version.h &&
- fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then
-
- kernsrcver=`(echo "#include <linux/version.h>";
- 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 <linux/utsrelease.h>";
+ 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
+ { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+ { { $as_echo "$as_me:$LINENO: error: *** Cannot determine kernel version." >&5
+$as_echo "$as_me: error: *** Cannot determine kernel version." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
{ $as_echo "$as_me:$LINENO: result: Not found" >&5
$as_echo "Not found" >&6; }
- { { $as_echo "$as_me:$LINENO: error:
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script" >&5
-$as_echo "$as_me: error:
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: *** Cannot find UTS_RELEASE definition." >&5
+$as_echo "$as_me: error: *** Cannot find UTS_RELEASE definition." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -14936,32 +14939,35 @@ $as_echo "$kernelbuild" >&6; }
{ $as_echo "$as_me:$LINENO: checking kernel source version" >&5
$as_echo_n "checking kernel source version... " >&6; }
- if test -r $kernelbuild/include/linux/version.h &&
- fgrep -q UTS_RELEASE $kernelbuild/include/linux/version.h; then
-
- kernsrcver=`(echo "#include <linux/version.h>";
- 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 <linux/utsrelease.h>";
+ 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
+ { $as_echo "$as_me:$LINENO: result: Not found" >&5
+$as_echo "Not found" >&6; }
+ { { $as_echo "$as_me:$LINENO: error: *** Cannot determine kernel version." >&5
+$as_echo "$as_me: error: *** Cannot determine kernel version." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
{ $as_echo "$as_me:$LINENO: result: Not found" >&5
$as_echo "Not found" >&6; }
- { { $as_echo "$as_me:$LINENO: error:
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script" >&5
-$as_echo "$as_me: error:
- *** Cannot determine the version of the linux kernel source.
- *** Please prepare the kernel before running this script" >&2;}
+ { { $as_echo "$as_me:$LINENO: error: *** Cannot find UTS_RELEASE definition." >&5
+$as_echo "$as_me: error: *** Cannot find UTS_RELEASE definition." >&2;}
{ (exit 1); exit 1; }; }
fi