Date: Sat, 11 May 2002 13:33:09 -0700 From: "David O'Brien" <dev-null@NUXI.com> To: current@freebsd.org Subject: embellish of bsd.cpu.mk Message-ID: <20020511133309.A14228@dragon.nuxi.com>
next in thread | raw e-mail | index | archive | help
[bogus From: address, because people cannot be bothered to respect Reply-To:]
What do people think of this patch to embellish bsd.cpu.mk?
I also changed pN to be the more canonical pentiumN (with pN aliases of
course).
Index: bsd.cpu.mk
===================================================================
RCS file: /home/ncvs/src/share/mk/bsd.cpu.mk,v
retrieving revision 1.9
diff -u -r1.9 bsd.cpu.mk
--- bsd.cpu.mk 11 May 2002 20:18:54 -0000 1.9
+++ bsd.cpu.mk 11 May 2002 20:31:28 -0000
@@ -6,6 +6,9 @@
.if ${MACHINE_ARCH} == "i386"
CPUTYPE ?= i386
.elif ${MACHINE_ARCH} == "alpha"
+if !defined(CPUTYPE)
+CPUTUNE ?= ev56
+.endif
CPUTYPE ?= ev4
.elif ${MACHINE_ARCH} == "ia64"
CPUTYPE ?= itanium
@@ -17,12 +20,30 @@
# between e.g. i586 and pentium)
.if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "pentiumpro"
-CPUTYPE = i686
-. elif ${CPUTYPE} == "pentium"
+. if ${CPUTYPE} == "pentium"
CPUTYPE = i586
-. elif ${CPUTYPE} == "athlon"
-CPUTYPE = k7
+. elif ${CPUTYPE} == "i686"
+CPUTYPE = pentiumpro
+. elif ${CPUTYPE} == "p2"
+CPUTYPE = pentium2
+. elif ${CPUTYPE} == "p3"
+CPUTYPE = pentium3
+. elif ${CPUTYPE} == "p4"
+CPUTYPE = pentium4
+. elif ${CPUTYPE} == "k7"
+CPUTYPE = athlon
+. elif ${CPUTYPE} == "duron"
+CPUTYPE = athlon
+. endif
+.elif ${MACHINE_ARCH} == "alpha"
+. if ${CPUTYPE} == "21264a"
+CPUTYPE = ev67
+. if ${CPUTYPE} == "21264"
+CPUTYPE = ev6
+. elif ${CPUTYPE} == "21164pc"
+CPUTYPE = pca56
+. elif ${CPUTYPE} == "21164a"
+CPUTYPE = ev56
. endif
.endif
@@ -36,7 +57,7 @@
.if !defined(NO_CPU_CFLAGS) || !defined(NO_CPU_COPTFLAGS)
. if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "k7"
+. if ${CPUTYPE} == "athlon"
_CPUCFLAGS = -march=athlon
. elif ${CPUTYPE} == "k6-2"
_CPUCFLAGS = -march=k6
@@ -44,13 +65,13 @@
_CPUCFLAGS = -march=k6
. elif ${CPUTYPE} == "k5"
_CPUCFLAGS = -march=pentium
-. elif ${CPUTYPE} == "p4"
-_CPUCFLAGS = -march=pentiumpro
-. elif ${CPUTYPE} == "p3"
-_CPUCFLAGS = -march=pentiumpro
-. elif ${CPUTYPE} == "p2"
-_CPUCFLAGS = -march=pentiumpro
-. elif ${CPUTYPE} == "i686"
+. elif ${CPUTYPE} == "pentium4"
+_CPUCFLAGS = -march=pentium4
+. elif ${CPUTYPE} == "pentium3"
+_CPUCFLAGS = -march=pentium3
+. elif ${CPUTYPE} == "pentium2"
+_CPUCFLAGS = -march=pentium2
+. elif ${CPUTYPE} == "pentiumpro"
_CPUCFLAGS = -march=pentiumpro
. elif ${CPUTYPE} == "i586/mmx"
_CPUCFLAGS = -march=pentium
@@ -60,6 +81,8 @@
_CPUCFLAGS = -march=i486
. endif
. elif ${MACHINE_ARCH} == "alpha"
+. if ${CPUTYPE} == "ev67"
+_CPUCFLAGS = -mcpu=ev67
. if ${CPUTYPE} == "ev6"
_CPUCFLAGS = -mcpu=ev6
. elif ${CPUTYPE} == "pca56"
@@ -75,6 +98,9 @@
. endif
. endif
.endif
+.if ${MACHINE_ARCH} == "alpha" && defined(CPUTUNE)
+_CPUCFLAGS += -mtune=${CPUTUNE}
+.endif
# NB: COPTFLAGS is handled in /usr/src/sys/conf/Makefile.<arch>
@@ -87,17 +113,17 @@
# presence of a CPU feature.
.if ${MACHINE_ARCH} == "i386"
-. if ${CPUTYPE} == "k7"
-MACHINE_CPU = k7 3dnow mmx k6 k5 i586 i486 i386
+. if ${CPUTYPE} == "athlon"
+MACHINE_CPU = athlon 3dnow mmx k6 k5 i586 i486 i386
. elif ${CPUTYPE} == "k6-2"
MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
. elif ${CPUTYPE} == "k6"
MACHINE_CPU = mmx k6 k5 i586 i486 i386
. elif ${CPUTYPE} == "k5"
MACHINE_CPU = k5 i586 i486 i386
-. elif ${CPUTYPE} == "p4"
+. elif ${CPUTYPE} == "pentium4"
MACHINE_CPU = sse i686 mmx i586 i486 i386
-. elif ${CPUTYPE} == "p3"
+. elif ${CPUTYPE} == "pentium3"
MACHINE_CPU = sse i686 mmx i586 i486 i386
. elif ${CPUTYPE} == "p2"
MACHINE_CPU = i686 mmx i586 i486 i386
@@ -113,7 +139,9 @@
MACHINE_CPU = i386
. endif
.elif ${MACHINE_ARCH} == "alpha"
-. if ${CPUTYPE} == "ev6"
+. if ${CPUTYPE} == "ev67"
+MACHINE_CPU = ev67 ev6 ev56 pca56 ev5 ev45 ev4
+. elif ${CPUTYPE} == "ev6"
MACHINE_CPU = ev6 ev56 pca56 ev5 ev45 ev4
. elif ${CPUTYPE} == "pca56"
MACHINE_CPU = pca56 ev56 ev5 ev45 ev4
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020511133309.A14228>
