On Sun, May 10, 2015 at 05:08:33PM -0400, Programmingkid wrote:
On May 10, 2015, at 5:23 AM, Mark Cave-Ayland wrote:
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@gmail.com.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@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
I still prefer CROSS_COMPILER to CROSS_COMPILE, but I can live with the change.
What advantage does the code "if [ x"$CROSS_COMPILE" != "x" ];" have over "if [ "$CROSS_COMPILE" ];"?
Did you mean:
if [ -n "$CROSS_COMPILE" ];?