* [gentoo-dev] [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross
@ 2017-09-08 8:33 Michał Górny
2017-09-08 22:03 ` [gentoo-dev] " Sergei Trofimovich
0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2017-09-08 8:33 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain, Michał Górny
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
---
eclass/toolchain-funcs.eclass | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index aeb6f7c70299..75fa638efff3 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/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
--
2.14.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-dev] Re: [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross
2017-09-08 8:33 [gentoo-dev] [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross Michał Górny
@ 2017-09-08 22:03 ` Sergei Trofimovich
2017-09-09 7:06 ` Michał Górny
0 siblings, 1 reply; 3+ messages in thread
From: Sergei Trofimovich @ 2017-09-08 22:03 UTC (permalink / raw
To: Michał Górny; +Cc: gentoo-dev, toolchain
[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]
On Fri, 8 Sep 2017 10:33:11 +0200
Michał Górny <mgorny@gentoo.org> wrote:
> 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
> ---
> eclass/toolchain-funcs.eclass | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
> index aeb6f7c70299..75fa638efff3 100644
> --- a/eclass/toolchain-funcs.eclass
> +++ b/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
> --
> 2.14.1
>
Looks good. Worth adding actual ebuild name that failed for you.
--
Sergei
[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [gentoo-dev] Re: [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross
2017-09-08 22:03 ` [gentoo-dev] " Sergei Trofimovich
@ 2017-09-09 7:06 ` Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2017-09-09 7:06 UTC (permalink / raw
To: gentoo-dev; +Cc: toolchain
W dniu pią, 08.09.2017 o godzinie 23∶03 +0100, użytkownik Sergei
Trofimovich napisał:
> On Fri, 8 Sep 2017 10:33:11 +0200
> Michał Górny <mgorny@gentoo.org> wrote:
>
> > 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
> > ---
> > eclass/toolchain-funcs.eclass | 8 +++++++-
> > 1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
> > index aeb6f7c70299..75fa638efff3 100644
> > --- a/eclass/toolchain-funcs.eclass
> > +++ b/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
> > --
> > 2.14.1
> >
>
> Looks good. Worth adding actual ebuild name that failed for you.
>
No ebuild failed. Just noticed it's not respecting my CC/CXX.
--
Best regards,
Michał Górny
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-09 7:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-08 8:33 [gentoo-dev] [PATCH] toolchain-funcs: Respect host vars for tc-getBUILD* when not cross Michał Górny
2017-09-08 22:03 ` [gentoo-dev] " Sergei Trofimovich
2017-09-09 7:06 ` Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox