config.sub 33 KB

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