diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2020-05-24 21:37:10 +0100 |
---|---|---|
committer | Sergei Trofimovich <slyfox@gentoo.org> | 2020-05-24 22:03:30 +0100 |
commit | 0e7dee6536e88f69e96809f03dbab4861f81938b (patch) | |
tree | 6c54c22e4474c7399feae01c808bcbb2e45dd6a1 /eclass/multilib.eclass | |
parent | multilib.eclass: don't backup/restore AS (diff) | |
download | gentoo-0e7dee6536e88f69e96809f03dbab4861f81938b.tar.gz gentoo-0e7dee6536e88f69e96809f03dbab4861f81938b.tar.bz2 gentoo-0e7dee6536e88f69e96809f03dbab4861f81938b.zip |
multilib.eclass: consolidate save/restore list
To avoid duplicating save/restore variable lists
gathered the list into a separate helper local variables.
This change is a no-op.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'eclass/multilib.eclass')
-rw-r--r-- | eclass/multilib.eclass | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass index 857829dd17b2..e13aae2bb7f7 100644 --- a/eclass/multilib.eclass +++ b/eclass/multilib.eclass @@ -456,9 +456,21 @@ multilib_toolchain_setup() { export ABI=$1 + local save_restore_variables=( + CBUILD + CHOST + CC + CXX + F77 + FC + LD + PKG_CONFIG_LIBDIR + PKG_CONFIG_PATH + ) + # First restore any saved state we have laying around. if [[ ${_DEFAULT_ABI_SAVED} == "true" ]] ; then - for v in CHOST CBUILD CC CXX F77 FC LD PKG_CONFIG_{LIBDIR,PATH} ; do + for v in "${save_restore_variables[@]}" ; do vv="_abi_saved_${v}" [[ ${!vv+set} == "set" ]] && export ${v}="${!vv}" || unset ${v} unset ${vv} @@ -468,7 +480,7 @@ multilib_toolchain_setup() { if [[ ${ABI} != ${DEFAULT_ABI} ]] ; then # Back that multilib-ass up so we can restore it later - for v in CHOST CBUILD CC CXX F77 FC LD PKG_CONFIG_{LIBDIR,PATH} ; do + for v in "${save_restore_variables[@]}" ; do vv="_abi_saved_${v}" [[ ${!v+set} == "set" ]] && export ${vv}="${!v}" || unset ${vv} done @@ -481,6 +493,8 @@ multilib_toolchain_setup() { # Set the CHOST native first so that we pick up the native # toolchain and not a cross-compiler by accident #202811. + # + # Make sure ${save_restore_variables[@]} list matches below. export CHOST=$(get_abi_CHOST ${DEFAULT_ABI}) export AR="$(tc-getAR)" # Avoid 'ar', use '${CHOST}-ar' export CC="$(tc-getCC) $(get_abi_CFLAGS)" |