toolchain-funcs.eclass: fix tc-cpp-is-true() to work with clang
authorMattias Nissler <mnissler@chromium.org>
Mon, 4 Nov 2019 10:11:20 +0000 (10:11 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Wed, 6 Nov 2019 22:44:33 +0000 (22:44 +0000)
commit3ef6b33339da7bb04afd77e1bc5db011b02d658a
tree82f88edfa2044ef28ca390135d2cf159f08c90b4
parent4d6492792623e56a9017c91711e302bf4eaf992c
toolchain-funcs.eclass: fix tc-cpp-is-true() to work with clang

Clang's preprocessor likes to output a leading newline, which makes
the comparison always fail. GCC generates additional output with certain
flags (e.g. -ggdb3) as well. Hence, switch the test to trigger a
preprocessor error when the condition is not true and examine the exit
code.

Bug: https://bugs.gentoo.org/698912

Signed-off-by: Mattias Nissler <mnissler@chromium.org>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/toolchain-funcs.eclass