[gentoo-dev] [PATCH 4/4] toolchain-funcs.eclass: Add helpful tc-is-{gcc,clang} wrappers

2016-06-24 Thread Michał Górny
--- eclass/tests/toolchain-funcs.sh | 28 eclass/toolchain-funcs.eclass | 12 2 files changed, 40 insertions(+) diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh index 6f37996..e6a1538 100755 ---

[gentoo-dev] [PATCH 3/4] toolchain-funcs.eclass: Add tc-get-compiler-type()

2016-06-24 Thread Michał Górny
Add a tc-get-compiler-type() function that can be used to identify the compiler being used, using the preprocessor defines. Alike gcc-*version() routines, it uses CPP (which in turn uses CC). The major usage would be applying compiler-specific quirks and limiting gcc version checks to compilers

[gentoo-dev] [PATCH 2/4] toolchain-funcs.eclass: Assume CPP="$(tc-getCC) -E" when unset, #582822

2016-06-24 Thread Michał Górny
Modify the tc-getCPP and tc-getBUILD_CPP functions to use "$(tc-getCC) -E" (i.e. the C compiler's preprocessing call) instead of falling back to 'cpp'. This ensures that in environment with CC (and CXX) overriden the correct compiler is used rather than the one selected by gcc-config, which in

[gentoo-dev] [PATCH 1/4] toolchain-funcs.eclass: Fix _tc-getPROG with multi-parameter defaults

2016-06-24 Thread Michał Górny
Fix _tc-getPROG function to account correctly for default values that contain program name along with arguments, e.g. the default for CPP containing "$(CC) -E". --- eclass/toolchain-funcs.eclass | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

[gentoo-dev] [PATCH v4] tc-get-compiler-type() + wrappers

2016-06-24 Thread Michał Górny
Here's a quick v4. Changes: - fixed CHOST-search logic for multi-parameter default, - replaced redundant tc-getCC call in tc-getCPP by plain ${CC:-gcc} since tc-getCPP will perform search anyway, - changed docs for tc-get* to @OUTPUT.

Re: [gentoo-dev] Re: [PATCH 4/4] toolchain-funcs.eclass: Add helpful tc-is-{gcc,clang} wrappers

2016-06-24 Thread Mike Frysinger
On 24 Jun 2016 07:40, Michał Górny wrote: > On Thu, 23 Jun 2016 21:32:34 -0400 Mike Frysinger wrote: > > On 22 Jun 2016 22:06, Michał Górny wrote: > > > +# @FUNCTION: tc-is-gcc > > > +# @DESCRIPTION: > > > +# Return true if the current compiler is pure GCC. > > > > "pure" doesn't make much