🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1895 lines
34 KiB

  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-07-31'
  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 \
  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. | h8300 | h8500 \
  1171. | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
  1172. | hexagon \
  1173. | i370 | i*86 | i860 | i960 | ia16 | ia64 \
  1174. | ip2k | iq2000 \
  1175. | k1om \
  1176. | kvx \
  1177. | le32 | le64 \
  1178. | lm32 \
  1179. | loongarch32 | loongarch64 \
  1180. | m32c | m32r | m32rle \
  1181. | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
  1182. | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
  1183. | m88110 | m88k | maxq | mb | mcore | mep | metag \
  1184. | microblaze | microblazeel \
  1185. | mips* \
  1186. | mmix \
  1187. | mn10200 | mn10300 \
  1188. | moxie \
  1189. | mt \
  1190. | msp430 \
  1191. | nds32 | nds32le | nds32be \
  1192. | nfp \
  1193. | nios | nios2 | nios2eb | nios2el \
  1194. | none | np1 | ns16k | ns32k | nvptx \
  1195. | open8 \
  1196. | or1k* \
  1197. | or32 \
  1198. | orion \
  1199. | picochip \
  1200. | pdp10 | pdp11 | pj | pjl | pn | power \
  1201. | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
  1202. | pru \
  1203. | pyramid \
  1204. | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
  1205. | rl78 | romp | rs6000 | rx \
  1206. | s390 | s390x \
  1207. | score \
  1208. | sh | shl \
  1209. | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
  1210. | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
  1211. | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
  1212. | sparclite \
  1213. | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
  1214. | spu \
  1215. | tahoe \
  1216. | thumbv7* \
  1217. | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
  1218. | tron \
  1219. | ubicom32 \
  1220. | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
  1221. | vax \
  1222. | visium \
  1223. | w65 \
  1224. | wasm32 | wasm64 \
  1225. | we32k \
  1226. | x86 | x86_64 | xc16x | xgate | xps100 \
  1227. | xstormy16 | xtensa* \
  1228. | ymp \
  1229. | z8k | z80)
  1230. ;;
  1231. *)
  1232. echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
  1233. exit 1
  1234. ;;
  1235. esac
  1236. ;;
  1237. esac
  1238. # Here we canonicalize certain aliases for manufacturers.
  1239. case $vendor in
  1240. digital*)
  1241. vendor=dec
  1242. ;;
  1243. commodore*)
  1244. vendor=cbm
  1245. ;;
  1246. *)
  1247. ;;
  1248. esac
  1249. # Decode manufacturer-specific aliases for certain operating systems.
  1250. if test x$basic_os != x
  1251. then
  1252. # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
  1253. # set os.
  1254. case $basic_os in
  1255. gnu/linux*)
  1256. kernel=linux
  1257. os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
  1258. ;;
  1259. os2-emx)
  1260. kernel=os2
  1261. os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
  1262. ;;
  1263. nto-qnx*)
  1264. kernel=nto
  1265. os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
  1266. ;;
  1267. *-*)
  1268. # shellcheck disable=SC2162
  1269. saved_IFS=$IFS
  1270. IFS="-" read kernel os <<EOF
  1271. $basic_os
  1272. EOF
  1273. IFS=$saved_IFS
  1274. ;;
  1275. # Default OS when just kernel was specified
  1276. nto*)
  1277. kernel=nto
  1278. os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
  1279. ;;
  1280. linux*)
  1281. kernel=linux
  1282. os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
  1283. ;;
  1284. managarm*)
  1285. kernel=managarm
  1286. os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
  1287. ;;
  1288. *)
  1289. kernel=
  1290. os=$basic_os
  1291. ;;
  1292. esac
  1293. # Now, normalize the OS (knowing we just have one component, it's not a kernel,
  1294. # etc.)
  1295. case $os in
  1296. # First match some system type aliases that might get confused
  1297. # with valid system types.
  1298. # solaris* is a basic system type, with this one exception.
  1299. auroraux)
  1300. os=auroraux
  1301. ;;
  1302. bluegene*)
  1303. os=cnk
  1304. ;;
  1305. solaris1 | solaris1.*)
  1306. os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
  1307. ;;
  1308. solaris)
  1309. os=solaris2
  1310. ;;
  1311. unixware*)
  1312. os=sysv4.2uw
  1313. ;;
  1314. # es1800 is here to avoid being matched by es* (a different OS)
  1315. es1800*)
  1316. os=ose
  1317. ;;
  1318. # Some version numbers need modification
  1319. chorusos*)
  1320. os=chorusos
  1321. ;;
  1322. isc)
  1323. os=isc2.2
  1324. ;;
  1325. sco6)
  1326. os=sco5v6
  1327. ;;
  1328. sco5)
  1329. os=sco3.2v5
  1330. ;;
  1331. sco4)
  1332. os=sco3.2v4
  1333. ;;
  1334. sco3.2.[4-9]*)
  1335. os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
  1336. ;;
  1337. sco*v* | scout)
  1338. # Don't match below
  1339. ;;
  1340. sco*)
  1341. os=sco3.2v2
  1342. ;;
  1343. psos*)
  1344. os=psos
  1345. ;;
  1346. qnx*)
  1347. os=qnx
  1348. ;;
  1349. hiux*)
  1350. os=hiuxwe2
  1351. ;;
  1352. lynx*178)
  1353. os=lynxos178
  1354. ;;
  1355. lynx*5)
  1356. os=lynxos5
  1357. ;;
  1358. lynxos*)
  1359. # don't get caught up in next wildcard
  1360. ;;
  1361. lynx*)
  1362. os=lynxos
  1363. ;;
  1364. mac[0-9]*)
  1365. os=`echo "$os" | sed -e 's|mac|macos|'`
  1366. ;;
  1367. opened*)
  1368. os=openedition
  1369. ;;
  1370. os400*)
  1371. os=os400
  1372. ;;
  1373. sunos5*)
  1374. os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
  1375. ;;
  1376. sunos6*)
  1377. os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
  1378. ;;
  1379. wince*)
  1380. os=wince
  1381. ;;
  1382. utek*)
  1383. os=bsd
  1384. ;;
  1385. dynix*)
  1386. os=bsd
  1387. ;;
  1388. acis*)
  1389. os=aos
  1390. ;;
  1391. atheos*)
  1392. os=atheos
  1393. ;;
  1394. syllable*)
  1395. os=syllable
  1396. ;;
  1397. 386bsd)
  1398. os=bsd
  1399. ;;
  1400. ctix* | uts*)
  1401. os=sysv
  1402. ;;
  1403. nova*)
  1404. os=rtmk-nova
  1405. ;;
  1406. ns2)
  1407. os=nextstep2
  1408. ;;
  1409. # Preserve the version number of sinix5.
  1410. sinix5.*)
  1411. os=`echo "$os" | sed -e 's|sinix|sysv|'`
  1412. ;;
  1413. sinix*)
  1414. os=sysv4
  1415. ;;
  1416. tpf*)
  1417. os=tpf
  1418. ;;
  1419. triton*)
  1420. os=sysv3
  1421. ;;
  1422. oss*)
  1423. os=sysv3
  1424. ;;
  1425. svr4*)
  1426. os=sysv4
  1427. ;;
  1428. svr3)
  1429. os=sysv3
  1430. ;;
  1431. sysvr4)
  1432. os=sysv4
  1433. ;;
  1434. ose*)
  1435. os=ose
  1436. ;;
  1437. *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
  1438. os=mint
  1439. ;;
  1440. dicos*)
  1441. os=dicos
  1442. ;;
  1443. pikeos*)
  1444. # Until real need of OS specific support for
  1445. # particular features comes up, bare metal
  1446. # configurations are quite functional.
  1447. case $cpu in
  1448. arm*)
  1449. os=eabi
  1450. ;;
  1451. *)
  1452. os=elf
  1453. ;;
  1454. esac
  1455. ;;
  1456. *)
  1457. # No normalization, but not necessarily accepted, that comes below.
  1458. ;;
  1459. esac
  1460. else
  1461. # Here we handle the default operating systems that come with various machines.
  1462. # The value should be what the vendor currently ships out the door with their
  1463. # machine or put another way, the most popular os provided with the machine.
  1464. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1465. # "-sun"), then you have to tell the case statement up towards the top
  1466. # that MANUFACTURER isn't an operating system. Otherwise, code above
  1467. # will signal an error saying that MANUFACTURER isn't an operating
  1468. # system, and we'll never get to this point.
  1469. kernel=
  1470. case $cpu-$vendor in
  1471. score-*)
  1472. os=elf
  1473. ;;
  1474. spu-*)
  1475. os=elf
  1476. ;;
  1477. *-acorn)
  1478. os=riscix1.2
  1479. ;;
  1480. arm*-rebel)
  1481. kernel=linux
  1482. os=gnu
  1483. ;;
  1484. arm*-semi)
  1485. os=aout
  1486. ;;
  1487. c4x-* | tic4x-*)
  1488. os=coff
  1489. ;;
  1490. c8051-*)
  1491. os=elf
  1492. ;;
  1493. clipper-intergraph)
  1494. os=clix
  1495. ;;
  1496. hexagon-*)
  1497. os=elf
  1498. ;;
  1499. tic54x-*)
  1500. os=coff
  1501. ;;
  1502. tic55x-*)
  1503. os=coff
  1504. ;;
  1505. tic6x-*)
  1506. os=coff
  1507. ;;
  1508. # This must come before the *-dec entry.
  1509. pdp10-*)
  1510. os=tops20
  1511. ;;
  1512. pdp11-*)
  1513. os=none
  1514. ;;
  1515. *-dec | vax-*)
  1516. os=ultrix4.2
  1517. ;;
  1518. m68*-apollo)
  1519. os=domain
  1520. ;;
  1521. i386-sun)
  1522. os=sunos4.0.2
  1523. ;;
  1524. m68000-sun)
  1525. os=sunos3
  1526. ;;
  1527. m68*-cisco)
  1528. os=aout
  1529. ;;
  1530. mep-*)
  1531. os=elf
  1532. ;;
  1533. mips*-cisco)
  1534. os=elf
  1535. ;;
  1536. mips*-*)
  1537. os=elf
  1538. ;;
  1539. or32-*)
  1540. os=coff
  1541. ;;
  1542. *-tti) # must be before sparc entry or we get the wrong os.
  1543. os=sysv3
  1544. ;;
  1545. sparc-* | *-sun)
  1546. os=sunos4.1.1
  1547. ;;
  1548. pru-*)
  1549. os=elf
  1550. ;;
  1551. *-be)
  1552. os=beos
  1553. ;;
  1554. *-ibm)
  1555. os=aix
  1556. ;;
  1557. *-knuth)
  1558. os=mmixware
  1559. ;;
  1560. *-wec)
  1561. os=proelf
  1562. ;;
  1563. *-winbond)
  1564. os=proelf
  1565. ;;
  1566. *-oki)
  1567. os=proelf
  1568. ;;
  1569. *-hp)
  1570. os=hpux
  1571. ;;
  1572. *-hitachi)
  1573. os=hiux
  1574. ;;
  1575. i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1576. os=sysv
  1577. ;;
  1578. *-cbm)
  1579. os=amigaos
  1580. ;;
  1581. *-dg)
  1582. os=dgux
  1583. ;;
  1584. *-dolphin)
  1585. os=sysv3
  1586. ;;
  1587. m68k-ccur)
  1588. os=rtu
  1589. ;;
  1590. m88k-omron*)
  1591. os=luna
  1592. ;;
  1593. *-next)
  1594. os=nextstep
  1595. ;;
  1596. *-sequent)
  1597. os=ptx
  1598. ;;
  1599. *-crds)
  1600. os=unos
  1601. ;;
  1602. *-ns)
  1603. os=genix
  1604. ;;
  1605. i370-*)
  1606. os=mvs
  1607. ;;
  1608. *-gould)
  1609. os=sysv
  1610. ;;
  1611. *-highlevel)
  1612. os=bsd
  1613. ;;
  1614. *-encore)
  1615. os=bsd
  1616. ;;
  1617. *-sgi)
  1618. os=irix
  1619. ;;
  1620. *-siemens)
  1621. os=sysv4
  1622. ;;
  1623. *-masscomp)
  1624. os=rtu
  1625. ;;
  1626. f30[01]-fujitsu | f700-fujitsu)
  1627. os=uxpv
  1628. ;;
  1629. *-rom68k)
  1630. os=coff
  1631. ;;
  1632. *-*bug)
  1633. os=coff
  1634. ;;
  1635. *-apple)
  1636. os=macos
  1637. ;;
  1638. *-atari*)
  1639. os=mint
  1640. ;;
  1641. *-wrs)
  1642. os=vxworks
  1643. ;;
  1644. *)
  1645. os=none
  1646. ;;
  1647. esac
  1648. fi
  1649. # Now, validate our (potentially fixed-up) OS.
  1650. case $os in
  1651. # Sometimes we do "kernel-libc", so those need to count as OSes.
  1652. musl* | newlib* | relibc* | uclibc*)
  1653. ;;
  1654. # Likewise for "kernel-abi"
  1655. eabi* | gnueabi*)
  1656. ;;
  1657. # VxWorks passes extra cpu info in the 4th filed.
  1658. simlinux | simwindows | spe)
  1659. ;;
  1660. # Now accept the basic system types.
  1661. # The portable systems comes first.
  1662. # Each alternative MUST end in a * to match a version number.
  1663. gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
  1664. | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
  1665. | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
  1666. | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
  1667. | hiux* | abug | nacl* | netware* | windows* \
  1668. | os9* | macos* | osx* | ios* | tvos* | watchos* \
  1669. | mpw* | magic* | mmixware* | mon960* | lnews* \
  1670. | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
  1671. | aos* | aros* | cloudabi* | sortix* | twizzler* \
  1672. | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
  1673. | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
  1674. | mirbsd* | netbsd* | dicos* | openedition* | ose* \
  1675. | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
  1676. | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
  1677. | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
  1678. | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
  1679. | udi* | lites* | ieee* | go32* | aux* | hcos* \
  1680. | chorusrdb* | cegcc* | glidix* | serenity* \
  1681. | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
  1682. | midipix* | mingw32* | mingw64* | mint* \
  1683. | uxpv* | beos* | mpeix* | udk* | moxiebox* \
  1684. | interix* | uwin* | mks* | rhapsody* | darwin* \
  1685. | openstep* | oskit* | conix* | pw32* | nonstopux* \
  1686. | storm-chaos* | tops10* | tenex* | tops20* | its* \
  1687. | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
  1688. | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
  1689. | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
  1690. | skyos* | haiku* | rdos* | toppers* | drops* | es* \
  1691. | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
  1692. | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
  1693. | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
  1694. | fiwix* | mlibc* | cos* | mbr* )
  1695. ;;
  1696. # This one is extra strict with allowed versions
  1697. sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
  1698. # Don't forget version if it is 3.2v4 or newer.
  1699. ;;
  1700. none)
  1701. ;;
  1702. kernel* | msvc* )
  1703. # Restricted further below
  1704. ;;
  1705. *)
  1706. echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
  1707. exit 1
  1708. ;;
  1709. esac
  1710. # As a final step for OS-related things, validate the OS-kernel combination
  1711. # (given a valid OS), if there is a kernel.
  1712. case $kernel-$os in
  1713. linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
  1714. | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
  1715. ;;
  1716. uclinux-uclibc* )
  1717. ;;
  1718. managarm-mlibc* | managarm-kernel* )
  1719. ;;
  1720. windows*-gnu* | windows*-msvc*)
  1721. ;;
  1722. -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
  1723. # These are just libc implementations, not actual OSes, and thus
  1724. # require a kernel.
  1725. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
  1726. exit 1
  1727. ;;
  1728. -kernel* )
  1729. echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
  1730. exit 1
  1731. ;;
  1732. *-kernel* )
  1733. echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
  1734. exit 1
  1735. ;;
  1736. *-msvc* )
  1737. echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
  1738. exit 1
  1739. ;;
  1740. kfreebsd*-gnu* | kopensolaris*-gnu*)
  1741. ;;
  1742. vxworks-simlinux | vxworks-simwindows | vxworks-spe)
  1743. ;;
  1744. nto-qnx*)
  1745. ;;
  1746. os2-emx)
  1747. ;;
  1748. *-eabi* | *-gnueabi*)
  1749. ;;
  1750. none-coff* | none-elf*)
  1751. # None (no kernel, i.e. freestanding / bare metal),
  1752. # can be paired with an output format "OS"
  1753. ;;
  1754. -*)
  1755. # Blank kernel with real OS is always fine.
  1756. ;;
  1757. *-*)
  1758. echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
  1759. exit 1
  1760. ;;
  1761. esac
  1762. # Here we handle the case where we know the os, and the CPU type, but not the
  1763. # manufacturer. We pick the logical manufacturer.
  1764. case $vendor in
  1765. unknown)
  1766. case $cpu-$os in
  1767. *-riscix*)
  1768. vendor=acorn
  1769. ;;
  1770. *-sunos*)
  1771. vendor=sun
  1772. ;;
  1773. *-cnk* | *-aix*)
  1774. vendor=ibm
  1775. ;;
  1776. *-beos*)
  1777. vendor=be
  1778. ;;
  1779. *-hpux*)
  1780. vendor=hp
  1781. ;;
  1782. *-mpeix*)
  1783. vendor=hp
  1784. ;;
  1785. *-hiux*)
  1786. vendor=hitachi
  1787. ;;
  1788. *-unos*)
  1789. vendor=crds
  1790. ;;
  1791. *-dgux*)
  1792. vendor=dg
  1793. ;;
  1794. *-luna*)
  1795. vendor=omron
  1796. ;;
  1797. *-genix*)
  1798. vendor=ns
  1799. ;;
  1800. *-clix*)
  1801. vendor=intergraph
  1802. ;;
  1803. *-mvs* | *-opened*)
  1804. vendor=ibm
  1805. ;;
  1806. *-os400*)
  1807. vendor=ibm
  1808. ;;
  1809. s390-* | s390x-*)
  1810. vendor=ibm
  1811. ;;
  1812. *-ptx*)
  1813. vendor=sequent
  1814. ;;
  1815. *-tpf*)
  1816. vendor=ibm
  1817. ;;
  1818. *-vxsim* | *-vxworks* | *-windiss*)
  1819. vendor=wrs
  1820. ;;
  1821. *-aux*)
  1822. vendor=apple
  1823. ;;
  1824. *-hms*)
  1825. vendor=hitachi
  1826. ;;
  1827. *-mpw* | *-macos*)
  1828. vendor=apple
  1829. ;;
  1830. *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
  1831. vendor=atari
  1832. ;;
  1833. *-vos*)
  1834. vendor=stratus
  1835. ;;
  1836. esac
  1837. ;;
  1838. esac
  1839. echo "$cpu-$vendor-${kernel:+$kernel-}$os"
  1840. exit
  1841. # Local variables:
  1842. # eval: (add-hook 'before-save-hook 'time-stamp)
  1843. # time-stamp-start: "timestamp='"
  1844. # time-stamp-format: "%:y-%02m-%02d"
  1845. # time-stamp-end: "'"
  1846. # End: