config.sub 33 KB

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