toolchain-funcs.eclass: Assume CPP="$(tc-getCC) -E" when unset, #582822
authorMichał Górny <mgorny@gentoo.org>
Fri, 17 Jun 2016 07:30:26 +0000 (09:30 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 26 Jun 2016 15:34:47 +0000 (17:34 +0200)
commitc65f6083898968b5442eeb66afd4298a3b4264e2
tree2c37f0dc0f16a0dd0f2fea8a61f5dfdb4cf50a17
parent66d4ffc4ef0dfbf7cd135cd7c54d6623c130c9a4
toolchain-funcs.eclass: Assume CPP="$(tc-getCC) -E" when unset, #582822

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 turn fixes gcc version queries.

The alternative would be to always override CPP along with CC & CXX.
However, that is uncommon and is known to break some packages.

Bug: https://bugs.gentoo.org/show_bug.cgi?id=582822
eclass/toolchain-funcs.eclass