ARCH=powerpc
James Lemke
jwlemke@wasabisystems.com
Sun Apr 9 21:32:00 GMT 2006
> this applies to linux-2.6.15+ only as starting with that version, ppc and
> ppc64 have been unified into just powerpc ... anything older still needs to
> use ppc/ppc64
OK, so the following would be a better patch...
--
Jim Lemke jwlemke@wasabisystems.com Orillia, Ontario
-------------- next part --------------
--- crosstool.sh-orig 2006-02-25 21:14:13.000000000 -0500
+++ crosstool.sh 2006-04-09 17:14:58.000000000 -0400
@@ -215,7 +215,19 @@ esac
set -ex
-# map TARGET to Linux equivalent
+# Autodetect kernel version from contents of Makefile.
+# Use it to determine correct kernel target.
+KERNEL_VERSION=`awk '/^VERSION =/ { print $3 }' $LINUX_HEADER_DIR/Makefile`
+KERNEL_PATCHLEVEL=`awk '/^PATCHLEVEL =/ { print $3 }' $LINUX_HEADER_DIR/Makefile`
+KERNEL_SUBLEVEL=`awk '/^SUBLEVEL =/ { print $3 }' $LINUX_HEADER_DIR/Makefile`
+ppc=ppc
+k_vps=`printf '%u%02u%02u' $KERNEL_VERSION $KERNEL_PATCHLEVEL $KERNEL_SUBLEVEL`
+if test $k_vps -ge 20615; then
+ ppc=powerpc
+fi
+unset KERNEL_SUBLEVEL k_vps
+
+# map TARGET to Linux kernel equivalent
case $TARGET in
alpha*) ARCH=alpha ;;
arm*) ARCH=arm ;;
@@ -226,8 +238,8 @@ case $TARGET in
ia64*) ARCH=ia64 ;;
mips*) ARCH=mips ;;
m68k*) ARCH=m68k ;;
- powerpc64*) ARCH=ppc64 ;;
- powerpc*) ARCH=ppc ;;
+ powerpc64*) ARCH=${ppc}64 ;;
+ 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 ;;
@@ -322,10 +334,6 @@ if test -f .config; then
yes "" | make ARCH=$ARCH oldconfig
fi
-# autodetect kernel version from contents of Makefile
-KERNEL_VERSION=`awk '/^VERSION =/ { print $3 }' $LINUX_HEADER_DIR/Makefile`
-KERNEL_PATCHLEVEL=`awk '/^PATCHLEVEL =/ { print $3 }' $LINUX_HEADER_DIR/Makefile`
-
case "$KERNEL_VERSION.$KERNEL_PATCHLEVEL.x" in
2.2.x|2.4.x) make ARCH=$ARCH symlinks include/linux/version.h
;;
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq
More information about the crossgcc
mailing list