Blame SOURCES/config.sub

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