| @@ -1,240 +1,244 @@ | | | @@ -1,240 +1,244 @@ |
1 | # $NetBSD: subr_NetBSD,v 1.9 2009/01/02 19:30:31 abs Exp $ | | 1 | # $NetBSD: subr_NetBSD,v 1.10 2009/01/09 12:54:15 abs Exp $ |
2 | | | 2 | |
3 | AWK=awk | | 3 | AWK=awk |
4 | SED=sed | | 4 | SED=sed |
5 | | | 5 | |
6 | display_hw_details() | | 6 | display_hw_details() |
7 | { | | 7 | { |
8 | cat <<END | | 8 | cat <<END |
9 | OS : '$(uname)' | | 9 | OS : '$(uname)' |
10 | OS version : '$(uname -r)' | | 10 | OS version : '$(uname -r)' |
11 | hw.model : '$hw_model' | | 11 | hw.model : '$hw_model' |
12 | hw.machine : '$hw_machine' | | 12 | hw.machine : '$hw_machine' |
13 | hw.machine_arch : '$hw_machine_arch' | | 13 | hw.machine_arch : '$hw_machine_arch' |
14 | CPU : '$cpu' | | 14 | CPU : '$cpu' |
15 | END | | 15 | END |
16 | extract_x86_cpu_vars | | 16 | extract_x86_cpu_vars |
17 | echo "$cpu_details" | | 17 | echo "$cpu_details" |
18 | } | | 18 | } |
19 | | | 19 | |
20 | extract_hw_details() | | 20 | extract_hw_details() |
21 | { | | 21 | { |
22 | hw_model=$(sysctl -n hw.model | $SED 's/^ *//') | | 22 | hw_model=$(sysctl -n hw.model | $SED 's/^ *//') |
23 | hw_machine=$(sysctl -n hw.machine) | | 23 | hw_machine=$(sysctl -n hw.machine) |
24 | hw_machine_arch=$(sysctl -n hw.machine_arch) | | 24 | hw_machine_arch=$(sysctl -n hw.machine_arch) |
25 | if [ "$hw_machine_arch" = i386 -o "$hw_machine_arch" = x86_64 ] ; then | | 25 | if [ "$hw_machine_arch" = i386 -o "$hw_machine_arch" = x86_64 ] ; then |
26 | if [ -x /usr/sbin/cpuctl ] ; then | | 26 | if [ -x /usr/sbin/cpuctl ] ; then |
27 | cpu_details="$(cpuctl identify 0 | grep ^cpu0:)" | | 27 | cpu_details="$(cpuctl identify 0 | grep ^cpu0:)" |
28 | else | | 28 | else |
29 | cpu_details="$(grep ^cpu0: /var/run/dmesg.boot)" | | 29 | cpu_details="$(grep ^cpu0: /var/run/dmesg.boot)" |
30 | fi | | 30 | fi |
31 | eval $(extract_x86_cpu_vars) | | 31 | eval $(extract_x86_cpu_vars) |
32 | fi | | 32 | fi |
33 | | | 33 | |
34 | # We're almost certainly crosscompiling | | 34 | # We're almost certainly crosscompiling |
35 | if [ -n "$MACHINE" -a $hw_machine != "$MACHINE" ]; then | | 35 | if [ -n "$MACHINE" -a $hw_machine != "$MACHINE" ]; then |
36 | echo | | 36 | echo |
37 | exit | | 37 | exit |
38 | fi | | 38 | fi |
39 | } | | 39 | } |
40 | | | 40 | |
41 | extract_x86_cpu_vars() | | 41 | extract_x86_cpu_vars() |
42 | { | | 42 | { |
43 | # Set: cpu_feature_FOO=1 for each 'FOO' feature reported | | 43 | # Set: cpu_feature_FOO=1 for each 'FOO' feature reported |
44 | # cpu_name="NAME" taken from the first cpu0: line | | 44 | # cpu_name="NAME" taken from the first cpu0: line |
45 | # cpu_brand="BRAND" the CPU branding string | | 45 | # cpu_brand="BRAND" the CPU branding string |
46 | echo "$cpu_details" | $AWK ' | | 46 | echo "$cpu_details" | $AWK ' |
47 | { if (/cpu0:/ && !n) { sub("cpu0: ",""); n=1; print "cpu_name=\""$0"\"" } } | | 47 | { if (/cpu0:/ && !n) { sub("cpu0: ",""); n=1; print "cpu_name=\""$0"\"" } } |
48 | /cpu0: ".*"/ { sub("[^\"]*", ""); print "cpu_brand="$0 } | | 48 | /cpu0: ".*"/ { sub("[^\"]*", ""); print "cpu_brand="$0 } |
49 | /cpu0: features/ { | | 49 | /cpu0: features/ { |
50 | sub(".*<",""); | | 50 | sub(".*<",""); |
51 | sub(">.*",""); | | 51 | sub(">.*",""); |
52 | gsub("[^,A-Z0-9]","_"); | | 52 | gsub("[^,A-Z0-9]","_"); |
53 | split($0, features, /,/) | | 53 | split($0, features, /,/) |
54 | for (f in features) | | 54 | for (f in features) |
55 | print "cpu_feature_"features[f]"=1"; | | 55 | print "cpu_feature_"features[f]"=1"; |
56 | } | | 56 | } |
57 | /cpu0: family/ { | | 57 | /cpu0: family/ { |
58 | for (i = 2; i < NF; i = i + 2) { print "cpu_"$i"="($(i+1) + 0) } | | 58 | for (i = 2; i < NF; i = i + 2) { |
| | | 59 | f=$(i+1); |
| | | 60 | sub(/^0/, "", f); |
| | | 61 | print "cpu_"$i"="f |
| | | 62 | } |
59 | } | | 63 | } |
60 | ' | | 64 | ' |
61 | } | | 65 | } |
62 | | | 66 | |
63 | determine_arch() | | 67 | determine_arch() |
64 | { | | 68 | { |
65 | ARCH= | | 69 | ARCH= |
66 | # When adding $hw_model tests use maximum context (such as trailing space) | | 70 | # When adding $hw_model tests use maximum context (such as trailing space) |
67 | case $hw_machine_arch in | | 71 | case $hw_machine_arch in |
68 | | | 72 | |
69 | alpha) | | 73 | alpha) |
70 | # cpu0 at mainbus0: ID 0 (primary), 21164A-0 (unknown ... | | 74 | # cpu0 at mainbus0: ID 0 (primary), 21164A-0 (unknown ... |
71 | case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in | | 75 | case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in |
72 | *[\(\ ]2106[46][-A\ \)]*) ARCH="-mcpu=21064" ;; | | 76 | *[\(\ ]2106[46][-A\ \)]*) ARCH="-mcpu=21064" ;; |
73 | *[\(\ ]21164[-\ \)]*) ARCH="-mcpu=21164" ;; | | 77 | *[\(\ ]21164[-\ \)]*) ARCH="-mcpu=21164" ;; |
74 | *[\(\ ]21164A[-\ \)]*) ARCH="-mcpu=21164a" ;; | | 78 | *[\(\ ]21164A[-\ \)]*) ARCH="-mcpu=21164a" ;; |
75 | *[\(\ ]21264[-\ \)]*) ARCH="-mcpu=21264" ;; | | 79 | *[\(\ ]21264[-\ \)]*) ARCH="-mcpu=21264" ;; |
76 | *[\(\ ]21264[AB][-\ \)]*) ARCH="-mcpu=21264a" ;; | | 80 | *[\(\ ]21264[AB][-\ \)]*) ARCH="-mcpu=21264a" ;; |
77 | *\ PCA56-2) ARCH="-mcpu=21164pc" ;; | | 81 | *\ PCA56-2) ARCH="-mcpu=21164pc" ;; |
78 | esac | | 82 | esac |
79 | ;; | | 83 | ;; |
80 | | | 84 | |
81 | arm | arm32) case $hw_model in | | 85 | arm | arm32) case $hw_model in |
82 | ARM610*) ARCH="-mcpu=arm610" ;; # risc pc | | 86 | ARM610*) ARCH="-mcpu=arm610" ;; # risc pc |
83 | ARM710*) ARCH="-mcpu=arm710" ;; # risc pc | | 87 | ARM710*) ARCH="-mcpu=arm710" ;; # risc pc |
84 | i80321\ *) ARCH="-mcpu=xscale" ;; # iyonix | | 88 | i80321\ *) ARCH="-mcpu=xscale" ;; # iyonix |
85 | SA-110*) | | 89 | SA-110*) |
86 | case $hw_machine in # arm32 split post 1.5 | | 90 | case $hw_machine in # arm32 split post 1.5 |
87 | cats|shark|hpcarm|netwinder) | | 91 | cats|shark|hpcarm|netwinder) |
88 | ARCH="-mcpu=strongarm110" ;; | | 92 | ARCH="-mcpu=strongarm110" ;; |
89 | acorn32) | | 93 | acorn32) |
90 | ARCH="-march=armv3m -mtune=strongarm" ;; | | 94 | ARCH="-march=armv3m -mtune=strongarm" ;; |
91 | *) | | 95 | *) |
92 | # memorybus in strongarm risc pc machines cannot support | | 96 | # memorybus in strongarm risc pc machines cannot support |
93 | # certain strongarm instructions, but in 1.5 and earlier | | 97 | # certain strongarm instructions, but in 1.5 and earlier |
94 | # all strongarm machines are 'arm32', so uname and sysctl | | 98 | # all strongarm machines are 'arm32', so uname and sysctl |
95 | # no use | | 99 | # no use |
96 | if egrep -q 'ofbus0|footbridge0' /var/run/dmesg.boot \ | | 100 | if egrep -q 'ofbus0|footbridge0' /var/run/dmesg.boot \ |
97 | 2>/dev/null ; then | | 101 | 2>/dev/null ; then |
98 | ARCH="-mcpu=strongarm110" # shark/cats | | 102 | ARCH="-mcpu=strongarm110" # shark/cats |
99 | else | | 103 | else |
100 | ARCH="-march=armv3m -mtune=strongarm" # risc pc | | 104 | ARCH="-march=armv3m -mtune=strongarm" # risc pc |
101 | fi | | 105 | fi |
102 | esac ;; | | 106 | esac ;; |
103 | esac ;; | | 107 | esac ;; |
104 | | | 108 | |
105 | hppa) | | 109 | hppa) |
106 | case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in | | 110 | case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in |
107 | *\ PA7100\ *) ARCH="-march=1.1 -mschedule=7100" ;; # untested | | 111 | *\ PA7100\ *) ARCH="-march=1.1 -mschedule=7100" ;; # untested |
108 | *\ PA7150\ *) ARCH="-march=1.1 -mschedule=7100" ;; # untested | | 112 | *\ PA7150\ *) ARCH="-march=1.1 -mschedule=7100" ;; # untested |
109 | *\ PA7100LC\ *) ARCH="-march=1.1 -mschedule=7100LC" ;; # untested | | 113 | *\ PA7100LC\ *) ARCH="-march=1.1 -mschedule=7100LC" ;; # untested |
110 | *\ PA7200\ *) ARCH="-march=1.1 -mschedule=7200" ;; # untested | | 114 | *\ PA7200\ *) ARCH="-march=1.1 -mschedule=7200" ;; # untested |
111 | *\ PA7300LC\ *) ARCH="-march=1.1 -mschedule=7300" ;; # B180L | | 115 | *\ PA7300LC\ *) ARCH="-march=1.1 -mschedule=7300" ;; # B180L |
112 | *\ PA8*) ARCH="-march=2.0 -mschedule=8000" ;; # untested | | 116 | *\ PA8*) ARCH="-march=2.0 -mschedule=8000" ;; # untested |
113 | esac | | 117 | esac |
114 | ;; | | 118 | ;; |
115 | | | 119 | |
116 | i386 | x86_64) | | 120 | i386 | x86_64) |
117 | include subr_x86 # this provides map_x86_brand_string() | | 121 | include subr_x86 # this provides map_x86_brand_string() |
118 | ARCH=$(map_x86_brand_string "$cpu_brand") | | 122 | ARCH=$(map_x86_brand_string) |
119 | if [ -z "$ARCH" ] ; then | | 123 | if [ -z "$ARCH" ] ; then |
120 | case "$cpu_name" in | | 124 | case "$cpu_name" in |
121 | 'AMD Athlon 64 X2 (686-class)'*) ARCH='-march=athlon64' ;; | | 125 | 'AMD Athlon 64 X2 (686-class)'*) ARCH='-march=athlon64' ;; |
122 | 'AMD Athlon 64 or Athlon 64 FX or Opteron '*) ARCH='-march=opteron' ;; | | 126 | 'AMD Athlon 64 or Athlon 64 FX or Opteron '*) ARCH='-march=opteron' ;; |
123 | 'AMD Athlon 64 or Sempron (686-class)'*) ARCH='-march=athlon64' ;; | | 127 | 'AMD Athlon 64 or Sempron (686-class)'*) ARCH='-march=athlon64' ;; |
124 | 'AMD Athlon Model 4 (Thunderbird) '*) ARCH='-march=athlon-tbird' ;; | | 128 | 'AMD Athlon Model 4 (Thunderbird) '*) ARCH='-march=athlon-tbird' ;; |
125 | 'AMD Dual-Core Opteron or Athlon 64 X2 '*) ARCH='-march=opteron' ;; | | 129 | 'AMD Dual-Core Opteron or Athlon 64 X2 '*) ARCH='-march=opteron' ;; |
126 | 'AMD Family 10h (686-class)'*) ARCH='-march=amdfam10' ;; | | 130 | 'AMD Family 10h (686-class)'*) ARCH='-march=amdfam10' ;; |
127 | 'AMD K6-2 (586-class)'*) ARCH="-march=k6-2" ;; | | 131 | 'AMD K6-2 (586-class)'*) ARCH="-march=k6-2" ;; |
128 | | | 132 | |
129 | # Intel PIII & earlier - later Intel handled by map_x86_brand_string | | 133 | # Intel PIII & earlier - later Intel handled by map_x86_brand_string |
130 | 'Intel (686-class)'*) ARCH='-march=pentiumpro' ;; | | 134 | 'Intel (686-class)'*) ARCH='-march=pentiumpro' ;; |
131 | 'Intel Pentium II (686-class)'*) ARCH='-march=pentium2' ;; | | 135 | 'Intel Pentium II (686-class)'*) ARCH='-march=pentium2' ;; |
132 | 'Intel Pentium III (686-class)'*) ARCH='-march=pentium3' ;; | | 136 | 'Intel Pentium III (686-class)'*) ARCH='-march=pentium3' ;; |
133 | 'Intel Pentium III (Katmai) (686-class)'*) ARCH='-march=pentium3' ;; | | 137 | 'Intel Pentium III (Katmai) (686-class)'*) ARCH='-march=pentium3' ;; |
134 | 'Intel Pentium III Xeon (686-class)'*) ARCH='-march=pentium3' ;; | | 138 | 'Intel Pentium III Xeon (686-class)'*) ARCH='-march=pentium3' ;; |
135 | | | 139 | |
136 | # Fallback classes | | 140 | # Fallback classes |
137 | *'(586-class)'*) ARCH='-march=pentium' ;; | | 141 | *'(586-class)'*) ARCH='-march=pentium' ;; |
138 | *'(486-class)'*) ARCH='-march=i486' ;; | | 142 | *'(486-class)'*) ARCH='-march=i486' ;; |
139 | esac | | 143 | esac |
140 | fi | | 144 | fi |
141 | ;; | | 145 | ;; |
142 | | | 146 | |
143 | m68k) case $hw_model in # Examples | | 147 | m68k) case $hw_model in # Examples |
144 | *\(68020*|*\ MC68020\ *) ARCH='-m68020' ;; # Untested | | 148 | *\(68020*|*\ MC68020\ *) ARCH='-m68020' ;; # Untested |
145 | *\(68030*|*\ MC68030\ *) ARCH='-m68030' ;; # Mac LC III | | 149 | *\(68030*|*\ MC68030\ *) ARCH='-m68030' ;; # Mac LC III |
146 | *\(68040*|*\ MC68040\ *) ARCH='-m68040' ;; # Untested | | 150 | *\(68040*|*\ MC68040\ *) ARCH='-m68040' ;; # Untested |
147 | *\(68060*|*\ MC68060\ *) ARCH='-m68060' ;; # Upgraded amiga 3000 | | 151 | *\(68060*|*\ MC68060\ *) ARCH='-m68060' ;; # Upgraded amiga 3000 |
148 | esac | | 152 | esac |
149 | ;; | | 153 | ;; |
150 | | | 154 | |
151 | mipseb|mipsel) | | 155 | mipseb|mipsel) |
152 | # cpu0 at mainbus0: QED R4600 Orion CPU (0x2020) Rev. 2.0 with ... | | 156 | # cpu0 at mainbus0: QED R4600 Orion CPU (0x2020) Rev. 2.0 with ... |
153 | case $hw_model in | | 157 | case $hw_model in |
154 | Infineon\ ADM5120) ARCH='-march=4kc' ;; | | 158 | Infineon\ ADM5120) ARCH='-march=4kc' ;; |
155 | *) | | 159 | *) |
156 | case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in | | 160 | case "$(egrep '^cpu0 ' /var/run/dmesg.boot)" in |
157 | *\ MIPS\ R2000\ *) ARCH="-march=r2000" ;; | | 161 | *\ MIPS\ R2000\ *) ARCH="-march=r2000" ;; |
158 | *\ MIPS\ R3000\ *) ARCH="-march=r3000" ;; | | 162 | *\ MIPS\ R3000\ *) ARCH="-march=r3000" ;; |
159 | *\ MIPS\ R3000A\ *) ARCH="-march=r3000" ;; | | 163 | *\ MIPS\ R3000A\ *) ARCH="-march=r3000" ;; |
160 | *\ Toshiba\ TX3912\ *) ARCH="-march=r3900" ;; | | 164 | *\ Toshiba\ TX3912\ *) ARCH="-march=r3900" ;; |
161 | *\ Toshiba\ TX392[27]\ *) ARCH="-march=r3900" ;; | | 165 | *\ Toshiba\ TX392[27]\ *) ARCH="-march=r3900" ;; |
162 | *\ MIPS\ R4000\ *) ARCH="-mtune=r4000 -mips2" ;; # mips3 | | 166 | *\ MIPS\ R4000\ *) ARCH="-mtune=r4000 -mips2" ;; # mips3 |
163 | *\ MIPS\ R4400\ *) ARCH="-mtune=r4400 -mips2" ;; # mips3 | | 167 | *\ MIPS\ R4400\ *) ARCH="-mtune=r4400 -mips2" ;; # mips3 |
164 | *\ NEC\ VR4100\ *) ARCH="-mtune=r4100 -mips2" ;; # mips3 | | 168 | *\ NEC\ VR4100\ *) ARCH="-mtune=r4100 -mips2" ;; # mips3 |
165 | *\ NEC\ VR4300\ *) ARCH="-mtune=r4300 -mips2" ;; # mips3 | | 169 | *\ NEC\ VR4300\ *) ARCH="-mtune=r4300 -mips2" ;; # mips3 |
166 | *\ QED\ R4600\ *) ARCH="-mtune=r4600 -mips2" ;; # mips3 | | 170 | *\ QED\ R4600\ *) ARCH="-mtune=r4600 -mips2" ;; # mips3 |
167 | *\ MIPS\ R5000\ *) ARCH="-mtune=r5000 -mips2" ;; # mips4 | | 171 | *\ MIPS\ R5000\ *) ARCH="-mtune=r5000 -mips2" ;; # mips4 |
168 | *\ QED\ RM5200\ *) ARCH="-mtune=r5000 -mips2" ;; # mips4 | | 172 | *\ QED\ RM5200\ *) ARCH="-mtune=r5000 -mips2" ;; # mips4 |
169 | *\ MIPS\ R6000\ *) ARCH="-mtune=r6000 -mips2" ;; | | 173 | *\ MIPS\ R6000\ *) ARCH="-mtune=r6000 -mips2" ;; |
170 | *\ MIPS\ R8000\ *) ARCH="-mtune=r8000 -mips2" ;; # mips4 | | 174 | *\ MIPS\ R8000\ *) ARCH="-mtune=r8000 -mips2" ;; # mips4 |
171 | *\ MIPS\ R10000\ *) ARCH="-march=mips4 -mabi=32" ;; # mips4 | | 175 | *\ MIPS\ R10000\ *) ARCH="-march=mips4 -mabi=32" ;; # mips4 |
172 | esac ;; | | 176 | esac ;; |
173 | esac | | 177 | esac |
174 | ;; | | 178 | ;; |
175 | | | 179 | |
176 | powerpc) case $hw_model in # Examples | | 180 | powerpc) case $hw_model in # Examples |
177 | 601\ *) ARCH='-mcpu=601' ;; # Untested | | 181 | 601\ *) ARCH='-mcpu=601' ;; # Untested |
178 | 602\ *) ARCH='-mcpu=602' ;; # Untested | | 182 | 602\ *) ARCH='-mcpu=602' ;; # Untested |
179 | 603\ *) ARCH='-mcpu=603' ;; # Untested | | 183 | 603\ *) ARCH='-mcpu=603' ;; # Untested |
180 | 603e\ *|603ev\ *) ARCH='-mcpu=603e' ;; # Umax C500 / PM4400 | | 184 | 603e\ *|603ev\ *) ARCH='-mcpu=603e' ;; # Umax C500 / PM4400 |
181 | 604\ *) ARCH='-mcpu=604' ;; # Mac 8500 | | 185 | 604\ *) ARCH='-mcpu=604' ;; # Mac 8500 |
182 | 604e\ *) ARCH='-mcpu=604e' ;; # upgr B&W G3 | | 186 | 604e\ *) ARCH='-mcpu=604e' ;; # upgr B&W G3 |
183 | 604ev\ *) ARCH='-mcpu=604e' ;; # usually 604e | | 187 | 604ev\ *) ARCH='-mcpu=604e' ;; # usually 604e |
184 | 620\ *) ARCH='-mcpu=620' ;; # Untested | | 188 | 620\ *) ARCH='-mcpu=620' ;; # Untested |
185 | 7400\ *) ARCH='-mcpu=7400' ;; # AGP G4/400 Mac | | 189 | 7400\ *) ARCH='-mcpu=7400' ;; # AGP G4/400 Mac |
186 | 740\ *) ARCH='-mcpu=740' ;; # Untested | | 190 | 740\ *) ARCH='-mcpu=740' ;; # Untested |
187 | 7410\ *) ARCH='-mcpu=7400' ;; # powerbook g4 | | 191 | 7410\ *) ARCH='-mcpu=7400' ;; # powerbook g4 |
188 | 7447A\ *) ARCH='-mcpu=7450' ;; # | | 192 | 7447A\ *) ARCH='-mcpu=7450' ;; # |
189 | 7450\ *) ARCH='-mcpu=7450' ;; # tibook 550 | | 193 | 7450\ *) ARCH='-mcpu=7450' ;; # tibook 550 |
190 | 750\ *) ARCH='-mcpu=750' ;; # orig. iBook | | 194 | 750\ *) ARCH='-mcpu=750' ;; # orig. iBook |
191 | | | 195 | |
192 | esac ;; | | 196 | esac ;; |
193 | | | 197 | |
194 | sparc | sparc64) case " $hw_model" in # Examples | | 198 | sparc | sparc64) case " $hw_model" in # Examples |
195 | *[\ \(]MB86900/1A*) ARCH='-mcpu=cypress' ;; # ss1+ | | 199 | *[\ \(]MB86900/1A*) ARCH='-mcpu=cypress' ;; # ss1+ |
196 | *[\ \(]L64811*) ARCH='-mcpu=cypress' ;; # sun4/sun4c | | 200 | *[\ \(]L64811*) ARCH='-mcpu=cypress' ;; # sun4/sun4c |
197 | *[\ \(]CY7C601*) ARCH='-mcpu=cypress' ;; # ss2 | | 201 | *[\ \(]CY7C601*) ARCH='-mcpu=cypress' ;; # ss2 |
198 | *[\ \(]W8601/8701*) ARCH='-mcpu=cypress' ;; # elc | | 202 | *[\ \(]W8601/8701*) ARCH='-mcpu=cypress' ;; # elc |
199 | *[\ \(]MB86904*) ARCH='-mcpu=supersparc' ;; # ss5 usparc | | 203 | *[\ \(]MB86904*) ARCH='-mcpu=supersparc' ;; # ss5 usparc |
200 | *[\ \(]MB86907*) ARCH='-mcpu=supersparc' ;; # ss5 usparc | | 204 | *[\ \(]MB86907*) ARCH='-mcpu=supersparc' ;; # ss5 usparc |
201 | *[\ \(]TMS390S10*) ARCH='-mcpu=supersparc' ;; # classic " | | 205 | *[\ \(]TMS390S10*) ARCH='-mcpu=supersparc' ;; # classic " |
202 | *[\ \(]TMS390Z50*) ARCH='-mcpu=supersparc' ;; # ss10/ss20 | | 206 | *[\ \(]TMS390Z50*) ARCH='-mcpu=supersparc' ;; # ss10/ss20 |
203 | *[\ \(]RT620/625*) ARCH='-mcpu=hypersparc' ;; # ss20 ross | | 207 | *[\ \(]RT620/625*) ARCH='-mcpu=hypersparc' ;; # ss20 ross |
204 | *[\ \(]MB86930*) ARCH='-mcpu=sparclite' ;; # from gcc | | 208 | *[\ \(]MB86930*) ARCH='-mcpu=sparclite' ;; # from gcc |
205 | *[\ \(]MB86934*) ARCH='-mcpu=sparclite' ;; # from gcc | | 209 | *[\ \(]MB86934*) ARCH='-mcpu=sparclite' ;; # from gcc |
206 | # under 1.5.1 -mcpu=ultrasparc chokes egcs-2.91.66 compiling perl | | 210 | # under 1.5.1 -mcpu=ultrasparc chokes egcs-2.91.66 compiling perl |
207 | *[\ \(]SUNW,UltraSPARC*) ARCH='-mcpu=v9' ;; # Ultra | | 211 | *[\ \(]SUNW,UltraSPARC*) ARCH='-mcpu=v9' ;; # Ultra |
208 | esac ;; | | 212 | esac ;; |
209 | | | 213 | |
210 | vax) # No VAX specific gcc optimisations available | | 214 | vax) # No VAX specific gcc optimisations available |
211 | NOARCH=1 | | 215 | NOARCH=1 |
212 | ;; | | 216 | ;; |
213 | | | 217 | |
214 | esac | | 218 | esac |
215 | echo $ARCH | | 219 | echo $ARCH |
216 | } | | 220 | } |
217 | | | 221 | |
218 | determine_features() | | 222 | determine_features() |
219 | { | | 223 | { |
220 | FEATURES= | | 224 | FEATURES= |
221 | | | 225 | |
222 | case $hw_machine_arch in | | 226 | case $hw_machine_arch in |
223 | i386 | x86_64) | | 227 | i386 | x86_64) |
224 | if [ -n "$cpu_feature_SSE3" ] ; then | | 228 | if [ -n "$cpu_feature_SSE3" ] ; then |
225 | FEATURES="-mfpmath=sse -msse3" | | 229 | FEATURES="-mfpmath=sse -msse3" |
226 | elif [ -n "$cpu_feature_SSE2" ] ; then | | 230 | elif [ -n "$cpu_feature_SSE2" ] ; then |
227 | FEATURES="-mfpmath=sse -msse2" | | 231 | FEATURES="-mfpmath=sse -msse2" |
228 | elif [ -n "$cpu_feature_SSE" ] ; then | | 232 | elif [ -n "$cpu_feature_SSE" ] ; then |
229 | FEATURES="-mfpmath=sse -msse" | | 233 | FEATURES="-mfpmath=sse -msse" |
230 | fi | | 234 | fi |
231 | ;; | | 235 | ;; |
232 | m68k) | | 236 | m68k) |
233 | case "$(egrep '^fpu0 ' /var/run/dmesg.boot)" in | | 237 | case "$(egrep '^fpu0 ' /var/run/dmesg.boot)" in |
234 | *\(emulator\)*) FEATURES="-msoft-float" ;; | | 238 | *\(emulator\)*) FEATURES="-msoft-float" ;; |
235 | *\(no\ math\ support\)*) FEATURES="-msoft-float" ;; | | 239 | *\(no\ math\ support\)*) FEATURES="-msoft-float" ;; |
236 | esac | | 240 | esac |
237 | ;; | | 241 | ;; |
238 | esac | | 242 | esac |
239 | echo $FEATURES | | 243 | echo $FEATURES |
240 | } | | 244 | } |