Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: toolchain@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross
Date: Fri, 08 Sep 2017 08:33:27
Message-Id: 20170908083311.5790-1-mgorny@gentoo.org
1 Make tc-getBUILD* functions respect host variables (CC & co.) when
2 not cross-compiling. This removes the necessity of overriding BUILD_*
3 along with the regular variables on the systems that are not concerned
4 about cross-compilation, and does not change the behavior for those
5 which are.
6
7 Closes: https://bugs.gentoo.org/630282
8 ---
9 eclass/toolchain-funcs.eclass | 8 +++++++-
10 1 file changed, 7 insertions(+), 1 deletion(-)
11
12 diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
13 index aeb6f7c70299..75fa638efff3 100644
14 --- a/eclass/toolchain-funcs.eclass
15 +++ b/eclass/toolchain-funcs.eclass
16 @@ -40,7 +40,13 @@ _tc-getPROG() {
17 export ${var}="${prog[*]}"
18 echo "${!var}"
19 }
20 -tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; }
21 +tc-getBUILD_PROG() {
22 + local vars="BUILD_$1 $1_FOR_BUILD HOST$1"
23 + # respect host vars if not cross-compiling
24 + # https://bugs.gentoo.org/630282
25 + tc-is-cross-compiler || vars+=" $1"
26 + _tc-getPROG CBUILD "${vars}" "${@:2}"
27 +}
28 tc-getPROG() { _tc-getPROG CHOST "$@"; }
29
30 # @FUNCTION: tc-getAR
31 --
32 2.14.1

Replies