summaryrefslogtreecommitdiff
path: root/util/xcompile
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2015-08-03 16:46:29 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-08-10 20:28:48 +0200
commit15dd6c2fa3b0953248a6a22b1b4b68c27b4c9c63 (patch)
tree7379a85c0c0f75edbfa96ade812f90a9a9b27055 /util/xcompile
parent6a106943d020015fdeccb7a40a1e1f3e04ef9369 (diff)
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>
Diffstat (limited to 'util/xcompile')
-rwxr-xr-xutil/xcompile/xcompile14
1 files changed, 13 insertions, 1 deletions
diff --git a/util/xcompile/xcompile b/util/xcompile/xcompile
index c1c42afb84..4560771bfe 100755
--- a/util/xcompile/xcompile
+++ b/util/xcompile/xcompile
@@ -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