j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
This patch allows users to build OpenBIOS on Mac OS X! The user just needs to install the elf cross compiler before applying this patch.
signed-off-by: John Arbuckle programmingkidx@gmail.com
Index: config/scripts/switch-arch =================================================================== --- config/scripts/switch-arch (revision 1117) +++ config/scripts/switch-arch (working copy) @@ -89,16 +89,27 @@
archname() { - HOSTARCH=`uname -m | sed -e s/i.86/x86/ -e s/i86pc/x86/ \ - -e s/sun4u/sparc64/ -e s/sparc$/sparc32/ \ - -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \ - -e "s/Power Macintosh/ppc/"` + OS_NAME=`uname` + if test "$OS_NAME" = "Darwin"; then # Can't depend on uname -m on Mac OS X + IS_64BIT=`sysctl hw.cpu64bit_capable` + if test "$IS_64BIT" = "hw.cpu64bit_capable: 1"; then + HOSTARCH="amd64" + else + HOSTARCH="x86" + fi + else + HOSTARCH=`uname -m | sed -e s/i.86/x86/ -e s/i86pc/x86/ \ + -e s/sun4u/sparc64/ -e s/sparc$/sparc32/ \ + -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \ + -e "s/Power Macintosh/ppc/"` + fi }
select_prefix() { - for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- + for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- ppc-elf- do + echo "Trying ${TARGET}gcc" if type ${TARGET}gcc > /dev/null 2>&1 then return
Attachments:
archname() {
- HOSTARCH=`uname -m | sed -e s/i.86/x86/ -e s/i86pc/x86/ \
- -e s/sun4u/sparc64/ -e s/sparc$/sparc32/ \
- -e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \
- -e "s/Power Macintosh/ppc/"`
- OS_NAME=`uname`
- if test "$OS_NAME" = "Darwin"; then # Can't depend on uname -
m on Mac OS X
IS_64BIT=`sysctl hw.cpu64bit_capable`
if test "$IS_64BIT" = "hw.cpu64bit_capable: 1"; then
HOSTARCH="amd64"
else
HOSTARCH="x86"
fi
- else
HOSTARCH=`uname -m | sed -e s/i.86/x86/ -e s/i86pc/x86/ \
-e s/sun4u/sparc64/ -e s/sparc$/sparc32/ \
-e s/arm.*/arm/ -e s/sa110/arm/ -e s/x86_64/amd64/ \
-e "s/Power Macintosh/ppc/"`
- fi
}
This is wrong. "uname" does not tell you the machine architecture; "uname -m" does, at least on my PowerPC Macs. Also:
$ sysctl hw.cpu64bit_capable second level name cpu64bit_capable in hw.cpu64bit_capable is invalid
select_prefix() {
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-
linux- ${1}-elf- ${1}-eabi-
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-
linux- ${1}-elf- ${1}-eabi- ppc-elf-
This is also wrong. ppc-elf is neither a canonical nor a common prefix. Whoever built your toolchain was hellbent on making life difficult for the users of said toolchain.
do
echo "Trying ${TARGET}gcc"
Not everyone wants to see your debug output, did you forget to remove it?
Segher