14a041c5bSmacallan#! /bin/sh
24a041c5bSmacallan# Configuration validation subroutine script.
38fc2d0c6Smrg#   Copyright 1992-2021 Free Software Foundation, Inc.
44a041c5bSmacallan
58fc2d0c6Smrg# shellcheck disable=SC2006,SC2268 # see below for rationale
68fc2d0c6Smrg
78fc2d0c6Smrgtimestamp='2021-08-14'
84a041c5bSmacallan
90a392d7eSmrg# This file is free software; you can redistribute it and/or modify it
100a392d7eSmrg# under the terms of the GNU General Public License as published by
110a392d7eSmrg# the Free Software Foundation; either version 3 of the License, or
124a041c5bSmacallan# (at your option) any later version.
134a041c5bSmacallan#
140a392d7eSmrg# This program is distributed in the hope that it will be useful, but
150a392d7eSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
160a392d7eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
170a392d7eSmrg# General Public License for more details.
184a041c5bSmacallan#
194a041c5bSmacallan# You should have received a copy of the GNU General Public License
208fc2d0c6Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
214a041c5bSmacallan#
224a041c5bSmacallan# As a special exception to the GNU General Public License, if you
234a041c5bSmacallan# distribute this file as part of a program that contains a
244a041c5bSmacallan# configuration script generated by Autoconf, you may include it under
250a392d7eSmrg# the same distribution terms that you use for the rest of that
260a392d7eSmrg# program.  This Exception is an additional permission under section 7
270a392d7eSmrg# of the GNU General Public License, version 3 ("GPLv3").
284a041c5bSmacallan
294a041c5bSmacallan
300a392d7eSmrg# Please send patches to <config-patches@gnu.org>.
314a041c5bSmacallan#
324a041c5bSmacallan# Configuration subroutine to validate and canonicalize a configuration type.
334a041c5bSmacallan# Supply the specified configuration type as an argument.
344a041c5bSmacallan# If it is invalid, we print an error message on stderr and exit with code 1.
354a041c5bSmacallan# Otherwise, we print the canonical config type on stdout and succeed.
364a041c5bSmacallan
3754b44505Smrg# You can get the latest version of this script from:
388fc2d0c6Smrg# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
3954b44505Smrg
404a041c5bSmacallan# This file is supposed to be the same for all GNU packages
414a041c5bSmacallan# and recognize all the CPU types, system types and aliases
424a041c5bSmacallan# that are meaningful with *any* GNU software.
434a041c5bSmacallan# Each package is responsible for reporting which valid configurations
444a041c5bSmacallan# it does not support.  The user should be able to distinguish
454a041c5bSmacallan# a failure to support a valid configuration from a meaningless
464a041c5bSmacallan# configuration.
474a041c5bSmacallan
484a041c5bSmacallan# The goal of this file is to map all the various variations of a given
494a041c5bSmacallan# machine specification into a single specification in the form:
504a041c5bSmacallan#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
514a041c5bSmacallan# or in some cases, the newer four-part form:
524a041c5bSmacallan#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
534a041c5bSmacallan# It is wrong to echo any other type of specification.
544a041c5bSmacallan
558fc2d0c6Smrg# The "shellcheck disable" line above the timestamp inhibits complaints
568fc2d0c6Smrg# about features and limitations of the classic Bourne shell that were
578fc2d0c6Smrg# superseded or lifted in POSIX.  However, this script identifies a wide
588fc2d0c6Smrg# variety of pre-POSIX systems that do not have POSIX shells at all, and
598fc2d0c6Smrg# even some reasonably current systems (Solaris 10 as case-in-point) still
608fc2d0c6Smrg# have a pre-POSIX /bin/sh.
618fc2d0c6Smrg
624a041c5bSmacallanme=`echo "$0" | sed -e 's,.*/,,'`
634a041c5bSmacallan
644a041c5bSmacallanusage="\
650a392d7eSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
664a041c5bSmacallan
674a041c5bSmacallanCanonicalize a configuration name.
684a041c5bSmacallan
698fc2d0c6SmrgOptions:
704a041c5bSmacallan  -h, --help         print this help, then exit
714a041c5bSmacallan  -t, --time-stamp   print date of last modification, then exit
724a041c5bSmacallan  -v, --version      print version number, then exit
734a041c5bSmacallan
744a041c5bSmacallanReport bugs and patches to <config-patches@gnu.org>."
754a041c5bSmacallan
764a041c5bSmacallanversion="\
774a041c5bSmacallanGNU config.sub ($timestamp)
784a041c5bSmacallan
798fc2d0c6SmrgCopyright 1992-2021 Free Software Foundation, Inc.
804a041c5bSmacallan
814a041c5bSmacallanThis is free software; see the source for copying conditions.  There is NO
824a041c5bSmacallanwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
834a041c5bSmacallan
844a041c5bSmacallanhelp="
854a041c5bSmacallanTry \`$me --help' for more information."
864a041c5bSmacallan
874a041c5bSmacallan# Parse command line
884a041c5bSmacallanwhile test $# -gt 0 ; do
894a041c5bSmacallan  case $1 in
904a041c5bSmacallan    --time-stamp | --time* | -t )
914a041c5bSmacallan       echo "$timestamp" ; exit ;;
924a041c5bSmacallan    --version | -v )
934a041c5bSmacallan       echo "$version" ; exit ;;
944a041c5bSmacallan    --help | --h* | -h )
954a041c5bSmacallan       echo "$usage"; exit ;;
964a041c5bSmacallan    -- )     # Stop option processing
974a041c5bSmacallan       shift; break ;;
984a041c5bSmacallan    - )	# Use stdin as input.
994a041c5bSmacallan       break ;;
1004a041c5bSmacallan    -* )
1018fc2d0c6Smrg       echo "$me: invalid option $1$help" >&2
1024a041c5bSmacallan       exit 1 ;;
1034a041c5bSmacallan
1044a041c5bSmacallan    *local*)
1054a041c5bSmacallan       # First pass through any local machine types.
1068fc2d0c6Smrg       echo "$1"
1074a041c5bSmacallan       exit ;;
1084a041c5bSmacallan
1094a041c5bSmacallan    * )
1104a041c5bSmacallan       break ;;
1114a041c5bSmacallan  esac
1124a041c5bSmacallandone
1134a041c5bSmacallan
1144a041c5bSmacallancase $# in
1154a041c5bSmacallan 0) echo "$me: missing argument$help" >&2
1164a041c5bSmacallan    exit 1;;
1174a041c5bSmacallan 1) ;;
1184a041c5bSmacallan *) echo "$me: too many arguments$help" >&2
1194a041c5bSmacallan    exit 1;;
1204a041c5bSmacallanesac
1214a041c5bSmacallan
1228fc2d0c6Smrg# Split fields of configuration type
1238fc2d0c6Smrg# shellcheck disable=SC2162
1248fc2d0c6Smrgsaved_IFS=$IFS
1258fc2d0c6SmrgIFS="-" read field1 field2 field3 field4 <<EOF
1268fc2d0c6Smrg$1
1278fc2d0c6SmrgEOF
1288fc2d0c6SmrgIFS=$saved_IFS
1294a041c5bSmacallan
1308fc2d0c6Smrg# Separate into logical components for further validation
1318fc2d0c6Smrgcase $1 in
1328fc2d0c6Smrg	*-*-*-*-*)
1338fc2d0c6Smrg		echo Invalid configuration \`"$1"\': more than four components >&2
1348fc2d0c6Smrg		exit 1
1354a041c5bSmacallan		;;
1368fc2d0c6Smrg	*-*-*-*)
1378fc2d0c6Smrg		basic_machine=$field1-$field2
1388fc2d0c6Smrg		basic_os=$field3-$field4
1394a041c5bSmacallan		;;
1408fc2d0c6Smrg	*-*-*)
1418fc2d0c6Smrg		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
1428fc2d0c6Smrg		# parts
1438fc2d0c6Smrg		maybe_os=$field2-$field3
1448fc2d0c6Smrg		case $maybe_os in
1458fc2d0c6Smrg			nto-qnx* | linux-* | uclinux-uclibc* \
1468fc2d0c6Smrg			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
1478fc2d0c6Smrg			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
1488fc2d0c6Smrg			| storm-chaos* | os2-emx* | rtmk-nova*)
1498fc2d0c6Smrg				basic_machine=$field1
1508fc2d0c6Smrg				basic_os=$maybe_os
1518fc2d0c6Smrg				;;
1528fc2d0c6Smrg			android-linux)
1538fc2d0c6Smrg				basic_machine=$field1-unknown
1548fc2d0c6Smrg				basic_os=linux-android
1558fc2d0c6Smrg				;;
1568fc2d0c6Smrg			*)
1578fc2d0c6Smrg				basic_machine=$field1-$field2
1588fc2d0c6Smrg				basic_os=$field3
1598fc2d0c6Smrg				;;
1608fc2d0c6Smrg		esac
1614a041c5bSmacallan		;;
1628fc2d0c6Smrg	*-*)
1638fc2d0c6Smrg		# A lone config we happen to match not fitting any pattern
1648fc2d0c6Smrg		case $field1-$field2 in
1658fc2d0c6Smrg			decstation-3100)
1668fc2d0c6Smrg				basic_machine=mips-dec
1678fc2d0c6Smrg				basic_os=
1688fc2d0c6Smrg				;;
1698fc2d0c6Smrg			*-*)
1708fc2d0c6Smrg				# Second component is usually, but not always the OS
1718fc2d0c6Smrg				case $field2 in
1728fc2d0c6Smrg					# Prevent following clause from handling this valid os
1738fc2d0c6Smrg					sun*os*)
1748fc2d0c6Smrg						basic_machine=$field1
1758fc2d0c6Smrg						basic_os=$field2
1768fc2d0c6Smrg						;;
1778fc2d0c6Smrg					zephyr*)
1788fc2d0c6Smrg						basic_machine=$field1-unknown
1798fc2d0c6Smrg						basic_os=$field2
1808fc2d0c6Smrg						;;
1818fc2d0c6Smrg					# Manufacturers
1828fc2d0c6Smrg					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
1838fc2d0c6Smrg					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
1848fc2d0c6Smrg					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
1858fc2d0c6Smrg					| convergent* | ncr* | news | 32* | 3600* | 3100* \
1868fc2d0c6Smrg					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
1878fc2d0c6Smrg					| ultra | tti* | harris | dolphin | highlevel | gould \
1888fc2d0c6Smrg					| cbm | ns | masscomp | apple | axis | knuth | cray \
1898fc2d0c6Smrg					| microblaze* | sim | cisco \
1908fc2d0c6Smrg					| oki | wec | wrs | winbond)
1918fc2d0c6Smrg						basic_machine=$field1-$field2
1928fc2d0c6Smrg						basic_os=
1938fc2d0c6Smrg						;;
1948fc2d0c6Smrg					*)
1958fc2d0c6Smrg						basic_machine=$field1
1968fc2d0c6Smrg						basic_os=$field2
1978fc2d0c6Smrg						;;
1988fc2d0c6Smrg				esac
1998fc2d0c6Smrg			;;
2008fc2d0c6Smrg		esac
2014a041c5bSmacallan		;;
2028fc2d0c6Smrg	*)
2038fc2d0c6Smrg		# Convert single-component short-hands not valid as part of
2048fc2d0c6Smrg		# multi-component configurations.
2058fc2d0c6Smrg		case $field1 in
2068fc2d0c6Smrg			386bsd)
2078fc2d0c6Smrg				basic_machine=i386-pc
2088fc2d0c6Smrg				basic_os=bsd
2098fc2d0c6Smrg				;;
2108fc2d0c6Smrg			a29khif)
2118fc2d0c6Smrg				basic_machine=a29k-amd
2128fc2d0c6Smrg				basic_os=udi
2138fc2d0c6Smrg				;;
2148fc2d0c6Smrg			adobe68k)
2158fc2d0c6Smrg				basic_machine=m68010-adobe
2168fc2d0c6Smrg				basic_os=scout
2178fc2d0c6Smrg				;;
2188fc2d0c6Smrg			alliant)
2198fc2d0c6Smrg				basic_machine=fx80-alliant
2208fc2d0c6Smrg				basic_os=
2218fc2d0c6Smrg				;;
2228fc2d0c6Smrg			altos | altos3068)
2238fc2d0c6Smrg				basic_machine=m68k-altos
2248fc2d0c6Smrg				basic_os=
2258fc2d0c6Smrg				;;
2268fc2d0c6Smrg			am29k)
2278fc2d0c6Smrg				basic_machine=a29k-none
2288fc2d0c6Smrg				basic_os=bsd
2298fc2d0c6Smrg				;;
2308fc2d0c6Smrg			amdahl)
2318fc2d0c6Smrg				basic_machine=580-amdahl
2328fc2d0c6Smrg				basic_os=sysv
2338fc2d0c6Smrg				;;
2348fc2d0c6Smrg			amiga)
2358fc2d0c6Smrg				basic_machine=m68k-unknown
2368fc2d0c6Smrg				basic_os=
2378fc2d0c6Smrg				;;
2388fc2d0c6Smrg			amigaos | amigados)
2398fc2d0c6Smrg				basic_machine=m68k-unknown
2408fc2d0c6Smrg				basic_os=amigaos
2418fc2d0c6Smrg				;;
2428fc2d0c6Smrg			amigaunix | amix)
2438fc2d0c6Smrg				basic_machine=m68k-unknown
2448fc2d0c6Smrg				basic_os=sysv4
2458fc2d0c6Smrg				;;
2468fc2d0c6Smrg			apollo68)
2478fc2d0c6Smrg				basic_machine=m68k-apollo
2488fc2d0c6Smrg				basic_os=sysv
2498fc2d0c6Smrg				;;
2508fc2d0c6Smrg			apollo68bsd)
2518fc2d0c6Smrg				basic_machine=m68k-apollo
2528fc2d0c6Smrg				basic_os=bsd
2538fc2d0c6Smrg				;;
2548fc2d0c6Smrg			aros)
2558fc2d0c6Smrg				basic_machine=i386-pc
2568fc2d0c6Smrg				basic_os=aros
2578fc2d0c6Smrg				;;
2588fc2d0c6Smrg			aux)
2598fc2d0c6Smrg				basic_machine=m68k-apple
2608fc2d0c6Smrg				basic_os=aux
2618fc2d0c6Smrg				;;
2628fc2d0c6Smrg			balance)
2638fc2d0c6Smrg				basic_machine=ns32k-sequent
2648fc2d0c6Smrg				basic_os=dynix
2658fc2d0c6Smrg				;;
2668fc2d0c6Smrg			blackfin)
2678fc2d0c6Smrg				basic_machine=bfin-unknown
2688fc2d0c6Smrg				basic_os=linux
2698fc2d0c6Smrg				;;
2708fc2d0c6Smrg			cegcc)
2718fc2d0c6Smrg				basic_machine=arm-unknown
2728fc2d0c6Smrg				basic_os=cegcc
2738fc2d0c6Smrg				;;
2748fc2d0c6Smrg			convex-c1)
2758fc2d0c6Smrg				basic_machine=c1-convex
2768fc2d0c6Smrg				basic_os=bsd
2778fc2d0c6Smrg				;;
2788fc2d0c6Smrg			convex-c2)
2798fc2d0c6Smrg				basic_machine=c2-convex
2808fc2d0c6Smrg				basic_os=bsd
2818fc2d0c6Smrg				;;
2828fc2d0c6Smrg			convex-c32)
2838fc2d0c6Smrg				basic_machine=c32-convex
2848fc2d0c6Smrg				basic_os=bsd
2858fc2d0c6Smrg				;;
2868fc2d0c6Smrg			convex-c34)
2878fc2d0c6Smrg				basic_machine=c34-convex
2888fc2d0c6Smrg				basic_os=bsd
2898fc2d0c6Smrg				;;
2908fc2d0c6Smrg			convex-c38)
2918fc2d0c6Smrg				basic_machine=c38-convex
2928fc2d0c6Smrg				basic_os=bsd
2938fc2d0c6Smrg				;;
2948fc2d0c6Smrg			cray)
2958fc2d0c6Smrg				basic_machine=j90-cray
2968fc2d0c6Smrg				basic_os=unicos
2978fc2d0c6Smrg				;;
2988fc2d0c6Smrg			crds | unos)
2998fc2d0c6Smrg				basic_machine=m68k-crds
3008fc2d0c6Smrg				basic_os=
3018fc2d0c6Smrg				;;
3028fc2d0c6Smrg			da30)
3038fc2d0c6Smrg				basic_machine=m68k-da30
3048fc2d0c6Smrg				basic_os=
3058fc2d0c6Smrg				;;
3068fc2d0c6Smrg			decstation | pmax | pmin | dec3100 | decstatn)
3078fc2d0c6Smrg				basic_machine=mips-dec
3088fc2d0c6Smrg				basic_os=
3098fc2d0c6Smrg				;;
3108fc2d0c6Smrg			delta88)
3118fc2d0c6Smrg				basic_machine=m88k-motorola
3128fc2d0c6Smrg				basic_os=sysv3
3138fc2d0c6Smrg				;;
3148fc2d0c6Smrg			dicos)
3158fc2d0c6Smrg				basic_machine=i686-pc
3168fc2d0c6Smrg				basic_os=dicos
3178fc2d0c6Smrg				;;
3188fc2d0c6Smrg			djgpp)
3198fc2d0c6Smrg				basic_machine=i586-pc
3208fc2d0c6Smrg				basic_os=msdosdjgpp
3218fc2d0c6Smrg				;;
3228fc2d0c6Smrg			ebmon29k)
3238fc2d0c6Smrg				basic_machine=a29k-amd
3248fc2d0c6Smrg				basic_os=ebmon
3258fc2d0c6Smrg				;;
3268fc2d0c6Smrg			es1800 | OSE68k | ose68k | ose | OSE)
3278fc2d0c6Smrg				basic_machine=m68k-ericsson
3288fc2d0c6Smrg				basic_os=ose
3298fc2d0c6Smrg				;;
3308fc2d0c6Smrg			gmicro)
3318fc2d0c6Smrg				basic_machine=tron-gmicro
3328fc2d0c6Smrg				basic_os=sysv
3338fc2d0c6Smrg				;;
3348fc2d0c6Smrg			go32)
3358fc2d0c6Smrg				basic_machine=i386-pc
3368fc2d0c6Smrg				basic_os=go32
3378fc2d0c6Smrg				;;
3388fc2d0c6Smrg			h8300hms)
3398fc2d0c6Smrg				basic_machine=h8300-hitachi
3408fc2d0c6Smrg				basic_os=hms
3418fc2d0c6Smrg				;;
3428fc2d0c6Smrg			h8300xray)
3438fc2d0c6Smrg				basic_machine=h8300-hitachi
3448fc2d0c6Smrg				basic_os=xray
3458fc2d0c6Smrg				;;
3468fc2d0c6Smrg			h8500hms)
3478fc2d0c6Smrg				basic_machine=h8500-hitachi
3488fc2d0c6Smrg				basic_os=hms
3498fc2d0c6Smrg				;;
3508fc2d0c6Smrg			harris)
3518fc2d0c6Smrg				basic_machine=m88k-harris
3528fc2d0c6Smrg				basic_os=sysv3
3538fc2d0c6Smrg				;;
3548fc2d0c6Smrg			hp300 | hp300hpux)
3558fc2d0c6Smrg				basic_machine=m68k-hp
3568fc2d0c6Smrg				basic_os=hpux
3578fc2d0c6Smrg				;;
3588fc2d0c6Smrg			hp300bsd)
3598fc2d0c6Smrg				basic_machine=m68k-hp
3608fc2d0c6Smrg				basic_os=bsd
3618fc2d0c6Smrg				;;
3628fc2d0c6Smrg			hppaosf)
3638fc2d0c6Smrg				basic_machine=hppa1.1-hp
3648fc2d0c6Smrg				basic_os=osf
3658fc2d0c6Smrg				;;
3668fc2d0c6Smrg			hppro)
3678fc2d0c6Smrg				basic_machine=hppa1.1-hp
3688fc2d0c6Smrg				basic_os=proelf
3698fc2d0c6Smrg				;;
3708fc2d0c6Smrg			i386mach)
3718fc2d0c6Smrg				basic_machine=i386-mach
3728fc2d0c6Smrg				basic_os=mach
3738fc2d0c6Smrg				;;
3748fc2d0c6Smrg			isi68 | isi)
3758fc2d0c6Smrg				basic_machine=m68k-isi
3768fc2d0c6Smrg				basic_os=sysv
3778fc2d0c6Smrg				;;
3788fc2d0c6Smrg			m68knommu)
3798fc2d0c6Smrg				basic_machine=m68k-unknown
3808fc2d0c6Smrg				basic_os=linux
3818fc2d0c6Smrg				;;
3828fc2d0c6Smrg			magnum | m3230)
3838fc2d0c6Smrg				basic_machine=mips-mips
3848fc2d0c6Smrg				basic_os=sysv
3858fc2d0c6Smrg				;;
3868fc2d0c6Smrg			merlin)
3878fc2d0c6Smrg				basic_machine=ns32k-utek
3888fc2d0c6Smrg				basic_os=sysv
3898fc2d0c6Smrg				;;
3908fc2d0c6Smrg			mingw64)
3918fc2d0c6Smrg				basic_machine=x86_64-pc
3928fc2d0c6Smrg				basic_os=mingw64
3938fc2d0c6Smrg				;;
3948fc2d0c6Smrg			mingw32)
3958fc2d0c6Smrg				basic_machine=i686-pc
3968fc2d0c6Smrg				basic_os=mingw32
3978fc2d0c6Smrg				;;
3988fc2d0c6Smrg			mingw32ce)
3998fc2d0c6Smrg				basic_machine=arm-unknown
4008fc2d0c6Smrg				basic_os=mingw32ce
4018fc2d0c6Smrg				;;
4028fc2d0c6Smrg			monitor)
4038fc2d0c6Smrg				basic_machine=m68k-rom68k
4048fc2d0c6Smrg				basic_os=coff
4058fc2d0c6Smrg				;;
4068fc2d0c6Smrg			morphos)
4078fc2d0c6Smrg				basic_machine=powerpc-unknown
4088fc2d0c6Smrg				basic_os=morphos
4098fc2d0c6Smrg				;;
4108fc2d0c6Smrg			moxiebox)
4118fc2d0c6Smrg				basic_machine=moxie-unknown
4128fc2d0c6Smrg				basic_os=moxiebox
4138fc2d0c6Smrg				;;
4148fc2d0c6Smrg			msdos)
4158fc2d0c6Smrg				basic_machine=i386-pc
4168fc2d0c6Smrg				basic_os=msdos
4178fc2d0c6Smrg				;;
4188fc2d0c6Smrg			msys)
4198fc2d0c6Smrg				basic_machine=i686-pc
4208fc2d0c6Smrg				basic_os=msys
4218fc2d0c6Smrg				;;
4228fc2d0c6Smrg			mvs)
4238fc2d0c6Smrg				basic_machine=i370-ibm
4248fc2d0c6Smrg				basic_os=mvs
4258fc2d0c6Smrg				;;
4268fc2d0c6Smrg			nacl)
4278fc2d0c6Smrg				basic_machine=le32-unknown
4288fc2d0c6Smrg				basic_os=nacl
4298fc2d0c6Smrg				;;
4308fc2d0c6Smrg			ncr3000)
4318fc2d0c6Smrg				basic_machine=i486-ncr
4328fc2d0c6Smrg				basic_os=sysv4
4338fc2d0c6Smrg				;;
4348fc2d0c6Smrg			netbsd386)
4358fc2d0c6Smrg				basic_machine=i386-pc
4368fc2d0c6Smrg				basic_os=netbsd
4378fc2d0c6Smrg				;;
4388fc2d0c6Smrg			netwinder)
4398fc2d0c6Smrg				basic_machine=armv4l-rebel
4408fc2d0c6Smrg				basic_os=linux
4418fc2d0c6Smrg				;;
4428fc2d0c6Smrg			news | news700 | news800 | news900)
4438fc2d0c6Smrg				basic_machine=m68k-sony
4448fc2d0c6Smrg				basic_os=newsos
4458fc2d0c6Smrg				;;
4468fc2d0c6Smrg			news1000)
4478fc2d0c6Smrg				basic_machine=m68030-sony
4488fc2d0c6Smrg				basic_os=newsos
4498fc2d0c6Smrg				;;
4508fc2d0c6Smrg			necv70)
4518fc2d0c6Smrg				basic_machine=v70-nec
4528fc2d0c6Smrg				basic_os=sysv
4538fc2d0c6Smrg				;;
4548fc2d0c6Smrg			nh3000)
4558fc2d0c6Smrg				basic_machine=m68k-harris
4568fc2d0c6Smrg				basic_os=cxux
4578fc2d0c6Smrg				;;
4588fc2d0c6Smrg			nh[45]000)
4598fc2d0c6Smrg				basic_machine=m88k-harris
4608fc2d0c6Smrg				basic_os=cxux
4618fc2d0c6Smrg				;;
4628fc2d0c6Smrg			nindy960)
4638fc2d0c6Smrg				basic_machine=i960-intel
4648fc2d0c6Smrg				basic_os=nindy
4658fc2d0c6Smrg				;;
4668fc2d0c6Smrg			mon960)
4678fc2d0c6Smrg				basic_machine=i960-intel
4688fc2d0c6Smrg				basic_os=mon960
4698fc2d0c6Smrg				;;
4708fc2d0c6Smrg			nonstopux)
4718fc2d0c6Smrg				basic_machine=mips-compaq
4728fc2d0c6Smrg				basic_os=nonstopux
4738fc2d0c6Smrg				;;
4748fc2d0c6Smrg			os400)
4758fc2d0c6Smrg				basic_machine=powerpc-ibm
4768fc2d0c6Smrg				basic_os=os400
4778fc2d0c6Smrg				;;
4788fc2d0c6Smrg			OSE68000 | ose68000)
4798fc2d0c6Smrg				basic_machine=m68000-ericsson
4808fc2d0c6Smrg				basic_os=ose
4818fc2d0c6Smrg				;;
4828fc2d0c6Smrg			os68k)
4838fc2d0c6Smrg				basic_machine=m68k-none
4848fc2d0c6Smrg				basic_os=os68k
4858fc2d0c6Smrg				;;
4868fc2d0c6Smrg			paragon)
4878fc2d0c6Smrg				basic_machine=i860-intel
4888fc2d0c6Smrg				basic_os=osf
4898fc2d0c6Smrg				;;
4908fc2d0c6Smrg			parisc)
4918fc2d0c6Smrg				basic_machine=hppa-unknown
4928fc2d0c6Smrg				basic_os=linux
4938fc2d0c6Smrg				;;
4948fc2d0c6Smrg			psp)
4958fc2d0c6Smrg				basic_machine=mipsallegrexel-sony
4968fc2d0c6Smrg				basic_os=psp
4978fc2d0c6Smrg				;;
4988fc2d0c6Smrg			pw32)
4998fc2d0c6Smrg				basic_machine=i586-unknown
5008fc2d0c6Smrg				basic_os=pw32
5018fc2d0c6Smrg				;;
5028fc2d0c6Smrg			rdos | rdos64)
5038fc2d0c6Smrg				basic_machine=x86_64-pc
5048fc2d0c6Smrg				basic_os=rdos
5058fc2d0c6Smrg				;;
5068fc2d0c6Smrg			rdos32)
5078fc2d0c6Smrg				basic_machine=i386-pc
5088fc2d0c6Smrg				basic_os=rdos
5098fc2d0c6Smrg				;;
5108fc2d0c6Smrg			rom68k)
5118fc2d0c6Smrg				basic_machine=m68k-rom68k
5128fc2d0c6Smrg				basic_os=coff
5138fc2d0c6Smrg				;;
5148fc2d0c6Smrg			sa29200)
5158fc2d0c6Smrg				basic_machine=a29k-amd
5168fc2d0c6Smrg				basic_os=udi
5178fc2d0c6Smrg				;;
5188fc2d0c6Smrg			sei)
5198fc2d0c6Smrg				basic_machine=mips-sei
5208fc2d0c6Smrg				basic_os=seiux
5218fc2d0c6Smrg				;;
5228fc2d0c6Smrg			sequent)
5238fc2d0c6Smrg				basic_machine=i386-sequent
5248fc2d0c6Smrg				basic_os=
5258fc2d0c6Smrg				;;
5268fc2d0c6Smrg			sps7)
5278fc2d0c6Smrg				basic_machine=m68k-bull
5288fc2d0c6Smrg				basic_os=sysv2
5298fc2d0c6Smrg				;;
5308fc2d0c6Smrg			st2000)
5318fc2d0c6Smrg				basic_machine=m68k-tandem
5328fc2d0c6Smrg				basic_os=
5338fc2d0c6Smrg				;;
5348fc2d0c6Smrg			stratus)
5358fc2d0c6Smrg				basic_machine=i860-stratus
5368fc2d0c6Smrg				basic_os=sysv4
5378fc2d0c6Smrg				;;
5388fc2d0c6Smrg			sun2)
5398fc2d0c6Smrg				basic_machine=m68000-sun
5408fc2d0c6Smrg				basic_os=
5418fc2d0c6Smrg				;;
5428fc2d0c6Smrg			sun2os3)
5438fc2d0c6Smrg				basic_machine=m68000-sun
5448fc2d0c6Smrg				basic_os=sunos3
5458fc2d0c6Smrg				;;
5468fc2d0c6Smrg			sun2os4)
5478fc2d0c6Smrg				basic_machine=m68000-sun
5488fc2d0c6Smrg				basic_os=sunos4
5498fc2d0c6Smrg				;;
5508fc2d0c6Smrg			sun3)
5518fc2d0c6Smrg				basic_machine=m68k-sun
5528fc2d0c6Smrg				basic_os=
5538fc2d0c6Smrg				;;
5548fc2d0c6Smrg			sun3os3)
5558fc2d0c6Smrg				basic_machine=m68k-sun
5568fc2d0c6Smrg				basic_os=sunos3
5578fc2d0c6Smrg				;;
5588fc2d0c6Smrg			sun3os4)
5598fc2d0c6Smrg				basic_machine=m68k-sun
5608fc2d0c6Smrg				basic_os=sunos4
5618fc2d0c6Smrg				;;
5628fc2d0c6Smrg			sun4)
5638fc2d0c6Smrg				basic_machine=sparc-sun
5648fc2d0c6Smrg				basic_os=
5658fc2d0c6Smrg				;;
5668fc2d0c6Smrg			sun4os3)
5678fc2d0c6Smrg				basic_machine=sparc-sun
5688fc2d0c6Smrg				basic_os=sunos3
5698fc2d0c6Smrg				;;
5708fc2d0c6Smrg			sun4os4)
5718fc2d0c6Smrg				basic_machine=sparc-sun
5728fc2d0c6Smrg				basic_os=sunos4
5738fc2d0c6Smrg				;;
5748fc2d0c6Smrg			sun4sol2)
5758fc2d0c6Smrg				basic_machine=sparc-sun
5768fc2d0c6Smrg				basic_os=solaris2
5778fc2d0c6Smrg				;;
5788fc2d0c6Smrg			sun386 | sun386i | roadrunner)
5798fc2d0c6Smrg				basic_machine=i386-sun
5808fc2d0c6Smrg				basic_os=
5818fc2d0c6Smrg				;;
5828fc2d0c6Smrg			sv1)
5838fc2d0c6Smrg				basic_machine=sv1-cray
5848fc2d0c6Smrg				basic_os=unicos
5858fc2d0c6Smrg				;;
5868fc2d0c6Smrg			symmetry)
5878fc2d0c6Smrg				basic_machine=i386-sequent
5888fc2d0c6Smrg				basic_os=dynix
5898fc2d0c6Smrg				;;
5908fc2d0c6Smrg			t3e)
5918fc2d0c6Smrg				basic_machine=alphaev5-cray
5928fc2d0c6Smrg				basic_os=unicos
5938fc2d0c6Smrg				;;
5948fc2d0c6Smrg			t90)
5958fc2d0c6Smrg				basic_machine=t90-cray
5968fc2d0c6Smrg				basic_os=unicos
5978fc2d0c6Smrg				;;
5988fc2d0c6Smrg			toad1)
5998fc2d0c6Smrg				basic_machine=pdp10-xkl
6008fc2d0c6Smrg				basic_os=tops20
6018fc2d0c6Smrg				;;
6028fc2d0c6Smrg			tpf)
6038fc2d0c6Smrg				basic_machine=s390x-ibm
6048fc2d0c6Smrg				basic_os=tpf
6058fc2d0c6Smrg				;;
6068fc2d0c6Smrg			udi29k)
6078fc2d0c6Smrg				basic_machine=a29k-amd
6088fc2d0c6Smrg				basic_os=udi
6098fc2d0c6Smrg				;;
6108fc2d0c6Smrg			ultra3)
6118fc2d0c6Smrg				basic_machine=a29k-nyu
6128fc2d0c6Smrg				basic_os=sym1
6138fc2d0c6Smrg				;;
6148fc2d0c6Smrg			v810 | necv810)
6158fc2d0c6Smrg				basic_machine=v810-nec
6168fc2d0c6Smrg				basic_os=none
6178fc2d0c6Smrg				;;
6188fc2d0c6Smrg			vaxv)
6198fc2d0c6Smrg				basic_machine=vax-dec
6208fc2d0c6Smrg				basic_os=sysv
6218fc2d0c6Smrg				;;
6228fc2d0c6Smrg			vms)
6238fc2d0c6Smrg				basic_machine=vax-dec
6248fc2d0c6Smrg				basic_os=vms
6258fc2d0c6Smrg				;;
6268fc2d0c6Smrg			vsta)
6278fc2d0c6Smrg				basic_machine=i386-pc
6288fc2d0c6Smrg				basic_os=vsta
6298fc2d0c6Smrg				;;
6308fc2d0c6Smrg			vxworks960)
6318fc2d0c6Smrg				basic_machine=i960-wrs
6328fc2d0c6Smrg				basic_os=vxworks
6338fc2d0c6Smrg				;;
6348fc2d0c6Smrg			vxworks68)
6358fc2d0c6Smrg				basic_machine=m68k-wrs
6368fc2d0c6Smrg				basic_os=vxworks
6378fc2d0c6Smrg				;;
6388fc2d0c6Smrg			vxworks29k)
6398fc2d0c6Smrg				basic_machine=a29k-wrs
6408fc2d0c6Smrg				basic_os=vxworks
6418fc2d0c6Smrg				;;
6428fc2d0c6Smrg			xbox)
6438fc2d0c6Smrg				basic_machine=i686-pc
6448fc2d0c6Smrg				basic_os=mingw32
6458fc2d0c6Smrg				;;
6468fc2d0c6Smrg			ymp)
6478fc2d0c6Smrg				basic_machine=ymp-cray
6488fc2d0c6Smrg				basic_os=unicos
6498fc2d0c6Smrg				;;
6508fc2d0c6Smrg			*)
6518fc2d0c6Smrg				basic_machine=$1
6528fc2d0c6Smrg				basic_os=
6538fc2d0c6Smrg				;;
6548fc2d0c6Smrg		esac
6554a041c5bSmacallan		;;
6564a041c5bSmacallanesac
6574a041c5bSmacallan
6588fc2d0c6Smrg# Decode 1-component or ad-hoc basic machines
6594a041c5bSmacallancase $basic_machine in
6608fc2d0c6Smrg	# Here we handle the default manufacturer of certain CPU types.  It is in
6618fc2d0c6Smrg	# some cases the only manufacturer, in others, it is the most popular.
6628fc2d0c6Smrg	w89k)
6638fc2d0c6Smrg		cpu=hppa1.1
6648fc2d0c6Smrg		vendor=winbond
6654a041c5bSmacallan		;;
6668fc2d0c6Smrg	op50n)
6678fc2d0c6Smrg		cpu=hppa1.1
6688fc2d0c6Smrg		vendor=oki
6694a041c5bSmacallan		;;
6708fc2d0c6Smrg	op60c)
6718fc2d0c6Smrg		cpu=hppa1.1
6728fc2d0c6Smrg		vendor=oki
6734a041c5bSmacallan		;;
6748fc2d0c6Smrg	ibm*)
6758fc2d0c6Smrg		cpu=i370
6768fc2d0c6Smrg		vendor=ibm
67754b44505Smrg		;;
6788fc2d0c6Smrg	orion105)
6798fc2d0c6Smrg		cpu=clipper
6808fc2d0c6Smrg		vendor=highlevel
68154b44505Smrg		;;
6828fc2d0c6Smrg	mac | mpw | mac-mpw)
6838fc2d0c6Smrg		cpu=m68k
6848fc2d0c6Smrg		vendor=apple
68554b44505Smrg		;;
6868fc2d0c6Smrg	pmac | pmac-mpw)
6878fc2d0c6Smrg		cpu=powerpc
6888fc2d0c6Smrg		vendor=apple
68954b44505Smrg		;;
69054b44505Smrg
6914a041c5bSmacallan	# Recognize the various machine names and aliases which stand
6924a041c5bSmacallan	# for a CPU type and a company and sometimes even an OS.
6934a041c5bSmacallan	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
6948fc2d0c6Smrg		cpu=m68000
6958fc2d0c6Smrg		vendor=att
6964a041c5bSmacallan		;;
6974a041c5bSmacallan	3b*)
6988fc2d0c6Smrg		cpu=we32k
6998fc2d0c6Smrg		vendor=att
7004a041c5bSmacallan		;;
70154b44505Smrg	bluegene*)
7028fc2d0c6Smrg		cpu=powerpc
7038fc2d0c6Smrg		vendor=ibm
7048fc2d0c6Smrg		basic_os=cnk
7054a041c5bSmacallan		;;
7064a041c5bSmacallan	decsystem10* | dec10*)
7078fc2d0c6Smrg		cpu=pdp10
7088fc2d0c6Smrg		vendor=dec
7098fc2d0c6Smrg		basic_os=tops10
7104a041c5bSmacallan		;;
7114a041c5bSmacallan	decsystem20* | dec20*)
7128fc2d0c6Smrg		cpu=pdp10
7138fc2d0c6Smrg		vendor=dec
7148fc2d0c6Smrg		basic_os=tops20
7154a041c5bSmacallan		;;
7164a041c5bSmacallan	delta | 3300 | motorola-3300 | motorola-delta \
7174a041c5bSmacallan	      | 3300-motorola | delta-motorola)
7188fc2d0c6Smrg		cpu=m68k
7198fc2d0c6Smrg		vendor=motorola
7204a041c5bSmacallan		;;
7218fc2d0c6Smrg	dpx2*)
7228fc2d0c6Smrg		cpu=m68k
7238fc2d0c6Smrg		vendor=bull
7248fc2d0c6Smrg		basic_os=sysv3
7254a041c5bSmacallan		;;
7264a041c5bSmacallan	encore | umax | mmax)
7278fc2d0c6Smrg		cpu=ns32k
7288fc2d0c6Smrg		vendor=encore
7294a041c5bSmacallan		;;
7308fc2d0c6Smrg	elxsi)
7318fc2d0c6Smrg		cpu=elxsi
7328fc2d0c6Smrg		vendor=elxsi
7338fc2d0c6Smrg		basic_os=${basic_os:-bsd}
7344a041c5bSmacallan		;;
7354a041c5bSmacallan	fx2800)
7368fc2d0c6Smrg		cpu=i860
7378fc2d0c6Smrg		vendor=alliant
7384a041c5bSmacallan		;;
7394a041c5bSmacallan	genix)
7408fc2d0c6Smrg		cpu=ns32k
7418fc2d0c6Smrg		vendor=ns
7424a041c5bSmacallan		;;
7434a041c5bSmacallan	h3050r* | hiux*)
7448fc2d0c6Smrg		cpu=hppa1.1
7458fc2d0c6Smrg		vendor=hitachi
7468fc2d0c6Smrg		basic_os=hiuxwe2
7474a041c5bSmacallan		;;
7484a041c5bSmacallan	hp3k9[0-9][0-9] | hp9[0-9][0-9])
7498fc2d0c6Smrg		cpu=hppa1.0
7508fc2d0c6Smrg		vendor=hp
7514a041c5bSmacallan		;;
7524a041c5bSmacallan	hp9k2[0-9][0-9] | hp9k31[0-9])
7538fc2d0c6Smrg		cpu=m68000
7548fc2d0c6Smrg		vendor=hp
7554a041c5bSmacallan		;;
7564a041c5bSmacallan	hp9k3[2-9][0-9])
7578fc2d0c6Smrg		cpu=m68k
7588fc2d0c6Smrg		vendor=hp
7594a041c5bSmacallan		;;
7604a041c5bSmacallan	hp9k6[0-9][0-9] | hp6[0-9][0-9])
7618fc2d0c6Smrg		cpu=hppa1.0
7628fc2d0c6Smrg		vendor=hp
7634a041c5bSmacallan		;;
7644a041c5bSmacallan	hp9k7[0-79][0-9] | hp7[0-79][0-9])
7658fc2d0c6Smrg		cpu=hppa1.1
7668fc2d0c6Smrg		vendor=hp
7674a041c5bSmacallan		;;
7684a041c5bSmacallan	hp9k78[0-9] | hp78[0-9])
7694a041c5bSmacallan		# FIXME: really hppa2.0-hp
7708fc2d0c6Smrg		cpu=hppa1.1
7718fc2d0c6Smrg		vendor=hp
7724a041c5bSmacallan		;;
7734a041c5bSmacallan	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
7744a041c5bSmacallan		# FIXME: really hppa2.0-hp
7758fc2d0c6Smrg		cpu=hppa1.1
7768fc2d0c6Smrg		vendor=hp
7774a041c5bSmacallan		;;
7784a041c5bSmacallan	hp9k8[0-9][13679] | hp8[0-9][13679])
7798fc2d0c6Smrg		cpu=hppa1.1
7808fc2d0c6Smrg		vendor=hp
7814a041c5bSmacallan		;;
7824a041c5bSmacallan	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7838fc2d0c6Smrg		cpu=hppa1.0
7848fc2d0c6Smrg		vendor=hp
7854a041c5bSmacallan		;;
7864a041c5bSmacallan	i*86v32)
7878fc2d0c6Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
7888fc2d0c6Smrg		vendor=pc
7898fc2d0c6Smrg		basic_os=sysv32
7904a041c5bSmacallan		;;
7914a041c5bSmacallan	i*86v4*)
7928fc2d0c6Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
7938fc2d0c6Smrg		vendor=pc
7948fc2d0c6Smrg		basic_os=sysv4
7954a041c5bSmacallan		;;
7964a041c5bSmacallan	i*86v)
7978fc2d0c6Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
7988fc2d0c6Smrg		vendor=pc
7998fc2d0c6Smrg		basic_os=sysv
8004a041c5bSmacallan		;;
8014a041c5bSmacallan	i*86sol2)
8028fc2d0c6Smrg		cpu=`echo "$1" | sed -e 's/86.*/86/'`
8038fc2d0c6Smrg		vendor=pc
8048fc2d0c6Smrg		basic_os=solaris2
8054a041c5bSmacallan		;;
8068fc2d0c6Smrg	j90 | j90-cray)
8078fc2d0c6Smrg		cpu=j90
8088fc2d0c6Smrg		vendor=cray
8098fc2d0c6Smrg		basic_os=${basic_os:-unicos}
8104a041c5bSmacallan		;;
8114a041c5bSmacallan	iris | iris4d)
8128fc2d0c6Smrg		cpu=mips
8138fc2d0c6Smrg		vendor=sgi
8148fc2d0c6Smrg		case $basic_os in
8158fc2d0c6Smrg		    irix*)
8164a041c5bSmacallan			;;
8174a041c5bSmacallan		    *)
8188fc2d0c6Smrg			basic_os=irix4
8194a041c5bSmacallan			;;
8204a041c5bSmacallan		esac
8214a041c5bSmacallan		;;
8224a041c5bSmacallan	miniframe)
8238fc2d0c6Smrg		cpu=m68000
8248fc2d0c6Smrg		vendor=convergent
8254a041c5bSmacallan		;;
8268fc2d0c6Smrg	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
8278fc2d0c6Smrg		cpu=m68k
8288fc2d0c6Smrg		vendor=atari
8298fc2d0c6Smrg		basic_os=mint
8304a041c5bSmacallan		;;
8314a041c5bSmacallan	news-3600 | risc-news)
8328fc2d0c6Smrg		cpu=mips
8338fc2d0c6Smrg		vendor=sony
8348fc2d0c6Smrg		basic_os=newsos
8358fc2d0c6Smrg		;;
8368fc2d0c6Smrg	next | m*-next)
8378fc2d0c6Smrg		cpu=m68k
8388fc2d0c6Smrg		vendor=next
8398fc2d0c6Smrg		case $basic_os in
8408fc2d0c6Smrg		    openstep*)
8418fc2d0c6Smrg		        ;;
8428fc2d0c6Smrg		    nextstep*)
8434a041c5bSmacallan			;;
8448fc2d0c6Smrg		    ns2*)
8458fc2d0c6Smrg		      basic_os=nextstep2
8464a041c5bSmacallan			;;
8474a041c5bSmacallan		    *)
8488fc2d0c6Smrg		      basic_os=nextstep3
8494a041c5bSmacallan			;;
8504a041c5bSmacallan		esac
8514a041c5bSmacallan		;;
8524a041c5bSmacallan	np1)
8538fc2d0c6Smrg		cpu=np1
8548fc2d0c6Smrg		vendor=gould
8554a041c5bSmacallan		;;
8564a041c5bSmacallan	op50n-* | op60c-*)
8578fc2d0c6Smrg		cpu=hppa1.1
8588fc2d0c6Smrg		vendor=oki
8598fc2d0c6Smrg		basic_os=proelf
8604a041c5bSmacallan		;;
8614a041c5bSmacallan	pa-hitachi)
8628fc2d0c6Smrg		cpu=hppa1.1
8638fc2d0c6Smrg		vendor=hitachi
8648fc2d0c6Smrg		basic_os=hiuxwe2
8654a041c5bSmacallan		;;
8664a041c5bSmacallan	pbd)
8678fc2d0c6Smrg		cpu=sparc
8688fc2d0c6Smrg		vendor=tti
8694a041c5bSmacallan		;;
8704a041c5bSmacallan	pbb)
8718fc2d0c6Smrg		cpu=m68k
8728fc2d0c6Smrg		vendor=tti
8734a041c5bSmacallan		;;
8748fc2d0c6Smrg	pc532)
8758fc2d0c6Smrg		cpu=ns32k
8768fc2d0c6Smrg		vendor=pc532
8774a041c5bSmacallan		;;
8784a041c5bSmacallan	pn)
8798fc2d0c6Smrg		cpu=pn
8808fc2d0c6Smrg		vendor=gould
8814a041c5bSmacallan		;;
8828fc2d0c6Smrg	power)
8838fc2d0c6Smrg		cpu=power
8848fc2d0c6Smrg		vendor=ibm
8854a041c5bSmacallan		;;
8864a041c5bSmacallan	ps2)
8878fc2d0c6Smrg		cpu=i386
8888fc2d0c6Smrg		vendor=ibm
8894a041c5bSmacallan		;;
8904a041c5bSmacallan	rm[46]00)
8918fc2d0c6Smrg		cpu=mips
8928fc2d0c6Smrg		vendor=siemens
8934a041c5bSmacallan		;;
8944a041c5bSmacallan	rtpc | rtpc-*)
8958fc2d0c6Smrg		cpu=romp
8968fc2d0c6Smrg		vendor=ibm
8974a041c5bSmacallan		;;
8988fc2d0c6Smrg	sde)
8998fc2d0c6Smrg		cpu=mipsisa32
9008fc2d0c6Smrg		vendor=sde
9018fc2d0c6Smrg		basic_os=${basic_os:-elf}
9024a041c5bSmacallan		;;
9038fc2d0c6Smrg	simso-wrs)
9048fc2d0c6Smrg		cpu=sparclite
9058fc2d0c6Smrg		vendor=wrs
9068fc2d0c6Smrg		basic_os=vxworks
9074a041c5bSmacallan		;;
9088fc2d0c6Smrg	tower | tower-32)
9098fc2d0c6Smrg		cpu=m68k
9108fc2d0c6Smrg		vendor=ncr
9114a041c5bSmacallan		;;
9128fc2d0c6Smrg	vpp*|vx|vx-*)
9138fc2d0c6Smrg		cpu=f301
9148fc2d0c6Smrg		vendor=fujitsu
9154a041c5bSmacallan		;;
9168fc2d0c6Smrg	w65)
9178fc2d0c6Smrg		cpu=w65
9188fc2d0c6Smrg		vendor=wdc
9194a041c5bSmacallan		;;
9208fc2d0c6Smrg	w89k-*)
9218fc2d0c6Smrg		cpu=hppa1.1
9228fc2d0c6Smrg		vendor=winbond
9238fc2d0c6Smrg		basic_os=proelf
9244a041c5bSmacallan		;;
9258fc2d0c6Smrg	none)
9268fc2d0c6Smrg		cpu=none
9278fc2d0c6Smrg		vendor=none
9284a041c5bSmacallan		;;
9298fc2d0c6Smrg	leon|leon[3-9])
9308fc2d0c6Smrg		cpu=sparc
9318fc2d0c6Smrg		vendor=$basic_machine
9324a041c5bSmacallan		;;
9338fc2d0c6Smrg	leon-*|leon[3-9]-*)
9348fc2d0c6Smrg		cpu=sparc
9358fc2d0c6Smrg		vendor=`echo "$basic_machine" | sed 's/-.*//'`
9364a041c5bSmacallan		;;
9378fc2d0c6Smrg
9388fc2d0c6Smrg	*-*)
9398fc2d0c6Smrg		# shellcheck disable=SC2162
9408fc2d0c6Smrg		saved_IFS=$IFS
9418fc2d0c6Smrg		IFS="-" read cpu vendor <<EOF
9428fc2d0c6Smrg$basic_machine
9438fc2d0c6SmrgEOF
9448fc2d0c6Smrg		IFS=$saved_IFS
9454a041c5bSmacallan		;;
9468fc2d0c6Smrg	# We use `pc' rather than `unknown'
9478fc2d0c6Smrg	# because (1) that's what they normally are, and
9488fc2d0c6Smrg	# (2) the word "unknown" tends to confuse beginning users.
9498fc2d0c6Smrg	i*86 | x86_64)
9508fc2d0c6Smrg		cpu=$basic_machine
9518fc2d0c6Smrg		vendor=pc
9524a041c5bSmacallan		;;
9538fc2d0c6Smrg	# These rules are duplicated from below for sake of the special case above;
9548fc2d0c6Smrg	# i.e. things that normalized to x86 arches should also default to "pc"
9558fc2d0c6Smrg	pc98)
9568fc2d0c6Smrg		cpu=i386
9578fc2d0c6Smrg		vendor=pc
9584a041c5bSmacallan		;;
9598fc2d0c6Smrg	x64 | amd64)
9608fc2d0c6Smrg		cpu=x86_64
9618fc2d0c6Smrg		vendor=pc
9624a041c5bSmacallan		;;
9638fc2d0c6Smrg	# Recognize the basic CPU types without company name.
9648fc2d0c6Smrg	*)
9658fc2d0c6Smrg		cpu=$basic_machine
9668fc2d0c6Smrg		vendor=unknown
96754b44505Smrg		;;
9688fc2d0c6Smrgesac
9698fc2d0c6Smrg
9708fc2d0c6Smrgunset -v basic_machine
9718fc2d0c6Smrg
9728fc2d0c6Smrg# Decode basic machines in the full and proper CPU-Company form.
9738fc2d0c6Smrgcase $cpu-$vendor in
9748fc2d0c6Smrg	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
9758fc2d0c6Smrg	# some cases the only manufacturer, in others, it is the most popular.
9768fc2d0c6Smrg	craynv-unknown)
9778fc2d0c6Smrg		vendor=cray
9788fc2d0c6Smrg		basic_os=${basic_os:-unicosmp}
9794a041c5bSmacallan		;;
9808fc2d0c6Smrg	c90-unknown | c90-cray)
9818fc2d0c6Smrg		vendor=cray
9828fc2d0c6Smrg		basic_os=${Basic_os:-unicos}
9834a041c5bSmacallan		;;
9848fc2d0c6Smrg	fx80-unknown)
9858fc2d0c6Smrg		vendor=alliant
9864a041c5bSmacallan		;;
9878fc2d0c6Smrg	romp-unknown)
9888fc2d0c6Smrg		vendor=ibm
9894a041c5bSmacallan		;;
9908fc2d0c6Smrg	mmix-unknown)
9918fc2d0c6Smrg		vendor=knuth
9924a041c5bSmacallan		;;
9938fc2d0c6Smrg	microblaze-unknown | microblazeel-unknown)
9948fc2d0c6Smrg		vendor=xilinx
9954a041c5bSmacallan		;;
9968fc2d0c6Smrg	rs6000-unknown)
9978fc2d0c6Smrg		vendor=ibm
9984a041c5bSmacallan		;;
9998fc2d0c6Smrg	vax-unknown)
10008fc2d0c6Smrg		vendor=dec
10014a041c5bSmacallan		;;
10028fc2d0c6Smrg	pdp11-unknown)
10038fc2d0c6Smrg		vendor=dec
10044a041c5bSmacallan		;;
10058fc2d0c6Smrg	we32k-unknown)
10068fc2d0c6Smrg		vendor=att
10074a041c5bSmacallan		;;
10088fc2d0c6Smrg	cydra-unknown)
10098fc2d0c6Smrg		vendor=cydrome
10104a041c5bSmacallan		;;
10118fc2d0c6Smrg	i370-ibm*)
10128fc2d0c6Smrg		vendor=ibm
10134a041c5bSmacallan		;;
10148fc2d0c6Smrg	orion-unknown)
10158fc2d0c6Smrg		vendor=highlevel
10164a041c5bSmacallan		;;
10178fc2d0c6Smrg	xps-unknown | xps100-unknown)
10188fc2d0c6Smrg		cpu=xps100
10198fc2d0c6Smrg		vendor=honeywell
10204a041c5bSmacallan		;;
10218fc2d0c6Smrg
10228fc2d0c6Smrg	# Here we normalize CPU types with a missing or matching vendor
10238fc2d0c6Smrg	dpx20-unknown | dpx20-bull)
10248fc2d0c6Smrg		cpu=rs6000
10258fc2d0c6Smrg		vendor=bull
10268fc2d0c6Smrg		basic_os=${basic_os:-bosx}
10274a041c5bSmacallan		;;
10288fc2d0c6Smrg
10298fc2d0c6Smrg	# Here we normalize CPU types irrespective of the vendor
10308fc2d0c6Smrg	amd64-*)
10318fc2d0c6Smrg		cpu=x86_64
10324a041c5bSmacallan		;;
10338fc2d0c6Smrg	blackfin-*)
10348fc2d0c6Smrg		cpu=bfin
10358fc2d0c6Smrg		basic_os=linux
10364a041c5bSmacallan		;;
10378fc2d0c6Smrg	c54x-*)
10388fc2d0c6Smrg		cpu=tic54x
10394a041c5bSmacallan		;;
10408fc2d0c6Smrg	c55x-*)
10418fc2d0c6Smrg		cpu=tic55x
10424a041c5bSmacallan		;;
10438fc2d0c6Smrg	c6x-*)
10448fc2d0c6Smrg		cpu=tic6x
10454a041c5bSmacallan		;;
10468fc2d0c6Smrg	e500v[12]-*)
10478fc2d0c6Smrg		cpu=powerpc
10488fc2d0c6Smrg		basic_os=${basic_os}"spe"
10494a041c5bSmacallan		;;
10508fc2d0c6Smrg	mips3*-*)
10518fc2d0c6Smrg		cpu=mips64
10524a041c5bSmacallan		;;
10538fc2d0c6Smrg	ms1-*)
10548fc2d0c6Smrg		cpu=mt
10554a041c5bSmacallan		;;
10568fc2d0c6Smrg	m68knommu-*)
10578fc2d0c6Smrg		cpu=m68k
10588fc2d0c6Smrg		basic_os=linux
10594a041c5bSmacallan		;;
10608fc2d0c6Smrg	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
10618fc2d0c6Smrg		cpu=s12z
10624a041c5bSmacallan		;;
10638fc2d0c6Smrg	openrisc-*)
10648fc2d0c6Smrg		cpu=or32
10654a041c5bSmacallan		;;
10668fc2d0c6Smrg	parisc-*)
10678fc2d0c6Smrg		cpu=hppa
10688fc2d0c6Smrg		basic_os=linux
10694a041c5bSmacallan		;;
10708fc2d0c6Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
10718fc2d0c6Smrg		cpu=i586
10724a041c5bSmacallan		;;
10738fc2d0c6Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
10748fc2d0c6Smrg		cpu=i686
10754a041c5bSmacallan		;;
10768fc2d0c6Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
10778fc2d0c6Smrg		cpu=i686
10784a041c5bSmacallan		;;
10798fc2d0c6Smrg	pentium4-*)
10808fc2d0c6Smrg		cpu=i786
10814a041c5bSmacallan		;;
10828fc2d0c6Smrg	pc98-*)
10838fc2d0c6Smrg		cpu=i386
10844a041c5bSmacallan		;;
10858fc2d0c6Smrg	ppc-* | ppcbe-*)
10868fc2d0c6Smrg		cpu=powerpc
10874a041c5bSmacallan		;;
10888fc2d0c6Smrg	ppcle-* | powerpclittle-*)
10898fc2d0c6Smrg		cpu=powerpcle
10904a041c5bSmacallan		;;
10918fc2d0c6Smrg	ppc64-*)
10928fc2d0c6Smrg		cpu=powerpc64
109354b44505Smrg		;;
10948fc2d0c6Smrg	ppc64le-* | powerpc64little-*)
10958fc2d0c6Smrg		cpu=powerpc64le
10964a041c5bSmacallan		;;
10978fc2d0c6Smrg	sb1-*)
10988fc2d0c6Smrg		cpu=mipsisa64sb1
10994a041c5bSmacallan		;;
11008fc2d0c6Smrg	sb1el-*)
11018fc2d0c6Smrg		cpu=mipsisa64sb1el
110254b44505Smrg		;;
11038fc2d0c6Smrg	sh5e[lb]-*)
11048fc2d0c6Smrg		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
11054a041c5bSmacallan		;;
11068fc2d0c6Smrg	spur-*)
11078fc2d0c6Smrg		cpu=spur
11084a041c5bSmacallan		;;
11098fc2d0c6Smrg	strongarm-* | thumb-*)
11108fc2d0c6Smrg		cpu=arm
11114a041c5bSmacallan		;;
11128fc2d0c6Smrg	tx39-*)
11138fc2d0c6Smrg		cpu=mipstx39
11144a041c5bSmacallan		;;
11158fc2d0c6Smrg	tx39el-*)
11168fc2d0c6Smrg		cpu=mipstx39el
11174a041c5bSmacallan		;;
11188fc2d0c6Smrg	x64-*)
11198fc2d0c6Smrg		cpu=x86_64
11204a041c5bSmacallan		;;
11218fc2d0c6Smrg	xscale-* | xscalee[bl]-*)
11228fc2d0c6Smrg		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
11234a041c5bSmacallan		;;
11248fc2d0c6Smrg	arm64-*)
11258fc2d0c6Smrg		cpu=aarch64
11264a041c5bSmacallan		;;
11278fc2d0c6Smrg
11288fc2d0c6Smrg	# Recognize the canonical CPU Types that limit and/or modify the
11298fc2d0c6Smrg	# company names they are paired with.
11308fc2d0c6Smrg	cr16-*)
11318fc2d0c6Smrg		basic_os=${basic_os:-elf}
11324a041c5bSmacallan		;;
11338fc2d0c6Smrg	crisv32-* | etraxfs*-*)
11348fc2d0c6Smrg		cpu=crisv32
11358fc2d0c6Smrg		vendor=axis
11364a041c5bSmacallan		;;
11378fc2d0c6Smrg	cris-* | etrax*-*)
11388fc2d0c6Smrg		cpu=cris
11398fc2d0c6Smrg		vendor=axis
11404a041c5bSmacallan		;;
11418fc2d0c6Smrg	crx-*)
11428fc2d0c6Smrg		basic_os=${basic_os:-elf}
11434a041c5bSmacallan		;;
11448fc2d0c6Smrg	neo-tandem)
11458fc2d0c6Smrg		cpu=neo
11468fc2d0c6Smrg		vendor=tandem
11474a041c5bSmacallan		;;
11488fc2d0c6Smrg	nse-tandem)
11498fc2d0c6Smrg		cpu=nse
11508fc2d0c6Smrg		vendor=tandem
11514a041c5bSmacallan		;;
11528fc2d0c6Smrg	nsr-tandem)
11538fc2d0c6Smrg		cpu=nsr
11548fc2d0c6Smrg		vendor=tandem
11554a041c5bSmacallan		;;
11568fc2d0c6Smrg	nsv-tandem)
11578fc2d0c6Smrg		cpu=nsv
11588fc2d0c6Smrg		vendor=tandem
11594a041c5bSmacallan		;;
11608fc2d0c6Smrg	nsx-tandem)
11618fc2d0c6Smrg		cpu=nsx
11628fc2d0c6Smrg		vendor=tandem
11634a041c5bSmacallan		;;
11648fc2d0c6Smrg	mipsallegrexel-sony)
11658fc2d0c6Smrg		cpu=mipsallegrexel
11668fc2d0c6Smrg		vendor=sony
11674a041c5bSmacallan		;;
11688fc2d0c6Smrg	tile*-*)
11698fc2d0c6Smrg		basic_os=${basic_os:-linux-gnu}
11704a041c5bSmacallan		;;
11718fc2d0c6Smrg
11724a041c5bSmacallan	*)
11738fc2d0c6Smrg		# Recognize the canonical CPU types that are allowed with any
11748fc2d0c6Smrg		# company name.
11758fc2d0c6Smrg		case $cpu in
11768fc2d0c6Smrg			1750a | 580 \
11778fc2d0c6Smrg			| a29k \
11788fc2d0c6Smrg			| aarch64 | aarch64_be \
11798fc2d0c6Smrg			| abacus \
11808fc2d0c6Smrg			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
11818fc2d0c6Smrg			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
11828fc2d0c6Smrg			| alphapca5[67] | alpha64pca5[67] \
11838fc2d0c6Smrg			| am33_2.0 \
11848fc2d0c6Smrg			| amdgcn \
11858fc2d0c6Smrg			| arc | arceb | arc32 | arc64 \
11868fc2d0c6Smrg			| arm | arm[lb]e | arme[lb] | armv* \
11878fc2d0c6Smrg			| avr | avr32 \
11888fc2d0c6Smrg			| asmjs \
11898fc2d0c6Smrg			| ba \
11908fc2d0c6Smrg			| be32 | be64 \
11918fc2d0c6Smrg			| bfin | bpf | bs2000 \
11928fc2d0c6Smrg			| c[123]* | c30 | [cjt]90 | c4x \
11938fc2d0c6Smrg			| c8051 | clipper | craynv | csky | cydra \
11948fc2d0c6Smrg			| d10v | d30v | dlx | dsp16xx \
11958fc2d0c6Smrg			| e2k | elxsi | epiphany \
11968fc2d0c6Smrg			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
11978fc2d0c6Smrg			| h8300 | h8500 \
11988fc2d0c6Smrg			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
11998fc2d0c6Smrg			| hexagon \
12008fc2d0c6Smrg			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
12018fc2d0c6Smrg			| ip2k | iq2000 \
12028fc2d0c6Smrg			| k1om \
12038fc2d0c6Smrg			| le32 | le64 \
12048fc2d0c6Smrg			| lm32 \
12058fc2d0c6Smrg			| loongarch32 | loongarch64 | loongarchx32 \
12068fc2d0c6Smrg			| m32c | m32r | m32rle \
12078fc2d0c6Smrg			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
12088fc2d0c6Smrg			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
12098fc2d0c6Smrg			| m88110 | m88k | maxq | mb | mcore | mep | metag \
12108fc2d0c6Smrg			| microblaze | microblazeel \
12118fc2d0c6Smrg			| mips | mipsbe | mipseb | mipsel | mipsle \
12128fc2d0c6Smrg			| mips16 \
12138fc2d0c6Smrg			| mips64 | mips64eb | mips64el \
12148fc2d0c6Smrg			| mips64octeon | mips64octeonel \
12158fc2d0c6Smrg			| mips64orion | mips64orionel \
12168fc2d0c6Smrg			| mips64r5900 | mips64r5900el \
12178fc2d0c6Smrg			| mips64vr | mips64vrel \
12188fc2d0c6Smrg			| mips64vr4100 | mips64vr4100el \
12198fc2d0c6Smrg			| mips64vr4300 | mips64vr4300el \
12208fc2d0c6Smrg			| mips64vr5000 | mips64vr5000el \
12218fc2d0c6Smrg			| mips64vr5900 | mips64vr5900el \
12228fc2d0c6Smrg			| mipsisa32 | mipsisa32el \
12238fc2d0c6Smrg			| mipsisa32r2 | mipsisa32r2el \
12248fc2d0c6Smrg			| mipsisa32r3 | mipsisa32r3el \
12258fc2d0c6Smrg			| mipsisa32r5 | mipsisa32r5el \
12268fc2d0c6Smrg			| mipsisa32r6 | mipsisa32r6el \
12278fc2d0c6Smrg			| mipsisa64 | mipsisa64el \
12288fc2d0c6Smrg			| mipsisa64r2 | mipsisa64r2el \
12298fc2d0c6Smrg			| mipsisa64r3 | mipsisa64r3el \
12308fc2d0c6Smrg			| mipsisa64r5 | mipsisa64r5el \
12318fc2d0c6Smrg			| mipsisa64r6 | mipsisa64r6el \
12328fc2d0c6Smrg			| mipsisa64sb1 | mipsisa64sb1el \
12338fc2d0c6Smrg			| mipsisa64sr71k | mipsisa64sr71kel \
12348fc2d0c6Smrg			| mipsr5900 | mipsr5900el \
12358fc2d0c6Smrg			| mipstx39 | mipstx39el \
12368fc2d0c6Smrg			| mmix \
12378fc2d0c6Smrg			| mn10200 | mn10300 \
12388fc2d0c6Smrg			| moxie \
12398fc2d0c6Smrg			| mt \
12408fc2d0c6Smrg			| msp430 \
12418fc2d0c6Smrg			| nds32 | nds32le | nds32be \
12428fc2d0c6Smrg			| nfp \
12438fc2d0c6Smrg			| nios | nios2 | nios2eb | nios2el \
12448fc2d0c6Smrg			| none | np1 | ns16k | ns32k | nvptx \
12458fc2d0c6Smrg			| open8 \
12468fc2d0c6Smrg			| or1k* \
12478fc2d0c6Smrg			| or32 \
12488fc2d0c6Smrg			| orion \
12498fc2d0c6Smrg			| picochip \
12508fc2d0c6Smrg			| pdp10 | pdp11 | pj | pjl | pn | power \
12518fc2d0c6Smrg			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
12528fc2d0c6Smrg			| pru \
12538fc2d0c6Smrg			| pyramid \
12548fc2d0c6Smrg			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
12558fc2d0c6Smrg			| rl78 | romp | rs6000 | rx \
12568fc2d0c6Smrg			| s390 | s390x \
12578fc2d0c6Smrg			| score \
12588fc2d0c6Smrg			| sh | shl \
12598fc2d0c6Smrg			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
12608fc2d0c6Smrg			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
12618fc2d0c6Smrg			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
12628fc2d0c6Smrg			| sparclite \
12638fc2d0c6Smrg			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
12648fc2d0c6Smrg			| spu \
12658fc2d0c6Smrg			| tahoe \
12668fc2d0c6Smrg			| thumbv7* \
12678fc2d0c6Smrg			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
12688fc2d0c6Smrg			| tron \
12698fc2d0c6Smrg			| ubicom32 \
12708fc2d0c6Smrg			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
12718fc2d0c6Smrg			| vax \
12728fc2d0c6Smrg			| visium \
12738fc2d0c6Smrg			| w65 \
12748fc2d0c6Smrg			| wasm32 | wasm64 \
12758fc2d0c6Smrg			| we32k \
12768fc2d0c6Smrg			| x86 | x86_64 | xc16x | xgate | xps100 \
12778fc2d0c6Smrg			| xstormy16 | xtensa* \
12788fc2d0c6Smrg			| ymp \
12798fc2d0c6Smrg			| z8k | z80)
12808fc2d0c6Smrg				;;
12818fc2d0c6Smrg
12828fc2d0c6Smrg			*)
12838fc2d0c6Smrg				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
12848fc2d0c6Smrg				exit 1
12858fc2d0c6Smrg				;;
12868fc2d0c6Smrg		esac
12874a041c5bSmacallan		;;
12884a041c5bSmacallanesac
12894a041c5bSmacallan
12904a041c5bSmacallan# Here we canonicalize certain aliases for manufacturers.
12918fc2d0c6Smrgcase $vendor in
12928fc2d0c6Smrg	digital*)
12938fc2d0c6Smrg		vendor=dec
12944a041c5bSmacallan		;;
12958fc2d0c6Smrg	commodore*)
12968fc2d0c6Smrg		vendor=cbm
12974a041c5bSmacallan		;;
12984a041c5bSmacallan	*)
12994a041c5bSmacallan		;;
13004a041c5bSmacallanesac
13014a041c5bSmacallan
13024a041c5bSmacallan# Decode manufacturer-specific aliases for certain operating systems.
13034a041c5bSmacallan
13048fc2d0c6Smrgif test x$basic_os != x
13054a041c5bSmacallanthen
13068fc2d0c6Smrg
13078fc2d0c6Smrg# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
13088fc2d0c6Smrg# set os.
13098fc2d0c6Smrgcase $basic_os in
13108fc2d0c6Smrg	gnu/linux*)
13118fc2d0c6Smrg		kernel=linux
13128fc2d0c6Smrg		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
13138fc2d0c6Smrg		;;
13148fc2d0c6Smrg	os2-emx)
13158fc2d0c6Smrg		kernel=os2
13168fc2d0c6Smrg		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
13178fc2d0c6Smrg		;;
13188fc2d0c6Smrg	nto-qnx*)
13198fc2d0c6Smrg		kernel=nto
13208fc2d0c6Smrg		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
13218fc2d0c6Smrg		;;
13228fc2d0c6Smrg	*-*)
13238fc2d0c6Smrg		# shellcheck disable=SC2162
13248fc2d0c6Smrg		saved_IFS=$IFS
13258fc2d0c6Smrg		IFS="-" read kernel os <<EOF
13268fc2d0c6Smrg$basic_os
13278fc2d0c6SmrgEOF
13288fc2d0c6Smrg		IFS=$saved_IFS
13298fc2d0c6Smrg		;;
13308fc2d0c6Smrg	# Default OS when just kernel was specified
13318fc2d0c6Smrg	nto*)
13328fc2d0c6Smrg		kernel=nto
13338fc2d0c6Smrg		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
13348fc2d0c6Smrg		;;
13358fc2d0c6Smrg	linux*)
13368fc2d0c6Smrg		kernel=linux
13378fc2d0c6Smrg		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
133854b44505Smrg		;;
13398fc2d0c6Smrg	*)
13408fc2d0c6Smrg		kernel=
13418fc2d0c6Smrg		os=$basic_os
13424a041c5bSmacallan		;;
13438fc2d0c6Smrgesac
13448fc2d0c6Smrg
13458fc2d0c6Smrg# Now, normalize the OS (knowing we just have one component, it's not a kernel,
13468fc2d0c6Smrg# etc.)
13478fc2d0c6Smrgcase $os in
13488fc2d0c6Smrg	# First match some system type aliases that might get confused
13498fc2d0c6Smrg	# with valid system types.
13508fc2d0c6Smrg	# solaris* is a basic system type, with this one exception.
13518fc2d0c6Smrg	auroraux)
13528fc2d0c6Smrg		os=auroraux
13534a041c5bSmacallan		;;
13548fc2d0c6Smrg	bluegene*)
13558fc2d0c6Smrg		os=cnk
13564a041c5bSmacallan		;;
13578fc2d0c6Smrg	solaris1 | solaris1.*)
13588fc2d0c6Smrg		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
13594a041c5bSmacallan		;;
13608fc2d0c6Smrg	solaris)
13618fc2d0c6Smrg		os=solaris2
13624a041c5bSmacallan		;;
13638fc2d0c6Smrg	unixware*)
13648fc2d0c6Smrg		os=sysv4.2uw
13654a041c5bSmacallan		;;
13668fc2d0c6Smrg	# es1800 is here to avoid being matched by es* (a different OS)
13678fc2d0c6Smrg	es1800*)
13688fc2d0c6Smrg		os=ose
13694a041c5bSmacallan		;;
13708fc2d0c6Smrg	# Some version numbers need modification
13718fc2d0c6Smrg	chorusos*)
13728fc2d0c6Smrg		os=chorusos
13734a041c5bSmacallan		;;
13748fc2d0c6Smrg	isc)
13758fc2d0c6Smrg		os=isc2.2
13764a041c5bSmacallan		;;
13778fc2d0c6Smrg	sco6)
13788fc2d0c6Smrg		os=sco5v6
13794a041c5bSmacallan		;;
13808fc2d0c6Smrg	sco5)
13818fc2d0c6Smrg		os=sco3.2v5
13824a041c5bSmacallan		;;
13838fc2d0c6Smrg	sco4)
13848fc2d0c6Smrg		os=sco3.2v4
13854a041c5bSmacallan		;;
13868fc2d0c6Smrg	sco3.2.[4-9]*)
13878fc2d0c6Smrg		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
13884a041c5bSmacallan		;;
13898fc2d0c6Smrg	sco*v* | scout)
13908fc2d0c6Smrg		# Don't match below
13914a041c5bSmacallan		;;
13928fc2d0c6Smrg	sco*)
13938fc2d0c6Smrg		os=sco3.2v2
13944a041c5bSmacallan		;;
13958fc2d0c6Smrg	psos*)
13968fc2d0c6Smrg		os=psos
13974a041c5bSmacallan		;;
13988fc2d0c6Smrg	qnx*)
13998fc2d0c6Smrg		os=qnx
14004a041c5bSmacallan		;;
14018fc2d0c6Smrg	hiux*)
14028fc2d0c6Smrg		os=hiuxwe2
14034a041c5bSmacallan		;;
14048fc2d0c6Smrg	lynx*178)
14058fc2d0c6Smrg		os=lynxos178
14064a041c5bSmacallan		;;
14078fc2d0c6Smrg	lynx*5)
14088fc2d0c6Smrg		os=lynxos5
14094a041c5bSmacallan		;;
14108fc2d0c6Smrg	lynxos*)
14118fc2d0c6Smrg		# don't get caught up in next wildcard
14124a041c5bSmacallan		;;
14138fc2d0c6Smrg	lynx*)
14148fc2d0c6Smrg		os=lynxos
14154a041c5bSmacallan		;;
14168fc2d0c6Smrg	mac[0-9]*)
14178fc2d0c6Smrg		os=`echo "$os" | sed -e 's|mac|macos|'`
14184a041c5bSmacallan		;;
14198fc2d0c6Smrg	opened*)
14208fc2d0c6Smrg		os=openedition
14214a041c5bSmacallan		;;
14228fc2d0c6Smrg	os400*)
14238fc2d0c6Smrg		os=os400
14244a041c5bSmacallan		;;
14258fc2d0c6Smrg	sunos5*)
14268fc2d0c6Smrg		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
14274a041c5bSmacallan		;;
14288fc2d0c6Smrg	sunos6*)
14298fc2d0c6Smrg		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
14304a041c5bSmacallan		;;
14318fc2d0c6Smrg	wince*)
14328fc2d0c6Smrg		os=wince
14334a041c5bSmacallan		;;
14348fc2d0c6Smrg	utek*)
14358fc2d0c6Smrg		os=bsd
14364a041c5bSmacallan		;;
14378fc2d0c6Smrg	dynix*)
14388fc2d0c6Smrg		os=bsd
14398fc2d0c6Smrg		;;
14408fc2d0c6Smrg	acis*)
14418fc2d0c6Smrg		os=aos
14424a041c5bSmacallan		;;
14438fc2d0c6Smrg	atheos*)
14448fc2d0c6Smrg		os=atheos
14454a041c5bSmacallan		;;
14468fc2d0c6Smrg	syllable*)
14478fc2d0c6Smrg		os=syllable
14484a041c5bSmacallan		;;
14498fc2d0c6Smrg	386bsd)
14508fc2d0c6Smrg		os=bsd
14514a041c5bSmacallan		;;
14528fc2d0c6Smrg	ctix* | uts*)
14538fc2d0c6Smrg		os=sysv
14544a041c5bSmacallan		;;
14558fc2d0c6Smrg	nova*)
14568fc2d0c6Smrg		os=rtmk-nova
14574a041c5bSmacallan		;;
14588fc2d0c6Smrg	ns2)
14598fc2d0c6Smrg		os=nextstep2
14604a041c5bSmacallan		;;
14618fc2d0c6Smrg	# Preserve the version number of sinix5.
14628fc2d0c6Smrg	sinix5.*)
14638fc2d0c6Smrg		os=`echo "$os" | sed -e 's|sinix|sysv|'`
14644a041c5bSmacallan		;;
14658fc2d0c6Smrg	sinix*)
14668fc2d0c6Smrg		os=sysv4
14674a041c5bSmacallan		;;
14688fc2d0c6Smrg	tpf*)
14698fc2d0c6Smrg		os=tpf
14704a041c5bSmacallan		;;
14718fc2d0c6Smrg	triton*)
14728fc2d0c6Smrg		os=sysv3
14734a041c5bSmacallan		;;
14748fc2d0c6Smrg	oss*)
14758fc2d0c6Smrg		os=sysv3
14764a041c5bSmacallan		;;
14778fc2d0c6Smrg	svr4*)
14788fc2d0c6Smrg		os=sysv4
14794a041c5bSmacallan		;;
14808fc2d0c6Smrg	svr3)
14818fc2d0c6Smrg		os=sysv3
14824a041c5bSmacallan		;;
14838fc2d0c6Smrg	sysvr4)
14848fc2d0c6Smrg		os=sysv4
14854a041c5bSmacallan		;;
14868fc2d0c6Smrg	ose*)
14878fc2d0c6Smrg		os=ose
148854b44505Smrg		;;
14898fc2d0c6Smrg	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
14908fc2d0c6Smrg		os=mint
149154b44505Smrg		;;
14928fc2d0c6Smrg	dicos*)
14938fc2d0c6Smrg		os=dicos
14940a392d7eSmrg		;;
14958fc2d0c6Smrg	pikeos*)
14968fc2d0c6Smrg		# Until real need of OS specific support for
14978fc2d0c6Smrg		# particular features comes up, bare metal
14988fc2d0c6Smrg		# configurations are quite functional.
14998fc2d0c6Smrg		case $cpu in
15008fc2d0c6Smrg		    arm*)
15018fc2d0c6Smrg			os=eabi
15028fc2d0c6Smrg			;;
15038fc2d0c6Smrg		    *)
15048fc2d0c6Smrg			os=elf
15058fc2d0c6Smrg			;;
15068fc2d0c6Smrg		esac
15074a041c5bSmacallan		;;
15084a041c5bSmacallan	*)
15098fc2d0c6Smrg		# No normalization, but not necessarily accepted, that comes below.
15104a041c5bSmacallan		;;
15114a041c5bSmacallanesac
15128fc2d0c6Smrg
15134a041c5bSmacallanelse
15144a041c5bSmacallan
15154a041c5bSmacallan# Here we handle the default operating systems that come with various machines.
15164a041c5bSmacallan# The value should be what the vendor currently ships out the door with their
15174a041c5bSmacallan# machine or put another way, the most popular os provided with the machine.
15184a041c5bSmacallan
15194a041c5bSmacallan# Note that if you're going to try to match "-MANUFACTURER" here (say,
15204a041c5bSmacallan# "-sun"), then you have to tell the case statement up towards the top
15214a041c5bSmacallan# that MANUFACTURER isn't an operating system.  Otherwise, code above
15224a041c5bSmacallan# will signal an error saying that MANUFACTURER isn't an operating
15234a041c5bSmacallan# system, and we'll never get to this point.
15244a041c5bSmacallan
15258fc2d0c6Smrgkernel=
15268fc2d0c6Smrgcase $cpu-$vendor in
152754b44505Smrg	score-*)
15288fc2d0c6Smrg		os=elf
15294a041c5bSmacallan		;;
153054b44505Smrg	spu-*)
15318fc2d0c6Smrg		os=elf
15324a041c5bSmacallan		;;
15334a041c5bSmacallan	*-acorn)
15348fc2d0c6Smrg		os=riscix1.2
15354a041c5bSmacallan		;;
15364a041c5bSmacallan	arm*-rebel)
15378fc2d0c6Smrg		kernel=linux
15388fc2d0c6Smrg		os=gnu
15394a041c5bSmacallan		;;
15404a041c5bSmacallan	arm*-semi)
15418fc2d0c6Smrg		os=aout
15424a041c5bSmacallan		;;
154354b44505Smrg	c4x-* | tic4x-*)
15448fc2d0c6Smrg		os=coff
154554b44505Smrg		;;
15460a392d7eSmrg	c8051-*)
15478fc2d0c6Smrg		os=elf
15488fc2d0c6Smrg		;;
15498fc2d0c6Smrg	clipper-intergraph)
15508fc2d0c6Smrg		os=clix
15510a392d7eSmrg		;;
155254b44505Smrg	hexagon-*)
15538fc2d0c6Smrg		os=elf
155454b44505Smrg		;;
155554b44505Smrg	tic54x-*)
15568fc2d0c6Smrg		os=coff
155754b44505Smrg		;;
155854b44505Smrg	tic55x-*)
15598fc2d0c6Smrg		os=coff
156054b44505Smrg		;;
156154b44505Smrg	tic6x-*)
15628fc2d0c6Smrg		os=coff
15634a041c5bSmacallan		;;
15644a041c5bSmacallan	# This must come before the *-dec entry.
15654a041c5bSmacallan	pdp10-*)
15668fc2d0c6Smrg		os=tops20
15674a041c5bSmacallan		;;
15684a041c5bSmacallan	pdp11-*)
15698fc2d0c6Smrg		os=none
15704a041c5bSmacallan		;;
15714a041c5bSmacallan	*-dec | vax-*)
15728fc2d0c6Smrg		os=ultrix4.2
15734a041c5bSmacallan		;;
15744a041c5bSmacallan	m68*-apollo)
15758fc2d0c6Smrg		os=domain
15764a041c5bSmacallan		;;
15774a041c5bSmacallan	i386-sun)
15788fc2d0c6Smrg		os=sunos4.0.2
15794a041c5bSmacallan		;;
15804a041c5bSmacallan	m68000-sun)
15818fc2d0c6Smrg		os=sunos3
15824a041c5bSmacallan		;;
15834a041c5bSmacallan	m68*-cisco)
15848fc2d0c6Smrg		os=aout
15854a041c5bSmacallan		;;
158654b44505Smrg	mep-*)
15878fc2d0c6Smrg		os=elf
15884a041c5bSmacallan		;;
15894a041c5bSmacallan	mips*-cisco)
15908fc2d0c6Smrg		os=elf
15914a041c5bSmacallan		;;
15924a041c5bSmacallan	mips*-*)
15938fc2d0c6Smrg		os=elf
15944a041c5bSmacallan		;;
15954a041c5bSmacallan	or32-*)
15968fc2d0c6Smrg		os=coff
15974a041c5bSmacallan		;;
15984a041c5bSmacallan	*-tti)	# must be before sparc entry or we get the wrong os.
15998fc2d0c6Smrg		os=sysv3
16004a041c5bSmacallan		;;
16014a041c5bSmacallan	sparc-* | *-sun)
16028fc2d0c6Smrg		os=sunos4.1.1
16034a041c5bSmacallan		;;
16048fc2d0c6Smrg	pru-*)
16058fc2d0c6Smrg		os=elf
16064a041c5bSmacallan		;;
16078fc2d0c6Smrg	*-be)
16088fc2d0c6Smrg		os=beos
16094a041c5bSmacallan		;;
16104a041c5bSmacallan	*-ibm)
16118fc2d0c6Smrg		os=aix
16124a041c5bSmacallan		;;
161354b44505Smrg	*-knuth)
16148fc2d0c6Smrg		os=mmixware
16154a041c5bSmacallan		;;
16164a041c5bSmacallan	*-wec)
16178fc2d0c6Smrg		os=proelf
16184a041c5bSmacallan		;;
16194a041c5bSmacallan	*-winbond)
16208fc2d0c6Smrg		os=proelf
16214a041c5bSmacallan		;;
16224a041c5bSmacallan	*-oki)
16238fc2d0c6Smrg		os=proelf
16244a041c5bSmacallan		;;
16254a041c5bSmacallan	*-hp)
16268fc2d0c6Smrg		os=hpux
16274a041c5bSmacallan		;;
16284a041c5bSmacallan	*-hitachi)
16298fc2d0c6Smrg		os=hiux
16304a041c5bSmacallan		;;
16314a041c5bSmacallan	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
16328fc2d0c6Smrg		os=sysv
16334a041c5bSmacallan		;;
16344a041c5bSmacallan	*-cbm)
16358fc2d0c6Smrg		os=amigaos
16364a041c5bSmacallan		;;
16374a041c5bSmacallan	*-dg)
16388fc2d0c6Smrg		os=dgux
16394a041c5bSmacallan		;;
16404a041c5bSmacallan	*-dolphin)
16418fc2d0c6Smrg		os=sysv3
16424a041c5bSmacallan		;;
16434a041c5bSmacallan	m68k-ccur)
16448fc2d0c6Smrg		os=rtu
16454a041c5bSmacallan		;;
16464a041c5bSmacallan	m88k-omron*)
16478fc2d0c6Smrg		os=luna
16484a041c5bSmacallan		;;
16498fc2d0c6Smrg	*-next)
16508fc2d0c6Smrg		os=nextstep
16514a041c5bSmacallan		;;
16524a041c5bSmacallan	*-sequent)
16538fc2d0c6Smrg		os=ptx
16544a041c5bSmacallan		;;
16554a041c5bSmacallan	*-crds)
16568fc2d0c6Smrg		os=unos
16574a041c5bSmacallan		;;
16584a041c5bSmacallan	*-ns)
16598fc2d0c6Smrg		os=genix
16604a041c5bSmacallan		;;
16614a041c5bSmacallan	i370-*)
16628fc2d0c6Smrg		os=mvs
16634a041c5bSmacallan		;;
16644a041c5bSmacallan	*-gould)
16658fc2d0c6Smrg		os=sysv
16664a041c5bSmacallan		;;
16674a041c5bSmacallan	*-highlevel)
16688fc2d0c6Smrg		os=bsd
16694a041c5bSmacallan		;;
16704a041c5bSmacallan	*-encore)
16718fc2d0c6Smrg		os=bsd
16724a041c5bSmacallan		;;
16734a041c5bSmacallan	*-sgi)
16748fc2d0c6Smrg		os=irix
16754a041c5bSmacallan		;;
16764a041c5bSmacallan	*-siemens)
16778fc2d0c6Smrg		os=sysv4
16784a041c5bSmacallan		;;
16794a041c5bSmacallan	*-masscomp)
16808fc2d0c6Smrg		os=rtu
16814a041c5bSmacallan		;;
16824a041c5bSmacallan	f30[01]-fujitsu | f700-fujitsu)
16838fc2d0c6Smrg		os=uxpv
16844a041c5bSmacallan		;;
16854a041c5bSmacallan	*-rom68k)
16868fc2d0c6Smrg		os=coff
16874a041c5bSmacallan		;;
16884a041c5bSmacallan	*-*bug)
16898fc2d0c6Smrg		os=coff
16904a041c5bSmacallan		;;
16914a041c5bSmacallan	*-apple)
16928fc2d0c6Smrg		os=macos
16934a041c5bSmacallan		;;
16944a041c5bSmacallan	*-atari*)
16958fc2d0c6Smrg		os=mint
16968fc2d0c6Smrg		;;
16978fc2d0c6Smrg	*-wrs)
16988fc2d0c6Smrg		os=vxworks
16994a041c5bSmacallan		;;
17004a041c5bSmacallan	*)
17018fc2d0c6Smrg		os=none
17024a041c5bSmacallan		;;
17034a041c5bSmacallanesac
17048fc2d0c6Smrg
17054a041c5bSmacallanfi
17064a041c5bSmacallan
17078fc2d0c6Smrg# Now, validate our (potentially fixed-up) OS.
17088fc2d0c6Smrgcase $os in
17098fc2d0c6Smrg	# Sometimes we do "kernel-libc", so those need to count as OSes.
17108fc2d0c6Smrg	musl* | newlib* | relibc* | uclibc*)
17118fc2d0c6Smrg		;;
17128fc2d0c6Smrg	# Likewise for "kernel-abi"
17138fc2d0c6Smrg	eabi* | gnueabi*)
17148fc2d0c6Smrg		;;
17158fc2d0c6Smrg	# VxWorks passes extra cpu info in the 4th filed.
17168fc2d0c6Smrg	simlinux | simwindows | spe)
17178fc2d0c6Smrg		;;
17188fc2d0c6Smrg	# Now accept the basic system types.
17198fc2d0c6Smrg	# The portable systems comes first.
17208fc2d0c6Smrg	# Each alternative MUST end in a * to match a version number.
17218fc2d0c6Smrg	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
17228fc2d0c6Smrg	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
17238fc2d0c6Smrg	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
17248fc2d0c6Smrg	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
17258fc2d0c6Smrg	     | hiux* | abug | nacl* | netware* | windows* \
17268fc2d0c6Smrg	     | os9* | macos* | osx* | ios* \
17278fc2d0c6Smrg	     | mpw* | magic* | mmixware* | mon960* | lnews* \
17288fc2d0c6Smrg	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
17298fc2d0c6Smrg	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
17308fc2d0c6Smrg	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
17318fc2d0c6Smrg	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
17328fc2d0c6Smrg	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
17338fc2d0c6Smrg	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
17348fc2d0c6Smrg	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
17358fc2d0c6Smrg	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
17368fc2d0c6Smrg	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
17378fc2d0c6Smrg	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
17388fc2d0c6Smrg	     | chorusrdb* | cegcc* | glidix* | serenity* \
17398fc2d0c6Smrg	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
17408fc2d0c6Smrg	     | midipix* | mingw32* | mingw64* | mint* \
17418fc2d0c6Smrg	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
17428fc2d0c6Smrg	     | interix* | uwin* | mks* | rhapsody* | darwin* \
17438fc2d0c6Smrg	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
17448fc2d0c6Smrg	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
17458fc2d0c6Smrg	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
17468fc2d0c6Smrg	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
17478fc2d0c6Smrg	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
17488fc2d0c6Smrg	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
17498fc2d0c6Smrg	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
17508fc2d0c6Smrg	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
17518fc2d0c6Smrg	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr*)
17528fc2d0c6Smrg		;;
17538fc2d0c6Smrg	# This one is extra strict with allowed versions
17548fc2d0c6Smrg	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
17558fc2d0c6Smrg		# Don't forget version if it is 3.2v4 or newer.
17568fc2d0c6Smrg		;;
17578fc2d0c6Smrg	none)
17588fc2d0c6Smrg		;;
17598fc2d0c6Smrg	*)
17608fc2d0c6Smrg		echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
17618fc2d0c6Smrg		exit 1
17628fc2d0c6Smrg		;;
17638fc2d0c6Smrgesac
17648fc2d0c6Smrg
17658fc2d0c6Smrg# As a final step for OS-related things, validate the OS-kernel combination
17668fc2d0c6Smrg# (given a valid OS), if there is a kernel.
17678fc2d0c6Smrgcase $kernel-$os in
17688fc2d0c6Smrg	linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
17698fc2d0c6Smrg		   | linux-musl* | linux-relibc* | linux-uclibc* )
17708fc2d0c6Smrg		;;
17718fc2d0c6Smrg	uclinux-uclibc* )
17728fc2d0c6Smrg		;;
17738fc2d0c6Smrg	-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
17748fc2d0c6Smrg		# These are just libc implementations, not actual OSes, and thus
17758fc2d0c6Smrg		# require a kernel.
17768fc2d0c6Smrg		echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
17778fc2d0c6Smrg		exit 1
17788fc2d0c6Smrg		;;
17798fc2d0c6Smrg	kfreebsd*-gnu* | kopensolaris*-gnu*)
17808fc2d0c6Smrg		;;
17818fc2d0c6Smrg	vxworks-simlinux | vxworks-simwindows | vxworks-spe)
17828fc2d0c6Smrg		;;
17838fc2d0c6Smrg	nto-qnx*)
17848fc2d0c6Smrg		;;
17858fc2d0c6Smrg	os2-emx)
17868fc2d0c6Smrg		;;
17878fc2d0c6Smrg	*-eabi* | *-gnueabi*)
17888fc2d0c6Smrg		;;
17898fc2d0c6Smrg	-*)
17908fc2d0c6Smrg		# Blank kernel with real OS is always fine.
17918fc2d0c6Smrg		;;
17928fc2d0c6Smrg	*-*)
17938fc2d0c6Smrg		echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
17948fc2d0c6Smrg		exit 1
17958fc2d0c6Smrg		;;
17968fc2d0c6Smrgesac
17978fc2d0c6Smrg
17984a041c5bSmacallan# Here we handle the case where we know the os, and the CPU type, but not the
17994a041c5bSmacallan# manufacturer.  We pick the logical manufacturer.
18008fc2d0c6Smrgcase $vendor in
18018fc2d0c6Smrg	unknown)
18028fc2d0c6Smrg		case $cpu-$os in
18038fc2d0c6Smrg			*-riscix*)
18044a041c5bSmacallan				vendor=acorn
18054a041c5bSmacallan				;;
18068fc2d0c6Smrg			*-sunos*)
18074a041c5bSmacallan				vendor=sun
18084a041c5bSmacallan				;;
18098fc2d0c6Smrg			*-cnk* | *-aix*)
18104a041c5bSmacallan				vendor=ibm
18114a041c5bSmacallan				;;
18128fc2d0c6Smrg			*-beos*)
18134a041c5bSmacallan				vendor=be
18144a041c5bSmacallan				;;
18158fc2d0c6Smrg			*-hpux*)
18164a041c5bSmacallan				vendor=hp
18174a041c5bSmacallan				;;
18188fc2d0c6Smrg			*-mpeix*)
18194a041c5bSmacallan				vendor=hp
18204a041c5bSmacallan				;;
18218fc2d0c6Smrg			*-hiux*)
18224a041c5bSmacallan				vendor=hitachi
18234a041c5bSmacallan				;;
18248fc2d0c6Smrg			*-unos*)
18254a041c5bSmacallan				vendor=crds
18264a041c5bSmacallan				;;
18278fc2d0c6Smrg			*-dgux*)
18284a041c5bSmacallan				vendor=dg
18294a041c5bSmacallan				;;
18308fc2d0c6Smrg			*-luna*)
18314a041c5bSmacallan				vendor=omron
18324a041c5bSmacallan				;;
18338fc2d0c6Smrg			*-genix*)
18344a041c5bSmacallan				vendor=ns
18354a041c5bSmacallan				;;
18368fc2d0c6Smrg			*-clix*)
18378fc2d0c6Smrg				vendor=intergraph
18388fc2d0c6Smrg				;;
18398fc2d0c6Smrg			*-mvs* | *-opened*)
18408fc2d0c6Smrg				vendor=ibm
18418fc2d0c6Smrg				;;
18428fc2d0c6Smrg			*-os400*)
18434a041c5bSmacallan				vendor=ibm
18444a041c5bSmacallan				;;
18458fc2d0c6Smrg			s390-* | s390x-*)
18464a041c5bSmacallan				vendor=ibm
18474a041c5bSmacallan				;;
18488fc2d0c6Smrg			*-ptx*)
18494a041c5bSmacallan				vendor=sequent
18504a041c5bSmacallan				;;
18518fc2d0c6Smrg			*-tpf*)
18524a041c5bSmacallan				vendor=ibm
18534a041c5bSmacallan				;;
18548fc2d0c6Smrg			*-vxsim* | *-vxworks* | *-windiss*)
18554a041c5bSmacallan				vendor=wrs
18564a041c5bSmacallan				;;
18578fc2d0c6Smrg			*-aux*)
18584a041c5bSmacallan				vendor=apple
18594a041c5bSmacallan				;;
18608fc2d0c6Smrg			*-hms*)
18614a041c5bSmacallan				vendor=hitachi
18624a041c5bSmacallan				;;
18638fc2d0c6Smrg			*-mpw* | *-macos*)
18644a041c5bSmacallan				vendor=apple
18654a041c5bSmacallan				;;
18668fc2d0c6Smrg			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
18674a041c5bSmacallan				vendor=atari
18684a041c5bSmacallan				;;
18698fc2d0c6Smrg			*-vos*)
18704a041c5bSmacallan				vendor=stratus
18714a041c5bSmacallan				;;
18724a041c5bSmacallan		esac
18734a041c5bSmacallan		;;
18744a041c5bSmacallanesac
18754a041c5bSmacallan
18768fc2d0c6Smrgecho "$cpu-$vendor-${kernel:+$kernel-}$os"
18774a041c5bSmacallanexit
18784a041c5bSmacallan
18794a041c5bSmacallan# Local variables:
18808fc2d0c6Smrg# eval: (add-hook 'before-save-hook 'time-stamp)
18814a041c5bSmacallan# time-stamp-start: "timestamp='"
18824a041c5bSmacallan# time-stamp-format: "%:y-%02m-%02d"
18834a041c5bSmacallan# time-stamp-end: "'"
18844a041c5bSmacallan# End:
1885