summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-06-22 21:54:44 +0200
committerMichał Górny <mgorny@gentoo.org>2016-06-26 17:34:47 +0200
commit6984a5b149a215dd96a9759d3d1f251354faf38f (patch)
treed838cbd9ce566773b95a357ee00a2d0d73c5a992 /eclass/toolchain-funcs.eclass
parenttoolchain-funcs.eclass: Add tc-get-compiler-type() (diff)
downloadgentoo-6984a5b149a215dd96a9759d3d1f251354faf38f.tar.gz
gentoo-6984a5b149a215dd96a9759d3d1f251354faf38f.tar.bz2
gentoo-6984a5b149a215dd96a9759d3d1f251354faf38f.zip
toolchain-funcs.eclass: Add helpful tc-is-{gcc,clang} wrappers
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r--eclass/toolchain-funcs.eclass12
1 files changed, 12 insertions, 0 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index a29784cd14a4..d3abfb528936 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -607,6 +607,18 @@ tc-get-compiler-type() {
esac
}
+# @FUNCTION: tc-is-gcc
+# @RETURN: Shell true if the current compiler is GCC, false otherwise.
+tc-is-gcc() {
+ [[ $(tc-get-compiler-type) == gcc ]]
+}
+
+# @FUNCTION: tc-is-clang
+# @RETURN: Shell true if the current compiler is clang, false otherwise.
+tc-is-clang() {
+ [[ $(tc-get-compiler-type) == clang ]]
+}
+
# Internal func. The first argument is the version info to expand.
# Query the preprocessor to improve compatibility across different
# compilers rather than maintaining a --version flag matrix. #335943