config.sub 33 KB

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