summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-09-08 10:30:29 +0200
committerMichał Górny <mgorny@gentoo.org>2018-01-01 11:34:45 +0100
commitea988da8e02e1ba501c73c961147f6ec63c58033 (patch)
treeb08eeb2e2bebb4d623dfd67f674e045145cea011 /eclass/toolchain-funcs.eclass
parenttmpfiles.eclass: Explicit warn on ROOT != / to avoid breakage (diff)
downloadgentoo-ea988da8e02e1ba501c73c961147f6ec63c58033.tar.gz
gentoo-ea988da8e02e1ba501c73c961147f6ec63c58033.tar.bz2
gentoo-ea988da8e02e1ba501c73c961147f6ec63c58033.zip
toolchain-funcs.eclass: Use host vars in tc-getBUILD* when not cross
Make tc-getBUILD* functions respect host variables (CC & co.) when not cross-compiling. This removes the necessity of overriding BUILD_* along with the regular variables on the systems that are not concerned about cross-compilation, and does not change the behavior for those which are. Closes: https://bugs.gentoo.org/630282
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r--eclass/toolchain-funcs.eclass10
1 files changed, 8 insertions, 2 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index aeb6f7c70299..4b1876b8e09b 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: toolchain-funcs.eclass
@@ -40,7 +40,13 @@ _tc-getPROG() {
export ${var}="${prog[*]}"
echo "${!var}"
}
-tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; }
+tc-getBUILD_PROG() {
+ local vars="BUILD_$1 $1_FOR_BUILD HOST$1"
+ # respect host vars if not cross-compiling
+ # https://bugs.gentoo.org/630282
+ tc-is-cross-compiler || vars+=" $1"
+ _tc-getPROG CBUILD "${vars}" "${@:2}"
+}
tc-getPROG() { _tc-getPROG CHOST "$@"; }
# @FUNCTION: tc-getAR