🛠️🐜 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.

1890 lines
35 KiB

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