summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-01-02 11:59:28 +0000
committerEric Andersen <andersen@codepoet.org>2004-01-02 11:59:28 +0000
commit7b6c8a1adcc37cf02e6fcc90e342e05f99f6b89a (patch)
tree5b8180bc7ab60e729df8f0550e07f6e5ae58327f /extra
parentc2e3235c998fb528b6485e0329624c75a92cb9a5 (diff)
Cope with 2.6.x headers
Diffstat (limited to 'extra')
-rwxr-xr-xextra/scripts/fix_includes.sh45
1 files changed, 25 insertions, 20 deletions
diff --git a/extra/scripts/fix_includes.sh b/extra/scripts/fix_includes.sh
index bcb679563..879bec0f1 100755
--- a/extra/scripts/fix_includes.sh
+++ b/extra/scripts/fix_includes.sh
@@ -59,46 +59,46 @@ while [ -n "$1" ]; do
esac;
done;
-if [ ! -f "$KERNEL_SOURCE/include/linux/version.h" ]; then
+if [ ! -f "$KERNEL_SOURCE/Makefile" ]; then
echo "";
echo "";
- echo "The file $KERNEL_SOURCE/include/linux/version.h is missing!";
- echo "Perhaps you forgot to configure your kernel source?"
+ echo "The file $KERNEL_SOURCE/Makefile is missing!";
+ echo "Perhaps your kernel source is broken?"
echo "";
echo "";
exit 1;
fi;
-if [ ! -d "$KERNEL_SOURCE" ]; then
+if [ ! -d "$KERNEL_SOURCE" ]; then
echo "";
echo "";
- echo "$KERNEL_SOURCE is not a directory";
+ echo "$KERNEL_SOURCE is not a directory";
echo "";
echo "";
exit 1;
fi;
-KVER=`gcc -I$KERNEL_SOURCE/include -E -dM $KERNEL_SOURCE/include/linux/version.h | grep UTS_RELEASE | awk '{ print $3 }' | sed 's/\"//g'`
+# set current VERSION, PATCHLEVEL, SUBLEVEL, EXTERVERSION
+eval `sed -n -e 's/^\([A-Z]*\) = \([0-9]*\)$/\1=\2/p' -e 's/^\([A-Z]*\) = \(-[-a-z0-9]*\)$/\1=\2/p' $KERNEL_SOURCE/Makefile`
+if [ -z "$VERSION" -o -z "$PATCHLEVEL" -o -z "$SUBLEVEL" ]
+then
+ echo "Unable to determine version for kernel headers"
+ echo -e "\tprovided in directory $KERNEL_SOURCE"
+ exit 1
+fi
+
+echo "Current kernel version is $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION}"
-if [ -z "$KVER" ] ; then
- echo "";
- echo "";
- echo "Unable to determine kernel version."
- echo "Perhaps your kernel source tree is broken?"
- echo "";
- echo "";
- exit 1;
-fi;
echo -e "\n"
-echo "Using kernel headers from $KVER for architecture '$TARGET_ARCH'"
+echo "Using kernel headers from $VERSION.$PATCHLEVEL.$SUBLEVEL${EXTRAVERSION} for architecture '$TARGET_ARCH'"
echo -e "\tprovided in directory $KERNEL_SOURCE"
echo -e "\n"
# Create a symlink to include/asm
-rm -f include/asm
-if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
+rm -f include/asm*
+if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
echo "";
echo "";
echo "The symlink $KERNEL_SOURCE/include/asm is missing\!";
@@ -106,7 +106,7 @@ if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
echo "You really should configure your kernel source tree so I";
echo "do not have to try and guess about this sort of thing.";
echo ""
- echo "Attempting to guess a usable value....";
+ echo "Attempting to guess a usable value....";
echo ""
echo "";
sleep 1;
@@ -123,7 +123,7 @@ if [ ! -d "$KERNEL_SOURCE/include/asm" ]; then
set -x;
ln -fs $KERNEL_SOURCE/include/asm-arm include/asm;
set +x;
- if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
+ if [ ! -L $KERNEL_SOURCE/include/asm-arm/proc ] ; then
if [ ! -L proc ] ; then
(cd include/asm;
ln -fs proc-armv proc;
@@ -155,6 +155,11 @@ ln -fs $KERNEL_SOURCE/include/asm include/asm
fi;
+# Annoyingly, 2.6.x kernel headers also need an include/asm-generic/ directory
+if [ $VERSION -eq 2 ] && [ $PATCHLEVEL -ge 6 ] ; then
+ ln -fs $KERNEL_SOURCE/include/asm-generic include/asm-generic
+fi;
+
# Create the include/linux and include/scsi symlinks.
rm -f include/linux