diff options
author | Alexey Neyman <stilor@att.net> | 2018-11-01 23:39:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-01 23:39:42 (GMT) |
commit | cc403506161efd9209dd1c543ca0c458ee5439b6 (patch) | |
tree | 3d4ba10e68b92e2f543c0f95a115f274efb1b929 /scripts/functions | |
parent | 7c4c6892b9a5ea8e989ecb8a120db4d9f3aa46f6 (diff) | |
parent | f232d6d09a895b4be25cd01008f76afd3a673ac2 (diff) |
Merge pull request #1078 from stilor/force-bfd-linker
Add an ability to modify an exported variable
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/functions b/scripts/functions index 272f368..ab235d8 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 |