From 3f9d982ec25aa5f9cf32a1268d6883a9afa70b12 Mon Sep 17 00:00:00 2001 From: Stephan Wiesand Date: Sat, 15 Dec 2012 15:36:24 +0100 Subject: [PATCH] Linux: Restructure kernel header detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Michael Laß Reviewed-by: Chas Williams - CONTRACTOR Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear --- acinclude.m4 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 44ce680c95..dc68e893d5 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -309,16 +309,20 @@ case $system in if test "x$with_linux_kernel_headers" != "x"; then LINUX_KERNEL_PATH="$with_linux_kernel_headers" else - LINUX_KERNEL_PATH="/lib/modules/`uname -r`/source" - if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then - LINUX_KERNEL_PATH="/lib/modules/`uname -r`/build" - fi - if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then - LINUX_KERNEL_PATH="/usr/src/linux-2.4" - fi - if test ! -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then - LINUX_KERNEL_PATH="/usr/src/linux" - fi + for utsdir in "/lib/modules/`uname -r`/build" \ + "/lib/modules/`uname -r`/source" \ + "/usr/src/linux-2.4" \ + "/usr/src/linux"; do + LINUX_KERNEL_PATH="$utsdir" + for utsfile in "include/generated/utsrelease.h" \ + "include/linux/utsrelease.h" \ + "include/linux/version.h" \ + "include/linux/version-up.h"; do + if grep "UTS_RELEASE" "$utsdir/$utsfile" >/dev/null 2>&1; then + break 2 + fi + done + done fi if test "x$with_linux_kernel_build" != "x"; then LINUX_KERNEL_BUILD="$with_linux_kernel_build"