Linux: Restructure kernel header detection

As of kernel 3.7, version.h has moved, and hence utsrelease.h was
no longer found. Loop over candidate directories and locations
within, and look for the files we're actually after.

FIXES 131525

Change-Id: I686212a283b9e0ce769b1351e3cb75e08f4b110c
Reviewed-on: http://gerrit.openafs.org/8761
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Stephan Wiesand 2012-12-15 15:36:24 +01:00 committed by Derrick Brashear
parent 23092acce5
commit 3f9d982ec2

View File

@ -309,16 +309,20 @@ case $system in
if test "x$with_linux_kernel_headers" != "x"; then if test "x$with_linux_kernel_headers" != "x"; then
LINUX_KERNEL_PATH="$with_linux_kernel_headers" LINUX_KERNEL_PATH="$with_linux_kernel_headers"
else else
LINUX_KERNEL_PATH="/lib/modules/`uname -r`/source" for utsdir in "/lib/modules/`uname -r`/build" \
if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then "/lib/modules/`uname -r`/source" \
LINUX_KERNEL_PATH="/lib/modules/`uname -r`/build" "/usr/src/linux-2.4" \
fi "/usr/src/linux"; do
if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then LINUX_KERNEL_PATH="$utsdir"
LINUX_KERNEL_PATH="/usr/src/linux-2.4" for utsfile in "include/generated/utsrelease.h" \
fi "include/linux/utsrelease.h" \
if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then "include/linux/version.h" \
LINUX_KERNEL_PATH="/usr/src/linux" "include/linux/version-up.h"; do
fi if grep "UTS_RELEASE" "$utsdir/$utsfile" >/dev/null 2>&1; then
break 2
fi
done
done
fi fi
if test "x$with_linux_kernel_build" != "x"; then if test "x$with_linux_kernel_build" != "x"; then
LINUX_KERNEL_BUILD="$with_linux_kernel_build" LINUX_KERNEL_BUILD="$with_linux_kernel_build"