From f232d6d09a895b4be25cd01008f76afd3a673ac2 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Thu, 1 Nov 2018 15:50:12 -0700 Subject: Add an ability to modify an exported variable ... and use that ability to permanently set CTNG_LD_IS in case gold is default linker and we're building glibc. Fixes #988. This was a long-standing breakage in crosstool-NG (at least since it began to run each step in a sub-shell). Signed-off-by: Alexey Neyman --- scripts/functions | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts/functions') diff --git a/scripts/functions b/scripts/functions index 272f3687..ab235d89 100644 --- a/scripts/functions +++ b/scripts/functions @@ -1026,9 +1026,15 @@ CT_DoConfigSub() { # Normally, each step is executed in a sub-shell and thus cannot modify the # environment for the next step(s). When this is needed, it can do so by # invoking this function. -# Usage: CT_EnvModify VAR VALUE +# Usage: CT_EnvModify [export] VAR VALUE CT_EnvModify() { - echo "${1}=\"${2}\"" >> "${CT_BUILD_DIR}/env.modify.sh" + local e + if [ "$1" = "export" ]; then + shift + e="export " + fi + eval "${e}${1}=\"${2}\"" + echo "${e}${1}=\"${2}\"" >> "${CT_BUILD_DIR}/env.modify.sh" } # Compute the target tuple from what is provided by the user -- cgit v1.2.3