config.sub 34 KB

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