summaryrefslogtreecommitdiffstats
path: root/sys/conf
diff options
context:
space:
mode:
Diffstat (limited to 'sys/conf')
-rw-r--r--sys/conf/files4
-rw-r--r--sys/conf/kern.mk15
-rw-r--r--sys/conf/kern.pre.mk33
-rw-r--r--sys/conf/kmod.mk15
4 files changed, 61 insertions, 6 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 73d1df7..339f7db 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -6,12 +6,12 @@
#
aicasm optional ahc \
dependency "$S/dev/aic7xxx/aicasm/*.[chyl]" \
- compile-with "${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \
+ compile-with "CC=${CC} ${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \
no-obj no-implicit-rule \
clean "aicasm* y.tab.h"
aicasm optional ahd \
dependency "$S/dev/aic7xxx/aicasm/*.[chyl]" \
- compile-with "${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \
+ compile-with "CC=${CC} ${MAKE} -f $S/dev/aic7xxx/aicasm/Makefile MAKESRCPATH=$S/dev/aic7xxx/aicasm" \
no-obj no-implicit-rule \
clean "aicasm* y.tab.h"
aic7xxx_{seq.h,reg.h,reg_print.c} optional ahc \
diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index dc369df..133f1cf 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -6,9 +6,14 @@
# Note that the newly added -Wcast-qual is responsible for generating
# most of the remaining warnings. Warnings introduced with -Wall will
# also pop up, but are easier to fix.
+.if ${CC} == "icc"
+#CWARNFLAGS= -w2 # use this if you are terribly bored
+CWARNFLAGS=
+.else
CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual \
-fformat-extensions -std=c99
+.endif
#
# The following flags are next up for working on:
# -W
@@ -22,7 +27,7 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes \
# use of code cache tag lines) and uses more stack (less efficient use of data
# cache tag lines)
#
-.if ${MACHINE_ARCH} == "i386"
+.if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
CFLAGS+= -mno-align-long-strings -mpreferred-stack-boundary=2
INLINE_LIMIT?= 8000
.endif
@@ -80,4 +85,12 @@ INLINE_LIMIT?= 15000
# GCC 3.0 and above like to do certain optimizations based on the
# assumption that the program is linked against libc. Stop this.
#
+.if ${CC} == "icc"
+CFLAGS+= -nolib_inline
+.else
CFLAGS+= -ffreestanding
+.endif
+
+.if ${CC} == "icc"
+CFLAGS+= -restrict
+.endif
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 9732ffb..4a786a5 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -16,14 +16,28 @@ NM?= nm
OBJCOPY?= objcopy
SIZE?= size
+.if ${CC} == "icc"
+COPTFLAGS?=-O
+.else
COPTFLAGS?=-O -pipe
-.if ${COPTFLAGS:M-O[23s]} != ""
+. if ${COPTFLAGS:M-O[23s]} != ""
COPTFLAGS+= -fno-strict-aliasing
+. endif
.endif
.if !defined(NO_CPU_COPTFLAGS)
+. if ${CC} == "icc"
+COPTFLAGS+= ${_ICC_CPUCFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
+. else
COPTFLAGS+= ${_CPUCFLAGS}
+. endif
+.endif
+.if ${CC} == "icc"
+NOSTDINC= -X
+.else
+NOSTDINC= -nostdinc
.endif
-INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S
+
+INCLUDES= ${NOSTDINC} -I- ${INCLMAGIC} -I. -I$S
# This hack lets us use the Intel ACPICA code without spamming a new
# include path into 100+ source files.
@@ -43,19 +57,34 @@ INCLUDES+= -I$S/contrib/ngatm
COPTS= ${INCLUDES} -D_KERNEL -include opt_global.h
CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS}
+.if ${CC} != "icc"
CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT}
WERROR?= -Werror
+.endif
# XXX LOCORE means "don't declare C stuff" not "for locore.s".
ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
.if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
+. if ${CC} == "icc"
+CFLAGS+= -DGPROF
+. else
CFLAGS+= -DGPROF -falign-functions=16
+. endif
.if ${PROFLEVEL} >= 2
CFLAGS+= -DGPROF4 -DGUPROF
+. if ${CC} == "icc"
+# XXX doesn't work yet
+#PROF= -prof_gen
+. else
PROF= -finstrument-functions
+. endif
.else
+. if ${CC} == "icc"
+PROF= -p
+. else
PROF= -pg
+. endif
.endif
.endif
DEFINED_PROF= ${PROF}
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 0766b71..c303061 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -70,6 +70,10 @@ OBJCOPY?= objcopy
.SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
+.if ${CC} == "icc"
+_ICC_CFLAGS:= ${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
+CFLAGS= ${_ICC_CFLAGS}
+.endif
CFLAGS+= ${COPTS} -D_KERNEL
CFLAGS+= -DKLD_MODULE
@@ -78,7 +82,12 @@ CFLAGS+= -DKLD_MODULE
# such paths after -nostdinc. It doesn't seem to be possible to
# add to the front of `make' variable.
_ICFLAGS:= ${CFLAGS:M-I*}
-CFLAGS+= -nostdinc -I- ${INCLMAGIC} ${_ICFLAGS}
+.if ${CC} == "icc"
+NOSTDINC= -X
+.else
+NOSTDINC= -nostdinc
+.endif
+CFLAGS+= ${NOSTDINC} -I- ${INCLMAGIC} ${_ICFLAGS}
.if defined(KERNBUILDDIR)
CFLAGS+= -include ${KERNBUILDDIR}/opt_global.h
.endif
@@ -102,11 +111,15 @@ CFLAGS+= -I${DESTDIR}/usr/include
CFLAGS+= -I@/../include -I${DESTDIR}/usr/include
.endif # @
+.if ${CC} != "icc"
CFLAGS+= -finline-limit=${INLINE_LIMIT}
+.endif
# Disallow common variables, and if we end up with commons from
# somewhere unexpected, allocate storage for them in the module itself.
+.if ${CC} != "icc"
CFLAGS+= -fno-common
+.endif
LDFLAGS+= -d -warn-common
CFLAGS+= ${DEBUG_FLAGS}
OpenPOWER on IntegriCloud