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]

Patch to crosstool.sh


Hi Dan!

I've now started using your script (actually, only crosstool.sh, called
from my own script as I personally find the demo-*.sh scripts confusing
and non-working with CVS trees instead of released tarballs:)

Here's a patch that does modify crosstool.sh in certain ways:

- Add "support" for the VAX architecture. Right, some people are working
  towards getting vax-dec-linux running:)
- Modify abort() message for ppc to also mention powerpc64-*
- Use TABs :)
- Use a different way to recognize kernel version. Previously, the
  script depended on "2.4" or "2.6" being in the path. Now, kernel
  version is taken from kernel's Makefile. This also works for CVS
  kernels:)

MfG, JBG


--- crosstool.sh.orig	2004-05-13 17:38:32.000000000 +0200
+++ crosstool.sh	2004-05-13 17:48:06.000000000 +0200
@@ -60,23 +60,24 @@
 
 # map TARGET to Linux equivalent
 case $TARGET in
-    alpha*)   ARCH=alpha ;;
-    arm*)     ARCH=arm ;;
-    cris*)    ARCH=cris ;;
-    hppa*)    ARCH=parisc ;;
-    i*86*)    ARCH=i386 ;;
-    ia64*)    ARCH=ia64 ;;
-    mips*)    ARCH=mips ;;
-    m68k*)    ARCH=m68k ;;
-    powerpc64*) ARCH=ppc64 ;;
-    powerpc*) ARCH=ppc ;;
-    ppc*)     abort "Target $TARGET incompatible with binutils and gcc regression tests; use target powerpc-* instead";;
-    s390*)    ARCH=s390 ;;
-    sh*)      ARCH=sh ;;
-    sparc64*) ARCH=sparc64 ;;
-    sparc*)   ARCH=sparc ;;
-    x86_64*)  ARCH=x86_64 ;;
-    *) abort "Bad target $TARGET"
+	alpha*)		ARCH=alpha;;
+	arm*)		ARCH=arm;;
+	cris*)		ARCH=cris;;
+	hppa*)		ARCH=parisc;;
+	i*86*)		ARCH=i386;;
+	ia64*)		ARCH=ia64;;
+	mips*)		ARCH=mips;;
+	m68k*)		ARCH=m68k;;
+	powerpc64*)	ARCH=ppc64;;
+	powerpc*)	ARCH=ppc;;
+	ppc*)		abort "Target $TARGET incompatible with binutils and gcc regression tests; use target powerpc-* or powerpc64-* instead";;
+	s390*)		ARCH=s390;;
+	sh*)		ARCH=sh;;
+	sparc64*)	ARCH=sparc64;;
+	sparc*)		ARCH=sparc;;
+	vax*)		ARCH=vax;;
+	x86_64*)	ARCH=x86_64;;
+	*)		abort "Bad target $TARGET";;
 esac
 
 # Make all paths absolute (it's so confusing otherwise)
@@ -156,10 +157,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]