aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/bin/lp.functions
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2020-11-14 23:13:58 +0100
committerNico Huber <nico.h@gmx.de>2021-01-01 21:41:48 +0000
commitdc5c83812b0d4ff506a71a226d3c575a995283e4 (patch)
tree7b9bf74977820bccf4f807145d49bee90f34b86c /payloads/libpayload/bin/lp.functions
parent1dba2ed806e6d1d095556e4f8cdfdb71f98641cb (diff)
libpayload/lpgcc: Turn references to build dir into a variable
Introduce a `$_OBJ` variable, that points to the build directory for in-tree usage of `lpgcc`. If unset, the default `../build` relative to the location of `lpgcc` is used. Change-Id: I35112d7533d69aa51252dd2bceec010a62522403 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/47629 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads/libpayload/bin/lp.functions')
-rw-r--r--payloads/libpayload/bin/lp.functions8
1 files changed, 6 insertions, 2 deletions
diff --git a/payloads/libpayload/bin/lp.functions b/payloads/libpayload/bin/lp.functions
index 3911c42a5b..8d784ebbd4 100644
--- a/payloads/libpayload/bin/lp.functions
+++ b/payloads/libpayload/bin/lp.functions
@@ -35,6 +35,10 @@ warn() {
echo "Warning: $1"
}
+# For in-tree builds, allow to override the libpayload build dir.
+
+_OBJ=${_OBJ:-$BASE/../build}
+
# If the user didn't specify LIBPAYLOAD_PREFIX, then preload it
# with the default prefix value
@@ -48,8 +52,8 @@ fi
if [ -f $BASE/../lib/libpayload.a ]; then
_LIBDIR=$BASE/../lib
-elif [ -f $BASE/../build/libpayload.a ]; then
- _LIBDIR=$BASE/../build
+elif [ -f $_OBJ/libpayload.a ]; then
+ _LIBDIR=$_OBJ
else
_LIBDIR=$LIBPAYLOAD_PREFIX/lib
fi