[OpenBIOS] [PATCH] switch-arch: Add non-standard compiler prefix support

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sun May 10 11:23:52 CEST 2015


Allow a user-defined compiler prefix to be specified via the CROSS_COMPILE
variable when running switch-arch, e.g.

    CROSS_COMPILE=powerpc-linux- ./config/scripts/switch-arch ppc

Based upon an original patch by John Arbuckle <programmingkidx at gmail.com>.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/config/scripts/switch-arch |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/openbios-devel/config/scripts/switch-arch b/openbios-devel/config/scripts/switch-arch
index 868eae6..d5e2f77 100755
--- a/openbios-devel/config/scripts/switch-arch
+++ b/openbios-devel/config/scripts/switch-arch
@@ -99,7 +99,13 @@ archname()
 
 select_prefix()
 {
-    for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
+    TARGETS="${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-"
+
+    if [ x"$CROSS_COMPILE" != "x" ]; then
+        TARGETS=$CROSS_COMPILE
+    fi
+
+    for TARGET in $TARGETS
     do
         if type ${TARGET}gcc > /dev/null 2>&1
         then
-- 
1.7.10.4




More information about the OpenBIOS mailing list