config.sub 36 KB

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