setup-hook.sh: use eval for dynamic variable export
This commit is contained in:
parent
06688b73ca
commit
6d52db43d4
@ -1,3 +1,4 @@
|
||||
# shellcheck shell=bash
|
||||
# Binutils Wrapper hygiene
|
||||
#
|
||||
# See comments in cc-wrapper's setup hook. This works exactly the same way.
|
||||
@ -14,7 +15,9 @@ bintoolsWrapper_addLDVars () {
|
||||
getHostRoleEnvHook
|
||||
|
||||
if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then
|
||||
export NIX_LDFLAGS${role_post}+=" -L$1/lib64"
|
||||
varName=NIX_LDFLAGS${role_post}
|
||||
eval "$varName=\"${!varName:-} -L$1/lib64\""
|
||||
export "${varName?}"
|
||||
fi
|
||||
|
||||
if [[ -d "$1/lib" ]]; then
|
||||
@ -24,7 +27,9 @@ bintoolsWrapper_addLDVars () {
|
||||
# directories and bloats the size of the environment variable space.
|
||||
local -a glob=( $1/lib/lib* )
|
||||
if [ "${#glob[*]}" -gt 0 ]; then
|
||||
export NIX_LDFLAGS${role_post}+=" -L$1/lib"
|
||||
varName=NIX_LDFLAGS${role_post}
|
||||
eval "$varName=\"${!varName:-} -L$1/lib\""
|
||||
export "${varName?}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user