1 # $DragonFly: src/share/mk/Attic/bsd.cpu.gcc40.mk,v 1.1 2005/06/05 22:43:19 corecode Exp $
3 # Set default CPU compile flags and baseline CPUTYPE for each arch. The
4 # compile flags must support the minimum CPU type for each architecture but
5 # may tune support for more advanced processors.
7 .if
!defined
(CPUTYPE
) || empty
(CPUTYPE
)
8 . if
${MACHINE_ARCH} == "i386"
9 _CPUCFLAGS
= -mtune
=pentiumpro
11 .elif
${MACHINE_ARCH} == "amd64"
12 MACHINE_CPU
= amd64 sse2 sse
16 # Handle aliases (not documented in make.conf to avoid user confusion
17 # between e.g. i586 and pentium)
19 . if
${MACHINE_ARCH} == "i386"
20 . if
${CPUTYPE} == "pentiumpro"
22 . elif
${CPUTYPE} == "pentium"
24 . elif
${CPUTYPE} == "k7"
29 # Logic to set up correct gcc optimization flag. This must be included
30 # after /etc/make.conf so it can react to the local value of CPUTYPE
31 # defined therein. Consult:
32 # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
33 # http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html
34 # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
35 # http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
37 . if
${MACHINE_ARCH} == "i386"
38 . if
${CPUTYPE} == "k8" ||
${CPUTYPE} == "opteron" ||
${CPUTYPE} == "athlon64" ||
${CPUTYPE} == "athlon-fx"
39 _CPUCFLAGS
= -march
=${CPUTYPE}
40 . elif
${CPUTYPE} == "athlon-mp" ||
${CPUTYPE} == "athlon-xp" ||
${CPUTYPE} == "athlon-4" ||
${CPUTYPE} == "athlon-tbird" ||
${CPUTYPE} == "athlon"
41 _CPUCFLAGS
= -march
=${CPUTYPE}
42 . elif
${CPUTYPE} == "k6-3" ||
${CPUTYPE} == "k6-2" ||
${CPUTYPE} == "k6"
43 _CPUCFLAGS
= -march
=${CPUTYPE}
44 . elif
${CPUTYPE} == "k5"
45 _CPUCFLAGS
= -march
=pentium
46 . elif
${CPUTYPE} == "p4"
47 _CPUCFLAGS
= -march
=pentium4
48 . elif
${CPUTYPE} == "p3"
49 _CPUCFLAGS
= -march
=pentium3
50 . elif
${CPUTYPE} == "p2"
51 _CPUCFLAGS
= -march
=pentium2
52 . elif
${CPUTYPE} == "i686"
53 _CPUCFLAGS
= -march
=pentiumpro
54 . elif
${CPUTYPE} == "i586/mmx"
55 _CPUCFLAGS
= -march
=pentium-mmx
56 . elif
${CPUTYPE} == "i586"
57 _CPUCFLAGS
= -march
=pentium
58 . elif
${CPUTYPE} == "i486"
59 _CPUCFLAGS
= -march
=i486
63 # Set up the list of CPU features based on the CPU type. This is an
64 # unordered list to make it easy for client makefiles to test for the
65 # presence of a CPU feature.
67 .if
${MACHINE_ARCH} == "i386"
68 . if
${CPUTYPE} == "k8" ||
${CPUTYPE} == "opteron" ||
${CPUTYPE} == "athlon64" ||
${CPUTYPE} == "athlon-fx"
69 MACHINE_CPU
= athlon-xp k7
3dnow sse mmx k6 k5 i586 i486 i386
70 . elif
${CPUTYPE} == "athlon-mp" ||
${CPUTYPE} == "athlon-xp" ||
${CPUTYPE} == "athlon-4"
71 MACHINE_CPU
= athlon-xp k7
3dnow sse mmx k6 k5 i586 i486 i386
72 . elif
${CPUTYPE} == "athlon" ||
${CPUTYPE} == "athlon-tbird"
73 MACHINE_CPU
= athlon k7
3dnow mmx k6 k5 i586 i486 i386
74 . elif
${CPUTYPE} == "k6-3" ||
${CPUTYPE} == "k6-2"
75 MACHINE_CPU
= 3dnow mmx k6 k5 i586 i486 i386
76 . elif
${CPUTYPE} == "k6"
77 MACHINE_CPU
= mmx k6 k5 i586 i486 i386
78 . elif
${CPUTYPE} == "k5"
79 MACHINE_CPU
= k5 i586 i486 i386
80 . elif
${CPUTYPE} == "p4"
81 MACHINE_CPU
= sse2 sse i686 mmx i586 i486 i386
82 . elif
${CPUTYPE} == "p3"
83 MACHINE_CPU
= sse i686 mmx i586 i486 i386
84 . elif
${CPUTYPE} == "p2"
85 MACHINE_CPU
= i686 mmx i586 i486 i386
86 . elif
${CPUTYPE} == "i686"
87 MACHINE_CPU
= i686 i586 i486 i386
88 . elif
${CPUTYPE} == "i586/mmx"
89 MACHINE_CPU
= mmx i586 i486 i386
90 . elif
${CPUTYPE} == "i586"
91 MACHINE_CPU
= i586 i486 i386
92 . elif
${CPUTYPE} == "i486"
93 MACHINE_CPU
= i486 i386
94 . elif
${CPUTYPE} == "i386"
97 . elif
${MACHINE_ARCH} == "amd64"
98 MACHINE_CPU
= amd64 sse2 sse