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