2 # Copyright 2000, International Business Machines Corporation and others.
5 # This software has been released under the terms of the IBM Public
6 # License. For details, see the LICENSE file in the top-level source
7 # directory or online at http://www.openafs.org/dl/license10.html
9 # Verify that this build machine has the required header files for the
10 # kernel versions specified in LINUX_VERS.
12 # The following critical variables are passed in from ./Makefile:
14 # LINUX_SRCDIR="/usr/src/linux-"
15 # LINUX_VERS="2.2.5-15 2.2.10 2.2.12 2.2.12-20 2.2.13 2.2.14"
17 # To add support for a new Linux kernel rev, msut therefore add it to
18 # $LINUX_VERS in ./Makefile and create $LINUX_SRCDIR$VERS, populating
19 # the latter with header files including a version of the include file
20 # $LINUX_SRCDIR$VERS/include/linux/version.h containing the appropriate
21 # UTS_RELEASE definition.
24 # The following two tests are done so that "make install" can be executed
25 # directly from the config directory.
26 if [ -z "$LINUX_VERS" ]; then
27 echo LINUX_VERS is not set. Not testing header links for kernel build.
31 if [ -z "$LINUX_SRCDIR" ]; then
32 echo "LINUX_SRCDIR is not set. Not testing header links for kernel build."
40 for VERS in $LINUX_VERS ; do
41 dir=$LINUX_SRCDIR$VERS
42 if [ ! -d $dir ] ; then
44 if [ ! -d $dir ] ; then
45 echo "ERROR: Cannot build for Linux kernel $VERS: $dir does not exist."
50 header=$LINUX_SRCDIR$VERS/include/linux/version.h
51 if [ ! -f $header ] ; then
52 header=$LINUX_SRCDIR/include/linux/version.h
53 if [ ! -f $header ] ; then
54 echo "ERROR: Cannot build for Linux kernel $VERS: $header does not exist."
60 vers=`fgrep UTS_RELEASE "$header" |
61 awk 'BEGIN { FS="\"" } { print $2 }'`
62 if [ "x$vers" = "x" ] ; then
63 echo "ERROR: Cannot build for Linux kernel $VERS:"
64 echo " No UTS_RELEASE string found in $header."
66 elif [ "$VERS" != "$vers" ] ; then
67 # Redhat kernel source has the problem that they create one version.h for
68 # all their builds; So, we have to be creative here.
69 # echo "ERROR: Cannot build $VERS. Wrong version '('$vers')' in $header."
73 for subvers in $vers ; do
74 if [ "x$subvers" = "x$VERS" ] ; then
80 CAN_BUILD="$CAN_BUILD $VERS"
84 if [ "x$errors" = "xtrue" ] ; then
85 echo "ERROR: Should be able to build at least one of $LINUX_VERS."
86 if [ "x$found_one" = "xtrue" ] ; then
87 echo " Cannot build all kernels. Only set up for $CAN_BUILD."
89 echo " Valid headers not present for any Linux kernel."