summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-08-17 20:39:28 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-08-17 20:39:28 +0000
commitf63ab9228e0818135be1431b017306e2062147ae (patch)
treee9956831a046982571c4a2200db030fbab894a73 /share
parentb449f3828322f9f90a73e893ab857f0773d9832c (diff)
downloadFreeBSD-src-f63ab9228e0818135be1431b017306e2062147ae.zip
FreeBSD-src-f63ab9228e0818135be1431b017306e2062147ae.tar.gz
For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename of the compiler command (excluding any arguments) is considered. This allows you to use, for example, CC="/nondefault/path/clang -xxx", and still have the various tests in bsd.*.mk identify your compiler as clang correctly. ICC if cases were also changed. Submitted by: Dimitry Andric <dimitry at andric.com>
Diffstat (limited to 'share')
-rw-r--r--share/mk/bsd.dep.mk2
-rw-r--r--share/mk/bsd.lib.mk2
-rw-r--r--share/mk/bsd.sys.mk6
3 files changed, 5 insertions, 5 deletions
diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
index a683a09..7921ea7 100644
--- a/share/mk/bsd.dep.mk
+++ b/share/mk/bsd.dep.mk
@@ -125,7 +125,7 @@ depend: beforedepend ${DEPENDFILE} afterdepend
# Different types of sources are compiled with slightly different flags.
# Split up the sources, and filter out headers and non-applicable flags.
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
MKDEP_CFLAGS= ${CFLAGS:M-X*} ${CFLAGS:M-[BIDU]*}
MKDEP_CXXFLAGS= ${CXXFLAGS:M-X*} ${CXXFLAGS:M-[BIDU]*}
MKDEP_OBJCFLAGS=${OBJCFLAGS:M-X*} ${OBJCFLAGS:M-[BIDU]*}
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 80c4264..94d918b 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -65,7 +65,7 @@ PICFLAG=-fpic
.endif
.endif
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
PO_FLAG=-p
.else
PO_FLAG=-pg
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 97860f2..3559a267 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -11,7 +11,7 @@
# the default is gnu99 for now
CSTD ?= gnu99
-.if ${CC} != "icc"
+.if ${CC:T:Micc} != "icc"
. if ${CSTD} == "k&r"
CFLAGS += -traditional
. elif ${CSTD} == "c89" || ${CSTD} == "c90"
@@ -24,7 +24,7 @@ CFLAGS += -std=iso9899:1999
CFLAGS += -std=${CSTD}
. endif
.endif
-.if !defined(NO_WARNS) && ${CC} != "icc"
+.if !defined(NO_WARNS) && ${CC:T:Micc} != "icc"
# -pedantic is problematic because it also imposes namespace restrictions
#CFLAGS += -pedantic
. if defined(WARNS)
@@ -79,7 +79,7 @@ CWARNFLAGS += -Werror
CWARNFLAGS += -Wno-unknown-pragmas
.endif
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
+.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && ${MACHINE_ARCH} != "ia64" && \
${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
# Don't use -Wstack-protector as it breaks world with -Werror.
SSP_CFLAGS ?= -fstack-protector
OpenPOWER on IntegriCloud