]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Linux: Restructure kernel header detection
authorStephan Wiesand <stephan.wiesand@desy.de>
Sat, 15 Dec 2012 14:36:24 +0000 (15:36 +0100)
committerPaul Smeddle <paul.smeddle@gmail.com>
Sat, 22 Dec 2012 11:53:44 +0000 (03:53 -0800)
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

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>
(cherry picked from commit 3f9d982ec25aa5f9cf32a1268d6883a9afa70b12)

Change-Id: Ia9653405195d4c5f6592960375340553de1267c5
Reviewed-on: http://gerrit.openafs.org/8804
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: Stephan Wiesand <stephan.wiesand@desy.de>
Reviewed-by: Paul Smeddle <paul.smeddle@gmail.com>
acinclude.m4

index 76ae5976e4d3d786c9a7967f9082705716b02e06..54e65f66c0805f79cf73d37b1e0288f4b2135c95 100644 (file)
@@ -286,16 +286,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"