[OpenBIOS] [RFC] cross-compiler detection does not work with dash
Andreas Färber
andreas.faerber at web.de
Fri Apr 23 15:17:30 CEST 2010
Am 23.04.2010 um 14:44 schrieb Andreas Färber:
> On Ubuntu Karmic `./config/scripts/switch-arch cross-ppc` did not
> recognize my powerpc-elf-gcc. The GNOME Terminal appears to use
> bash, where `type -p powerpc-elf-gcc && echo yah` works, but /bin/sh
> is dash, where it does not:
> echo "type -p powerpc-elf-gcc && echo yah" | /bin/sh
...and if we actually do it like that, without 2>/dev/null, we see:
-p: not found
So dash's `type` does not seem to support the -p parameter, whatever
that does. Without -p it works, too.
Andreas
diff --git a/config/scripts/switch-arch b/config/scripts/switch-arch
index c145e86..b7511e7 100755
--- a/config/scripts/switch-arch
+++ b/config/scripts/switch-arch
@@ -88,7 +88,7 @@ select_prefix()
{
for TARGET in ${1}-linux-gnu- ${1}-elf- ${1}-eabi-
do
- if type -p ${TARGET}gcc > /dev/null
+ if type ${TARGET}gcc > /dev/null
then
return
fi
More information about the OpenBIOS
mailing list