14e8f48c7Smrg#!/usr/bin/sh
2c43cc173Smrg# Configuration validation subroutine script.
3c6b4a769Smrg#   Copyright 1992-2023 Free Software Foundation, Inc.
4c43cc173Smrg
54e8f48c7Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale
64e8f48c7Smrg
7c6b4a769Smrgtimestamp='2023-06-23'
8c43cc173Smrg
906c34b88Smrg# This file is free software; you can redistribute it and/or modify it
1006c34b88Smrg# under the terms of the GNU General Public License as published by
114e8f48c7Smrg# the Free Software Foundation, either version 3 of the License, or
12c43cc173Smrg# (at your option) any later version.
13c43cc173Smrg#
1406c34b88Smrg# This program is distributed in the hope that it will be useful, but
1506c34b88Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1606c34b88Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1706c34b88Smrg# General Public License for more details.
18c43cc173Smrg#
19c43cc173Smrg# You should have received a copy of the GNU General Public License
2087404ef7Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
2121e67964Smrg#
22c43cc173Smrg# As a special exception to the GNU General Public License, if you
23c43cc173Smrg# distribute this file as part of a program that contains a
24c43cc173Smrg# configuration script generated by Autoconf, you may include it under
2506c34b88Smrg# the same distribution terms that you use for the rest of that
2606c34b88Smrg# program.  This Exception is an additional permission under section 7
2706c34b88Smrg# of the GNU General Public License, version 3 ("GPLv3").
28c43cc173Smrg
2921e67964Smrg
3048e5ce07Smrg# Please send patches to <config-patches@gnu.org>.
31c43cc173Smrg#
32c43cc173Smrg# Configuration subroutine to validate and canonicalize a configuration type.
33c43cc173Smrg# Supply the specified configuration type as an argument.
34c43cc173Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
35c43cc173Smrg# Otherwise, we print the canonical config type on stdout and succeed.
36c43cc173Smrg
373e256790Smrg# You can get the latest version of this script from:
384e8f48c7Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
393e256790Smrg
40c43cc173Smrg# This file is supposed to be the same for all GNU packages
41c43cc173Smrg# and recognize all the CPU types, system types and aliases
42c43cc173Smrg# that are meaningful with *any* GNU software.
43c43cc173Smrg# Each package is responsible for reporting which valid configurations
44c43cc173Smrg# it does not support.  The user should be able to distinguish
45c43cc173Smrg# a failure to support a valid configuration from a meaningless
46c43cc173Smrg# configuration.
47c43cc173Smrg
48c43cc173Smrg# The goal of this file is to map all the various variations of a given
49c43cc173Smrg# machine specification into a single specification in the form:
50c43cc173Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
51c43cc173Smrg# or in some cases, the newer four-part form:
52c43cc173Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
53c43cc173Smrg# It is wrong to echo any other type of specification.
54c43cc173Smrg
554e8f48c7Smrg# The "shellcheck disable" line above the timestamp inhibits complaints
564e8f48c7Smrg# about features and limitations of the classic Bourne shell that were
574e8f48c7Smrg# superseded or lifted in POSIX.  However, this script identifies a wide
584e8f48c7Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
594e8f48c7Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still
604e8f48c7Smrg# have a pre-POSIX /bin/sh.
614e8f48c7Smrg
62c43cc173Smrgme=`echo "$0" | sed -e 's,.*/,,'`
63c43cc173Smrg
64c43cc173Smrgusage="\
654940c694SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
66c43cc173Smrg
67c43cc173SmrgCanonicalize a configuration name.
68c43cc173Smrg
6987404ef7SmrgOptions:
70c43cc173Smrg  -h, --help         print this help, then exit
71c43cc173Smrg  -t, --time-stamp   print date of last modification, then exit
72c43cc173Smrg  -v, --version      print version number, then exit
73c43cc173Smrg
74c43cc173SmrgReport bugs and patches to <config-patches@gnu.org>."
75c43cc173Smrg
76c43cc173Smrgversion="\
77c43cc173SmrgGNU config.sub ($timestamp)
78c43cc173Smrg
79c6b4a769SmrgCopyright 1992-2023 Free Software Foundation, Inc.
80c43cc173Smrg
81c43cc173SmrgThis is free software; see the source for copying conditions.  There is NO
82c43cc173Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
83c43cc173Smrg
84c43cc173Smrghelp="
85c6b4a769SmrgTry '$me --help' for more information."
86c43cc173Smrg
87c43cc173Smrg# Parse command line
88c43cc173Smrgwhile test $# -gt 0 ; do
89c43cc173Smrg  case $1 in
90c43cc173Smrg    --time-stamp | --time* | -t )
9121e67964Smrg       echo "$timestamp" ; exit ;;
92c43cc173Smrg    --version | -v )
9321e67964Smrg       echo "$version" ; exit ;;
94c43cc173Smrg    --help | --h* | -h )
9521e67964Smrg       echo "$usage"; exit ;;
96c43cc173Smrg    -- )     # Stop option processing
97c43cc173Smrg       shift; break ;;
98c43cc173Smrg    - )	# Use stdin as input.
99c43cc173Smrg       break ;;
100c43cc173Smrg    -* )
1014e8f48c7Smrg       echo "$me: invalid option $1$help" >&2
102c43cc173Smrg       exit 1 ;;
103c43cc173Smrg
104c43cc173Smrg    *local*)
105c43cc173Smrg       # First pass through any local machine types.
10687404ef7Smrg       echo "$1"
10721e67964Smrg       exit ;;
108c43cc173Smrg
109c43cc173Smrg    * )
110c43cc173Smrg       break ;;
111c43cc173Smrg  esac
112c43cc173Smrgdone
113c43cc173Smrg
114c43cc173Smrgcase $# in
115c43cc173Smrg 0) echo "$me: missing argument$help" >&2
116c43cc173Smrg    exit 1;;
117c43cc173Smrg 1) ;;
118c43cc173Smrg *) echo "$me: too many arguments$help" >&2
119c43cc173Smrg    exit 1;;
120c43cc173Smrgesac
121c43cc173Smrg
1224e8f48c7Smrg# Split fields of configuration type
1234e8f48c7Smrg# shellcheck disable=SC2162
1244e8f48c7Smrgsaved_IFS=$IFS
1254e8f48c7SmrgIFS="-" read field1 field2 field3 field4 <<EOF
1264e8f48c7Smrg$1
1274e8f48c7SmrgEOF
1284e8f48c7SmrgIFS=$saved_IFS
129c43cc173Smrg
1304e8f48c7Smrg# Separate into logical components for further validation
1314e8f48c7Smrgcase $1 in
1324e8f48c7Smrg	*-*-*-*-*)
133c6b4a769Smrg		echo "Invalid configuration '$1': more than four components" >&2
1344e8f48c7Smrg		exit 1
135f1ee322dSmrg		;;
1364e8f48c7Smrg	*-*-*-*)
1374e8f48c7Smrg		basic_machine=$field1-$field2
1384e8f48c7Smrg		basic_os=$field3-$field4
139c43cc173Smrg		;;
1404e8f48c7Smrg	*-*-*)
1414e8f48c7Smrg		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
1424e8f48c7Smrg		# parts
1434e8f48c7Smrg		maybe_os=$field2-$field3
1444e8f48c7Smrg		case $maybe_os in
1454e8f48c7Smrg			nto-qnx* | linux-* | uclinux-uclibc* \
1464e8f48c7Smrg			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
1474e8f48c7Smrg			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
148c6b4a769Smrg			| storm-chaos* | os2-emx* | rtmk-nova* | managarm-*)
1494e8f48c7Smrg				basic_machine=$field1
1504e8f48c7Smrg				basic_os=$maybe_os
1514e8f48c7Smrg				;;
1524e8f48c7Smrg			android-linux)
1534e8f48c7Smrg				basic_machine=$field1-unknown
1544e8f48c7Smrg				basic_os=linux-android
1554e8f48c7Smrg				;;
1564e8f48c7Smrg			*)
1574e8f48c7Smrg				basic_machine=$field1-$field2
1584e8f48c7Smrg				basic_os=$field3
1594e8f48c7Smrg				;;
1604e8f48c7Smrg		esac
161c43cc173Smrg		;;
1624e8f48c7Smrg	*-*)
1634e8f48c7Smrg		# A lone config we happen to match not fitting any pattern
1644e8f48c7Smrg		case $field1-$field2 in
1654e8f48c7Smrg			decstation-3100)
1664e8f48c7Smrg				basic_machine=mips-dec
1674e8f48c7Smrg				basic_os=
1684e8f48c7Smrg				;;
1694e8f48c7Smrg			*-*)
1704e8f48c7Smrg				# Second component is usually, but not always the OS
1714e8f48c7Smrg				case $field2 in
1724e8f48c7Smrg					# Prevent following clause from handling this valid os
1734e8f48c7Smrg					sun*os*)
1744e8f48c7Smrg						basic_machine=$field1
1754e8f48c7Smrg						basic_os=$field2
1764e8f48c7Smrg						;;
1774e8f48c7Smrg					zephyr*)
1784e8f48c7Smrg						basic_machine=$field1-unknown
1794e8f48c7Smrg						basic_os=$field2
1804e8f48c7Smrg						;;
1814e8f48c7Smrg					# Manufacturers
1824e8f48c7Smrg					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
1834e8f48c7Smrg					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
1844e8f48c7Smrg					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
1854e8f48c7Smrg					| convergent* | ncr* | news | 32* | 3600* | 3100* \
1864e8f48c7Smrg					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
1874e8f48c7Smrg					| ultra | tti* | harris | dolphin | highlevel | gould \
1884e8f48c7Smrg					| cbm | ns | masscomp | apple | axis | knuth | cray \
1894e8f48c7Smrg					| microblaze* | sim | cisco \
1904e8f48c7Smrg					| oki | wec | wrs | winbond)
1914e8f48c7Smrg						basic_machine=$field1-$field2
1924e8f48c7Smrg						basic_os=
1934e8f48c7Smrg						;;
1944e8f48c7Smrg					*)
1954e8f48c7Smrg						basic_machine=$field1
1964e8f48c7Smrg						basic_os=$field2
1974e8f48c7Smrg						;;
1984e8f48c7Smrg				esac
1994e8f48c7Smrg			;;
2004e8f48c7Smrg		esac
201c43cc173Smrg		;;
2024e8f48c7Smrg	*)
2034e8f48c7Smrg		# Convert single-component short-hands not valid as part of
2044e8f48c7Smrg		# multi-component configurations.
2054e8f48c7Smrg		case $field1 in
2064e8f48c7Smrg			386bsd)
2074e8f48c7Smrg				basic_machine=i386-pc
2084e8f48c7Smrg				basic_os=bsd
2094e8f48c7Smrg				;;
2104e8f48c7Smrg			a29khif)
2114e8f48c7Smrg				basic_machine=a29k-amd
2124e8f48c7Smrg				basic_os=udi
2134e8f48c7Smrg				;;
2144e8f48c7Smrg			adobe68k)
2154e8f48c7Smrg				basic_machine=m68010-adobe
2164e8f48c7Smrg				basic_os=scout
2174e8f48c7Smrg				;;
2184e8f48c7Smrg			alliant)
2194e8f48c7Smrg				basic_machine=fx80-alliant
2204e8f48c7Smrg				basic_os=
2214e8f48c7Smrg				;;
2224e8f48c7Smrg			altos | altos3068)
2234e8f48c7Smrg				basic_machine=m68k-altos
2244e8f48c7Smrg				basic_os=
2254e8f48c7Smrg				;;
2264e8f48c7Smrg			am29k)
2274e8f48c7Smrg				basic_machine=a29k-none
2284e8f48c7Smrg				basic_os=bsd
2294e8f48c7Smrg				;;
2304e8f48c7Smrg			amdahl)
2314e8f48c7Smrg				basic_machine=580-amdahl
2324e8f48c7Smrg				basic_os=sysv
2334e8f48c7Smrg				;;
2344e8f48c7Smrg			amiga)
2354e8f48c7Smrg				basic_machine=m68k-unknown
2364e8f48c7Smrg				basic_os=
2374e8f48c7Smrg				;;
2384e8f48c7Smrg			amigaos | amigados)
2394e8f48c7Smrg				basic_machine=m68k-unknown
2404e8f48c7Smrg				basic_os=amigaos
2414e8f48c7Smrg				;;
2424e8f48c7Smrg			amigaunix | amix)
2434e8f48c7Smrg				basic_machine=m68k-unknown
2444e8f48c7Smrg				basic_os=sysv4
2454e8f48c7Smrg				;;
2464e8f48c7Smrg			apollo68)
2474e8f48c7Smrg				basic_machine=m68k-apollo
2484e8f48c7Smrg				basic_os=sysv
2494e8f48c7Smrg				;;
2504e8f48c7Smrg			apollo68bsd)
2514e8f48c7Smrg				basic_machine=m68k-apollo
2524e8f48c7Smrg				basic_os=bsd
2534e8f48c7Smrg				;;
2544e8f48c7Smrg			aros)
2554e8f48c7Smrg				basic_machine=i386-pc
2564e8f48c7Smrg				basic_os=aros
2574e8f48c7Smrg				;;
2584e8f48c7Smrg			aux)
2594e8f48c7Smrg				basic_machine=m68k-apple
2604e8f48c7Smrg				basic_os=aux
2614e8f48c7Smrg				;;
2624e8f48c7Smrg			balance)
2634e8f48c7Smrg				basic_machine=ns32k-sequent
2644e8f48c7Smrg				basic_os=dynix
2654e8f48c7Smrg				;;
2664e8f48c7Smrg			blackfin)
2674e8f48c7Smrg				basic_machine=bfin-unknown
2684e8f48c7Smrg				basic_os=linux
2694e8f48c7Smrg				;;
2704e8f48c7Smrg			cegcc)
2714e8f48c7Smrg				basic_machine=arm-unknown
2724e8f48c7Smrg				basic_os=cegcc
2734e8f48c7Smrg				;;
2744e8f48c7Smrg			convex-c1)
2754e8f48c7Smrg				basic_machine=c1-convex
2764e8f48c7Smrg				basic_os=bsd
2774e8f48c7Smrg				;;
2784e8f48c7Smrg			convex-c2)
2794e8f48c7Smrg				basic_machine=c2-convex
2804e8f48c7Smrg				basic_os=bsd
2814e8f48c7Smrg				;;
2824e8f48c7Smrg			convex-c32)
2834e8f48c7Smrg				basic_machine=c32-convex
2844e8f48c7Smrg				basic_os=bsd
2854e8f48c7Smrg				;;
2864e8f48c7Smrg			convex-c34)
2874e8f48c7Smrg				basic_machine=c34-convex
2884e8f48c7Smrg				basic_os=bsd
2894e8f48c7Smrg				;;
2904e8f48c7Smrg			convex-c38)
2914e8f48c7Smrg				basic_machine=c38-convex
2924e8f48c7Smrg				basic_os=bsd
2934e8f48c7Smrg				;;
2944e8f48c7Smrg			cray)
2954e8f48c7Smrg				basic_machine=j90-cray
2964e8f48c7Smrg				basic_os=unicos
2974e8f48c7Smrg				;;
2984e8f48c7Smrg			crds | unos)
2994e8f48c7Smrg				basic_machine=m68k-crds
3004e8f48c7Smrg				basic_os=
3014e8f48c7Smrg				;;
3024e8f48c7Smrg			da30)
3034e8f48c7Smrg				basic_machine=m68k-da30
3044e8f48c7Smrg				basic_os=
3054e8f48c7Smrg				;;
3064e8f48c7Smrg			decstation | pmax | pmin | dec3100 | decstatn)
3074e8f48c7Smrg				basic_machine=mips-dec
3084e8f48c7Smrg				basic_os=
3094e8f48c7Smrg				;;
3104e8f48c7Smrg			delta88)
3114e8f48c7Smrg				basic_machine=m88k-motorola
3124e8f48c7Smrg				basic_os=sysv3
3134e8f48c7Smrg				;;
3144e8f48c7Smrg			dicos)
3154e8f48c7Smrg				basic_machine=i686-pc
3164e8f48c7Smrg				basic_os=dicos
3174e8f48c7Smrg				;;
3184e8f48c7Smrg			djgpp)
3194e8f48c7Smrg				basic_machine=i586-pc
3204e8f48c7Smrg				basic_os=msdosdjgpp
3214e8f48c7Smrg				;;
3224e8f48c7Smrg			ebmon29k)
3234e8f48c7Smrg				basic_machine=a29k-amd
3244e8f48c7Smrg				basic_os=ebmon
3254e8f48c7Smrg				;;
3264e8f48c7Smrg			es1800 | OSE68k | ose68k | ose | OSE)
3274e8f48c7Smrg				basic_machine=m68k-ericsson
3284e8f48c7Smrg				basic_os=ose
3294e8f48c7Smrg				;;
3304e8f48c7Smrg			gmicro)
3314e8f48c7Smrg				basic_machine=tron-gmicro
3324e8f48c7Smrg				basic_os=sysv
3334e8f48c7Smrg				;;
3344e8f48c7Smrg			go32)
3354e8f48c7Smrg				basic_machine=i386-pc
3364e8f48c7Smrg				basic_os=go32
3374e8f48c7Smrg				;;
3384e8f48c7Smrg			h8300hms)
3394e8f48c7Smrg				basic_machine=h8300-hitachi
3404e8f48c7Smrg				basic_os=hms
3414e8f48c7Smrg				;;
3424e8f48c7Smrg			h8300xray)
3434e8f48c7Smrg				basic_machine=h8300-hitachi
3444e8f48c7Smrg				basic_os=xray
3454e8f48c7Smrg				;;
3464e8f48c7Smrg			h8500hms)
3474e8f48c7Smrg				basic_machine=h8500-hitachi
3484e8f48c7Smrg				basic_os=hms
3494e8f48c7Smrg				;;
3504e8f48c7Smrg			harris)
3514e8f48c7Smrg				basic_machine=m88k-harris
3524e8f48c7Smrg				basic_os=sysv3
3534e8f48c7Smrg				;;
3544e8f48c7Smrg			hp300 | hp300hpux)
3554e8f48c7Smrg				basic_machine=m68k-hp
3564e8f48c7Smrg				basic_os=hpux
3574e8f48c7Smrg				;;
3584e8f48c7Smrg			hp300bsd)
3594e8f48c7Smrg				basic_machine=m68k-hp
3604e8f48c7Smrg				basic_os=bsd
3614e8f48c7Smrg				;;
3624e8f48c7Smrg			hppaosf)
3634e8f48c7Smrg				basic_machine=hppa1.1-hp
3644e8f48c7Smrg				basic_os=osf
3654e8f48c7Smrg				;;
3664e8f48c7Smrg			hppro)
3674e8f48c7Smrg				basic_machine=hppa1.1-hp
3684e8f48c7Smrg				basic_os=proelf
3694e8f48c7Smrg				;;
3704e8f48c7Smrg			i386mach)
3714e8f48c7Smrg				basic_machine=i386-mach
3724e8f48c7Smrg				basic_os=mach
3734e8f48c7Smrg				;;
3744e8f48c7Smrg			isi68 | isi)
3754e8f48c7Smrg				basic_machine=m68k-isi
3764e8f48c7Smrg				basic_os=sysv
3774e8f48c7Smrg				;;
3784e8f48c7Smrg			m68knommu)
3794e8f48c7Smrg				basic_machine=m68k-unknown
3804e8f48c7Smrg				basic_os=linux
3814e8f48c7Smrg				;;
3824e8f48c7Smrg			magnum | m3230)
3834e8f48c7Smrg				basic_machine=mips-mips
3844e8f48c7Smrg				basic_os=sysv
3854e8f48c7Smrg				;;
3864e8f48c7Smrg			merlin)
3874e8f48c7Smrg				basic_machine=ns32k-utek
3884e8f48c7Smrg				basic_os=sysv
3894e8f48c7Smrg				;;
3904e8f48c7Smrg			mingw64)
3914e8f48c7Smrg				basic_machine=x86_64-pc
3924e8f48c7Smrg				basic_os=mingw64
3934e8f48c7Smrg				;;
3944e8f48c7Smrg			mingw32)
3954e8f48c7Smrg				basic_machine=i686-pc
3964e8f48c7Smrg				basic_os=mingw32
3974e8f48c7Smrg				;;
3984e8f48c7Smrg			mingw32ce)
3994e8f48c7Smrg				basic_machine=arm-unknown
4004e8f48c7Smrg				basic_os=mingw32ce
4014e8f48c7Smrg				;;
4024e8f48c7Smrg			monitor)
4034e8f48c7Smrg				basic_machine=m68k-rom68k
4044e8f48c7Smrg				basic_os=coff
4054e8f48c7Smrg				;;
4064e8f48c7Smrg			morphos)
4074e8f48c7Smrg				basic_machine=powerpc-unknown
4084e8f48c7Smrg				basic_os=morphos
4094e8f48c7Smrg				;;
4104e8f48c7Smrg			moxiebox)
4114e8f48c7Smrg				basic_machine=moxie-unknown
4124e8f48c7Smrg				basic_os=moxiebox
4134e8f48c7Smrg				;;
4144e8f48c7Smrg			msdos)
4154e8f48c7Smrg				basic_machine=i386-pc
4164e8f48c7Smrg				basic_os=msdos
4174e8f48c7Smrg				;;
4184e8f48c7Smrg			msys)
4194e8f48c7Smrg				basic_machine=i686-pc
4204e8f48c7Smrg				basic_os=msys
4214e8f48c7Smrg				;;
4224e8f48c7Smrg			mvs)
4234e8f48c7Smrg				basic_machine=i370-ibm
4244e8f48c7Smrg				basic_os=mvs
4254e8f48c7Smrg				;;
4264e8f48c7Smrg			nacl)
4274e8f48c7Smrg				basic_machine=le32-unknown
4284e8f48c7Smrg				basic_os=nacl
4294e8f48c7Smrg				;;
4304e8f48c7Smrg			ncr3000)
4314e8f48c7Smrg				basic_machine=i486-ncr
4324e8f48c7Smrg				basic_os=sysv4
4334e8f48c7Smrg				;;
4344e8f48c7Smrg			netbsd386)
4354e8f48c7Smrg				basic_machine=i386-pc
4364e8f48c7Smrg				basic_os=netbsd
4374e8f48c7Smrg				;;
4384e8f48c7Smrg			netwinder)
4394e8f48c7Smrg				basic_machine=armv4l-rebel
4404e8f48c7Smrg				basic_os=linux
4414e8f48c7Smrg				;;
4424e8f48c7Smrg			news | news700 | news800 | news900)
4434e8f48c7Smrg				basic_machine=m68k-sony
4444e8f48c7Smrg				basic_os=newsos
4454e8f48c7Smrg				;;
4464e8f48c7Smrg			news1000)
4474e8f48c7Smrg				basic_machine=m68030-sony
4484e8f48c7Smrg				basic_os=newsos
4494e8f48c7Smrg				;;
4504e8f48c7Smrg			necv70)
4514e8f48c7Smrg				basic_machine=v70-nec
4524e8f48c7Smrg				basic_os=sysv
4534e8f48c7Smrg				;;
4544e8f48c7Smrg			nh3000)
4554e8f48c7Smrg				basic_machine=m68k-harris
4564e8f48c7Smrg				basic_os=cxux
4574e8f48c7Smrg				;;
4584e8f48c7Smrg			nh[45]000)
4594e8f48c7Smrg				basic_machine=m88k-harris
4604e8f48c7Smrg				basic_os=cxux
4614e8f48c7Smrg				;;
4624e8f48c7Smrg			nindy960)
4634e8f48c7Smrg				basic_machine=i960-intel
4644e8f48c7Smrg				basic_os=nindy
4654e8f48c7Smrg				;;
4664e8f48c7Smrg			mon960)
4674e8f48c7Smrg				basic_machine=i960-intel
4684e8f48c7Smrg				basic_os=mon960
4694e8f48c7Smrg				;;
4704e8f48c7Smrg			nonstopux)
4714e8f48c7Smrg				basic_machine=mips-compaq
4724e8f48c7Smrg				basic_os=nonstopux
4734e8f48c7Smrg				;;
4744e8f48c7Smrg			os400)
4754e8f48c7Smrg				basic_machine=powerpc-ibm
4764e8f48c7Smrg				basic_os=os400
4774e8f48c7Smrg				;;
4784e8f48c7Smrg			OSE68000 | ose68000)
4794e8f48c7Smrg				basic_machine=m68000-ericsson
4804e8f48c7Smrg				basic_os=ose
4814e8f48c7Smrg				;;
4824e8f48c7Smrg			os68k)
4834e8f48c7Smrg				basic_machine=m68k-none
4844e8f48c7Smrg				basic_os=os68k
4854e8f48c7Smrg				;;
4864e8f48c7Smrg			paragon)
4874e8f48c7Smrg				basic_machine=i860-intel
4884e8f48c7Smrg				basic_os=osf
4894e8f48c7Smrg				;;
4904e8f48c7Smrg			parisc)
4914e8f48c7Smrg				basic_machine=hppa-unknown
4924e8f48c7Smrg				basic_os=linux
4934e8f48c7Smrg				;;
4944e8f48c7Smrg			psp)
4954e8f48c7Smrg				basic_machine=mipsallegrexel-sony
4964e8f48c7Smrg				basic_os=psp
4974e8f48c7Smrg				;;
4984e8f48c7Smrg			pw32)
4994e8f48c7Smrg				basic_machine=i586-unknown
5004e8f48c7Smrg				basic_os=pw32
5014e8f48c7Smrg				;;
5024e8f48c7Smrg			rdos | rdos64)
5034e8f48c7Smrg				basic_machine=x86_64-pc
5044e8f48c7Smrg				basic_os=rdos
5054e8f48c7Smrg				;;
5064e8f48c7Smrg			rdos32)
5074e8f48c7Smrg				basic_machine=i386-pc
5084e8f48c7Smrg				basic_os=rdos
5094e8f48c7Smrg				;;
5104e8f48c7Smrg			rom68k)
5114e8f48c7Smrg				basic_machine=m68k-rom68k
5124e8f48c7Smrg				basic_os=coff
5134e8f48c7Smrg				;;
5144e8f48c7Smrg			sa29200)
5154e8f48c7Smrg				basic_machine=a29k-amd
5164e8f48c7Smrg				basic_os=udi
5174e8f48c7Smrg				;;
5184e8f48c7Smrg			sei)
5194e8f48c7Smrg				basic_machine=mips-sei
5204e8f48c7Smrg				basic_os=seiux
5214e8f48c7Smrg				;;
5224e8f48c7Smrg			sequent)
5234e8f48c7Smrg				basic_machine=i386-sequent
5244e8f48c7Smrg				basic_os=
5254e8f48c7Smrg				;;
5264e8f48c7Smrg			sps7)
5274e8f48c7Smrg				basic_machine=m68k-bull
5284e8f48c7Smrg				basic_os=sysv2
5294e8f48c7Smrg				;;
5304e8f48c7Smrg			st2000)
5314e8f48c7Smrg				basic_machine=m68k-tandem
5324e8f48c7Smrg				basic_os=
5334e8f48c7Smrg				;;
5344e8f48c7Smrg			stratus)
5354e8f48c7Smrg				basic_machine=i860-stratus
5364e8f48c7Smrg				basic_os=sysv4
5374e8f48c7Smrg				;;
5384e8f48c7Smrg			sun2)
5394e8f48c7Smrg				basic_machine=m68000-sun
5404e8f48c7Smrg				basic_os=
5414e8f48c7Smrg				;;
5424e8f48c7Smrg			sun2os3)
5434e8f48c7Smrg				basic_machine=m68000-sun
5444e8f48c7Smrg				basic_os=sunos3
5454e8f48c7Smrg				;;
5464e8f48c7Smrg			sun2os4)
5474e8f48c7Smrg				basic_machine=m68000-sun
5484e8f48c7Smrg				basic_os=sunos4
5494e8f48c7Smrg				;;
5504e8f48c7Smrg			sun3)
5514e8f48c7Smrg				basic_machine=m68k-sun
5524e8f48c7Smrg				basic_os=
5534e8f48c7Smrg				;;
5544e8f48c7Smrg			sun3os3)
5554e8f48c7Smrg				basic_machine=m68k-sun
5564e8f48c7Smrg				basic_os=sunos3
5574e8f48c7Smrg				;;
5584e8f48c7Smrg			sun3os4)
5594e8f48c7Smrg				basic_machine=m68k-sun
5604e8f48c7Smrg				basic_os=sunos4
5614e8f48c7Smrg				;;
5624e8f48c7Smrg			sun4)
5634e8f48c7Smrg				basic_machine=sparc-sun
5644e8f48c7Smrg				basic_os=
5654e8f48c7Smrg				;;
5664e8f48c7Smrg			sun4os3)
5674e8f48c7Smrg				basic_machine=sparc-sun
5684e8f48c7Smrg				basic_os=sunos3
5694e8f48c7Smrg				;;
5704e8f48c7Smrg			sun4os4)
5714e8f48c7Smrg				basic_machine=sparc-sun
5724e8f48c7Smrg				basic_os=sunos4
5734e8f48c7Smrg				;;
5744e8f48c7Smrg			sun4sol2)
5754e8f48c7Smrg				basic_machine=sparc-sun
5764e8f48c7Smrg				basic_os=solaris2
5774e8f48c7Smrg				;;
5784e8f48c7Smrg			sun386 | sun386i | roadrunner)
5794e8f48c7Smrg				basic_machine=i386-sun
5804e8f48c7Smrg				basic_os=
5814e8f48c7Smrg				;;
5824e8f48c7Smrg			sv1)
5834e8f48c7Smrg				basic_machine=sv1-cray
5844e8f48c7Smrg				basic_os=unicos
5854e8f48c7Smrg				;;
5864e8f48c7Smrg			symmetry)
5874e8f48c7Smrg				basic_machine=i386-sequent
5884e8f48c7Smrg				basic_os=dynix
5894e8f48c7Smrg				;;
5904e8f48c7Smrg			t3e)
5914e8f48c7Smrg				basic_machine=alphaev5-cray
5924e8f48c7Smrg				basic_os=unicos
5934e8f48c7Smrg				;;
5944e8f48c7Smrg			t90)
5954e8f48c7Smrg				basic_machine=t90-cray
5964e8f48c7Smrg				basic_os=unicos
5974e8f48c7Smrg				;;
5984e8f48c7Smrg			toad1)
5994e8f48c7Smrg				basic_machine=pdp10-xkl
6004e8f48c7Smrg				basic_os=tops20
6014e8f48c7Smrg				;;
6024e8f48c7Smrg			tpf)
6034e8f48c7Smrg				basic_machine=s390x-ibm
6044e8f48c7Smrg				basic_os=tpf
6054e8f48c7Smrg				;;
6064e8f48c7Smrg			udi29k)
6074e8f48c7Smrg				basic_machine=a29k-amd
6084e8f48c7Smrg				basic_os=udi
6094e8f48c7Smrg				;;
6104e8f48c7Smrg			ultra3)
6114e8f48c7Smrg				basic_machine=a29k-nyu
6124e8f48c7Smrg				basic_os=sym1
6134e8f48c7Smrg				;;
6144e8f48c7Smrg			v810 | necv810)
6154e8f48c7Smrg				basic_machine=v810-nec
6164e8f48c7Smrg				basic_os=none
6174e8f48c7Smrg				;;
6184e8f48c7Smrg			vaxv)
6194e8f48c7Smrg				basic_machine=vax-dec
6204e8f48c7Smrg				basic_os=sysv
6214e8f48c7Smrg				;;
6224e8f48c7Smrg			vms)
6234e8f48c7Smrg				basic_machine=vax-dec
6244e8f48c7Smrg				basic_os=vms
6254e8f48c7Smrg				;;
6264e8f48c7Smrg			vsta)
6274e8f48c7Smrg				basic_machine=i386-pc
6284e8f48c7Smrg				basic_os=vsta
6294e8f48c7Smrg				;;
6304e8f48c7Smrg			vxworks960)
6314e8f48c7Smrg				basic_machine=i960-wrs
6324e8f48c7Smrg				basic_os=vxworks
6334e8f48c7Smrg				;;
6344e8f48c7Smrg			vxworks68)
6354e8f48c7Smrg				basic_machine=m68k-wrs
6364e8f48c7Smrg				basic_os=vxworks
6374e8f48c7Smrg				;;
6384e8f48c7Smrg			vxworks29k)
6394e8f48c7Smrg				basic_machine=a29k-wrs
6404e8f48c7Smrg				basic_os=vxworks
6414e8f48c7Smrg				;;
6424e8f48c7Smrg			xbox)
6434e8f48c7Smrg				basic_machine=i686-pc
6444e8f48c7Smrg				basic_os=mingw32
6454e8f48c7Smrg				;;
6464e8f48c7Smrg			ymp)
6474e8f48c7Smrg				basic_machine=ymp-cray
6484e8f48c7Smrg				basic_os=unicos
6494e8f48c7Smrg				;;
6504e8f48c7Smrg			*)
6514e8f48c7Smrg				basic_machine=$1
6524e8f48c7Smrg				basic_os=
6534e8f48c7Smrg				;;
6544e8f48c7Smrg		esac
655c43cc173Smrg		;;
656c43cc173Smrgesac
657c43cc173Smrg
6584e8f48c7Smrg# Decode 1-component or ad-hoc basic machines
659c43cc173Smrgcase $basic_machine in
6604e8f48c7Smrg	# Here we handle the default manufacturer of certain CPU types.  It is in
6614e8f48c7Smrg	# some cases the only manufacturer, in others, it is the most popular.
6624e8f48c7Smrg	w89k)
6634e8f48c7Smrg		cpu=hppa1.1
6644e8f48c7Smrg		vendor=winbond
665c43cc173Smrg		;;
6664e8f48c7Smrg	op50n)
6674e8f48c7Smrg		cpu=hppa1.1
6684e8f48c7Smrg		vendor=oki
669c43cc173Smrg		;;
6704e8f48c7Smrg	op60c)
6714e8f48c7Smrg		cpu=hppa1.1
6724e8f48c7Smrg		vendor=oki
67321e67964Smrg		;;
6744e8f48c7Smrg	ibm*)
6754e8f48c7Smrg		cpu=i370
6764e8f48c7Smrg		vendor=ibm
677f1ee322dSmrg		;;
6784e8f48c7Smrg	orion105)
6794e8f48c7Smrg		cpu=clipper
6804e8f48c7Smrg		vendor=highlevel
681f1ee322dSmrg		;;
6824e8f48c7Smrg	mac | mpw | mac-mpw)
6834e8f48c7Smrg		cpu=m68k
6844e8f48c7Smrg		vendor=apple
685f1ee322dSmrg		;;
6864e8f48c7Smrg	pmac | pmac-mpw)
6874e8f48c7Smrg		cpu=powerpc
6884e8f48c7Smrg		vendor=apple
689f1ee322dSmrg		;;
690f1ee322dSmrg
691c43cc173Smrg	# Recognize the various machine names and aliases which stand
692c43cc173Smrg	# for a CPU type and a company and sometimes even an OS.
693c43cc173Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
6944e8f48c7Smrg		cpu=m68000
6954e8f48c7Smrg		vendor=att
696c43cc173Smrg		;;
697c43cc173Smrg	3b*)
6984e8f48c7Smrg		cpu=we32k
6994e8f48c7Smrg		vendor=att
700c27c18e8Smrg		;;
7013e256790Smrg	bluegene*)
7024e8f48c7Smrg		cpu=powerpc
7034e8f48c7Smrg		vendor=ibm
7044e8f48c7Smrg		basic_os=cnk
705c43cc173Smrg		;;
706c43cc173Smrg	decsystem10* | dec10*)
7074e8f48c7Smrg		cpu=pdp10
7084e8f48c7Smrg		vendor=dec
7094e8f48c7Smrg		basic_os=tops10
710c43cc173Smrg		;;
711c43cc173Smrg	decsystem20* | dec20*)
7124e8f48c7Smrg		cpu=pdp10
7134e8f48c7Smrg		vendor=dec
7144e8f48c7Smrg		basic_os=tops20
715c43cc173Smrg		;;
716c43cc173Smrg	delta | 3300 | motorola-3300 | motorola-delta \
717c43cc173Smrg	      | 3300-motorola | delta-motorola)
7184e8f48c7Smrg		cpu=m68k
7194e8f48c7Smrg		vendor=motorola
720c43cc173Smrg		;;
72187404ef7Smrg	dpx2*)
7224e8f48c7Smrg		cpu=m68k
7234e8f48c7Smrg		vendor=bull
7244e8f48c7Smrg		basic_os=sysv3
725c43cc173Smrg		;;
726c43cc173Smrg	encore | umax | mmax)
7274e8f48c7Smrg		cpu=ns32k
7284e8f48c7Smrg		vendor=encore
729c43cc173Smrg		;;
7304e8f48c7Smrg	elxsi)
7314e8f48c7Smrg		cpu=elxsi
7324e8f48c7Smrg		vendor=elxsi
7334e8f48c7Smrg		basic_os=${basic_os:-bsd}
734c43cc173Smrg		;;
735c43cc173Smrg	fx2800)
7364e8f48c7Smrg		cpu=i860
7374e8f48c7Smrg		vendor=alliant
738c43cc173Smrg		;;
739c43cc173Smrg	genix)
7404e8f48c7Smrg		cpu=ns32k
7414e8f48c7Smrg		vendor=ns
742c43cc173Smrg		;;
743c43cc173Smrg	h3050r* | hiux*)
7444e8f48c7Smrg		cpu=hppa1.1
7454e8f48c7Smrg		vendor=hitachi
7464e8f48c7Smrg		basic_os=hiuxwe2
747c43cc173Smrg		;;
748c43cc173Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
7494e8f48c7Smrg		cpu=hppa1.0
7504e8f48c7Smrg		vendor=hp
751c43cc173Smrg		;;
752c43cc173Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
7534e8f48c7Smrg		cpu=m68000
7544e8f48c7Smrg		vendor=hp
755c43cc173Smrg		;;
756c43cc173Smrg	hp9k3[2-9][0-9])
7574e8f48c7Smrg		cpu=m68k
7584e8f48c7Smrg		vendor=hp
759c43cc173Smrg		;;
760c43cc173Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
7614e8f48c7Smrg		cpu=hppa1.0
7624e8f48c7Smrg		vendor=hp
763c43cc173Smrg		;;
764c43cc173Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
7654e8f48c7Smrg		cpu=hppa1.1
7664e8f48c7Smrg		vendor=hp
767c43cc173Smrg		;;
768c43cc173Smrg	hp9k78[0-9] | hp78[0-9])
769c43cc173Smrg		# FIXME: really hppa2.0-hp
7704e8f48c7Smrg		cpu=hppa1.1
7714e8f48c7Smrg		vendor=hp
772c43cc173Smrg		;;
773c43cc173Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
774c43cc173Smrg		# FIXME: really hppa2.0-hp
7754e8f48c7Smrg		cpu=hppa1.1
7764e8f48c7Smrg		vendor=hp
777c43cc173Smrg		;;
778c43cc173Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
7794e8f48c7Smrg		cpu=hppa1.1
7804e8f48c7Smrg		vendor=hp
781c43cc173Smrg		;;
782c43cc173Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7834e8f48c7Smrg		cpu=hppa1.0
7844e8f48c7Smrg		vendor=hp
785c43cc173Smrg		;;
786c43cc173Smrg	i*86v32)
7874e8f48c7Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
7884e8f48c7Smrg		vendor=pc
7894e8f48c7Smrg		basic_os=sysv32
790c43cc173Smrg		;;
791c43cc173Smrg	i*86v4*)
7924e8f48c7Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
7934e8f48c7Smrg		vendor=pc
7944e8f48c7Smrg		basic_os=sysv4
795c43cc173Smrg		;;
796c43cc173Smrg	i*86v)
7974e8f48c7Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
7984e8f48c7Smrg		vendor=pc
7994e8f48c7Smrg		basic_os=sysv
800c43cc173Smrg		;;
801c43cc173Smrg	i*86sol2)
8024e8f48c7Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
8034e8f48c7Smrg		vendor=pc
8044e8f48c7Smrg		basic_os=solaris2
805c43cc173Smrg		;;
8064e8f48c7Smrg	j90 | j90-cray)
8074e8f48c7Smrg		cpu=j90
8084e8f48c7Smrg		vendor=cray
8094e8f48c7Smrg		basic_os=${basic_os:-unicos}
810c43cc173Smrg		;;
811c43cc173Smrg	iris | iris4d)
8124e8f48c7Smrg		cpu=mips
8134e8f48c7Smrg		vendor=sgi
8144e8f48c7Smrg		case $basic_os in
8154e8f48c7Smrg		    irix*)
816c43cc173Smrg			;;
817c43cc173Smrg		    *)
8184e8f48c7Smrg			basic_os=irix4
819c43cc173Smrg			;;
820c43cc173Smrg		esac
821c43cc173Smrg		;;
822c43cc173Smrg	miniframe)
8234e8f48c7Smrg		cpu=m68000
8244e8f48c7Smrg		vendor=convergent
82548e5ce07Smrg		;;
8264e8f48c7Smrg	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
8274e8f48c7Smrg		cpu=m68k
8284e8f48c7Smrg		vendor=atari
8294e8f48c7Smrg		basic_os=mint
830c43cc173Smrg		;;
831c43cc173Smrg	news-3600 | risc-news)
8324e8f48c7Smrg		cpu=mips
8334e8f48c7Smrg		vendor=sony
8344e8f48c7Smrg		basic_os=newsos
835c43cc173Smrg		;;
83687404ef7Smrg	next | m*-next)
8374e8f48c7Smrg		cpu=m68k
8384e8f48c7Smrg		vendor=next
8394e8f48c7Smrg		case $basic_os in
8404e8f48c7Smrg		    openstep*)
8414e8f48c7Smrg		        ;;
8424e8f48c7Smrg		    nextstep*)
843c43cc173Smrg			;;
8444e8f48c7Smrg		    ns2*)
8454e8f48c7Smrg		      basic_os=nextstep2
846c43cc173Smrg			;;
847c43cc173Smrg		    *)
8484e8f48c7Smrg		      basic_os=nextstep3
849c43cc173Smrg			;;
850c43cc173Smrg		esac
851c43cc173Smrg		;;
852c43cc173Smrg	np1)
8534e8f48c7Smrg		cpu=np1
8544e8f48c7Smrg		vendor=gould
85587404ef7Smrg		;;
856c43cc173Smrg	op50n-* | op60c-*)
8574e8f48c7Smrg		cpu=hppa1.1
8584e8f48c7Smrg		vendor=oki
8594e8f48c7Smrg		basic_os=proelf
860c43cc173Smrg		;;
861c43cc173Smrg	pa-hitachi)
8624e8f48c7Smrg		cpu=hppa1.1
8634e8f48c7Smrg		vendor=hitachi
8644e8f48c7Smrg		basic_os=hiuxwe2
865c27c18e8Smrg		;;
866c43cc173Smrg	pbd)
8674e8f48c7Smrg		cpu=sparc
8684e8f48c7Smrg		vendor=tti
869c43cc173Smrg		;;
870c43cc173Smrg	pbb)
8714e8f48c7Smrg		cpu=m68k
8724e8f48c7Smrg		vendor=tti
87321e67964Smrg		;;
8744e8f48c7Smrg	pc532)
8754e8f48c7Smrg		cpu=ns32k
8764e8f48c7Smrg		vendor=pc532
877c43cc173Smrg		;;
878c43cc173Smrg	pn)
8794e8f48c7Smrg		cpu=pn
8804e8f48c7Smrg		vendor=gould
881c43cc173Smrg		;;
8824e8f48c7Smrg	power)
8834e8f48c7Smrg		cpu=power
8844e8f48c7Smrg		vendor=ibm
885c43cc173Smrg		;;
8864e8f48c7Smrg	ps2)
8874e8f48c7Smrg		cpu=i386
8884e8f48c7Smrg		vendor=ibm
889c43cc173Smrg		;;
8904e8f48c7Smrg	rm[46]00)
8914e8f48c7Smrg		cpu=mips
8924e8f48c7Smrg		vendor=siemens
893c43cc173Smrg		;;
8944e8f48c7Smrg	rtpc | rtpc-*)
8954e8f48c7Smrg		cpu=romp
8964e8f48c7Smrg		vendor=ibm
897c43cc173Smrg		;;
8984e8f48c7Smrg	sde)
8994e8f48c7Smrg		cpu=mipsisa32
9004e8f48c7Smrg		vendor=sde
9014e8f48c7Smrg		basic_os=${basic_os:-elf}
902c43cc173Smrg		;;
9034e8f48c7Smrg	simso-wrs)
9044e8f48c7Smrg		cpu=sparclite
9054e8f48c7Smrg		vendor=wrs
9064e8f48c7Smrg		basic_os=vxworks
907c43cc173Smrg		;;
9084e8f48c7Smrg	tower | tower-32)
9094e8f48c7Smrg		cpu=m68k
9104e8f48c7Smrg		vendor=ncr
911c43cc173Smrg		;;
9124e8f48c7Smrg	vpp*|vx|vx-*)
9134e8f48c7Smrg		cpu=f301
9144e8f48c7Smrg		vendor=fujitsu
915c43cc173Smrg		;;
9164e8f48c7Smrg	w65)
9174e8f48c7Smrg		cpu=w65
9184e8f48c7Smrg		vendor=wdc
91906c34b88Smrg		;;
9204e8f48c7Smrg	w89k-*)
9214e8f48c7Smrg		cpu=hppa1.1
9224e8f48c7Smrg		vendor=winbond
9234e8f48c7Smrg		basic_os=proelf
92421e67964Smrg		;;
9254e8f48c7Smrg	none)
9264e8f48c7Smrg		cpu=none
9274e8f48c7Smrg		vendor=none
928c43cc173Smrg		;;
9294e8f48c7Smrg	leon|leon[3-9])
9304e8f48c7Smrg		cpu=sparc
9314e8f48c7Smrg		vendor=$basic_machine
932c43cc173Smrg		;;
9334e8f48c7Smrg	leon-*|leon[3-9]-*)
9344e8f48c7Smrg		cpu=sparc
9354e8f48c7Smrg		vendor=`echo "$basic_machine" | sed 's/-.*//'`
936c43cc173Smrg		;;
9374e8f48c7Smrg
9384e8f48c7Smrg	*-*)
9394e8f48c7Smrg		# shellcheck disable=SC2162
9404e8f48c7Smrg		saved_IFS=$IFS
9414e8f48c7Smrg		IFS="-" read cpu vendor <<EOF
9424e8f48c7Smrg$basic_machine
9434e8f48c7SmrgEOF
9444e8f48c7Smrg		IFS=$saved_IFS
945c43cc173Smrg		;;
946c6b4a769Smrg	# We use 'pc' rather than 'unknown'
9474e8f48c7Smrg	# because (1) that's what they normally are, and
9484e8f48c7Smrg	# (2) the word "unknown" tends to confuse beginning users.
9494e8f48c7Smrg	i*86 | x86_64)
9504e8f48c7Smrg		cpu=$basic_machine
9514e8f48c7Smrg		vendor=pc
952c43cc173Smrg		;;
9534e8f48c7Smrg	# These rules are duplicated from below for sake of the special case above;
9544e8f48c7Smrg	# i.e. things that normalized to x86 arches should also default to "pc"
9554e8f48c7Smrg	pc98)
9564e8f48c7Smrg		cpu=i386
9574e8f48c7Smrg		vendor=pc
958c43cc173Smrg		;;
9594e8f48c7Smrg	x64 | amd64)
9604e8f48c7Smrg		cpu=x86_64
9614e8f48c7Smrg		vendor=pc
962c43cc173Smrg		;;
9634e8f48c7Smrg	# Recognize the basic CPU types without company name.
9644e8f48c7Smrg	*)
9654e8f48c7Smrg		cpu=$basic_machine
9664e8f48c7Smrg		vendor=unknown
967c43cc173Smrg		;;
9684e8f48c7Smrgesac
9694e8f48c7Smrg
9704e8f48c7Smrgunset -v basic_machine
9714e8f48c7Smrg
9724e8f48c7Smrg# Decode basic machines in the full and proper CPU-Company form.
9734e8f48c7Smrgcase $cpu-$vendor in
9744e8f48c7Smrg	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
9754e8f48c7Smrg	# some cases the only manufacturer, in others, it is the most popular.
9764e8f48c7Smrg	craynv-unknown)
9774e8f48c7Smrg		vendor=cray
9784e8f48c7Smrg		basic_os=${basic_os:-unicosmp}
97921e67964Smrg		;;
9804e8f48c7Smrg	c90-unknown | c90-cray)
9814e8f48c7Smrg		vendor=cray
9824e8f48c7Smrg		basic_os=${Basic_os:-unicos}
983c43cc173Smrg		;;
9844e8f48c7Smrg	fx80-unknown)
9854e8f48c7Smrg		vendor=alliant
986c43cc173Smrg		;;
9874e8f48c7Smrg	romp-unknown)
9884e8f48c7Smrg		vendor=ibm
98921e67964Smrg		;;
9904e8f48c7Smrg	mmix-unknown)
9914e8f48c7Smrg		vendor=knuth
992c43cc173Smrg		;;
9934e8f48c7Smrg	microblaze-unknown | microblazeel-unknown)
9944e8f48c7Smrg		vendor=xilinx
995c43cc173Smrg		;;
9964e8f48c7Smrg	rs6000-unknown)
9974e8f48c7Smrg		vendor=ibm
998c43cc173Smrg		;;
9994e8f48c7Smrg	vax-unknown)
10004e8f48c7Smrg		vendor=dec
1001c43cc173Smrg		;;
10024e8f48c7Smrg	pdp11-unknown)
10034e8f48c7Smrg		vendor=dec
1004c43cc173Smrg		;;
10054e8f48c7Smrg	we32k-unknown)
10064e8f48c7Smrg		vendor=att
1007f1ee322dSmrg		;;
10084e8f48c7Smrg	cydra-unknown)
10094e8f48c7Smrg		vendor=cydrome
1010c43cc173Smrg		;;
10114e8f48c7Smrg	i370-ibm*)
10124e8f48c7Smrg		vendor=ibm
1013c43cc173Smrg		;;
10144e8f48c7Smrg	orion-unknown)
10154e8f48c7Smrg		vendor=highlevel
1016c43cc173Smrg		;;
10174e8f48c7Smrg	xps-unknown | xps100-unknown)
10184e8f48c7Smrg		cpu=xps100
10194e8f48c7Smrg		vendor=honeywell
1020c43cc173Smrg		;;
10214e8f48c7Smrg
10224e8f48c7Smrg	# Here we normalize CPU types with a missing or matching vendor
10234e8f48c7Smrg	armh-unknown | armh-alt)
10244e8f48c7Smrg		cpu=armv7l
10254e8f48c7Smrg		vendor=alt
10264e8f48c7Smrg		basic_os=${basic_os:-linux-gnueabihf}
1027c43cc173Smrg		;;
10284e8f48c7Smrg	dpx20-unknown | dpx20-bull)
10294e8f48c7Smrg		cpu=rs6000
10304e8f48c7Smrg		vendor=bull
10314e8f48c7Smrg		basic_os=${basic_os:-bosx}
1032c43cc173Smrg		;;
10334e8f48c7Smrg
10344e8f48c7Smrg	# Here we normalize CPU types irrespective of the vendor
10354e8f48c7Smrg	amd64-*)
10364e8f48c7Smrg		cpu=x86_64
1037c43cc173Smrg		;;
10384e8f48c7Smrg	blackfin-*)
10394e8f48c7Smrg		cpu=bfin
10404e8f48c7Smrg		basic_os=linux
1041c43cc173Smrg		;;
10424e8f48c7Smrg	c54x-*)
10434e8f48c7Smrg		cpu=tic54x
1044c43cc173Smrg		;;
10454e8f48c7Smrg	c55x-*)
10464e8f48c7Smrg		cpu=tic55x
1047c43cc173Smrg		;;
10484e8f48c7Smrg	c6x-*)
10494e8f48c7Smrg		cpu=tic6x
1050c43cc173Smrg		;;
10514e8f48c7Smrg	e500v[12]-*)
10524e8f48c7Smrg		cpu=powerpc
10534e8f48c7Smrg		basic_os=${basic_os}"spe"
1054c43cc173Smrg		;;
10554e8f48c7Smrg	mips3*-*)
10564e8f48c7Smrg		cpu=mips64
1057c43cc173Smrg		;;
10584e8f48c7Smrg	ms1-*)
10594e8f48c7Smrg		cpu=mt
1060c43cc173Smrg		;;
10614e8f48c7Smrg	m68knommu-*)
10624e8f48c7Smrg		cpu=m68k
10634e8f48c7Smrg		basic_os=linux
1064c43cc173Smrg		;;
10654e8f48c7Smrg	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
10664e8f48c7Smrg		cpu=s12z
1067c27c18e8Smrg		;;
10684e8f48c7Smrg	openrisc-*)
10694e8f48c7Smrg		cpu=or32
1070c43cc173Smrg		;;
10714e8f48c7Smrg	parisc-*)
10724e8f48c7Smrg		cpu=hppa
10734e8f48c7Smrg		basic_os=linux
1074c43cc173Smrg		;;
10754e8f48c7Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
10764e8f48c7Smrg		cpu=i586
1077c43cc173Smrg		;;
1078c6b4a769Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
10794e8f48c7Smrg		cpu=i686
1080c43cc173Smrg		;;
10814e8f48c7Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
10824e8f48c7Smrg		cpu=i686
108321e67964Smrg		;;
10844e8f48c7Smrg	pentium4-*)
10854e8f48c7Smrg		cpu=i786
1086c43cc173Smrg		;;
10874e8f48c7Smrg	pc98-*)
10884e8f48c7Smrg		cpu=i386
1089c43cc173Smrg		;;
10904e8f48c7Smrg	ppc-* | ppcbe-*)
10914e8f48c7Smrg		cpu=powerpc
1092c43cc173Smrg		;;
10934e8f48c7Smrg	ppcle-* | powerpclittle-*)
10944e8f48c7Smrg		cpu=powerpcle
1095c43cc173Smrg		;;
10964e8f48c7Smrg	ppc64-*)
10974e8f48c7Smrg		cpu=powerpc64
1098c43cc173Smrg		;;
10994e8f48c7Smrg	ppc64le-* | powerpc64little-*)
11004e8f48c7Smrg		cpu=powerpc64le
1101c43cc173Smrg		;;
11024e8f48c7Smrg	sb1-*)
11034e8f48c7Smrg		cpu=mipsisa64sb1
1104c43cc173Smrg		;;
11054e8f48c7Smrg	sb1el-*)
11064e8f48c7Smrg		cpu=mipsisa64sb1el
1107c43cc173Smrg		;;
11084e8f48c7Smrg	sh5e[lb]-*)
11094e8f48c7Smrg		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1110c43cc173Smrg		;;
11114e8f48c7Smrg	spur-*)
11124e8f48c7Smrg		cpu=spur
1113c43cc173Smrg		;;
11144e8f48c7Smrg	strongarm-* | thumb-*)
11154e8f48c7Smrg		cpu=arm
1116c43cc173Smrg		;;
11174e8f48c7Smrg	tx39-*)
11184e8f48c7Smrg		cpu=mipstx39
111987404ef7Smrg		;;
11204e8f48c7Smrg	tx39el-*)
11214e8f48c7Smrg		cpu=mipstx39el
112221e67964Smrg		;;
11234e8f48c7Smrg	x64-*)
11244e8f48c7Smrg		cpu=x86_64
1125c43cc173Smrg		;;
1126f1ee322dSmrg	xscale-* | xscalee[bl]-*)
11274e8f48c7Smrg		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1128c43cc173Smrg		;;
11294e8f48c7Smrg	arm64-* | aarch64le-*)
11304e8f48c7Smrg		cpu=aarch64
1131c43cc173Smrg		;;
1132c43cc173Smrg
11334e8f48c7Smrg	# Recognize the canonical CPU Types that limit and/or modify the
11344e8f48c7Smrg	# company names they are paired with.
11354e8f48c7Smrg	cr16-*)
11364e8f48c7Smrg		basic_os=${basic_os:-elf}
113721e67964Smrg		;;
11384e8f48c7Smrg	crisv32-* | etraxfs*-*)
11394e8f48c7Smrg		cpu=crisv32
11404e8f48c7Smrg		vendor=axis
1141c43cc173Smrg		;;
11424e8f48c7Smrg	cris-* | etrax*-*)
11434e8f48c7Smrg		cpu=cris
11444e8f48c7Smrg		vendor=axis
1145c43cc173Smrg		;;
11464e8f48c7Smrg	crx-*)
11474e8f48c7Smrg		basic_os=${basic_os:-elf}
1148c43cc173Smrg		;;
11494e8f48c7Smrg	neo-tandem)
11504e8f48c7Smrg		cpu=neo
11514e8f48c7Smrg		vendor=tandem
1152c43cc173Smrg		;;
11534e8f48c7Smrg	nse-tandem)
11544e8f48c7Smrg		cpu=nse
11554e8f48c7Smrg		vendor=tandem
1156c43cc173Smrg		;;
11574e8f48c7Smrg	nsr-tandem)
11584e8f48c7Smrg		cpu=nsr
11594e8f48c7Smrg		vendor=tandem
1160c43cc173Smrg		;;
11614e8f48c7Smrg	nsv-tandem)
11624e8f48c7Smrg		cpu=nsv
11634e8f48c7Smrg		vendor=tandem
1164c43cc173Smrg		;;
11654e8f48c7Smrg	nsx-tandem)
11664e8f48c7Smrg		cpu=nsx
11674e8f48c7Smrg		vendor=tandem
1168c43cc173Smrg		;;
11694e8f48c7Smrg	mipsallegrexel-sony)
11704e8f48c7Smrg		cpu=mipsallegrexel
11714e8f48c7Smrg		vendor=sony
1172c43cc173Smrg		;;
11734e8f48c7Smrg	tile*-*)
11744e8f48c7Smrg		basic_os=${basic_os:-linux-gnu}
1175c43cc173Smrg		;;
11764e8f48c7Smrg
1177c43cc173Smrg	*)
11784e8f48c7Smrg		# Recognize the canonical CPU types that are allowed with any
11794e8f48c7Smrg		# company name.
11804e8f48c7Smrg		case $cpu in
11814e8f48c7Smrg			1750a | 580 \
11824e8f48c7Smrg			| a29k \
11834e8f48c7Smrg			| aarch64 | aarch64_be \
11844e8f48c7Smrg			| abacus \
11854e8f48c7Smrg			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
11864e8f48c7Smrg			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
11874e8f48c7Smrg			| alphapca5[67] | alpha64pca5[67] \
11884e8f48c7Smrg			| am33_2.0 \
11894e8f48c7Smrg			| amdgcn \
11904e8f48c7Smrg			| arc | arceb | arc32 | arc64 \
11914e8f48c7Smrg			| arm | arm[lb]e | arme[lb] | armv* \
11924e8f48c7Smrg			| avr | avr32 \
11934e8f48c7Smrg			| asmjs \
11944e8f48c7Smrg			| ba \
11954e8f48c7Smrg			| be32 | be64 \
11964e8f48c7Smrg			| bfin | bpf | bs2000 \
11974e8f48c7Smrg			| c[123]* | c30 | [cjt]90 | c4x \
11984e8f48c7Smrg			| c8051 | clipper | craynv | csky | cydra \
11994e8f48c7Smrg			| d10v | d30v | dlx | dsp16xx \
12004e8f48c7Smrg			| e2k | elxsi | epiphany \
12014e8f48c7Smrg			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
12024e8f48c7Smrg			| h8300 | h8500 \
12034e8f48c7Smrg			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
12044e8f48c7Smrg			| hexagon \
12054e8f48c7Smrg			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
12064e8f48c7Smrg			| ip2k | iq2000 \
12074e8f48c7Smrg			| k1om \
12084e8f48c7Smrg			| le32 | le64 \
12094e8f48c7Smrg			| lm32 \
1210c6b4a769Smrg			| loongarch32 | loongarch64 \
12114e8f48c7Smrg			| m32c | m32r | m32rle \
12124e8f48c7Smrg			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
12134e8f48c7Smrg			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
12144e8f48c7Smrg			| m88110 | m88k | maxq | mb | mcore | mep | metag \
12154e8f48c7Smrg			| microblaze | microblazeel \
12164e8f48c7Smrg			| mips | mipsbe | mipseb | mipsel | mipsle \
12174e8f48c7Smrg			| mips16 \
12184e8f48c7Smrg			| mips64 | mips64eb | mips64el \
12194e8f48c7Smrg			| mips64octeon | mips64octeonel \
12204e8f48c7Smrg			| mips64orion | mips64orionel \
12214e8f48c7Smrg			| mips64r5900 | mips64r5900el \
12224e8f48c7Smrg			| mips64vr | mips64vrel \
12234e8f48c7Smrg			| mips64vr4100 | mips64vr4100el \
12244e8f48c7Smrg			| mips64vr4300 | mips64vr4300el \
12254e8f48c7Smrg			| mips64vr5000 | mips64vr5000el \
12264e8f48c7Smrg			| mips64vr5900 | mips64vr5900el \
12274e8f48c7Smrg			| mipsisa32 | mipsisa32el \
12284e8f48c7Smrg			| mipsisa32r2 | mipsisa32r2el \
12294e8f48c7Smrg			| mipsisa32r3 | mipsisa32r3el \
12304e8f48c7Smrg			| mipsisa32r5 | mipsisa32r5el \
12314e8f48c7Smrg			| mipsisa32r6 | mipsisa32r6el \
12324e8f48c7Smrg			| mipsisa64 | mipsisa64el \
12334e8f48c7Smrg			| mipsisa64r2 | mipsisa64r2el \
12344e8f48c7Smrg			| mipsisa64r3 | mipsisa64r3el \
12354e8f48c7Smrg			| mipsisa64r5 | mipsisa64r5el \
12364e8f48c7Smrg			| mipsisa64r6 | mipsisa64r6el \
12374e8f48c7Smrg			| mipsisa64sb1 | mipsisa64sb1el \
12384e8f48c7Smrg			| mipsisa64sr71k | mipsisa64sr71kel \
12394e8f48c7Smrg			| mipsr5900 | mipsr5900el \
12404e8f48c7Smrg			| mipstx39 | mipstx39el \
12414e8f48c7Smrg			| mmix \
12424e8f48c7Smrg			| mn10200 | mn10300 \
12434e8f48c7Smrg			| moxie \
12444e8f48c7Smrg			| mt \
12454e8f48c7Smrg			| msp430 \
12464e8f48c7Smrg			| nds32 | nds32le | nds32be \
12474e8f48c7Smrg			| nfp \
12484e8f48c7Smrg			| nios | nios2 | nios2eb | nios2el \
12494e8f48c7Smrg			| none | np1 | ns16k | ns32k | nvptx \
12504e8f48c7Smrg			| open8 \
12514e8f48c7Smrg			| or1k* \
12524e8f48c7Smrg			| or32 \
12534e8f48c7Smrg			| orion \
12544e8f48c7Smrg			| picochip \
12554e8f48c7Smrg			| pdp10 | pdp11 | pj | pjl | pn | power \
12564e8f48c7Smrg			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
12574e8f48c7Smrg			| pru \
12584e8f48c7Smrg			| pyramid \
12594e8f48c7Smrg			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
12604e8f48c7Smrg			| rl78 | romp | rs6000 | rx \
12614e8f48c7Smrg			| s390 | s390x \
12624e8f48c7Smrg			| score \
12634e8f48c7Smrg			| sh | shl \
12644e8f48c7Smrg			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
12654e8f48c7Smrg			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
12664e8f48c7Smrg			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
12674e8f48c7Smrg			| sparclite \
12684e8f48c7Smrg			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
12694e8f48c7Smrg			| spu \
12704e8f48c7Smrg			| tahoe \
12714e8f48c7Smrg			| thumbv7* \
12724e8f48c7Smrg			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
12734e8f48c7Smrg			| tron \
12744e8f48c7Smrg			| ubicom32 \
12754e8f48c7Smrg			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
12764e8f48c7Smrg			| vax \
12774e8f48c7Smrg			| visium \
12784e8f48c7Smrg			| w65 \
12794e8f48c7Smrg			| wasm32 | wasm64 \
12804e8f48c7Smrg			| we32k \
12814e8f48c7Smrg			| x86 | x86_64 | xc16x | xgate | xps100 \
12824e8f48c7Smrg			| xstormy16 | xtensa* \
12834e8f48c7Smrg			| ymp \
12844e8f48c7Smrg			| z8k | z80)
12854e8f48c7Smrg				;;
12864e8f48c7Smrg
12874e8f48c7Smrg			*)
1288c6b4a769Smrg				echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
12894e8f48c7Smrg				exit 1
12904e8f48c7Smrg				;;
12914e8f48c7Smrg		esac
1292c43cc173Smrg		;;
1293c43cc173Smrgesac
1294c43cc173Smrg
1295c43cc173Smrg# Here we canonicalize certain aliases for manufacturers.
12964e8f48c7Smrgcase $vendor in
12974e8f48c7Smrg	digital*)
12984e8f48c7Smrg		vendor=dec
1299c43cc173Smrg		;;
13004e8f48c7Smrg	commodore*)
13014e8f48c7Smrg		vendor=cbm
1302c43cc173Smrg		;;
1303c43cc173Smrg	*)
1304c43cc173Smrg		;;
1305c43cc173Smrgesac
1306c43cc173Smrg
1307c43cc173Smrg# Decode manufacturer-specific aliases for certain operating systems.
1308c43cc173Smrg
13094e8f48c7Smrgif test x$basic_os != x
1310c43cc173Smrgthen
13114e8f48c7Smrg
13124e8f48c7Smrg# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
13134e8f48c7Smrg# set os.
13144e8f48c7Smrgcase $basic_os in
13154e8f48c7Smrg	gnu/linux*)
13164e8f48c7Smrg		kernel=linux
13174e8f48c7Smrg		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
13184e8f48c7Smrg		;;
13194e8f48c7Smrg	os2-emx)
13204e8f48c7Smrg		kernel=os2
13214e8f48c7Smrg		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
13224e8f48c7Smrg		;;
13234e8f48c7Smrg	nto-qnx*)
13244e8f48c7Smrg		kernel=nto
13254e8f48c7Smrg		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
13264e8f48c7Smrg		;;
13274e8f48c7Smrg	*-*)
13284e8f48c7Smrg		# shellcheck disable=SC2162
13294e8f48c7Smrg		saved_IFS=$IFS
13304e8f48c7Smrg		IFS="-" read kernel os <<EOF
13314e8f48c7Smrg$basic_os
13324e8f48c7SmrgEOF
13334e8f48c7Smrg		IFS=$saved_IFS
13344e8f48c7Smrg		;;
13354e8f48c7Smrg	# Default OS when just kernel was specified
13364e8f48c7Smrg	nto*)
13374e8f48c7Smrg		kernel=nto
13384e8f48c7Smrg		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
13394e8f48c7Smrg		;;
13404e8f48c7Smrg	linux*)
13414e8f48c7Smrg		kernel=linux
13424e8f48c7Smrg		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
13434e8f48c7Smrg		;;
1344c6b4a769Smrg	managarm*)
1345c6b4a769Smrg		kernel=managarm
1346c6b4a769Smrg		os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
1347c6b4a769Smrg		;;
13484e8f48c7Smrg	*)
13494e8f48c7Smrg		kernel=
13504e8f48c7Smrg		os=$basic_os
13514e8f48c7Smrg		;;
13524e8f48c7Smrgesac
13534e8f48c7Smrg
13544e8f48c7Smrg# Now, normalize the OS (knowing we just have one component, it's not a kernel,
13554e8f48c7Smrg# etc.)
1356c43cc173Smrgcase $os in
135787404ef7Smrg	# First match some system type aliases that might get confused
135887404ef7Smrg	# with valid system types.
13594e8f48c7Smrg	# solaris* is a basic system type, with this one exception.
13604e8f48c7Smrg	auroraux)
13614e8f48c7Smrg		os=auroraux
13623e256790Smrg		;;
13634e8f48c7Smrg	bluegene*)
13644e8f48c7Smrg		os=cnk
1365c43cc173Smrg		;;
13664e8f48c7Smrg	solaris1 | solaris1.*)
13674e8f48c7Smrg		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
1368c43cc173Smrg		;;
13694e8f48c7Smrg	solaris)
13704e8f48c7Smrg		os=solaris2
1371c43cc173Smrg		;;
13724e8f48c7Smrg	unixware*)
13734e8f48c7Smrg		os=sysv4.2uw
1374c43cc173Smrg		;;
137587404ef7Smrg	# es1800 is here to avoid being matched by es* (a different OS)
13764e8f48c7Smrg	es1800*)
13774e8f48c7Smrg		os=ose
137887404ef7Smrg		;;
13794e8f48c7Smrg	# Some version numbers need modification
13804e8f48c7Smrg	chorusos*)
13814e8f48c7Smrg		os=chorusos
1382c43cc173Smrg		;;
13834e8f48c7Smrg	isc)
13844e8f48c7Smrg		os=isc2.2
1385c43cc173Smrg		;;
13864e8f48c7Smrg	sco6)
13874e8f48c7Smrg		os=sco5v6
1388c43cc173Smrg		;;
13894e8f48c7Smrg	sco5)
13904e8f48c7Smrg		os=sco3.2v5
1391c43cc173Smrg		;;
13924e8f48c7Smrg	sco4)
13934e8f48c7Smrg		os=sco3.2v4
1394c43cc173Smrg		;;
13954e8f48c7Smrg	sco3.2.[4-9]*)
13964e8f48c7Smrg		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
139721e67964Smrg		;;
13984e8f48c7Smrg	sco*v* | scout)
13994e8f48c7Smrg		# Don't match below
1400c43cc173Smrg		;;
14014e8f48c7Smrg	sco*)
14024e8f48c7Smrg		os=sco3.2v2
1403c43cc173Smrg		;;
14044e8f48c7Smrg	psos*)
14054e8f48c7Smrg		os=psos
1406c43cc173Smrg		;;
14074e8f48c7Smrg	qnx*)
14084e8f48c7Smrg		os=qnx
1409c43cc173Smrg		;;
14104e8f48c7Smrg	hiux*)
14114e8f48c7Smrg		os=hiuxwe2
141221e67964Smrg		;;
14134e8f48c7Smrg	lynx*178)
14144e8f48c7Smrg		os=lynxos178
1415c43cc173Smrg		;;
14164e8f48c7Smrg	lynx*5)
14174e8f48c7Smrg		os=lynxos5
1418c43cc173Smrg		;;
14194e8f48c7Smrg	lynxos*)
14204e8f48c7Smrg		# don't get caught up in next wildcard
1421c43cc173Smrg		;;
14224e8f48c7Smrg	lynx*)
14234e8f48c7Smrg		os=lynxos
1424c43cc173Smrg		;;
14254e8f48c7Smrg	mac[0-9]*)
14264e8f48c7Smrg		os=`echo "$os" | sed -e 's|mac|macos|'`
1427c43cc173Smrg		;;
14284e8f48c7Smrg	opened*)
14294e8f48c7Smrg		os=openedition
143021e67964Smrg		;;
14314e8f48c7Smrg	os400*)
14324e8f48c7Smrg		os=os400
1433c43cc173Smrg		;;
14344e8f48c7Smrg	sunos5*)
14354e8f48c7Smrg		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1436c43cc173Smrg		;;
14374e8f48c7Smrg	sunos6*)
14384e8f48c7Smrg		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1439c43cc173Smrg		;;
14404e8f48c7Smrg	wince*)
14414e8f48c7Smrg		os=wince
1442c43cc173Smrg		;;
14434e8f48c7Smrg	utek*)
14444e8f48c7Smrg		os=bsd
1445c43cc173Smrg		;;
14464e8f48c7Smrg	dynix*)
14474e8f48c7Smrg		os=bsd
1448c43cc173Smrg		;;
14494e8f48c7Smrg	acis*)
14504e8f48c7Smrg		os=aos
1451c43cc173Smrg		;;
14524e8f48c7Smrg	atheos*)
14534e8f48c7Smrg		os=atheos
145421e67964Smrg		;;
14554e8f48c7Smrg	syllable*)
14564e8f48c7Smrg		os=syllable
14574e8f48c7Smrg		;;
14584e8f48c7Smrg	386bsd)
14594e8f48c7Smrg		os=bsd
14604e8f48c7Smrg		;;
14614e8f48c7Smrg	ctix* | uts*)
14624e8f48c7Smrg		os=sysv
14634e8f48c7Smrg		;;
14644e8f48c7Smrg	nova*)
14654e8f48c7Smrg		os=rtmk-nova
14664e8f48c7Smrg		;;
14674e8f48c7Smrg	ns2)
14684e8f48c7Smrg		os=nextstep2
14694e8f48c7Smrg		;;
14704e8f48c7Smrg	# Preserve the version number of sinix5.
14714e8f48c7Smrg	sinix5.*)
14724e8f48c7Smrg		os=`echo "$os" | sed -e 's|sinix|sysv|'`
1473c43cc173Smrg		;;
14744e8f48c7Smrg	sinix*)
14754e8f48c7Smrg		os=sysv4
1476c43cc173Smrg		;;
14774e8f48c7Smrg	tpf*)
14784e8f48c7Smrg		os=tpf
1479c43cc173Smrg		;;
14804e8f48c7Smrg	triton*)
14814e8f48c7Smrg		os=sysv3
1482c43cc173Smrg		;;
14834e8f48c7Smrg	oss*)
14844e8f48c7Smrg		os=sysv3
1485c43cc173Smrg		;;
14864e8f48c7Smrg	svr4*)
14874e8f48c7Smrg		os=sysv4
1488c43cc173Smrg		;;
14894e8f48c7Smrg	svr3)
14904e8f48c7Smrg		os=sysv3
1491c43cc173Smrg		;;
14924e8f48c7Smrg	sysvr4)
14934e8f48c7Smrg		os=sysv4
1494c43cc173Smrg		;;
14954e8f48c7Smrg	ose*)
14964e8f48c7Smrg		os=ose
149721e67964Smrg		;;
14984e8f48c7Smrg	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
14994e8f48c7Smrg		os=mint
1500c27c18e8Smrg		;;
15014e8f48c7Smrg	dicos*)
15024e8f48c7Smrg		os=dicos
15034e8f48c7Smrg		;;
15044e8f48c7Smrg	pikeos*)
150587404ef7Smrg		# Until real need of OS specific support for
150687404ef7Smrg		# particular features comes up, bare metal
150787404ef7Smrg		# configurations are quite functional.
15084e8f48c7Smrg		case $cpu in
150987404ef7Smrg		    arm*)
15104e8f48c7Smrg			os=eabi
151187404ef7Smrg			;;
151287404ef7Smrg		    *)
15134e8f48c7Smrg			os=elf
151487404ef7Smrg			;;
151587404ef7Smrg		esac
151687404ef7Smrg		;;
1517c43cc173Smrg	*)
15184e8f48c7Smrg		# No normalization, but not necessarily accepted, that comes below.
1519c43cc173Smrg		;;
1520c43cc173Smrgesac
15214e8f48c7Smrg
1522c43cc173Smrgelse
1523c43cc173Smrg
1524c43cc173Smrg# Here we handle the default operating systems that come with various machines.
1525c43cc173Smrg# The value should be what the vendor currently ships out the door with their
1526c43cc173Smrg# machine or put another way, the most popular os provided with the machine.
1527c43cc173Smrg
1528c43cc173Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
1529c43cc173Smrg# "-sun"), then you have to tell the case statement up towards the top
1530c43cc173Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
1531c43cc173Smrg# will signal an error saying that MANUFACTURER isn't an operating
1532c43cc173Smrg# system, and we'll never get to this point.
1533c43cc173Smrg
15344e8f48c7Smrgkernel=
15354e8f48c7Smrgcase $cpu-$vendor in
1536f1ee322dSmrg	score-*)
15374e8f48c7Smrg		os=elf
153821e67964Smrg		;;
1539f1ee322dSmrg	spu-*)
15404e8f48c7Smrg		os=elf
154121e67964Smrg		;;
1542c43cc173Smrg	*-acorn)
15434e8f48c7Smrg		os=riscix1.2
1544c43cc173Smrg		;;
1545c43cc173Smrg	arm*-rebel)
15464e8f48c7Smrg		kernel=linux
15474e8f48c7Smrg		os=gnu
1548c43cc173Smrg		;;
1549c43cc173Smrg	arm*-semi)
15504e8f48c7Smrg		os=aout
1551c43cc173Smrg		;;
1552f1ee322dSmrg	c4x-* | tic4x-*)
15534e8f48c7Smrg		os=coff
1554f1ee322dSmrg		;;
155544584a44Smrg	c8051-*)
15564e8f48c7Smrg		os=elf
15574e8f48c7Smrg		;;
15584e8f48c7Smrg	clipper-intergraph)
15594e8f48c7Smrg		os=clix
156044584a44Smrg		;;
1561f1ee322dSmrg	hexagon-*)
15624e8f48c7Smrg		os=elf
1563f1ee322dSmrg		;;
1564f1ee322dSmrg	tic54x-*)
15654e8f48c7Smrg		os=coff
1566f1ee322dSmrg		;;
1567f1ee322dSmrg	tic55x-*)
15684e8f48c7Smrg		os=coff
1569f1ee322dSmrg		;;
1570f1ee322dSmrg	tic6x-*)
15714e8f48c7Smrg		os=coff
157221e67964Smrg		;;
1573c43cc173Smrg	# This must come before the *-dec entry.
1574c43cc173Smrg	pdp10-*)
15754e8f48c7Smrg		os=tops20
1576c43cc173Smrg		;;
1577c43cc173Smrg	pdp11-*)
15784e8f48c7Smrg		os=none
1579c43cc173Smrg		;;
1580c43cc173Smrg	*-dec | vax-*)
15814e8f48c7Smrg		os=ultrix4.2
1582c43cc173Smrg		;;
1583c43cc173Smrg	m68*-apollo)
15844e8f48c7Smrg		os=domain
1585c43cc173Smrg		;;
1586c43cc173Smrg	i386-sun)
15874e8f48c7Smrg		os=sunos4.0.2
1588c43cc173Smrg		;;
1589c43cc173Smrg	m68000-sun)
15904e8f48c7Smrg		os=sunos3
1591c43cc173Smrg		;;
1592c43cc173Smrg	m68*-cisco)
15934e8f48c7Smrg		os=aout
1594c43cc173Smrg		;;
1595f1ee322dSmrg	mep-*)
15964e8f48c7Smrg		os=elf
159721e67964Smrg		;;
1598c43cc173Smrg	mips*-cisco)
15994e8f48c7Smrg		os=elf
1600c43cc173Smrg		;;
1601c43cc173Smrg	mips*-*)
16024e8f48c7Smrg		os=elf
1603c43cc173Smrg		;;
1604c43cc173Smrg	or32-*)
16054e8f48c7Smrg		os=coff
1606c43cc173Smrg		;;
1607c43cc173Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
16084e8f48c7Smrg		os=sysv3
1609c43cc173Smrg		;;
1610c43cc173Smrg	sparc-* | *-sun)
16114e8f48c7Smrg		os=sunos4.1.1
1612c43cc173Smrg		;;
16134940c694Smrg	pru-*)
16144e8f48c7Smrg		os=elf
16154940c694Smrg		;;
1616c43cc173Smrg	*-be)
16174e8f48c7Smrg		os=beos
1618c43cc173Smrg		;;
1619c43cc173Smrg	*-ibm)
16204e8f48c7Smrg		os=aix
1621c43cc173Smrg		;;
1622f1ee322dSmrg	*-knuth)
16234e8f48c7Smrg		os=mmixware
162421e67964Smrg		;;
1625c43cc173Smrg	*-wec)
16264e8f48c7Smrg		os=proelf
1627c43cc173Smrg		;;
1628c43cc173Smrg	*-winbond)
16294e8f48c7Smrg		os=proelf
1630c43cc173Smrg		;;
1631c43cc173Smrg	*-oki)
16324e8f48c7Smrg		os=proelf
1633c43cc173Smrg		;;
1634c43cc173Smrg	*-hp)
16354e8f48c7Smrg		os=hpux
1636c43cc173Smrg		;;
1637c43cc173Smrg	*-hitachi)
16384e8f48c7Smrg		os=hiux
1639c43cc173Smrg		;;
1640c43cc173Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
16414e8f48c7Smrg		os=sysv
1642c43cc173Smrg		;;
1643c43cc173Smrg	*-cbm)
16444e8f48c7Smrg		os=amigaos
1645c43cc173Smrg		;;
1646c43cc173Smrg	*-dg)
16474e8f48c7Smrg		os=dgux
1648c43cc173Smrg		;;
1649c43cc173Smrg	*-dolphin)
16504e8f48c7Smrg		os=sysv3
1651c43cc173Smrg		;;
1652c43cc173Smrg	m68k-ccur)
16534e8f48c7Smrg		os=rtu
1654c43cc173Smrg		;;
1655c43cc173Smrg	m88k-omron*)
16564e8f48c7Smrg		os=luna
1657c43cc173Smrg		;;
165887404ef7Smrg	*-next)
16594e8f48c7Smrg		os=nextstep
1660c43cc173Smrg		;;
1661c43cc173Smrg	*-sequent)
16624e8f48c7Smrg		os=ptx
1663c43cc173Smrg		;;
1664c43cc173Smrg	*-crds)
16654e8f48c7Smrg		os=unos
1666c43cc173Smrg		;;
1667c43cc173Smrg	*-ns)
16684e8f48c7Smrg		os=genix
1669c43cc173Smrg		;;
1670c43cc173Smrg	i370-*)
16714e8f48c7Smrg		os=mvs
1672c43cc173Smrg		;;
1673c43cc173Smrg	*-gould)
16744e8f48c7Smrg		os=sysv
1675c43cc173Smrg		;;
1676c43cc173Smrg	*-highlevel)
16774e8f48c7Smrg		os=bsd
1678c43cc173Smrg		;;
1679c43cc173Smrg	*-encore)
16804e8f48c7Smrg		os=bsd
1681c43cc173Smrg		;;
1682c43cc173Smrg	*-sgi)
16834e8f48c7Smrg		os=irix
1684c43cc173Smrg		;;
1685c43cc173Smrg	*-siemens)
16864e8f48c7Smrg		os=sysv4
1687c43cc173Smrg		;;
1688c43cc173Smrg	*-masscomp)
16894e8f48c7Smrg		os=rtu
1690c43cc173Smrg		;;
1691c43cc173Smrg	f30[01]-fujitsu | f700-fujitsu)
16924e8f48c7Smrg		os=uxpv
1693c43cc173Smrg		;;
1694c43cc173Smrg	*-rom68k)
16954e8f48c7Smrg		os=coff
1696c43cc173Smrg		;;
1697c43cc173Smrg	*-*bug)
16984e8f48c7Smrg		os=coff
1699c43cc173Smrg		;;
1700c43cc173Smrg	*-apple)
17014e8f48c7Smrg		os=macos
1702c43cc173Smrg		;;
1703c43cc173Smrg	*-atari*)
17044e8f48c7Smrg		os=mint
17054e8f48c7Smrg		;;
17064e8f48c7Smrg	*-wrs)
17074e8f48c7Smrg		os=vxworks
1708c43cc173Smrg		;;
1709c43cc173Smrg	*)
17104e8f48c7Smrg		os=none
1711c43cc173Smrg		;;
1712c43cc173Smrgesac
17134e8f48c7Smrg
1714c43cc173Smrgfi
1715c43cc173Smrg
17164e8f48c7Smrg# Now, validate our (potentially fixed-up) OS.
17174e8f48c7Smrgcase $os in
17184e8f48c7Smrg	# Sometimes we do "kernel-libc", so those need to count as OSes.
17194e8f48c7Smrg	musl* | newlib* | relibc* | uclibc*)
17204e8f48c7Smrg		;;
17214e8f48c7Smrg	# Likewise for "kernel-abi"
17224e8f48c7Smrg	eabi* | gnueabi*)
17234e8f48c7Smrg		;;
17244e8f48c7Smrg	# VxWorks passes extra cpu info in the 4th filed.
17254e8f48c7Smrg	simlinux | simwindows | spe)
17264e8f48c7Smrg		;;
17274e8f48c7Smrg	# Now accept the basic system types.
17284e8f48c7Smrg	# The portable systems comes first.
17294e8f48c7Smrg	# Each alternative MUST end in a * to match a version number.
17304e8f48c7Smrg	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
17314e8f48c7Smrg	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
17324e8f48c7Smrg	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
17334e8f48c7Smrg	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
17344e8f48c7Smrg	     | hiux* | abug | nacl* | netware* | windows* \
17354e8f48c7Smrg	     | os9* | macos* | osx* | ios* \
17364e8f48c7Smrg	     | mpw* | magic* | mmixware* | mon960* | lnews* \
17374e8f48c7Smrg	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
17384e8f48c7Smrg	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
17394e8f48c7Smrg	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
17404e8f48c7Smrg	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
17414e8f48c7Smrg	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
17424e8f48c7Smrg	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
17434e8f48c7Smrg	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
17444e8f48c7Smrg	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
17454e8f48c7Smrg	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
17464e8f48c7Smrg	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
17474e8f48c7Smrg	     | chorusrdb* | cegcc* | glidix* | serenity* \
17484e8f48c7Smrg	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
17494e8f48c7Smrg	     | midipix* | mingw32* | mingw64* | mint* \
17504e8f48c7Smrg	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
17514e8f48c7Smrg	     | interix* | uwin* | mks* | rhapsody* | darwin* \
17524e8f48c7Smrg	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
17534e8f48c7Smrg	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
17544e8f48c7Smrg	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
17554e8f48c7Smrg	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
17564e8f48c7Smrg	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
17574e8f48c7Smrg	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
17584e8f48c7Smrg	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
17594e8f48c7Smrg	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
17604e8f48c7Smrg	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1761c6b4a769Smrg	     | fiwix* | mlibc* )
17624e8f48c7Smrg		;;
17634e8f48c7Smrg	# This one is extra strict with allowed versions
17644e8f48c7Smrg	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
17654e8f48c7Smrg		# Don't forget version if it is 3.2v4 or newer.
17664e8f48c7Smrg		;;
17674e8f48c7Smrg	none)
17684e8f48c7Smrg		;;
1769c6b4a769Smrg	kernel* )
1770c6b4a769Smrg		# Restricted further below
1771c6b4a769Smrg		;;
17724e8f48c7Smrg	*)
1773c6b4a769Smrg		echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
17744e8f48c7Smrg		exit 1
17754e8f48c7Smrg		;;
17764e8f48c7Smrgesac
17774e8f48c7Smrg
17784e8f48c7Smrg# As a final step for OS-related things, validate the OS-kernel combination
17794e8f48c7Smrg# (given a valid OS), if there is a kernel.
17804e8f48c7Smrgcase $kernel-$os in
17814e8f48c7Smrg	linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
1782c6b4a769Smrg		   | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* )
17834e8f48c7Smrg		;;
17844e8f48c7Smrg	uclinux-uclibc* )
17854e8f48c7Smrg		;;
1786c6b4a769Smrg	managarm-mlibc* | managarm-kernel* )
1787c6b4a769Smrg		;;
1788c6b4a769Smrg	-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* )
17894e8f48c7Smrg		# These are just libc implementations, not actual OSes, and thus
17904e8f48c7Smrg		# require a kernel.
1791c6b4a769Smrg		echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
1792c6b4a769Smrg		exit 1
1793c6b4a769Smrg		;;
1794c6b4a769Smrg	-kernel* )
1795c6b4a769Smrg		echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
1796c6b4a769Smrg		exit 1
1797c6b4a769Smrg		;;
1798c6b4a769Smrg	*-kernel* )
1799c6b4a769Smrg		echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
18004e8f48c7Smrg		exit 1
18014e8f48c7Smrg		;;
18024e8f48c7Smrg	kfreebsd*-gnu* | kopensolaris*-gnu*)
18034e8f48c7Smrg		;;
18044e8f48c7Smrg	vxworks-simlinux | vxworks-simwindows | vxworks-spe)
18054e8f48c7Smrg		;;
18064e8f48c7Smrg	nto-qnx*)
18074e8f48c7Smrg		;;
18084e8f48c7Smrg	os2-emx)
18094e8f48c7Smrg		;;
18104e8f48c7Smrg	*-eabi* | *-gnueabi*)
18114e8f48c7Smrg		;;
18124e8f48c7Smrg	-*)
18134e8f48c7Smrg		# Blank kernel with real OS is always fine.
18144e8f48c7Smrg		;;
18154e8f48c7Smrg	*-*)
1816c6b4a769Smrg		echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
18174e8f48c7Smrg		exit 1
18184e8f48c7Smrg		;;
18194e8f48c7Smrgesac
18204e8f48c7Smrg
1821c43cc173Smrg# Here we handle the case where we know the os, and the CPU type, but not the
1822c43cc173Smrg# manufacturer.  We pick the logical manufacturer.
18234e8f48c7Smrgcase $vendor in
18244e8f48c7Smrg	unknown)
18254e8f48c7Smrg		case $cpu-$os in
18264e8f48c7Smrg			*-riscix*)
1827c43cc173Smrg				vendor=acorn
1828c43cc173Smrg				;;
18294e8f48c7Smrg			*-sunos*)
1830c43cc173Smrg				vendor=sun
1831c43cc173Smrg				;;
18324e8f48c7Smrg			*-cnk* | *-aix*)
1833c43cc173Smrg				vendor=ibm
1834c43cc173Smrg				;;
18354e8f48c7Smrg			*-beos*)
1836c43cc173Smrg				vendor=be
1837c43cc173Smrg				;;
18384e8f48c7Smrg			*-hpux*)
1839c43cc173Smrg				vendor=hp
1840c43cc173Smrg				;;
18414e8f48c7Smrg			*-mpeix*)
1842c43cc173Smrg				vendor=hp
1843c43cc173Smrg				;;
18444e8f48c7Smrg			*-hiux*)
1845c43cc173Smrg				vendor=hitachi
1846c43cc173Smrg				;;
18474e8f48c7Smrg			*-unos*)
1848c43cc173Smrg				vendor=crds
1849c43cc173Smrg				;;
18504e8f48c7Smrg			*-dgux*)
1851c43cc173Smrg				vendor=dg
1852c43cc173Smrg				;;
18534e8f48c7Smrg			*-luna*)
1854c43cc173Smrg				vendor=omron
1855c43cc173Smrg				;;
18564e8f48c7Smrg			*-genix*)
1857c43cc173Smrg				vendor=ns
1858c43cc173Smrg				;;
18594e8f48c7Smrg			*-clix*)
18604e8f48c7Smrg				vendor=intergraph
18614e8f48c7Smrg				;;
18624e8f48c7Smrg			*-mvs* | *-opened*)
18634e8f48c7Smrg				vendor=ibm
18644e8f48c7Smrg				;;
18654e8f48c7Smrg			*-os400*)
1866c43cc173Smrg				vendor=ibm
1867c43cc173Smrg				;;
18684e8f48c7Smrg			s390-* | s390x-*)
186921e67964Smrg				vendor=ibm
187021e67964Smrg				;;
18714e8f48c7Smrg			*-ptx*)
1872c43cc173Smrg				vendor=sequent
1873c43cc173Smrg				;;
18744e8f48c7Smrg			*-tpf*)
187521e67964Smrg				vendor=ibm
187621e67964Smrg				;;
18774e8f48c7Smrg			*-vxsim* | *-vxworks* | *-windiss*)
1878c43cc173Smrg				vendor=wrs
1879c43cc173Smrg				;;
18804e8f48c7Smrg			*-aux*)
1881c43cc173Smrg				vendor=apple
1882c43cc173Smrg				;;
18834e8f48c7Smrg			*-hms*)
1884c43cc173Smrg				vendor=hitachi
1885c43cc173Smrg				;;
18864e8f48c7Smrg			*-mpw* | *-macos*)
1887c43cc173Smrg				vendor=apple
1888c43cc173Smrg				;;
18894e8f48c7Smrg			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
1890c43cc173Smrg				vendor=atari
1891c43cc173Smrg				;;
18924e8f48c7Smrg			*-vos*)
1893c43cc173Smrg				vendor=stratus
1894c43cc173Smrg				;;
1895c43cc173Smrg		esac
1896c43cc173Smrg		;;
1897c43cc173Smrgesac
1898c43cc173Smrg
18994e8f48c7Smrgecho "$cpu-$vendor-${kernel:+$kernel-}$os"
190021e67964Smrgexit
1901c43cc173Smrg
1902c43cc173Smrg# Local variables:
19034e8f48c7Smrg# eval: (add-hook 'before-save-hook 'time-stamp)
1904c43cc173Smrg# time-stamp-start: "timestamp='"
1905c43cc173Smrg# time-stamp-format: "%:y-%02m-%02d"
1906c43cc173Smrg# time-stamp-end: "'"
1907c43cc173Smrg# End:
1908