Prefer MACHINE_CPUARCH to MACHINE_ARCH unless there's a good reason...

This commit is contained in:
imp 2010-09-13 07:22:14 +00:00
parent 71456632de
commit 18db545520

View File

@ -6,18 +6,18 @@
.if !defined(CPUTYPE) || empty(CPUTYPE) .if !defined(CPUTYPE) || empty(CPUTYPE)
_CPUCFLAGS = _CPUCFLAGS =
. if ${MACHINE_ARCH} == "i386" . if ${MACHINE_CPUARCH} == "i386"
MACHINE_CPU = i486 MACHINE_CPU = i486
. elif ${MACHINE_ARCH} == "amd64" . elif ${MACHINE_CPUARCH} == "amd64"
MACHINE_CPU = amd64 sse2 sse mmx MACHINE_CPU = amd64 sse2 sse mmx
. elif ${MACHINE_ARCH} == "ia64" . elif ${MACHINE_CPUARCH} == "ia64"
MACHINE_CPU = itanium MACHINE_CPU = itanium
. elif ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" . elif ${MACHINE_CPUARCH} == "powerpc"
MACHINE_CPU = aim MACHINE_CPU = aim
. elif ${MACHINE_ARCH} == "sparc64" . elif ${MACHINE_CPUARCH} == "sparc64"
. elif ${MACHINE_ARCH} == "arm" . elif ${MACHINE_CPUARCH} == "arm"
MACHINE_CPU = arm MACHINE_CPU = arm
. elif ${MACHINE_ARCH} == "mips" . elif ${MACHINE_CPUARCH} == "mips"
MACHINE_CPU = mips MACHINE_CPU = mips
. endif . endif
.else .else
@ -25,7 +25,7 @@ MACHINE_CPU = mips
# Handle aliases (not documented in make.conf to avoid user confusion # Handle aliases (not documented in make.conf to avoid user confusion
# between e.g. i586 and pentium) # between e.g. i586 and pentium)
. if ${MACHINE_ARCH} == "i386" . if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "nocona" . if ${CPUTYPE} == "nocona"
CPUTYPE = prescott CPUTYPE = prescott
. elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2" . elif ${CPUTYPE} == "core" || ${CPUTYPE} == "core2"
@ -54,7 +54,7 @@ CPUTYPE = athlon-mp
. elif ${CPUTYPE} == "k7" . elif ${CPUTYPE} == "k7"
CPUTYPE = athlon CPUTYPE = athlon
. endif . endif
. elif ${MACHINE_ARCH} == "amd64" . elif ${MACHINE_CPUARCH} == "amd64"
. if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2" . if ${CPUTYPE} == "prescott" || ${CPUTYPE} == "core2"
CPUTYPE = nocona CPUTYPE = nocona
. endif . endif
@ -71,7 +71,7 @@ CPUTYPE = nocona
# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
# http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html
. if ${MACHINE_ARCH} == "i386" . if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "crusoe" . if ${CPUTYPE} == "crusoe"
_CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0 _CPUCFLAGS = -march=i686 -falign-functions=0 -falign-jumps=0 -falign-loops=0
. elif ${CPUTYPE} == "k5" . elif ${CPUTYPE} == "k5"
@ -104,9 +104,9 @@ _ICC_CPUCFLAGS = -tpp5
. else . else
_ICC_CPUCFLAGS = _ICC_CPUCFLAGS =
. endif # ICC on 'i386' . endif # ICC on 'i386'
. elif ${MACHINE_ARCH} == "amd64" . elif ${MACHINE_CPUARCH} == "amd64"
_CPUCFLAGS = -march=${CPUTYPE} _CPUCFLAGS = -march=${CPUTYPE}
. elif ${MACHINE_ARCH} == "arm" . elif ${MACHINE_CPUARCH} == "arm"
. if ${CPUTYPE} == "xscale" . if ${CPUTYPE} == "xscale"
#XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself #XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself
#_CPUCFLAGS = -mcpu=xscale #_CPUCFLAGS = -mcpu=xscale
@ -123,7 +123,7 @@ _CPUCFLAGS = -mcpu=${CPUTYPE} -mno-powerpc64
. endif . endif
. elif ${MACHINE_ARCH} == "powerpc64" . elif ${MACHINE_ARCH} == "powerpc64"
_CPUCFLAGS = -mcpu=${CPUTYPE} _CPUCFLAGS = -mcpu=${CPUTYPE}
. elif ${MACHINE_ARCH} == "mips" . elif ${MACHINE_CPUARCH} == "mips"
. if ${CPUTYPE} == "mips32" . if ${CPUTYPE} == "mips32"
_CPUCFLAGS = -march=mips32 _CPUCFLAGS = -march=mips32
. elif ${CPUTYPE} == "mips32r2" . elif ${CPUTYPE} == "mips32r2"
@ -143,7 +143,7 @@ _CPUCFLAGS = -march=24kc
# unordered list to make it easy for client makefiles to test for the # unordered list to make it easy for client makefiles to test for the
# presence of a CPU feature. # presence of a CPU feature.
. if ${MACHINE_ARCH} == "i386" . if ${MACHINE_CPUARCH} == "i386"
. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" . if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64"
MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386 MACHINE_CPU = athlon-xp athlon k7 3dnow sse2 sse mmx k6 k5 i586 i486 i386
. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \ . elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || \
@ -182,27 +182,27 @@ MACHINE_CPU = i486 i386
. elif ${CPUTYPE} == "i386" . elif ${CPUTYPE} == "i386"
MACHINE_CPU = i386 MACHINE_CPU = i386
. endif . endif
. elif ${MACHINE_ARCH} == "amd64" . elif ${MACHINE_CPUARCH} == "amd64"
. if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8" . if ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "k8"
MACHINE_CPU = k8 3dnow MACHINE_CPU = k8 3dnow
. elif ${CPUTYPE} == "nocona" . elif ${CPUTYPE} == "nocona"
MACHINE_CPU = sse3 MACHINE_CPU = sse3
. endif . endif
MACHINE_CPU += amd64 sse2 sse mmx MACHINE_CPU += amd64 sse2 sse mmx
. elif ${MACHINE_ARCH} == "ia64" . elif ${MACHINE_CPUARCH} == "ia64"
. if ${CPUTYPE} == "itanium" . if ${CPUTYPE} == "itanium"
MACHINE_CPU = itanium MACHINE_CPU = itanium
. endif . endif
. endif . endif
.endif .endif
.if ${MACHINE_ARCH} == "arm" && defined(TARGET_BIG_ENDIAN) .if ${MACHINE_CPUARCH} == "arm" && defined(TARGET_BIG_ENDIAN)
CFLAGS += -mbig-endian CFLAGS += -mbig-endian
LDFLAGS += -mbig-endian LDFLAGS += -mbig-endian
LD += -EB LD += -EB
.endif .endif
.if ${MACHINE_ARCH} == "mips" .if ${MACHINE_CPUARCH} == "mips"
CFLAGS += -G0 CFLAGS += -G0
.endif .endif