config.sub revision 3bfa90b6
16df26cacSmrg#! /bin/sh
26df26cacSmrg# Configuration validation subroutine script.
36df26cacSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
43bfa90b6Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
53bfa90b6Smrg#   2011, 2012 Free Software Foundation, Inc.
66df26cacSmrg
73bfa90b6Smrgtimestamp='2012-02-10'
86df26cacSmrg
96df26cacSmrg# This file is (in principle) common to ALL GNU software.
106df26cacSmrg# The presence of a machine in this file suggests that SOME GNU software
116df26cacSmrg# can handle that machine.  It does not imply ALL GNU software can.
126df26cacSmrg#
136df26cacSmrg# This file is free software; you can redistribute it and/or modify
146df26cacSmrg# it under the terms of the GNU General Public License as published by
156df26cacSmrg# the Free Software Foundation; either version 2 of the License, or
166df26cacSmrg# (at your option) any later version.
176df26cacSmrg#
186df26cacSmrg# This program is distributed in the hope that it will be useful,
196df26cacSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
206df26cacSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
216df26cacSmrg# GNU General Public License for more details.
226df26cacSmrg#
236df26cacSmrg# You should have received a copy of the GNU General Public License
243bfa90b6Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
256df26cacSmrg#
266df26cacSmrg# As a special exception to the GNU General Public License, if you
276df26cacSmrg# distribute this file as part of a program that contains a
286df26cacSmrg# configuration script generated by Autoconf, you may include it under
296df26cacSmrg# the same distribution terms that you use for the rest of that program.
306df26cacSmrg
316df26cacSmrg
326df26cacSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
333bfa90b6Smrg# diff and a properly formatted GNU ChangeLog entry.
346df26cacSmrg#
356df26cacSmrg# Configuration subroutine to validate and canonicalize a configuration type.
366df26cacSmrg# Supply the specified configuration type as an argument.
376df26cacSmrg# If it is invalid, we print an error message on stderr and exit with code 1.
386df26cacSmrg# Otherwise, we print the canonical config type on stdout and succeed.
396df26cacSmrg
403bfa90b6Smrg# You can get the latest version of this script from:
413bfa90b6Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
423bfa90b6Smrg
436df26cacSmrg# This file is supposed to be the same for all GNU packages
446df26cacSmrg# and recognize all the CPU types, system types and aliases
456df26cacSmrg# that are meaningful with *any* GNU software.
466df26cacSmrg# Each package is responsible for reporting which valid configurations
476df26cacSmrg# it does not support.  The user should be able to distinguish
486df26cacSmrg# a failure to support a valid configuration from a meaningless
496df26cacSmrg# configuration.
506df26cacSmrg
516df26cacSmrg# The goal of this file is to map all the various variations of a given
526df26cacSmrg# machine specification into a single specification in the form:
536df26cacSmrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
546df26cacSmrg# or in some cases, the newer four-part form:
556df26cacSmrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
566df26cacSmrg# It is wrong to echo any other type of specification.
576df26cacSmrg
586df26cacSmrgme=`echo "$0" | sed -e 's,.*/,,'`
596df26cacSmrg
606df26cacSmrgusage="\
616df26cacSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
626df26cacSmrg       $0 [OPTION] ALIAS
636df26cacSmrg
646df26cacSmrgCanonicalize a configuration name.
656df26cacSmrg
666df26cacSmrgOperation modes:
676df26cacSmrg  -h, --help         print this help, then exit
686df26cacSmrg  -t, --time-stamp   print date of last modification, then exit
696df26cacSmrg  -v, --version      print version number, then exit
706df26cacSmrg
716df26cacSmrgReport bugs and patches to <config-patches@gnu.org>."
726df26cacSmrg
736df26cacSmrgversion="\
746df26cacSmrgGNU config.sub ($timestamp)
756df26cacSmrg
763bfa90b6SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
773bfa90b6Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
783bfa90b6SmrgFree Software Foundation, Inc.
796df26cacSmrg
806df26cacSmrgThis is free software; see the source for copying conditions.  There is NO
816df26cacSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
826df26cacSmrg
836df26cacSmrghelp="
846df26cacSmrgTry \`$me --help' for more information."
856df26cacSmrg
866df26cacSmrg# Parse command line
876df26cacSmrgwhile test $# -gt 0 ; do
886df26cacSmrg  case $1 in
896df26cacSmrg    --time-stamp | --time* | -t )
906df26cacSmrg       echo "$timestamp" ; exit ;;
916df26cacSmrg    --version | -v )
926df26cacSmrg       echo "$version" ; exit ;;
936df26cacSmrg    --help | --h* | -h )
946df26cacSmrg       echo "$usage"; exit ;;
956df26cacSmrg    -- )     # Stop option processing
966df26cacSmrg       shift; break ;;
976df26cacSmrg    - )	# Use stdin as input.
986df26cacSmrg       break ;;
996df26cacSmrg    -* )
1006df26cacSmrg       echo "$me: invalid option $1$help"
1016df26cacSmrg       exit 1 ;;
1026df26cacSmrg
1036df26cacSmrg    *local*)
1046df26cacSmrg       # First pass through any local machine types.
1056df26cacSmrg       echo $1
1066df26cacSmrg       exit ;;
1076df26cacSmrg
1086df26cacSmrg    * )
1096df26cacSmrg       break ;;
1106df26cacSmrg  esac
1116df26cacSmrgdone
1126df26cacSmrg
1136df26cacSmrgcase $# in
1146df26cacSmrg 0) echo "$me: missing argument$help" >&2
1156df26cacSmrg    exit 1;;
1166df26cacSmrg 1) ;;
1176df26cacSmrg *) echo "$me: too many arguments$help" >&2
1186df26cacSmrg    exit 1;;
1196df26cacSmrgesac
1206df26cacSmrg
1216df26cacSmrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1226df26cacSmrg# Here we must recognize all the valid KERNEL-OS combinations.
1236df26cacSmrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1246df26cacSmrgcase $maybe_os in
1253bfa90b6Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
1263bfa90b6Smrg  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
1273bfa90b6Smrg  knetbsd*-gnu* | netbsd*-gnu* | \
1283bfa90b6Smrg  kopensolaris*-gnu* | \
1296df26cacSmrg  storm-chaos* | os2-emx* | rtmk-nova*)
1306df26cacSmrg    os=-$maybe_os
1316df26cacSmrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1326df26cacSmrg    ;;
1333bfa90b6Smrg  android-linux)
1343bfa90b6Smrg    os=-linux-android
1353bfa90b6Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
1363bfa90b6Smrg    ;;
1376df26cacSmrg  *)
1386df26cacSmrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1396df26cacSmrg    if [ $basic_machine != $1 ]
1406df26cacSmrg    then os=`echo $1 | sed 's/.*-/-/'`
1416df26cacSmrg    else os=; fi
1426df26cacSmrg    ;;
1436df26cacSmrgesac
1446df26cacSmrg
1456df26cacSmrg### Let's recognize common machines as not being operating systems so
1466df26cacSmrg### that things like config.sub decstation-3100 work.  We also
1476df26cacSmrg### recognize some manufacturers as not being operating systems, so we
1486df26cacSmrg### can provide default operating systems below.
1496df26cacSmrgcase $os in
1506df26cacSmrg	-sun*os*)
1516df26cacSmrg		# Prevent following clause from handling this invalid input.
1526df26cacSmrg		;;
1536df26cacSmrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
1546df26cacSmrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
1556df26cacSmrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
1566df26cacSmrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
1576df26cacSmrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
1586df26cacSmrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
1593bfa90b6Smrg	-apple | -axis | -knuth | -cray | -microblaze)
1606df26cacSmrg		os=
1616df26cacSmrg		basic_machine=$1
1626df26cacSmrg		;;
1633bfa90b6Smrg	-bluegene*)
1643bfa90b6Smrg		os=-cnk
1653bfa90b6Smrg		;;
1666df26cacSmrg	-sim | -cisco | -oki | -wec | -winbond)
1676df26cacSmrg		os=
1686df26cacSmrg		basic_machine=$1
1696df26cacSmrg		;;
1706df26cacSmrg	-scout)
1716df26cacSmrg		;;
1726df26cacSmrg	-wrs)
1736df26cacSmrg		os=-vxworks
1746df26cacSmrg		basic_machine=$1
1756df26cacSmrg		;;
1766df26cacSmrg	-chorusos*)
1776df26cacSmrg		os=-chorusos
1786df26cacSmrg		basic_machine=$1
1796df26cacSmrg		;;
1803bfa90b6Smrg	-chorusrdb)
1813bfa90b6Smrg		os=-chorusrdb
1826df26cacSmrg		basic_machine=$1
1833bfa90b6Smrg		;;
1846df26cacSmrg	-hiux*)
1856df26cacSmrg		os=-hiuxwe2
1866df26cacSmrg		;;
1876df26cacSmrg	-sco6)
1886df26cacSmrg		os=-sco5v6
1896df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1906df26cacSmrg		;;
1916df26cacSmrg	-sco5)
1926df26cacSmrg		os=-sco3.2v5
1936df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1946df26cacSmrg		;;
1956df26cacSmrg	-sco4)
1966df26cacSmrg		os=-sco3.2v4
1976df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
1986df26cacSmrg		;;
1996df26cacSmrg	-sco3.2.[4-9]*)
2006df26cacSmrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
2016df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2026df26cacSmrg		;;
2036df26cacSmrg	-sco3.2v[4-9]*)
2046df26cacSmrg		# Don't forget version if it is 3.2v4 or newer.
2056df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2066df26cacSmrg		;;
2076df26cacSmrg	-sco5v6*)
2086df26cacSmrg		# Don't forget version if it is 3.2v4 or newer.
2096df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2106df26cacSmrg		;;
2116df26cacSmrg	-sco*)
2126df26cacSmrg		os=-sco3.2v2
2136df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2146df26cacSmrg		;;
2156df26cacSmrg	-udk*)
2166df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2176df26cacSmrg		;;
2186df26cacSmrg	-isc)
2196df26cacSmrg		os=-isc2.2
2206df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2216df26cacSmrg		;;
2226df26cacSmrg	-clix*)
2236df26cacSmrg		basic_machine=clipper-intergraph
2246df26cacSmrg		;;
2256df26cacSmrg	-isc*)
2266df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2276df26cacSmrg		;;
2286df26cacSmrg	-lynx*)
2296df26cacSmrg		os=-lynxos
2306df26cacSmrg		;;
2316df26cacSmrg	-ptx*)
2326df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2336df26cacSmrg		;;
2346df26cacSmrg	-windowsnt*)
2356df26cacSmrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2366df26cacSmrg		;;
2376df26cacSmrg	-psos*)
2386df26cacSmrg		os=-psos
2396df26cacSmrg		;;
2406df26cacSmrg	-mint | -mint[0-9]*)
2416df26cacSmrg		basic_machine=m68k-atari
2426df26cacSmrg		os=-mint
2436df26cacSmrg		;;
2446df26cacSmrgesac
2456df26cacSmrg
2466df26cacSmrg# Decode aliases for certain CPU-COMPANY combinations.
2476df26cacSmrgcase $basic_machine in
2486df26cacSmrg	# Recognize the basic CPU types without company name.
2496df26cacSmrg	# Some are omitted here because they have special meanings below.
2506df26cacSmrg	1750a | 580 \
2516df26cacSmrg	| a29k \
2523bfa90b6Smrg	| aarch64 | aarch64_be \
2536df26cacSmrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2546df26cacSmrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2556df26cacSmrg	| am33_2.0 \
2566df26cacSmrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
2573bfa90b6Smrg        | be32 | be64 \
2586df26cacSmrg	| bfin \
2596df26cacSmrg	| c4x | clipper \
2606df26cacSmrg	| d10v | d30v | dlx | dsp16xx \
2613bfa90b6Smrg	| epiphany \
26216fd1166Smrg	| fido | fr30 | frv \
2636df26cacSmrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
2643bfa90b6Smrg	| hexagon \
2656df26cacSmrg	| i370 | i860 | i960 | ia64 \
2666df26cacSmrg	| ip2k | iq2000 \
2673bfa90b6Smrg	| le32 | le64 \
2683bfa90b6Smrg	| lm32 \
2696df26cacSmrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2701f27ce9aSmrg	| maxq | mb | microblaze | mcore | mep | metag \
2716df26cacSmrg	| mips | mipsbe | mipseb | mipsel | mipsle \
2726df26cacSmrg	| mips16 \
2736df26cacSmrg	| mips64 | mips64el \
2741f27ce9aSmrg	| mips64octeon | mips64octeonel \
2756df26cacSmrg	| mips64orion | mips64orionel \
2761f27ce9aSmrg	| mips64r5900 | mips64r5900el \
2771f27ce9aSmrg	| mips64vr | mips64vrel \
2786df26cacSmrg	| mips64vr4100 | mips64vr4100el \
2796df26cacSmrg	| mips64vr4300 | mips64vr4300el \
2806df26cacSmrg	| mips64vr5000 | mips64vr5000el \
2816df26cacSmrg	| mips64vr5900 | mips64vr5900el \
2826df26cacSmrg	| mipsisa32 | mipsisa32el \
2836df26cacSmrg	| mipsisa32r2 | mipsisa32r2el \
2846df26cacSmrg	| mipsisa64 | mipsisa64el \
2856df26cacSmrg	| mipsisa64r2 | mipsisa64r2el \
2866df26cacSmrg	| mipsisa64sb1 | mipsisa64sb1el \
2876df26cacSmrg	| mipsisa64sr71k | mipsisa64sr71kel \
2886df26cacSmrg	| mipstx39 | mipstx39el \
2896df26cacSmrg	| mn10200 | mn10300 \
2903bfa90b6Smrg	| moxie \
2916df26cacSmrg	| mt \
2926df26cacSmrg	| msp430 \
2933bfa90b6Smrg	| nds32 | nds32le | nds32be \
2946df26cacSmrg	| nios | nios2 \
2956df26cacSmrg	| ns16k | ns32k \
2963bfa90b6Smrg	| open8 \
2976df26cacSmrg	| or32 \
2986df26cacSmrg	| pdp10 | pdp11 | pj | pjl \
2993bfa90b6Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
3006df26cacSmrg	| pyramid \
3013bfa90b6Smrg	| rl78 | rx \
3026df26cacSmrg	| score \
3033bfa90b6Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
3046df26cacSmrg	| sh64 | sh64le \
3056df26cacSmrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
3066df26cacSmrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
3073bfa90b6Smrg	| spu \
3083bfa90b6Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
3093bfa90b6Smrg	| ubicom32 \
3103bfa90b6Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
3116df26cacSmrg	| we32k \
3123bfa90b6Smrg	| x86 | xc16x | xstormy16 | xtensa \
3131f27ce9aSmrg	| z8k | z80)
3146df26cacSmrg		basic_machine=$basic_machine-unknown
3156df26cacSmrg		;;
3163bfa90b6Smrg	c54x)
3173bfa90b6Smrg		basic_machine=tic54x-unknown
3183bfa90b6Smrg		;;
3193bfa90b6Smrg	c55x)
3203bfa90b6Smrg		basic_machine=tic55x-unknown
3213bfa90b6Smrg		;;
3223bfa90b6Smrg	c6x)
3233bfa90b6Smrg		basic_machine=tic6x-unknown
3243bfa90b6Smrg		;;
3253bfa90b6Smrg	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
3266df26cacSmrg		basic_machine=$basic_machine-unknown
3276df26cacSmrg		os=-none
3286df26cacSmrg		;;
3296df26cacSmrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
3306df26cacSmrg		;;
3316df26cacSmrg	ms1)
3326df26cacSmrg		basic_machine=mt-unknown
3336df26cacSmrg		;;
3346df26cacSmrg
3353bfa90b6Smrg	strongarm | thumb | xscale)
3363bfa90b6Smrg		basic_machine=arm-unknown
3373bfa90b6Smrg		;;
3383bfa90b6Smrg	xgate)
3393bfa90b6Smrg		basic_machine=$basic_machine-unknown
3403bfa90b6Smrg		os=-none
3413bfa90b6Smrg		;;
3423bfa90b6Smrg	xscaleeb)
3433bfa90b6Smrg		basic_machine=armeb-unknown
3443bfa90b6Smrg		;;
3453bfa90b6Smrg
3463bfa90b6Smrg	xscaleel)
3473bfa90b6Smrg		basic_machine=armel-unknown
3483bfa90b6Smrg		;;
3493bfa90b6Smrg
3506df26cacSmrg	# We use `pc' rather than `unknown'
3516df26cacSmrg	# because (1) that's what they normally are, and
3526df26cacSmrg	# (2) the word "unknown" tends to confuse beginning users.
3536df26cacSmrg	i*86 | x86_64)
3546df26cacSmrg	  basic_machine=$basic_machine-pc
3556df26cacSmrg	  ;;
3566df26cacSmrg	# Object if more than one company name word.
3576df26cacSmrg	*-*-*)
3586df26cacSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3596df26cacSmrg		exit 1
3606df26cacSmrg		;;
3616df26cacSmrg	# Recognize the basic CPU types with company name.
3626df26cacSmrg	580-* \
3636df26cacSmrg	| a29k-* \
3643bfa90b6Smrg	| aarch64-* | aarch64_be-* \
3656df26cacSmrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
3666df26cacSmrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
3676df26cacSmrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
3686df26cacSmrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3696df26cacSmrg	| avr-* | avr32-* \
3703bfa90b6Smrg	| be32-* | be64-* \
3716df26cacSmrg	| bfin-* | bs2000-* \
3723bfa90b6Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
3736df26cacSmrg	| clipper-* | craynv-* | cydra-* \
3746df26cacSmrg	| d10v-* | d30v-* | dlx-* \
3756df26cacSmrg	| elxsi-* \
37616fd1166Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
3776df26cacSmrg	| h8300-* | h8500-* \
3786df26cacSmrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
3793bfa90b6Smrg	| hexagon-* \
3806df26cacSmrg	| i*86-* | i860-* | i960-* | ia64-* \
3816df26cacSmrg	| ip2k-* | iq2000-* \
3823bfa90b6Smrg	| le32-* | le64-* \
3833bfa90b6Smrg	| lm32-* \
3846df26cacSmrg	| m32c-* | m32r-* | m32rle-* \
3856df26cacSmrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
3863bfa90b6Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
3876df26cacSmrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
3886df26cacSmrg	| mips16-* \
3896df26cacSmrg	| mips64-* | mips64el-* \
3901f27ce9aSmrg	| mips64octeon-* | mips64octeonel-* \
3916df26cacSmrg	| mips64orion-* | mips64orionel-* \
3921f27ce9aSmrg	| mips64r5900-* | mips64r5900el-* \
3931f27ce9aSmrg	| mips64vr-* | mips64vrel-* \
3946df26cacSmrg	| mips64vr4100-* | mips64vr4100el-* \
3956df26cacSmrg	| mips64vr4300-* | mips64vr4300el-* \
3966df26cacSmrg	| mips64vr5000-* | mips64vr5000el-* \
3976df26cacSmrg	| mips64vr5900-* | mips64vr5900el-* \
3986df26cacSmrg	| mipsisa32-* | mipsisa32el-* \
3996df26cacSmrg	| mipsisa32r2-* | mipsisa32r2el-* \
4006df26cacSmrg	| mipsisa64-* | mipsisa64el-* \
4016df26cacSmrg	| mipsisa64r2-* | mipsisa64r2el-* \
4026df26cacSmrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
4036df26cacSmrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
4046df26cacSmrg	| mipstx39-* | mipstx39el-* \
4056df26cacSmrg	| mmix-* \
4066df26cacSmrg	| mt-* \
4076df26cacSmrg	| msp430-* \
4083bfa90b6Smrg	| nds32-* | nds32le-* | nds32be-* \
4096df26cacSmrg	| nios-* | nios2-* \
4106df26cacSmrg	| none-* | np1-* | ns16k-* | ns32k-* \
4113bfa90b6Smrg	| open8-* \
4126df26cacSmrg	| orion-* \
4136df26cacSmrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
4143bfa90b6Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
4156df26cacSmrg	| pyramid-* \
4163bfa90b6Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
4173bfa90b6Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
4186df26cacSmrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
4196df26cacSmrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
4206df26cacSmrg	| sparclite-* \
4213bfa90b6Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
4223bfa90b6Smrg	| tahoe-* \
4233bfa90b6Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
4243bfa90b6Smrg	| tile*-* \
4256df26cacSmrg	| tron-* \
4263bfa90b6Smrg	| ubicom32-* \
4273bfa90b6Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
4283bfa90b6Smrg	| vax-* \
4296df26cacSmrg	| we32k-* \
4303bfa90b6Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
431b68e1f86Smrg	| xstormy16-* | xtensa*-* \
4326df26cacSmrg	| ymp-* \
4331f27ce9aSmrg	| z8k-* | z80-*)
4346df26cacSmrg		;;
435b68e1f86Smrg	# Recognize the basic CPU types without company name, with glob match.
436b68e1f86Smrg	xtensa*)
437b68e1f86Smrg		basic_machine=$basic_machine-unknown
438b68e1f86Smrg		;;
4396df26cacSmrg	# Recognize the various machine names and aliases which stand
4406df26cacSmrg	# for a CPU type and a company and sometimes even an OS.
4416df26cacSmrg	386bsd)
4426df26cacSmrg		basic_machine=i386-unknown
4436df26cacSmrg		os=-bsd
4446df26cacSmrg		;;
4456df26cacSmrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
4466df26cacSmrg		basic_machine=m68000-att
4476df26cacSmrg		;;
4486df26cacSmrg	3b*)
4496df26cacSmrg		basic_machine=we32k-att
4506df26cacSmrg		;;
4516df26cacSmrg	a29khif)
4526df26cacSmrg		basic_machine=a29k-amd
4536df26cacSmrg		os=-udi
4546df26cacSmrg		;;
4553bfa90b6Smrg	abacus)
4566df26cacSmrg		basic_machine=abacus-unknown
4576df26cacSmrg		;;
4586df26cacSmrg	adobe68k)
4596df26cacSmrg		basic_machine=m68010-adobe
4606df26cacSmrg		os=-scout
4616df26cacSmrg		;;
4626df26cacSmrg	alliant | fx80)
4636df26cacSmrg		basic_machine=fx80-alliant
4646df26cacSmrg		;;
4656df26cacSmrg	altos | altos3068)
4666df26cacSmrg		basic_machine=m68k-altos
4676df26cacSmrg		;;
4686df26cacSmrg	am29k)
4696df26cacSmrg		basic_machine=a29k-none
4706df26cacSmrg		os=-bsd
4716df26cacSmrg		;;
4726df26cacSmrg	amd64)
4736df26cacSmrg		basic_machine=x86_64-pc
4746df26cacSmrg		;;
4756df26cacSmrg	amd64-*)
4766df26cacSmrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
4776df26cacSmrg		;;
4786df26cacSmrg	amdahl)
4796df26cacSmrg		basic_machine=580-amdahl
4806df26cacSmrg		os=-sysv
4816df26cacSmrg		;;
4826df26cacSmrg	amiga | amiga-*)
4836df26cacSmrg		basic_machine=m68k-unknown
4846df26cacSmrg		;;
4856df26cacSmrg	amigaos | amigados)
4866df26cacSmrg		basic_machine=m68k-unknown
4876df26cacSmrg		os=-amigaos
4886df26cacSmrg		;;
4896df26cacSmrg	amigaunix | amix)
4906df26cacSmrg		basic_machine=m68k-unknown
4916df26cacSmrg		os=-sysv4
4926df26cacSmrg		;;
4936df26cacSmrg	apollo68)
4946df26cacSmrg		basic_machine=m68k-apollo
4956df26cacSmrg		os=-sysv
4966df26cacSmrg		;;
4976df26cacSmrg	apollo68bsd)
4986df26cacSmrg		basic_machine=m68k-apollo
4996df26cacSmrg		os=-bsd
5006df26cacSmrg		;;
5013bfa90b6Smrg	aros)
5023bfa90b6Smrg		basic_machine=i386-pc
5033bfa90b6Smrg		os=-aros
5043bfa90b6Smrg		;;
5056df26cacSmrg	aux)
5066df26cacSmrg		basic_machine=m68k-apple
5076df26cacSmrg		os=-aux
5086df26cacSmrg		;;
5096df26cacSmrg	balance)
5106df26cacSmrg		basic_machine=ns32k-sequent
5116df26cacSmrg		os=-dynix
5126df26cacSmrg		;;
513b68e1f86Smrg	blackfin)
514b68e1f86Smrg		basic_machine=bfin-unknown
515b68e1f86Smrg		os=-linux
516b68e1f86Smrg		;;
517b68e1f86Smrg	blackfin-*)
518b68e1f86Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
519b68e1f86Smrg		os=-linux
520b68e1f86Smrg		;;
5213bfa90b6Smrg	bluegene*)
5223bfa90b6Smrg		basic_machine=powerpc-ibm
5233bfa90b6Smrg		os=-cnk
5243bfa90b6Smrg		;;
5253bfa90b6Smrg	c54x-*)
5263bfa90b6Smrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
5273bfa90b6Smrg		;;
5283bfa90b6Smrg	c55x-*)
5293bfa90b6Smrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
5303bfa90b6Smrg		;;
5313bfa90b6Smrg	c6x-*)
5323bfa90b6Smrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
5333bfa90b6Smrg		;;
5346df26cacSmrg	c90)
5356df26cacSmrg		basic_machine=c90-cray
5366df26cacSmrg		os=-unicos
5376df26cacSmrg		;;
5383bfa90b6Smrg	cegcc)
5391f27ce9aSmrg		basic_machine=arm-unknown
5401f27ce9aSmrg		os=-cegcc
5411f27ce9aSmrg		;;
5426df26cacSmrg	convex-c1)
5436df26cacSmrg		basic_machine=c1-convex
5446df26cacSmrg		os=-bsd
5456df26cacSmrg		;;
5466df26cacSmrg	convex-c2)
5476df26cacSmrg		basic_machine=c2-convex
5486df26cacSmrg		os=-bsd
5496df26cacSmrg		;;
5506df26cacSmrg	convex-c32)
5516df26cacSmrg		basic_machine=c32-convex
5526df26cacSmrg		os=-bsd
5536df26cacSmrg		;;
5546df26cacSmrg	convex-c34)
5556df26cacSmrg		basic_machine=c34-convex
5566df26cacSmrg		os=-bsd
5576df26cacSmrg		;;
5586df26cacSmrg	convex-c38)
5596df26cacSmrg		basic_machine=c38-convex
5606df26cacSmrg		os=-bsd
5616df26cacSmrg		;;
5626df26cacSmrg	cray | j90)
5636df26cacSmrg		basic_machine=j90-cray
5646df26cacSmrg		os=-unicos
5656df26cacSmrg		;;
5666df26cacSmrg	craynv)
5676df26cacSmrg		basic_machine=craynv-cray
5686df26cacSmrg		os=-unicosmp
5696df26cacSmrg		;;
5703bfa90b6Smrg	cr16 | cr16-*)
571b68e1f86Smrg		basic_machine=cr16-unknown
5726df26cacSmrg		os=-elf
5736df26cacSmrg		;;
5746df26cacSmrg	crds | unos)
5756df26cacSmrg		basic_machine=m68k-crds
5766df26cacSmrg		;;
5776df26cacSmrg	crisv32 | crisv32-* | etraxfs*)
5786df26cacSmrg		basic_machine=crisv32-axis
5796df26cacSmrg		;;
5806df26cacSmrg	cris | cris-* | etrax*)
5816df26cacSmrg		basic_machine=cris-axis
5826df26cacSmrg		;;
5836df26cacSmrg	crx)
5846df26cacSmrg		basic_machine=crx-unknown
5856df26cacSmrg		os=-elf
5866df26cacSmrg		;;
5876df26cacSmrg	da30 | da30-*)
5886df26cacSmrg		basic_machine=m68k-da30
5896df26cacSmrg		;;
5906df26cacSmrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
5916df26cacSmrg		basic_machine=mips-dec
5926df26cacSmrg		;;
5936df26cacSmrg	decsystem10* | dec10*)
5946df26cacSmrg		basic_machine=pdp10-dec
5956df26cacSmrg		os=-tops10
5966df26cacSmrg		;;
5976df26cacSmrg	decsystem20* | dec20*)
5986df26cacSmrg		basic_machine=pdp10-dec
5996df26cacSmrg		os=-tops20
6006df26cacSmrg		;;
6016df26cacSmrg	delta | 3300 | motorola-3300 | motorola-delta \
6026df26cacSmrg	      | 3300-motorola | delta-motorola)
6036df26cacSmrg		basic_machine=m68k-motorola
6046df26cacSmrg		;;
6056df26cacSmrg	delta88)
6066df26cacSmrg		basic_machine=m88k-motorola
6076df26cacSmrg		os=-sysv3
6086df26cacSmrg		;;
6091f27ce9aSmrg	dicos)
6101f27ce9aSmrg		basic_machine=i686-pc
6111f27ce9aSmrg		os=-dicos
6121f27ce9aSmrg		;;
6136df26cacSmrg	djgpp)
6146df26cacSmrg		basic_machine=i586-pc
6156df26cacSmrg		os=-msdosdjgpp
6166df26cacSmrg		;;
6176df26cacSmrg	dpx20 | dpx20-*)
6186df26cacSmrg		basic_machine=rs6000-bull
6196df26cacSmrg		os=-bosx
6206df26cacSmrg		;;
6216df26cacSmrg	dpx2* | dpx2*-bull)
6226df26cacSmrg		basic_machine=m68k-bull
6236df26cacSmrg		os=-sysv3
6246df26cacSmrg		;;
6256df26cacSmrg	ebmon29k)
6266df26cacSmrg		basic_machine=a29k-amd
6276df26cacSmrg		os=-ebmon
6286df26cacSmrg		;;
6296df26cacSmrg	elxsi)
6306df26cacSmrg		basic_machine=elxsi-elxsi
6316df26cacSmrg		os=-bsd
6326df26cacSmrg		;;
6336df26cacSmrg	encore | umax | mmax)
6346df26cacSmrg		basic_machine=ns32k-encore
6356df26cacSmrg		;;
6366df26cacSmrg	es1800 | OSE68k | ose68k | ose | OSE)
6376df26cacSmrg		basic_machine=m68k-ericsson
6386df26cacSmrg		os=-ose
6396df26cacSmrg		;;
6406df26cacSmrg	fx2800)
6416df26cacSmrg		basic_machine=i860-alliant
6426df26cacSmrg		;;
6436df26cacSmrg	genix)
6446df26cacSmrg		basic_machine=ns32k-ns
6456df26cacSmrg		;;
6466df26cacSmrg	gmicro)
6476df26cacSmrg		basic_machine=tron-gmicro
6486df26cacSmrg		os=-sysv
6496df26cacSmrg		;;
6506df26cacSmrg	go32)
6516df26cacSmrg		basic_machine=i386-pc
6526df26cacSmrg		os=-go32
6536df26cacSmrg		;;
6546df26cacSmrg	h3050r* | hiux*)
6556df26cacSmrg		basic_machine=hppa1.1-hitachi
6566df26cacSmrg		os=-hiuxwe2
6576df26cacSmrg		;;
6586df26cacSmrg	h8300hms)
6596df26cacSmrg		basic_machine=h8300-hitachi
6606df26cacSmrg		os=-hms
6616df26cacSmrg		;;
6626df26cacSmrg	h8300xray)
6636df26cacSmrg		basic_machine=h8300-hitachi
6646df26cacSmrg		os=-xray
6656df26cacSmrg		;;
6666df26cacSmrg	h8500hms)
6676df26cacSmrg		basic_machine=h8500-hitachi
6686df26cacSmrg		os=-hms
6696df26cacSmrg		;;
6706df26cacSmrg	harris)
6716df26cacSmrg		basic_machine=m88k-harris
6726df26cacSmrg		os=-sysv3
6736df26cacSmrg		;;
6746df26cacSmrg	hp300-*)
6756df26cacSmrg		basic_machine=m68k-hp
6766df26cacSmrg		;;
6776df26cacSmrg	hp300bsd)
6786df26cacSmrg		basic_machine=m68k-hp
6796df26cacSmrg		os=-bsd
6806df26cacSmrg		;;
6816df26cacSmrg	hp300hpux)
6826df26cacSmrg		basic_machine=m68k-hp
6836df26cacSmrg		os=-hpux
6846df26cacSmrg		;;
6856df26cacSmrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
6866df26cacSmrg		basic_machine=hppa1.0-hp
6876df26cacSmrg		;;
6886df26cacSmrg	hp9k2[0-9][0-9] | hp9k31[0-9])
6896df26cacSmrg		basic_machine=m68000-hp
6906df26cacSmrg		;;
6916df26cacSmrg	hp9k3[2-9][0-9])
6926df26cacSmrg		basic_machine=m68k-hp
6936df26cacSmrg		;;
6946df26cacSmrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
6956df26cacSmrg		basic_machine=hppa1.0-hp
6966df26cacSmrg		;;
6976df26cacSmrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
6986df26cacSmrg		basic_machine=hppa1.1-hp
6996df26cacSmrg		;;
7006df26cacSmrg	hp9k78[0-9] | hp78[0-9])
7016df26cacSmrg		# FIXME: really hppa2.0-hp
7026df26cacSmrg		basic_machine=hppa1.1-hp
7036df26cacSmrg		;;
7046df26cacSmrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
7056df26cacSmrg		# FIXME: really hppa2.0-hp
7066df26cacSmrg		basic_machine=hppa1.1-hp
7076df26cacSmrg		;;
7086df26cacSmrg	hp9k8[0-9][13679] | hp8[0-9][13679])
7096df26cacSmrg		basic_machine=hppa1.1-hp
7106df26cacSmrg		;;
7116df26cacSmrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
7126df26cacSmrg		basic_machine=hppa1.0-hp
7136df26cacSmrg		;;
7146df26cacSmrg	hppa-next)
7156df26cacSmrg		os=-nextstep3
7166df26cacSmrg		;;
7176df26cacSmrg	hppaosf)
7186df26cacSmrg		basic_machine=hppa1.1-hp
7196df26cacSmrg		os=-osf
7206df26cacSmrg		;;
7216df26cacSmrg	hppro)
7226df26cacSmrg		basic_machine=hppa1.1-hp
7236df26cacSmrg		os=-proelf
7246df26cacSmrg		;;
7256df26cacSmrg	i370-ibm* | ibm*)
7266df26cacSmrg		basic_machine=i370-ibm
7276df26cacSmrg		;;
7286df26cacSmrg	i*86v32)
7296df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7306df26cacSmrg		os=-sysv32
7316df26cacSmrg		;;
7326df26cacSmrg	i*86v4*)
7336df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7346df26cacSmrg		os=-sysv4
7356df26cacSmrg		;;
7366df26cacSmrg	i*86v)
7376df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7386df26cacSmrg		os=-sysv
7396df26cacSmrg		;;
7406df26cacSmrg	i*86sol2)
7416df26cacSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
7426df26cacSmrg		os=-solaris2
7436df26cacSmrg		;;
7446df26cacSmrg	i386mach)
7456df26cacSmrg		basic_machine=i386-mach
7466df26cacSmrg		os=-mach
7476df26cacSmrg		;;
7486df26cacSmrg	i386-vsta | vsta)
7496df26cacSmrg		basic_machine=i386-unknown
7506df26cacSmrg		os=-vsta
7516df26cacSmrg		;;
7526df26cacSmrg	iris | iris4d)
7536df26cacSmrg		basic_machine=mips-sgi
7546df26cacSmrg		case $os in
7556df26cacSmrg		    -irix*)
7566df26cacSmrg			;;
7576df26cacSmrg		    *)
7586df26cacSmrg			os=-irix4
7596df26cacSmrg			;;
7606df26cacSmrg		esac
7616df26cacSmrg		;;
7626df26cacSmrg	isi68 | isi)
7636df26cacSmrg		basic_machine=m68k-isi
7646df26cacSmrg		os=-sysv
7656df26cacSmrg		;;
766b68e1f86Smrg	m68knommu)
767b68e1f86Smrg		basic_machine=m68k-unknown
768b68e1f86Smrg		os=-linux
769b68e1f86Smrg		;;
770b68e1f86Smrg	m68knommu-*)
771b68e1f86Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
772b68e1f86Smrg		os=-linux
773b68e1f86Smrg		;;
7746df26cacSmrg	m88k-omron*)
7756df26cacSmrg		basic_machine=m88k-omron
7766df26cacSmrg		;;
7776df26cacSmrg	magnum | m3230)
7786df26cacSmrg		basic_machine=mips-mips
7796df26cacSmrg		os=-sysv
7806df26cacSmrg		;;
7816df26cacSmrg	merlin)
7826df26cacSmrg		basic_machine=ns32k-utek
7836df26cacSmrg		os=-sysv
7846df26cacSmrg		;;
7853bfa90b6Smrg	microblaze)
7863bfa90b6Smrg		basic_machine=microblaze-xilinx
7873bfa90b6Smrg		;;
7886df26cacSmrg	mingw32)
7896df26cacSmrg		basic_machine=i386-pc
7906df26cacSmrg		os=-mingw32
7916df26cacSmrg		;;
79216fd1166Smrg	mingw32ce)
79316fd1166Smrg		basic_machine=arm-unknown
79416fd1166Smrg		os=-mingw32ce
79516fd1166Smrg		;;
7966df26cacSmrg	miniframe)
7976df26cacSmrg		basic_machine=m68000-convergent
7986df26cacSmrg		;;
7996df26cacSmrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
8006df26cacSmrg		basic_machine=m68k-atari
8016df26cacSmrg		os=-mint
8026df26cacSmrg		;;
8036df26cacSmrg	mips3*-*)
8046df26cacSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
8056df26cacSmrg		;;
8066df26cacSmrg	mips3*)
8076df26cacSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
8086df26cacSmrg		;;
8096df26cacSmrg	monitor)
8106df26cacSmrg		basic_machine=m68k-rom68k
8116df26cacSmrg		os=-coff
8126df26cacSmrg		;;
8136df26cacSmrg	morphos)
8146df26cacSmrg		basic_machine=powerpc-unknown
8156df26cacSmrg		os=-morphos
8166df26cacSmrg		;;
8176df26cacSmrg	msdos)
8186df26cacSmrg		basic_machine=i386-pc
8196df26cacSmrg		os=-msdos
8206df26cacSmrg		;;
8216df26cacSmrg	ms1-*)
8226df26cacSmrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
8236df26cacSmrg		;;
8243bfa90b6Smrg	msys)
8253bfa90b6Smrg		basic_machine=i386-pc
8263bfa90b6Smrg		os=-msys
8273bfa90b6Smrg		;;
8286df26cacSmrg	mvs)
8296df26cacSmrg		basic_machine=i370-ibm
8306df26cacSmrg		os=-mvs
8316df26cacSmrg		;;
8323bfa90b6Smrg	nacl)
8333bfa90b6Smrg		basic_machine=le32-unknown
8343bfa90b6Smrg		os=-nacl
8353bfa90b6Smrg		;;
8366df26cacSmrg	ncr3000)
8376df26cacSmrg		basic_machine=i486-ncr
8386df26cacSmrg		os=-sysv4
8396df26cacSmrg		;;
8406df26cacSmrg	netbsd386)
8416df26cacSmrg		basic_machine=i386-unknown
8426df26cacSmrg		os=-netbsd
8436df26cacSmrg		;;
8446df26cacSmrg	netwinder)
8456df26cacSmrg		basic_machine=armv4l-rebel
8466df26cacSmrg		os=-linux
8476df26cacSmrg		;;
8486df26cacSmrg	news | news700 | news800 | news900)
8496df26cacSmrg		basic_machine=m68k-sony
8506df26cacSmrg		os=-newsos
8516df26cacSmrg		;;
8526df26cacSmrg	news1000)
8536df26cacSmrg		basic_machine=m68030-sony
8546df26cacSmrg		os=-newsos
8556df26cacSmrg		;;
8566df26cacSmrg	news-3600 | risc-news)
8576df26cacSmrg		basic_machine=mips-sony
8586df26cacSmrg		os=-newsos
8596df26cacSmrg		;;
8606df26cacSmrg	necv70)
8616df26cacSmrg		basic_machine=v70-nec
8626df26cacSmrg		os=-sysv
8636df26cacSmrg		;;
8646df26cacSmrg	next | m*-next )
8656df26cacSmrg		basic_machine=m68k-next
8666df26cacSmrg		case $os in
8676df26cacSmrg		    -nextstep* )
8686df26cacSmrg			;;
8696df26cacSmrg		    -ns2*)
8706df26cacSmrg		      os=-nextstep2
8716df26cacSmrg			;;
8726df26cacSmrg		    *)
8736df26cacSmrg		      os=-nextstep3
8746df26cacSmrg			;;
8756df26cacSmrg		esac
8766df26cacSmrg		;;
8776df26cacSmrg	nh3000)
8786df26cacSmrg		basic_machine=m68k-harris
8796df26cacSmrg		os=-cxux
8806df26cacSmrg		;;
8816df26cacSmrg	nh[45]000)
8826df26cacSmrg		basic_machine=m88k-harris
8836df26cacSmrg		os=-cxux
8846df26cacSmrg		;;
8856df26cacSmrg	nindy960)
8866df26cacSmrg		basic_machine=i960-intel
8876df26cacSmrg		os=-nindy
8886df26cacSmrg		;;
8896df26cacSmrg	mon960)
8906df26cacSmrg		basic_machine=i960-intel
8916df26cacSmrg		os=-mon960
8926df26cacSmrg		;;
8936df26cacSmrg	nonstopux)
8946df26cacSmrg		basic_machine=mips-compaq
8956df26cacSmrg		os=-nonstopux
8966df26cacSmrg		;;
8976df26cacSmrg	np1)
8986df26cacSmrg		basic_machine=np1-gould
8996df26cacSmrg		;;
9003bfa90b6Smrg	neo-tandem)
9013bfa90b6Smrg		basic_machine=neo-tandem
9023bfa90b6Smrg		;;
9033bfa90b6Smrg	nse-tandem)
9043bfa90b6Smrg		basic_machine=nse-tandem
9053bfa90b6Smrg		;;
9066df26cacSmrg	nsr-tandem)
9076df26cacSmrg		basic_machine=nsr-tandem
9086df26cacSmrg		;;
9096df26cacSmrg	op50n-* | op60c-*)
9106df26cacSmrg		basic_machine=hppa1.1-oki
9116df26cacSmrg		os=-proelf
9126df26cacSmrg		;;
9136df26cacSmrg	openrisc | openrisc-*)
9146df26cacSmrg		basic_machine=or32-unknown
9156df26cacSmrg		;;
9166df26cacSmrg	os400)
9176df26cacSmrg		basic_machine=powerpc-ibm
9186df26cacSmrg		os=-os400
9196df26cacSmrg		;;
9206df26cacSmrg	OSE68000 | ose68000)
9216df26cacSmrg		basic_machine=m68000-ericsson
9226df26cacSmrg		os=-ose
9236df26cacSmrg		;;
9246df26cacSmrg	os68k)
9256df26cacSmrg		basic_machine=m68k-none
9266df26cacSmrg		os=-os68k
9276df26cacSmrg		;;
9286df26cacSmrg	pa-hitachi)
9296df26cacSmrg		basic_machine=hppa1.1-hitachi
9306df26cacSmrg		os=-hiuxwe2
9316df26cacSmrg		;;
9326df26cacSmrg	paragon)
9336df26cacSmrg		basic_machine=i860-intel
9346df26cacSmrg		os=-osf
9356df26cacSmrg		;;
936b68e1f86Smrg	parisc)
937b68e1f86Smrg		basic_machine=hppa-unknown
938b68e1f86Smrg		os=-linux
939b68e1f86Smrg		;;
940b68e1f86Smrg	parisc-*)
941b68e1f86Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
942b68e1f86Smrg		os=-linux
943b68e1f86Smrg		;;
9446df26cacSmrg	pbd)
9456df26cacSmrg		basic_machine=sparc-tti
9466df26cacSmrg		;;
9476df26cacSmrg	pbb)
9486df26cacSmrg		basic_machine=m68k-tti
9496df26cacSmrg		;;
9506df26cacSmrg	pc532 | pc532-*)
9516df26cacSmrg		basic_machine=ns32k-pc532
9526df26cacSmrg		;;
9536df26cacSmrg	pc98)
9546df26cacSmrg		basic_machine=i386-pc
9556df26cacSmrg		;;
9566df26cacSmrg	pc98-*)
9576df26cacSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
9586df26cacSmrg		;;
9596df26cacSmrg	pentium | p5 | k5 | k6 | nexgen | viac3)
9606df26cacSmrg		basic_machine=i586-pc
9616df26cacSmrg		;;
9626df26cacSmrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
9636df26cacSmrg		basic_machine=i686-pc
9646df26cacSmrg		;;
9656df26cacSmrg	pentiumii | pentium2 | pentiumiii | pentium3)
9666df26cacSmrg		basic_machine=i686-pc
9676df26cacSmrg		;;
9686df26cacSmrg	pentium4)
9696df26cacSmrg		basic_machine=i786-pc
9706df26cacSmrg		;;
9716df26cacSmrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
9726df26cacSmrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
9736df26cacSmrg		;;
9746df26cacSmrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
9756df26cacSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9766df26cacSmrg		;;
9776df26cacSmrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
9786df26cacSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
9796df26cacSmrg		;;
9806df26cacSmrg	pentium4-*)
9816df26cacSmrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
9826df26cacSmrg		;;
9836df26cacSmrg	pn)
9846df26cacSmrg		basic_machine=pn-gould
9856df26cacSmrg		;;
9866df26cacSmrg	power)	basic_machine=power-ibm
9876df26cacSmrg		;;
9883bfa90b6Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
9896df26cacSmrg		;;
9903bfa90b6Smrg	ppc-* | ppcbe-*)
9913bfa90b6Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
9926df26cacSmrg		;;
9936df26cacSmrg	ppcle | powerpclittle | ppc-le | powerpc-little)
9946df26cacSmrg		basic_machine=powerpcle-unknown
9956df26cacSmrg		;;
9966df26cacSmrg	ppcle-* | powerpclittle-*)
9976df26cacSmrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
9986df26cacSmrg		;;
9996df26cacSmrg	ppc64)	basic_machine=powerpc64-unknown
10006df26cacSmrg		;;
10016df26cacSmrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
10026df26cacSmrg		;;
10036df26cacSmrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
10046df26cacSmrg		basic_machine=powerpc64le-unknown
10056df26cacSmrg		;;
10066df26cacSmrg	ppc64le-* | powerpc64little-*)
10076df26cacSmrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
10086df26cacSmrg		;;
10096df26cacSmrg	ps2)
10106df26cacSmrg		basic_machine=i386-ibm
10116df26cacSmrg		;;
10126df26cacSmrg	pw32)
10136df26cacSmrg		basic_machine=i586-unknown
10146df26cacSmrg		os=-pw32
10156df26cacSmrg		;;
10166df26cacSmrg	rdos)
10176df26cacSmrg		basic_machine=i386-pc
10186df26cacSmrg		os=-rdos
10196df26cacSmrg		;;
10206df26cacSmrg	rom68k)
10216df26cacSmrg		basic_machine=m68k-rom68k
10226df26cacSmrg		os=-coff
10236df26cacSmrg		;;
10246df26cacSmrg	rm[46]00)
10256df26cacSmrg		basic_machine=mips-siemens
10266df26cacSmrg		;;
10276df26cacSmrg	rtpc | rtpc-*)
10286df26cacSmrg		basic_machine=romp-ibm
10296df26cacSmrg		;;
10306df26cacSmrg	s390 | s390-*)
10316df26cacSmrg		basic_machine=s390-ibm
10326df26cacSmrg		;;
10336df26cacSmrg	s390x | s390x-*)
10346df26cacSmrg		basic_machine=s390x-ibm
10356df26cacSmrg		;;
10366df26cacSmrg	sa29200)
10376df26cacSmrg		basic_machine=a29k-amd
10386df26cacSmrg		os=-udi
10396df26cacSmrg		;;
10406df26cacSmrg	sb1)
10416df26cacSmrg		basic_machine=mipsisa64sb1-unknown
10426df26cacSmrg		;;
10436df26cacSmrg	sb1el)
10446df26cacSmrg		basic_machine=mipsisa64sb1el-unknown
10456df26cacSmrg		;;
10466df26cacSmrg	sde)
10476df26cacSmrg		basic_machine=mipsisa32-sde
10486df26cacSmrg		os=-elf
10496df26cacSmrg		;;
10506df26cacSmrg	sei)
10516df26cacSmrg		basic_machine=mips-sei
10526df26cacSmrg		os=-seiux
10536df26cacSmrg		;;
10546df26cacSmrg	sequent)
10556df26cacSmrg		basic_machine=i386-sequent
10566df26cacSmrg		;;
10576df26cacSmrg	sh)
10586df26cacSmrg		basic_machine=sh-hitachi
10596df26cacSmrg		os=-hms
10606df26cacSmrg		;;
106116fd1166Smrg	sh5el)
106216fd1166Smrg		basic_machine=sh5le-unknown
106316fd1166Smrg		;;
10646df26cacSmrg	sh64)
10656df26cacSmrg		basic_machine=sh64-unknown
10666df26cacSmrg		;;
10676df26cacSmrg	sparclite-wrs | simso-wrs)
10686df26cacSmrg		basic_machine=sparclite-wrs
10696df26cacSmrg		os=-vxworks
10706df26cacSmrg		;;
10716df26cacSmrg	sps7)
10726df26cacSmrg		basic_machine=m68k-bull
10736df26cacSmrg		os=-sysv2
10746df26cacSmrg		;;
10756df26cacSmrg	spur)
10766df26cacSmrg		basic_machine=spur-unknown
10776df26cacSmrg		;;
10786df26cacSmrg	st2000)
10796df26cacSmrg		basic_machine=m68k-tandem
10806df26cacSmrg		;;
10816df26cacSmrg	stratus)
10826df26cacSmrg		basic_machine=i860-stratus
10836df26cacSmrg		os=-sysv4
10846df26cacSmrg		;;
10853bfa90b6Smrg	strongarm-* | thumb-*)
10863bfa90b6Smrg		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
10873bfa90b6Smrg		;;
10886df26cacSmrg	sun2)
10896df26cacSmrg		basic_machine=m68000-sun
10906df26cacSmrg		;;
10916df26cacSmrg	sun2os3)
10926df26cacSmrg		basic_machine=m68000-sun
10936df26cacSmrg		os=-sunos3
10946df26cacSmrg		;;
10956df26cacSmrg	sun2os4)
10966df26cacSmrg		basic_machine=m68000-sun
10976df26cacSmrg		os=-sunos4
10986df26cacSmrg		;;
10996df26cacSmrg	sun3os3)
11006df26cacSmrg		basic_machine=m68k-sun
11016df26cacSmrg		os=-sunos3
11026df26cacSmrg		;;
11036df26cacSmrg	sun3os4)
11046df26cacSmrg		basic_machine=m68k-sun
11056df26cacSmrg		os=-sunos4
11066df26cacSmrg		;;
11076df26cacSmrg	sun4os3)
11086df26cacSmrg		basic_machine=sparc-sun
11096df26cacSmrg		os=-sunos3
11106df26cacSmrg		;;
11116df26cacSmrg	sun4os4)
11126df26cacSmrg		basic_machine=sparc-sun
11136df26cacSmrg		os=-sunos4
11146df26cacSmrg		;;
11156df26cacSmrg	sun4sol2)
11166df26cacSmrg		basic_machine=sparc-sun
11176df26cacSmrg		os=-solaris2
11186df26cacSmrg		;;
11196df26cacSmrg	sun3 | sun3-*)
11206df26cacSmrg		basic_machine=m68k-sun
11216df26cacSmrg		;;
11226df26cacSmrg	sun4)
11236df26cacSmrg		basic_machine=sparc-sun
11246df26cacSmrg		;;
11256df26cacSmrg	sun386 | sun386i | roadrunner)
11266df26cacSmrg		basic_machine=i386-sun
11276df26cacSmrg		;;
11286df26cacSmrg	sv1)
11296df26cacSmrg		basic_machine=sv1-cray
11306df26cacSmrg		os=-unicos
11316df26cacSmrg		;;
11326df26cacSmrg	symmetry)
11336df26cacSmrg		basic_machine=i386-sequent
11346df26cacSmrg		os=-dynix
11356df26cacSmrg		;;
11366df26cacSmrg	t3e)
11376df26cacSmrg		basic_machine=alphaev5-cray
11386df26cacSmrg		os=-unicos
11396df26cacSmrg		;;
11406df26cacSmrg	t90)
11416df26cacSmrg		basic_machine=t90-cray
11426df26cacSmrg		os=-unicos
11436df26cacSmrg		;;
1144b68e1f86Smrg	tile*)
11453bfa90b6Smrg		basic_machine=$basic_machine-unknown
1146b68e1f86Smrg		os=-linux-gnu
1147b68e1f86Smrg		;;
11486df26cacSmrg	tx39)
11496df26cacSmrg		basic_machine=mipstx39-unknown
11506df26cacSmrg		;;
11516df26cacSmrg	tx39el)
11526df26cacSmrg		basic_machine=mipstx39el-unknown
11536df26cacSmrg		;;
11546df26cacSmrg	toad1)
11556df26cacSmrg		basic_machine=pdp10-xkl
11566df26cacSmrg		os=-tops20
11576df26cacSmrg		;;
11586df26cacSmrg	tower | tower-32)
11596df26cacSmrg		basic_machine=m68k-ncr
11606df26cacSmrg		;;
11616df26cacSmrg	tpf)
11626df26cacSmrg		basic_machine=s390x-ibm
11636df26cacSmrg		os=-tpf
11646df26cacSmrg		;;
11656df26cacSmrg	udi29k)
11666df26cacSmrg		basic_machine=a29k-amd
11676df26cacSmrg		os=-udi
11686df26cacSmrg		;;
11696df26cacSmrg	ultra3)
11706df26cacSmrg		basic_machine=a29k-nyu
11716df26cacSmrg		os=-sym1
11726df26cacSmrg		;;
11736df26cacSmrg	v810 | necv810)
11746df26cacSmrg		basic_machine=v810-nec
11756df26cacSmrg		os=-none
11766df26cacSmrg		;;
11776df26cacSmrg	vaxv)
11786df26cacSmrg		basic_machine=vax-dec
11796df26cacSmrg		os=-sysv
11806df26cacSmrg		;;
11816df26cacSmrg	vms)
11826df26cacSmrg		basic_machine=vax-dec
11836df26cacSmrg		os=-vms
11846df26cacSmrg		;;
11856df26cacSmrg	vpp*|vx|vx-*)
11866df26cacSmrg		basic_machine=f301-fujitsu
11876df26cacSmrg		;;
11886df26cacSmrg	vxworks960)
11896df26cacSmrg		basic_machine=i960-wrs
11906df26cacSmrg		os=-vxworks
11916df26cacSmrg		;;
11926df26cacSmrg	vxworks68)
11936df26cacSmrg		basic_machine=m68k-wrs
11946df26cacSmrg		os=-vxworks
11956df26cacSmrg		;;
11966df26cacSmrg	vxworks29k)
11976df26cacSmrg		basic_machine=a29k-wrs
11986df26cacSmrg		os=-vxworks
11996df26cacSmrg		;;
12006df26cacSmrg	w65*)
12016df26cacSmrg		basic_machine=w65-wdc
12026df26cacSmrg		os=-none
12036df26cacSmrg		;;
12046df26cacSmrg	w89k-*)
12056df26cacSmrg		basic_machine=hppa1.1-winbond
12066df26cacSmrg		os=-proelf
12076df26cacSmrg		;;
12086df26cacSmrg	xbox)
12096df26cacSmrg		basic_machine=i686-pc
12106df26cacSmrg		os=-mingw32
12116df26cacSmrg		;;
12126df26cacSmrg	xps | xps100)
12136df26cacSmrg		basic_machine=xps100-honeywell
12146df26cacSmrg		;;
12153bfa90b6Smrg	xscale-* | xscalee[bl]-*)
12163bfa90b6Smrg		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
12173bfa90b6Smrg		;;
12186df26cacSmrg	ymp)
12196df26cacSmrg		basic_machine=ymp-cray
12206df26cacSmrg		os=-unicos
12216df26cacSmrg		;;
12226df26cacSmrg	z8k-*-coff)
12236df26cacSmrg		basic_machine=z8k-unknown
12246df26cacSmrg		os=-sim
12256df26cacSmrg		;;
12261f27ce9aSmrg	z80-*-coff)
12271f27ce9aSmrg		basic_machine=z80-unknown
12281f27ce9aSmrg		os=-sim
12291f27ce9aSmrg		;;
12306df26cacSmrg	none)
12316df26cacSmrg		basic_machine=none-none
12326df26cacSmrg		os=-none
12336df26cacSmrg		;;
12346df26cacSmrg
12356df26cacSmrg# Here we handle the default manufacturer of certain CPU types.  It is in
12366df26cacSmrg# some cases the only manufacturer, in others, it is the most popular.
12376df26cacSmrg	w89k)
12386df26cacSmrg		basic_machine=hppa1.1-winbond
12396df26cacSmrg		;;
12406df26cacSmrg	op50n)
12416df26cacSmrg		basic_machine=hppa1.1-oki
12426df26cacSmrg		;;
12436df26cacSmrg	op60c)
12446df26cacSmrg		basic_machine=hppa1.1-oki
12456df26cacSmrg		;;
12466df26cacSmrg	romp)
12476df26cacSmrg		basic_machine=romp-ibm
12486df26cacSmrg		;;
12496df26cacSmrg	mmix)
12506df26cacSmrg		basic_machine=mmix-knuth
12516df26cacSmrg		;;
12526df26cacSmrg	rs6000)
12536df26cacSmrg		basic_machine=rs6000-ibm
12546df26cacSmrg		;;
12556df26cacSmrg	vax)
12566df26cacSmrg		basic_machine=vax-dec
12576df26cacSmrg		;;
12586df26cacSmrg	pdp10)
12596df26cacSmrg		# there are many clones, so DEC is not a safe bet
12606df26cacSmrg		basic_machine=pdp10-unknown
12616df26cacSmrg		;;
12626df26cacSmrg	pdp11)
12636df26cacSmrg		basic_machine=pdp11-dec
12646df26cacSmrg		;;
12656df26cacSmrg	we32k)
12666df26cacSmrg		basic_machine=we32k-att
12676df26cacSmrg		;;
12683bfa90b6Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
12696df26cacSmrg		basic_machine=sh-unknown
12706df26cacSmrg		;;
12716df26cacSmrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
12726df26cacSmrg		basic_machine=sparc-sun
12736df26cacSmrg		;;
12746df26cacSmrg	cydra)
12756df26cacSmrg		basic_machine=cydra-cydrome
12766df26cacSmrg		;;
12776df26cacSmrg	orion)
12786df26cacSmrg		basic_machine=orion-highlevel
12796df26cacSmrg		;;
12806df26cacSmrg	orion105)
12816df26cacSmrg		basic_machine=clipper-highlevel
12826df26cacSmrg		;;
12836df26cacSmrg	mac | mpw | mac-mpw)
12846df26cacSmrg		basic_machine=m68k-apple
12856df26cacSmrg		;;
12866df26cacSmrg	pmac | pmac-mpw)
12876df26cacSmrg		basic_machine=powerpc-apple
12886df26cacSmrg		;;
12896df26cacSmrg	*-unknown)
12906df26cacSmrg		# Make sure to match an already-canonicalized machine name.
12916df26cacSmrg		;;
12926df26cacSmrg	*)
12936df26cacSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
12946df26cacSmrg		exit 1
12956df26cacSmrg		;;
12966df26cacSmrgesac
12976df26cacSmrg
12986df26cacSmrg# Here we canonicalize certain aliases for manufacturers.
12996df26cacSmrgcase $basic_machine in
13006df26cacSmrg	*-digital*)
13016df26cacSmrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
13026df26cacSmrg		;;
13036df26cacSmrg	*-commodore*)
13046df26cacSmrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
13056df26cacSmrg		;;
13066df26cacSmrg	*)
13076df26cacSmrg		;;
13086df26cacSmrgesac
13096df26cacSmrg
13106df26cacSmrg# Decode manufacturer-specific aliases for certain operating systems.
13116df26cacSmrg
13126df26cacSmrgif [ x"$os" != x"" ]
13136df26cacSmrgthen
13146df26cacSmrgcase $os in
13153bfa90b6Smrg	# First match some system type aliases
13163bfa90b6Smrg	# that might get confused with valid system types.
13176df26cacSmrg	# -solaris* is a basic system type, with this one exception.
13183bfa90b6Smrg	-auroraux)
13193bfa90b6Smrg		os=-auroraux
13203bfa90b6Smrg		;;
13216df26cacSmrg	-solaris1 | -solaris1.*)
13226df26cacSmrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
13236df26cacSmrg		;;
13246df26cacSmrg	-solaris)
13256df26cacSmrg		os=-solaris2
13266df26cacSmrg		;;
13276df26cacSmrg	-svr4*)
13286df26cacSmrg		os=-sysv4
13296df26cacSmrg		;;
13306df26cacSmrg	-unixware*)
13316df26cacSmrg		os=-sysv4.2uw
13326df26cacSmrg		;;
13336df26cacSmrg	-gnu/linux*)
13346df26cacSmrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
13356df26cacSmrg		;;
13366df26cacSmrg	# First accept the basic system types.
13376df26cacSmrg	# The portable systems comes first.
13386df26cacSmrg	# Each alternative MUST END IN A *, to match a version number.
13396df26cacSmrg	# -sysv* is not here because it comes later, after sysvr4.
13406df26cacSmrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
13413bfa90b6Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
13423bfa90b6Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
13433bfa90b6Smrg	      | -sym* | -kopensolaris* \
13446df26cacSmrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
13453bfa90b6Smrg	      | -aos* | -aros* \
13466df26cacSmrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
13476df26cacSmrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
13486df26cacSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
13496df26cacSmrg	      | -openbsd* | -solidbsd* \
13506df26cacSmrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
13516df26cacSmrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
13526df26cacSmrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
13536df26cacSmrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
13541f27ce9aSmrg	      | -chorusos* | -chorusrdb* | -cegcc* \
13553bfa90b6Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
13563bfa90b6Smrg	      | -mingw32* | -linux-gnu* | -linux-android* \
13573bfa90b6Smrg	      | -linux-newlib* | -linux-uclibc* \
13586df26cacSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
13596df26cacSmrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
13606df26cacSmrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
13616df26cacSmrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
13626df26cacSmrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
13636df26cacSmrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
13646df26cacSmrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
13653bfa90b6Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
13666df26cacSmrg	# Remember, each alternative MUST END IN *, to match a version number.
13676df26cacSmrg		;;
13686df26cacSmrg	-qnx*)
13696df26cacSmrg		case $basic_machine in
13706df26cacSmrg		    x86-* | i*86-*)
13716df26cacSmrg			;;
13726df26cacSmrg		    *)
13736df26cacSmrg			os=-nto$os
13746df26cacSmrg			;;
13756df26cacSmrg		esac
13766df26cacSmrg		;;
13776df26cacSmrg	-nto-qnx*)
13786df26cacSmrg		;;
13796df26cacSmrg	-nto*)
13806df26cacSmrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
13816df26cacSmrg		;;
13826df26cacSmrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
13836df26cacSmrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
13846df26cacSmrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
13856df26cacSmrg		;;
13866df26cacSmrg	-mac*)
13876df26cacSmrg		os=`echo $os | sed -e 's|mac|macos|'`
13886df26cacSmrg		;;
13896df26cacSmrg	-linux-dietlibc)
13906df26cacSmrg		os=-linux-dietlibc
13916df26cacSmrg		;;
13926df26cacSmrg	-linux*)
13936df26cacSmrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
13946df26cacSmrg		;;
13956df26cacSmrg	-sunos5*)
13966df26cacSmrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
13976df26cacSmrg		;;
13986df26cacSmrg	-sunos6*)
13996df26cacSmrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
14006df26cacSmrg		;;
14016df26cacSmrg	-opened*)
14026df26cacSmrg		os=-openedition
14036df26cacSmrg		;;
14043bfa90b6Smrg	-os400*)
14056df26cacSmrg		os=-os400
14066df26cacSmrg		;;
14076df26cacSmrg	-wince*)
14086df26cacSmrg		os=-wince
14096df26cacSmrg		;;
14106df26cacSmrg	-osfrose*)
14116df26cacSmrg		os=-osfrose
14126df26cacSmrg		;;
14136df26cacSmrg	-osf*)
14146df26cacSmrg		os=-osf
14156df26cacSmrg		;;
14166df26cacSmrg	-utek*)
14176df26cacSmrg		os=-bsd
14186df26cacSmrg		;;
14196df26cacSmrg	-dynix*)
14206df26cacSmrg		os=-bsd
14216df26cacSmrg		;;
14226df26cacSmrg	-acis*)
14236df26cacSmrg		os=-aos
14246df26cacSmrg		;;
14256df26cacSmrg	-atheos*)
14266df26cacSmrg		os=-atheos
14276df26cacSmrg		;;
14286df26cacSmrg	-syllable*)
14296df26cacSmrg		os=-syllable
14306df26cacSmrg		;;
14316df26cacSmrg	-386bsd)
14326df26cacSmrg		os=-bsd
14336df26cacSmrg		;;
14346df26cacSmrg	-ctix* | -uts*)
14356df26cacSmrg		os=-sysv
14366df26cacSmrg		;;
14376df26cacSmrg	-nova*)
14386df26cacSmrg		os=-rtmk-nova
14396df26cacSmrg		;;
14406df26cacSmrg	-ns2 )
14416df26cacSmrg		os=-nextstep2
14426df26cacSmrg		;;
14436df26cacSmrg	-nsk*)
14446df26cacSmrg		os=-nsk
14456df26cacSmrg		;;
14466df26cacSmrg	# Preserve the version number of sinix5.
14476df26cacSmrg	-sinix5.*)
14486df26cacSmrg		os=`echo $os | sed -e 's|sinix|sysv|'`
14496df26cacSmrg		;;
14506df26cacSmrg	-sinix*)
14516df26cacSmrg		os=-sysv4
14526df26cacSmrg		;;
14533bfa90b6Smrg	-tpf*)
14546df26cacSmrg		os=-tpf
14556df26cacSmrg		;;
14566df26cacSmrg	-triton*)
14576df26cacSmrg		os=-sysv3
14586df26cacSmrg		;;
14596df26cacSmrg	-oss*)
14606df26cacSmrg		os=-sysv3
14616df26cacSmrg		;;
14626df26cacSmrg	-svr4)
14636df26cacSmrg		os=-sysv4
14646df26cacSmrg		;;
14656df26cacSmrg	-svr3)
14666df26cacSmrg		os=-sysv3
14676df26cacSmrg		;;
14686df26cacSmrg	-sysvr4)
14696df26cacSmrg		os=-sysv4
14706df26cacSmrg		;;
14716df26cacSmrg	# This must come after -sysvr4.
14726df26cacSmrg	-sysv*)
14736df26cacSmrg		;;
14746df26cacSmrg	-ose*)
14756df26cacSmrg		os=-ose
14766df26cacSmrg		;;
14776df26cacSmrg	-es1800*)
14786df26cacSmrg		os=-ose
14796df26cacSmrg		;;
14806df26cacSmrg	-xenix)
14816df26cacSmrg		os=-xenix
14826df26cacSmrg		;;
14836df26cacSmrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
14846df26cacSmrg		os=-mint
14856df26cacSmrg		;;
14866df26cacSmrg	-aros*)
14876df26cacSmrg		os=-aros
14886df26cacSmrg		;;
14896df26cacSmrg	-kaos*)
14906df26cacSmrg		os=-kaos
14916df26cacSmrg		;;
14926df26cacSmrg	-zvmoe)
14936df26cacSmrg		os=-zvmoe
14946df26cacSmrg		;;
14951f27ce9aSmrg	-dicos*)
14961f27ce9aSmrg		os=-dicos
14971f27ce9aSmrg		;;
14983bfa90b6Smrg	-nacl*)
14993bfa90b6Smrg		;;
15006df26cacSmrg	-none)
15016df26cacSmrg		;;
15026df26cacSmrg	*)
15036df26cacSmrg		# Get rid of the `-' at the beginning of $os.
15046df26cacSmrg		os=`echo $os | sed 's/[^-]*-//'`
15056df26cacSmrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
15066df26cacSmrg		exit 1
15076df26cacSmrg		;;
15086df26cacSmrgesac
15096df26cacSmrgelse
15106df26cacSmrg
15116df26cacSmrg# Here we handle the default operating systems that come with various machines.
15126df26cacSmrg# The value should be what the vendor currently ships out the door with their
15136df26cacSmrg# machine or put another way, the most popular os provided with the machine.
15146df26cacSmrg
15156df26cacSmrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
15166df26cacSmrg# "-sun"), then you have to tell the case statement up towards the top
15176df26cacSmrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
15186df26cacSmrg# will signal an error saying that MANUFACTURER isn't an operating
15196df26cacSmrg# system, and we'll never get to this point.
15206df26cacSmrg
15216df26cacSmrgcase $basic_machine in
15223bfa90b6Smrg	score-*)
15236df26cacSmrg		os=-elf
15246df26cacSmrg		;;
15253bfa90b6Smrg	spu-*)
15266df26cacSmrg		os=-elf
15276df26cacSmrg		;;
15286df26cacSmrg	*-acorn)
15296df26cacSmrg		os=-riscix1.2
15306df26cacSmrg		;;
15316df26cacSmrg	arm*-rebel)
15326df26cacSmrg		os=-linux
15336df26cacSmrg		;;
15346df26cacSmrg	arm*-semi)
15356df26cacSmrg		os=-aout
15366df26cacSmrg		;;
15373bfa90b6Smrg	c4x-* | tic4x-*)
15383bfa90b6Smrg		os=-coff
15393bfa90b6Smrg		;;
15403bfa90b6Smrg	tic54x-*)
15413bfa90b6Smrg		os=-coff
15423bfa90b6Smrg		;;
15433bfa90b6Smrg	tic55x-*)
15443bfa90b6Smrg		os=-coff
15453bfa90b6Smrg		;;
15463bfa90b6Smrg	tic6x-*)
15473bfa90b6Smrg		os=-coff
15486df26cacSmrg		;;
15496df26cacSmrg	# This must come before the *-dec entry.
15506df26cacSmrg	pdp10-*)
15516df26cacSmrg		os=-tops20
15526df26cacSmrg		;;
15536df26cacSmrg	pdp11-*)
15546df26cacSmrg		os=-none
15556df26cacSmrg		;;
15566df26cacSmrg	*-dec | vax-*)
15576df26cacSmrg		os=-ultrix4.2
15586df26cacSmrg		;;
15596df26cacSmrg	m68*-apollo)
15606df26cacSmrg		os=-domain
15616df26cacSmrg		;;
15626df26cacSmrg	i386-sun)
15636df26cacSmrg		os=-sunos4.0.2
15646df26cacSmrg		;;
15656df26cacSmrg	m68000-sun)
15666df26cacSmrg		os=-sunos3
15676df26cacSmrg		;;
15686df26cacSmrg	m68*-cisco)
15696df26cacSmrg		os=-aout
15706df26cacSmrg		;;
15713bfa90b6Smrg	mep-*)
157216fd1166Smrg		os=-elf
157316fd1166Smrg		;;
15746df26cacSmrg	mips*-cisco)
15756df26cacSmrg		os=-elf
15766df26cacSmrg		;;
15776df26cacSmrg	mips*-*)
15786df26cacSmrg		os=-elf
15796df26cacSmrg		;;
15806df26cacSmrg	or32-*)
15816df26cacSmrg		os=-coff
15826df26cacSmrg		;;
15836df26cacSmrg	*-tti)	# must be before sparc entry or we get the wrong os.
15846df26cacSmrg		os=-sysv3
15856df26cacSmrg		;;
15866df26cacSmrg	sparc-* | *-sun)
15876df26cacSmrg		os=-sunos4.1.1
15886df26cacSmrg		;;
15896df26cacSmrg	*-be)
15906df26cacSmrg		os=-beos
15916df26cacSmrg		;;
15926df26cacSmrg	*-haiku)
15936df26cacSmrg		os=-haiku
15946df26cacSmrg		;;
15956df26cacSmrg	*-ibm)
15966df26cacSmrg		os=-aix
15976df26cacSmrg		;;
15983bfa90b6Smrg	*-knuth)
15996df26cacSmrg		os=-mmixware
16006df26cacSmrg		;;
16016df26cacSmrg	*-wec)
16026df26cacSmrg		os=-proelf
16036df26cacSmrg		;;
16046df26cacSmrg	*-winbond)
16056df26cacSmrg		os=-proelf
16066df26cacSmrg		;;
16076df26cacSmrg	*-oki)
16086df26cacSmrg		os=-proelf
16096df26cacSmrg		;;
16106df26cacSmrg	*-hp)
16116df26cacSmrg		os=-hpux
16126df26cacSmrg		;;
16136df26cacSmrg	*-hitachi)
16146df26cacSmrg		os=-hiux
16156df26cacSmrg		;;
16166df26cacSmrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
16176df26cacSmrg		os=-sysv
16186df26cacSmrg		;;
16196df26cacSmrg	*-cbm)
16206df26cacSmrg		os=-amigaos
16216df26cacSmrg		;;
16226df26cacSmrg	*-dg)
16236df26cacSmrg		os=-dgux
16246df26cacSmrg		;;
16256df26cacSmrg	*-dolphin)
16266df26cacSmrg		os=-sysv3
16276df26cacSmrg		;;
16286df26cacSmrg	m68k-ccur)
16296df26cacSmrg		os=-rtu
16306df26cacSmrg		;;
16316df26cacSmrg	m88k-omron*)
16326df26cacSmrg		os=-luna
16336df26cacSmrg		;;
16346df26cacSmrg	*-next )
16356df26cacSmrg		os=-nextstep
16366df26cacSmrg		;;
16376df26cacSmrg	*-sequent)
16386df26cacSmrg		os=-ptx
16396df26cacSmrg		;;
16406df26cacSmrg	*-crds)
16416df26cacSmrg		os=-unos
16426df26cacSmrg		;;
16436df26cacSmrg	*-ns)
16446df26cacSmrg		os=-genix
16456df26cacSmrg		;;
16466df26cacSmrg	i370-*)
16476df26cacSmrg		os=-mvs
16486df26cacSmrg		;;
16496df26cacSmrg	*-next)
16506df26cacSmrg		os=-nextstep3
16516df26cacSmrg		;;
16526df26cacSmrg	*-gould)
16536df26cacSmrg		os=-sysv
16546df26cacSmrg		;;
16556df26cacSmrg	*-highlevel)
16566df26cacSmrg		os=-bsd
16576df26cacSmrg		;;
16586df26cacSmrg	*-encore)
16596df26cacSmrg		os=-bsd
16606df26cacSmrg		;;
16616df26cacSmrg	*-sgi)
16626df26cacSmrg		os=-irix
16636df26cacSmrg		;;
16646df26cacSmrg	*-siemens)
16656df26cacSmrg		os=-sysv4
16666df26cacSmrg		;;
16676df26cacSmrg	*-masscomp)
16686df26cacSmrg		os=-rtu
16696df26cacSmrg		;;
16706df26cacSmrg	f30[01]-fujitsu | f700-fujitsu)
16716df26cacSmrg		os=-uxpv
16726df26cacSmrg		;;
16736df26cacSmrg	*-rom68k)
16746df26cacSmrg		os=-coff
16756df26cacSmrg		;;
16766df26cacSmrg	*-*bug)
16776df26cacSmrg		os=-coff
16786df26cacSmrg		;;
16796df26cacSmrg	*-apple)
16806df26cacSmrg		os=-macos
16816df26cacSmrg		;;
16826df26cacSmrg	*-atari*)
16836df26cacSmrg		os=-mint
16846df26cacSmrg		;;
16856df26cacSmrg	*)
16866df26cacSmrg		os=-none
16876df26cacSmrg		;;
16886df26cacSmrgesac
16896df26cacSmrgfi
16906df26cacSmrg
16916df26cacSmrg# Here we handle the case where we know the os, and the CPU type, but not the
16926df26cacSmrg# manufacturer.  We pick the logical manufacturer.
16936df26cacSmrgvendor=unknown
16946df26cacSmrgcase $basic_machine in
16956df26cacSmrg	*-unknown)
16966df26cacSmrg		case $os in
16976df26cacSmrg			-riscix*)
16986df26cacSmrg				vendor=acorn
16996df26cacSmrg				;;
17006df26cacSmrg			-sunos*)
17016df26cacSmrg				vendor=sun
17026df26cacSmrg				;;
17033bfa90b6Smrg			-cnk*|-aix*)
17046df26cacSmrg				vendor=ibm
17056df26cacSmrg				;;
17066df26cacSmrg			-beos*)
17076df26cacSmrg				vendor=be
17086df26cacSmrg				;;
17096df26cacSmrg			-hpux*)
17106df26cacSmrg				vendor=hp
17116df26cacSmrg				;;
17126df26cacSmrg			-mpeix*)
17136df26cacSmrg				vendor=hp
17146df26cacSmrg				;;
17156df26cacSmrg			-hiux*)
17166df26cacSmrg				vendor=hitachi
17176df26cacSmrg				;;
17186df26cacSmrg			-unos*)
17196df26cacSmrg				vendor=crds
17206df26cacSmrg				;;
17216df26cacSmrg			-dgux*)
17226df26cacSmrg				vendor=dg
17236df26cacSmrg				;;
17246df26cacSmrg			-luna*)
17256df26cacSmrg				vendor=omron
17266df26cacSmrg				;;
17276df26cacSmrg			-genix*)
17286df26cacSmrg				vendor=ns
17296df26cacSmrg				;;
17306df26cacSmrg			-mvs* | -opened*)
17316df26cacSmrg				vendor=ibm
17326df26cacSmrg				;;
17336df26cacSmrg			-os400*)
17346df26cacSmrg				vendor=ibm
17356df26cacSmrg				;;
17366df26cacSmrg			-ptx*)
17376df26cacSmrg				vendor=sequent
17386df26cacSmrg				;;
17396df26cacSmrg			-tpf*)
17406df26cacSmrg				vendor=ibm
17416df26cacSmrg				;;
17426df26cacSmrg			-vxsim* | -vxworks* | -windiss*)
17436df26cacSmrg				vendor=wrs
17446df26cacSmrg				;;
17456df26cacSmrg			-aux*)
17466df26cacSmrg				vendor=apple
17476df26cacSmrg				;;
17486df26cacSmrg			-hms*)
17496df26cacSmrg				vendor=hitachi
17506df26cacSmrg				;;
17516df26cacSmrg			-mpw* | -macos*)
17526df26cacSmrg				vendor=apple
17536df26cacSmrg				;;
17546df26cacSmrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
17556df26cacSmrg				vendor=atari
17566df26cacSmrg				;;
17576df26cacSmrg			-vos*)
17586df26cacSmrg				vendor=stratus
17596df26cacSmrg				;;
17606df26cacSmrg		esac
17616df26cacSmrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
17626df26cacSmrg		;;
17636df26cacSmrgesac
17646df26cacSmrg
17656df26cacSmrgecho $basic_machine$os
17666df26cacSmrgexit
17676df26cacSmrg
17686df26cacSmrg# Local variables:
17696df26cacSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
17706df26cacSmrg# time-stamp-start: "timestamp='"
17716df26cacSmrg# time-stamp-format: "%:y-%02m-%02d"
17726df26cacSmrg# time-stamp-end: "'"
17736df26cacSmrg# End:
1774