This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

crosstool.sh: Better detection of kernel version


Hi Dan!

Please accept this patch to crosstool.sh. It adds better detection to
the used Linux kernel version than just looking at the path. Some people
use CVS kernels which don't have 2.x.y in their path...

MfG, JBG

--- crosstool.sh~linux	2004-05-15 23:27:20.000000000 +0200
+++ crosstool.sh	2004-05-15 23:31:28.000000000 +0200
@@ -156,10 +156,13 @@
     yes "" | make ARCH=$ARCH oldconfig
 fi
 
-# check for kernel version 2.6.*
-case "$LINUX_DIR" in
-*2.6.*) make ARCH=$ARCH include/asm include/linux/version.h;;
-*)      make ARCH=$ARCH symlinks    include/linux/version.h;;
+# Check for kernel version 2.6.*
+eval "`head -n4 $LINUX_DIR/Makefile | sed -e 's/[[:space:]]//g'`"
+case "${VERSION}_${PATCHLEVEL}_x" in
+	2_2_x)	make ARCH=$ARCH symlinks	include/linux/version.h ;;
+	2_4_x)	make ARCH=$ARCH symlinks	include/linux/version.h ;;
+	2_6_x)	make ARCH=$ARCH include/asm	include/linux/version.h ;;
+	*)	abort "Unsupported kernel version ${VERSION}.${PATCHLEVEL}.x" ;;
 esac
 
 mkdir -p $HEADERDIR

-- 
   Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481
   "Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg
    fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!
   ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]