config.sub 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849
  1. #! /bin/sh
  2. # Configuration validation subroutine script.
  3. # Copyright 1992-2020 Free Software Foundation, Inc.
  4. timestamp='2020-09-08'
  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/gitweb/?p=config.git;a=blob_plain;f=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. | kvx \
  1155. | k1om \
  1156. | le32 | le64 \
  1157. | lm32 \
  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. | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
  1215. | tron \
  1216. | ubicom32 \
  1217. | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
  1218. | vax \
  1219. | visium \
  1220. | w65 \
  1221. | wasm32 | wasm64 \
  1222. | we32k \
  1223. | x86 | x86_64 | xc16x | xgate | xps100 \
  1224. | xstormy16 | xtensa* \
  1225. | ymp \
  1226. | z8k | z80)
  1227. ;;
  1228. *)
  1229. echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
  1230. exit 1
  1231. ;;
  1232. esac
  1233. ;;
  1234. esac
  1235. # Here we canonicalize certain aliases for manufacturers.
  1236. case $vendor in
  1237. digital*)
  1238. vendor=dec
  1239. ;;
  1240. commodore*)
  1241. vendor=cbm
  1242. ;;
  1243. *)
  1244. ;;
  1245. esac
  1246. # Decode manufacturer-specific aliases for certain operating systems.
  1247. if test x$basic_os != x
  1248. then
  1249. # First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
  1250. # set os.
  1251. case $basic_os in
  1252. gnu/linux*)
  1253. kernel=linux
  1254. os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'`
  1255. ;;
  1256. nto-qnx*)
  1257. kernel=nto
  1258. os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'`
  1259. ;;
  1260. *-*)
  1261. # shellcheck disable=SC2162
  1262. IFS="-" read kernel os <<EOF
  1263. $basic_os
  1264. EOF
  1265. ;;
  1266. # Default OS when just kernel was specified
  1267. nto*)
  1268. kernel=nto
  1269. os=`echo $basic_os | sed -e 's|nto|qnx|'`
  1270. ;;
  1271. linux*)
  1272. kernel=linux
  1273. os=`echo $basic_os | sed -e 's|linux|gnu|'`
  1274. ;;
  1275. *)
  1276. kernel=
  1277. os=$basic_os
  1278. ;;
  1279. esac
  1280. # Now, normalize the OS (knowing we just have one component, it's not a kernel,
  1281. # etc.)
  1282. case $os in
  1283. # First match some system type aliases that might get confused
  1284. # with valid system types.
  1285. # solaris* is a basic system type, with this one exception.
  1286. auroraux)
  1287. os=auroraux
  1288. ;;
  1289. bluegene*)
  1290. os=cnk
  1291. ;;
  1292. solaris1 | solaris1.*)
  1293. os=`echo $os | sed -e 's|solaris1|sunos4|'`
  1294. ;;
  1295. solaris)
  1296. os=solaris2
  1297. ;;
  1298. unixware*)
  1299. os=sysv4.2uw
  1300. ;;
  1301. # es1800 is here to avoid being matched by es* (a different OS)
  1302. es1800*)
  1303. os=ose
  1304. ;;
  1305. # Some version numbers need modification
  1306. chorusos*)
  1307. os=chorusos
  1308. ;;
  1309. isc)
  1310. os=isc2.2
  1311. ;;
  1312. sco6)
  1313. os=sco5v6
  1314. ;;
  1315. sco5)
  1316. os=sco3.2v5
  1317. ;;
  1318. sco4)
  1319. os=sco3.2v4
  1320. ;;
  1321. sco3.2.[4-9]*)
  1322. os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  1323. ;;
  1324. sco*v* | scout)
  1325. # Don't match below
  1326. ;;
  1327. sco*)
  1328. os=sco3.2v2
  1329. ;;
  1330. psos*)
  1331. os=psos
  1332. ;;
  1333. qnx*)
  1334. os=qnx
  1335. ;;
  1336. hiux*)
  1337. os=hiuxwe2
  1338. ;;
  1339. lynx*178)
  1340. os=lynxos178
  1341. ;;
  1342. lynx*5)
  1343. os=lynxos5
  1344. ;;
  1345. lynxos*)
  1346. # don't get caught up in next wildcard
  1347. ;;
  1348. lynx*)
  1349. os=lynxos
  1350. ;;
  1351. mac[0-9]*)
  1352. os=`echo "$os" | sed -e 's|mac|macos|'`
  1353. ;;
  1354. opened*)
  1355. os=openedition
  1356. ;;
  1357. os400*)
  1358. os=os400
  1359. ;;
  1360. sunos5*)
  1361. os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
  1362. ;;
  1363. sunos6*)
  1364. os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
  1365. ;;
  1366. wince*)
  1367. os=wince
  1368. ;;
  1369. utek*)
  1370. os=bsd
  1371. ;;
  1372. dynix*)
  1373. os=bsd
  1374. ;;
  1375. acis*)
  1376. os=aos
  1377. ;;
  1378. atheos*)
  1379. os=atheos
  1380. ;;
  1381. syllable*)
  1382. os=syllable
  1383. ;;
  1384. 386bsd)
  1385. os=bsd
  1386. ;;
  1387. ctix* | uts*)
  1388. os=sysv
  1389. ;;
  1390. nova*)
  1391. os=rtmk-nova
  1392. ;;
  1393. ns2)
  1394. os=nextstep2
  1395. ;;
  1396. # Preserve the version number of sinix5.
  1397. sinix5.*)
  1398. os=`echo $os | sed -e 's|sinix|sysv|'`
  1399. ;;
  1400. sinix*)
  1401. os=sysv4
  1402. ;;
  1403. tpf*)
  1404. os=tpf
  1405. ;;
  1406. triton*)
  1407. os=sysv3
  1408. ;;
  1409. oss*)
  1410. os=sysv3
  1411. ;;
  1412. svr4*)
  1413. os=sysv4
  1414. ;;
  1415. svr3)
  1416. os=sysv3
  1417. ;;
  1418. sysvr4)
  1419. os=sysv4
  1420. ;;
  1421. ose*)
  1422. os=ose
  1423. ;;
  1424. *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
  1425. os=mint
  1426. ;;
  1427. dicos*)
  1428. os=dicos
  1429. ;;
  1430. pikeos*)
  1431. # Until real need of OS specific support for
  1432. # particular features comes up, bare metal
  1433. # configurations are quite functional.
  1434. case $cpu in
  1435. arm*)
  1436. os=eabi
  1437. ;;
  1438. *)
  1439. os=elf
  1440. ;;
  1441. esac
  1442. ;;
  1443. *)
  1444. # No normalization, but not necessarily accepted, that comes below.
  1445. ;;
  1446. esac
  1447. else
  1448. # Here we handle the default operating systems that come with various machines.
  1449. # The value should be what the vendor currently ships out the door with their
  1450. # machine or put another way, the most popular os provided with the machine.
  1451. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1452. # "-sun"), then you have to tell the case statement up towards the top
  1453. # that MANUFACTURER isn't an operating system. Otherwise, code above
  1454. # will signal an error saying that MANUFACTURER isn't an operating
  1455. # system, and we'll never get to this point.
  1456. kernel=
  1457. case $cpu-$vendor in
  1458. score-*)
  1459. os=elf
  1460. ;;
  1461. spu-*)
  1462. os=elf
  1463. ;;
  1464. *-acorn)
  1465. os=riscix1.2
  1466. ;;
  1467. arm*-rebel)
  1468. kernel=linux
  1469. os=gnu
  1470. ;;
  1471. arm*-semi)
  1472. os=aout
  1473. ;;
  1474. c4x-* | tic4x-*)
  1475. os=coff
  1476. ;;
  1477. c8051-*)
  1478. os=elf
  1479. ;;
  1480. clipper-intergraph)
  1481. os=clix
  1482. ;;
  1483. hexagon-*)
  1484. os=elf
  1485. ;;
  1486. tic54x-*)
  1487. os=coff
  1488. ;;
  1489. tic55x-*)
  1490. os=coff
  1491. ;;
  1492. tic6x-*)
  1493. os=coff
  1494. ;;
  1495. # This must come before the *-dec entry.
  1496. pdp10-*)
  1497. os=tops20
  1498. ;;
  1499. pdp11-*)
  1500. os=none
  1501. ;;
  1502. *-dec | vax-*)
  1503. os=ultrix4.2
  1504. ;;
  1505. m68*-apollo)
  1506. os=domain
  1507. ;;
  1508. i386-sun)
  1509. os=sunos4.0.2
  1510. ;;
  1511. m68000-sun)
  1512. os=sunos3
  1513. ;;
  1514. m68*-cisco)
  1515. os=aout
  1516. ;;
  1517. mep-*)
  1518. os=elf
  1519. ;;
  1520. mips*-cisco)
  1521. os=elf
  1522. ;;
  1523. mips*-*)
  1524. os=elf
  1525. ;;
  1526. or32-*)
  1527. os=coff
  1528. ;;
  1529. *-tti) # must be before sparc entry or we get the wrong os.
  1530. os=sysv3
  1531. ;;
  1532. sparc-* | *-sun)
  1533. os=sunos4.1.1
  1534. ;;
  1535. pru-*)
  1536. os=elf
  1537. ;;
  1538. *-be)
  1539. os=beos
  1540. ;;
  1541. *-ibm)
  1542. os=aix
  1543. ;;
  1544. *-knuth)
  1545. os=mmixware
  1546. ;;
  1547. *-wec)
  1548. os=proelf
  1549. ;;
  1550. *-winbond)
  1551. os=proelf
  1552. ;;
  1553. *-oki)
  1554. os=proelf
  1555. ;;
  1556. *-hp)
  1557. os=hpux
  1558. ;;
  1559. *-hitachi)
  1560. os=hiux
  1561. ;;
  1562. i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1563. os=sysv
  1564. ;;
  1565. *-cbm)
  1566. os=amigaos
  1567. ;;
  1568. *-dg)
  1569. os=dgux
  1570. ;;
  1571. *-dolphin)
  1572. os=sysv3
  1573. ;;
  1574. m68k-ccur)
  1575. os=rtu
  1576. ;;
  1577. m88k-omron*)
  1578. os=luna
  1579. ;;
  1580. *-next)
  1581. os=nextstep
  1582. ;;
  1583. *-sequent)
  1584. os=ptx
  1585. ;;
  1586. *-crds)
  1587. os=unos
  1588. ;;
  1589. *-ns)
  1590. os=genix
  1591. ;;
  1592. i370-*)
  1593. os=mvs
  1594. ;;
  1595. *-gould)
  1596. os=sysv
  1597. ;;
  1598. *-highlevel)
  1599. os=bsd
  1600. ;;
  1601. *-encore)
  1602. os=bsd
  1603. ;;
  1604. *-sgi)
  1605. os=irix
  1606. ;;
  1607. *-siemens)
  1608. os=sysv4
  1609. ;;
  1610. *-masscomp)
  1611. os=rtu
  1612. ;;
  1613. f30[01]-fujitsu | f700-fujitsu)
  1614. os=uxpv
  1615. ;;
  1616. *-rom68k)
  1617. os=coff
  1618. ;;
  1619. *-*bug)
  1620. os=coff
  1621. ;;
  1622. *-apple)
  1623. os=macos
  1624. ;;
  1625. *-atari*)
  1626. os=mint
  1627. ;;
  1628. *-wrs)
  1629. os=vxworks
  1630. ;;
  1631. *)
  1632. os=none
  1633. ;;
  1634. esac
  1635. fi
  1636. # Now, validate our (potentially fixed-up) OS.
  1637. case $os in
  1638. # Sometimes we do "kernel-abi", so those need to count as OSes.
  1639. musl* | newlib* | uclibc*)
  1640. ;;
  1641. # Likewise for "kernel-libc"
  1642. eabi | eabihf | gnueabi | gnueabihf)
  1643. ;;
  1644. # Now accept the basic system types.
  1645. # The portable systems comes first.
  1646. # Each alternative MUST end in a * to match a version number.
  1647. gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
  1648. | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
  1649. | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
  1650. | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
  1651. | hiux* | abug | nacl* | netware* | windows* \
  1652. | os9* | macos* | osx* | ios* \
  1653. | mpw* | magic* | mmixware* | mon960* | lnews* \
  1654. | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
  1655. | aos* | aros* | cloudabi* | sortix* | twizzler* \
  1656. | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
  1657. | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
  1658. | mirbsd* | netbsd* | dicos* | openedition* | ose* \
  1659. | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
  1660. | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
  1661. | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
  1662. | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
  1663. | udi* | lites* | ieee* | go32* | aux* | hcos* \
  1664. | chorusrdb* | cegcc* | glidix* \
  1665. | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
  1666. | midipix* | mingw32* | mingw64* | mint* \
  1667. | uxpv* | beos* | mpeix* | udk* | moxiebox* \
  1668. | interix* | uwin* | mks* | rhapsody* | darwin* \
  1669. | openstep* | oskit* | conix* | pw32* | nonstopux* \
  1670. | storm-chaos* | tops10* | tenex* | tops20* | its* \
  1671. | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
  1672. | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
  1673. | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
  1674. | skyos* | haiku* | rdos* | toppers* | drops* | es* \
  1675. | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
  1676. | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
  1677. | nsk* | powerunix* | genode* | zvmoe* | qnx* )
  1678. ;;
  1679. # This one is extra strict with allowed versions
  1680. sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
  1681. # Don't forget version if it is 3.2v4 or newer.
  1682. ;;
  1683. none)
  1684. ;;
  1685. *)
  1686. echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
  1687. exit 1
  1688. ;;
  1689. esac
  1690. # As a final step for OS-related things, validate the OS-kernel combination
  1691. # (given a valid OS), if there is a kernel.
  1692. case $kernel-$os in
  1693. linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
  1694. ;;
  1695. uclinux-uclibc* )
  1696. ;;
  1697. -dietlibc* | -newlib* | -musl* | -uclibc* )
  1698. # These are just libc implementations, not actual OSes, and thus
  1699. # require a kernel.
  1700. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
  1701. exit 1
  1702. ;;
  1703. kfreebsd*-gnu* | kopensolaris*-gnu*)
  1704. ;;
  1705. nto-qnx*)
  1706. ;;
  1707. *-eabi* | *-gnueabi*)
  1708. ;;
  1709. -*)
  1710. # Blank kernel with real OS is always fine.
  1711. ;;
  1712. *-*)
  1713. echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
  1714. exit 1
  1715. ;;
  1716. esac
  1717. # Here we handle the case where we know the os, and the CPU type, but not the
  1718. # manufacturer. We pick the logical manufacturer.
  1719. case $vendor in
  1720. unknown)
  1721. case $cpu-$os in
  1722. *-riscix*)
  1723. vendor=acorn
  1724. ;;
  1725. *-sunos*)
  1726. vendor=sun
  1727. ;;
  1728. *-cnk* | *-aix*)
  1729. vendor=ibm
  1730. ;;
  1731. *-beos*)
  1732. vendor=be
  1733. ;;
  1734. *-hpux*)
  1735. vendor=hp
  1736. ;;
  1737. *-mpeix*)
  1738. vendor=hp
  1739. ;;
  1740. *-hiux*)
  1741. vendor=hitachi
  1742. ;;
  1743. *-unos*)
  1744. vendor=crds
  1745. ;;
  1746. *-dgux*)
  1747. vendor=dg
  1748. ;;
  1749. *-luna*)
  1750. vendor=omron
  1751. ;;
  1752. *-genix*)
  1753. vendor=ns
  1754. ;;
  1755. *-clix*)
  1756. vendor=intergraph
  1757. ;;
  1758. *-mvs* | *-opened*)
  1759. vendor=ibm
  1760. ;;
  1761. *-os400*)
  1762. vendor=ibm
  1763. ;;
  1764. s390-* | s390x-*)
  1765. vendor=ibm
  1766. ;;
  1767. *-ptx*)
  1768. vendor=sequent
  1769. ;;
  1770. *-tpf*)
  1771. vendor=ibm
  1772. ;;
  1773. *-vxsim* | *-vxworks* | *-windiss*)
  1774. vendor=wrs
  1775. ;;
  1776. *-aux*)
  1777. vendor=apple
  1778. ;;
  1779. *-hms*)
  1780. vendor=hitachi
  1781. ;;
  1782. *-mpw* | *-macos*)
  1783. vendor=apple
  1784. ;;
  1785. *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
  1786. vendor=atari
  1787. ;;
  1788. *-vos*)
  1789. vendor=stratus
  1790. ;;
  1791. esac
  1792. ;;
  1793. esac
  1794. echo "$cpu-$vendor-${kernel:+$kernel-}$os"
  1795. exit
  1796. # Local variables:
  1797. # eval: (add-hook 'before-save-hook 'time-stamp)
  1798. # time-stamp-start: "timestamp='"
  1799. # time-stamp-format: "%:y-%02m-%02d"
  1800. # time-stamp-end: "'"
  1801. # End: