Blame SOURCES/config.sub

3f601b
#! /bin/sh
3f601b
# Configuration validation subroutine script.
3f601b
#   Copyright 1992-2018 Free Software Foundation, Inc.
3f601b
3f601b
timestamp='2018-08-29'
3f601b
3f601b
# This file is free software; you can redistribute it and/or modify it
3f601b
# under the terms of the GNU General Public License as published by
3f601b
# the Free Software Foundation; either version 3 of the License, or
3f601b
# (at your option) any later version.
3f601b
#
3f601b
# This program is distributed in the hope that it will be useful, but
3f601b
# WITHOUT ANY WARRANTY; without even the implied warranty of
3f601b
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
3f601b
# General Public License for more details.
3f601b
#
3f601b
# You should have received a copy of the GNU General Public License
3f601b
# along with this program; if not, see <https://www.gnu.org/licenses/>.
3f601b
#
3f601b
# As a special exception to the GNU General Public License, if you
3f601b
# distribute this file as part of a program that contains a
3f601b
# configuration script generated by Autoconf, you may include it under
3f601b
# the same distribution terms that you use for the rest of that
3f601b
# program.  This Exception is an additional permission under section 7
3f601b
# of the GNU General Public License, version 3 ("GPLv3").
3f601b
3f601b
3f601b
# Please send patches to <config-patches@gnu.org>.
3f601b
#
3f601b
# Configuration subroutine to validate and canonicalize a configuration type.
3f601b
# Supply the specified configuration type as an argument.
3f601b
# If it is invalid, we print an error message on stderr and exit with code 1.
3f601b
# Otherwise, we print the canonical config type on stdout and succeed.
3f601b
3f601b
# You can get the latest version of this script from:
3f601b
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
3f601b
3f601b
# This file is supposed to be the same for all GNU packages
3f601b
# and recognize all the CPU types, system types and aliases
3f601b
# that are meaningful with *any* GNU software.
3f601b
# Each package is responsible for reporting which valid configurations
3f601b
# it does not support.  The user should be able to distinguish
3f601b
# a failure to support a valid configuration from a meaningless
3f601b
# configuration.
3f601b
3f601b
# The goal of this file is to map all the various variations of a given
3f601b
# machine specification into a single specification in the form:
3f601b
#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
3f601b
# or in some cases, the newer four-part form:
3f601b
#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
3f601b
# It is wrong to echo any other type of specification.
3f601b
3f601b
me=`echo "$0" | sed -e 's,.*/,,'`
3f601b
3f601b
usage="\
3f601b
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
3f601b
3f601b
Canonicalize a configuration name.
3f601b
3f601b
Options:
3f601b
  -h, --help         print this help, then exit
3f601b
  -t, --time-stamp   print date of last modification, then exit
3f601b
  -v, --version      print version number, then exit
3f601b
3f601b
Report bugs and patches to <config-patches@gnu.org>."
3f601b
3f601b
version="\
3f601b
GNU config.sub ($timestamp)
3f601b
3f601b
Copyright 1992-2018 Free Software Foundation, Inc.
3f601b
3f601b
This is free software; see the source for copying conditions.  There is NO
3f601b
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
3f601b
3f601b
help="
3f601b
Try \`$me --help' for more information."
3f601b
3f601b
# Parse command line
3f601b
while test $# -gt 0 ; do
3f601b
  case $1 in
3f601b
    --time-stamp | --time* | -t )
3f601b
       echo "$timestamp" ; exit ;;
3f601b
    --version | -v )
3f601b
       echo "$version" ; exit ;;
3f601b
    --help | --h* | -h )
3f601b
       echo "$usage"; exit ;;
3f601b
    -- )     # Stop option processing
3f601b
       shift; break ;;
3f601b
    - )	# Use stdin as input.
3f601b
       break ;;
3f601b
    -* )
3f601b
       echo "$me: invalid option $1$help"
3f601b
       exit 1 ;;
3f601b
3f601b
    *local*)
3f601b
       # First pass through any local machine types.
3f601b
       echo "$1"
3f601b
       exit ;;
3f601b
3f601b
    * )
3f601b
       break ;;
3f601b
  esac
3f601b
done
3f601b
3f601b
case $# in
3f601b
 0) echo "$me: missing argument$help" >&2
3f601b
    exit 1;;
3f601b
 1) ;;
3f601b
 *) echo "$me: too many arguments$help" >&2
3f601b
    exit 1;;
3f601b
esac
3f601b
3f601b
# Split fields of configuration type
3f601b
IFS="-" read -r field1 field2 field3 field4 <
3f601b
$1
3f601b
EOF
3f601b
3f601b
# Separate into logical components for further validation
3f601b
case $1 in
3f601b
	*-*-*-*-*)
3f601b
		echo Invalid configuration \`"$1"\': more than four components >&2
3f601b
		exit 1
3f601b
		;;
3f601b
	*-*-*-*)
3f601b
		basic_machine=$field1-$field2
3f601b
		os=$field3-$field4
3f601b
		;;
3f601b
	*-*-*)
3f601b
		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
3f601b
		# parts
3f601b
		maybe_os=$field2-$field3
3f601b
		case $maybe_os in
3f601b
			nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
3f601b
			| linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
3f601b
			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
3f601b
			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
3f601b
			| storm-chaos* | os2-emx* | rtmk-nova*)
3f601b
				basic_machine=$field1
3f601b
				os=$maybe_os
3f601b
				;;
3f601b
			android-linux)
3f601b
				basic_machine=$field1-unknown
3f601b
				os=linux-android
3f601b
				;;
3f601b
			*)
3f601b
				basic_machine=$field1-$field2
3f601b
				os=$field3
3f601b
				;;
3f601b
		esac
3f601b
		;;
3f601b
	*-*)
3f601b
		# A lone config we happen to match not fitting any patern
3f601b
		case $field1-$field2 in
3f601b
			decstation-3100)
3f601b
				basic_machine=mips-dec
3f601b
				os=
3f601b
				;;
3f601b
			*-*)
3f601b
				# Second component is usually, but not always the OS
3f601b
				case $field2 in
3f601b
					# Prevent following clause from handling this valid os
3f601b
					sun*os*)
3f601b
						basic_machine=$field1
3f601b
						os=$field2
3f601b
						;;
3f601b
					# Manufacturers
3f601b
					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
3f601b
					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
3f601b
					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
3f601b
					| convergent* | ncr* | news | 32* | 3600* | 3100* \
3f601b
					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
3f601b
					| ultra | tti* | harris | dolphin | highlevel | gould \
3f601b
					| cbm | ns | masscomp | apple | axis | knuth | cray \
3f601b
					| microblaze* | sim | cisco \
3f601b
					| oki | wec | wrs | winbond)
3f601b
						basic_machine=$field1-$field2
3f601b
						os=
3f601b
						;;
3f601b
					*)
3f601b
						basic_machine=$field1
3f601b
						os=$field2
3f601b
						;;
3f601b
				esac
3f601b
			;;
3f601b
		esac
3f601b
		;;
3f601b
	*)
3f601b
		# Convert single-component short-hands not valid as part of
3f601b
		# multi-component configurations.
3f601b
		case $field1 in
3f601b
			386bsd)
3f601b
				basic_machine=i386-pc
3f601b
				os=bsd
3f601b
				;;
3f601b
			a29khif)
3f601b
				basic_machine=a29k-amd
3f601b
				os=udi
3f601b
				;;
3f601b
			adobe68k)
3f601b
				basic_machine=m68010-adobe
3f601b
				os=scout
3f601b
				;;
3f601b
			alliant)
3f601b
				basic_machine=fx80-alliant
3f601b
				os=
3f601b
				;;
3f601b
			altos | altos3068)
3f601b
				basic_machine=m68k-altos
3f601b
				os=
3f601b
				;;
3f601b
			am29k)
3f601b
				basic_machine=a29k-none
3f601b
				os=bsd
3f601b
				;;
3f601b
			amdahl)
3f601b
				basic_machine=580-amdahl
3f601b
				os=sysv
3f601b
				;;
3f601b
			amiga)
3f601b
				basic_machine=m68k-unknown
3f601b
				os=
3f601b
				;;
3f601b
			amigaos | amigados)
3f601b
				basic_machine=m68k-unknown
3f601b
				os=amigaos
3f601b
				;;
3f601b
			amigaunix | amix)
3f601b
				basic_machine=m68k-unknown
3f601b
				os=sysv4
3f601b
				;;
3f601b
			apollo68)
3f601b
				basic_machine=m68k-apollo
3f601b
				os=sysv
3f601b
				;;
3f601b
			apollo68bsd)
3f601b
				basic_machine=m68k-apollo
3f601b
				os=bsd
3f601b
				;;
3f601b
			aros)
3f601b
				basic_machine=i386-pc
3f601b
				os=aros
3f601b
				;;
3f601b
			aux)
3f601b
				basic_machine=m68k-apple
3f601b
				os=aux
3f601b
				;;
3f601b
			balance)
3f601b
				basic_machine=ns32k-sequent
3f601b
				os=dynix
3f601b
				;;
3f601b
			blackfin)
3f601b
				basic_machine=bfin-unknown
3f601b
				os=linux
3f601b
				;;
3f601b
			cegcc)
3f601b
				basic_machine=arm-unknown
3f601b
				os=cegcc
3f601b
				;;
3f601b
			convex-c1)
3f601b
				basic_machine=c1-convex
3f601b
				os=bsd
3f601b
				;;
3f601b
			convex-c2)
3f601b
				basic_machine=c2-convex
3f601b
				os=bsd
3f601b
				;;
3f601b
			convex-c32)
3f601b
				basic_machine=c32-convex
3f601b
				os=bsd
3f601b
				;;
3f601b
			convex-c34)
3f601b
				basic_machine=c34-convex
3f601b
				os=bsd
3f601b
				;;
3f601b
			convex-c38)
3f601b
				basic_machine=c38-convex
3f601b
				os=bsd
3f601b
				;;
3f601b
			cray)
3f601b
				basic_machine=j90-cray
3f601b
				os=unicos
3f601b
				;;
3f601b
			crds | unos)
3f601b
				basic_machine=m68k-crds
3f601b
				os=
3f601b
				;;
3f601b
			da30)
3f601b
				basic_machine=m68k-da30
3f601b
				os=
3f601b
				;;
3f601b
			decstation | pmax | pmin | dec3100 | decstatn)
3f601b
				basic_machine=mips-dec
3f601b
				os=
3f601b
				;;
3f601b
			delta88)
3f601b
				basic_machine=m88k-motorola
3f601b
				os=sysv3
3f601b
				;;
3f601b
			dicos)
3f601b
				basic_machine=i686-pc
3f601b
				os=dicos
3f601b
				;;
3f601b
			djgpp)
3f601b
				basic_machine=i586-pc
3f601b
				os=msdosdjgpp
3f601b
				;;
3f601b
			ebmon29k)
3f601b
				basic_machine=a29k-amd
3f601b
				os=ebmon
3f601b
				;;
3f601b
			es1800 | OSE68k | ose68k | ose | OSE)
3f601b
				basic_machine=m68k-ericsson
3f601b
				os=ose
3f601b
				;;
3f601b
			gmicro)
3f601b
				basic_machine=tron-gmicro
3f601b
				os=sysv
3f601b
				;;
3f601b
			go32)
3f601b
				basic_machine=i386-pc
3f601b
				os=go32
3f601b
				;;
3f601b
			h8300hms)
3f601b
				basic_machine=h8300-hitachi
3f601b
				os=hms
3f601b
				;;
3f601b
			h8300xray)
3f601b
				basic_machine=h8300-hitachi
3f601b
				os=xray
3f601b
				;;
3f601b
			h8500hms)
3f601b
				basic_machine=h8500-hitachi
3f601b
				os=hms
3f601b
				;;
3f601b
			harris)
3f601b
				basic_machine=m88k-harris
3f601b
				os=sysv3
3f601b
				;;
3f601b
			hp300)
3f601b
				basic_machine=m68k-hp
3f601b
				;;
3f601b
			hp300bsd)
3f601b
				basic_machine=m68k-hp
3f601b
				os=bsd
3f601b
				;;
3f601b
			hp300hpux)
3f601b
				basic_machine=m68k-hp
3f601b
				os=hpux
3f601b
				;;
3f601b
			hppaosf)
3f601b
				basic_machine=hppa1.1-hp
3f601b
				os=osf
3f601b
				;;
3f601b
			hppro)
3f601b
				basic_machine=hppa1.1-hp
3f601b
				os=proelf
3f601b
				;;
3f601b
			i386mach)
3f601b
				basic_machine=i386-mach
3f601b
				os=mach
3f601b
				;;
3f601b
			vsta)
3f601b
				basic_machine=i386-pc
3f601b
				os=vsta
3f601b
				;;
3f601b
			isi68 | isi)
3f601b
				basic_machine=m68k-isi
3f601b
				os=sysv
3f601b
				;;
3f601b
			m68knommu)
3f601b
				basic_machine=m68k-unknown
3f601b
				os=linux
3f601b
				;;
3f601b
			magnum | m3230)
3f601b
				basic_machine=mips-mips
3f601b
				os=sysv
3f601b
				;;
3f601b
			merlin)
3f601b
				basic_machine=ns32k-utek
3f601b
				os=sysv
3f601b
				;;
3f601b
			mingw64)
3f601b
				basic_machine=x86_64-pc
3f601b
				os=mingw64
3f601b
				;;
3f601b
			mingw32)
3f601b
				basic_machine=i686-pc
3f601b
				os=mingw32
3f601b
				;;
3f601b
			mingw32ce)
3f601b
				basic_machine=arm-unknown
3f601b
				os=mingw32ce
3f601b
				;;
3f601b
			monitor)
3f601b
				basic_machine=m68k-rom68k
3f601b
				os=coff
3f601b
				;;
3f601b
			morphos)
3f601b
				basic_machine=powerpc-unknown
3f601b
				os=morphos
3f601b
				;;
3f601b
			moxiebox)
3f601b
				basic_machine=moxie-unknown
3f601b
				os=moxiebox
3f601b
				;;
3f601b
			msdos)
3f601b
				basic_machine=i386-pc
3f601b
				os=msdos
3f601b
				;;
3f601b
			msys)
3f601b
				basic_machine=i686-pc
3f601b
				os=msys
3f601b
				;;
3f601b
			mvs)
3f601b
				basic_machine=i370-ibm
3f601b
				os=mvs
3f601b
				;;
3f601b
			nacl)
3f601b
				basic_machine=le32-unknown
3f601b
				os=nacl
3f601b
				;;
3f601b
			ncr3000)
3f601b
				basic_machine=i486-ncr
3f601b
				os=sysv4
3f601b
				;;
3f601b
			netbsd386)
3f601b
				basic_machine=i386-pc
3f601b
				os=netbsd
3f601b
				;;
3f601b
			netwinder)
3f601b
				basic_machine=armv4l-rebel
3f601b
				os=linux
3f601b
				;;
3f601b
			news | news700 | news800 | news900)
3f601b
				basic_machine=m68k-sony
3f601b
				os=newsos
3f601b
				;;
3f601b
			news1000)
3f601b
				basic_machine=m68030-sony
3f601b
				os=newsos
3f601b
				;;
3f601b
			necv70)
3f601b
				basic_machine=v70-nec
3f601b
				os=sysv
3f601b
				;;
3f601b
			nh3000)
3f601b
				basic_machine=m68k-harris
3f601b
				os=cxux
3f601b
				;;
3f601b
			nh[45]000)
3f601b
				basic_machine=m88k-harris
3f601b
				os=cxux
3f601b
				;;
3f601b
			nindy960)
3f601b
				basic_machine=i960-intel
3f601b
				os=nindy
3f601b
				;;
3f601b
			mon960)
3f601b
				basic_machine=i960-intel
3f601b
				os=mon960
3f601b
				;;
3f601b
			nonstopux)
3f601b
				basic_machine=mips-compaq
3f601b
				os=nonstopux
3f601b
				;;
3f601b
			os400)
3f601b
				basic_machine=powerpc-ibm
3f601b
				os=os400
3f601b
				;;
3f601b
			OSE68000 | ose68000)
3f601b
				basic_machine=m68000-ericsson
3f601b
				os=ose
3f601b
				;;
3f601b
			os68k)
3f601b
				basic_machine=m68k-none
3f601b
				os=os68k
3f601b
				;;
3f601b
			paragon)
3f601b
				basic_machine=i860-intel
3f601b
				os=osf
3f601b
				;;
3f601b
			parisc)
3f601b
				basic_machine=hppa-unknown
3f601b
				os=linux
3f601b
				;;
3f601b
			pw32)
3f601b
				basic_machine=i586-unknown
3f601b
				os=pw32
3f601b
				;;
3f601b
			rdos | rdos64)
3f601b
				basic_machine=x86_64-pc
3f601b
				os=rdos
3f601b
				;;
3f601b
			rdos32)
3f601b
				basic_machine=i386-pc
3f601b
				os=rdos
3f601b
				;;
3f601b
			rom68k)
3f601b
				basic_machine=m68k-rom68k
3f601b
				os=coff
3f601b
				;;
3f601b
			sa29200)
3f601b
				basic_machine=a29k-amd
3f601b
				os=udi
3f601b
				;;
3f601b
			sei)
3f601b
				basic_machine=mips-sei
3f601b
				os=seiux
3f601b
				;;
3f601b
			sequent)
3f601b
				basic_machine=i386-sequent
3f601b
				os=
3f601b
				;;
3f601b
			sps7)
3f601b
				basic_machine=m68k-bull
3f601b
				os=sysv2
3f601b
				;;
3f601b
			st2000)
3f601b
				basic_machine=m68k-tandem
3f601b
				os=
3f601b
				;;
3f601b
			stratus)
3f601b
				basic_machine=i860-stratus
3f601b
				os=sysv4
3f601b
				;;
3f601b
			sun2)
3f601b
				basic_machine=m68000-sun
3f601b
				os=
3f601b
				;;
3f601b
			sun2os3)
3f601b
				basic_machine=m68000-sun
3f601b
				os=sunos3
3f601b
				;;
3f601b
			sun2os4)
3f601b
				basic_machine=m68000-sun
3f601b
				os=sunos4
3f601b
				;;
3f601b
			sun3)
3f601b
				basic_machine=m68k-sun
3f601b
				os=
3f601b
				;;
3f601b
			sun3os3)
3f601b
				basic_machine=m68k-sun
3f601b
				os=sunos3
3f601b
				;;
3f601b
			sun3os4)
3f601b
				basic_machine=m68k-sun
3f601b
				os=sunos4
3f601b
				;;
3f601b
			sun4)
3f601b
				basic_machine=sparc-sun
3f601b
				os=
3f601b
				;;
3f601b
			sun4os3)
3f601b
				basic_machine=sparc-sun
3f601b
				os=sunos3
3f601b
				;;
3f601b
			sun4os4)
3f601b
				basic_machine=sparc-sun
3f601b
				os=sunos4
3f601b
				;;
3f601b
			sun4sol2)
3f601b
				basic_machine=sparc-sun
3f601b
				os=solaris2
3f601b
				;;
3f601b
			sun386 | sun386i | roadrunner)
3f601b
				basic_machine=i386-sun
3f601b
				os=
3f601b
				;;
3f601b
			sv1)
3f601b
				basic_machine=sv1-cray
3f601b
				os=unicos
3f601b
				;;
3f601b
			symmetry)
3f601b
				basic_machine=i386-sequent
3f601b
				os=dynix
3f601b
				;;
3f601b
			t3e)
3f601b
				basic_machine=alphaev5-cray
3f601b
				os=unicos
3f601b
				;;
3f601b
			t90)
3f601b
				basic_machine=t90-cray
3f601b
				os=unicos
3f601b
				;;
3f601b
			toad1)
3f601b
				basic_machine=pdp10-xkl
3f601b
				os=tops20
3f601b
				;;
3f601b
			tpf)
3f601b
				basic_machine=s390x-ibm
3f601b
				os=tpf
3f601b
				;;
3f601b
			udi29k)
3f601b
				basic_machine=a29k-amd
3f601b
				os=udi
3f601b
				;;
3f601b
			ultra3)
3f601b
				basic_machine=a29k-nyu
3f601b
				os=sym1
3f601b
				;;
3f601b
			v810 | necv810)
3f601b
				basic_machine=v810-nec
3f601b
				os=none
3f601b
				;;
3f601b
			vaxv)
3f601b
				basic_machine=vax-dec
3f601b
				os=sysv
3f601b
				;;
3f601b
			vms)
3f601b
				basic_machine=vax-dec
3f601b
				os=vms
3f601b
				;;
3f601b
			vxworks960)
3f601b
				basic_machine=i960-wrs
3f601b
				os=vxworks
3f601b
				;;
3f601b
			vxworks68)
3f601b
				basic_machine=m68k-wrs
3f601b
				os=vxworks
3f601b
				;;
3f601b
			vxworks29k)
3f601b
				basic_machine=a29k-wrs
3f601b
				os=vxworks
3f601b
				;;
3f601b
			xbox)
3f601b
				basic_machine=i686-pc
3f601b
				os=mingw32
3f601b
				;;
3f601b
			ymp)
3f601b
				basic_machine=ymp-cray
3f601b
				os=unicos
3f601b
				;;
3f601b
			*)
3f601b
				basic_machine=$1
3f601b
				os=
3f601b
				;;
3f601b
		esac
3f601b
		;;
3f601b
esac
3f601b
3f601b
# Decode 1-component or ad-hoc basic machines
3f601b
case $basic_machine in
3f601b
	# Here we handle the default manufacturer of certain CPU types.  It is in
3f601b
	# some cases the only manufacturer, in others, it is the most popular.
3f601b
	w89k)
3f601b
		cpu=hppa1.1
3f601b
		vendor=winbond
3f601b
		;;
3f601b
	op50n)
3f601b
		cpu=hppa1.1
3f601b
		vendor=oki
3f601b
		;;
3f601b
	op60c)
3f601b
		cpu=hppa1.1
3f601b
		vendor=oki
3f601b
		;;
3f601b
	ibm*)
3f601b
		cpu=i370
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	orion105)
3f601b
		cpu=clipper
3f601b
		vendor=highlevel
3f601b
		;;
3f601b
	mac | mpw | mac-mpw)
3f601b
		cpu=m68k
3f601b
		vendor=apple
3f601b
		;;
3f601b
	pmac | pmac-mpw)
3f601b
		cpu=powerpc
3f601b
		vendor=apple
3f601b
		;;
3f601b
3f601b
	# Recognize the various machine names and aliases which stand
3f601b
	# for a CPU type and a company and sometimes even an OS.
3f601b
	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
3f601b
		cpu=m68000
3f601b
		vendor=att
3f601b
		;;
3f601b
	3b*)
3f601b
		cpu=we32k
3f601b
		vendor=att
3f601b
		;;
3f601b
	bluegene*)
3f601b
		cpu=powerpc
3f601b
		vendor=ibm
3f601b
		os=cnk
3f601b
		;;
3f601b
	decsystem10* | dec10*)
3f601b
		cpu=pdp10
3f601b
		vendor=dec
3f601b
		os=tops10
3f601b
		;;
3f601b
	decsystem20* | dec20*)
3f601b
		cpu=pdp10
3f601b
		vendor=dec
3f601b
		os=tops20
3f601b
		;;
3f601b
	delta | 3300 | motorola-3300 | motorola-delta \
3f601b
	      | 3300-motorola | delta-motorola)
3f601b
		cpu=m68k
3f601b
		vendor=motorola
3f601b
		;;
3f601b
	dpx2*)
3f601b
		cpu=m68k
3f601b
		vendor=bull
3f601b
		os=sysv3
3f601b
		;;
3f601b
	encore | umax | mmax)
3f601b
		cpu=ns32k
3f601b
		vendor=encore
3f601b
		;;
3f601b
	elxsi)
3f601b
		cpu=elxsi
3f601b
		vendor=elxsi
3f601b
		os=${os:-bsd}
3f601b
		;;
3f601b
	fx2800)
3f601b
		cpu=i860
3f601b
		vendor=alliant
3f601b
		;;
3f601b
	genix)
3f601b
		cpu=ns32k
3f601b
		vendor=ns
3f601b
		;;
3f601b
	h3050r* | hiux*)
3f601b
		cpu=hppa1.1
3f601b
		vendor=hitachi
3f601b
		os=hiuxwe2
3f601b
		;;
3f601b
	hp3k9[0-9][0-9] | hp9[0-9][0-9])
3f601b
		cpu=hppa1.0
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k2[0-9][0-9] | hp9k31[0-9])
3f601b
		cpu=m68000
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k3[2-9][0-9])
3f601b
		cpu=m68k
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k6[0-9][0-9] | hp6[0-9][0-9])
3f601b
		cpu=hppa1.0
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k7[0-79][0-9] | hp7[0-79][0-9])
3f601b
		cpu=hppa1.1
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k78[0-9] | hp78[0-9])
3f601b
		# FIXME: really hppa2.0-hp
3f601b
		cpu=hppa1.1
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
3f601b
		# FIXME: really hppa2.0-hp
3f601b
		cpu=hppa1.1
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k8[0-9][13679] | hp8[0-9][13679])
3f601b
		cpu=hppa1.1
3f601b
		vendor=hp
3f601b
		;;
3f601b
	hp9k8[0-9][0-9] | hp8[0-9][0-9])
3f601b
		cpu=hppa1.0
3f601b
		vendor=hp
3f601b
		;;
3f601b
	i*86v32)
3f601b
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
3f601b
		vendor=pc
3f601b
		os=sysv32
3f601b
		;;
3f601b
	i*86v4*)
3f601b
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
3f601b
		vendor=pc
3f601b
		os=sysv4
3f601b
		;;
3f601b
	i*86v)
3f601b
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
3f601b
		vendor=pc
3f601b
		os=sysv
3f601b
		;;
3f601b
	i*86sol2)
3f601b
		cpu=`echo "$1" | sed -e 's/86.*/86/'`
3f601b
		vendor=pc
3f601b
		os=solaris2
3f601b
		;;
3f601b
	j90 | j90-cray)
3f601b
		cpu=j90
3f601b
		vendor=cray
3f601b
		os=${os:-unicos}
3f601b
		;;
3f601b
	iris | iris4d)
3f601b
		cpu=mips
3f601b
		vendor=sgi
3f601b
		case $os in
3f601b
		    irix*)
3f601b
			;;
3f601b
		    *)
3f601b
			os=irix4
3f601b
			;;
3f601b
		esac
3f601b
		;;
3f601b
	miniframe)
3f601b
		cpu=m68000
3f601b
		vendor=convergent
3f601b
		;;
3f601b
	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
3f601b
		cpu=m68k
3f601b
		vendor=atari
3f601b
		os=mint
3f601b
		;;
3f601b
	news-3600 | risc-news)
3f601b
		cpu=mips
3f601b
		vendor=sony
3f601b
		os=newsos
3f601b
		;;
3f601b
	next | m*-next)
3f601b
		cpu=m68k
3f601b
		vendor=next
3f601b
		case $os in
3f601b
		    nextstep* )
3f601b
			;;
3f601b
		    ns2*)
3f601b
		      os=nextstep2
3f601b
			;;
3f601b
		    *)
3f601b
		      os=nextstep3
3f601b
			;;
3f601b
		esac
3f601b
		;;
3f601b
	np1)
3f601b
		cpu=np1
3f601b
		vendor=gould
3f601b
		;;
3f601b
	op50n-* | op60c-*)
3f601b
		cpu=hppa1.1
3f601b
		vendor=oki
3f601b
		os=proelf
3f601b
		;;
3f601b
	pa-hitachi)
3f601b
		cpu=hppa1.1
3f601b
		vendor=hitachi
3f601b
		os=hiuxwe2
3f601b
		;;
3f601b
	pbd)
3f601b
		cpu=sparc
3f601b
		vendor=tti
3f601b
		;;
3f601b
	pbb)
3f601b
		cpu=m68k
3f601b
		vendor=tti
3f601b
		;;
3f601b
	pc532)
3f601b
		cpu=ns32k
3f601b
		vendor=pc532
3f601b
		;;
3f601b
	pn)
3f601b
		cpu=pn
3f601b
		vendor=gould
3f601b
		;;
3f601b
	power)
3f601b
		cpu=power
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	ps2)
3f601b
		cpu=i386
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	rm[46]00)
3f601b
		cpu=mips
3f601b
		vendor=siemens
3f601b
		;;
3f601b
	rtpc | rtpc-*)
3f601b
		cpu=romp
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	sde)
3f601b
		cpu=mipsisa32
3f601b
		vendor=sde
3f601b
		os=${os:-elf}
3f601b
		;;
3f601b
	simso-wrs)
3f601b
		cpu=sparclite
3f601b
		vendor=wrs
3f601b
		os=vxworks
3f601b
		;;
3f601b
	tower | tower-32)
3f601b
		cpu=m68k
3f601b
		vendor=ncr
3f601b
		;;
3f601b
	vpp*|vx|vx-*)
3f601b
		cpu=f301
3f601b
		vendor=fujitsu
3f601b
		;;
3f601b
	w65)
3f601b
		cpu=w65
3f601b
		vendor=wdc
3f601b
		;;
3f601b
	w89k-*)
3f601b
		cpu=hppa1.1
3f601b
		vendor=winbond
3f601b
		os=proelf
3f601b
		;;
3f601b
	none)
3f601b
		cpu=none
3f601b
		vendor=none
3f601b
		;;
3f601b
	leon|leon[3-9])
3f601b
		cpu=sparc
3f601b
		vendor=$basic_machine
3f601b
		;;
3f601b
	leon-*|leon[3-9]-*)
3f601b
		cpu=sparc
3f601b
		vendor=`echo "$basic_machine" | sed 's/-.*//'`
3f601b
		;;
3f601b
3f601b
	*-*)
3f601b
		IFS="-" read -r cpu vendor <
3f601b
$basic_machine
3f601b
EOF
3f601b
		;;
3f601b
	# We use `pc' rather than `unknown'
3f601b
	# because (1) that's what they normally are, and
3f601b
	# (2) the word "unknown" tends to confuse beginning users.
3f601b
	i*86 | x86_64)
3f601b
		cpu=$basic_machine
3f601b
		vendor=pc
3f601b
		;;
3f601b
	# These rules are duplicated from below for sake of the special case above;
3f601b
	# i.e. things that normalized to x86 arches should also default to "pc"
3f601b
	pc98)
3f601b
		cpu=i386
3f601b
		vendor=pc
3f601b
		;;
3f601b
	x64 | amd64)
3f601b
		cpu=x86_64
3f601b
		vendor=pc
3f601b
		;;
3f601b
	# Recognize the basic CPU types without company name.
3f601b
	*)
3f601b
		cpu=$basic_machine
3f601b
		vendor=unknown
3f601b
		;;
3f601b
esac
3f601b
3f601b
unset -v basic_machine
3f601b
3f601b
# Decode basic machines in the full and proper CPU-Company form.
3f601b
case $cpu-$vendor in
3f601b
	# Here we handle the default manufacturer of certain CPU types in cannonical form. It is in
3f601b
	# some cases the only manufacturer, in others, it is the most popular.
3f601b
	craynv-unknown)
3f601b
		vendor=cray
3f601b
		os=${os:-unicosmp}
3f601b
		;;
3f601b
	c90-unknown | c90-cray)
3f601b
		vendor=cray
3f601b
		os=${os:-unicos}
3f601b
		;;
3f601b
	fx80-unknown)
3f601b
		vendor=alliant
3f601b
		;;
3f601b
	romp-unknown)
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	mmix-unknown)
3f601b
		vendor=knuth
3f601b
		;;
3f601b
	microblaze-unknown | microblazeel-unknown)
3f601b
		vendor=xilinx
3f601b
		;;
3f601b
	rs6000-unknown)
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	vax-unknown)
3f601b
		vendor=dec
3f601b
		;;
3f601b
	pdp11-unknown)
3f601b
		vendor=dec
3f601b
		;;
3f601b
	we32k-unknown)
3f601b
		vendor=att
3f601b
		;;
3f601b
	cydra-unknown)
3f601b
		vendor=cydrome
3f601b
		;;
3f601b
	i370-ibm*)
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	orion-unknown)
3f601b
		vendor=highlevel
3f601b
		;;
3f601b
	xps-unknown | xps100-unknown)
3f601b
		cpu=xps100
3f601b
		vendor=honeywell
3f601b
		;;
3f601b
3f601b
	# Here we normalize CPU types with a missing or matching vendor
3f601b
	dpx20-unknown | dpx20-bull)
3f601b
		cpu=rs6000
3f601b
		vendor=bull
3f601b
		os=${os:-bosx}
3f601b
		;;
3f601b
3f601b
	# Here we normalize CPU types irrespective of the vendor
3f601b
	amd64-*)
3f601b
		cpu=x86_64
3f601b
		;;
3f601b
	blackfin-*)
3f601b
		cpu=bfin
3f601b
		os=linux
3f601b
		;;
3f601b
	c54x-*)
3f601b
		cpu=tic54x
3f601b
		;;
3f601b
	c55x-*)
3f601b
		cpu=tic55x
3f601b
		;;
3f601b
	c6x-*)
3f601b
		cpu=tic6x
3f601b
		;;
3f601b
	e500v[12]-*)
3f601b
		cpu=powerpc
3f601b
		os=$os"spe"
3f601b
		;;
3f601b
	mips3*-*)
3f601b
		cpu=mips64
3f601b
		;;
3f601b
	ms1-*)
3f601b
		cpu=mt
3f601b
		;;
3f601b
	m68knommu-*)
3f601b
		cpu=m68k
3f601b
		os=linux
3f601b
		;;
3f601b
	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
3f601b
		cpu=s12z
3f601b
		;;
3f601b
	openrisc-*)
3f601b
		cpu=or32
3f601b
		;;
3f601b
	parisc-*)
3f601b
		cpu=hppa
3f601b
		os=linux
3f601b
		;;
3f601b
	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
3f601b
		cpu=i586
3f601b
		;;
3f601b
	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
3f601b
		cpu=i686
3f601b
		;;
3f601b
	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
3f601b
		cpu=i686
3f601b
		;;
3f601b
	pentium4-*)
3f601b
		cpu=i786
3f601b
		;;
3f601b
	pc98-*)
3f601b
		cpu=i386
3f601b
		;;
3f601b
	ppc-* | ppcbe-*)
3f601b
		cpu=powerpc
3f601b
		;;
3f601b
	ppcle-* | powerpclittle-*)
3f601b
		cpu=powerpcle
3f601b
		;;
3f601b
	ppc64-*)
3f601b
		cpu=powerpc64
3f601b
		;;
3f601b
	ppc64le-* | powerpc64little-*)
3f601b
		cpu=powerpc64le
3f601b
		;;
3f601b
	sb1-*)
3f601b
		cpu=mipsisa64sb1
3f601b
		;;
3f601b
	sb1el-*)
3f601b
		cpu=mipsisa64sb1el
3f601b
		;;
3f601b
	sh5e[lb]-*)
3f601b
		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
3f601b
		;;
3f601b
	spur-*)
3f601b
		cpu=spur
3f601b
		;;
3f601b
	strongarm-* | thumb-*)
3f601b
		cpu=arm
3f601b
		;;
3f601b
	tx39-*)
3f601b
		cpu=mipstx39
3f601b
		;;
3f601b
	tx39el-*)
3f601b
		cpu=mipstx39el
3f601b
		;;
3f601b
	x64-*)
3f601b
		cpu=x86_64
3f601b
		;;
3f601b
	xscale-* | xscalee[bl]-*)
3f601b
		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
3f601b
		;;
3f601b
3f601b
	# Recognize the cannonical CPU Types that limit and/or modify the
3f601b
	# company names they are paired with.
3f601b
	cr16-*)
3f601b
		os=${os:-elf}
3f601b
		;;
3f601b
	crisv32-* | etraxfs*-*)
3f601b
		cpu=crisv32
3f601b
		vendor=axis
3f601b
		;;
3f601b
	cris-* | etrax*-*)
3f601b
		cpu=cris
3f601b
		vendor=axis
3f601b
		;;
3f601b
	crx-*)
3f601b
		os=${os:-elf}
3f601b
		;;
3f601b
	neo-tandem)
3f601b
		cpu=neo
3f601b
		vendor=tandem
3f601b
		;;
3f601b
	nse-tandem)
3f601b
		cpu=nse
3f601b
		vendor=tandem
3f601b
		;;
3f601b
	nsr-tandem)
3f601b
		cpu=nsr
3f601b
		vendor=tandem
3f601b
		;;
3f601b
	nsv-tandem)
3f601b
		cpu=nsv
3f601b
		vendor=tandem
3f601b
		;;
3f601b
	nsx-tandem)
3f601b
		cpu=nsx
3f601b
		vendor=tandem
3f601b
		;;
3f601b
	s390-*)
3f601b
		cpu=s390
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	s390x-*)
3f601b
		cpu=s390x
3f601b
		vendor=ibm
3f601b
		;;
3f601b
	tile*-*)
3f601b
		os=${os:-linux-gnu}
3f601b
		;;
3f601b
3f601b
	*)
3f601b
		# Recognize the cannonical CPU types that are allowed with any
3f601b
		# company name.
3f601b
		case $cpu in
3f601b
			1750a | 580 \
3f601b
			| a29k \
3f601b
			| aarch64 | aarch64_be \
3f601b
			| abacus \
3f601b
			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
3f601b
			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
3f601b
			| alphapca5[67] | alpha64pca5[67] \
3f601b
			| am33_2.0 \
3f601b
			| arc | arceb \
3f601b
			| arm  | arm[lb]e | arme[lb] | armv* \
3f601b
			| avr | avr32 \
3f601b
			| asmjs \
3f601b
			| ba \
3f601b
			| be32 | be64 \
3f601b
			| bfin | bs2000 \
3f601b
			| c[123]* | c30 | [cjt]90 | c4x \
3f601b
			| c8051 | clipper | craynv | csky | cydra \
3f601b
			| d10v | d30v | dlx | dsp16xx \
3f601b
			| e2k | elxsi | epiphany \
3f601b
			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
3f601b
			| h8300 | h8500 \
3f601b
			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
3f601b
			| hexagon \
3f601b
			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
3f601b
			| ip2k | iq2000 \
3f601b
			| k1om \
3f601b
			| le32 | le64 \
3f601b
			| lm32 \
3f601b
			| m32c | m32r | m32rle \
3f601b
			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \
3f601b
			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \
3f601b
			| m88110 | m88k | maxq | mb | mcore | mep | metag \
3f601b
			| microblaze | microblazeel \
3f601b
			| mips | mipsbe | mipseb | mipsel | mipsle \
3f601b
			| mips16 \
3f601b
			| mips64 | mips64el \
3f601b
			| mips64octeon | mips64octeonel \
3f601b
			| mips64orion | mips64orionel \
3f601b
			| mips64r5900 | mips64r5900el \
3f601b
			| mips64vr | mips64vrel \
3f601b
			| mips64vr4100 | mips64vr4100el \
3f601b
			| mips64vr4300 | mips64vr4300el \
3f601b
			| mips64vr5000 | mips64vr5000el \
3f601b
			| mips64vr5900 | mips64vr5900el \
3f601b
			| mipsisa32 | mipsisa32el \
3f601b
			| mipsisa32r2 | mipsisa32r2el \
3f601b
			| mipsisa32r6 | mipsisa32r6el \
3f601b
			| mipsisa64 | mipsisa64el \
3f601b
			| mipsisa64r2 | mipsisa64r2el \
3f601b
			| mipsisa64r6 | mipsisa64r6el \
3f601b
			| mipsisa64sb1 | mipsisa64sb1el \
3f601b
			| mipsisa64sr71k | mipsisa64sr71kel \
3f601b
			| mipsr5900 | mipsr5900el \
3f601b
			| mipstx39 | mipstx39el \
3f601b
			| mmix \
3f601b
			| mn10200 | mn10300 \
3f601b
			| moxie \
3f601b
			| mt \
3f601b
			| msp430 \
3f601b
			| nds32 | nds32le | nds32be \
3f601b
			| nfp \
3f601b
			| nios | nios2 | nios2eb | nios2el \
3f601b
			| none | np1 | ns16k | ns32k \
3f601b
			| open8 \
3f601b
			| or1k* \
3f601b
			| or32 \
3f601b
			| orion \
3f601b
			| pdp10 | pdp11 | pj | pjl | pn | power \
3f601b
			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
3f601b
			| pru \
3f601b
			| pyramid \
3f601b
			| riscv | riscv32 | riscv64 \
3f601b
			| rl78 | romp | rs6000 | rx \
3f601b
			| score \
3f601b
			| sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
3f601b
			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
3f601b
			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
3f601b
			| sparclite \
3f601b
			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
3f601b
			| spu \
3f601b
			| tahoe \
3f601b
			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
3f601b
			| tron \
3f601b
			| ubicom32 \
3f601b
			| v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
3f601b
			| vax \
3f601b
			| visium \
3f601b
			| wasm32 \
3f601b
			| we32k \
3f601b
			| x86 | x86_64 | xc16x | xgate | xps100 \
3f601b
			| xstormy16 | xtensa* \
3f601b
			| ymp \
3f601b
			| z8k | z80)
3f601b
				;;
3f601b
3f601b
			*)
3f601b
				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
3f601b
				exit 1
3f601b
				;;
3f601b
		esac
3f601b
		;;
3f601b
esac
3f601b
3f601b
# Here we canonicalize certain aliases for manufacturers.
3f601b
case $vendor in
3f601b
	digital*)
3f601b
		vendor=dec
3f601b
		;;
3f601b
	commodore*)
3f601b
		vendor=cbm
3f601b
		;;
3f601b
	*)
3f601b
		;;
3f601b
esac
3f601b
3f601b
# Decode manufacturer-specific aliases for certain operating systems.
3f601b
3f601b
if [ x$os != x ]
3f601b
then
3f601b
case $os in
3f601b
	# First match some system type aliases that might get confused
3f601b
	# with valid system types.
3f601b
	# solaris* is a basic system type, with this one exception.
3f601b
	auroraux)
3f601b
		os=auroraux
3f601b
		;;
3f601b
	bluegene*)
3f601b
		os=cnk
3f601b
		;;
3f601b
	solaris1 | solaris1.*)
3f601b
		os=`echo $os | sed -e 's|solaris1|sunos4|'`
3f601b
		;;
3f601b
	solaris)
3f601b
		os=solaris2
3f601b
		;;
3f601b
	unixware*)
3f601b
		os=sysv4.2uw
3f601b
		;;
3f601b
	gnu/linux*)
3f601b
		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
3f601b
		;;
3f601b
	# es1800 is here to avoid being matched by es* (a different OS)
3f601b
	es1800*)
3f601b
		os=ose
3f601b
		;;
3f601b
	# Some version numbers need modification
3f601b
	chorusos*)
3f601b
		os=chorusos
3f601b
		;;
3f601b
	isc)
3f601b
		os=isc2.2
3f601b
		;;
3f601b
	sco6)
3f601b
		os=sco5v6
3f601b
		;;
3f601b
	sco5)
3f601b
		os=sco3.2v5
3f601b
		;;
3f601b
	sco4)
3f601b
		os=sco3.2v4
3f601b
		;;
3f601b
	sco3.2.[4-9]*)
3f601b
		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
3f601b
		;;
3f601b
	sco3.2v[4-9]* | sco5v6*)
3f601b
		# Don't forget version if it is 3.2v4 or newer.
3f601b
		;;
3f601b
	scout)
3f601b
		# Don't match below
3f601b
		;;
3f601b
	sco*)
3f601b
		os=sco3.2v2
3f601b
		;;
3f601b
	psos*)
3f601b
		os=psos
3f601b
		;;
3f601b
	# Now accept the basic system types.
3f601b
	# The portable systems comes first.
3f601b
	# Each alternative MUST end in a * to match a version number.
3f601b
	# sysv* is not here because it comes later, after sysvr4.
3f601b
	gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
3f601b
	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
3f601b
	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
3f601b
	     | sym* | kopensolaris* | plan9* \
3f601b
	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
3f601b
	     | aos* | aros* | cloudabi* | sortix* \
3f601b
	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
3f601b
	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
3f601b
	     | knetbsd* | mirbsd* | netbsd* \
3f601b
	     | bitrig* | openbsd* | solidbsd* | libertybsd* \
3f601b
	     | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
3f601b
	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
3f601b
	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
3f601b
	     | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
3f601b
	     | chorusrdb* | cegcc* | glidix* \
3f601b
	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
3f601b
	     | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
3f601b
	     | linux-newlib* | linux-musl* | linux-uclibc* \
3f601b
	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
3f601b
	     | interix* | uwin* | mks* | rhapsody* | darwin* \
3f601b
	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
3f601b
	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
3f601b
	     | os2* | vos* | palmos* | uclinux* | nucleus* \
3f601b
	     | morphos* | superux* | rtmk* | windiss* \
3f601b
	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
3f601b
	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
3f601b
	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
3f601b
	     | midnightbsd*)
3f601b
	# Remember, each alternative MUST END IN *, to match a version number.
3f601b
		;;
3f601b
	qnx*)
3f601b
		case $cpu in
3f601b
		    x86 | i*86)
3f601b
			;;
3f601b
		    *)
3f601b
			os=nto-$os
3f601b
			;;
3f601b
		esac
3f601b
		;;
3f601b
	hiux*)
3f601b
		os=hiuxwe2
3f601b
		;;
3f601b
	nto-qnx*)
3f601b
		;;
3f601b
	nto*)
3f601b
		os=`echo $os | sed -e 's|nto|nto-qnx|'`
3f601b
		;;
3f601b
	sim | xray | os68k* | v88r* \
3f601b
	    | windows* | osx | abug | netware* | os9* \
3f601b
	    | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
3f601b
		;;
3f601b
	linux-dietlibc)
3f601b
		os=linux-dietlibc
3f601b
		;;
3f601b
	linux*)
3f601b
		os=`echo $os | sed -e 's|linux|linux-gnu|'`
3f601b
		;;
3f601b
	lynx*178)
3f601b
		os=lynxos178
3f601b
		;;
3f601b
	lynx*5)
3f601b
		os=lynxos5
3f601b
		;;
3f601b
	lynx*)
3f601b
		os=lynxos
3f601b
		;;
3f601b
	mac*)
3f601b
		os=`echo "$os" | sed -e 's|mac|macos|'`
3f601b
		;;
3f601b
	opened*)
3f601b
		os=openedition
3f601b
		;;
3f601b
	os400*)
3f601b
		os=os400
3f601b
		;;
3f601b
	sunos5*)
3f601b
		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
3f601b
		;;
3f601b
	sunos6*)
3f601b
		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
3f601b
		;;
3f601b
	wince*)
3f601b
		os=wince
3f601b
		;;
3f601b
	utek*)
3f601b
		os=bsd
3f601b
		;;
3f601b
	dynix*)
3f601b
		os=bsd
3f601b
		;;
3f601b
	acis*)
3f601b
		os=aos
3f601b
		;;
3f601b
	atheos*)
3f601b
		os=atheos
3f601b
		;;
3f601b
	syllable*)
3f601b
		os=syllable
3f601b
		;;
3f601b
	386bsd)
3f601b
		os=bsd
3f601b
		;;
3f601b
	ctix* | uts*)
3f601b
		os=sysv
3f601b
		;;
3f601b
	nova*)
3f601b
		os=rtmk-nova
3f601b
		;;
3f601b
	ns2)
3f601b
		os=nextstep2
3f601b
		;;
3f601b
	nsk*)
3f601b
		os=nsk
3f601b
		;;
3f601b
	# Preserve the version number of sinix5.
3f601b
	sinix5.*)
3f601b
		os=`echo $os | sed -e 's|sinix|sysv|'`
3f601b
		;;
3f601b
	sinix*)
3f601b
		os=sysv4
3f601b
		;;
3f601b
	tpf*)
3f601b
		os=tpf
3f601b
		;;
3f601b
	triton*)
3f601b
		os=sysv3
3f601b
		;;
3f601b
	oss*)
3f601b
		os=sysv3
3f601b
		;;
3f601b
	svr4*)
3f601b
		os=sysv4
3f601b
		;;
3f601b
	svr3)
3f601b
		os=sysv3
3f601b
		;;
3f601b
	sysvr4)
3f601b
		os=sysv4
3f601b
		;;
3f601b
	# This must come after sysvr4.
3f601b
	sysv*)
3f601b
		;;
3f601b
	ose*)
3f601b
		os=ose
3f601b
		;;
3f601b
	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
3f601b
		os=mint
3f601b
		;;
3f601b
	zvmoe)
3f601b
		os=zvmoe
3f601b
		;;
3f601b
	dicos*)
3f601b
		os=dicos
3f601b
		;;
3f601b
	pikeos*)
3f601b
		# Until real need of OS specific support for
3f601b
		# particular features comes up, bare metal
3f601b
		# configurations are quite functional.
3f601b
		case $cpu in
3f601b
		    arm*)
3f601b
			os=eabi
3f601b
			;;
3f601b
		    *)
3f601b
			os=elf
3f601b
			;;
3f601b
		esac
3f601b
		;;
3f601b
	nacl*)
3f601b
		;;
3f601b
	ios)
3f601b
		;;
3f601b
	none)
3f601b
		;;
3f601b
	*-eabi)
3f601b
		;;
3f601b
	*)
3f601b
		echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
3f601b
		exit 1
3f601b
		;;
3f601b
esac
3f601b
else
3f601b
3f601b
# Here we handle the default operating systems that come with various machines.
3f601b
# The value should be what the vendor currently ships out the door with their
3f601b
# machine or put another way, the most popular os provided with the machine.
3f601b
3f601b
# Note that if you're going to try to match "-MANUFACTURER" here (say,
3f601b
# "-sun"), then you have to tell the case statement up towards the top
3f601b
# that MANUFACTURER isn't an operating system.  Otherwise, code above
3f601b
# will signal an error saying that MANUFACTURER isn't an operating
3f601b
# system, and we'll never get to this point.
3f601b
3f601b
case $cpu-$vendor in
3f601b
	score-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	spu-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	*-acorn)
3f601b
		os=riscix1.2
3f601b
		;;
3f601b
	arm*-rebel)
3f601b
		os=linux
3f601b
		;;
3f601b
	arm*-semi)
3f601b
		os=aout
3f601b
		;;
3f601b
	c4x-* | tic4x-*)
3f601b
		os=coff
3f601b
		;;
3f601b
	c8051-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	clipper-intergraph)
3f601b
		os=clix
3f601b
		;;
3f601b
	hexagon-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	tic54x-*)
3f601b
		os=coff
3f601b
		;;
3f601b
	tic55x-*)
3f601b
		os=coff
3f601b
		;;
3f601b
	tic6x-*)
3f601b
		os=coff
3f601b
		;;
3f601b
	# This must come before the *-dec entry.
3f601b
	pdp10-*)
3f601b
		os=tops20
3f601b
		;;
3f601b
	pdp11-*)
3f601b
		os=none
3f601b
		;;
3f601b
	*-dec | vax-*)
3f601b
		os=ultrix4.2
3f601b
		;;
3f601b
	m68*-apollo)
3f601b
		os=domain
3f601b
		;;
3f601b
	i386-sun)
3f601b
		os=sunos4.0.2
3f601b
		;;
3f601b
	m68000-sun)
3f601b
		os=sunos3
3f601b
		;;
3f601b
	m68*-cisco)
3f601b
		os=aout
3f601b
		;;
3f601b
	mep-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	mips*-cisco)
3f601b
		os=elf
3f601b
		;;
3f601b
	mips*-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	or32-*)
3f601b
		os=coff
3f601b
		;;
3f601b
	*-tti)	# must be before sparc entry or we get the wrong os.
3f601b
		os=sysv3
3f601b
		;;
3f601b
	sparc-* | *-sun)
3f601b
		os=sunos4.1.1
3f601b
		;;
3f601b
	pru-*)
3f601b
		os=elf
3f601b
		;;
3f601b
	*-be)
3f601b
		os=beos
3f601b
		;;
3f601b
	*-ibm)
3f601b
		os=aix
3f601b
		;;
3f601b
	*-knuth)
3f601b
		os=mmixware
3f601b
		;;
3f601b
	*-wec)
3f601b
		os=proelf
3f601b
		;;
3f601b
	*-winbond)
3f601b
		os=proelf
3f601b
		;;
3f601b
	*-oki)
3f601b
		os=proelf
3f601b
		;;
3f601b
	*-hp)
3f601b
		os=hpux
3f601b
		;;
3f601b
	*-hitachi)
3f601b
		os=hiux
3f601b
		;;
3f601b
	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
3f601b
		os=sysv
3f601b
		;;
3f601b
	*-cbm)
3f601b
		os=amigaos
3f601b
		;;
3f601b
	*-dg)
3f601b
		os=dgux
3f601b
		;;
3f601b
	*-dolphin)
3f601b
		os=sysv3
3f601b
		;;
3f601b
	m68k-ccur)
3f601b
		os=rtu
3f601b
		;;
3f601b
	m88k-omron*)
3f601b
		os=luna
3f601b
		;;
3f601b
	*-next)
3f601b
		os=nextstep
3f601b
		;;
3f601b
	*-sequent)
3f601b
		os=ptx
3f601b
		;;
3f601b
	*-crds)
3f601b
		os=unos
3f601b
		;;
3f601b
	*-ns)
3f601b
		os=genix
3f601b
		;;
3f601b
	i370-*)
3f601b
		os=mvs
3f601b
		;;
3f601b
	*-gould)
3f601b
		os=sysv
3f601b
		;;
3f601b
	*-highlevel)
3f601b
		os=bsd
3f601b
		;;
3f601b
	*-encore)
3f601b
		os=bsd
3f601b
		;;
3f601b
	*-sgi)
3f601b
		os=irix
3f601b
		;;
3f601b
	*-siemens)
3f601b
		os=sysv4
3f601b
		;;
3f601b
	*-masscomp)
3f601b
		os=rtu
3f601b
		;;
3f601b
	f30[01]-fujitsu | f700-fujitsu)
3f601b
		os=uxpv
3f601b
		;;
3f601b
	*-rom68k)
3f601b
		os=coff
3f601b
		;;
3f601b
	*-*bug)
3f601b
		os=coff
3f601b
		;;
3f601b
	*-apple)
3f601b
		os=macos
3f601b
		;;
3f601b
	*-atari*)
3f601b
		os=mint
3f601b
		;;
3f601b
	*-wrs)
3f601b
		os=vxworks
3f601b
		;;
3f601b
	*)
3f601b
		os=none
3f601b
		;;
3f601b
esac
3f601b
fi
3f601b
3f601b
# Here we handle the case where we know the os, and the CPU type, but not the
3f601b
# manufacturer.  We pick the logical manufacturer.
3f601b
case $vendor in
3f601b
	unknown)
3f601b
		case $os in
3f601b
			riscix*)
3f601b
				vendor=acorn
3f601b
				;;
3f601b
			sunos*)
3f601b
				vendor=sun
3f601b
				;;
3f601b
			cnk*|-aix*)
3f601b
				vendor=ibm
3f601b
				;;
3f601b
			beos*)
3f601b
				vendor=be
3f601b
				;;
3f601b
			hpux*)
3f601b
				vendor=hp
3f601b
				;;
3f601b
			mpeix*)
3f601b
				vendor=hp
3f601b
				;;
3f601b
			hiux*)
3f601b
				vendor=hitachi
3f601b
				;;
3f601b
			unos*)
3f601b
				vendor=crds
3f601b
				;;
3f601b
			dgux*)
3f601b
				vendor=dg
3f601b
				;;
3f601b
			luna*)
3f601b
				vendor=omron
3f601b
				;;
3f601b
			genix*)
3f601b
				vendor=ns
3f601b
				;;
3f601b
			clix*)
3f601b
				vendor=intergraph
3f601b
				;;
3f601b
			mvs* | opened*)
3f601b
				vendor=ibm
3f601b
				;;
3f601b
			os400*)
3f601b
				vendor=ibm
3f601b
				;;
3f601b
			ptx*)
3f601b
				vendor=sequent
3f601b
				;;
3f601b
			tpf*)
3f601b
				vendor=ibm
3f601b
				;;
3f601b
			vxsim* | vxworks* | windiss*)
3f601b
				vendor=wrs
3f601b
				;;
3f601b
			aux*)
3f601b
				vendor=apple
3f601b
				;;
3f601b
			hms*)
3f601b
				vendor=hitachi
3f601b
				;;
3f601b
			mpw* | macos*)
3f601b
				vendor=apple
3f601b
				;;
3f601b
			*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
3f601b
				vendor=atari
3f601b
				;;
3f601b
			vos*)
3f601b
				vendor=stratus
3f601b
				;;
3f601b
		esac
3f601b
		;;
3f601b
esac
3f601b
3f601b
echo "$cpu-$vendor-$os"
3f601b
exit
3f601b
3f601b
# Local variables:
3f601b
# eval: (add-hook 'before-save-hook 'time-stamp)
3f601b
# time-stamp-start: "timestamp='"
3f601b
# time-stamp-format: "%:y-%02m-%02d"
3f601b
# time-stamp-end: "'"
3f601b
# End: