config.sub 34 KB

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