toolchain-funcs.eclass: Add tc-get-compiler-type()
authorMichał Górny <mgorny@gentoo.org>
Wed, 22 Jun 2016 19:50:21 +0000 (21:50 +0200)
committerMichał Górny <mgorny@gentoo.org>
Sun, 26 Jun 2016 15:34:47 +0000 (17:34 +0200)
commit2fea606eba41d9246f510814ce833879368bd835
tree98345156df535f81b749e0f5b9162f7e6f0e494f
parentc65f6083898968b5442eeb66afd4298a3b4264e2
toolchain-funcs.eclass: Add tc-get-compiler-type()

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 that actually are gcc, since e.g. clang
reports gcc version 4.2 -- which would incorrectly cause numerous gcc
version checks in ebuilds to fail.
eclass/tests/toolchain-funcs.sh
eclass/toolchain-funcs.eclass