coreboot/util/xcompile/xcompile
Uwe Hermann 28cff651fe Minor bugfixes:
- lib/console.c: BIOS_SPEW never kicked in.

 - util/xcompile/xcompile: the "function" prefix isn't supported by all shells.

Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@364 f3766cd6-281f-0410-b1cd-43a5c92072e9
2007-06-20 17:21:49 +00:00

69 lines
2.2 KiB
Bash
Executable file

#!/bin/sh
#
# This file is part of the LinuxBIOS project.
#
# Copyright (C) 2007 coresystems GmbH
# (Written by Stefan Reinauer <stepan@coresystems.de> for coresystems GmbH)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
ARCH=`uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \
-e s/arm.*/arm/ -e s/sa110/arm/ \
-e s/s390x/s390/ -e s/parisc64/parisc/ \
-e s/ppc.*/powerpc/ -e s/mips.*/mips/`
searchgnu()
{
# $1 short name
# result: GNU version of that tool on stdout
# or no output if no GNU version was found
for i in "$1" "g$1" "gnu$1"; do
if test -x "`which $i 2>/dev/null`"; then
if test `$i --version 2>/dev/null |grep -c GNU` -gt 0; then
echo $i
return
fi
fi
done
echo "ERROR: Missing toolchain: $1" >&2
exit 1
}
case "$ARCH" in
"x86_64")
echo "CC_x86 := gcc -m32"
searchgnu as >/dev/null && echo "AS_x86 := $(searchgnu as) --32"
searchgnu ld >/dev/null && echo "LD_x86 := $(searchgnu ld) -b elf32-i386 -melf_i386"
searchgnu objcopy >/dev/null && echo "OBJCOPY_x86 := $(searchgnu objcopy)"
;;
"x86")
echo "CC_x86 := gcc"
searchgnu as >/dev/null && echo "AS_x86 := $(searchgnu as)"
searchgnu ld >/dev/null && echo "LD_x86 := $(searchgnu ld)"
searchgnu objcopy >/dev/null && echo "OBJCOPY_x86 := $(searchgnu objcopy)"
;;
*)
# FIXME: This should be detected.
echo "CC_x86 := i386-linux-gcc"
echo "AS_x86 := i386-linux-as"
echo "LD_x86 := i386-linux-ld"
echo "OBJCOPY_x86 := i386-linux-objcopy"
;;
esac
# TODO: The same as above for PowerPC, and other architectures
# as soon as they are supported by LinuxBIOSv3.