]>
Commit | Line | Data |
---|---|---|
252b5132 | 1 | #! /bin/sh |
35590697 | 2 | # Configuration validation subroutine script. |
996ff3e8 | 3 | # Copyright 1992-2023 Free Software Foundation, Inc. |
ac73857d | 4 | |
6c037fdb NC |
5 | # shellcheck disable=SC2006,SC2268 # see below for rationale |
6 | ||
ce3abd47 | 7 | timestamp='2023-09-19' |
ac73857d | 8 | |
c3d399e7 L |
9 | # This file is free software; you can redistribute it and/or modify it |
10 | # under the terms of the GNU General Public License as published by | |
6c037fdb | 11 | # the Free Software Foundation, either version 3 of the License, or |
252b5132 RH |
12 | # (at your option) any later version. |
13 | # | |
c3d399e7 L |
14 | # This program is distributed in the hope that it will be useful, but |
15 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 | # General Public License for more details. | |
252b5132 RH |
18 | # |
19 | # You should have received a copy of the GNU General Public License | |
bf41f30d | 20 | # along with this program; if not, see <https://www.gnu.org/licenses/>. |
1d9c9cd7 | 21 | # |
252b5132 RH |
22 | # As a special exception to the GNU General Public License, if you |
23 | # distribute this file as part of a program that contains a | |
24 | # configuration script generated by Autoconf, you may include it under | |
c3d399e7 L |
25 | # the same distribution terms that you use for the rest of that |
26 | # program. This Exception is an additional permission under section 7 | |
27 | # of the GNU General Public License, version 3 ("GPLv3"). | |
252b5132 | 28 | |
1d9c9cd7 | 29 | |
8969c424 | 30 | # Please send patches to <config-patches@gnu.org>. |
ada59422 | 31 | # |
252b5132 RH |
32 | # Configuration subroutine to validate and canonicalize a configuration type. |
33 | # Supply the specified configuration type as an argument. | |
34 | # If it is invalid, we print an error message on stderr and exit with code 1. | |
35 | # Otherwise, we print the canonical config type on stdout and succeed. | |
36 | ||
707a0b5c | 37 | # You can get the latest version of this script from: |
5f8c2a15 | 38 | # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub |
707a0b5c | 39 | |
252b5132 RH |
40 | # This file is supposed to be the same for all GNU packages |
41 | # and recognize all the CPU types, system types and aliases | |
42 | # that are meaningful with *any* GNU software. | |
43 | # Each package is responsible for reporting which valid configurations | |
44 | # it does not support. The user should be able to distinguish | |
45 | # a failure to support a valid configuration from a meaningless | |
46 | # configuration. | |
47 | ||
48 | # The goal of this file is to map all the various variations of a given | |
49 | # machine specification into a single specification in the form: | |
50 | # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM | |
51 | # or in some cases, the newer four-part form: | |
52 | # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM | |
53 | # It is wrong to echo any other type of specification. | |
54 | ||
6c037fdb NC |
55 | # The "shellcheck disable" line above the timestamp inhibits complaints |
56 | # about features and limitations of the classic Bourne shell that were | |
57 | # superseded or lifted in POSIX. However, this script identifies a wide | |
58 | # variety of pre-POSIX systems that do not have POSIX shells at all, and | |
59 | # even some reasonably current systems (Solaris 10 as case-in-point) still | |
60 | # have a pre-POSIX /bin/sh. | |
61 | ||
62 | me=`echo "$0" | sed -e 's,.*/,,'` | |
252b5132 | 63 | |
ac73857d | 64 | usage="\ |
4849dfd8 | 65 | Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS |
ac73857d AC |
66 | |
67 | Canonicalize a configuration name. | |
68 | ||
bf41f30d | 69 | Options: |
35590697 AJ |
70 | -h, --help print this help, then exit |
71 | -t, --time-stamp print date of last modification, then exit | |
72 | -v, --version print version number, then exit | |
73 | ||
74 | Report bugs and patches to <config-patches@gnu.org>." | |
75 | ||
76 | version="\ | |
77 | GNU config.sub ($timestamp) | |
78 | ||
996ff3e8 | 79 | Copyright 1992-2023 Free Software Foundation, Inc. |
35590697 AJ |
80 | |
81 | This is free software; see the source for copying conditions. There is NO | |
82 | warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." | |
ac73857d AC |
83 | |
84 | help=" | |
996ff3e8 | 85 | Try '$me --help' for more information." |
ac73857d AC |
86 | |
87 | # Parse command line | |
88 | while test $# -gt 0 ; do | |
35590697 AJ |
89 | case $1 in |
90 | --time-stamp | --time* | -t ) | |
1d9c9cd7 | 91 | echo "$timestamp" ; exit ;; |
35590697 | 92 | --version | -v ) |
1d9c9cd7 | 93 | echo "$version" ; exit ;; |
ac73857d | 94 | --help | --h* | -h ) |
1d9c9cd7 | 95 | echo "$usage"; exit ;; |
ac73857d AC |
96 | -- ) # Stop option processing |
97 | shift; break ;; | |
98 | - ) # Use stdin as input. | |
99 | break ;; | |
100 | -* ) | |
d63f2be2 | 101 | echo "$me: invalid option $1$help" >&2 |
ac73857d AC |
102 | exit 1 ;; |
103 | ||
104 | *local*) | |
105 | # First pass through any local machine types. | |
b5778783 | 106 | echo "$1" |
1d9c9cd7 | 107 | exit ;; |
ac73857d AC |
108 | |
109 | * ) | |
110 | break ;; | |
111 | esac | |
112 | done | |
113 | ||
114 | case $# in | |
115 | 0) echo "$me: missing argument$help" >&2 | |
116 | exit 1;; | |
117 | 1) ;; | |
118 | *) echo "$me: too many arguments$help" >&2 | |
119 | exit 1;; | |
252b5132 RH |
120 | esac |
121 | ||
c5244148 | 122 | # Split fields of configuration type |
d63f2be2 | 123 | # shellcheck disable=SC2162 |
6c037fdb | 124 | saved_IFS=$IFS |
d63f2be2 | 125 | IFS="-" read field1 field2 field3 field4 <<EOF |
c5244148 SH |
126 | $1 |
127 | EOF | |
6c037fdb | 128 | IFS=$saved_IFS |
252b5132 | 129 | |
c5244148 SH |
130 | # Separate into logical components for further validation |
131 | case $1 in | |
132 | *-*-*-*-*) | |
996ff3e8 | 133 | echo "Invalid configuration '$1': more than four components" >&2 |
c5244148 | 134 | exit 1 |
d2213593 | 135 | ;; |
c5244148 SH |
136 | *-*-*-*) |
137 | basic_machine=$field1-$field2 | |
5f8c2a15 | 138 | basic_os=$field3-$field4 |
252b5132 | 139 | ;; |
c5244148 SH |
140 | *-*-*) |
141 | # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two | |
142 | # parts | |
143 | maybe_os=$field2-$field3 | |
144 | case $maybe_os in | |
5f8c2a15 | 145 | nto-qnx* | linux-* | uclinux-uclibc* \ |
c5244148 SH |
146 | | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ |
147 | | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | |
6e712424 PI |
148 | | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \ |
149 | | windows-* ) | |
c5244148 | 150 | basic_machine=$field1 |
5f8c2a15 | 151 | basic_os=$maybe_os |
c5244148 SH |
152 | ;; |
153 | android-linux) | |
154 | basic_machine=$field1-unknown | |
5f8c2a15 | 155 | basic_os=linux-android |
c5244148 SH |
156 | ;; |
157 | *) | |
158 | basic_machine=$field1-$field2 | |
5f8c2a15 | 159 | basic_os=$field3 |
c5244148 SH |
160 | ;; |
161 | esac | |
252b5132 | 162 | ;; |
c5244148 | 163 | *-*) |
d63f2be2 RO |
164 | # A lone config we happen to match not fitting any pattern |
165 | case $field1-$field2 in | |
166 | decstation-3100) | |
167 | basic_machine=mips-dec | |
5f8c2a15 | 168 | basic_os= |
c5244148 | 169 | ;; |
d63f2be2 RO |
170 | *-*) |
171 | # Second component is usually, but not always the OS | |
172 | case $field2 in | |
173 | # Prevent following clause from handling this valid os | |
174 | sun*os*) | |
175 | basic_machine=$field1 | |
5f8c2a15 | 176 | basic_os=$field2 |
d63f2be2 | 177 | ;; |
6c037fdb NC |
178 | zephyr*) |
179 | basic_machine=$field1-unknown | |
180 | basic_os=$field2 | |
181 | ;; | |
d63f2be2 RO |
182 | # Manufacturers |
183 | dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | |
184 | | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | |
185 | | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | |
186 | | convergent* | ncr* | news | 32* | 3600* | 3100* \ | |
187 | | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | |
188 | | ultra | tti* | harris | dolphin | highlevel | gould \ | |
189 | | cbm | ns | masscomp | apple | axis | knuth | cray \ | |
190 | | microblaze* | sim | cisco \ | |
191 | | oki | wec | wrs | winbond) | |
192 | basic_machine=$field1-$field2 | |
5f8c2a15 | 193 | basic_os= |
d63f2be2 RO |
194 | ;; |
195 | *) | |
196 | basic_machine=$field1 | |
5f8c2a15 | 197 | basic_os=$field2 |
d63f2be2 RO |
198 | ;; |
199 | esac | |
200 | ;; | |
c5244148 | 201 | esac |
252b5132 | 202 | ;; |
c5244148 SH |
203 | *) |
204 | # Convert single-component short-hands not valid as part of | |
205 | # multi-component configurations. | |
206 | case $field1 in | |
207 | 386bsd) | |
208 | basic_machine=i386-pc | |
5f8c2a15 | 209 | basic_os=bsd |
c5244148 SH |
210 | ;; |
211 | a29khif) | |
212 | basic_machine=a29k-amd | |
5f8c2a15 | 213 | basic_os=udi |
c5244148 SH |
214 | ;; |
215 | adobe68k) | |
216 | basic_machine=m68010-adobe | |
5f8c2a15 | 217 | basic_os=scout |
c5244148 | 218 | ;; |
d63f2be2 RO |
219 | alliant) |
220 | basic_machine=fx80-alliant | |
5f8c2a15 | 221 | basic_os= |
d63f2be2 RO |
222 | ;; |
223 | altos | altos3068) | |
224 | basic_machine=m68k-altos | |
5f8c2a15 | 225 | basic_os= |
d63f2be2 | 226 | ;; |
c5244148 SH |
227 | am29k) |
228 | basic_machine=a29k-none | |
5f8c2a15 | 229 | basic_os=bsd |
c5244148 SH |
230 | ;; |
231 | amdahl) | |
232 | basic_machine=580-amdahl | |
5f8c2a15 | 233 | basic_os=sysv |
c5244148 | 234 | ;; |
d63f2be2 RO |
235 | amiga) |
236 | basic_machine=m68k-unknown | |
5f8c2a15 | 237 | basic_os= |
d63f2be2 | 238 | ;; |
c5244148 SH |
239 | amigaos | amigados) |
240 | basic_machine=m68k-unknown | |
5f8c2a15 | 241 | basic_os=amigaos |
c5244148 SH |
242 | ;; |
243 | amigaunix | amix) | |
244 | basic_machine=m68k-unknown | |
5f8c2a15 | 245 | basic_os=sysv4 |
c5244148 SH |
246 | ;; |
247 | apollo68) | |
248 | basic_machine=m68k-apollo | |
5f8c2a15 | 249 | basic_os=sysv |
c5244148 SH |
250 | ;; |
251 | apollo68bsd) | |
252 | basic_machine=m68k-apollo | |
5f8c2a15 | 253 | basic_os=bsd |
c5244148 SH |
254 | ;; |
255 | aros) | |
256 | basic_machine=i386-pc | |
5f8c2a15 | 257 | basic_os=aros |
c5244148 SH |
258 | ;; |
259 | aux) | |
260 | basic_machine=m68k-apple | |
5f8c2a15 | 261 | basic_os=aux |
c5244148 SH |
262 | ;; |
263 | balance) | |
264 | basic_machine=ns32k-sequent | |
5f8c2a15 | 265 | basic_os=dynix |
c5244148 SH |
266 | ;; |
267 | blackfin) | |
268 | basic_machine=bfin-unknown | |
5f8c2a15 | 269 | basic_os=linux |
c5244148 SH |
270 | ;; |
271 | cegcc) | |
272 | basic_machine=arm-unknown | |
5f8c2a15 | 273 | basic_os=cegcc |
c5244148 | 274 | ;; |
d63f2be2 RO |
275 | convex-c1) |
276 | basic_machine=c1-convex | |
5f8c2a15 | 277 | basic_os=bsd |
d63f2be2 RO |
278 | ;; |
279 | convex-c2) | |
280 | basic_machine=c2-convex | |
5f8c2a15 | 281 | basic_os=bsd |
d63f2be2 RO |
282 | ;; |
283 | convex-c32) | |
284 | basic_machine=c32-convex | |
5f8c2a15 | 285 | basic_os=bsd |
d63f2be2 RO |
286 | ;; |
287 | convex-c34) | |
288 | basic_machine=c34-convex | |
5f8c2a15 | 289 | basic_os=bsd |
d63f2be2 RO |
290 | ;; |
291 | convex-c38) | |
292 | basic_machine=c38-convex | |
5f8c2a15 | 293 | basic_os=bsd |
d63f2be2 | 294 | ;; |
c5244148 SH |
295 | cray) |
296 | basic_machine=j90-cray | |
5f8c2a15 | 297 | basic_os=unicos |
c5244148 | 298 | ;; |
d63f2be2 RO |
299 | crds | unos) |
300 | basic_machine=m68k-crds | |
5f8c2a15 | 301 | basic_os= |
d63f2be2 RO |
302 | ;; |
303 | da30) | |
304 | basic_machine=m68k-da30 | |
5f8c2a15 | 305 | basic_os= |
d63f2be2 RO |
306 | ;; |
307 | decstation | pmax | pmin | dec3100 | decstatn) | |
308 | basic_machine=mips-dec | |
5f8c2a15 | 309 | basic_os= |
c5244148 SH |
310 | ;; |
311 | delta88) | |
312 | basic_machine=m88k-motorola | |
5f8c2a15 | 313 | basic_os=sysv3 |
c5244148 SH |
314 | ;; |
315 | dicos) | |
316 | basic_machine=i686-pc | |
5f8c2a15 | 317 | basic_os=dicos |
c5244148 SH |
318 | ;; |
319 | djgpp) | |
320 | basic_machine=i586-pc | |
5f8c2a15 | 321 | basic_os=msdosdjgpp |
c5244148 SH |
322 | ;; |
323 | ebmon29k) | |
324 | basic_machine=a29k-amd | |
5f8c2a15 | 325 | basic_os=ebmon |
c5244148 SH |
326 | ;; |
327 | es1800 | OSE68k | ose68k | ose | OSE) | |
328 | basic_machine=m68k-ericsson | |
5f8c2a15 | 329 | basic_os=ose |
c5244148 SH |
330 | ;; |
331 | gmicro) | |
332 | basic_machine=tron-gmicro | |
5f8c2a15 | 333 | basic_os=sysv |
c5244148 SH |
334 | ;; |
335 | go32) | |
336 | basic_machine=i386-pc | |
5f8c2a15 | 337 | basic_os=go32 |
c5244148 SH |
338 | ;; |
339 | h8300hms) | |
340 | basic_machine=h8300-hitachi | |
5f8c2a15 | 341 | basic_os=hms |
c5244148 SH |
342 | ;; |
343 | h8300xray) | |
344 | basic_machine=h8300-hitachi | |
5f8c2a15 | 345 | basic_os=xray |
c5244148 SH |
346 | ;; |
347 | h8500hms) | |
348 | basic_machine=h8500-hitachi | |
5f8c2a15 | 349 | basic_os=hms |
c5244148 SH |
350 | ;; |
351 | harris) | |
352 | basic_machine=m88k-harris | |
5f8c2a15 | 353 | basic_os=sysv3 |
c5244148 | 354 | ;; |
4fb3a8da | 355 | hp300 | hp300hpux) |
d63f2be2 | 356 | basic_machine=m68k-hp |
5f8c2a15 | 357 | basic_os=hpux |
d63f2be2 | 358 | ;; |
c5244148 SH |
359 | hp300bsd) |
360 | basic_machine=m68k-hp | |
5f8c2a15 | 361 | basic_os=bsd |
c5244148 | 362 | ;; |
c5244148 SH |
363 | hppaosf) |
364 | basic_machine=hppa1.1-hp | |
5f8c2a15 | 365 | basic_os=osf |
c5244148 SH |
366 | ;; |
367 | hppro) | |
368 | basic_machine=hppa1.1-hp | |
5f8c2a15 | 369 | basic_os=proelf |
c5244148 SH |
370 | ;; |
371 | i386mach) | |
372 | basic_machine=i386-mach | |
5f8c2a15 | 373 | basic_os=mach |
c5244148 | 374 | ;; |
c5244148 SH |
375 | isi68 | isi) |
376 | basic_machine=m68k-isi | |
5f8c2a15 | 377 | basic_os=sysv |
c5244148 SH |
378 | ;; |
379 | m68knommu) | |
380 | basic_machine=m68k-unknown | |
5f8c2a15 | 381 | basic_os=linux |
c5244148 SH |
382 | ;; |
383 | magnum | m3230) | |
384 | basic_machine=mips-mips | |
5f8c2a15 | 385 | basic_os=sysv |
c5244148 SH |
386 | ;; |
387 | merlin) | |
388 | basic_machine=ns32k-utek | |
5f8c2a15 | 389 | basic_os=sysv |
c5244148 SH |
390 | ;; |
391 | mingw64) | |
392 | basic_machine=x86_64-pc | |
5f8c2a15 | 393 | basic_os=mingw64 |
c5244148 SH |
394 | ;; |
395 | mingw32) | |
396 | basic_machine=i686-pc | |
5f8c2a15 | 397 | basic_os=mingw32 |
c5244148 SH |
398 | ;; |
399 | mingw32ce) | |
400 | basic_machine=arm-unknown | |
5f8c2a15 | 401 | basic_os=mingw32ce |
c5244148 SH |
402 | ;; |
403 | monitor) | |
404 | basic_machine=m68k-rom68k | |
5f8c2a15 | 405 | basic_os=coff |
c5244148 SH |
406 | ;; |
407 | morphos) | |
408 | basic_machine=powerpc-unknown | |
5f8c2a15 | 409 | basic_os=morphos |
c5244148 SH |
410 | ;; |
411 | moxiebox) | |
412 | basic_machine=moxie-unknown | |
5f8c2a15 | 413 | basic_os=moxiebox |
c5244148 SH |
414 | ;; |
415 | msdos) | |
416 | basic_machine=i386-pc | |
5f8c2a15 | 417 | basic_os=msdos |
c5244148 SH |
418 | ;; |
419 | msys) | |
420 | basic_machine=i686-pc | |
5f8c2a15 | 421 | basic_os=msys |
c5244148 SH |
422 | ;; |
423 | mvs) | |
424 | basic_machine=i370-ibm | |
5f8c2a15 | 425 | basic_os=mvs |
c5244148 SH |
426 | ;; |
427 | nacl) | |
428 | basic_machine=le32-unknown | |
5f8c2a15 | 429 | basic_os=nacl |
c5244148 SH |
430 | ;; |
431 | ncr3000) | |
432 | basic_machine=i486-ncr | |
5f8c2a15 | 433 | basic_os=sysv4 |
c5244148 SH |
434 | ;; |
435 | netbsd386) | |
d63f2be2 | 436 | basic_machine=i386-pc |
5f8c2a15 | 437 | basic_os=netbsd |
c5244148 SH |
438 | ;; |
439 | netwinder) | |
440 | basic_machine=armv4l-rebel | |
5f8c2a15 | 441 | basic_os=linux |
c5244148 SH |
442 | ;; |
443 | news | news700 | news800 | news900) | |
444 | basic_machine=m68k-sony | |
5f8c2a15 | 445 | basic_os=newsos |
c5244148 SH |
446 | ;; |
447 | news1000) | |
448 | basic_machine=m68030-sony | |
5f8c2a15 | 449 | basic_os=newsos |
c5244148 SH |
450 | ;; |
451 | necv70) | |
452 | basic_machine=v70-nec | |
5f8c2a15 | 453 | basic_os=sysv |
c5244148 SH |
454 | ;; |
455 | nh3000) | |
456 | basic_machine=m68k-harris | |
5f8c2a15 | 457 | basic_os=cxux |
c5244148 SH |
458 | ;; |
459 | nh[45]000) | |
460 | basic_machine=m88k-harris | |
5f8c2a15 | 461 | basic_os=cxux |
c5244148 SH |
462 | ;; |
463 | nindy960) | |
464 | basic_machine=i960-intel | |
5f8c2a15 | 465 | basic_os=nindy |
c5244148 SH |
466 | ;; |
467 | mon960) | |
468 | basic_machine=i960-intel | |
5f8c2a15 | 469 | basic_os=mon960 |
c5244148 SH |
470 | ;; |
471 | nonstopux) | |
472 | basic_machine=mips-compaq | |
5f8c2a15 | 473 | basic_os=nonstopux |
c5244148 SH |
474 | ;; |
475 | os400) | |
476 | basic_machine=powerpc-ibm | |
5f8c2a15 | 477 | basic_os=os400 |
c5244148 SH |
478 | ;; |
479 | OSE68000 | ose68000) | |
480 | basic_machine=m68000-ericsson | |
5f8c2a15 | 481 | basic_os=ose |
c5244148 SH |
482 | ;; |
483 | os68k) | |
484 | basic_machine=m68k-none | |
5f8c2a15 | 485 | basic_os=os68k |
c5244148 SH |
486 | ;; |
487 | paragon) | |
488 | basic_machine=i860-intel | |
5f8c2a15 | 489 | basic_os=osf |
c5244148 SH |
490 | ;; |
491 | parisc) | |
492 | basic_machine=hppa-unknown | |
5f8c2a15 AM |
493 | basic_os=linux |
494 | ;; | |
495 | psp) | |
496 | basic_machine=mipsallegrexel-sony | |
497 | basic_os=psp | |
c5244148 SH |
498 | ;; |
499 | pw32) | |
500 | basic_machine=i586-unknown | |
5f8c2a15 | 501 | basic_os=pw32 |
c5244148 SH |
502 | ;; |
503 | rdos | rdos64) | |
504 | basic_machine=x86_64-pc | |
5f8c2a15 | 505 | basic_os=rdos |
c5244148 SH |
506 | ;; |
507 | rdos32) | |
508 | basic_machine=i386-pc | |
5f8c2a15 | 509 | basic_os=rdos |
c5244148 SH |
510 | ;; |
511 | rom68k) | |
512 | basic_machine=m68k-rom68k | |
5f8c2a15 | 513 | basic_os=coff |
c5244148 SH |
514 | ;; |
515 | sa29200) | |
516 | basic_machine=a29k-amd | |
5f8c2a15 | 517 | basic_os=udi |
c5244148 SH |
518 | ;; |
519 | sei) | |
520 | basic_machine=mips-sei | |
5f8c2a15 | 521 | basic_os=seiux |
c5244148 | 522 | ;; |
d63f2be2 RO |
523 | sequent) |
524 | basic_machine=i386-sequent | |
5f8c2a15 | 525 | basic_os= |
d63f2be2 | 526 | ;; |
c5244148 SH |
527 | sps7) |
528 | basic_machine=m68k-bull | |
5f8c2a15 | 529 | basic_os=sysv2 |
c5244148 | 530 | ;; |
d63f2be2 RO |
531 | st2000) |
532 | basic_machine=m68k-tandem | |
5f8c2a15 | 533 | basic_os= |
d63f2be2 | 534 | ;; |
c5244148 SH |
535 | stratus) |
536 | basic_machine=i860-stratus | |
5f8c2a15 | 537 | basic_os=sysv4 |
c5244148 | 538 | ;; |
d63f2be2 RO |
539 | sun2) |
540 | basic_machine=m68000-sun | |
5f8c2a15 | 541 | basic_os= |
d63f2be2 | 542 | ;; |
c5244148 SH |
543 | sun2os3) |
544 | basic_machine=m68000-sun | |
5f8c2a15 | 545 | basic_os=sunos3 |
c5244148 SH |
546 | ;; |
547 | sun2os4) | |
548 | basic_machine=m68000-sun | |
5f8c2a15 | 549 | basic_os=sunos4 |
c5244148 | 550 | ;; |
d63f2be2 RO |
551 | sun3) |
552 | basic_machine=m68k-sun | |
5f8c2a15 | 553 | basic_os= |
d63f2be2 | 554 | ;; |
c5244148 SH |
555 | sun3os3) |
556 | basic_machine=m68k-sun | |
5f8c2a15 | 557 | basic_os=sunos3 |
c5244148 SH |
558 | ;; |
559 | sun3os4) | |
560 | basic_machine=m68k-sun | |
5f8c2a15 | 561 | basic_os=sunos4 |
c5244148 | 562 | ;; |
d63f2be2 RO |
563 | sun4) |
564 | basic_machine=sparc-sun | |
5f8c2a15 | 565 | basic_os= |
d63f2be2 | 566 | ;; |
c5244148 SH |
567 | sun4os3) |
568 | basic_machine=sparc-sun | |
5f8c2a15 | 569 | basic_os=sunos3 |
c5244148 SH |
570 | ;; |
571 | sun4os4) | |
572 | basic_machine=sparc-sun | |
5f8c2a15 | 573 | basic_os=sunos4 |
c5244148 SH |
574 | ;; |
575 | sun4sol2) | |
576 | basic_machine=sparc-sun | |
5f8c2a15 | 577 | basic_os=solaris2 |
c5244148 | 578 | ;; |
d63f2be2 RO |
579 | sun386 | sun386i | roadrunner) |
580 | basic_machine=i386-sun | |
5f8c2a15 | 581 | basic_os= |
d63f2be2 | 582 | ;; |
c5244148 SH |
583 | sv1) |
584 | basic_machine=sv1-cray | |
5f8c2a15 | 585 | basic_os=unicos |
c5244148 SH |
586 | ;; |
587 | symmetry) | |
588 | basic_machine=i386-sequent | |
5f8c2a15 | 589 | basic_os=dynix |
c5244148 SH |
590 | ;; |
591 | t3e) | |
592 | basic_machine=alphaev5-cray | |
5f8c2a15 | 593 | basic_os=unicos |
c5244148 SH |
594 | ;; |
595 | t90) | |
596 | basic_machine=t90-cray | |
5f8c2a15 | 597 | basic_os=unicos |
c5244148 SH |
598 | ;; |
599 | toad1) | |
600 | basic_machine=pdp10-xkl | |
5f8c2a15 | 601 | basic_os=tops20 |
c5244148 SH |
602 | ;; |
603 | tpf) | |
604 | basic_machine=s390x-ibm | |
5f8c2a15 | 605 | basic_os=tpf |
c5244148 SH |
606 | ;; |
607 | udi29k) | |
608 | basic_machine=a29k-amd | |
5f8c2a15 | 609 | basic_os=udi |
c5244148 SH |
610 | ;; |
611 | ultra3) | |
612 | basic_machine=a29k-nyu | |
5f8c2a15 | 613 | basic_os=sym1 |
c5244148 SH |
614 | ;; |
615 | v810 | necv810) | |
616 | basic_machine=v810-nec | |
5f8c2a15 | 617 | basic_os=none |
c5244148 SH |
618 | ;; |
619 | vaxv) | |
620 | basic_machine=vax-dec | |
5f8c2a15 | 621 | basic_os=sysv |
c5244148 SH |
622 | ;; |
623 | vms) | |
624 | basic_machine=vax-dec | |
5f8c2a15 | 625 | basic_os=vms |
c5244148 | 626 | ;; |
4fb3a8da NC |
627 | vsta) |
628 | basic_machine=i386-pc | |
5f8c2a15 | 629 | basic_os=vsta |
4fb3a8da | 630 | ;; |
c5244148 SH |
631 | vxworks960) |
632 | basic_machine=i960-wrs | |
5f8c2a15 | 633 | basic_os=vxworks |
c5244148 SH |
634 | ;; |
635 | vxworks68) | |
636 | basic_machine=m68k-wrs | |
5f8c2a15 | 637 | basic_os=vxworks |
c5244148 SH |
638 | ;; |
639 | vxworks29k) | |
640 | basic_machine=a29k-wrs | |
5f8c2a15 | 641 | basic_os=vxworks |
c5244148 SH |
642 | ;; |
643 | xbox) | |
644 | basic_machine=i686-pc | |
5f8c2a15 | 645 | basic_os=mingw32 |
c5244148 SH |
646 | ;; |
647 | ymp) | |
648 | basic_machine=ymp-cray | |
5f8c2a15 | 649 | basic_os=unicos |
c5244148 SH |
650 | ;; |
651 | *) | |
652 | basic_machine=$1 | |
5f8c2a15 | 653 | basic_os= |
c5244148 SH |
654 | ;; |
655 | esac | |
ada59422 | 656 | ;; |
252b5132 RH |
657 | esac |
658 | ||
d63f2be2 | 659 | # Decode 1-component or ad-hoc basic machines |
252b5132 | 660 | case $basic_machine in |
d63f2be2 RO |
661 | # Here we handle the default manufacturer of certain CPU types. It is in |
662 | # some cases the only manufacturer, in others, it is the most popular. | |
663 | w89k) | |
664 | cpu=hppa1.1 | |
665 | vendor=winbond | |
b5778783 | 666 | ;; |
d63f2be2 RO |
667 | op50n) |
668 | cpu=hppa1.1 | |
669 | vendor=oki | |
ada59422 | 670 | ;; |
d63f2be2 RO |
671 | op60c) |
672 | cpu=hppa1.1 | |
673 | vendor=oki | |
ec49b2b8 | 674 | ;; |
d63f2be2 RO |
675 | ibm*) |
676 | cpu=i370 | |
677 | vendor=ibm | |
29b2c556 | 678 | ;; |
d63f2be2 RO |
679 | orion105) |
680 | cpu=clipper | |
681 | vendor=highlevel | |
d2213593 | 682 | ;; |
d63f2be2 RO |
683 | mac | mpw | mac-mpw) |
684 | cpu=m68k | |
685 | vendor=apple | |
29b2c556 | 686 | ;; |
d63f2be2 RO |
687 | pmac | pmac-mpw) |
688 | cpu=powerpc | |
689 | vendor=apple | |
29b2c556 JM |
690 | ;; |
691 | ||
252b5132 RH |
692 | # Recognize the various machine names and aliases which stand |
693 | # for a CPU type and a company and sometimes even an OS. | |
252b5132 | 694 | 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) |
d63f2be2 RO |
695 | cpu=m68000 |
696 | vendor=att | |
252b5132 RH |
697 | ;; |
698 | 3b*) | |
d63f2be2 RO |
699 | cpu=we32k |
700 | vendor=att | |
ad25e7d5 | 701 | ;; |
2262bbf4 | 702 | bluegene*) |
d63f2be2 RO |
703 | cpu=powerpc |
704 | vendor=ibm | |
5f8c2a15 | 705 | basic_os=cnk |
2262bbf4 | 706 | ;; |
0e254642 | 707 | decsystem10* | dec10*) |
d63f2be2 RO |
708 | cpu=pdp10 |
709 | vendor=dec | |
5f8c2a15 | 710 | basic_os=tops10 |
0e254642 AM |
711 | ;; |
712 | decsystem20* | dec20*) | |
d63f2be2 RO |
713 | cpu=pdp10 |
714 | vendor=dec | |
5f8c2a15 | 715 | basic_os=tops20 |
0e254642 | 716 | ;; |
252b5132 RH |
717 | delta | 3300 | motorola-3300 | motorola-delta \ |
718 | | 3300-motorola | delta-motorola) | |
d63f2be2 RO |
719 | cpu=m68k |
720 | vendor=motorola | |
252b5132 | 721 | ;; |
bf41f30d | 722 | dpx2*) |
d63f2be2 RO |
723 | cpu=m68k |
724 | vendor=bull | |
5f8c2a15 | 725 | basic_os=sysv3 |
252b5132 | 726 | ;; |
252b5132 | 727 | encore | umax | mmax) |
d63f2be2 RO |
728 | cpu=ns32k |
729 | vendor=encore | |
252b5132 | 730 | ;; |
c5244148 | 731 | elxsi) |
d63f2be2 RO |
732 | cpu=elxsi |
733 | vendor=elxsi | |
5f8c2a15 | 734 | basic_os=${basic_os:-bsd} |
252b5132 RH |
735 | ;; |
736 | fx2800) | |
d63f2be2 RO |
737 | cpu=i860 |
738 | vendor=alliant | |
252b5132 RH |
739 | ;; |
740 | genix) | |
d63f2be2 RO |
741 | cpu=ns32k |
742 | vendor=ns | |
252b5132 | 743 | ;; |
252b5132 | 744 | h3050r* | hiux*) |
d63f2be2 RO |
745 | cpu=hppa1.1 |
746 | vendor=hitachi | |
5f8c2a15 | 747 | basic_os=hiuxwe2 |
252b5132 | 748 | ;; |
252b5132 | 749 | hp3k9[0-9][0-9] | hp9[0-9][0-9]) |
d63f2be2 RO |
750 | cpu=hppa1.0 |
751 | vendor=hp | |
252b5132 RH |
752 | ;; |
753 | hp9k2[0-9][0-9] | hp9k31[0-9]) | |
d63f2be2 RO |
754 | cpu=m68000 |
755 | vendor=hp | |
252b5132 RH |
756 | ;; |
757 | hp9k3[2-9][0-9]) | |
d63f2be2 RO |
758 | cpu=m68k |
759 | vendor=hp | |
252b5132 | 760 | ;; |
6c3175b0 | 761 | hp9k6[0-9][0-9] | hp6[0-9][0-9]) |
d63f2be2 RO |
762 | cpu=hppa1.0 |
763 | vendor=hp | |
252b5132 | 764 | ;; |
6c3175b0 | 765 | hp9k7[0-79][0-9] | hp7[0-79][0-9]) |
d63f2be2 RO |
766 | cpu=hppa1.1 |
767 | vendor=hp | |
252b5132 | 768 | ;; |
6c3175b0 | 769 | hp9k78[0-9] | hp78[0-9]) |
252b5132 | 770 | # FIXME: really hppa2.0-hp |
d63f2be2 RO |
771 | cpu=hppa1.1 |
772 | vendor=hp | |
252b5132 | 773 | ;; |
6c3175b0 | 774 | hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) |
252b5132 | 775 | # FIXME: really hppa2.0-hp |
d63f2be2 RO |
776 | cpu=hppa1.1 |
777 | vendor=hp | |
252b5132 | 778 | ;; |
6c3175b0 | 779 | hp9k8[0-9][13679] | hp8[0-9][13679]) |
d63f2be2 RO |
780 | cpu=hppa1.1 |
781 | vendor=hp | |
252b5132 RH |
782 | ;; |
783 | hp9k8[0-9][0-9] | hp8[0-9][0-9]) | |
d63f2be2 RO |
784 | cpu=hppa1.0 |
785 | vendor=hp | |
252b5132 | 786 | ;; |
82208dc5 | 787 | i*86v32) |
6c037fdb | 788 | cpu=`echo "$1" | sed -e 's/86.*/86/'` |
d63f2be2 | 789 | vendor=pc |
5f8c2a15 | 790 | basic_os=sysv32 |
252b5132 | 791 | ;; |
82208dc5 | 792 | i*86v4*) |
6c037fdb | 793 | cpu=`echo "$1" | sed -e 's/86.*/86/'` |
d63f2be2 | 794 | vendor=pc |
5f8c2a15 | 795 | basic_os=sysv4 |
252b5132 | 796 | ;; |
82208dc5 | 797 | i*86v) |
6c037fdb | 798 | cpu=`echo "$1" | sed -e 's/86.*/86/'` |
d63f2be2 | 799 | vendor=pc |
5f8c2a15 | 800 | basic_os=sysv |
252b5132 | 801 | ;; |
82208dc5 | 802 | i*86sol2) |
6c037fdb | 803 | cpu=`echo "$1" | sed -e 's/86.*/86/'` |
d63f2be2 | 804 | vendor=pc |
5f8c2a15 | 805 | basic_os=solaris2 |
252b5132 | 806 | ;; |
c5244148 | 807 | j90 | j90-cray) |
d63f2be2 RO |
808 | cpu=j90 |
809 | vendor=cray | |
5f8c2a15 | 810 | basic_os=${basic_os:-unicos} |
252b5132 | 811 | ;; |
252b5132 | 812 | iris | iris4d) |
d63f2be2 RO |
813 | cpu=mips |
814 | vendor=sgi | |
5f8c2a15 | 815 | case $basic_os in |
c5244148 | 816 | irix*) |
252b5132 RH |
817 | ;; |
818 | *) | |
5f8c2a15 | 819 | basic_os=irix4 |
252b5132 RH |
820 | ;; |
821 | esac | |
822 | ;; | |
252b5132 | 823 | miniframe) |
d63f2be2 RO |
824 | cpu=m68000 |
825 | vendor=convergent | |
252b5132 | 826 | ;; |
c5244148 | 827 | *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) |
d63f2be2 RO |
828 | cpu=m68k |
829 | vendor=atari | |
5f8c2a15 | 830 | basic_os=mint |
6c3175b0 | 831 | ;; |
252b5132 | 832 | news-3600 | risc-news) |
d63f2be2 RO |
833 | cpu=mips |
834 | vendor=sony | |
5f8c2a15 | 835 | basic_os=newsos |
252b5132 | 836 | ;; |
bf41f30d | 837 | next | m*-next) |
d63f2be2 RO |
838 | cpu=m68k |
839 | vendor=next | |
5f8c2a15 | 840 | case $basic_os in |
2376c370 JM |
841 | openstep*) |
842 | ;; | |
843 | nextstep*) | |
252b5132 | 844 | ;; |
c5244148 | 845 | ns2*) |
5f8c2a15 | 846 | basic_os=nextstep2 |
252b5132 RH |
847 | ;; |
848 | *) | |
5f8c2a15 | 849 | basic_os=nextstep3 |
252b5132 RH |
850 | ;; |
851 | esac | |
852 | ;; | |
252b5132 | 853 | np1) |
d63f2be2 RO |
854 | cpu=np1 |
855 | vendor=gould | |
252b5132 | 856 | ;; |
d63f2be2 RO |
857 | op50n-* | op60c-*) |
858 | cpu=hppa1.1 | |
859 | vendor=oki | |
5f8c2a15 | 860 | basic_os=proelf |
5548b4ce | 861 | ;; |
d63f2be2 RO |
862 | pa-hitachi) |
863 | cpu=hppa1.1 | |
864 | vendor=hitachi | |
5f8c2a15 | 865 | basic_os=hiuxwe2 |
5548b4ce | 866 | ;; |
d63f2be2 RO |
867 | pbd) |
868 | cpu=sparc | |
869 | vendor=tti | |
ac73857d | 870 | ;; |
d63f2be2 RO |
871 | pbb) |
872 | cpu=m68k | |
873 | vendor=tti | |
b5778783 | 874 | ;; |
d63f2be2 RO |
875 | pc532) |
876 | cpu=ns32k | |
877 | vendor=pc532 | |
11997a83 | 878 | ;; |
d63f2be2 RO |
879 | pn) |
880 | cpu=pn | |
881 | vendor=gould | |
6c3175b0 | 882 | ;; |
d63f2be2 RO |
883 | power) |
884 | cpu=power | |
885 | vendor=ibm | |
f6e1c110 | 886 | ;; |
d63f2be2 RO |
887 | ps2) |
888 | cpu=i386 | |
889 | vendor=ibm | |
ad25e7d5 | 890 | ;; |
d63f2be2 RO |
891 | rm[46]00) |
892 | cpu=mips | |
893 | vendor=siemens | |
ad25e7d5 | 894 | ;; |
d63f2be2 RO |
895 | rtpc | rtpc-*) |
896 | cpu=romp | |
897 | vendor=ibm | |
252b5132 | 898 | ;; |
d63f2be2 RO |
899 | sde) |
900 | cpu=mipsisa32 | |
901 | vendor=sde | |
5f8c2a15 | 902 | basic_os=${basic_os:-elf} |
252b5132 | 903 | ;; |
d63f2be2 RO |
904 | simso-wrs) |
905 | cpu=sparclite | |
906 | vendor=wrs | |
5f8c2a15 | 907 | basic_os=vxworks |
252b5132 | 908 | ;; |
d63f2be2 RO |
909 | tower | tower-32) |
910 | cpu=m68k | |
911 | vendor=ncr | |
ec49b2b8 | 912 | ;; |
d63f2be2 RO |
913 | vpp*|vx|vx-*) |
914 | cpu=f301 | |
915 | vendor=fujitsu | |
916 | ;; | |
917 | w65) | |
918 | cpu=w65 | |
919 | vendor=wdc | |
920 | ;; | |
921 | w89k-*) | |
922 | cpu=hppa1.1 | |
923 | vendor=winbond | |
5f8c2a15 | 924 | basic_os=proelf |
ec49b2b8 | 925 | ;; |
d63f2be2 RO |
926 | none) |
927 | cpu=none | |
928 | vendor=none | |
252b5132 | 929 | ;; |
d63f2be2 RO |
930 | leon|leon[3-9]) |
931 | cpu=sparc | |
932 | vendor=$basic_machine | |
252b5132 | 933 | ;; |
d63f2be2 RO |
934 | leon-*|leon[3-9]-*) |
935 | cpu=sparc | |
6c037fdb | 936 | vendor=`echo "$basic_machine" | sed 's/-.*//'` |
252b5132 | 937 | ;; |
d63f2be2 RO |
938 | |
939 | *-*) | |
2376c370 | 940 | # shellcheck disable=SC2162 |
6c037fdb | 941 | saved_IFS=$IFS |
d63f2be2 RO |
942 | IFS="-" read cpu vendor <<EOF |
943 | $basic_machine | |
944 | EOF | |
6c037fdb | 945 | IFS=$saved_IFS |
00c22daa | 946 | ;; |
996ff3e8 | 947 | # We use 'pc' rather than 'unknown' |
d63f2be2 RO |
948 | # because (1) that's what they normally are, and |
949 | # (2) the word "unknown" tends to confuse beginning users. | |
950 | i*86 | x86_64) | |
951 | cpu=$basic_machine | |
952 | vendor=pc | |
252b5132 | 953 | ;; |
d63f2be2 RO |
954 | # These rules are duplicated from below for sake of the special case above; |
955 | # i.e. things that normalized to x86 arches should also default to "pc" | |
956 | pc98) | |
957 | cpu=i386 | |
958 | vendor=pc | |
252b5132 | 959 | ;; |
d63f2be2 RO |
960 | x64 | amd64) |
961 | cpu=x86_64 | |
962 | vendor=pc | |
252b5132 | 963 | ;; |
d63f2be2 RO |
964 | # Recognize the basic CPU types without company name. |
965 | *) | |
966 | cpu=$basic_machine | |
967 | vendor=unknown | |
00c22daa | 968 | ;; |
d63f2be2 RO |
969 | esac |
970 | ||
971 | unset -v basic_machine | |
972 | ||
973 | # Decode basic machines in the full and proper CPU-Company form. | |
974 | case $cpu-$vendor in | |
975 | # Here we handle the default manufacturer of certain CPU types in canonical form. It is in | |
976 | # some cases the only manufacturer, in others, it is the most popular. | |
977 | craynv-unknown) | |
978 | vendor=cray | |
5f8c2a15 | 979 | basic_os=${basic_os:-unicosmp} |
d63f2be2 RO |
980 | ;; |
981 | c90-unknown | c90-cray) | |
982 | vendor=cray | |
5f8c2a15 | 983 | basic_os=${Basic_os:-unicos} |
252b5132 | 984 | ;; |
d63f2be2 RO |
985 | fx80-unknown) |
986 | vendor=alliant | |
252b5132 | 987 | ;; |
d63f2be2 RO |
988 | romp-unknown) |
989 | vendor=ibm | |
fd31a171 | 990 | ;; |
d63f2be2 RO |
991 | mmix-unknown) |
992 | vendor=knuth | |
252b5132 | 993 | ;; |
d63f2be2 RO |
994 | microblaze-unknown | microblazeel-unknown) |
995 | vendor=xilinx | |
fd31a171 | 996 | ;; |
d63f2be2 RO |
997 | rs6000-unknown) |
998 | vendor=ibm | |
252b5132 | 999 | ;; |
d63f2be2 RO |
1000 | vax-unknown) |
1001 | vendor=dec | |
fd31a171 | 1002 | ;; |
d63f2be2 RO |
1003 | pdp11-unknown) |
1004 | vendor=dec | |
82208dc5 | 1005 | ;; |
d63f2be2 RO |
1006 | we32k-unknown) |
1007 | vendor=att | |
fd31a171 | 1008 | ;; |
d63f2be2 RO |
1009 | cydra-unknown) |
1010 | vendor=cydrome | |
82208dc5 | 1011 | ;; |
d63f2be2 RO |
1012 | i370-ibm*) |
1013 | vendor=ibm | |
252b5132 | 1014 | ;; |
d63f2be2 RO |
1015 | orion-unknown) |
1016 | vendor=highlevel | |
252b5132 | 1017 | ;; |
d63f2be2 RO |
1018 | xps-unknown | xps100-unknown) |
1019 | cpu=xps100 | |
1020 | vendor=honeywell | |
1021 | ;; | |
1022 | ||
1023 | # Here we normalize CPU types with a missing or matching vendor | |
6c037fdb NC |
1024 | armh-unknown | armh-alt) |
1025 | cpu=armv7l | |
1026 | vendor=alt | |
1027 | basic_os=${basic_os:-linux-gnueabihf} | |
1028 | ;; | |
d63f2be2 RO |
1029 | dpx20-unknown | dpx20-bull) |
1030 | cpu=rs6000 | |
1031 | vendor=bull | |
5f8c2a15 | 1032 | basic_os=${basic_os:-bosx} |
252b5132 | 1033 | ;; |
d63f2be2 RO |
1034 | |
1035 | # Here we normalize CPU types irrespective of the vendor | |
1036 | amd64-*) | |
1037 | cpu=x86_64 | |
26ef82f4 | 1038 | ;; |
d63f2be2 RO |
1039 | blackfin-*) |
1040 | cpu=bfin | |
5f8c2a15 | 1041 | basic_os=linux |
26ef82f4 | 1042 | ;; |
d63f2be2 RO |
1043 | c54x-*) |
1044 | cpu=tic54x | |
fd31a171 | 1045 | ;; |
d63f2be2 RO |
1046 | c55x-*) |
1047 | cpu=tic55x | |
fd31a171 | 1048 | ;; |
d63f2be2 RO |
1049 | c6x-*) |
1050 | cpu=tic6x | |
1e600082 | 1051 | ;; |
d63f2be2 RO |
1052 | e500v[12]-*) |
1053 | cpu=powerpc | |
5f8c2a15 | 1054 | basic_os=${basic_os}"spe" |
252b5132 | 1055 | ;; |
d63f2be2 RO |
1056 | mips3*-*) |
1057 | cpu=mips64 | |
0cfa5389 | 1058 | ;; |
d63f2be2 RO |
1059 | ms1-*) |
1060 | cpu=mt | |
252b5132 | 1061 | ;; |
d63f2be2 RO |
1062 | m68knommu-*) |
1063 | cpu=m68k | |
5f8c2a15 | 1064 | basic_os=linux |
252b5132 | 1065 | ;; |
d63f2be2 RO |
1066 | m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) |
1067 | cpu=s12z | |
252b5132 | 1068 | ;; |
d63f2be2 RO |
1069 | openrisc-*) |
1070 | cpu=or32 | |
29b2c556 | 1071 | ;; |
d63f2be2 RO |
1072 | parisc-*) |
1073 | cpu=hppa | |
5f8c2a15 | 1074 | basic_os=linux |
252b5132 | 1075 | ;; |
d63f2be2 RO |
1076 | pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) |
1077 | cpu=i586 | |
252b5132 | 1078 | ;; |
996ff3e8 | 1079 | pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*) |
d63f2be2 | 1080 | cpu=i686 |
252b5132 | 1081 | ;; |
d63f2be2 RO |
1082 | pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) |
1083 | cpu=i686 | |
252b5132 | 1084 | ;; |
d63f2be2 RO |
1085 | pentium4-*) |
1086 | cpu=i786 | |
19090595 | 1087 | ;; |
d63f2be2 RO |
1088 | pc98-*) |
1089 | cpu=i386 | |
252b5132 | 1090 | ;; |
d63f2be2 RO |
1091 | ppc-* | ppcbe-*) |
1092 | cpu=powerpc | |
252b5132 | 1093 | ;; |
d63f2be2 RO |
1094 | ppcle-* | powerpclittle-*) |
1095 | cpu=powerpcle | |
252b5132 | 1096 | ;; |
d63f2be2 RO |
1097 | ppc64-*) |
1098 | cpu=powerpc64 | |
fd31a171 | 1099 | ;; |
d63f2be2 RO |
1100 | ppc64le-* | powerpc64little-*) |
1101 | cpu=powerpc64le | |
6c3175b0 | 1102 | ;; |
d63f2be2 RO |
1103 | sb1-*) |
1104 | cpu=mipsisa64sb1 | |
252b5132 | 1105 | ;; |
d63f2be2 RO |
1106 | sb1el-*) |
1107 | cpu=mipsisa64sb1el | |
bf41f30d | 1108 | ;; |
d63f2be2 | 1109 | sh5e[lb]-*) |
6c037fdb | 1110 | cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` |
252b5132 | 1111 | ;; |
d63f2be2 RO |
1112 | spur-*) |
1113 | cpu=spur | |
29b2c556 | 1114 | ;; |
d63f2be2 RO |
1115 | strongarm-* | thumb-*) |
1116 | cpu=arm | |
252b5132 | 1117 | ;; |
d63f2be2 RO |
1118 | tx39-*) |
1119 | cpu=mipstx39 | |
252b5132 | 1120 | ;; |
d63f2be2 RO |
1121 | tx39el-*) |
1122 | cpu=mipstx39el | |
252b5132 | 1123 | ;; |
d63f2be2 RO |
1124 | x64-*) |
1125 | cpu=x86_64 | |
252b5132 | 1126 | ;; |
d63f2be2 | 1127 | xscale-* | xscalee[bl]-*) |
6c037fdb | 1128 | cpu=`echo "$cpu" | sed 's/^xscale/arm/'` |
5f8c2a15 | 1129 | ;; |
6c037fdb | 1130 | arm64-* | aarch64le-*) |
5f8c2a15 | 1131 | cpu=aarch64 |
252b5132 | 1132 | ;; |
d63f2be2 RO |
1133 | |
1134 | # Recognize the canonical CPU Types that limit and/or modify the | |
1135 | # company names they are paired with. | |
1136 | cr16-*) | |
5f8c2a15 | 1137 | basic_os=${basic_os:-elf} |
eb1352ed | 1138 | ;; |
d63f2be2 RO |
1139 | crisv32-* | etraxfs*-*) |
1140 | cpu=crisv32 | |
1141 | vendor=axis | |
252b5132 | 1142 | ;; |
d63f2be2 RO |
1143 | cris-* | etrax*-*) |
1144 | cpu=cris | |
1145 | vendor=axis | |
252b5132 | 1146 | ;; |
d63f2be2 | 1147 | crx-*) |
5f8c2a15 | 1148 | basic_os=${basic_os:-elf} |
252b5132 | 1149 | ;; |
d63f2be2 RO |
1150 | neo-tandem) |
1151 | cpu=neo | |
1152 | vendor=tandem | |
252b5132 | 1153 | ;; |
d63f2be2 RO |
1154 | nse-tandem) |
1155 | cpu=nse | |
1156 | vendor=tandem | |
1af08294 | 1157 | ;; |
d63f2be2 RO |
1158 | nsr-tandem) |
1159 | cpu=nsr | |
1160 | vendor=tandem | |
252b5132 | 1161 | ;; |
d63f2be2 RO |
1162 | nsv-tandem) |
1163 | cpu=nsv | |
1164 | vendor=tandem | |
252b5132 | 1165 | ;; |
d63f2be2 RO |
1166 | nsx-tandem) |
1167 | cpu=nsx | |
1168 | vendor=tandem | |
252b5132 | 1169 | ;; |
5f8c2a15 AM |
1170 | mipsallegrexel-sony) |
1171 | cpu=mipsallegrexel | |
1172 | vendor=sony | |
252b5132 | 1173 | ;; |
d63f2be2 | 1174 | tile*-*) |
5f8c2a15 | 1175 | basic_os=${basic_os:-linux-gnu} |
82208dc5 | 1176 | ;; |
d63f2be2 | 1177 | |
252b5132 | 1178 | *) |
d63f2be2 RO |
1179 | # Recognize the canonical CPU types that are allowed with any |
1180 | # company name. | |
1181 | case $cpu in | |
1182 | 1750a | 580 \ | |
1183 | | a29k \ | |
ce3abd47 | 1184 | | aarch64 | aarch64_be | aarch64c | arm64ec \ |
d63f2be2 RO |
1185 | | abacus \ |
1186 | | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ | |
1187 | | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ | |
1188 | | alphapca5[67] | alpha64pca5[67] \ | |
1189 | | am33_2.0 \ | |
1190 | | amdgcn \ | |
6c037fdb | 1191 | | arc | arceb | arc32 | arc64 \ |
5f8c2a15 | 1192 | | arm | arm[lb]e | arme[lb] | armv* \ |
d63f2be2 RO |
1193 | | avr | avr32 \ |
1194 | | asmjs \ | |
1195 | | ba \ | |
1196 | | be32 | be64 \ | |
2376c370 | 1197 | | bfin | bpf | bs2000 \ |
d63f2be2 RO |
1198 | | c[123]* | c30 | [cjt]90 | c4x \ |
1199 | | c8051 | clipper | craynv | csky | cydra \ | |
1200 | | d10v | d30v | dlx | dsp16xx \ | |
1201 | | e2k | elxsi | epiphany \ | |
1202 | | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ | |
ce3abd47 | 1203 | | javascript \ |
d63f2be2 RO |
1204 | | h8300 | h8500 \ |
1205 | | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | |
1206 | | hexagon \ | |
1207 | | i370 | i*86 | i860 | i960 | ia16 | ia64 \ | |
1208 | | ip2k | iq2000 \ | |
1209 | | k1om \ | |
6e712424 | 1210 | | kvx \ |
d63f2be2 RO |
1211 | | le32 | le64 \ |
1212 | | lm32 \ | |
996ff3e8 | 1213 | | loongarch32 | loongarch64 \ |
d63f2be2 | 1214 | | m32c | m32r | m32rle \ |
2376c370 JM |
1215 | | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ |
1216 | | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ | |
d63f2be2 RO |
1217 | | m88110 | m88k | maxq | mb | mcore | mep | metag \ |
1218 | | microblaze | microblazeel \ | |
ce3abd47 | 1219 | | mips* \ |
d63f2be2 RO |
1220 | | mmix \ |
1221 | | mn10200 | mn10300 \ | |
1222 | | moxie \ | |
1223 | | mt \ | |
1224 | | msp430 \ | |
1225 | | nds32 | nds32le | nds32be \ | |
1226 | | nfp \ | |
1227 | | nios | nios2 | nios2eb | nios2el \ | |
2376c370 | 1228 | | none | np1 | ns16k | ns32k | nvptx \ |
d63f2be2 RO |
1229 | | open8 \ |
1230 | | or1k* \ | |
1231 | | or32 \ | |
1232 | | orion \ | |
2376c370 | 1233 | | picochip \ |
d63f2be2 RO |
1234 | | pdp10 | pdp11 | pj | pjl | pn | power \ |
1235 | | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | |
1236 | | pru \ | |
1237 | | pyramid \ | |
5f8c2a15 | 1238 | | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ |
d63f2be2 | 1239 | | rl78 | romp | rs6000 | rx \ |
5f8c2a15 | 1240 | | s390 | s390x \ |
d63f2be2 | 1241 | | score \ |
2376c370 JM |
1242 | | sh | shl \ |
1243 | | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ | |
d63f2be2 RO |
1244 | | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ |
1245 | | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ | |
1246 | | sparclite \ | |
1247 | | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ | |
1248 | | spu \ | |
1249 | | tahoe \ | |
5f8c2a15 | 1250 | | thumbv7* \ |
d63f2be2 RO |
1251 | | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ |
1252 | | tron \ | |
1253 | | ubicom32 \ | |
2376c370 | 1254 | | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ |
d63f2be2 RO |
1255 | | vax \ |
1256 | | visium \ | |
2376c370 JM |
1257 | | w65 \ |
1258 | | wasm32 | wasm64 \ | |
d63f2be2 RO |
1259 | | we32k \ |
1260 | | x86 | x86_64 | xc16x | xgate | xps100 \ | |
1261 | | xstormy16 | xtensa* \ | |
1262 | | ymp \ | |
1263 | | z8k | z80) | |
1264 | ;; | |
1265 | ||
1266 | *) | |
996ff3e8 | 1267 | echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 |
d63f2be2 RO |
1268 | exit 1 |
1269 | ;; | |
1270 | esac | |
252b5132 RH |
1271 | ;; |
1272 | esac | |
1273 | ||
1274 | # Here we canonicalize certain aliases for manufacturers. | |
d63f2be2 RO |
1275 | case $vendor in |
1276 | digital*) | |
1277 | vendor=dec | |
252b5132 | 1278 | ;; |
d63f2be2 RO |
1279 | commodore*) |
1280 | vendor=cbm | |
252b5132 RH |
1281 | ;; |
1282 | *) | |
1283 | ;; | |
1284 | esac | |
1285 | ||
1286 | # Decode manufacturer-specific aliases for certain operating systems. | |
1287 | ||
ce3abd47 | 1288 | if test x"$basic_os" != x |
252b5132 | 1289 | then |
5f8c2a15 | 1290 | |
6c037fdb | 1291 | # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just |
5f8c2a15 | 1292 | # set os. |
ce3abd47 | 1293 | obj= |
5f8c2a15 AM |
1294 | case $basic_os in |
1295 | gnu/linux*) | |
1296 | kernel=linux | |
6c037fdb | 1297 | os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` |
5f8c2a15 AM |
1298 | ;; |
1299 | os2-emx) | |
1300 | kernel=os2 | |
6c037fdb | 1301 | os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` |
5f8c2a15 AM |
1302 | ;; |
1303 | nto-qnx*) | |
1304 | kernel=nto | |
6c037fdb | 1305 | os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` |
5f8c2a15 AM |
1306 | ;; |
1307 | *-*) | |
1308 | # shellcheck disable=SC2162 | |
6c037fdb | 1309 | saved_IFS=$IFS |
5f8c2a15 AM |
1310 | IFS="-" read kernel os <<EOF |
1311 | $basic_os | |
1312 | EOF | |
6c037fdb | 1313 | IFS=$saved_IFS |
5f8c2a15 AM |
1314 | ;; |
1315 | # Default OS when just kernel was specified | |
1316 | nto*) | |
1317 | kernel=nto | |
6c037fdb | 1318 | os=`echo "$basic_os" | sed -e 's|nto|qnx|'` |
5f8c2a15 AM |
1319 | ;; |
1320 | linux*) | |
1321 | kernel=linux | |
6c037fdb | 1322 | os=`echo "$basic_os" | sed -e 's|linux|gnu|'` |
5f8c2a15 | 1323 | ;; |
996ff3e8 NC |
1324 | managarm*) |
1325 | kernel=managarm | |
1326 | os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'` | |
1327 | ;; | |
5f8c2a15 AM |
1328 | *) |
1329 | kernel= | |
1330 | os=$basic_os | |
1331 | ;; | |
1332 | esac | |
1333 | ||
1334 | # Now, normalize the OS (knowing we just have one component, it's not a kernel, | |
1335 | # etc.) | |
252b5132 | 1336 | case $os in |
bf41f30d NC |
1337 | # First match some system type aliases that might get confused |
1338 | # with valid system types. | |
c5244148 SH |
1339 | # solaris* is a basic system type, with this one exception. |
1340 | auroraux) | |
1341 | os=auroraux | |
1342 | ;; | |
1343 | bluegene*) | |
1344 | os=cnk | |
06ca7962 | 1345 | ;; |
c5244148 | 1346 | solaris1 | solaris1.*) |
6c037fdb | 1347 | os=`echo "$os" | sed -e 's|solaris1|sunos4|'` |
252b5132 | 1348 | ;; |
c5244148 SH |
1349 | solaris) |
1350 | os=solaris2 | |
252b5132 | 1351 | ;; |
c5244148 SH |
1352 | unixware*) |
1353 | os=sysv4.2uw | |
252b5132 | 1354 | ;; |
b5778783 | 1355 | # es1800 is here to avoid being matched by es* (a different OS) |
c5244148 SH |
1356 | es1800*) |
1357 | os=ose | |
1358 | ;; | |
1359 | # Some version numbers need modification | |
1360 | chorusos*) | |
1361 | os=chorusos | |
1362 | ;; | |
1363 | isc) | |
1364 | os=isc2.2 | |
1365 | ;; | |
1366 | sco6) | |
1367 | os=sco5v6 | |
1368 | ;; | |
1369 | sco5) | |
1370 | os=sco3.2v5 | |
1371 | ;; | |
1372 | sco4) | |
1373 | os=sco3.2v4 | |
1374 | ;; | |
1375 | sco3.2.[4-9]*) | |
6c037fdb | 1376 | os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'` |
c5244148 | 1377 | ;; |
5f8c2a15 | 1378 | sco*v* | scout) |
c5244148 SH |
1379 | # Don't match below |
1380 | ;; | |
1381 | sco*) | |
1382 | os=sco3.2v2 | |
1383 | ;; | |
1384 | psos*) | |
1385 | os=psos | |
b5778783 | 1386 | ;; |
c5244148 | 1387 | qnx*) |
5f8c2a15 | 1388 | os=qnx |
ac73857d | 1389 | ;; |
c5244148 SH |
1390 | hiux*) |
1391 | os=hiuxwe2 | |
3f234ef5 | 1392 | ;; |
c5244148 SH |
1393 | lynx*178) |
1394 | os=lynxos178 | |
1395 | ;; | |
1396 | lynx*5) | |
1397 | os=lynxos5 | |
1398 | ;; | |
5f8c2a15 AM |
1399 | lynxos*) |
1400 | # don't get caught up in next wildcard | |
1401 | ;; | |
c5244148 SH |
1402 | lynx*) |
1403 | os=lynxos | |
252b5132 | 1404 | ;; |
5f8c2a15 | 1405 | mac[0-9]*) |
6c037fdb | 1406 | os=`echo "$os" | sed -e 's|mac|macos|'` |
252b5132 | 1407 | ;; |
c5244148 SH |
1408 | opened*) |
1409 | os=openedition | |
1e600082 | 1410 | ;; |
c5244148 SH |
1411 | os400*) |
1412 | os=os400 | |
252b5132 | 1413 | ;; |
c5244148 | 1414 | sunos5*) |
6c037fdb | 1415 | os=`echo "$os" | sed -e 's|sunos5|solaris2|'` |
252b5132 | 1416 | ;; |
c5244148 | 1417 | sunos6*) |
6c037fdb | 1418 | os=`echo "$os" | sed -e 's|sunos6|solaris3|'` |
252b5132 | 1419 | ;; |
c5244148 SH |
1420 | wince*) |
1421 | os=wince | |
4bab746c | 1422 | ;; |
c5244148 SH |
1423 | utek*) |
1424 | os=bsd | |
252b5132 | 1425 | ;; |
c5244148 SH |
1426 | dynix*) |
1427 | os=bsd | |
252b5132 | 1428 | ;; |
c5244148 SH |
1429 | acis*) |
1430 | os=aos | |
252b5132 | 1431 | ;; |
c5244148 SH |
1432 | atheos*) |
1433 | os=atheos | |
26ef82f4 | 1434 | ;; |
c5244148 SH |
1435 | syllable*) |
1436 | os=syllable | |
1e600082 | 1437 | ;; |
c5244148 SH |
1438 | 386bsd) |
1439 | os=bsd | |
252b5132 | 1440 | ;; |
c5244148 SH |
1441 | ctix* | uts*) |
1442 | os=sysv | |
252b5132 | 1443 | ;; |
c5244148 SH |
1444 | nova*) |
1445 | os=rtmk-nova | |
39121370 | 1446 | ;; |
c5244148 SH |
1447 | ns2) |
1448 | os=nextstep2 | |
252b5132 RH |
1449 | ;; |
1450 | # Preserve the version number of sinix5. | |
c5244148 | 1451 | sinix5.*) |
6c037fdb | 1452 | os=`echo "$os" | sed -e 's|sinix|sysv|'` |
252b5132 | 1453 | ;; |
c5244148 SH |
1454 | sinix*) |
1455 | os=sysv4 | |
252b5132 | 1456 | ;; |
c5244148 SH |
1457 | tpf*) |
1458 | os=tpf | |
1e600082 | 1459 | ;; |
c5244148 SH |
1460 | triton*) |
1461 | os=sysv3 | |
252b5132 | 1462 | ;; |
c5244148 SH |
1463 | oss*) |
1464 | os=sysv3 | |
252b5132 | 1465 | ;; |
c5244148 SH |
1466 | svr4*) |
1467 | os=sysv4 | |
252b5132 | 1468 | ;; |
c5244148 SH |
1469 | svr3) |
1470 | os=sysv3 | |
252b5132 | 1471 | ;; |
c5244148 SH |
1472 | sysvr4) |
1473 | os=sysv4 | |
252b5132 | 1474 | ;; |
c5244148 SH |
1475 | ose*) |
1476 | os=ose | |
252b5132 | 1477 | ;; |
c5244148 SH |
1478 | *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) |
1479 | os=mint | |
6c3175b0 | 1480 | ;; |
c5244148 SH |
1481 | dicos*) |
1482 | os=dicos | |
e2208220 | 1483 | ;; |
c5244148 | 1484 | pikeos*) |
bf41f30d NC |
1485 | # Until real need of OS specific support for |
1486 | # particular features comes up, bare metal | |
1487 | # configurations are quite functional. | |
d63f2be2 | 1488 | case $cpu in |
bf41f30d | 1489 | arm*) |
c5244148 | 1490 | os=eabi |
bf41f30d NC |
1491 | ;; |
1492 | *) | |
ce3abd47 NC |
1493 | os= |
1494 | obj=elf | |
bf41f30d NC |
1495 | ;; |
1496 | esac | |
1497 | ;; | |
ce3abd47 NC |
1498 | aout* | coff* | elf* | pe*) |
1499 | # These are machine code file formats, not OSes | |
1500 | obj=$os | |
1501 | os= | |
1502 | ;; | |
252b5132 | 1503 | *) |
5f8c2a15 | 1504 | # No normalization, but not necessarily accepted, that comes below. |
252b5132 RH |
1505 | ;; |
1506 | esac | |
5f8c2a15 | 1507 | |
252b5132 RH |
1508 | else |
1509 | ||
1510 | # Here we handle the default operating systems that come with various machines. | |
1511 | # The value should be what the vendor currently ships out the door with their | |
1512 | # machine or put another way, the most popular os provided with the machine. | |
1513 | ||
1514 | # Note that if you're going to try to match "-MANUFACTURER" here (say, | |
1515 | # "-sun"), then you have to tell the case statement up towards the top | |
1516 | # that MANUFACTURER isn't an operating system. Otherwise, code above | |
1517 | # will signal an error saying that MANUFACTURER isn't an operating | |
1518 | # system, and we'll never get to this point. | |
1519 | ||
5f8c2a15 | 1520 | kernel= |
ce3abd47 | 1521 | obj= |
d63f2be2 | 1522 | case $cpu-$vendor in |
5548b4ce | 1523 | score-*) |
ce3abd47 NC |
1524 | os= |
1525 | obj=elf | |
17bcf627 | 1526 | ;; |
5548b4ce | 1527 | spu-*) |
ce3abd47 NC |
1528 | os= |
1529 | obj=elf | |
ea3d1626 | 1530 | ;; |
252b5132 | 1531 | *-acorn) |
c5244148 | 1532 | os=riscix1.2 |
252b5132 | 1533 | ;; |
ada59422 | 1534 | arm*-rebel) |
5f8c2a15 AM |
1535 | kernel=linux |
1536 | os=gnu | |
252b5132 RH |
1537 | ;; |
1538 | arm*-semi) | |
ce3abd47 NC |
1539 | os= |
1540 | obj=aout | |
252b5132 | 1541 | ;; |
5548b4ce | 1542 | c4x-* | tic4x-*) |
ce3abd47 NC |
1543 | os= |
1544 | obj=coff | |
ea3d1626 | 1545 | ;; |
f3f51a69 | 1546 | c8051-*) |
ce3abd47 NC |
1547 | os= |
1548 | obj=elf | |
c5244148 SH |
1549 | ;; |
1550 | clipper-intergraph) | |
1551 | os=clix | |
f3f51a69 | 1552 | ;; |
7b0e8ca5 | 1553 | hexagon-*) |
ce3abd47 NC |
1554 | os= |
1555 | obj=elf | |
7b0e8ca5 | 1556 | ;; |
c35a0556 | 1557 | tic54x-*) |
ce3abd47 NC |
1558 | os= |
1559 | obj=coff | |
c35a0556 JM |
1560 | ;; |
1561 | tic55x-*) | |
ce3abd47 NC |
1562 | os= |
1563 | obj=coff | |
c35a0556 JM |
1564 | ;; |
1565 | tic6x-*) | |
ce3abd47 NC |
1566 | os= |
1567 | obj=coff | |
c35a0556 | 1568 | ;; |
0e254642 | 1569 | # This must come before the *-dec entry. |
9dec4c71 | 1570 | pdp10-*) |
c5244148 | 1571 | os=tops20 |
9dec4c71 | 1572 | ;; |
fd31a171 | 1573 | pdp11-*) |
c5244148 | 1574 | os=none |
252b5132 RH |
1575 | ;; |
1576 | *-dec | vax-*) | |
c5244148 | 1577 | os=ultrix4.2 |
252b5132 RH |
1578 | ;; |
1579 | m68*-apollo) | |
c5244148 | 1580 | os=domain |
252b5132 RH |
1581 | ;; |
1582 | i386-sun) | |
c5244148 | 1583 | os=sunos4.0.2 |
252b5132 RH |
1584 | ;; |
1585 | m68000-sun) | |
c5244148 | 1586 | os=sunos3 |
252b5132 | 1587 | ;; |
6c3175b0 | 1588 | m68*-cisco) |
ce3abd47 NC |
1589 | os= |
1590 | obj=aout | |
252b5132 | 1591 | ;; |
5548b4ce | 1592 | mep-*) |
ce3abd47 NC |
1593 | os= |
1594 | obj=elf | |
98a1bbc5 | 1595 | ;; |
6c3175b0 | 1596 | mips*-cisco) |
ce3abd47 NC |
1597 | os= |
1598 | obj=elf | |
6c3175b0 NC |
1599 | ;; |
1600 | mips*-*) | |
ce3abd47 NC |
1601 | os= |
1602 | obj=elf | |
252b5132 | 1603 | ;; |
f6e1c110 | 1604 | or32-*) |
ce3abd47 NC |
1605 | os= |
1606 | obj=coff | |
f6e1c110 | 1607 | ;; |
252b5132 | 1608 | *-tti) # must be before sparc entry or we get the wrong os. |
c5244148 | 1609 | os=sysv3 |
252b5132 RH |
1610 | ;; |
1611 | sparc-* | *-sun) | |
c5244148 | 1612 | os=sunos4.1.1 |
252b5132 | 1613 | ;; |
3f66c01b | 1614 | pru-*) |
ce3abd47 NC |
1615 | os= |
1616 | obj=elf | |
3f66c01b | 1617 | ;; |
252b5132 | 1618 | *-be) |
c5244148 | 1619 | os=beos |
252b5132 RH |
1620 | ;; |
1621 | *-ibm) | |
c5244148 | 1622 | os=aix |
252b5132 | 1623 | ;; |
5548b4ce | 1624 | *-knuth) |
c5244148 | 1625 | os=mmixware |
eb1352ed | 1626 | ;; |
6c3175b0 | 1627 | *-wec) |
c5244148 | 1628 | os=proelf |
252b5132 | 1629 | ;; |
6c3175b0 | 1630 | *-winbond) |
c5244148 | 1631 | os=proelf |
252b5132 | 1632 | ;; |
6c3175b0 | 1633 | *-oki) |
c5244148 | 1634 | os=proelf |
252b5132 RH |
1635 | ;; |
1636 | *-hp) | |
c5244148 | 1637 | os=hpux |
252b5132 RH |
1638 | ;; |
1639 | *-hitachi) | |
c5244148 | 1640 | os=hiux |
252b5132 RH |
1641 | ;; |
1642 | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) | |
c5244148 | 1643 | os=sysv |
252b5132 RH |
1644 | ;; |
1645 | *-cbm) | |
c5244148 | 1646 | os=amigaos |
252b5132 RH |
1647 | ;; |
1648 | *-dg) | |
c5244148 | 1649 | os=dgux |
252b5132 RH |
1650 | ;; |
1651 | *-dolphin) | |
c5244148 | 1652 | os=sysv3 |
252b5132 RH |
1653 | ;; |
1654 | m68k-ccur) | |
c5244148 | 1655 | os=rtu |
252b5132 RH |
1656 | ;; |
1657 | m88k-omron*) | |
c5244148 | 1658 | os=luna |
252b5132 | 1659 | ;; |
bf41f30d | 1660 | *-next) |
c5244148 | 1661 | os=nextstep |
252b5132 RH |
1662 | ;; |
1663 | *-sequent) | |
c5244148 | 1664 | os=ptx |
252b5132 RH |
1665 | ;; |
1666 | *-crds) | |
c5244148 | 1667 | os=unos |
252b5132 RH |
1668 | ;; |
1669 | *-ns) | |
c5244148 | 1670 | os=genix |
252b5132 RH |
1671 | ;; |
1672 | i370-*) | |
c5244148 | 1673 | os=mvs |
252b5132 | 1674 | ;; |
fd31a171 | 1675 | *-gould) |
c5244148 | 1676 | os=sysv |
252b5132 | 1677 | ;; |
fd31a171 | 1678 | *-highlevel) |
c5244148 | 1679 | os=bsd |
252b5132 RH |
1680 | ;; |
1681 | *-encore) | |
c5244148 | 1682 | os=bsd |
252b5132 | 1683 | ;; |
fd31a171 | 1684 | *-sgi) |
c5244148 | 1685 | os=irix |
252b5132 | 1686 | ;; |
fd31a171 | 1687 | *-siemens) |
c5244148 | 1688 | os=sysv4 |
252b5132 RH |
1689 | ;; |
1690 | *-masscomp) | |
c5244148 | 1691 | os=rtu |
252b5132 | 1692 | ;; |
35590697 | 1693 | f30[01]-fujitsu | f700-fujitsu) |
c5244148 | 1694 | os=uxpv |
252b5132 | 1695 | ;; |
6c3175b0 | 1696 | *-rom68k) |
ce3abd47 NC |
1697 | os= |
1698 | obj=coff | |
252b5132 | 1699 | ;; |
6c3175b0 | 1700 | *-*bug) |
ce3abd47 NC |
1701 | os= |
1702 | obj=coff | |
252b5132 | 1703 | ;; |
6c3175b0 | 1704 | *-apple) |
c5244148 | 1705 | os=macos |
252b5132 | 1706 | ;; |
6c3175b0 | 1707 | *-atari*) |
c5244148 SH |
1708 | os=mint |
1709 | ;; | |
1710 | *-wrs) | |
1711 | os=vxworks | |
6c3175b0 | 1712 | ;; |
252b5132 | 1713 | *) |
c5244148 | 1714 | os=none |
252b5132 RH |
1715 | ;; |
1716 | esac | |
5f8c2a15 | 1717 | |
252b5132 RH |
1718 | fi |
1719 | ||
ce3abd47 NC |
1720 | # Now, validate our (potentially fixed-up) individual pieces (OS, OBJ). |
1721 | ||
5f8c2a15 | 1722 | case $os in |
2e8adb64 | 1723 | # Sometimes we do "kernel-libc", so those need to count as OSes. |
6c037fdb | 1724 | musl* | newlib* | relibc* | uclibc*) |
5f8c2a15 | 1725 | ;; |
2e8adb64 | 1726 | # Likewise for "kernel-abi" |
16062162 | 1727 | eabi* | gnueabi*) |
5f8c2a15 | 1728 | ;; |
2e8adb64 MR |
1729 | # VxWorks passes extra cpu info in the 4th filed. |
1730 | simlinux | simwindows | spe) | |
1731 | ;; | |
ce3abd47 NC |
1732 | # See `case $cpu-$os` validation below |
1733 | ghcjs) | |
1734 | ;; | |
5f8c2a15 AM |
1735 | # Now accept the basic system types. |
1736 | # The portable systems comes first. | |
1737 | # Each alternative MUST end in a * to match a version number. | |
1738 | gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ | |
1739 | | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ | |
1740 | | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ | |
1741 | | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ | |
1742 | | hiux* | abug | nacl* | netware* | windows* \ | |
ce3abd47 | 1743 | | os9* | macos* | osx* | ios* | tvos* | watchos* \ |
5f8c2a15 AM |
1744 | | mpw* | magic* | mmixware* | mon960* | lnews* \ |
1745 | | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ | |
1746 | | aos* | aros* | cloudabi* | sortix* | twizzler* \ | |
1747 | | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ | |
1748 | | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ | |
1749 | | mirbsd* | netbsd* | dicos* | openedition* | ose* \ | |
2e8adb64 | 1750 | | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ |
5f8c2a15 | 1751 | | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ |
ce3abd47 NC |
1752 | | bosx* | nextstep* | cxux* | oabi* \ |
1753 | | ptx* | ecoff* | winnt* | domain* | vsta* \ | |
5f8c2a15 | 1754 | | udi* | lites* | ieee* | go32* | aux* | hcos* \ |
2e8adb64 | 1755 | | chorusrdb* | cegcc* | glidix* | serenity* \ |
ce3abd47 | 1756 | | cygwin* | msys* | moss* | proelf* | rtems* \ |
5f8c2a15 AM |
1757 | | midipix* | mingw32* | mingw64* | mint* \ |
1758 | | uxpv* | beos* | mpeix* | udk* | moxiebox* \ | |
1759 | | interix* | uwin* | mks* | rhapsody* | darwin* \ | |
1760 | | openstep* | oskit* | conix* | pw32* | nonstopux* \ | |
1761 | | storm-chaos* | tops10* | tenex* | tops20* | its* \ | |
1762 | | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ | |
1763 | | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ | |
1764 | | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ | |
1765 | | skyos* | haiku* | rdos* | toppers* | drops* | es* \ | |
1766 | | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ | |
1767 | | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ | |
6c037fdb | 1768 | | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ |
6e712424 | 1769 | | fiwix* | mlibc* | cos* | mbr* ) |
5f8c2a15 AM |
1770 | ;; |
1771 | # This one is extra strict with allowed versions | |
1772 | sco3.2v2 | sco3.2v[4-9]* | sco5v6*) | |
1773 | # Don't forget version if it is 3.2v4 or newer. | |
1774 | ;; | |
1775 | none) | |
1776 | ;; | |
6e712424 | 1777 | kernel* | msvc* ) |
996ff3e8 NC |
1778 | # Restricted further below |
1779 | ;; | |
ce3abd47 NC |
1780 | '') |
1781 | if test x"$obj" = x | |
1782 | then | |
1783 | echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2 | |
1784 | fi | |
1785 | ;; | |
5f8c2a15 | 1786 | *) |
996ff3e8 | 1787 | echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 |
5f8c2a15 AM |
1788 | exit 1 |
1789 | ;; | |
1790 | esac | |
1791 | ||
ce3abd47 NC |
1792 | case $obj in |
1793 | aout* | coff* | elf* | pe*) | |
1794 | ;; | |
1795 | '') | |
1796 | # empty is fine | |
1797 | ;; | |
1798 | *) | |
1799 | echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 | |
1800 | exit 1 | |
1801 | ;; | |
1802 | esac | |
1803 | ||
1804 | # Here we handle the constraint that a (synthetic) cpu and os are | |
1805 | # valid only in combination with each other and nowhere else. | |
1806 | case $cpu-$os in | |
1807 | # The "javascript-unknown-ghcjs" triple is used by GHC; we | |
1808 | # accept it here in order to tolerate that, but reject any | |
1809 | # variations. | |
1810 | javascript-ghcjs) | |
1811 | ;; | |
1812 | javascript-* | *-ghcjs) | |
1813 | echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 | |
1814 | exit 1 | |
1815 | ;; | |
1816 | esac | |
1817 | ||
5f8c2a15 AM |
1818 | # As a final step for OS-related things, validate the OS-kernel combination |
1819 | # (given a valid OS), if there is a kernel. | |
ce3abd47 NC |
1820 | case $kernel-$os-$obj in |
1821 | linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \ | |
1822 | | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- ) | |
5f8c2a15 | 1823 | ;; |
ce3abd47 | 1824 | uclinux-uclibc*- ) |
5f8c2a15 | 1825 | ;; |
ce3abd47 | 1826 | managarm-mlibc*- | managarm-kernel*- ) |
996ff3e8 | 1827 | ;; |
ce3abd47 | 1828 | windows*-msvc*-) |
6e712424 | 1829 | ;; |
ce3abd47 | 1830 | -dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- ) |
5f8c2a15 AM |
1831 | # These are just libc implementations, not actual OSes, and thus |
1832 | # require a kernel. | |
996ff3e8 NC |
1833 | echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 |
1834 | exit 1 | |
1835 | ;; | |
ce3abd47 | 1836 | -kernel*- ) |
996ff3e8 NC |
1837 | echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 |
1838 | exit 1 | |
1839 | ;; | |
ce3abd47 | 1840 | *-kernel*- ) |
996ff3e8 | 1841 | echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 |
5f8c2a15 AM |
1842 | exit 1 |
1843 | ;; | |
ce3abd47 | 1844 | *-msvc*- ) |
6e712424 PI |
1845 | echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 |
1846 | exit 1 | |
1847 | ;; | |
ce3abd47 | 1848 | kfreebsd*-gnu*- | kopensolaris*-gnu*-) |
5f8c2a15 | 1849 | ;; |
ce3abd47 | 1850 | vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) |
2e8adb64 | 1851 | ;; |
ce3abd47 | 1852 | nto-qnx*-) |
5f8c2a15 | 1853 | ;; |
ce3abd47 NC |
1854 | os2-emx-) |
1855 | ;; | |
1856 | *-eabi*- | *-gnueabi*-) | |
5f8c2a15 | 1857 | ;; |
ce3abd47 NC |
1858 | none--*) |
1859 | # None (no kernel, i.e. freestanding / bare metal), | |
1860 | # can be paired with an machine code file format | |
5f8c2a15 | 1861 | ;; |
ce3abd47 | 1862 | -*-) |
5f8c2a15 AM |
1863 | # Blank kernel with real OS is always fine. |
1864 | ;; | |
ce3abd47 NC |
1865 | --*) |
1866 | # Blank kernel and OS with real machine code file format is always fine. | |
1867 | ;; | |
1868 | *-*-*) | |
996ff3e8 | 1869 | echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 |
5f8c2a15 AM |
1870 | exit 1 |
1871 | ;; | |
1872 | esac | |
1873 | ||
252b5132 RH |
1874 | # Here we handle the case where we know the os, and the CPU type, but not the |
1875 | # manufacturer. We pick the logical manufacturer. | |
d63f2be2 RO |
1876 | case $vendor in |
1877 | unknown) | |
5f8c2a15 AM |
1878 | case $cpu-$os in |
1879 | *-riscix*) | |
252b5132 RH |
1880 | vendor=acorn |
1881 | ;; | |
5f8c2a15 | 1882 | *-sunos*) |
252b5132 RH |
1883 | vendor=sun |
1884 | ;; | |
5f8c2a15 | 1885 | *-cnk* | *-aix*) |
252b5132 RH |
1886 | vendor=ibm |
1887 | ;; | |
5f8c2a15 | 1888 | *-beos*) |
252b5132 RH |
1889 | vendor=be |
1890 | ;; | |
5f8c2a15 | 1891 | *-hpux*) |
252b5132 RH |
1892 | vendor=hp |
1893 | ;; | |
5f8c2a15 | 1894 | *-mpeix*) |
252b5132 RH |
1895 | vendor=hp |
1896 | ;; | |
5f8c2a15 | 1897 | *-hiux*) |
252b5132 RH |
1898 | vendor=hitachi |
1899 | ;; | |
5f8c2a15 | 1900 | *-unos*) |
252b5132 RH |
1901 | vendor=crds |
1902 | ;; | |
5f8c2a15 | 1903 | *-dgux*) |
252b5132 RH |
1904 | vendor=dg |
1905 | ;; | |
5f8c2a15 | 1906 | *-luna*) |
252b5132 RH |
1907 | vendor=omron |
1908 | ;; | |
5f8c2a15 | 1909 | *-genix*) |
252b5132 RH |
1910 | vendor=ns |
1911 | ;; | |
5f8c2a15 | 1912 | *-clix*) |
c5244148 SH |
1913 | vendor=intergraph |
1914 | ;; | |
5f8c2a15 AM |
1915 | *-mvs* | *-opened*) |
1916 | vendor=ibm | |
1917 | ;; | |
1918 | *-os400*) | |
252b5132 RH |
1919 | vendor=ibm |
1920 | ;; | |
5f8c2a15 | 1921 | s390-* | s390x-*) |
1e600082 AC |
1922 | vendor=ibm |
1923 | ;; | |
5f8c2a15 | 1924 | *-ptx*) |
252b5132 RH |
1925 | vendor=sequent |
1926 | ;; | |
5f8c2a15 | 1927 | *-tpf*) |
1e600082 AC |
1928 | vendor=ibm |
1929 | ;; | |
5f8c2a15 | 1930 | *-vxsim* | *-vxworks* | *-windiss*) |
252b5132 RH |
1931 | vendor=wrs |
1932 | ;; | |
5f8c2a15 | 1933 | *-aux*) |
252b5132 RH |
1934 | vendor=apple |
1935 | ;; | |
5f8c2a15 | 1936 | *-hms*) |
252b5132 RH |
1937 | vendor=hitachi |
1938 | ;; | |
5f8c2a15 | 1939 | *-mpw* | *-macos*) |
252b5132 RH |
1940 | vendor=apple |
1941 | ;; | |
5f8c2a15 | 1942 | *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) |
6c3175b0 NC |
1943 | vendor=atari |
1944 | ;; | |
5f8c2a15 | 1945 | *-vos*) |
82208dc5 AM |
1946 | vendor=stratus |
1947 | ;; | |
252b5132 | 1948 | esac |
252b5132 RH |
1949 | ;; |
1950 | esac | |
1951 | ||
ce3abd47 | 1952 | echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" |
1d9c9cd7 | 1953 | exit |
ac73857d AC |
1954 | |
1955 | # Local variables: | |
b5778783 | 1956 | # eval: (add-hook 'before-save-hook 'time-stamp) |
35590697 | 1957 | # time-stamp-start: "timestamp='" |
ac73857d AC |
1958 | # time-stamp-format: "%:y-%02m-%02d" |
1959 | # time-stamp-end: "'" | |
1960 | # End: |