aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRobert Millan <rmh@FreeBSD.org>2011-10-23 16:27:03 +0000
committerRobert Millan <rmh@FreeBSD.org>2011-10-23 16:27:03 +0000
commitf9629bc4cdcd1cdf7de0f1ffb416cd3dc4207323 (patch)
treedb8cfec3807c3dd6c951e25ab93847261c2e38c4 /sys
parentcb47bf1448ee85e139a142287e10fac5aeec2fcd (diff)
downloadsrc-f9629bc4cdcd1cdf7de0f1ffb416cd3dc4207323.tar.gz
src-f9629bc4cdcd1cdf7de0f1ffb416cd3dc4207323.zip
Conditionalize a pair of FreeBSD GCC extensions so that its CFLAGS are only
used with FreeBSD GCC. Approved by: kib (mentor)
Notes
Notes: svn path=/head/; revision=226665
Diffstat (limited to 'sys')
-rw-r--r--sys/conf/kern.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index a0a595f50645..9fc379f4dae6 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -1,11 +1,21 @@
# $FreeBSD$
+.if ${CC:T:Mclang} != "clang"
+FREEBSD_GCC!= ${CC} --version | grep FreeBSD || true
+.endif
+
#
# Warning flags for compiling the kernel and components of the kernel:
#
+.if ${FREEBSD_GCC}
+# FreeBSD extensions, not available in upstream GCC
+format_extensions= -fformat-extensions
+no_align_long_strings= -mno-align-long-strings
+.endif
+
CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
- -Wundef -Wno-pointer-sign -fformat-extensions \
+ -Wundef -Wno-pointer-sign ${format_extensions} \
-Wmissing-include-dirs -fdiagnostics-show-option
#
# The following flags are next up for working on:
@@ -32,7 +42,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
#
.if ${MACHINE_CPUARCH} == "i386"
.if ${CC:T:Mclang} != "clang"
-CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-sse
+CFLAGS+= ${no_align_long_strings} -mpreferred-stack-boundary=2 -mno-sse
.else
CFLAGS+= -mno-aes -mno-avx
.endif