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
43 echo "ERROR: Cannot build for Linux kernel $VERS: $dir does not exist."
47 header=$LINUX_SRCDIR$VERS/include/linux/version.h
48 if [ ! -f $header ] ; then
49 echo "ERROR: Cannot build for Linux kernel $VERS: $header does not exist."
54 vers=`fgrep UTS_RELEASE $LINUX_SRCDIR$VERS/include/linux/version.h |
55 awk 'BEGIN { FS="\"" } { print $2 }'`
56 if [ "x$vers" = "x" ] ; then
57 echo "ERROR: Cannot build for Linux kernel $VERS:"
58 echo " No UTS_RELEASE string found in $header."
60 elif [ "$VERS" != "$vers" ] ; then
61 # Redhat kernel source has the problem that they create one version.h for
62 # all their builds; So, we have to be creative here.
63 # echo "ERROR: Cannot build $VERS. Wrong version '('$vers')' in $header."
67 for subvers in $vers ; do
68 if [ "x$subvers" = "x$VERS" ] ; then
74 CAN_BUILD="$CAN_BUILD $VERS"
78 if [ "x$errors" = "xtrue" ] ; then
79 echo "ERROR: Should be able to build at least one of $LINUX_VERS."
80 if [ "x$found_one" = "xtrue" ] ; then
81 echo " Cannot build all kernels. Only set up for $CAN_BUILD."
83 echo " Valid headers not present for any Linux kernel."