config.sub 34 KB

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