xcompile: fail earlier on missing host tools
No need to test all the cross compiler things if there's no host compiler or iasl. Also test that the alternatives work, instead of assuming iasl or cc are in the path. Change-Id: I1d2293873f4bf1bb525d794851ec20adddb05ac6 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/5742 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
TMPFILE=""
|
TMPFILE=""
|
||||||
|
XGCCPATH=${1:-"`pwd`/util/crossgcc/xgcc/bin/"}
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
echo "ERROR: $*" >&2
|
echo "ERROR: $*" >&2
|
||||||
@ -36,6 +37,32 @@ program_exists() {
|
|||||||
type "$1" >/dev/null 2>&1
|
type "$1" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if [ "$(${XGCCPATH}/iasl 2>/dev/null | grep -c ACPI)" -gt 0 ]; then
|
||||||
|
IASL=${XGCCPATH}iasl
|
||||||
|
elif [ "$(iasl 2>/dev/null | grep -c ACPI)" -gt 0 ]; then
|
||||||
|
IASL=iasl
|
||||||
|
else
|
||||||
|
echo "no iasl found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if program_exists gcc; then
|
||||||
|
HOSTCC=gcc
|
||||||
|
elif program_exists cc; then
|
||||||
|
HOSTCC=cc
|
||||||
|
else
|
||||||
|
echo "no host compiler found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
# platform agnostic and host tools
|
||||||
|
IASL:=${IASL}
|
||||||
|
HOSTCC:=${HOSTCC}
|
||||||
|
|
||||||
|
EOF
|
||||||
|
|
||||||
testcc() {
|
testcc() {
|
||||||
local tmp_c="$TMPFILE.c"
|
local tmp_c="$TMPFILE.c"
|
||||||
local tmp_o="$TMPFILE.o"
|
local tmp_o="$TMPFILE.o"
|
||||||
@ -163,8 +190,6 @@ arch_config_x86() {
|
|||||||
TWIDTH="32"
|
TWIDTH="32"
|
||||||
}
|
}
|
||||||
|
|
||||||
XGCCPATH=${1:-"`pwd`/util/crossgcc/xgcc/bin/"}
|
|
||||||
|
|
||||||
# This loops over all supported architectures.
|
# This loops over all supported architectures.
|
||||||
for architecture in $SUPPORTED_ARCHITECTURE; do
|
for architecture in $SUPPORTED_ARCHITECTURE; do
|
||||||
GCCPREFIX="invalid"
|
GCCPREFIX="invalid"
|
||||||
@ -207,21 +232,3 @@ for architecture in $SUPPORTED_ARCHITECTURE; do
|
|||||||
report_arch_toolchain
|
report_arch_toolchain
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ "$(${XGCCPATH}/iasl 2>/dev/null | grep -c ACPI)" -gt 0 ]; then
|
|
||||||
IASL=${XGCCPATH}iasl
|
|
||||||
else
|
|
||||||
IASL=iasl
|
|
||||||
fi
|
|
||||||
|
|
||||||
if program_exists gcc; then
|
|
||||||
HOSTCC=gcc
|
|
||||||
else
|
|
||||||
HOSTCC=cc
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat <<EOF
|
|
||||||
IASL:=${IASL}
|
|
||||||
|
|
||||||
# native toolchain
|
|
||||||
HOSTCC:=${HOSTCC}
|
|
||||||
EOF
|
|
||||||
|
Reference in New Issue
Block a user