Author: mcayland Date: Fri Nov 6 16:06:31 2015 New Revision: 1356 URL: http://tracker.coreboot.org/trac/openbios/changeset/1356
Log: switch-arch: compute base arch and allow native compiler for 32bit and 64bit
Signed-off-by: Laurent Vivier laurent@vivier.eu Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Modified: trunk/openbios-devel/config/scripts/switch-arch
Modified: trunk/openbios-devel/config/scripts/switch-arch ============================================================================== --- trunk/openbios-devel/config/scripts/switch-arch Fri Nov 6 16:06:27 2015 (r1355) +++ trunk/openbios-devel/config/scripts/switch-arch Fri Nov 6 16:06:31 2015 (r1356) @@ -45,6 +45,19 @@ fi }
+basearch() +{ + arch=$1 + case $arch in + powerpc|ppc64|powerpc64) + echo ppc + ;; + *) + echo $arch + ;; + esac +} + crosscflags() { host=$1 @@ -95,6 +108,7 @@
select_prefix() { + BASEARCH=$(basearch $ARCH) for target_arch ; do TARGETS="${target_arch}-unknown-linux-gnu- ${target_arch}-linux-gnu- ${target_arch}-linux- ${target_arch}-elf- ${target_arch}-eabi-"
@@ -109,7 +123,8 @@ return fi done - if [ "$ARCH" = "$HOSTARCH" ]; then + if [ "$BASEARCH" = "$(basearch $HOSTARCH)" ]; then + TARGET="" return fi done @@ -240,7 +255,6 @@ esac done
- BASEARCH=$ARCH case $ARCH in amd64) select_prefix x86_64 @@ -263,7 +277,6 @@ select_prefix powerpc64 CFLAGS="-Wa,-a64 -m64 -msoft-float -fno-builtin" AS_FLAGS="-Wa,-a64" - BASEARCH=ppc ;;
sparc32)