1 |
commit: ea988da8e02e1ba501c73c961147f6ec63c58033 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 8 08:30:29 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 1 10:34:45 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea988da8 |
7 |
|
8 |
toolchain-funcs.eclass: Use host vars in tc-getBUILD* when not cross |
9 |
|
10 |
Make tc-getBUILD* functions respect host variables (CC & co.) when |
11 |
not cross-compiling. This removes the necessity of overriding BUILD_* |
12 |
along with the regular variables on the systems that are not concerned |
13 |
about cross-compilation, and does not change the behavior for those |
14 |
which are. |
15 |
|
16 |
Closes: https://bugs.gentoo.org/630282 |
17 |
|
18 |
eclass/toolchain-funcs.eclass | 10 ++++++++-- |
19 |
1 file changed, 8 insertions(+), 2 deletions(-) |
20 |
|
21 |
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass |
22 |
index aeb6f7c7029..4b1876b8e09 100644 |
23 |
--- a/eclass/toolchain-funcs.eclass |
24 |
+++ b/eclass/toolchain-funcs.eclass |
25 |
@@ -1,4 +1,4 @@ |
26 |
-# Copyright 1999-2017 Gentoo Foundation |
27 |
+# Copyright 1999-2018 Gentoo Foundation |
28 |
# Distributed under the terms of the GNU General Public License v2 |
29 |
|
30 |
# @ECLASS: toolchain-funcs.eclass |
31 |
@@ -40,7 +40,13 @@ _tc-getPROG() { |
32 |
export ${var}="${prog[*]}" |
33 |
echo "${!var}" |
34 |
} |
35 |
-tc-getBUILD_PROG() { _tc-getPROG CBUILD "BUILD_$1 $1_FOR_BUILD HOST$1" "${@:2}"; } |
36 |
+tc-getBUILD_PROG() { |
37 |
+ local vars="BUILD_$1 $1_FOR_BUILD HOST$1" |
38 |
+ # respect host vars if not cross-compiling |
39 |
+ # https://bugs.gentoo.org/630282 |
40 |
+ tc-is-cross-compiler || vars+=" $1" |
41 |
+ _tc-getPROG CBUILD "${vars}" "${@:2}" |
42 |
+} |
43 |
tc-getPROG() { _tc-getPROG CHOST "$@"; } |
44 |
|
45 |
# @FUNCTION: tc-getAR |