From af1f8a2d2a282b542e5a8b338a7a578ba3c754df Mon Sep 17 00:00:00 2001 From: jhb Date: Sat, 27 Jul 2002 22:04:05 +0000 Subject: If there is not a CPUTYPE defined by default, then allow for _CPUCFLAGS to tune for more advanced processors while still supporting the minimum processor in an architecture. We can do this with the '-mtune=' option to gcc for alpha, sparc64, and powerpc and with the mis-named '-mcpu=' option for i386. This defaults to tuning i386 builds for i686 machines though not using any instructions that aren't found on an 80386. For alpha it defaults to tuning for an EV5. Approved by: peter Peril sensitive sunglasses borrowed from: peter --- share/mk/bsd.cpu.mk | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'share') diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk index c320052..f4eef7a 100644 --- a/share/mk/bsd.cpu.mk +++ b/share/mk/bsd.cpu.mk @@ -1,17 +1,24 @@ # $FreeBSD$ -# Set default baseline values of CPUTYPE based on MACHINE_ARCH -- this is -# the minimum CPU type we support for each architecture +# Set default CPU compile flags and baseline CPUTYPE for each arch. The +# compile flags must support the minimum CPU type for each architecture but +# may tune support for more advanced processors. +.if !defined(CPUTYPE) .if ${MACHINE_ARCH} == "i386" -CPUTYPE ?= i386 +_CPUCFLAGS = -mcpu=pentiumpro +CPUTYPE = i386 .elif ${MACHINE_ARCH} == "alpha" -CPUTYPE ?= ev5 +_CPUCFLAGS = -mcpu=ev4 -mtune=ev5 +CPUTYPE = ev4 .elif ${MACHINE_ARCH} == "ia64" -CPUTYPE ?= itanium +_CPUCFLAGS = +CPUTYPE = itanium .elif ${MACHINE_ARCH} == "sparc64" -CPUTYPE ?= ultrasparc +_CPUCFLAGS = +CPUTYPE = ultrasparc .endif +.else # Handle aliases (not documented in make.conf to avoid user confusion # between e.g. i586 and pentium) @@ -79,6 +86,7 @@ _CPUCFLAGS = -mcpu=ev4 . endif . endif .endif +.endif # NB: COPTFLAGS is handled in /usr/src/sys/conf/Makefile. -- cgit v1.1