summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/defaults/make.conf1
-rw-r--r--share/examples/etc/make.conf1
-rw-r--r--share/mk/bsd.cpu.mk42
-rw-r--r--sys/conf/Makefile.alpha5
-rw-r--r--sys/conf/Makefile.i3865
-rw-r--r--sys/conf/Makefile.ia645
-rw-r--r--sys/conf/Makefile.pc985
-rw-r--r--sys/conf/Makefile.powerpc5
8 files changed, 46 insertions, 23 deletions
diff --git a/etc/defaults/make.conf b/etc/defaults/make.conf
index b10819b..7554631 100644
--- a/etc/defaults/make.conf
+++ b/etc/defaults/make.conf
@@ -29,6 +29,7 @@
#
#CPUTYPE=i686
#NO_CPU_CFLAGS= true # Don't add -march=<cpu> to CFLAGS automatically
+#NO_CPU_COPTFLAGS=true # Don't add -march=<cpu> to COPTFLAGS automatically
#
# CFLAGS controls the compiler settings used when compiling C code.
# Note that optimization settings above -O (-O2, ...) are not recommended
diff --git a/share/examples/etc/make.conf b/share/examples/etc/make.conf
index b10819b..7554631 100644
--- a/share/examples/etc/make.conf
+++ b/share/examples/etc/make.conf
@@ -29,6 +29,7 @@
#
#CPUTYPE=i686
#NO_CPU_CFLAGS= true # Don't add -march=<cpu> to CFLAGS automatically
+#NO_CPU_COPTFLAGS=true # Don't add -march=<cpu> to COPTFLAGS automatically
#
# CFLAGS controls the compiler settings used when compiling C code.
# Note that optimization settings above -O (-O2, ...) are not recommended
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
index df50183..ed652ed 100644
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -28,48 +28,54 @@ CPUTYPE = k7
# after /etc/make.conf so it can react to the local value of CPUTYPE
# defined therein.
-.if !defined(NO_CPU_CFLAGS)
+.if !defined(NO_CPU_CFLAGS) || !defined(NO_CPU_COPTFLAGS)
. if ${MACHINE_ARCH} == "i386"
. if ${CPUTYPE} == "k7"
-CFLAGS += -march=k6 # gcc doesn't support athlon yet, but it will
+_CPUCFLAGS = -march=k6 # gcc doesn't support athlon yet, but it will
. elif ${CPUTYPE} == "k6-2"
-CFLAGS += -march=k6
+_CPUCFLAGS = -march=k6
. elif ${CPUTYPE} == "k6"
-CFLAGS += -march=k6
+_CPUCFLAGS = -march=k6
. elif ${CPUTYPE} == "k5"
-CFLAGS += -march=pentium
+_CPUCFLAGS = -march=pentium
. elif ${CPUTYPE} == "p4"
-CFLAGS += -march=pentiumpro
+_CPUCFLAGS = -march=pentiumpro
. elif ${CPUTYPE} == "p3"
-CFLAGS += -march=pentiumpro
+_CPUCFLAGS = -march=pentiumpro
. elif ${CPUTYPE} == "p2"
-CFLAGS += -march=pentiumpro
+_CPUCFLAGS = -march=pentiumpro
. elif ${CPUTYPE} == "i686"
-CFLAGS += -march=pentiumpro
+_CPUCFLAGS = -march=pentiumpro
. elif ${CPUTYPE} == "i586/mmx"
-CFLAGS += -march=pentium
+_CPUCFLAGS = -march=pentium
. elif ${CPUTYPE} == "i586"
-CFLAGS += -march=pentium
+_CPUCFLAGS = -march=pentium
. elif ${CPUTYPE} == "i486"
-CFLAGS += -m486
+_CPUCFLAGS = -m486
. endif
. elif ${MACHINE_ARCH} == "alpha"
. if ${CPUTYPE} == "ev6"
-CFLAGS += -mcpu=ev6
+_CPUCFLAGS = -mcpu=ev6
. elif ${CPUTYPE} == "pca56"
-CFLAGS += -mcpu=pca56
+_CPUCFLAGS = -mcpu=pca56
. elif ${CPUTYPE} == "ev56"
-CFLAGS += -mcpu=ev56
+_CPUCFLAGS = -mcpu=ev56
. elif ${CPUTYPE} == "ev5"
-CFLAGS += -mcpu=ev5
+_CPUCFLAGS = -mcpu=ev5
. elif ${CPUTYPE} == "ev45"
-CFLAGS += -mcpu=ev4 # No -mcpu=ev45 for gcc
+_CPUCFLAGS = -mcpu=ev4 # No -mcpu=ev45 for gcc
. elif ${CPUTYPE} == "ev4"
-CFLAGS += -mcpu=ev4
+_CPUCFLAGS = -mcpu=ev4
. endif
. endif
.endif
+# NB: COPTFLAGS is handled in /usr/src/sys/conf/Makefile.<arch>
+
+.if !defined(NO_CPU_CFLAGS)
+CFLAGS += ${_CPUCFLAGS}
+.endif
+
# Set up the list of CPU features based on the CPU type. This is an
# unordered list to make it easy for client makefiles to test for the
# presence of a CPU feature.
diff --git a/sys/conf/Makefile.alpha b/sys/conf/Makefile.alpha
index 5a9a326..26a4704 100644
--- a/sys/conf/Makefile.alpha
+++ b/sys/conf/Makefile.alpha
@@ -37,7 +37,10 @@ M= ${MACHINE_ARCH}
SIZE?= size
OBJCOPY?= objcopy
-COPTFLAGS?=-O
+COPTFLAGS?=-O -pipe
+.if !defined(NO_CPU_COPTFLAGS)
+COPTFLAGS+= ${_CPUCFLAGS}
+.endif
INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
.if exists($S/../include)
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386
index b704742..1af9e61 100644
--- a/sys/conf/Makefile.i386
+++ b/sys/conf/Makefile.i386
@@ -37,7 +37,10 @@ M= ${MACHINE_ARCH}
SIZE?= size
OBJCOPY?= objcopy
-COPTFLAGS?=-O
+COPTFLAGS?=-O -pipe
+.if !defined(NO_CPU_COPTFLAGS)
+COPTFLAGS+= ${_CPUCFLAGS}
+.endif
INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
.if exists($S/../include)
diff --git a/sys/conf/Makefile.ia64 b/sys/conf/Makefile.ia64
index c1e0eec..617c7eb 100644
--- a/sys/conf/Makefile.ia64
+++ b/sys/conf/Makefile.ia64
@@ -47,7 +47,10 @@ M= ${MACHINE_ARCH}
SIZE?= size
OBJCOPY?= objcopy
-COPTFLAGS?=-O
+COPTFLAGS?=-O -pipe
+.if !defined(NO_CPU_COPTFLAGS)
+COPTFLAGS+= ${_CPUCFLAGS}
+.endif
INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
.if exists($S/../include)
diff --git a/sys/conf/Makefile.pc98 b/sys/conf/Makefile.pc98
index d85d6e4..a4b2fd3 100644
--- a/sys/conf/Makefile.pc98
+++ b/sys/conf/Makefile.pc98
@@ -39,7 +39,10 @@ M= ${MACHINE_ARCH}
SIZE?= size
OBJCOPY?= objcopy
-COPTFLAGS?=-O
+COPTFLAGS?=-O -pipe
+.if !defined(NO_CPU_COPTFLAGS)
+COPTFLAGS+= ${_CPUCFLAGS}
+.endif
INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
.if exists($S/../include)
diff --git a/sys/conf/Makefile.powerpc b/sys/conf/Makefile.powerpc
index b704742..1af9e61 100644
--- a/sys/conf/Makefile.powerpc
+++ b/sys/conf/Makefile.powerpc
@@ -37,7 +37,10 @@ M= ${MACHINE_ARCH}
SIZE?= size
OBJCOPY?= objcopy
-COPTFLAGS?=-O
+COPTFLAGS?=-O -pipe
+.if !defined(NO_CPU_COPTFLAGS)
+COPTFLAGS+= ${_CPUCFLAGS}
+.endif
INCLUDES= -nostdinc -I- ${INCLMAGIC} -I. -I$S -I$S/dev
# This hack is to allow kernel compiles to succeed on machines w/out srcdist
.if exists($S/../include)
OpenPOWER on IntegriCloud