1 # $DragonFly: src/share/mk/bsd.cpu.gcc34.mk,v 1.1 2004/06/15 07:53:32 joerg 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} == "alpha"
12 _CPUCFLAGS
= -mtune
=ev4
-mtune
=ev5
14 .elif
${MACHINE_ARCH} == "amd64"
15 MACHINE_CPU
= amd64 sse2 sse
16 . elif
${MACHINE_ARCH} == "ia64"
19 . elif
${MACHINE_ARCH} == "sparc64"
24 # Handle aliases (not documented in make.conf to avoid user confusion
25 # between e.g. i586 and pentium)
27 . if
${MACHINE_ARCH} == "i386"
28 . if
${CPUTYPE} == "pentiumpro"
30 . elif
${CPUTYPE} == "pentium"
32 . elif
${CPUTYPE} == "k7"
37 # Logic to set up correct gcc optimization flag. This must be included
38 # after /etc/make.conf so it can react to the local value of CPUTYPE
39 # defined therein. Consult:
40 # http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86-64-Options.html
41 # http://gcc.gnu.org/onlinedocs/gcc/DEC-Alpha-Options.html
42 # http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
43 # http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
45 . if
${MACHINE_ARCH} == "i386"
46 . if
${CPUTYPE} == "k8" ||
${CPUTYPE} == "opteron" ||
${CPUTYPE} == "athlon64" ||
${CPUTYPE} == "athlon-fx"
47 _CPUCFLAGS
= -march
=${CPUTYPE}
48 . elif
${CPUTYPE} == "athlon-mp" ||
${CPUTYPE} == "athlon-xp" ||
${CPUTYPE} == "athlon-4" ||
${CPUTYPE} == "athlon-tbird" ||
${CPUTYPE} == "athlon"
49 _CPUCFLAGS
= -march
=${CPUTYPE}
50 . elif
${CPUTYPE} == "k6-3" ||
${CPUTYPE} == "k6-2" ||
${CPUTYPE} == "k6"
51 _CPUCFLAGS
= -march
=${CPUTYPE}
52 . elif
${CPUTYPE} == "k5"
53 _CPUCFLAGS
= -march
=pentium
54 . elif
${CPUTYPE} == "p4"
55 _CPUCFLAGS
= -march
=pentium4
56 . elif
${CPUTYPE} == "p3"
57 _CPUCFLAGS
= -march
=pentium3
58 . elif
${CPUTYPE} == "p2"
59 _CPUCFLAGS
= -march
=pentium2
60 . elif
${CPUTYPE} == "i686"
61 _CPUCFLAGS
= -march
=pentiumpro
62 . elif
${CPUTYPE} == "i586/mmx"
63 _CPUCFLAGS
= -march
=pentium-mmx
64 . elif
${CPUTYPE} == "i586"
65 _CPUCFLAGS
= -march
=pentium
66 . elif
${CPUTYPE} == "i486"
67 _CPUCFLAGS
= -march
=i486
69 . elif
${MACHINE_ARCH} == "alpha"
70 . if
${CPUTYPE} == "ev67"
71 _CPUCFLAGS
= -mtune
=ev67
72 . elif
${CPUTYPE} == "ev6"
73 _CPUCFLAGS
= -mtune
=ev6
74 . elif
${CPUTYPE} == "pca56"
75 _CPUCFLAGS
= -mtune
=pca56
76 . elif
${CPUTYPE} == "ev56"
77 _CPUCFLAGS
= -mtune
=ev56
78 . elif
${CPUTYPE} == "ev5"
79 _CPUCFLAGS
= -mtune
=ev5
80 . elif
${CPUTYPE} == "ev45"
81 _CPUCFLAGS
= -mtune
=ev45
82 . elif
${CPUTYPE} == "ev4"
83 _CPUCFLAGS
= -mtune
=ev4
87 # Set up the list of CPU features based on the CPU type. This is an
88 # unordered list to make it easy for client makefiles to test for the
89 # presence of a CPU feature.
91 .if
${MACHINE_ARCH} == "i386"
92 . if
${CPUTYPE} == "k8" ||
${CPUTYPE} == "opteron" ||
${CPUTYPE} == "athlon64" ||
${CPUTYPE} == "athlon-fx"
93 MACHINE_CPU
= athlon-xp k7
3dnow sse mmx k6 k5 i586 i486 i386
94 . elif
${CPUTYPE} == "athlon-mp" ||
${CPUTYPE} == "athlon-xp" ||
${CPUTYPE} == "athlon-4"
95 MACHINE_CPU
= athlon-xp k7
3dnow sse mmx k6 k5 i586 i486 i386
96 . elif
${CPUTYPE} == "athlon" ||
${CPUTYPE} == "athlon-tbird"
97 MACHINE_CPU
= athlon k7
3dnow mmx k6 k5 i586 i486 i386
98 . elif
${CPUTYPE} == "k6-3" ||
${CPUTYPE} == "k6-2"
99 MACHINE_CPU
= 3dnow mmx k6 k5 i586 i486 i386
100 . elif
${CPUTYPE} == "k6"
101 MACHINE_CPU
= mmx k6 k5 i586 i486 i386
102 . elif
${CPUTYPE} == "k5"
103 MACHINE_CPU
= k5 i586 i486 i386
104 . elif
${CPUTYPE} == "p4"
105 MACHINE_CPU
= sse2 sse i686 mmx i586 i486 i386
106 . elif
${CPUTYPE} == "p3"
107 MACHINE_CPU
= sse i686 mmx i586 i486 i386
108 . elif
${CPUTYPE} == "p2"
109 MACHINE_CPU
= i686 mmx i586 i486 i386
110 . elif
${CPUTYPE} == "i686"
111 MACHINE_CPU
= i686 i586 i486 i386
112 . elif
${CPUTYPE} == "i586/mmx"
113 MACHINE_CPU
= mmx i586 i486 i386
114 . elif
${CPUTYPE} == "i586"
115 MACHINE_CPU
= i586 i486 i386
116 . elif
${CPUTYPE} == "i486"
117 MACHINE_CPU
= i486 i386
118 . elif
${CPUTYPE} == "i386"
121 . elif
${MACHINE_ARCH} == "alpha"
122 . if
${CPUTYPE} == "ev6"
123 MACHINE_CPU
= ev6 ev56 pca56 ev5 ev45 ev4
124 . elif
${CPUTYPE} == "pca56"
125 MACHINE_CPU
= pca56 ev56 ev5 ev45 ev4
126 . elif
${CPUTYPE} == "ev56"
127 MACHINE_CPU
= ev56 ev5 ev45 ev4
128 . elif
${CPUTYPE} == "ev5"
129 MACHINE_CPU
= ev5 ev45 ev4
130 . elif
${CPUTYPE} == "ev45"
131 MACHINE_CPU
= ev45 ev4
132 . elif
${CPUTYPE} == "ev4"
135 . elif
${MACHINE_ARCH} == "amd64"
136 MACHINE_CPU
= amd64 sse2 sse
137 . elif
${MACHINE_ARCH} == "ia64"
138 . if
${CPUTYPE} == "itanium"
139 MACHINE_CPU
= itanium
144 .if
${MACHINE_ARCH} == "alpha"