bintools-wrapper: Define env vars with full path

This commit is contained in:
John Ericson 2018-08-06 18:35:56 -04:00
parent 1dc0404d6e
commit 044a73bbe6

View File

@ -59,11 +59,11 @@ for cmd in \
ar as ld nm objcopy objdump readelf ranlib strip strings size windres ar as ld nm objcopy objdump readelf ranlib strip strings size windres
do do
if if
PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null cmd_path=$(PATH=$_PATH command -v "@targetPrefix@${cmd}")
then then
upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")" upper_case="$(echo "$cmd" | tr "[:lower:]" "[:upper:]")"
export "${role_pre}${upper_case}=@targetPrefix@${cmd}"; export "${role_pre}${upper_case}=${cmd_path}";
export "${upper_case}${role_post}=@targetPrefix@${cmd}"; export "${upper_case}${role_post}=${cmd_path}";
fi fi
done done
@ -72,5 +72,5 @@ done
export NIX_HARDENING_ENABLE export NIX_HARDENING_ENABLE
# No local scope in sourced file # No local scope in sourced file
unset -v role_pre role_post cmd upper_case unset -v role_pre role_post cmd cmd_path upper_case
set +u set +u