config.sub revision 74c14cd6
172b676d7Smrg#! /bin/sh
272b676d7Smrg# Configuration validation subroutine script.
372b676d7Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
474c14cd6Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
574c14cd6Smrg#   2011, 2012 Free Software Foundation, Inc.
672b676d7Smrg
774c14cd6Smrgtimestamp='2012-01-01'
872b676d7Smrg
972b676d7Smrg# This file is (in principle) common to ALL GNU software.
1072b676d7Smrg# The presence of a machine in this file suggests that SOME GNU software
1172b676d7Smrg# can handle that machine.  It does not imply ALL GNU software can.
1272b676d7Smrg#
1372b676d7Smrg# This file is free software; you can redistribute it and/or modify
1472b676d7Smrg# it under the terms of the GNU General Public License as published by
1572b676d7Smrg# the Free Software Foundation; either version 2 of the License, or
1672b676d7Smrg# (at your option) any later version.
1772b676d7Smrg#
1872b676d7Smrg# This program is distributed in the hope that it will be useful,
1972b676d7Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
2072b676d7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2172b676d7Smrg# GNU General Public License for more details.
2272b676d7Smrg#
2372b676d7Smrg# You should have received a copy of the GNU General Public License
2472b676d7Smrg# along with this program; if not, write to the Free Software
2572b676d7Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2672b676d7Smrg# 02110-1301, USA.
2772b676d7Smrg#
2872b676d7Smrg# As a special exception to the GNU General Public License, if you
2972b676d7Smrg# distribute this file as part of a program that contains a
3072b676d7Smrg# configuration script generated by Autoconf, you may include it under
3172b676d7Smrg# the same distribution terms that you use for the rest of that program.
3272b676d7Smrg
3372b676d7Smrg
3472b676d7Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3574c14cd6Smrg# diff and a properly formatted GNU ChangeLog entry.
3672b676d7Smrg#
3772b676d7Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3872b676d7Smrg# Supply the specified configuration type as an argument.
3972b676d7Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
4072b676d7Smrg# Otherwise, we print the canonical config type on stdout and succeed.
4172b676d7Smrg
4274c14cd6Smrg# You can get the latest version of this script from:
4374c14cd6Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
4474c14cd6Smrg
4572b676d7Smrg# This file is supposed to be the same for all GNU packages
4672b676d7Smrg# and recognize all the CPU types, system types and aliases
4772b676d7Smrg# that are meaningful with *any* GNU software.
4872b676d7Smrg# Each package is responsible for reporting which valid configurations
4972b676d7Smrg# it does not support.  The user should be able to distinguish
5072b676d7Smrg# a failure to support a valid configuration from a meaningless
5172b676d7Smrg# configuration.
5272b676d7Smrg
5372b676d7Smrg# The goal of this file is to map all the various variations of a given
5472b676d7Smrg# machine specification into a single specification in the form:
5572b676d7Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5672b676d7Smrg# or in some cases, the newer four-part form:
5772b676d7Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5872b676d7Smrg# It is wrong to echo any other type of specification.
5972b676d7Smrg
6072b676d7Smrgme=`echo "$0" | sed -e 's,.*/,,'`
6172b676d7Smrg
6272b676d7Smrgusage="\
6372b676d7SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
6472b676d7Smrg       $0 [OPTION] ALIAS
6572b676d7Smrg
6672b676d7SmrgCanonicalize a configuration name.
6772b676d7Smrg
6872b676d7SmrgOperation modes:
6972b676d7Smrg  -h, --help         print this help, then exit
7072b676d7Smrg  -t, --time-stamp   print date of last modification, then exit
7172b676d7Smrg  -v, --version      print version number, then exit
7272b676d7Smrg
7372b676d7SmrgReport bugs and patches to <config-patches@gnu.org>."
7472b676d7Smrg
7572b676d7Smrgversion="\
7672b676d7SmrgGNU config.sub ($timestamp)
7772b676d7Smrg
7874c14cd6SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
7974c14cd6Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
8074c14cd6SmrgFree Software Foundation, Inc.
8172b676d7Smrg
8272b676d7SmrgThis is free software; see the source for copying conditions.  There is NO
8372b676d7Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8472b676d7Smrg
8572b676d7Smrghelp="
8672b676d7SmrgTry \`$me --help' for more information."
8772b676d7Smrg
8872b676d7Smrg# Parse command line
8972b676d7Smrgwhile test $# -gt 0 ; do
9072b676d7Smrg  case $1 in
9172b676d7Smrg    --time-stamp | --time* | -t )
9272b676d7Smrg       echo "$timestamp" ; exit ;;
9372b676d7Smrg    --version | -v )
9472b676d7Smrg       echo "$version" ; exit ;;
9572b676d7Smrg    --help | --h* | -h )
9672b676d7Smrg       echo "$usage"; exit ;;
9772b676d7Smrg    -- )     # Stop option processing
9872b676d7Smrg       shift; break ;;
9972b676d7Smrg    - )	# Use stdin as input.
10072b676d7Smrg       break ;;
10172b676d7Smrg    -* )
10272b676d7Smrg       echo "$me: invalid option $1$help"
10372b676d7Smrg       exit 1 ;;
10472b676d7Smrg
10572b676d7Smrg    *local*)
10672b676d7Smrg       # First pass through any local machine types.
10772b676d7Smrg       echo $1
10872b676d7Smrg       exit ;;
10972b676d7Smrg
11072b676d7Smrg    * )
11172b676d7Smrg       break ;;
11272b676d7Smrg  esac
11372b676d7Smrgdone
11472b676d7Smrg
11572b676d7Smrgcase $# in
11672b676d7Smrg 0) echo "$me: missing argument$help" >&2
11772b676d7Smrg    exit 1;;
11872b676d7Smrg 1) ;;
11972b676d7Smrg *) echo "$me: too many arguments$help" >&2
12072b676d7Smrg    exit 1;;
12172b676d7Smrgesac
12272b676d7Smrg
12372b676d7Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
12472b676d7Smrg# Here we must recognize all the valid KERNEL-OS combinations.
12572b676d7Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12672b676d7Smrgcase $maybe_os in
12774c14cd6Smrg  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
12874c14cd6Smrg  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
12974c14cd6Smrg  knetbsd*-gnu* | netbsd*-gnu* | \
13074c14cd6Smrg  kopensolaris*-gnu* | \
13172b676d7Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
13272b676d7Smrg    os=-$maybe_os
13372b676d7Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
13472b676d7Smrg    ;;
13572b676d7Smrg  *)
13672b676d7Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13772b676d7Smrg    if [ $basic_machine != $1 ]
13872b676d7Smrg    then os=`echo $1 | sed 's/.*-/-/'`
13972b676d7Smrg    else os=; fi
14072b676d7Smrg    ;;
14172b676d7Smrgesac
14272b676d7Smrg
14372b676d7Smrg### Let's recognize common machines as not being operating systems so
14472b676d7Smrg### that things like config.sub decstation-3100 work.  We also
14572b676d7Smrg### recognize some manufacturers as not being operating systems, so we
14672b676d7Smrg### can provide default operating systems below.
14772b676d7Smrgcase $os in
14872b676d7Smrg	-sun*os*)
14972b676d7Smrg		# Prevent following clause from handling this invalid input.
15072b676d7Smrg		;;
15172b676d7Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
15272b676d7Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
15372b676d7Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
15472b676d7Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
15572b676d7Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15672b676d7Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15774c14cd6Smrg	-apple | -axis | -knuth | -cray | -microblaze)
15872b676d7Smrg		os=
15972b676d7Smrg		basic_machine=$1
16072b676d7Smrg		;;
16174c14cd6Smrg	-bluegene*)
16274c14cd6Smrg		os=-cnk
16374c14cd6Smrg		;;
16472b676d7Smrg	-sim | -cisco | -oki | -wec | -winbond)
16572b676d7Smrg		os=
16672b676d7Smrg		basic_machine=$1
16772b676d7Smrg		;;
16872b676d7Smrg	-scout)
16972b676d7Smrg		;;
17072b676d7Smrg	-wrs)
17172b676d7Smrg		os=-vxworks
17272b676d7Smrg		basic_machine=$1
17372b676d7Smrg		;;
17472b676d7Smrg	-chorusos*)
17572b676d7Smrg		os=-chorusos
17672b676d7Smrg		basic_machine=$1
17772b676d7Smrg		;;
17874c14cd6Smrg	-chorusrdb)
17974c14cd6Smrg		os=-chorusrdb
18072b676d7Smrg		basic_machine=$1
18174c14cd6Smrg		;;
18272b676d7Smrg	-hiux*)
18372b676d7Smrg		os=-hiuxwe2
18472b676d7Smrg		;;
18572b676d7Smrg	-sco6)
18672b676d7Smrg		os=-sco5v6
18772b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18872b676d7Smrg		;;
18972b676d7Smrg	-sco5)
19072b676d7Smrg		os=-sco3.2v5
19172b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19272b676d7Smrg		;;
19372b676d7Smrg	-sco4)
19472b676d7Smrg		os=-sco3.2v4
19572b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19672b676d7Smrg		;;
19772b676d7Smrg	-sco3.2.[4-9]*)
19872b676d7Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19972b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20072b676d7Smrg		;;
20172b676d7Smrg	-sco3.2v[4-9]*)
20272b676d7Smrg		# Don't forget version if it is 3.2v4 or newer.
20372b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20472b676d7Smrg		;;
20572b676d7Smrg	-sco5v6*)
20672b676d7Smrg		# Don't forget version if it is 3.2v4 or newer.
20772b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20872b676d7Smrg		;;
20972b676d7Smrg	-sco*)
21072b676d7Smrg		os=-sco3.2v2
21172b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21272b676d7Smrg		;;
21372b676d7Smrg	-udk*)
21472b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21572b676d7Smrg		;;
21672b676d7Smrg	-isc)
21772b676d7Smrg		os=-isc2.2
21872b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21972b676d7Smrg		;;
22072b676d7Smrg	-clix*)
22172b676d7Smrg		basic_machine=clipper-intergraph
22272b676d7Smrg		;;
22372b676d7Smrg	-isc*)
22472b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
22572b676d7Smrg		;;
22672b676d7Smrg	-lynx*)
22772b676d7Smrg		os=-lynxos
22872b676d7Smrg		;;
22972b676d7Smrg	-ptx*)
23072b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
23172b676d7Smrg		;;
23272b676d7Smrg	-windowsnt*)
23372b676d7Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
23472b676d7Smrg		;;
23572b676d7Smrg	-psos*)
23672b676d7Smrg		os=-psos
23772b676d7Smrg		;;
23872b676d7Smrg	-mint | -mint[0-9]*)
23972b676d7Smrg		basic_machine=m68k-atari
24072b676d7Smrg		os=-mint
24172b676d7Smrg		;;
24272b676d7Smrgesac
24372b676d7Smrg
24472b676d7Smrg# Decode aliases for certain CPU-COMPANY combinations.
24572b676d7Smrgcase $basic_machine in
24672b676d7Smrg	# Recognize the basic CPU types without company name.
24772b676d7Smrg	# Some are omitted here because they have special meanings below.
24872b676d7Smrg	1750a | 580 \
24972b676d7Smrg	| a29k \
25072b676d7Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
25172b676d7Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
25272b676d7Smrg	| am33_2.0 \
2531fd23544Smrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
25474c14cd6Smrg        | be32 | be64 \
25572b676d7Smrg	| bfin \
25672b676d7Smrg	| c4x | clipper \
25772b676d7Smrg	| d10v | d30v | dlx | dsp16xx \
25874c14cd6Smrg	| epiphany \
2591fd23544Smrg	| fido | fr30 | frv \
26072b676d7Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
26174c14cd6Smrg	| hexagon \
26272b676d7Smrg	| i370 | i860 | i960 | ia64 \
26372b676d7Smrg	| ip2k | iq2000 \
26474c14cd6Smrg	| le32 | le64 \
26574c14cd6Smrg	| lm32 \
2661fd23544Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
26774c14cd6Smrg	| maxq | mb | microblaze | mcore | mep | metag \
26872b676d7Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
26972b676d7Smrg	| mips16 \
27072b676d7Smrg	| mips64 | mips64el \
27174c14cd6Smrg	| mips64octeon | mips64octeonel \
27272b676d7Smrg	| mips64orion | mips64orionel \
27374c14cd6Smrg	| mips64r5900 | mips64r5900el \
27474c14cd6Smrg	| mips64vr | mips64vrel \
27572b676d7Smrg	| mips64vr4100 | mips64vr4100el \
27672b676d7Smrg	| mips64vr4300 | mips64vr4300el \
27772b676d7Smrg	| mips64vr5000 | mips64vr5000el \
27872b676d7Smrg	| mips64vr5900 | mips64vr5900el \
27972b676d7Smrg	| mipsisa32 | mipsisa32el \
28072b676d7Smrg	| mipsisa32r2 | mipsisa32r2el \
28172b676d7Smrg	| mipsisa64 | mipsisa64el \
28272b676d7Smrg	| mipsisa64r2 | mipsisa64r2el \
28372b676d7Smrg	| mipsisa64sb1 | mipsisa64sb1el \
28472b676d7Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
28572b676d7Smrg	| mipstx39 | mipstx39el \
28672b676d7Smrg	| mn10200 | mn10300 \
28774c14cd6Smrg	| moxie \
28872b676d7Smrg	| mt \
28972b676d7Smrg	| msp430 \
29074c14cd6Smrg	| nds32 | nds32le | nds32be \
29172b676d7Smrg	| nios | nios2 \
29272b676d7Smrg	| ns16k | ns32k \
29374c14cd6Smrg	| open8 \
29472b676d7Smrg	| or32 \
29572b676d7Smrg	| pdp10 | pdp11 | pj | pjl \
29674c14cd6Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle \
29772b676d7Smrg	| pyramid \
29874c14cd6Smrg	| rl78 | rx \
2991fd23544Smrg	| score \
30074c14cd6Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
30172b676d7Smrg	| sh64 | sh64le \
3021fd23544Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
3031fd23544Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
30474c14cd6Smrg	| spu \
30574c14cd6Smrg	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
30674c14cd6Smrg	| ubicom32 \
30774c14cd6Smrg	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
30872b676d7Smrg	| we32k \
30974c14cd6Smrg	| x86 | xc16x | xstormy16 | xtensa \
31074c14cd6Smrg	| z8k | z80)
31172b676d7Smrg		basic_machine=$basic_machine-unknown
31272b676d7Smrg		;;
31374c14cd6Smrg	c54x)
31474c14cd6Smrg		basic_machine=tic54x-unknown
31574c14cd6Smrg		;;
31674c14cd6Smrg	c55x)
31774c14cd6Smrg		basic_machine=tic55x-unknown
31874c14cd6Smrg		;;
31974c14cd6Smrg	c6x)
32074c14cd6Smrg		basic_machine=tic6x-unknown
32174c14cd6Smrg		;;
32274c14cd6Smrg	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
32372b676d7Smrg		basic_machine=$basic_machine-unknown
32472b676d7Smrg		os=-none
32572b676d7Smrg		;;
32672b676d7Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
32772b676d7Smrg		;;
32872b676d7Smrg	ms1)
32972b676d7Smrg		basic_machine=mt-unknown
33072b676d7Smrg		;;
33172b676d7Smrg
33274c14cd6Smrg	strongarm | thumb | xscale)
33374c14cd6Smrg		basic_machine=arm-unknown
33474c14cd6Smrg		;;
33574c14cd6Smrg
33674c14cd6Smrg	xscaleeb)
33774c14cd6Smrg		basic_machine=armeb-unknown
33874c14cd6Smrg		;;
33974c14cd6Smrg
34074c14cd6Smrg	xscaleel)
34174c14cd6Smrg		basic_machine=armel-unknown
34274c14cd6Smrg		;;
34374c14cd6Smrg
34472b676d7Smrg	# We use `pc' rather than `unknown'
34572b676d7Smrg	# because (1) that's what they normally are, and
34672b676d7Smrg	# (2) the word "unknown" tends to confuse beginning users.
34772b676d7Smrg	i*86 | x86_64)
34872b676d7Smrg	  basic_machine=$basic_machine-pc
34972b676d7Smrg	  ;;
35072b676d7Smrg	# Object if more than one company name word.
35172b676d7Smrg	*-*-*)
35272b676d7Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
35372b676d7Smrg		exit 1
35472b676d7Smrg		;;
35572b676d7Smrg	# Recognize the basic CPU types with company name.
35672b676d7Smrg	580-* \
35772b676d7Smrg	| a29k-* \
35872b676d7Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
35972b676d7Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
36072b676d7Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
36172b676d7Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3621fd23544Smrg	| avr-* | avr32-* \
36374c14cd6Smrg	| be32-* | be64-* \
36472b676d7Smrg	| bfin-* | bs2000-* \
36574c14cd6Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* \
36672b676d7Smrg	| clipper-* | craynv-* | cydra-* \
36772b676d7Smrg	| d10v-* | d30v-* | dlx-* \
36872b676d7Smrg	| elxsi-* \
3691fd23544Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
37072b676d7Smrg	| h8300-* | h8500-* \
37172b676d7Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
37274c14cd6Smrg	| hexagon-* \
37372b676d7Smrg	| i*86-* | i860-* | i960-* | ia64-* \
37472b676d7Smrg	| ip2k-* | iq2000-* \
37574c14cd6Smrg	| le32-* | le64-* \
37674c14cd6Smrg	| lm32-* \
3771fd23544Smrg	| m32c-* | m32r-* | m32rle-* \
37872b676d7Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
37974c14cd6Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
38072b676d7Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
38172b676d7Smrg	| mips16-* \
38272b676d7Smrg	| mips64-* | mips64el-* \
38374c14cd6Smrg	| mips64octeon-* | mips64octeonel-* \
38472b676d7Smrg	| mips64orion-* | mips64orionel-* \
38574c14cd6Smrg	| mips64r5900-* | mips64r5900el-* \
38674c14cd6Smrg	| mips64vr-* | mips64vrel-* \
38772b676d7Smrg	| mips64vr4100-* | mips64vr4100el-* \
38872b676d7Smrg	| mips64vr4300-* | mips64vr4300el-* \
38972b676d7Smrg	| mips64vr5000-* | mips64vr5000el-* \
39072b676d7Smrg	| mips64vr5900-* | mips64vr5900el-* \
39172b676d7Smrg	| mipsisa32-* | mipsisa32el-* \
39272b676d7Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
39372b676d7Smrg	| mipsisa64-* | mipsisa64el-* \
39472b676d7Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
39572b676d7Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
39672b676d7Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
39772b676d7Smrg	| mipstx39-* | mipstx39el-* \
39872b676d7Smrg	| mmix-* \
39972b676d7Smrg	| mt-* \
40072b676d7Smrg	| msp430-* \
40174c14cd6Smrg	| nds32-* | nds32le-* | nds32be-* \
40272b676d7Smrg	| nios-* | nios2-* \
40372b676d7Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
40474c14cd6Smrg	| open8-* \
40572b676d7Smrg	| orion-* \
40672b676d7Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
40774c14cd6Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
40872b676d7Smrg	| pyramid-* \
40974c14cd6Smrg	| rl78-* | romp-* | rs6000-* | rx-* \
41074c14cd6Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
41172b676d7Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
4121fd23544Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
41372b676d7Smrg	| sparclite-* \
41474c14cd6Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
41574c14cd6Smrg	| tahoe-* \
41672b676d7Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
41774c14cd6Smrg	| tile*-* \
41872b676d7Smrg	| tron-* \
41974c14cd6Smrg	| ubicom32-* \
42074c14cd6Smrg	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
42174c14cd6Smrg	| vax-* \
42272b676d7Smrg	| we32k-* \
42374c14cd6Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* \
4241fd23544Smrg	| xstormy16-* | xtensa*-* \
42572b676d7Smrg	| ymp-* \
42674c14cd6Smrg	| z8k-* | z80-*)
42772b676d7Smrg		;;
4281fd23544Smrg	# Recognize the basic CPU types without company name, with glob match.
4291fd23544Smrg	xtensa*)
4301fd23544Smrg		basic_machine=$basic_machine-unknown
43172b676d7Smrg		;;
43272b676d7Smrg	# Recognize the various machine names and aliases which stand
43372b676d7Smrg	# for a CPU type and a company and sometimes even an OS.
43472b676d7Smrg	386bsd)
43572b676d7Smrg		basic_machine=i386-unknown
43672b676d7Smrg		os=-bsd
43772b676d7Smrg		;;
43872b676d7Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
43972b676d7Smrg		basic_machine=m68000-att
44072b676d7Smrg		;;
44172b676d7Smrg	3b*)
44272b676d7Smrg		basic_machine=we32k-att
44372b676d7Smrg		;;
44472b676d7Smrg	a29khif)
44572b676d7Smrg		basic_machine=a29k-amd
44672b676d7Smrg		os=-udi
44772b676d7Smrg		;;
44874c14cd6Smrg	abacus)
44972b676d7Smrg		basic_machine=abacus-unknown
45072b676d7Smrg		;;
45172b676d7Smrg	adobe68k)
45272b676d7Smrg		basic_machine=m68010-adobe
45372b676d7Smrg		os=-scout
45472b676d7Smrg		;;
45572b676d7Smrg	alliant | fx80)
45672b676d7Smrg		basic_machine=fx80-alliant
45772b676d7Smrg		;;
45872b676d7Smrg	altos | altos3068)
45972b676d7Smrg		basic_machine=m68k-altos
46072b676d7Smrg		;;
46172b676d7Smrg	am29k)
46272b676d7Smrg		basic_machine=a29k-none
46372b676d7Smrg		os=-bsd
46472b676d7Smrg		;;
46572b676d7Smrg	amd64)
46672b676d7Smrg		basic_machine=x86_64-pc
46772b676d7Smrg		;;
46872b676d7Smrg	amd64-*)
46972b676d7Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
47072b676d7Smrg		;;
47172b676d7Smrg	amdahl)
47272b676d7Smrg		basic_machine=580-amdahl
47372b676d7Smrg		os=-sysv
47472b676d7Smrg		;;
47572b676d7Smrg	amiga | amiga-*)
47672b676d7Smrg		basic_machine=m68k-unknown
47772b676d7Smrg		;;
47872b676d7Smrg	amigaos | amigados)
47972b676d7Smrg		basic_machine=m68k-unknown
48072b676d7Smrg		os=-amigaos
48172b676d7Smrg		;;
48272b676d7Smrg	amigaunix | amix)
48372b676d7Smrg		basic_machine=m68k-unknown
48472b676d7Smrg		os=-sysv4
48572b676d7Smrg		;;
48672b676d7Smrg	apollo68)
48772b676d7Smrg		basic_machine=m68k-apollo
48872b676d7Smrg		os=-sysv
48972b676d7Smrg		;;
49072b676d7Smrg	apollo68bsd)
49172b676d7Smrg		basic_machine=m68k-apollo
49272b676d7Smrg		os=-bsd
49372b676d7Smrg		;;
49474c14cd6Smrg	aros)
49574c14cd6Smrg		basic_machine=i386-pc
49674c14cd6Smrg		os=-aros
49774c14cd6Smrg		;;
49872b676d7Smrg	aux)
49972b676d7Smrg		basic_machine=m68k-apple
50072b676d7Smrg		os=-aux
50172b676d7Smrg		;;
50272b676d7Smrg	balance)
50372b676d7Smrg		basic_machine=ns32k-sequent
50472b676d7Smrg		os=-dynix
50572b676d7Smrg		;;
5061fd23544Smrg	blackfin)
5071fd23544Smrg		basic_machine=bfin-unknown
5081fd23544Smrg		os=-linux
5091fd23544Smrg		;;
5101fd23544Smrg	blackfin-*)
5111fd23544Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
5121fd23544Smrg		os=-linux
5131fd23544Smrg		;;
51474c14cd6Smrg	bluegene*)
51574c14cd6Smrg		basic_machine=powerpc-ibm
51674c14cd6Smrg		os=-cnk
51774c14cd6Smrg		;;
51874c14cd6Smrg	c54x-*)
51974c14cd6Smrg		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
52074c14cd6Smrg		;;
52174c14cd6Smrg	c55x-*)
52274c14cd6Smrg		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
52374c14cd6Smrg		;;
52474c14cd6Smrg	c6x-*)
52574c14cd6Smrg		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
52674c14cd6Smrg		;;
52772b676d7Smrg	c90)
52872b676d7Smrg		basic_machine=c90-cray
52972b676d7Smrg		os=-unicos
53072b676d7Smrg		;;
53174c14cd6Smrg	cegcc)
53274c14cd6Smrg		basic_machine=arm-unknown
53374c14cd6Smrg		os=-cegcc
53474c14cd6Smrg		;;
53572b676d7Smrg	convex-c1)
53672b676d7Smrg		basic_machine=c1-convex
53772b676d7Smrg		os=-bsd
53872b676d7Smrg		;;
53972b676d7Smrg	convex-c2)
54072b676d7Smrg		basic_machine=c2-convex
54172b676d7Smrg		os=-bsd
54272b676d7Smrg		;;
54372b676d7Smrg	convex-c32)
54472b676d7Smrg		basic_machine=c32-convex
54572b676d7Smrg		os=-bsd
54672b676d7Smrg		;;
54772b676d7Smrg	convex-c34)
54872b676d7Smrg		basic_machine=c34-convex
54972b676d7Smrg		os=-bsd
55072b676d7Smrg		;;
55172b676d7Smrg	convex-c38)
55272b676d7Smrg		basic_machine=c38-convex
55372b676d7Smrg		os=-bsd
55472b676d7Smrg		;;
55572b676d7Smrg	cray | j90)
55672b676d7Smrg		basic_machine=j90-cray
55772b676d7Smrg		os=-unicos
55872b676d7Smrg		;;
55972b676d7Smrg	craynv)
56072b676d7Smrg		basic_machine=craynv-cray
56172b676d7Smrg		os=-unicosmp
56272b676d7Smrg		;;
56374c14cd6Smrg	cr16 | cr16-*)
5641fd23544Smrg		basic_machine=cr16-unknown
56572b676d7Smrg		os=-elf
56672b676d7Smrg		;;
56772b676d7Smrg	crds | unos)
56872b676d7Smrg		basic_machine=m68k-crds
56972b676d7Smrg		;;
57072b676d7Smrg	crisv32 | crisv32-* | etraxfs*)
57172b676d7Smrg		basic_machine=crisv32-axis
57272b676d7Smrg		;;
57372b676d7Smrg	cris | cris-* | etrax*)
57472b676d7Smrg		basic_machine=cris-axis
57572b676d7Smrg		;;
57672b676d7Smrg	crx)
57772b676d7Smrg		basic_machine=crx-unknown
57872b676d7Smrg		os=-elf
57972b676d7Smrg		;;
58072b676d7Smrg	da30 | da30-*)
58172b676d7Smrg		basic_machine=m68k-da30
58272b676d7Smrg		;;
58372b676d7Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
58472b676d7Smrg		basic_machine=mips-dec
58572b676d7Smrg		;;
58672b676d7Smrg	decsystem10* | dec10*)
58772b676d7Smrg		basic_machine=pdp10-dec
58872b676d7Smrg		os=-tops10
58972b676d7Smrg		;;
59072b676d7Smrg	decsystem20* | dec20*)
59172b676d7Smrg		basic_machine=pdp10-dec
59272b676d7Smrg		os=-tops20
59372b676d7Smrg		;;
59472b676d7Smrg	delta | 3300 | motorola-3300 | motorola-delta \
59572b676d7Smrg	      | 3300-motorola | delta-motorola)
59672b676d7Smrg		basic_machine=m68k-motorola
59772b676d7Smrg		;;
59872b676d7Smrg	delta88)
59972b676d7Smrg		basic_machine=m88k-motorola
60072b676d7Smrg		os=-sysv3
60172b676d7Smrg		;;
60274c14cd6Smrg	dicos)
60374c14cd6Smrg		basic_machine=i686-pc
60474c14cd6Smrg		os=-dicos
60574c14cd6Smrg		;;
60672b676d7Smrg	djgpp)
60772b676d7Smrg		basic_machine=i586-pc
60872b676d7Smrg		os=-msdosdjgpp
60972b676d7Smrg		;;
61072b676d7Smrg	dpx20 | dpx20-*)
61172b676d7Smrg		basic_machine=rs6000-bull
61272b676d7Smrg		os=-bosx
61372b676d7Smrg		;;
61472b676d7Smrg	dpx2* | dpx2*-bull)
61572b676d7Smrg		basic_machine=m68k-bull
61672b676d7Smrg		os=-sysv3
61772b676d7Smrg		;;
61872b676d7Smrg	ebmon29k)
61972b676d7Smrg		basic_machine=a29k-amd
62072b676d7Smrg		os=-ebmon
62172b676d7Smrg		;;
62272b676d7Smrg	elxsi)
62372b676d7Smrg		basic_machine=elxsi-elxsi
62472b676d7Smrg		os=-bsd
62572b676d7Smrg		;;
62672b676d7Smrg	encore | umax | mmax)
62772b676d7Smrg		basic_machine=ns32k-encore
62872b676d7Smrg		;;
62972b676d7Smrg	es1800 | OSE68k | ose68k | ose | OSE)
63072b676d7Smrg		basic_machine=m68k-ericsson
63172b676d7Smrg		os=-ose
63272b676d7Smrg		;;
63372b676d7Smrg	fx2800)
63472b676d7Smrg		basic_machine=i860-alliant
63572b676d7Smrg		;;
63672b676d7Smrg	genix)
63772b676d7Smrg		basic_machine=ns32k-ns
63872b676d7Smrg		;;
63972b676d7Smrg	gmicro)
64072b676d7Smrg		basic_machine=tron-gmicro
64172b676d7Smrg		os=-sysv
64272b676d7Smrg		;;
64372b676d7Smrg	go32)
64472b676d7Smrg		basic_machine=i386-pc
64572b676d7Smrg		os=-go32
64672b676d7Smrg		;;
64772b676d7Smrg	h3050r* | hiux*)
64872b676d7Smrg		basic_machine=hppa1.1-hitachi
64972b676d7Smrg		os=-hiuxwe2
65072b676d7Smrg		;;
65172b676d7Smrg	h8300hms)
65272b676d7Smrg		basic_machine=h8300-hitachi
65372b676d7Smrg		os=-hms
65472b676d7Smrg		;;
65572b676d7Smrg	h8300xray)
65672b676d7Smrg		basic_machine=h8300-hitachi
65772b676d7Smrg		os=-xray
65872b676d7Smrg		;;
65972b676d7Smrg	h8500hms)
66072b676d7Smrg		basic_machine=h8500-hitachi
66172b676d7Smrg		os=-hms
66272b676d7Smrg		;;
66372b676d7Smrg	harris)
66472b676d7Smrg		basic_machine=m88k-harris
66572b676d7Smrg		os=-sysv3
66672b676d7Smrg		;;
66772b676d7Smrg	hp300-*)
66872b676d7Smrg		basic_machine=m68k-hp
66972b676d7Smrg		;;
67072b676d7Smrg	hp300bsd)
67172b676d7Smrg		basic_machine=m68k-hp
67272b676d7Smrg		os=-bsd
67372b676d7Smrg		;;
67472b676d7Smrg	hp300hpux)
67572b676d7Smrg		basic_machine=m68k-hp
67672b676d7Smrg		os=-hpux
67772b676d7Smrg		;;
67872b676d7Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
67972b676d7Smrg		basic_machine=hppa1.0-hp
68072b676d7Smrg		;;
68172b676d7Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
68272b676d7Smrg		basic_machine=m68000-hp
68372b676d7Smrg		;;
68472b676d7Smrg	hp9k3[2-9][0-9])
68572b676d7Smrg		basic_machine=m68k-hp
68672b676d7Smrg		;;
68772b676d7Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
68872b676d7Smrg		basic_machine=hppa1.0-hp
68972b676d7Smrg		;;
69072b676d7Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
69172b676d7Smrg		basic_machine=hppa1.1-hp
69272b676d7Smrg		;;
69372b676d7Smrg	hp9k78[0-9] | hp78[0-9])
69472b676d7Smrg		# FIXME: really hppa2.0-hp
69572b676d7Smrg		basic_machine=hppa1.1-hp
69672b676d7Smrg		;;
69772b676d7Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
69872b676d7Smrg		# FIXME: really hppa2.0-hp
69972b676d7Smrg		basic_machine=hppa1.1-hp
70072b676d7Smrg		;;
70172b676d7Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
70272b676d7Smrg		basic_machine=hppa1.1-hp
70372b676d7Smrg		;;
70472b676d7Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
70572b676d7Smrg		basic_machine=hppa1.0-hp
70672b676d7Smrg		;;
70772b676d7Smrg	hppa-next)
70872b676d7Smrg		os=-nextstep3
70972b676d7Smrg		;;
71072b676d7Smrg	hppaosf)
71172b676d7Smrg		basic_machine=hppa1.1-hp
71272b676d7Smrg		os=-osf
71372b676d7Smrg		;;
71472b676d7Smrg	hppro)
71572b676d7Smrg		basic_machine=hppa1.1-hp
71672b676d7Smrg		os=-proelf
71772b676d7Smrg		;;
71872b676d7Smrg	i370-ibm* | ibm*)
71972b676d7Smrg		basic_machine=i370-ibm
72072b676d7Smrg		;;
72172b676d7Smrg	i*86v32)
72272b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
72372b676d7Smrg		os=-sysv32
72472b676d7Smrg		;;
72572b676d7Smrg	i*86v4*)
72672b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
72772b676d7Smrg		os=-sysv4
72872b676d7Smrg		;;
72972b676d7Smrg	i*86v)
73072b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
73172b676d7Smrg		os=-sysv
73272b676d7Smrg		;;
73372b676d7Smrg	i*86sol2)
73472b676d7Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
73572b676d7Smrg		os=-solaris2
73672b676d7Smrg		;;
73772b676d7Smrg	i386mach)
73872b676d7Smrg		basic_machine=i386-mach
73972b676d7Smrg		os=-mach
74072b676d7Smrg		;;
74172b676d7Smrg	i386-vsta | vsta)
74272b676d7Smrg		basic_machine=i386-unknown
74372b676d7Smrg		os=-vsta
74472b676d7Smrg		;;
74572b676d7Smrg	iris | iris4d)
74672b676d7Smrg		basic_machine=mips-sgi
74772b676d7Smrg		case $os in
74872b676d7Smrg		    -irix*)
74972b676d7Smrg			;;
75072b676d7Smrg		    *)
75172b676d7Smrg			os=-irix4
75272b676d7Smrg			;;
75372b676d7Smrg		esac
75472b676d7Smrg		;;
75572b676d7Smrg	isi68 | isi)
75672b676d7Smrg		basic_machine=m68k-isi
75772b676d7Smrg		os=-sysv
75872b676d7Smrg		;;
7591fd23544Smrg	m68knommu)
7601fd23544Smrg		basic_machine=m68k-unknown
7611fd23544Smrg		os=-linux
7621fd23544Smrg		;;
7631fd23544Smrg	m68knommu-*)
7641fd23544Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
7651fd23544Smrg		os=-linux
7661fd23544Smrg		;;
76772b676d7Smrg	m88k-omron*)
76872b676d7Smrg		basic_machine=m88k-omron
76972b676d7Smrg		;;
77072b676d7Smrg	magnum | m3230)
77172b676d7Smrg		basic_machine=mips-mips
77272b676d7Smrg		os=-sysv
77372b676d7Smrg		;;
77472b676d7Smrg	merlin)
77572b676d7Smrg		basic_machine=ns32k-utek
77672b676d7Smrg		os=-sysv
77772b676d7Smrg		;;
77874c14cd6Smrg	microblaze)
77974c14cd6Smrg		basic_machine=microblaze-xilinx
78074c14cd6Smrg		;;
78172b676d7Smrg	mingw32)
78272b676d7Smrg		basic_machine=i386-pc
78372b676d7Smrg		os=-mingw32
78472b676d7Smrg		;;
7851fd23544Smrg	mingw32ce)
7861fd23544Smrg		basic_machine=arm-unknown
7871fd23544Smrg		os=-mingw32ce
7881fd23544Smrg		;;
78972b676d7Smrg	miniframe)
79072b676d7Smrg		basic_machine=m68000-convergent
79172b676d7Smrg		;;
79272b676d7Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
79372b676d7Smrg		basic_machine=m68k-atari
79472b676d7Smrg		os=-mint
79572b676d7Smrg		;;
79672b676d7Smrg	mips3*-*)
79772b676d7Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
79872b676d7Smrg		;;
79972b676d7Smrg	mips3*)
80072b676d7Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
80172b676d7Smrg		;;
80272b676d7Smrg	monitor)
80372b676d7Smrg		basic_machine=m68k-rom68k
80472b676d7Smrg		os=-coff
80572b676d7Smrg		;;
80672b676d7Smrg	morphos)
80772b676d7Smrg		basic_machine=powerpc-unknown
80872b676d7Smrg		os=-morphos
80972b676d7Smrg		;;
81072b676d7Smrg	msdos)
81172b676d7Smrg		basic_machine=i386-pc
81272b676d7Smrg		os=-msdos
81372b676d7Smrg		;;
81472b676d7Smrg	ms1-*)
81572b676d7Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
81672b676d7Smrg		;;
81774c14cd6Smrg	msys)
81874c14cd6Smrg		basic_machine=i386-pc
81974c14cd6Smrg		os=-msys
82074c14cd6Smrg		;;
82172b676d7Smrg	mvs)
82272b676d7Smrg		basic_machine=i370-ibm
82372b676d7Smrg		os=-mvs
82472b676d7Smrg		;;
82574c14cd6Smrg	nacl)
82674c14cd6Smrg		basic_machine=le32-unknown
82774c14cd6Smrg		os=-nacl
82874c14cd6Smrg		;;
82972b676d7Smrg	ncr3000)
83072b676d7Smrg		basic_machine=i486-ncr
83172b676d7Smrg		os=-sysv4
83272b676d7Smrg		;;
83372b676d7Smrg	netbsd386)
83472b676d7Smrg		basic_machine=i386-unknown
83572b676d7Smrg		os=-netbsd
83672b676d7Smrg		;;
83772b676d7Smrg	netwinder)
83872b676d7Smrg		basic_machine=armv4l-rebel
83972b676d7Smrg		os=-linux
84072b676d7Smrg		;;
84172b676d7Smrg	news | news700 | news800 | news900)
84272b676d7Smrg		basic_machine=m68k-sony
84372b676d7Smrg		os=-newsos
84472b676d7Smrg		;;
84572b676d7Smrg	news1000)
84672b676d7Smrg		basic_machine=m68030-sony
84772b676d7Smrg		os=-newsos
84872b676d7Smrg		;;
84972b676d7Smrg	news-3600 | risc-news)
85072b676d7Smrg		basic_machine=mips-sony
85172b676d7Smrg		os=-newsos
85272b676d7Smrg		;;
85372b676d7Smrg	necv70)
85472b676d7Smrg		basic_machine=v70-nec
85572b676d7Smrg		os=-sysv
85672b676d7Smrg		;;
85772b676d7Smrg	next | m*-next )
85872b676d7Smrg		basic_machine=m68k-next
85972b676d7Smrg		case $os in
86072b676d7Smrg		    -nextstep* )
86172b676d7Smrg			;;
86272b676d7Smrg		    -ns2*)
86372b676d7Smrg		      os=-nextstep2
86472b676d7Smrg			;;
86572b676d7Smrg		    *)
86672b676d7Smrg		      os=-nextstep3
86772b676d7Smrg			;;
86872b676d7Smrg		esac
86972b676d7Smrg		;;
87072b676d7Smrg	nh3000)
87172b676d7Smrg		basic_machine=m68k-harris
87272b676d7Smrg		os=-cxux
87372b676d7Smrg		;;
87472b676d7Smrg	nh[45]000)
87572b676d7Smrg		basic_machine=m88k-harris
87672b676d7Smrg		os=-cxux
87772b676d7Smrg		;;
87872b676d7Smrg	nindy960)
87972b676d7Smrg		basic_machine=i960-intel
88072b676d7Smrg		os=-nindy
88172b676d7Smrg		;;
88272b676d7Smrg	mon960)
88372b676d7Smrg		basic_machine=i960-intel
88472b676d7Smrg		os=-mon960
88572b676d7Smrg		;;
88672b676d7Smrg	nonstopux)
88772b676d7Smrg		basic_machine=mips-compaq
88872b676d7Smrg		os=-nonstopux
88972b676d7Smrg		;;
89072b676d7Smrg	np1)
89172b676d7Smrg		basic_machine=np1-gould
89272b676d7Smrg		;;
89374c14cd6Smrg	neo-tandem)
89474c14cd6Smrg		basic_machine=neo-tandem
89574c14cd6Smrg		;;
89674c14cd6Smrg	nse-tandem)
89774c14cd6Smrg		basic_machine=nse-tandem
89874c14cd6Smrg		;;
89972b676d7Smrg	nsr-tandem)
90072b676d7Smrg		basic_machine=nsr-tandem
90172b676d7Smrg		;;
90272b676d7Smrg	op50n-* | op60c-*)
90372b676d7Smrg		basic_machine=hppa1.1-oki
90472b676d7Smrg		os=-proelf
90572b676d7Smrg		;;
90672b676d7Smrg	openrisc | openrisc-*)
90772b676d7Smrg		basic_machine=or32-unknown
90872b676d7Smrg		;;
90972b676d7Smrg	os400)
91072b676d7Smrg		basic_machine=powerpc-ibm
91172b676d7Smrg		os=-os400
91272b676d7Smrg		;;
91372b676d7Smrg	OSE68000 | ose68000)
91472b676d7Smrg		basic_machine=m68000-ericsson
91572b676d7Smrg		os=-ose
91672b676d7Smrg		;;
91772b676d7Smrg	os68k)
91872b676d7Smrg		basic_machine=m68k-none
91972b676d7Smrg		os=-os68k
92072b676d7Smrg		;;
92172b676d7Smrg	pa-hitachi)
92272b676d7Smrg		basic_machine=hppa1.1-hitachi
92372b676d7Smrg		os=-hiuxwe2
92472b676d7Smrg		;;
92572b676d7Smrg	paragon)
92672b676d7Smrg		basic_machine=i860-intel
92772b676d7Smrg		os=-osf
92872b676d7Smrg		;;
9291fd23544Smrg	parisc)
9301fd23544Smrg		basic_machine=hppa-unknown
9311fd23544Smrg		os=-linux
9321fd23544Smrg		;;
9331fd23544Smrg	parisc-*)
9341fd23544Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
9351fd23544Smrg		os=-linux
9361fd23544Smrg		;;
93772b676d7Smrg	pbd)
93872b676d7Smrg		basic_machine=sparc-tti
93972b676d7Smrg		;;
94072b676d7Smrg	pbb)
94172b676d7Smrg		basic_machine=m68k-tti
94272b676d7Smrg		;;
94372b676d7Smrg	pc532 | pc532-*)
94472b676d7Smrg		basic_machine=ns32k-pc532
94572b676d7Smrg		;;
94672b676d7Smrg	pc98)
94772b676d7Smrg		basic_machine=i386-pc
94872b676d7Smrg		;;
94972b676d7Smrg	pc98-*)
95072b676d7Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
95172b676d7Smrg		;;
95272b676d7Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
95372b676d7Smrg		basic_machine=i586-pc
95472b676d7Smrg		;;
95572b676d7Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
95672b676d7Smrg		basic_machine=i686-pc
95772b676d7Smrg		;;
95872b676d7Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
95972b676d7Smrg		basic_machine=i686-pc
96072b676d7Smrg		;;
96172b676d7Smrg	pentium4)
96272b676d7Smrg		basic_machine=i786-pc
96372b676d7Smrg		;;
96472b676d7Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
96572b676d7Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
96672b676d7Smrg		;;
96772b676d7Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
96872b676d7Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
96972b676d7Smrg		;;
97072b676d7Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
97172b676d7Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
97272b676d7Smrg		;;
97372b676d7Smrg	pentium4-*)
97472b676d7Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
97572b676d7Smrg		;;
97672b676d7Smrg	pn)
97772b676d7Smrg		basic_machine=pn-gould
97872b676d7Smrg		;;
97972b676d7Smrg	power)	basic_machine=power-ibm
98072b676d7Smrg		;;
98174c14cd6Smrg	ppc | ppcbe)	basic_machine=powerpc-unknown
98272b676d7Smrg		;;
98374c14cd6Smrg	ppc-* | ppcbe-*)
98474c14cd6Smrg		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
98572b676d7Smrg		;;
98672b676d7Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
98772b676d7Smrg		basic_machine=powerpcle-unknown
98872b676d7Smrg		;;
98972b676d7Smrg	ppcle-* | powerpclittle-*)
99072b676d7Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
99172b676d7Smrg		;;
99272b676d7Smrg	ppc64)	basic_machine=powerpc64-unknown
99372b676d7Smrg		;;
99472b676d7Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
99572b676d7Smrg		;;
99672b676d7Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
99772b676d7Smrg		basic_machine=powerpc64le-unknown
99872b676d7Smrg		;;
99972b676d7Smrg	ppc64le-* | powerpc64little-*)
100072b676d7Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
100172b676d7Smrg		;;
100272b676d7Smrg	ps2)
100372b676d7Smrg		basic_machine=i386-ibm
100472b676d7Smrg		;;
100572b676d7Smrg	pw32)
100672b676d7Smrg		basic_machine=i586-unknown
100772b676d7Smrg		os=-pw32
100872b676d7Smrg		;;
100972b676d7Smrg	rdos)
101072b676d7Smrg		basic_machine=i386-pc
101172b676d7Smrg		os=-rdos
101272b676d7Smrg		;;
101372b676d7Smrg	rom68k)
101472b676d7Smrg		basic_machine=m68k-rom68k
101572b676d7Smrg		os=-coff
101672b676d7Smrg		;;
101772b676d7Smrg	rm[46]00)
101872b676d7Smrg		basic_machine=mips-siemens
101972b676d7Smrg		;;
102072b676d7Smrg	rtpc | rtpc-*)
102172b676d7Smrg		basic_machine=romp-ibm
102272b676d7Smrg		;;
102372b676d7Smrg	s390 | s390-*)
102472b676d7Smrg		basic_machine=s390-ibm
102572b676d7Smrg		;;
102672b676d7Smrg	s390x | s390x-*)
102772b676d7Smrg		basic_machine=s390x-ibm
102872b676d7Smrg		;;
102972b676d7Smrg	sa29200)
103072b676d7Smrg		basic_machine=a29k-amd
103172b676d7Smrg		os=-udi
103272b676d7Smrg		;;
103372b676d7Smrg	sb1)
103472b676d7Smrg		basic_machine=mipsisa64sb1-unknown
103572b676d7Smrg		;;
103672b676d7Smrg	sb1el)
103772b676d7Smrg		basic_machine=mipsisa64sb1el-unknown
103872b676d7Smrg		;;
10391fd23544Smrg	sde)
10401fd23544Smrg		basic_machine=mipsisa32-sde
10411fd23544Smrg		os=-elf
10421fd23544Smrg		;;
104372b676d7Smrg	sei)
104472b676d7Smrg		basic_machine=mips-sei
104572b676d7Smrg		os=-seiux
104672b676d7Smrg		;;
104772b676d7Smrg	sequent)
104872b676d7Smrg		basic_machine=i386-sequent
104972b676d7Smrg		;;
105072b676d7Smrg	sh)
105172b676d7Smrg		basic_machine=sh-hitachi
105272b676d7Smrg		os=-hms
105372b676d7Smrg		;;
10541fd23544Smrg	sh5el)
10551fd23544Smrg		basic_machine=sh5le-unknown
10561fd23544Smrg		;;
105772b676d7Smrg	sh64)
105872b676d7Smrg		basic_machine=sh64-unknown
105972b676d7Smrg		;;
106072b676d7Smrg	sparclite-wrs | simso-wrs)
106172b676d7Smrg		basic_machine=sparclite-wrs
106272b676d7Smrg		os=-vxworks
106372b676d7Smrg		;;
106472b676d7Smrg	sps7)
106572b676d7Smrg		basic_machine=m68k-bull
106672b676d7Smrg		os=-sysv2
106772b676d7Smrg		;;
106872b676d7Smrg	spur)
106972b676d7Smrg		basic_machine=spur-unknown
107072b676d7Smrg		;;
107172b676d7Smrg	st2000)
107272b676d7Smrg		basic_machine=m68k-tandem
107372b676d7Smrg		;;
107472b676d7Smrg	stratus)
107572b676d7Smrg		basic_machine=i860-stratus
107672b676d7Smrg		os=-sysv4
107772b676d7Smrg		;;
107874c14cd6Smrg	strongarm-* | thumb-*)
107974c14cd6Smrg		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
108074c14cd6Smrg		;;
108172b676d7Smrg	sun2)
108272b676d7Smrg		basic_machine=m68000-sun
108372b676d7Smrg		;;
108472b676d7Smrg	sun2os3)
108572b676d7Smrg		basic_machine=m68000-sun
108672b676d7Smrg		os=-sunos3
108772b676d7Smrg		;;
108872b676d7Smrg	sun2os4)
108972b676d7Smrg		basic_machine=m68000-sun
109072b676d7Smrg		os=-sunos4
109172b676d7Smrg		;;
109272b676d7Smrg	sun3os3)
109372b676d7Smrg		basic_machine=m68k-sun
109472b676d7Smrg		os=-sunos3
109572b676d7Smrg		;;
109672b676d7Smrg	sun3os4)
109772b676d7Smrg		basic_machine=m68k-sun
109872b676d7Smrg		os=-sunos4
109972b676d7Smrg		;;
110072b676d7Smrg	sun4os3)
110172b676d7Smrg		basic_machine=sparc-sun
110272b676d7Smrg		os=-sunos3
110372b676d7Smrg		;;
110472b676d7Smrg	sun4os4)
110572b676d7Smrg		basic_machine=sparc-sun
110672b676d7Smrg		os=-sunos4
110772b676d7Smrg		;;
110872b676d7Smrg	sun4sol2)
110972b676d7Smrg		basic_machine=sparc-sun
111072b676d7Smrg		os=-solaris2
111172b676d7Smrg		;;
111272b676d7Smrg	sun3 | sun3-*)
111372b676d7Smrg		basic_machine=m68k-sun
111472b676d7Smrg		;;
111572b676d7Smrg	sun4)
111672b676d7Smrg		basic_machine=sparc-sun
111772b676d7Smrg		;;
111872b676d7Smrg	sun386 | sun386i | roadrunner)
111972b676d7Smrg		basic_machine=i386-sun
112072b676d7Smrg		;;
112172b676d7Smrg	sv1)
112272b676d7Smrg		basic_machine=sv1-cray
112372b676d7Smrg		os=-unicos
112472b676d7Smrg		;;
112572b676d7Smrg	symmetry)
112672b676d7Smrg		basic_machine=i386-sequent
112772b676d7Smrg		os=-dynix
112872b676d7Smrg		;;
112972b676d7Smrg	t3e)
113072b676d7Smrg		basic_machine=alphaev5-cray
113172b676d7Smrg		os=-unicos
113272b676d7Smrg		;;
113372b676d7Smrg	t90)
113472b676d7Smrg		basic_machine=t90-cray
113572b676d7Smrg		os=-unicos
113672b676d7Smrg		;;
11371fd23544Smrg	tile*)
113874c14cd6Smrg		basic_machine=$basic_machine-unknown
11391fd23544Smrg		os=-linux-gnu
11401fd23544Smrg		;;
114172b676d7Smrg	tx39)
114272b676d7Smrg		basic_machine=mipstx39-unknown
114372b676d7Smrg		;;
114472b676d7Smrg	tx39el)
114572b676d7Smrg		basic_machine=mipstx39el-unknown
114672b676d7Smrg		;;
114772b676d7Smrg	toad1)
114872b676d7Smrg		basic_machine=pdp10-xkl
114972b676d7Smrg		os=-tops20
115072b676d7Smrg		;;
115172b676d7Smrg	tower | tower-32)
115272b676d7Smrg		basic_machine=m68k-ncr
115372b676d7Smrg		;;
115472b676d7Smrg	tpf)
115572b676d7Smrg		basic_machine=s390x-ibm
115672b676d7Smrg		os=-tpf
115772b676d7Smrg		;;
115872b676d7Smrg	udi29k)
115972b676d7Smrg		basic_machine=a29k-amd
116072b676d7Smrg		os=-udi
116172b676d7Smrg		;;
116272b676d7Smrg	ultra3)
116372b676d7Smrg		basic_machine=a29k-nyu
116472b676d7Smrg		os=-sym1
116572b676d7Smrg		;;
116672b676d7Smrg	v810 | necv810)
116772b676d7Smrg		basic_machine=v810-nec
116872b676d7Smrg		os=-none
116972b676d7Smrg		;;
117072b676d7Smrg	vaxv)
117172b676d7Smrg		basic_machine=vax-dec
117272b676d7Smrg		os=-sysv
117372b676d7Smrg		;;
117472b676d7Smrg	vms)
117572b676d7Smrg		basic_machine=vax-dec
117672b676d7Smrg		os=-vms
117772b676d7Smrg		;;
117872b676d7Smrg	vpp*|vx|vx-*)
117972b676d7Smrg		basic_machine=f301-fujitsu
118072b676d7Smrg		;;
118172b676d7Smrg	vxworks960)
118272b676d7Smrg		basic_machine=i960-wrs
118372b676d7Smrg		os=-vxworks
118472b676d7Smrg		;;
118572b676d7Smrg	vxworks68)
118672b676d7Smrg		basic_machine=m68k-wrs
118772b676d7Smrg		os=-vxworks
118872b676d7Smrg		;;
118972b676d7Smrg	vxworks29k)
119072b676d7Smrg		basic_machine=a29k-wrs
119172b676d7Smrg		os=-vxworks
119272b676d7Smrg		;;
119372b676d7Smrg	w65*)
119472b676d7Smrg		basic_machine=w65-wdc
119572b676d7Smrg		os=-none
119672b676d7Smrg		;;
119772b676d7Smrg	w89k-*)
119872b676d7Smrg		basic_machine=hppa1.1-winbond
119972b676d7Smrg		os=-proelf
120072b676d7Smrg		;;
120172b676d7Smrg	xbox)
120272b676d7Smrg		basic_machine=i686-pc
120372b676d7Smrg		os=-mingw32
120472b676d7Smrg		;;
120572b676d7Smrg	xps | xps100)
120672b676d7Smrg		basic_machine=xps100-honeywell
120772b676d7Smrg		;;
120874c14cd6Smrg	xscale-* | xscalee[bl]-*)
120974c14cd6Smrg		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
121074c14cd6Smrg		;;
121172b676d7Smrg	ymp)
121272b676d7Smrg		basic_machine=ymp-cray
121372b676d7Smrg		os=-unicos
121472b676d7Smrg		;;
121572b676d7Smrg	z8k-*-coff)
121672b676d7Smrg		basic_machine=z8k-unknown
121772b676d7Smrg		os=-sim
121872b676d7Smrg		;;
121974c14cd6Smrg	z80-*-coff)
122074c14cd6Smrg		basic_machine=z80-unknown
122174c14cd6Smrg		os=-sim
122274c14cd6Smrg		;;
122372b676d7Smrg	none)
122472b676d7Smrg		basic_machine=none-none
122572b676d7Smrg		os=-none
122672b676d7Smrg		;;
122772b676d7Smrg
122872b676d7Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
122972b676d7Smrg# some cases the only manufacturer, in others, it is the most popular.
123072b676d7Smrg	w89k)
123172b676d7Smrg		basic_machine=hppa1.1-winbond
123272b676d7Smrg		;;
123372b676d7Smrg	op50n)
123472b676d7Smrg		basic_machine=hppa1.1-oki
123572b676d7Smrg		;;
123672b676d7Smrg	op60c)
123772b676d7Smrg		basic_machine=hppa1.1-oki
123872b676d7Smrg		;;
123972b676d7Smrg	romp)
124072b676d7Smrg		basic_machine=romp-ibm
124172b676d7Smrg		;;
124272b676d7Smrg	mmix)
124372b676d7Smrg		basic_machine=mmix-knuth
124472b676d7Smrg		;;
124572b676d7Smrg	rs6000)
124672b676d7Smrg		basic_machine=rs6000-ibm
124772b676d7Smrg		;;
124872b676d7Smrg	vax)
124972b676d7Smrg		basic_machine=vax-dec
125072b676d7Smrg		;;
125172b676d7Smrg	pdp10)
125272b676d7Smrg		# there are many clones, so DEC is not a safe bet
125372b676d7Smrg		basic_machine=pdp10-unknown
125472b676d7Smrg		;;
125572b676d7Smrg	pdp11)
125672b676d7Smrg		basic_machine=pdp11-dec
125772b676d7Smrg		;;
125872b676d7Smrg	we32k)
125972b676d7Smrg		basic_machine=we32k-att
126072b676d7Smrg		;;
126174c14cd6Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
126272b676d7Smrg		basic_machine=sh-unknown
126372b676d7Smrg		;;
12641fd23544Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
126572b676d7Smrg		basic_machine=sparc-sun
126672b676d7Smrg		;;
126772b676d7Smrg	cydra)
126872b676d7Smrg		basic_machine=cydra-cydrome
126972b676d7Smrg		;;
127072b676d7Smrg	orion)
127172b676d7Smrg		basic_machine=orion-highlevel
127272b676d7Smrg		;;
127372b676d7Smrg	orion105)
127472b676d7Smrg		basic_machine=clipper-highlevel
127572b676d7Smrg		;;
127672b676d7Smrg	mac | mpw | mac-mpw)
127772b676d7Smrg		basic_machine=m68k-apple
127872b676d7Smrg		;;
127972b676d7Smrg	pmac | pmac-mpw)
128072b676d7Smrg		basic_machine=powerpc-apple
128172b676d7Smrg		;;
128272b676d7Smrg	*-unknown)
128372b676d7Smrg		# Make sure to match an already-canonicalized machine name.
128472b676d7Smrg		;;
128572b676d7Smrg	*)
128672b676d7Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
128772b676d7Smrg		exit 1
128872b676d7Smrg		;;
128972b676d7Smrgesac
129072b676d7Smrg
129172b676d7Smrg# Here we canonicalize certain aliases for manufacturers.
129272b676d7Smrgcase $basic_machine in
129372b676d7Smrg	*-digital*)
129472b676d7Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
129572b676d7Smrg		;;
129672b676d7Smrg	*-commodore*)
129772b676d7Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
129872b676d7Smrg		;;
129972b676d7Smrg	*)
130072b676d7Smrg		;;
130172b676d7Smrgesac
130272b676d7Smrg
130372b676d7Smrg# Decode manufacturer-specific aliases for certain operating systems.
130472b676d7Smrg
130572b676d7Smrgif [ x"$os" != x"" ]
130672b676d7Smrgthen
130772b676d7Smrgcase $os in
130874c14cd6Smrg	# First match some system type aliases
130974c14cd6Smrg	# that might get confused with valid system types.
131072b676d7Smrg	# -solaris* is a basic system type, with this one exception.
131174c14cd6Smrg	-auroraux)
131274c14cd6Smrg		os=-auroraux
131374c14cd6Smrg		;;
131472b676d7Smrg	-solaris1 | -solaris1.*)
131572b676d7Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
131672b676d7Smrg		;;
131772b676d7Smrg	-solaris)
131872b676d7Smrg		os=-solaris2
131972b676d7Smrg		;;
132072b676d7Smrg	-svr4*)
132172b676d7Smrg		os=-sysv4
132272b676d7Smrg		;;
132372b676d7Smrg	-unixware*)
132472b676d7Smrg		os=-sysv4.2uw
132572b676d7Smrg		;;
132672b676d7Smrg	-gnu/linux*)
132772b676d7Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
132872b676d7Smrg		;;
132972b676d7Smrg	# First accept the basic system types.
133072b676d7Smrg	# The portable systems comes first.
133172b676d7Smrg	# Each alternative MUST END IN A *, to match a version number.
133272b676d7Smrg	# -sysv* is not here because it comes later, after sysvr4.
133372b676d7Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
133474c14cd6Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
133574c14cd6Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
133674c14cd6Smrg	      | -sym* | -kopensolaris* \
133772b676d7Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
133874c14cd6Smrg	      | -aos* | -aros* \
133972b676d7Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
134072b676d7Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
134172b676d7Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
134272b676d7Smrg	      | -openbsd* | -solidbsd* \
134372b676d7Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
134472b676d7Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
134572b676d7Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
134672b676d7Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
134774c14cd6Smrg	      | -chorusos* | -chorusrdb* | -cegcc* \
134874c14cd6Smrg	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
134974c14cd6Smrg	      | -mingw32* | -linux-gnu* | -linux-android* \
135074c14cd6Smrg	      | -linux-newlib* | -linux-uclibc* \
135172b676d7Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
135272b676d7Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
135372b676d7Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
135472b676d7Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
135572b676d7Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
135672b676d7Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
135772b676d7Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
135874c14cd6Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
135972b676d7Smrg	# Remember, each alternative MUST END IN *, to match a version number.
136072b676d7Smrg		;;
136172b676d7Smrg	-qnx*)
136272b676d7Smrg		case $basic_machine in
136372b676d7Smrg		    x86-* | i*86-*)
136472b676d7Smrg			;;
136572b676d7Smrg		    *)
136672b676d7Smrg			os=-nto$os
136772b676d7Smrg			;;
136872b676d7Smrg		esac
136972b676d7Smrg		;;
137072b676d7Smrg	-nto-qnx*)
137172b676d7Smrg		;;
137272b676d7Smrg	-nto*)
137372b676d7Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
137472b676d7Smrg		;;
137572b676d7Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
137672b676d7Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
137772b676d7Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
137872b676d7Smrg		;;
137972b676d7Smrg	-mac*)
138072b676d7Smrg		os=`echo $os | sed -e 's|mac|macos|'`
138172b676d7Smrg		;;
138272b676d7Smrg	-linux-dietlibc)
138372b676d7Smrg		os=-linux-dietlibc
138472b676d7Smrg		;;
138572b676d7Smrg	-linux*)
138672b676d7Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
138772b676d7Smrg		;;
138872b676d7Smrg	-sunos5*)
138972b676d7Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
139072b676d7Smrg		;;
139172b676d7Smrg	-sunos6*)
139272b676d7Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
139372b676d7Smrg		;;
139472b676d7Smrg	-opened*)
139572b676d7Smrg		os=-openedition
139672b676d7Smrg		;;
139774c14cd6Smrg	-os400*)
139872b676d7Smrg		os=-os400
139972b676d7Smrg		;;
140072b676d7Smrg	-wince*)
140172b676d7Smrg		os=-wince
140272b676d7Smrg		;;
140372b676d7Smrg	-osfrose*)
140472b676d7Smrg		os=-osfrose
140572b676d7Smrg		;;
140672b676d7Smrg	-osf*)
140772b676d7Smrg		os=-osf
140872b676d7Smrg		;;
140972b676d7Smrg	-utek*)
141072b676d7Smrg		os=-bsd
141172b676d7Smrg		;;
141272b676d7Smrg	-dynix*)
141372b676d7Smrg		os=-bsd
141472b676d7Smrg		;;
141572b676d7Smrg	-acis*)
141672b676d7Smrg		os=-aos
141772b676d7Smrg		;;
141872b676d7Smrg	-atheos*)
141972b676d7Smrg		os=-atheos
142072b676d7Smrg		;;
142172b676d7Smrg	-syllable*)
142272b676d7Smrg		os=-syllable
142372b676d7Smrg		;;
142472b676d7Smrg	-386bsd)
142572b676d7Smrg		os=-bsd
142672b676d7Smrg		;;
142772b676d7Smrg	-ctix* | -uts*)
142872b676d7Smrg		os=-sysv
142972b676d7Smrg		;;
143072b676d7Smrg	-nova*)
143172b676d7Smrg		os=-rtmk-nova
143272b676d7Smrg		;;
143372b676d7Smrg	-ns2 )
143472b676d7Smrg		os=-nextstep2
143572b676d7Smrg		;;
143672b676d7Smrg	-nsk*)
143772b676d7Smrg		os=-nsk
143872b676d7Smrg		;;
143972b676d7Smrg	# Preserve the version number of sinix5.
144072b676d7Smrg	-sinix5.*)
144172b676d7Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
144272b676d7Smrg		;;
144372b676d7Smrg	-sinix*)
144472b676d7Smrg		os=-sysv4
144572b676d7Smrg		;;
144674c14cd6Smrg	-tpf*)
144772b676d7Smrg		os=-tpf
144872b676d7Smrg		;;
144972b676d7Smrg	-triton*)
145072b676d7Smrg		os=-sysv3
145172b676d7Smrg		;;
145272b676d7Smrg	-oss*)
145372b676d7Smrg		os=-sysv3
145472b676d7Smrg		;;
145572b676d7Smrg	-svr4)
145672b676d7Smrg		os=-sysv4
145772b676d7Smrg		;;
145872b676d7Smrg	-svr3)
145972b676d7Smrg		os=-sysv3
146072b676d7Smrg		;;
146172b676d7Smrg	-sysvr4)
146272b676d7Smrg		os=-sysv4
146372b676d7Smrg		;;
146472b676d7Smrg	# This must come after -sysvr4.
146572b676d7Smrg	-sysv*)
146672b676d7Smrg		;;
146772b676d7Smrg	-ose*)
146872b676d7Smrg		os=-ose
146972b676d7Smrg		;;
147072b676d7Smrg	-es1800*)
147172b676d7Smrg		os=-ose
147272b676d7Smrg		;;
147372b676d7Smrg	-xenix)
147472b676d7Smrg		os=-xenix
147572b676d7Smrg		;;
147672b676d7Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
147772b676d7Smrg		os=-mint
147872b676d7Smrg		;;
147972b676d7Smrg	-aros*)
148072b676d7Smrg		os=-aros
148172b676d7Smrg		;;
148272b676d7Smrg	-kaos*)
148372b676d7Smrg		os=-kaos
148472b676d7Smrg		;;
148572b676d7Smrg	-zvmoe)
148672b676d7Smrg		os=-zvmoe
148772b676d7Smrg		;;
148874c14cd6Smrg	-dicos*)
148974c14cd6Smrg		os=-dicos
149074c14cd6Smrg		;;
149174c14cd6Smrg	-nacl*)
149274c14cd6Smrg		;;
149372b676d7Smrg	-none)
149472b676d7Smrg		;;
149572b676d7Smrg	*)
149672b676d7Smrg		# Get rid of the `-' at the beginning of $os.
149772b676d7Smrg		os=`echo $os | sed 's/[^-]*-//'`
149872b676d7Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
149972b676d7Smrg		exit 1
150072b676d7Smrg		;;
150172b676d7Smrgesac
150272b676d7Smrgelse
150372b676d7Smrg
150472b676d7Smrg# Here we handle the default operating systems that come with various machines.
150572b676d7Smrg# The value should be what the vendor currently ships out the door with their
150672b676d7Smrg# machine or put another way, the most popular os provided with the machine.
150772b676d7Smrg
150872b676d7Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
150972b676d7Smrg# "-sun"), then you have to tell the case statement up towards the top
151072b676d7Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
151172b676d7Smrg# will signal an error saying that MANUFACTURER isn't an operating
151272b676d7Smrg# system, and we'll never get to this point.
151372b676d7Smrg
151472b676d7Smrgcase $basic_machine in
151574c14cd6Smrg	score-*)
15161fd23544Smrg		os=-elf
15171fd23544Smrg		;;
151874c14cd6Smrg	spu-*)
15191fd23544Smrg		os=-elf
15201fd23544Smrg		;;
152172b676d7Smrg	*-acorn)
152272b676d7Smrg		os=-riscix1.2
152372b676d7Smrg		;;
152472b676d7Smrg	arm*-rebel)
152572b676d7Smrg		os=-linux
152672b676d7Smrg		;;
152772b676d7Smrg	arm*-semi)
152872b676d7Smrg		os=-aout
152972b676d7Smrg		;;
153074c14cd6Smrg	c4x-* | tic4x-*)
153174c14cd6Smrg		os=-coff
153274c14cd6Smrg		;;
153374c14cd6Smrg	tic54x-*)
153474c14cd6Smrg		os=-coff
153574c14cd6Smrg		;;
153674c14cd6Smrg	tic55x-*)
153774c14cd6Smrg		os=-coff
153874c14cd6Smrg		;;
153974c14cd6Smrg	tic6x-*)
154074c14cd6Smrg		os=-coff
15411fd23544Smrg		;;
154272b676d7Smrg	# This must come before the *-dec entry.
154372b676d7Smrg	pdp10-*)
154472b676d7Smrg		os=-tops20
154572b676d7Smrg		;;
154672b676d7Smrg	pdp11-*)
154772b676d7Smrg		os=-none
154872b676d7Smrg		;;
154972b676d7Smrg	*-dec | vax-*)
155072b676d7Smrg		os=-ultrix4.2
155172b676d7Smrg		;;
155272b676d7Smrg	m68*-apollo)
155372b676d7Smrg		os=-domain
155472b676d7Smrg		;;
155572b676d7Smrg	i386-sun)
155672b676d7Smrg		os=-sunos4.0.2
155772b676d7Smrg		;;
155872b676d7Smrg	m68000-sun)
155972b676d7Smrg		os=-sunos3
156072b676d7Smrg		;;
156172b676d7Smrg	m68*-cisco)
156272b676d7Smrg		os=-aout
156372b676d7Smrg		;;
156474c14cd6Smrg	mep-*)
15651fd23544Smrg		os=-elf
15661fd23544Smrg		;;
156772b676d7Smrg	mips*-cisco)
156872b676d7Smrg		os=-elf
156972b676d7Smrg		;;
157072b676d7Smrg	mips*-*)
157172b676d7Smrg		os=-elf
157272b676d7Smrg		;;
157372b676d7Smrg	or32-*)
157472b676d7Smrg		os=-coff
157572b676d7Smrg		;;
157672b676d7Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
157772b676d7Smrg		os=-sysv3
157872b676d7Smrg		;;
157972b676d7Smrg	sparc-* | *-sun)
158072b676d7Smrg		os=-sunos4.1.1
158172b676d7Smrg		;;
158272b676d7Smrg	*-be)
158372b676d7Smrg		os=-beos
158472b676d7Smrg		;;
158572b676d7Smrg	*-haiku)
158672b676d7Smrg		os=-haiku
158772b676d7Smrg		;;
158872b676d7Smrg	*-ibm)
158972b676d7Smrg		os=-aix
159072b676d7Smrg		;;
159174c14cd6Smrg	*-knuth)
159272b676d7Smrg		os=-mmixware
159372b676d7Smrg		;;
159472b676d7Smrg	*-wec)
159572b676d7Smrg		os=-proelf
159672b676d7Smrg		;;
159772b676d7Smrg	*-winbond)
159872b676d7Smrg		os=-proelf
159972b676d7Smrg		;;
160072b676d7Smrg	*-oki)
160172b676d7Smrg		os=-proelf
160272b676d7Smrg		;;
160372b676d7Smrg	*-hp)
160472b676d7Smrg		os=-hpux
160572b676d7Smrg		;;
160672b676d7Smrg	*-hitachi)
160772b676d7Smrg		os=-hiux
160872b676d7Smrg		;;
160972b676d7Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
161072b676d7Smrg		os=-sysv
161172b676d7Smrg		;;
161272b676d7Smrg	*-cbm)
161372b676d7Smrg		os=-amigaos
161472b676d7Smrg		;;
161572b676d7Smrg	*-dg)
161672b676d7Smrg		os=-dgux
161772b676d7Smrg		;;
161872b676d7Smrg	*-dolphin)
161972b676d7Smrg		os=-sysv3
162072b676d7Smrg		;;
162172b676d7Smrg	m68k-ccur)
162272b676d7Smrg		os=-rtu
162372b676d7Smrg		;;
162472b676d7Smrg	m88k-omron*)
162572b676d7Smrg		os=-luna
162672b676d7Smrg		;;
162772b676d7Smrg	*-next )
162872b676d7Smrg		os=-nextstep
162972b676d7Smrg		;;
163072b676d7Smrg	*-sequent)
163172b676d7Smrg		os=-ptx
163272b676d7Smrg		;;
163372b676d7Smrg	*-crds)
163472b676d7Smrg		os=-unos
163572b676d7Smrg		;;
163672b676d7Smrg	*-ns)
163772b676d7Smrg		os=-genix
163872b676d7Smrg		;;
163972b676d7Smrg	i370-*)
164072b676d7Smrg		os=-mvs
164172b676d7Smrg		;;
164272b676d7Smrg	*-next)
164372b676d7Smrg		os=-nextstep3
164472b676d7Smrg		;;
164572b676d7Smrg	*-gould)
164672b676d7Smrg		os=-sysv
164772b676d7Smrg		;;
164872b676d7Smrg	*-highlevel)
164972b676d7Smrg		os=-bsd
165072b676d7Smrg		;;
165172b676d7Smrg	*-encore)
165272b676d7Smrg		os=-bsd
165372b676d7Smrg		;;
165472b676d7Smrg	*-sgi)
165572b676d7Smrg		os=-irix
165672b676d7Smrg		;;
165772b676d7Smrg	*-siemens)
165872b676d7Smrg		os=-sysv4
165972b676d7Smrg		;;
166072b676d7Smrg	*-masscomp)
166172b676d7Smrg		os=-rtu
166272b676d7Smrg		;;
166372b676d7Smrg	f30[01]-fujitsu | f700-fujitsu)
166472b676d7Smrg		os=-uxpv
166572b676d7Smrg		;;
166672b676d7Smrg	*-rom68k)
166772b676d7Smrg		os=-coff
166872b676d7Smrg		;;
166972b676d7Smrg	*-*bug)
167072b676d7Smrg		os=-coff
167172b676d7Smrg		;;
167272b676d7Smrg	*-apple)
167372b676d7Smrg		os=-macos
167472b676d7Smrg		;;
167572b676d7Smrg	*-atari*)
167672b676d7Smrg		os=-mint
167772b676d7Smrg		;;
167872b676d7Smrg	*)
167972b676d7Smrg		os=-none
168072b676d7Smrg		;;
168172b676d7Smrgesac
168272b676d7Smrgfi
168372b676d7Smrg
168472b676d7Smrg# Here we handle the case where we know the os, and the CPU type, but not the
168572b676d7Smrg# manufacturer.  We pick the logical manufacturer.
168672b676d7Smrgvendor=unknown
168772b676d7Smrgcase $basic_machine in
168872b676d7Smrg	*-unknown)
168972b676d7Smrg		case $os in
169072b676d7Smrg			-riscix*)
169172b676d7Smrg				vendor=acorn
169272b676d7Smrg				;;
169372b676d7Smrg			-sunos*)
169472b676d7Smrg				vendor=sun
169572b676d7Smrg				;;
169674c14cd6Smrg			-cnk*|-aix*)
169772b676d7Smrg				vendor=ibm
169872b676d7Smrg				;;
169972b676d7Smrg			-beos*)
170072b676d7Smrg				vendor=be
170172b676d7Smrg				;;
170272b676d7Smrg			-hpux*)
170372b676d7Smrg				vendor=hp
170472b676d7Smrg				;;
170572b676d7Smrg			-mpeix*)
170672b676d7Smrg				vendor=hp
170772b676d7Smrg				;;
170872b676d7Smrg			-hiux*)
170972b676d7Smrg				vendor=hitachi
171072b676d7Smrg				;;
171172b676d7Smrg			-unos*)
171272b676d7Smrg				vendor=crds
171372b676d7Smrg				;;
171472b676d7Smrg			-dgux*)
171572b676d7Smrg				vendor=dg
171672b676d7Smrg				;;
171772b676d7Smrg			-luna*)
171872b676d7Smrg				vendor=omron
171972b676d7Smrg				;;
172072b676d7Smrg			-genix*)
172172b676d7Smrg				vendor=ns
172272b676d7Smrg				;;
172372b676d7Smrg			-mvs* | -opened*)
172472b676d7Smrg				vendor=ibm
172572b676d7Smrg				;;
172672b676d7Smrg			-os400*)
172772b676d7Smrg				vendor=ibm
172872b676d7Smrg				;;
172972b676d7Smrg			-ptx*)
173072b676d7Smrg				vendor=sequent
173172b676d7Smrg				;;
173272b676d7Smrg			-tpf*)
173372b676d7Smrg				vendor=ibm
173472b676d7Smrg				;;
173572b676d7Smrg			-vxsim* | -vxworks* | -windiss*)
173672b676d7Smrg				vendor=wrs
173772b676d7Smrg				;;
173872b676d7Smrg			-aux*)
173972b676d7Smrg				vendor=apple
174072b676d7Smrg				;;
174172b676d7Smrg			-hms*)
174272b676d7Smrg				vendor=hitachi
174372b676d7Smrg				;;
174472b676d7Smrg			-mpw* | -macos*)
174572b676d7Smrg				vendor=apple
174672b676d7Smrg				;;
174772b676d7Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
174872b676d7Smrg				vendor=atari
174972b676d7Smrg				;;
175072b676d7Smrg			-vos*)
175172b676d7Smrg				vendor=stratus
175272b676d7Smrg				;;
175372b676d7Smrg		esac
175472b676d7Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
175572b676d7Smrg		;;
175672b676d7Smrgesac
175772b676d7Smrg
175872b676d7Smrgecho $basic_machine$os
175972b676d7Smrgexit
176072b676d7Smrg
176172b676d7Smrg# Local variables:
176272b676d7Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
176372b676d7Smrg# time-stamp-start: "timestamp='"
176472b676d7Smrg# time-stamp-format: "%:y-%02m-%02d"
176572b676d7Smrg# time-stamp-end: "'"
176672b676d7Smrg# End:
1767