summaryrefslogtreecommitdiffstats
path: root/sys/conf/kern.pre.mk
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-03-03 18:58:15 +0000
committerdim <dim@FreeBSD.org>2012-03-03 18:58:15 +0000
commit35f5c46c91cca7eca1523a35b1a1f4e514545ee1 (patch)
treefc928d9f09714ddfc8584aabaa3be7780ec80aef /sys/conf/kern.pre.mk
parentdb63f69541c624629331258004b800e1929a9140 (diff)
downloadFreeBSD-src-35f5c46c91cca7eca1523a35b1a1f4e514545ee1.zip
FreeBSD-src-35f5c46c91cca7eca1523a35b1a1f4e514545ee1.tar.gz
After r232322, it turned out many people (and some ports) are building
kernel modules using their old installed /usr/share/mk/bsd.*.mk files, instead of the updated ones in their source tree. This leads to errors like: "sys/conf/kmod.mk", line 111: Malformed conditional (${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang") Obviously, these errors will go away after a "make installworld", or alternatively, by using "make buildenv" before attempting to manually build modules. However, since it is apparently an expected use case to build using old .mk files, change the way we test for clang, so it also works when the MK_CLANG_IS_CC macro doesn't exist. Note the conditional expressions are becoming rather unreadable now, but I will attempt to fix that on a followup commit. MFC after: 2 weeks
Diffstat (limited to 'sys/conf/kern.pre.mk')
-rw-r--r--sys/conf/kern.pre.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 07eaa38..fa4ef87 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -34,7 +34,7 @@ _MINUS_O= -O2
.endif
.endif
.if ${MACHINE_CPUARCH} == "amd64"
-.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang"
+.if ${CC:T:Mclang} != "clang" && (!defined(MK_CLANG_IS_CC) || ${MK_CLANG_IS_CC} == "no")
COPTFLAGS?=-O2 -frename-registers -pipe
.else
COPTFLAGS?=-O2 -pipe
@@ -84,7 +84,7 @@ INCLUDES+= -I$S/dev/cxgb -I$S/dev/cxgbe
CFLAGS= ${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS}
CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
-.if ${MK_CLANG_IS_CC} == "no" && ${CC:T:Mclang} != "clang"
+.if ${CC:T:Mclang} != "clang" && (!defined(MK_CLANG_IS_CC) || ${MK_CLANG_IS_CC} == "no")
CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT}
.if ${MACHINE_CPUARCH} != "mips"
CFLAGS+= --param inline-unit-growth=100
OpenPOWER on IntegriCloud