config.sub 35 KB

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