config.sub 34 KB

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