diff options
author | Michał Górny <mgorny@gentoo.org> | 2016-06-22 21:54:44 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2016-06-26 17:34:47 +0200 |
commit | 6984a5b149a215dd96a9759d3d1f251354faf38f (patch) | |
tree | d838cbd9ce566773b95a357ee00a2d0d73c5a992 /eclass/tests/toolchain-funcs.sh | |
parent | toolchain-funcs.eclass: Add tc-get-compiler-type() (diff) | |
download | gentoo-6984a5b149a215dd96a9759d3d1f251354faf38f.tar.gz gentoo-6984a5b149a215dd96a9759d3d1f251354faf38f.tar.bz2 gentoo-6984a5b149a215dd96a9759d3d1f251354faf38f.zip |
toolchain-funcs.eclass: Add helpful tc-is-{gcc,clang} wrappers
Diffstat (limited to 'eclass/tests/toolchain-funcs.sh')
-rwxr-xr-x | eclass/tests/toolchain-funcs.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/eclass/tests/toolchain-funcs.sh b/eclass/tests/toolchain-funcs.sh index 6f3799679a00..e6a15389c913 100755 --- a/eclass/tests/toolchain-funcs.sh +++ b/eclass/tests/toolchain-funcs.sh @@ -120,6 +120,20 @@ export CC=gcc ) tend $? +tbegin "tc-is-gcc (gcc)" +( +export CC=gcc +tc-is-gcc +) +tend $? + +tbegin "! tc-is-clang (gcc)" +( +export CC=gcc +! tc-is-clang +) +tend $? + if type -P clang &>/dev/null; then tbegin "tc-get-compiler-type (clang)" ( @@ -127,6 +141,20 @@ if type -P clang &>/dev/null; then [[ $(tc-get-compiler-type) == clang ]] ) tend $? + + tbegin "! tc-is-gcc (clang)" + ( + export CC=clang + ! tc-is-gcc + ) + tend $? + + tbegin "tc-is-clang (clang)" + ( + export CC=clang + tc-is-clang + ) + tend $? fi if type -P pathcc &>/dev/null; then |