5 # Verify that this build machine has the required header files for the
6 # kernel versions specified in LINUX_VERS.
8 # The following critical variables are passed in from ./Makefile:
10 # LINUX_SRCDIR="/usr/src/linux-"
11 # LINUX_VERS="2.2.5-15 2.2.10 2.2.12 2.2.12-20 2.2.13 2.2.14"
13 # To add support for a new Linux kernel rev, msut therefore add it to
14 # $LINUX_VERS in ./Makefile and create $LINUX_SRCDIR$VERS, populating
15 # the latter with header files including a version of the include file
16 # $LINUX_SRCDIR$VERS/include/linux/version.h containing the appropriate
17 # UTS_RELEASE definition.
20 # The following two tests are done so that "make install" can be executed
21 # directly from the config directory.
22 if [ -z "$LINUX_VERS" ]; then
23 echo LINUX_VERS is not set. Not testing header links for kernel build.
27 if [ -z "$LINUX_SRCDIR" ]; then
28 echo "LINUX_SRCDIR is not set. Not testing header links for kernel build."
36 for VERS in $LINUX_VERS ; do
37 dir=$LINUX_SRCDIR$VERS
38 if [ ! -d $dir ] ; then
39 echo "ERROR: Cannot build for Linux kernel $VERS: $dir does not exist."
43 header=$LINUX_SRCDIR$VERS/include/linux/version.h
44 if [ ! -f $header ] ; then
45 echo "ERROR: Cannot build for Linux kernel $VERS: $header does not exist."
50 vers=`fgrep UTS_RELEASE $LINUX_SRCDIR$VERS/include/linux/version.h |
51 awk 'BEGIN { FS="\"" } { print $2 }'`
52 if [ "x$vers" = "x" ] ; then
53 echo "ERROR: Cannot build for Linux kernel $VERS:"
54 echo " No UTS_RELEASE string found in $header."
56 elif [ "$VERS" != "$vers" ] ; then
57 echo "ERROR: Cannot build $VERS. Wrong version '('$vers')' in $header."
61 CAN_BUILD="$CAN_BUILD $VERS"
65 if [ "x$errors" = "xtrue" ] ; then
66 echo "ERROR: Should be able to build at least one of $LINUX_VERS."
67 if [ "x$found_one" = "xtrue" ] ; then
68 echo " Cannot build all kernels. Only set up for $CAN_BUILD."
70 echo " Valid headers not present for any Linux kernel."