Retire gcc-4.0.
[dragonfly.git] / share / mk / bsd.cpu.gcc40.mk
CommitLineData
bed723a4 1# $DragonFly: src/share/mk/Attic/bsd.cpu.gcc40.mk,v 1.3 2006/11/19 22:04:19 victor Exp $
80ef1470
SS
2
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.
6
7.if !defined(CPUTYPE) || empty(CPUTYPE)
8. if ${MACHINE_ARCH} == "i386"
9_CPUCFLAGS = -mtune=pentiumpro
10MACHINE_CPU = i486
11.elif ${MACHINE_ARCH} == "amd64"
12MACHINE_CPU = amd64 sse2 sse
13. endif
14.else
15
16# Handle aliases (not documented in make.conf to avoid user confusion
17# between e.g. i586 and pentium)
18
19. if ${MACHINE_ARCH} == "i386"
20. if ${CPUTYPE} == "pentiumpro"
21CPUTYPE = i686
22. elif ${CPUTYPE} == "pentium"
23CPUTYPE = i586
24. elif ${CPUTYPE} == "k7"
25CPUTYPE = athlon
26. endif
27. endif
28
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
80ef1470
SS
33# http://gcc.gnu.org/onlinedocs/gcc/SPARC-Options.html
34# http://gcc.gnu.org/onlinedocs/gcc/RS-6000-and-PowerPC-Options.html
35
36. if ${MACHINE_ARCH} == "i386"
37. if ${CPUTYPE} == "k8" || ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "athlon-fx"
38_CPUCFLAGS = -march=${CPUTYPE}
39. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || ${CPUTYPE} == "athlon-4" || ${CPUTYPE} == "athlon-tbird" || ${CPUTYPE} == "athlon"
40_CPUCFLAGS = -march=${CPUTYPE}
41. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2" || ${CPUTYPE} == "k6"
42_CPUCFLAGS = -march=${CPUTYPE}
43. elif ${CPUTYPE} == "k5"
44_CPUCFLAGS = -march=pentium
45. elif ${CPUTYPE} == "p4"
46_CPUCFLAGS = -march=pentium4
bed723a4
VBD
47. elif ${CPUTYPE} == "pentium-m"
48_CPUCFLAGS = -march=pentium-m
80ef1470
SS
49. elif ${CPUTYPE} == "p3"
50_CPUCFLAGS = -march=pentium3
51. elif ${CPUTYPE} == "p2"
52_CPUCFLAGS = -march=pentium2
53. elif ${CPUTYPE} == "i686"
54_CPUCFLAGS = -march=pentiumpro
55. elif ${CPUTYPE} == "i586/mmx"
56_CPUCFLAGS = -march=pentium-mmx
57. elif ${CPUTYPE} == "i586"
58_CPUCFLAGS = -march=pentium
59. elif ${CPUTYPE} == "i486"
60_CPUCFLAGS = -march=i486
61. endif
62. endif
63
64# Set up the list of CPU features based on the CPU type. This is an
65# unordered list to make it easy for client makefiles to test for the
66# presence of a CPU feature.
67
68.if ${MACHINE_ARCH} == "i386"
69. if ${CPUTYPE} == "k8" || ${CPUTYPE} == "opteron" || ${CPUTYPE} == "athlon64" || ${CPUTYPE} == "athlon-fx"
70MACHINE_CPU = athlon-xp k7 3dnow sse mmx k6 k5 i586 i486 i386
71. elif ${CPUTYPE} == "athlon-mp" || ${CPUTYPE} == "athlon-xp" || ${CPUTYPE} == "athlon-4"
72MACHINE_CPU = athlon-xp k7 3dnow sse mmx k6 k5 i586 i486 i386
73. elif ${CPUTYPE} == "athlon" || ${CPUTYPE} == "athlon-tbird"
74MACHINE_CPU = athlon k7 3dnow mmx k6 k5 i586 i486 i386
75. elif ${CPUTYPE} == "k6-3" || ${CPUTYPE} == "k6-2"
76MACHINE_CPU = 3dnow mmx k6 k5 i586 i486 i386
77. elif ${CPUTYPE} == "k6"
78MACHINE_CPU = mmx k6 k5 i586 i486 i386
79. elif ${CPUTYPE} == "k5"
80MACHINE_CPU = k5 i586 i486 i386
bed723a4 81. elif ${CPUTYPE} == "p4" || ${CPUTYPE} == "pentium-m"
80ef1470
SS
82MACHINE_CPU = sse2 sse i686 mmx i586 i486 i386
83. elif ${CPUTYPE} == "p3"
84MACHINE_CPU = sse i686 mmx i586 i486 i386
85. elif ${CPUTYPE} == "p2"
86MACHINE_CPU = i686 mmx i586 i486 i386
87. elif ${CPUTYPE} == "i686"
88MACHINE_CPU = i686 i586 i486 i386
89. elif ${CPUTYPE} == "i586/mmx"
90MACHINE_CPU = mmx i586 i486 i386
91. elif ${CPUTYPE} == "i586"
92MACHINE_CPU = i586 i486 i386
93. elif ${CPUTYPE} == "i486"
94MACHINE_CPU = i486 i386
95. elif ${CPUTYPE} == "i386"
96MACHINE_CPU = i386
97. endif
98. elif ${MACHINE_ARCH} == "amd64"
99MACHINE_CPU = amd64 sse2 sse
100. endif
101.endif
102