summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kircher <openembedded@hetsh.de>2023-01-10 17:11:18 +0100
committerSteve Sakoman <steve@sakoman.com>2023-01-19 13:00:34 -1000
commitad2b7b4d4138ac5f6f74f69d9d6d88a592b14c6f (patch)
tree4c0f70cfa05d607ee63e85e2ae44ad877929a5bc
parent44f59f5d8414cbe935addb57bd1ea9ffaf734fba (diff)
downloadopenembedded-core-ad2b7b4d4138ac5f6f74f69d9d6d88a592b14c6f.tar.gz
toolchain-scripts: compatibility with unbound variable protection
Fixed an error when Bash's unbound variable protection is enabled (set -u) and variable "LD_LIBRARY_PATH" does not exist. Signed-off-by: Jan Kircher <openembedded@hetsh.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 85685370b0ad93291cda59fb091a15eeecf5e0d5) Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r--meta/classes/toolchain-scripts.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/toolchain-scripts.bbclass b/meta/classes/toolchain-scripts.bbclass
index 1d7c703748..d2562b5d38 100644
--- a/meta/classes/toolchain-scripts.bbclass
+++ b/meta/classes/toolchain-scripts.bbclass
@@ -31,7 +31,7 @@ toolchain_create_sdk_env_script () {
echo '# http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80' >> $script
echo '# http://xahlee.info/UnixResource_dir/_/ldpath.html' >> $script
echo '# Only disable this check if you are absolutely know what you are doing!' >> $script
- echo 'if [ ! -z "$LD_LIBRARY_PATH" ]; then' >> $script
+ echo 'if [ ! -z "${LD_LIBRARY_PATH:-}" ]; then' >> $script
echo " echo \"Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH'\"" >> $script
echo " echo \"but please check why this was set in the first place and that it's safe to unset.\"" >> $script
echo ' echo "The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set."' >> $script