Blame SOURCES/config.sub

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