config.sub 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960
  1. #! /bin/sh
  2. # Configuration validation subroutine script.
  3. # Copyright 1992-2023 Free Software Foundation, Inc.
  4. # shellcheck disable=SC2006,SC2268 # see below for rationale
  5. timestamp='2023-09-19'
  6. # This file is free software; you can redistribute it and/or modify it
  7. # under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation, either version 3 of the License, or
  9. # (at your option) any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. # General Public License for more details.
  15. #
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, see <https://www.gnu.org/licenses/>.
  18. #
  19. # As a special exception to the GNU General Public License, if you
  20. # distribute this file as part of a program that contains a
  21. # configuration script generated by Autoconf, you may include it under
  22. # the same distribution terms that you use for the rest of that
  23. # program. This Exception is an additional permission under section 7
  24. # of the GNU General Public License, version 3 ("GPLv3").
  25. # Please send patches to <config-patches@gnu.org>.
  26. #
  27. # Configuration subroutine to validate and canonicalize a configuration type.
  28. # Supply the specified configuration type as an argument.
  29. # If it is invalid, we print an error message on stderr and exit with code 1.
  30. # Otherwise, we print the canonical config type on stdout and succeed.
  31. # You can get the latest version of this script from:
  32. # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
  33. # This file is supposed to be the same for all GNU packages
  34. # and recognize all the CPU types, system types and aliases
  35. # that are meaningful with *any* GNU software.
  36. # Each package is responsible for reporting which valid configurations
  37. # it does not support. The user should be able to distinguish
  38. # a failure to support a valid configuration from a meaningless
  39. # configuration.
  40. # The goal of this file is to map all the various variations of a given
  41. # machine specification into a single specification in the form:
  42. # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  43. # or in some cases, the newer four-part form:
  44. # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
  45. # It is wrong to echo any other type of specification.
  46. # The "shellcheck disable" line above the timestamp inhibits complaints
  47. # about features and limitations of the classic Bourne shell that were
  48. # superseded or lifted in POSIX. However, this script identifies a wide
  49. # variety of pre-POSIX systems that do not have POSIX shells at all, and
  50. # even some reasonably current systems (Solaris 10 as case-in-point) still
  51. # have a pre-POSIX /bin/sh.
  52. me=`echo "$0" | sed -e 's,.*/,,'`
  53. usage="\
  54. Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
  55. Canonicalize a configuration name.
  56. Options:
  57. -h, --help print this help, then exit
  58. -t, --time-stamp print date of last modification, then exit
  59. -v, --version print version number, then exit
  60. Report bugs and patches to <config-patches@gnu.org>."
  61. version="\
  62. GNU config.sub ($timestamp)
  63. Copyright 1992-2023 Free Software Foundation, Inc.
  64. This is free software; see the source for copying conditions. There is NO
  65. warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
  66. help="
  67. Try '$me --help' for more information."
  68. # Parse command line
  69. while test $# -gt 0 ; do
  70. case $1 in
  71. --time-stamp | --time* | -t )
  72. echo "$timestamp" ; exit ;;
  73. --version | -v )
  74. echo "$version" ; exit ;;
  75. --help | --h* | -h )
  76. echo "$usage"; exit ;;
  77. -- ) # Stop option processing
  78. shift; break ;;
  79. - ) # Use stdin as input.
  80. break ;;
  81. -* )
  82. echo "$me: invalid option $1$help" >&2
  83. exit 1 ;;
  84. *local*)
  85. # First pass through any local machine types.
  86. echo "$1"
  87. exit ;;
  88. * )
  89. break ;;
  90. esac
  91. done
  92. case $# in
  93. 0) echo "$me: missing argument$help" >&2
  94. exit 1;;
  95. 1) ;;
  96. *) echo "$me: too many arguments$help" >&2
  97. exit 1;;
  98. esac
  99. # Split fields of configuration type
  100. # shellcheck disable=SC2162
  101. saved_IFS=$IFS
  102. IFS="-" read field1 field2 field3 field4 <<EOF
  103. $1
  104. EOF
  105. IFS=$saved_IFS
  106. # Separate into logical components for further validation
  107. case $1 in
  108. *-*-*-*-*)
  109. echo "Invalid configuration '$1': more than four components" >&2
  110. exit 1
  111. ;;
  112. *-*-*-*)
  113. basic_machine=$field1-$field2
  114. basic_os=$field3-$field4
  115. ;;
  116. *-*-*)
  117. # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
  118. # parts
  119. maybe_os=$field2-$field3
  120. case $maybe_os in
  121. nto-qnx* | linux-* | uclinux-uclibc* \
  122. | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
  123. | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
  124. | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
  125. | 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. | nds32 | nds32le | nds32be \
  1193. | nfp \
  1194. | nios | nios2 | nios2eb | nios2el \
  1195. | none | np1 | ns16k | ns32k | nvptx \
  1196. | open8 \
  1197. | or1k* \
  1198. | or32 \
  1199. | orion \
  1200. | picochip \
  1201. | pdp10 | pdp11 | pj | pjl | pn | power \
  1202. | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
  1203. | pru \
  1204. | pyramid \
  1205. | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
  1206. | rl78 | romp | rs6000 | rx \
  1207. | s390 | s390x \
  1208. | score \
  1209. | sh | shl \
  1210. | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
  1211. | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
  1212. | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
  1213. | sparclite \
  1214. | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
  1215. | spu \
  1216. | tahoe \
  1217. | thumbv7* \
  1218. | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
  1219. | tron \
  1220. | ubicom32 \
  1221. | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
  1222. | vax \
  1223. | visium \
  1224. | w65 \
  1225. | wasm32 | wasm64 \
  1226. | we32k \
  1227. | x86 | x86_64 | xc16x | xgate | xps100 \
  1228. | xstormy16 | xtensa* \
  1229. | ymp \
  1230. | z8k | z80)
  1231. ;;
  1232. *)
  1233. echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
  1234. exit 1
  1235. ;;
  1236. esac
  1237. ;;
  1238. esac
  1239. # Here we canonicalize certain aliases for manufacturers.
  1240. case $vendor in
  1241. digital*)
  1242. vendor=dec
  1243. ;;
  1244. commodore*)
  1245. vendor=cbm
  1246. ;;
  1247. *)
  1248. ;;
  1249. esac
  1250. # Decode manufacturer-specific aliases for certain operating systems.
  1251. if test x"$basic_os" != x
  1252. then
  1253. # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
  1254. # set os.
  1255. obj=
  1256. case $basic_os in
  1257. gnu/linux*)
  1258. kernel=linux
  1259. os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
  1260. ;;
  1261. os2-emx)
  1262. kernel=os2
  1263. os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
  1264. ;;
  1265. nto-qnx*)
  1266. kernel=nto
  1267. os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
  1268. ;;
  1269. *-*)
  1270. # shellcheck disable=SC2162
  1271. saved_IFS=$IFS
  1272. IFS="-" read kernel os <<EOF
  1273. $basic_os
  1274. EOF
  1275. IFS=$saved_IFS
  1276. ;;
  1277. # Default OS when just kernel was specified
  1278. nto*)
  1279. kernel=nto
  1280. os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
  1281. ;;
  1282. linux*)
  1283. kernel=linux
  1284. os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
  1285. ;;
  1286. managarm*)
  1287. kernel=managarm
  1288. os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
  1289. ;;
  1290. *)
  1291. kernel=
  1292. os=$basic_os
  1293. ;;
  1294. esac
  1295. # Now, normalize the OS (knowing we just have one component, it's not a kernel,
  1296. # etc.)
  1297. case $os in
  1298. # First match some system type aliases that might get confused
  1299. # with valid system types.
  1300. # solaris* is a basic system type, with this one exception.
  1301. auroraux)
  1302. os=auroraux
  1303. ;;
  1304. bluegene*)
  1305. os=cnk
  1306. ;;
  1307. solaris1 | solaris1.*)
  1308. os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
  1309. ;;
  1310. solaris)
  1311. os=solaris2
  1312. ;;
  1313. unixware*)
  1314. os=sysv4.2uw
  1315. ;;
  1316. # es1800 is here to avoid being matched by es* (a different OS)
  1317. es1800*)
  1318. os=ose
  1319. ;;
  1320. # Some version numbers need modification
  1321. chorusos*)
  1322. os=chorusos
  1323. ;;
  1324. isc)
  1325. os=isc2.2
  1326. ;;
  1327. sco6)
  1328. os=sco5v6
  1329. ;;
  1330. sco5)
  1331. os=sco3.2v5
  1332. ;;
  1333. sco4)
  1334. os=sco3.2v4
  1335. ;;
  1336. sco3.2.[4-9]*)
  1337. os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
  1338. ;;
  1339. sco*v* | scout)
  1340. # Don't match below
  1341. ;;
  1342. sco*)
  1343. os=sco3.2v2
  1344. ;;
  1345. psos*)
  1346. os=psos
  1347. ;;
  1348. qnx*)
  1349. os=qnx
  1350. ;;
  1351. hiux*)
  1352. os=hiuxwe2
  1353. ;;
  1354. lynx*178)
  1355. os=lynxos178
  1356. ;;
  1357. lynx*5)
  1358. os=lynxos5
  1359. ;;
  1360. lynxos*)
  1361. # don't get caught up in next wildcard
  1362. ;;
  1363. lynx*)
  1364. os=lynxos
  1365. ;;
  1366. mac[0-9]*)
  1367. os=`echo "$os" | sed -e 's|mac|macos|'`
  1368. ;;
  1369. opened*)
  1370. os=openedition
  1371. ;;
  1372. os400*)
  1373. os=os400
  1374. ;;
  1375. sunos5*)
  1376. os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
  1377. ;;
  1378. sunos6*)
  1379. os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
  1380. ;;
  1381. wince*)
  1382. os=wince
  1383. ;;
  1384. utek*)
  1385. os=bsd
  1386. ;;
  1387. dynix*)
  1388. os=bsd
  1389. ;;
  1390. acis*)
  1391. os=aos
  1392. ;;
  1393. atheos*)
  1394. os=atheos
  1395. ;;
  1396. syllable*)
  1397. os=syllable
  1398. ;;
  1399. 386bsd)
  1400. os=bsd
  1401. ;;
  1402. ctix* | uts*)
  1403. os=sysv
  1404. ;;
  1405. nova*)
  1406. os=rtmk-nova
  1407. ;;
  1408. ns2)
  1409. os=nextstep2
  1410. ;;
  1411. # Preserve the version number of sinix5.
  1412. sinix5.*)
  1413. os=`echo "$os" | sed -e 's|sinix|sysv|'`
  1414. ;;
  1415. sinix*)
  1416. os=sysv4
  1417. ;;
  1418. tpf*)
  1419. os=tpf
  1420. ;;
  1421. triton*)
  1422. os=sysv3
  1423. ;;
  1424. oss*)
  1425. os=sysv3
  1426. ;;
  1427. svr4*)
  1428. os=sysv4
  1429. ;;
  1430. svr3)
  1431. os=sysv3
  1432. ;;
  1433. sysvr4)
  1434. os=sysv4
  1435. ;;
  1436. ose*)
  1437. os=ose
  1438. ;;
  1439. *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
  1440. os=mint
  1441. ;;
  1442. dicos*)
  1443. os=dicos
  1444. ;;
  1445. pikeos*)
  1446. # Until real need of OS specific support for
  1447. # particular features comes up, bare metal
  1448. # configurations are quite functional.
  1449. case $cpu in
  1450. arm*)
  1451. os=eabi
  1452. ;;
  1453. *)
  1454. os=
  1455. obj=elf
  1456. ;;
  1457. esac
  1458. ;;
  1459. aout* | coff* | elf* | pe*)
  1460. # These are machine code file formats, not OSes
  1461. obj=$os
  1462. os=
  1463. ;;
  1464. *)
  1465. # No normalization, but not necessarily accepted, that comes below.
  1466. ;;
  1467. esac
  1468. else
  1469. # Here we handle the default operating systems that come with various machines.
  1470. # The value should be what the vendor currently ships out the door with their
  1471. # machine or put another way, the most popular os provided with the machine.
  1472. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1473. # "-sun"), then you have to tell the case statement up towards the top
  1474. # that MANUFACTURER isn't an operating system. Otherwise, code above
  1475. # will signal an error saying that MANUFACTURER isn't an operating
  1476. # system, and we'll never get to this point.
  1477. kernel=
  1478. obj=
  1479. case $cpu-$vendor in
  1480. score-*)
  1481. os=
  1482. obj=elf
  1483. ;;
  1484. spu-*)
  1485. os=
  1486. obj=elf
  1487. ;;
  1488. *-acorn)
  1489. os=riscix1.2
  1490. ;;
  1491. arm*-rebel)
  1492. kernel=linux
  1493. os=gnu
  1494. ;;
  1495. arm*-semi)
  1496. os=
  1497. obj=aout
  1498. ;;
  1499. c4x-* | tic4x-*)
  1500. os=
  1501. obj=coff
  1502. ;;
  1503. c8051-*)
  1504. os=
  1505. obj=elf
  1506. ;;
  1507. clipper-intergraph)
  1508. os=clix
  1509. ;;
  1510. hexagon-*)
  1511. os=
  1512. obj=elf
  1513. ;;
  1514. tic54x-*)
  1515. os=
  1516. obj=coff
  1517. ;;
  1518. tic55x-*)
  1519. os=
  1520. obj=coff
  1521. ;;
  1522. tic6x-*)
  1523. os=
  1524. obj=coff
  1525. ;;
  1526. # This must come before the *-dec entry.
  1527. pdp10-*)
  1528. os=tops20
  1529. ;;
  1530. pdp11-*)
  1531. os=none
  1532. ;;
  1533. *-dec | vax-*)
  1534. os=ultrix4.2
  1535. ;;
  1536. m68*-apollo)
  1537. os=domain
  1538. ;;
  1539. i386-sun)
  1540. os=sunos4.0.2
  1541. ;;
  1542. m68000-sun)
  1543. os=sunos3
  1544. ;;
  1545. m68*-cisco)
  1546. os=
  1547. obj=aout
  1548. ;;
  1549. mep-*)
  1550. os=
  1551. obj=elf
  1552. ;;
  1553. mips*-cisco)
  1554. os=
  1555. obj=elf
  1556. ;;
  1557. mips*-*)
  1558. os=
  1559. obj=elf
  1560. ;;
  1561. or32-*)
  1562. os=
  1563. obj=coff
  1564. ;;
  1565. *-tti) # must be before sparc entry or we get the wrong os.
  1566. os=sysv3
  1567. ;;
  1568. sparc-* | *-sun)
  1569. os=sunos4.1.1
  1570. ;;
  1571. pru-*)
  1572. os=
  1573. obj=elf
  1574. ;;
  1575. *-be)
  1576. os=beos
  1577. ;;
  1578. *-ibm)
  1579. os=aix
  1580. ;;
  1581. *-knuth)
  1582. os=mmixware
  1583. ;;
  1584. *-wec)
  1585. os=proelf
  1586. ;;
  1587. *-winbond)
  1588. os=proelf
  1589. ;;
  1590. *-oki)
  1591. os=proelf
  1592. ;;
  1593. *-hp)
  1594. os=hpux
  1595. ;;
  1596. *-hitachi)
  1597. os=hiux
  1598. ;;
  1599. i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1600. os=sysv
  1601. ;;
  1602. *-cbm)
  1603. os=amigaos
  1604. ;;
  1605. *-dg)
  1606. os=dgux
  1607. ;;
  1608. *-dolphin)
  1609. os=sysv3
  1610. ;;
  1611. m68k-ccur)
  1612. os=rtu
  1613. ;;
  1614. m88k-omron*)
  1615. os=luna
  1616. ;;
  1617. *-next)
  1618. os=nextstep
  1619. ;;
  1620. *-sequent)
  1621. os=ptx
  1622. ;;
  1623. *-crds)
  1624. os=unos
  1625. ;;
  1626. *-ns)
  1627. os=genix
  1628. ;;
  1629. i370-*)
  1630. os=mvs
  1631. ;;
  1632. *-gould)
  1633. os=sysv
  1634. ;;
  1635. *-highlevel)
  1636. os=bsd
  1637. ;;
  1638. *-encore)
  1639. os=bsd
  1640. ;;
  1641. *-sgi)
  1642. os=irix
  1643. ;;
  1644. *-siemens)
  1645. os=sysv4
  1646. ;;
  1647. *-masscomp)
  1648. os=rtu
  1649. ;;
  1650. f30[01]-fujitsu | f700-fujitsu)
  1651. os=uxpv
  1652. ;;
  1653. *-rom68k)
  1654. os=
  1655. obj=coff
  1656. ;;
  1657. *-*bug)
  1658. os=
  1659. obj=coff
  1660. ;;
  1661. *-apple)
  1662. os=macos
  1663. ;;
  1664. *-atari*)
  1665. os=mint
  1666. ;;
  1667. *-wrs)
  1668. os=vxworks
  1669. ;;
  1670. *)
  1671. os=none
  1672. ;;
  1673. esac
  1674. fi
  1675. # Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
  1676. case $os in
  1677. # Sometimes we do "kernel-libc", so those need to count as OSes.
  1678. musl* | newlib* | relibc* | uclibc*)
  1679. ;;
  1680. # Likewise for "kernel-abi"
  1681. eabi* | gnueabi*)
  1682. ;;
  1683. # VxWorks passes extra cpu info in the 4th filed.
  1684. simlinux | simwindows | spe)
  1685. ;;
  1686. # See `case $cpu-$os` validation below
  1687. ghcjs)
  1688. ;;
  1689. # Now accept the basic system types.
  1690. # The portable systems comes first.
  1691. # Each alternative MUST end in a * to match a version number.
  1692. gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
  1693. | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
  1694. | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
  1695. | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
  1696. | hiux* | abug | nacl* | netware* | windows* \
  1697. | os9* | macos* | osx* | ios* | tvos* | watchos* \
  1698. | mpw* | magic* | mmixware* | mon960* | lnews* \
  1699. | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
  1700. | aos* | aros* | cloudabi* | sortix* | twizzler* \
  1701. | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
  1702. | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
  1703. | mirbsd* | netbsd* | dicos* | openedition* | ose* \
  1704. | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
  1705. | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
  1706. | bosx* | nextstep* | cxux* | oabi* \
  1707. | ptx* | ecoff* | winnt* | domain* | vsta* \
  1708. | udi* | lites* | ieee* | go32* | aux* | hcos* \
  1709. | chorusrdb* | cegcc* | glidix* | serenity* \
  1710. | cygwin* | msys* | moss* | proelf* | rtems* \
  1711. | midipix* | mingw32* | mingw64* | mint* \
  1712. | uxpv* | beos* | mpeix* | udk* | moxiebox* \
  1713. | interix* | uwin* | mks* | rhapsody* | darwin* \
  1714. | openstep* | oskit* | conix* | pw32* | nonstopux* \
  1715. | storm-chaos* | tops10* | tenex* | tops20* | its* \
  1716. | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
  1717. | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
  1718. | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
  1719. | skyos* | haiku* | rdos* | toppers* | drops* | es* \
  1720. | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
  1721. | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
  1722. | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
  1723. | fiwix* | mlibc* | cos* | mbr* )
  1724. ;;
  1725. # This one is extra strict with allowed versions
  1726. sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
  1727. # Don't forget version if it is 3.2v4 or newer.
  1728. ;;
  1729. none)
  1730. ;;
  1731. kernel* | msvc* )
  1732. # Restricted further below
  1733. ;;
  1734. '')
  1735. if test x"$obj" = x
  1736. then
  1737. echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
  1738. fi
  1739. ;;
  1740. *)
  1741. echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
  1742. exit 1
  1743. ;;
  1744. esac
  1745. case $obj in
  1746. aout* | coff* | elf* | pe*)
  1747. ;;
  1748. '')
  1749. # empty is fine
  1750. ;;
  1751. *)
  1752. echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
  1753. exit 1
  1754. ;;
  1755. esac
  1756. # Here we handle the constraint that a (synthetic) cpu and os are
  1757. # valid only in combination with each other and nowhere else.
  1758. case $cpu-$os in
  1759. # The "javascript-unknown-ghcjs" triple is used by GHC; we
  1760. # accept it here in order to tolerate that, but reject any
  1761. # variations.
  1762. javascript-ghcjs)
  1763. ;;
  1764. javascript-* | *-ghcjs)
  1765. echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
  1766. exit 1
  1767. ;;
  1768. esac
  1769. # As a final step for OS-related things, validate the OS-kernel combination
  1770. # (given a valid OS), if there is a kernel.
  1771. case $kernel-$os-$obj in
  1772. linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \
  1773. | linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- )
  1774. ;;
  1775. uclinux-uclibc*- )
  1776. ;;
  1777. managarm-mlibc*- | managarm-kernel*- )
  1778. ;;
  1779. windows*-msvc*-)
  1780. ;;
  1781. -dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- )
  1782. # These are just libc implementations, not actual OSes, and thus
  1783. # require a kernel.
  1784. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
  1785. exit 1
  1786. ;;
  1787. -kernel*- )
  1788. echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
  1789. exit 1
  1790. ;;
  1791. *-kernel*- )
  1792. echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
  1793. exit 1
  1794. ;;
  1795. *-msvc*- )
  1796. echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
  1797. exit 1
  1798. ;;
  1799. kfreebsd*-gnu*- | kopensolaris*-gnu*-)
  1800. ;;
  1801. vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
  1802. ;;
  1803. nto-qnx*-)
  1804. ;;
  1805. os2-emx-)
  1806. ;;
  1807. *-eabi*- | *-gnueabi*-)
  1808. ;;
  1809. none--*)
  1810. # None (no kernel, i.e. freestanding / bare metal),
  1811. # can be paired with an machine code file format
  1812. ;;
  1813. -*-)
  1814. # Blank kernel with real OS is always fine.
  1815. ;;
  1816. --*)
  1817. # Blank kernel and OS with real machine code file format is always fine.
  1818. ;;
  1819. *-*-*)
  1820. echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
  1821. exit 1
  1822. ;;
  1823. esac
  1824. # Here we handle the case where we know the os, and the CPU type, but not the
  1825. # manufacturer. We pick the logical manufacturer.
  1826. case $vendor in
  1827. unknown)
  1828. case $cpu-$os in
  1829. *-riscix*)
  1830. vendor=acorn
  1831. ;;
  1832. *-sunos*)
  1833. vendor=sun
  1834. ;;
  1835. *-cnk* | *-aix*)
  1836. vendor=ibm
  1837. ;;
  1838. *-beos*)
  1839. vendor=be
  1840. ;;
  1841. *-hpux*)
  1842. vendor=hp
  1843. ;;
  1844. *-mpeix*)
  1845. vendor=hp
  1846. ;;
  1847. *-hiux*)
  1848. vendor=hitachi
  1849. ;;
  1850. *-unos*)
  1851. vendor=crds
  1852. ;;
  1853. *-dgux*)
  1854. vendor=dg
  1855. ;;
  1856. *-luna*)
  1857. vendor=omron
  1858. ;;
  1859. *-genix*)
  1860. vendor=ns
  1861. ;;
  1862. *-clix*)
  1863. vendor=intergraph
  1864. ;;
  1865. *-mvs* | *-opened*)
  1866. vendor=ibm
  1867. ;;
  1868. *-os400*)
  1869. vendor=ibm
  1870. ;;
  1871. s390-* | s390x-*)
  1872. vendor=ibm
  1873. ;;
  1874. *-ptx*)
  1875. vendor=sequent
  1876. ;;
  1877. *-tpf*)
  1878. vendor=ibm
  1879. ;;
  1880. *-vxsim* | *-vxworks* | *-windiss*)
  1881. vendor=wrs
  1882. ;;
  1883. *-aux*)
  1884. vendor=apple
  1885. ;;
  1886. *-hms*)
  1887. vendor=hitachi
  1888. ;;
  1889. *-mpw* | *-macos*)
  1890. vendor=apple
  1891. ;;
  1892. *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
  1893. vendor=atari
  1894. ;;
  1895. *-vos*)
  1896. vendor=stratus
  1897. ;;
  1898. esac
  1899. ;;
  1900. esac
  1901. echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
  1902. exit
  1903. # Local variables:
  1904. # eval: (add-hook 'before-save-hook 'time-stamp)
  1905. # time-stamp-start: "timestamp='"
  1906. # time-stamp-format: "%:y-%02m-%02d"
  1907. # time-stamp-end: "'"
  1908. # End: