1 AC_DEFUN([OPENAFS_LINUX_KERNEL_PATH],[
2 if test "x$with_linux_kernel_headers" != "x"; then
3 LINUX_KERNEL_PATH="$with_linux_kernel_headers"
5 for utsdir in "/lib/modules/`uname -r`/build" \
6 "/lib/modules/`uname -r`/source" \
8 LINUX_KERNEL_PATH="$utsdir"
9 for utsfile in "include/generated/utsrelease.h" \
10 "include/linux/utsrelease.h" \
11 "include/linux/version.h" \
12 "include/linux/version-up.h"; do
13 if grep "UTS_RELEASE" "$utsdir/$utsfile" >/dev/null 2>&1; then
19 if test "x$with_linux_kernel_build" != "x"; then
20 LINUX_KERNEL_BUILD="$with_linux_kernel_build"
22 LINUX_KERNEL_BUILD=$LINUX_KERNEL_PATH
24 if test -f "$LINUX_KERNEL_BUILD/include/generated/utsrelease.h"; then
25 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/generated/utsrelease.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
26 LINUX_VERSION="$linux_kvers"
28 if test -f "$LINUX_KERNEL_BUILD/include/linux/utsrelease.h"; then
29 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/linux/utsrelease.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
30 LINUX_VERSION="$linux_kvers"
32 if test -f "$LINUX_KERNEL_BUILD/include/linux/version.h"; then
33 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
34 if test "x$linux_kvers" = "x"; then
35 if test -f "$LINUX_KERNEL_BUILD/include/linux/version-up.h"; then
36 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_BUILD/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
37 if test "x$linux_kvers" = "x"; then
38 AC_MSG_ERROR(Linux headers lack version definition [2])
41 LINUX_VERSION="$linux_kvers"
44 AC_MSG_ERROR(Linux headers lack version definition)
48 LINUX_VERSION="$linux_kvers"
51 enable_kernel_module="no"
55 if test ! -f "$LINUX_KERNEL_BUILD/include/generated/autoconf.h" &&
56 test ! -f "$LINUX_KERNEL_BUILD/include/linux/autoconf.h"; then
57 enable_kernel_module="no"
59 if test "x$enable_kernel_module" = "xno"; then
60 if test "x$with_linux_kernel_headers" != "x"; then
61 AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
64 AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
67 dnl do we need to determine SUBARCH from autoconf.h