xcompile: crossgcc lookup in parent paths, for painless libpayload support

libpayload is calling the xcompile script from payloads/libpayload, so the
script never finds the path on its own and has to be fed the right XGCCPATH by
hand.

This makes xcompile look for the parent path too, so that it can find the
crossgcc toolchains when called from libpayload.

Change-Id: Icc41bb68e3a43810f40f03ab1eb08af07a50a3de
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Reviewed-on: http://review.coreboot.org/11119
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Paul Kocialkowski 2015-08-03 16:46:29 +02:00 committed by Stefan Reinauer
parent 6a106943d0
commit 15dd6c2fa3
1 changed files with 13 additions and 1 deletions

View File

@ -20,7 +20,19 @@
#
TMPFILE=""
XGCCPATH=${1:-"`pwd`/util/crossgcc/xgcc/bin/"}
XGCCPATH=$1
# libpayload crossgcc path
if [ -d "`pwd`/../../util/crossgcc/xgcc/bin/" ]
then
XGCCPATH=${XGCCPATH:-"`pwd`/../../util/crossgcc/xgcc/bin/"}
fi
# coreboot crossgcc path
if [ -d "`pwd`/util/crossgcc/xgcc/bin/" ]
then
XGCCPATH=${XGCCPATH:-"`pwd`/util/crossgcc/xgcc/bin/"}
fi
die() {
echo "ERROR: $*" >&2