summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-04-25 19:25:57 +0000
committerimp <imp@FreeBSD.org>2014-04-25 19:25:57 +0000
commita55b178478e3ea738e1f213cc3b6a4aee7080f8b (patch)
tree685f9360c5fb411e2df4e4ccff959f43efd3d5a5
parent6abbfe5b87293077a437d632d786c1dd7344c85d (diff)
downloadFreeBSD-src-a55b178478e3ea738e1f213cc3b6a4aee7080f8b.zip
FreeBSD-src-a55b178478e3ea738e1f213cc3b6a4aee7080f8b.tar.gz
Generalize FOO.clang to FOO.${COMPILER_TYPE}. There's no reason these
need to be clang specific. Also generalize things a bit.
-rw-r--r--share/mk/bsd.sys.mk27
1 files changed, 10 insertions, 17 deletions
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index 3428edc..c94ca61 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -30,10 +30,9 @@ CFLAGS+= -std=${CSTD}
.if defined(WARNS)
.if ${WARNS} >= 1
CWARNFLAGS+= -Wsystem-headers
-.if !defined(NO_WERROR) && (${COMPILER_TYPE} != "clang" \
- || !defined(NO_WERROR.clang))
+.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE})
CWARNFLAGS+= -Werror
-.endif # !NO_WERROR && (!CLANG || !NO_WERROR.clang)
+.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE}
.endif # WARNS >= 1
.if ${WARNS} >= 2
CWARNFLAGS+= -Wall -Wno-format-y2k
@@ -45,10 +44,9 @@ CWARNFLAGS+= -W -Wno-unused-parameter -Wstrict-prototypes\
.if ${WARNS} >= 4
CWARNFLAGS+= -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow\
-Wunused-parameter
-.if !defined(NO_WCAST_ALIGN) && (${COMPILER_TYPE} != "clang" \
- || !defined(NO_WCAST_ALIGN.clang))
+.if !defined(NO_WCAST_ALIGN) && !defined(NO_WCAST_ALIGN.${COMPILER_TYPE})
CWARNFLAGS+= -Wcast-align
-.endif # !NO_WCAST_ALIGN && (!CLANG || !NO_WCAST_ALIGN.clang)
+.endif # !NO_WCAST_ALIGN !NO_WCAST_ALIGN.${COMPILER_TYPE}
.endif # WARNS >= 4
# BDECFLAGS
.if ${WARNS} >= 6
@@ -99,15 +97,14 @@ CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args
CWARNFLAGS+= -Wno-format-nonliteral
.endif # WARNS <= 3
.endif # CLANG
-.if !defined(NO_WERROR) && (${COMPILER_TYPE} != "clang" \
- || !defined(NO_WERROR.clang))
+.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE})
CWARNFLAGS+= -Werror
-.endif # !NO_WERROR && (!CLANG || !NO_WERROR.clang)
+.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE}
.endif # WFORMAT > 0
.endif # WFORMAT
-.if defined(NO_WFORMAT) || (${COMPILER_TYPE} == "clang" && defined(NO_WFORMAT.clang))
+.if defined(NO_WFORMAT) || defined(NO_WFORMAT.${COMPILER_TYPE})
CWARNFLAGS+= -Wno-format
-.endif # NO_WFORMAT || (CLANG && NO_WFORMAT.clang)
+.endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE}
.endif # !NO_WARNS
.if defined(IGNORE_PRAGMA)
@@ -130,13 +127,9 @@ CFLAGS+= -fno-dwarf2-cfi-asm
# Eventually we'll want to start building the base system C++ code as C++11,
# but not yet.
CXXFLAGS+= -Wno-c++11-extensions
-CFLAGS+= ${CFLAGS.clang}
-CXXFLAGS+= ${CXXFLAGS.clang}
-.else # !CLANG
-GCC_MS_EXTENSIONS= -fms-extensions
-CFLAGS+= ${CFLAGS.gcc}
-CXXFLAGS+= ${CXXFLAGS.gcc}
.endif # CLANG
+CFLAGS+= ${CFLAGS.${COMPILER_TYPE}}
+CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}}
.endif # !EARLY_BUILD
.if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \
OpenPOWER on IntegriCloud