aboutsummaryrefslogtreecommitdiff
path: root/share/mk/bsd.compiler.mk
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2014-05-23 14:34:22 +0000
committerWarner Losh <imp@FreeBSD.org>2014-05-23 14:34:22 +0000
commit79f387daa86f089c30ad99ec2afc28ca95477563 (patch)
tree063560a7726a517dcc5774295fc7f24f5b7170db /share/mk/bsd.compiler.mk
parentaedb7289daa2a317e883cac7d100c98c0bc33542 (diff)
downloadsrc-79f387daa86f089c30ad99ec2afc28ca95477563.tar.gz
src-79f387daa86f089c30ad99ec2afc28ca95477563.zip
Allow CC to not actually exist. During the ports INDEX run, all the
Makefiles are evaluated without building things. In a normal build, the prerequisites would be built, and CC would be an actual thing. In an INDEX build, though, they don't exists. Redirect stderr to get rid of annoying messages, and assume that the compiler version is 0 if the actual compiler can't tell us. Do this in preference to guessing based on numbers because gcc410 might be 4.10, or 4.1.0 and without carefully crafted special knowledge we differentiate between them easily (also ming-gcc has no clues at all). Elsewhere, don't trust the compiler version if it is 0.
Notes
Notes: svn path=/head/; revision=266587
Diffstat (limited to 'share/mk/bsd.compiler.mk')
-rw-r--r--share/mk/bsd.compiler.mk6
1 files changed, 3 insertions, 3 deletions
diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk
index a4f3feceb654..c343adc86fae 100644
--- a/share/mk/bsd.compiler.mk
+++ b/share/mk/bsd.compiler.mk
@@ -21,11 +21,11 @@
.if !target(__<bsd.compiler.mk>__)
__<bsd.compiler.mk>__:
-_v!= ${CC} --version
+_v!= ${CC} --version 2>/dev/null || echo 0.0.0
.if !defined(COMPILER_TYPE)
-. if ${CC:T:Mgcc*}
+. if ${CC:T:M*gcc*}
COMPILER_TYPE:= gcc
-. elif ${CC:T:Mclang}
+. elif ${CC:T:M*clang*}
COMPILER_TYPE:= clang
. elif ${_v:Mgcc}
COMPILER_TYPE:= gcc