1 # $DragonFly: src/share/mk/bsd.cpu.gcc34.mk,v 1.2 2006/08/26 00:37:08 swildner 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
13 . elif
${MACHINE_ARCH} == "ia64"
16 . elif
${MACHINE_ARCH} == "sparc64"
21 # Handle aliases (not documented in make.conf to avoid user confusion
22 # between e.g. i586 and pentium)
24 . if
${MACHINE_ARCH} == "i386"
25 . if
${CPUTYPE} == "pentiumpro"
27 . elif
${CPUTYPE} == "pentium"
29 . elif
${CPUTYPE} == "k7"
34 # Logic to set up correct gcc optimization flag. This must be included
35 # after /etc/make.conf so it can react to the local value of CPUTYPE
36 # defined therein. Consult:
37 # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
38 # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
39 # http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
41 . if
${MACHINE_ARCH} == "i386"
42 . if
${CPUTYPE} == "k8" ||
${CPUTYPE} == "opteron" ||
${CPUTYPE} == "athlon64" ||
${CPUTYPE} == "athlon-fx"
43 _CPUCFLAGS
= -march
=${CPUTYPE}
44 . elif
${CPUTYPE} == "athlon-mp" ||
${CPUTYPE} == "athlon-xp" ||
${CPUTYPE} == "athlon-4" ||
${CPUTYPE} == "athlon-tbird" ||
${CPUTYPE} == "athlon"
45 _CPUCFLAGS
= -march
=${CPUTYPE}
46 . elif
${CPUTYPE} == "k6-3" ||
${CPUTYPE} == "k6-2" ||
${CPUTYPE} == "k6"
47 _CPUCFLAGS
= -march
=${CPUTYPE}
48 . elif
${CPUTYPE} == "k5"
49 _CPUCFLAGS
= -march
=pentium
50 . elif
${CPUTYPE} == "p4"
51 _CPUCFLAGS
= -march
=pentium4
52 . elif
${CPUTYPE} == "p3"
53 _CPUCFLAGS
= -march
=pentium3
54 . elif
${CPUTYPE} == "p2"
55 _CPUCFLAGS
= -march
=pentium2
56 . elif
${CPUTYPE} == "i686"
57 _CPUCFLAGS
= -march
=pentiumpro
58 . elif
${CPUTYPE} == "i586/mmx"
59 _CPUCFLAGS
= -march
=pentium-mmx
60 . elif
${CPUTYPE} == "i586"
61 _CPUCFLAGS
= -march
=pentium
62 . elif
${CPUTYPE} == "i486"
63 _CPUCFLAGS
= -march
=i486
67 # Set up the list of CPU features based on the CPU type. This is an
68 # unordered list to make it easy for client makefiles to test for the
69 # presence of a CPU feature.
71 .if
${MACHINE_ARCH} == "i386"
72 . if
${CPUTYPE} == "k8" ||
${CPUTYPE} == "opteron" ||
${CPUTYPE} == "athlon64" ||
${CPUTYPE} == "athlon-fx"
73 MACHINE_CPU
= athlon-xp k7
3dnow sse mmx k6 k5 i586 i486 i386
74 . elif
${CPUTYPE} == "athlon-mp" ||
${CPUTYPE} == "athlon-xp" ||
${CPUTYPE} == "athlon-4"
75 MACHINE_CPU
= athlon-xp k7
3dnow sse mmx k6 k5 i586 i486 i386
76 . elif
${CPUTYPE} == "athlon" ||
${CPUTYPE} == "athlon-tbird"
77 MACHINE_CPU
= athlon k7
3dnow mmx k6 k5 i586 i486 i386
78 . elif
${CPUTYPE} == "k6-3" ||
${CPUTYPE} == "k6-2"
79 MACHINE_CPU
= 3dnow mmx k6 k5 i586 i486 i386
80 . elif
${CPUTYPE} == "k6"
81 MACHINE_CPU
= mmx k6 k5 i586 i486 i386
82 . elif
${CPUTYPE} == "k5"
83 MACHINE_CPU
= k5 i586 i486 i386
84 . elif
${CPUTYPE} == "p4"
85 MACHINE_CPU
= sse2 sse i686 mmx i586 i486 i386
86 . elif
${CPUTYPE} == "p3"
87 MACHINE_CPU
= sse i686 mmx i586 i486 i386
88 . elif
${CPUTYPE} == "p2"
89 MACHINE_CPU
= i686 mmx i586 i486 i386
90 . elif
${CPUTYPE} == "i686"
91 MACHINE_CPU
= i686 i586 i486 i386
92 . elif
${CPUTYPE} == "i586/mmx"
93 MACHINE_CPU
= mmx i586 i486 i386
94 . elif
${CPUTYPE} == "i586"
95 MACHINE_CPU
= i586 i486 i386
96 . elif
${CPUTYPE} == "i486"
97 MACHINE_CPU
= i486 i386
98 . elif
${CPUTYPE} == "i386"
101 . elif
${MACHINE_ARCH} == "amd64"
102 MACHINE_CPU
= amd64 sse2 sse
103 . elif
${MACHINE_ARCH} == "ia64"
104 . if
${CPUTYPE} == "itanium"
105 MACHINE_CPU
= itanium