140dd5a57Smrg#! /bin/sh
240dd5a57Smrg# Configuration validation subroutine script.
340dd5a57Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
440dd5a57Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
540dd5a57Smrg#   Free Software Foundation, Inc.
640dd5a57Smrg
740dd5a57Smrgtimestamp='2009-11-20'
840dd5a57Smrg
940dd5a57Smrg# This file is (in principle) common to ALL GNU software.
1040dd5a57Smrg# The presence of a machine in this file suggests that SOME GNU software
1140dd5a57Smrg# can handle that machine.  It does not imply ALL GNU software can.
1240dd5a57Smrg#
1340dd5a57Smrg# This file is free software; you can redistribute it and/or modify
1440dd5a57Smrg# it under the terms of the GNU General Public License as published by
1540dd5a57Smrg# the Free Software Foundation; either version 2 of the License, or
1640dd5a57Smrg# (at your option) any later version.
1740dd5a57Smrg#
1840dd5a57Smrg# This program is distributed in the hope that it will be useful,
1940dd5a57Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
2040dd5a57Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2140dd5a57Smrg# GNU General Public License for more details.
2240dd5a57Smrg#
2340dd5a57Smrg# You should have received a copy of the GNU General Public License
2440dd5a57Smrg# along with this program; if not, write to the Free Software
2540dd5a57Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2640dd5a57Smrg# 02110-1301, USA.
2740dd5a57Smrg#
2840dd5a57Smrg# As a special exception to the GNU General Public License, if you
2940dd5a57Smrg# distribute this file as part of a program that contains a
3040dd5a57Smrg# configuration script generated by Autoconf, you may include it under
3140dd5a57Smrg# the same distribution terms that you use for the rest of that program.
3240dd5a57Smrg
3340dd5a57Smrg
3440dd5a57Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3540dd5a57Smrg# diff and a properly formatted GNU ChangeLog entry.
3640dd5a57Smrg#
3740dd5a57Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3840dd5a57Smrg# Supply the specified configuration type as an argument.
3940dd5a57Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
4040dd5a57Smrg# Otherwise, we print the canonical config type on stdout and succeed.
4140dd5a57Smrg
4240dd5a57Smrg# You can get the latest version of this script from:
4340dd5a57Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
4440dd5a57Smrg
4540dd5a57Smrg# This file is supposed to be the same for all GNU packages
4640dd5a57Smrg# and recognize all the CPU types, system types and aliases
4740dd5a57Smrg# that are meaningful with *any* GNU software.
4840dd5a57Smrg# Each package is responsible for reporting which valid configurations
4940dd5a57Smrg# it does not support.  The user should be able to distinguish
5040dd5a57Smrg# a failure to support a valid configuration from a meaningless
5140dd5a57Smrg# configuration.
5240dd5a57Smrg
5340dd5a57Smrg# The goal of this file is to map all the various variations of a given
5440dd5a57Smrg# machine specification into a single specification in the form:
5540dd5a57Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5640dd5a57Smrg# or in some cases, the newer four-part form:
5740dd5a57Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5840dd5a57Smrg# It is wrong to echo any other type of specification.
5940dd5a57Smrg
6040dd5a57Smrgme=`echo "$0" | sed -e 's,.*/,,'`
6140dd5a57Smrg
6240dd5a57Smrgusage="\
6340dd5a57SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
6440dd5a57Smrg       $0 [OPTION] ALIAS
6540dd5a57Smrg
6640dd5a57SmrgCanonicalize a configuration name.
6740dd5a57Smrg
6840dd5a57SmrgOperation modes:
6940dd5a57Smrg  -h, --help         print this help, then exit
7040dd5a57Smrg  -t, --time-stamp   print date of last modification, then exit
7140dd5a57Smrg  -v, --version      print version number, then exit
7240dd5a57Smrg
7340dd5a57SmrgReport bugs and patches to <config-patches@gnu.org>."
7440dd5a57Smrg
7540dd5a57Smrgversion="\
7640dd5a57SmrgGNU config.sub ($timestamp)
7740dd5a57Smrg
7840dd5a57SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
7940dd5a57Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
8040dd5a57Smrg
8140dd5a57SmrgThis is free software; see the source for copying conditions.  There is NO
8240dd5a57Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8340dd5a57Smrg
8440dd5a57Smrghelp="
8540dd5a57SmrgTry \`$me --help' for more information."
8640dd5a57Smrg
8740dd5a57Smrg# Parse command line
8840dd5a57Smrgwhile test $# -gt 0 ; do
8940dd5a57Smrg  case $1 in
9040dd5a57Smrg    --time-stamp | --time* | -t )
9140dd5a57Smrg       echo "$timestamp" ; exit ;;
9240dd5a57Smrg    --version | -v )
9340dd5a57Smrg       echo "$version" ; exit ;;
9440dd5a57Smrg    --help | --h* | -h )
9540dd5a57Smrg       echo "$usage"; exit ;;
9640dd5a57Smrg    -- )     # Stop option processing
9740dd5a57Smrg       shift; break ;;
9840dd5a57Smrg    - )	# Use stdin as input.
9940dd5a57Smrg       break ;;
10040dd5a57Smrg    -* )
10140dd5a57Smrg       echo "$me: invalid option $1$help"
10240dd5a57Smrg       exit 1 ;;
10340dd5a57Smrg
10440dd5a57Smrg    *local*)
10540dd5a57Smrg       # First pass through any local machine types.
10640dd5a57Smrg       echo $1
10740dd5a57Smrg       exit ;;
10840dd5a57Smrg
10940dd5a57Smrg    * )
11040dd5a57Smrg       break ;;
11140dd5a57Smrg  esac
11240dd5a57Smrgdone
11340dd5a57Smrg
11440dd5a57Smrgcase $# in
11540dd5a57Smrg 0) echo "$me: missing argument$help" >&2
11640dd5a57Smrg    exit 1;;
11740dd5a57Smrg 1) ;;
11840dd5a57Smrg *) echo "$me: too many arguments$help" >&2
11940dd5a57Smrg    exit 1;;
12040dd5a57Smrgesac
12140dd5a57Smrg
12240dd5a57Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
12340dd5a57Smrg# Here we must recognize all the valid KERNEL-OS combinations.
12440dd5a57Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12540dd5a57Smrgcase $maybe_os in
12640dd5a57Smrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
12740dd5a57Smrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
12840dd5a57Smrg  kopensolaris*-gnu* | \
12940dd5a57Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
13040dd5a57Smrg    os=-$maybe_os
13140dd5a57Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
13240dd5a57Smrg    ;;
13340dd5a57Smrg  *)
13440dd5a57Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13540dd5a57Smrg    if [ $basic_machine != $1 ]
13640dd5a57Smrg    then os=`echo $1 | sed 's/.*-/-/'`
13740dd5a57Smrg    else os=; fi
13840dd5a57Smrg    ;;
13940dd5a57Smrgesac
14040dd5a57Smrg
14140dd5a57Smrg### Let's recognize common machines as not being operating systems so
14240dd5a57Smrg### that things like config.sub decstation-3100 work.  We also
14340dd5a57Smrg### recognize some manufacturers as not being operating systems, so we
14440dd5a57Smrg### can provide default operating systems below.
14540dd5a57Smrgcase $os in
14640dd5a57Smrg	-sun*os*)
14740dd5a57Smrg		# Prevent following clause from handling this invalid input.
14840dd5a57Smrg		;;
14940dd5a57Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
15040dd5a57Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
15140dd5a57Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
15240dd5a57Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
15340dd5a57Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15440dd5a57Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15540dd5a57Smrg	-apple | -axis | -knuth | -cray | -microblaze)
15640dd5a57Smrg		os=
15740dd5a57Smrg		basic_machine=$1
15840dd5a57Smrg		;;
15940dd5a57Smrg        -bluegene*)
16040dd5a57Smrg	        os=-cnk
16140dd5a57Smrg		;;
16240dd5a57Smrg	-sim | -cisco | -oki | -wec | -winbond)
16340dd5a57Smrg		os=
16440dd5a57Smrg		basic_machine=$1
16540dd5a57Smrg		;;
16640dd5a57Smrg	-scout)
16740dd5a57Smrg		;;
16840dd5a57Smrg	-wrs)
16940dd5a57Smrg		os=-vxworks
17040dd5a57Smrg		basic_machine=$1
17140dd5a57Smrg		;;
17240dd5a57Smrg	-chorusos*)
17340dd5a57Smrg		os=-chorusos
17440dd5a57Smrg		basic_machine=$1
17540dd5a57Smrg		;;
17640dd5a57Smrg 	-chorusrdb)
17740dd5a57Smrg 		os=-chorusrdb
17840dd5a57Smrg		basic_machine=$1
17940dd5a57Smrg 		;;
18040dd5a57Smrg	-hiux*)
18140dd5a57Smrg		os=-hiuxwe2
18240dd5a57Smrg		;;
18340dd5a57Smrg	-sco6)
18440dd5a57Smrg		os=-sco5v6
18540dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18640dd5a57Smrg		;;
18740dd5a57Smrg	-sco5)
18840dd5a57Smrg		os=-sco3.2v5
18940dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19040dd5a57Smrg		;;
19140dd5a57Smrg	-sco4)
19240dd5a57Smrg		os=-sco3.2v4
19340dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19440dd5a57Smrg		;;
19540dd5a57Smrg	-sco3.2.[4-9]*)
19640dd5a57Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19740dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19840dd5a57Smrg		;;
19940dd5a57Smrg	-sco3.2v[4-9]*)
20040dd5a57Smrg		# Don't forget version if it is 3.2v4 or newer.
20140dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20240dd5a57Smrg		;;
20340dd5a57Smrg	-sco5v6*)
20440dd5a57Smrg		# Don't forget version if it is 3.2v4 or newer.
20540dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20640dd5a57Smrg		;;
20740dd5a57Smrg	-sco*)
20840dd5a57Smrg		os=-sco3.2v2
20940dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21040dd5a57Smrg		;;
21140dd5a57Smrg	-udk*)
21240dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21340dd5a57Smrg		;;
21440dd5a57Smrg	-isc)
21540dd5a57Smrg		os=-isc2.2
21640dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21740dd5a57Smrg		;;
21840dd5a57Smrg	-clix*)
21940dd5a57Smrg		basic_machine=clipper-intergraph
22040dd5a57Smrg		;;
22140dd5a57Smrg	-isc*)
22240dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
22340dd5a57Smrg		;;
22440dd5a57Smrg	-lynx*)
22540dd5a57Smrg		os=-lynxos
22640dd5a57Smrg		;;
22740dd5a57Smrg	-ptx*)
22840dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
22940dd5a57Smrg		;;
23040dd5a57Smrg	-windowsnt*)
23140dd5a57Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
23240dd5a57Smrg		;;
23340dd5a57Smrg	-psos*)
23440dd5a57Smrg		os=-psos
23540dd5a57Smrg		;;
23640dd5a57Smrg	-mint | -mint[0-9]*)
23740dd5a57Smrg		basic_machine=m68k-atari
23840dd5a57Smrg		os=-mint
23940dd5a57Smrg		;;
24040dd5a57Smrgesac
24140dd5a57Smrg
24240dd5a57Smrg# Decode aliases for certain CPU-COMPANY combinations.
24340dd5a57Smrgcase $basic_machine in
24440dd5a57Smrg	# Recognize the basic CPU types without company name.
24540dd5a57Smrg	# Some are omitted here because they have special meanings below.
24640dd5a57Smrg	1750a | 580 \
24740dd5a57Smrg	| a29k \
24840dd5a57Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
24940dd5a57Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
25040dd5a57Smrg	| am33_2.0 \
25140dd5a57Smrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
25240dd5a57Smrg	| bfin \
25340dd5a57Smrg	| c4x | clipper \
25440dd5a57Smrg	| d10v | d30v | dlx | dsp16xx \
25540dd5a57Smrg	| fido | fr30 | frv \
25640dd5a57Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
25740dd5a57Smrg	| i370 | i860 | i960 | ia64 \
25840dd5a57Smrg	| ip2k | iq2000 \
25940dd5a57Smrg	| lm32 \
26040dd5a57Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
26140dd5a57Smrg	| maxq | mb | microblaze | mcore | mep | metag \
26240dd5a57Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
26340dd5a57Smrg	| mips16 \
26440dd5a57Smrg	| mips64 | mips64el \
26540dd5a57Smrg	| mips64octeon | mips64octeonel \
26640dd5a57Smrg	| mips64orion | mips64orionel \
26740dd5a57Smrg	| mips64r5900 | mips64r5900el \
26840dd5a57Smrg	| mips64vr | mips64vrel \
26940dd5a57Smrg	| mips64vr4100 | mips64vr4100el \
27040dd5a57Smrg	| mips64vr4300 | mips64vr4300el \
27140dd5a57Smrg	| mips64vr5000 | mips64vr5000el \
27240dd5a57Smrg	| mips64vr5900 | mips64vr5900el \
27340dd5a57Smrg	| mipsisa32 | mipsisa32el \
27440dd5a57Smrg	| mipsisa32r2 | mipsisa32r2el \
27540dd5a57Smrg	| mipsisa64 | mipsisa64el \
27640dd5a57Smrg	| mipsisa64r2 | mipsisa64r2el \
27740dd5a57Smrg	| mipsisa64sb1 | mipsisa64sb1el \
27840dd5a57Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
27940dd5a57Smrg	| mipstx39 | mipstx39el \
28040dd5a57Smrg	| mn10200 | mn10300 \
28140dd5a57Smrg	| moxie \
28240dd5a57Smrg	| mt \
28340dd5a57Smrg	| msp430 \
28440dd5a57Smrg	| nios | nios2 \
28540dd5a57Smrg	| ns16k | ns32k \
28640dd5a57Smrg	| or32 \
28740dd5a57Smrg	| pdp10 | pdp11 | pj | pjl \
28840dd5a57Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
28940dd5a57Smrg	| pyramid \
29040dd5a57Smrg	| rx \
29140dd5a57Smrg	| score \
29240dd5a57Smrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
29340dd5a57Smrg	| sh64 | sh64le \
29440dd5a57Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
29540dd5a57Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
29640dd5a57Smrg	| spu | strongarm \
29740dd5a57Smrg	| tahoe | thumb | tic4x | tic80 | tron \
29840dd5a57Smrg	| ubicom32 \
29940dd5a57Smrg	| v850 | v850e \
30040dd5a57Smrg	| we32k \
30140dd5a57Smrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
30240dd5a57Smrg	| z8k | z80)
30340dd5a57Smrg		basic_machine=$basic_machine-unknown
30440dd5a57Smrg		;;
30540dd5a57Smrg	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
30640dd5a57Smrg		# Motorola 68HC11/12.
30740dd5a57Smrg		basic_machine=$basic_machine-unknown
30840dd5a57Smrg		os=-none
30940dd5a57Smrg		;;
31040dd5a57Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
31140dd5a57Smrg		;;
31240dd5a57Smrg	ms1)
31340dd5a57Smrg		basic_machine=mt-unknown
31440dd5a57Smrg		;;
31540dd5a57Smrg
31640dd5a57Smrg	# We use `pc' rather than `unknown'
31740dd5a57Smrg	# because (1) that's what they normally are, and
31840dd5a57Smrg	# (2) the word "unknown" tends to confuse beginning users.
31940dd5a57Smrg	i*86 | x86_64)
32040dd5a57Smrg	  basic_machine=$basic_machine-pc
32140dd5a57Smrg	  ;;
32240dd5a57Smrg	# Object if more than one company name word.
32340dd5a57Smrg	*-*-*)
32440dd5a57Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
32540dd5a57Smrg		exit 1
32640dd5a57Smrg		;;
32740dd5a57Smrg	# Recognize the basic CPU types with company name.
32840dd5a57Smrg	580-* \
32940dd5a57Smrg	| a29k-* \
33040dd5a57Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
33140dd5a57Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
33240dd5a57Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
33340dd5a57Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
33440dd5a57Smrg	| avr-* | avr32-* \
33540dd5a57Smrg	| bfin-* | bs2000-* \
33640dd5a57Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
33740dd5a57Smrg	| clipper-* | craynv-* | cydra-* \
33840dd5a57Smrg	| d10v-* | d30v-* | dlx-* \
33940dd5a57Smrg	| elxsi-* \
34040dd5a57Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
34140dd5a57Smrg	| h8300-* | h8500-* \
34240dd5a57Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
34340dd5a57Smrg	| i*86-* | i860-* | i960-* | ia64-* \
34440dd5a57Smrg	| ip2k-* | iq2000-* \
34540dd5a57Smrg	| lm32-* \
34640dd5a57Smrg	| m32c-* | m32r-* | m32rle-* \
34740dd5a57Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
34840dd5a57Smrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
34940dd5a57Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
35040dd5a57Smrg	| mips16-* \
35140dd5a57Smrg	| mips64-* | mips64el-* \
35240dd5a57Smrg	| mips64octeon-* | mips64octeonel-* \
35340dd5a57Smrg	| mips64orion-* | mips64orionel-* \
35440dd5a57Smrg	| mips64r5900-* | mips64r5900el-* \
35540dd5a57Smrg	| mips64vr-* | mips64vrel-* \
35640dd5a57Smrg	| mips64vr4100-* | mips64vr4100el-* \
35740dd5a57Smrg	| mips64vr4300-* | mips64vr4300el-* \
35840dd5a57Smrg	| mips64vr5000-* | mips64vr5000el-* \
35940dd5a57Smrg	| mips64vr5900-* | mips64vr5900el-* \
36040dd5a57Smrg	| mipsisa32-* | mipsisa32el-* \
36140dd5a57Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
36240dd5a57Smrg	| mipsisa64-* | mipsisa64el-* \
36340dd5a57Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
36440dd5a57Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
36540dd5a57Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
36640dd5a57Smrg	| mipstx39-* | mipstx39el-* \
36740dd5a57Smrg	| mmix-* \
36840dd5a57Smrg	| mt-* \
36940dd5a57Smrg	| msp430-* \
37040dd5a57Smrg	| nios-* | nios2-* \
37140dd5a57Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
37240dd5a57Smrg	| orion-* \
37340dd5a57Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
37440dd5a57Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
37540dd5a57Smrg	| pyramid-* \
37640dd5a57Smrg	| romp-* | rs6000-* | rx-* \
37740dd5a57Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
37840dd5a57Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
37940dd5a57Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
38040dd5a57Smrg	| sparclite-* \
38140dd5a57Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
38240dd5a57Smrg	| tahoe-* | thumb-* \
38340dd5a57Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
38440dd5a57Smrg	| tron-* \
38540dd5a57Smrg	| ubicom32-* \
38640dd5a57Smrg	| v850-* | v850e-* | vax-* \
38740dd5a57Smrg	| we32k-* \
38840dd5a57Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
38940dd5a57Smrg	| xstormy16-* | xtensa*-* \
39040dd5a57Smrg	| ymp-* \
39140dd5a57Smrg	| z8k-* | z80-*)
39240dd5a57Smrg		;;
39340dd5a57Smrg	# Recognize the basic CPU types without company name, with glob match.
39440dd5a57Smrg	xtensa*)
39540dd5a57Smrg		basic_machine=$basic_machine-unknown
39640dd5a57Smrg		;;
39740dd5a57Smrg	# Recognize the various machine names and aliases which stand
39840dd5a57Smrg	# for a CPU type and a company and sometimes even an OS.
39940dd5a57Smrg	386bsd)
40040dd5a57Smrg		basic_machine=i386-unknown
40140dd5a57Smrg		os=-bsd
40240dd5a57Smrg		;;
40340dd5a57Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
40440dd5a57Smrg		basic_machine=m68000-att
40540dd5a57Smrg		;;
40640dd5a57Smrg	3b*)
40740dd5a57Smrg		basic_machine=we32k-att
40840dd5a57Smrg		;;
40940dd5a57Smrg	a29khif)
41040dd5a57Smrg		basic_machine=a29k-amd
41140dd5a57Smrg		os=-udi
41240dd5a57Smrg		;;
41340dd5a57Smrg    	abacus)
41440dd5a57Smrg		basic_machine=abacus-unknown
41540dd5a57Smrg		;;
41640dd5a57Smrg	adobe68k)
41740dd5a57Smrg		basic_machine=m68010-adobe
41840dd5a57Smrg		os=-scout
41940dd5a57Smrg		;;
42040dd5a57Smrg	alliant | fx80)
42140dd5a57Smrg		basic_machine=fx80-alliant
42240dd5a57Smrg		;;
42340dd5a57Smrg	altos | altos3068)
42440dd5a57Smrg		basic_machine=m68k-altos
42540dd5a57Smrg		;;
42640dd5a57Smrg	am29k)
42740dd5a57Smrg		basic_machine=a29k-none
42840dd5a57Smrg		os=-bsd
42940dd5a57Smrg		;;
43040dd5a57Smrg	amd64)
43140dd5a57Smrg		basic_machine=x86_64-pc
43240dd5a57Smrg		;;
43340dd5a57Smrg	amd64-*)
43440dd5a57Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
43540dd5a57Smrg		;;
43640dd5a57Smrg	amdahl)
43740dd5a57Smrg		basic_machine=580-amdahl
43840dd5a57Smrg		os=-sysv
43940dd5a57Smrg		;;
44040dd5a57Smrg	amiga | amiga-*)
44140dd5a57Smrg		basic_machine=m68k-unknown
44240dd5a57Smrg		;;
44340dd5a57Smrg	amigaos | amigados)
44440dd5a57Smrg		basic_machine=m68k-unknown
44540dd5a57Smrg		os=-amigaos
44640dd5a57Smrg		;;
44740dd5a57Smrg	amigaunix | amix)
44840dd5a57Smrg		basic_machine=m68k-unknown
44940dd5a57Smrg		os=-sysv4
45040dd5a57Smrg		;;
45140dd5a57Smrg	apollo68)
45240dd5a57Smrg		basic_machine=m68k-apollo
45340dd5a57Smrg		os=-sysv
45440dd5a57Smrg		;;
45540dd5a57Smrg	apollo68bsd)
45640dd5a57Smrg		basic_machine=m68k-apollo
45740dd5a57Smrg		os=-bsd
45840dd5a57Smrg		;;
45940dd5a57Smrg	aros)
46040dd5a57Smrg		basic_machine=i386-pc
46140dd5a57Smrg		os=-aros
46240dd5a57Smrg		;;
46340dd5a57Smrg	aux)
46440dd5a57Smrg		basic_machine=m68k-apple
46540dd5a57Smrg		os=-aux
46640dd5a57Smrg		;;
46740dd5a57Smrg	balance)
46840dd5a57Smrg		basic_machine=ns32k-sequent
46940dd5a57Smrg		os=-dynix
47040dd5a57Smrg		;;
47140dd5a57Smrg	blackfin)
47240dd5a57Smrg		basic_machine=bfin-unknown
47340dd5a57Smrg		os=-linux
47440dd5a57Smrg		;;
47540dd5a57Smrg	blackfin-*)
47640dd5a57Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
47740dd5a57Smrg		os=-linux
47840dd5a57Smrg		;;
47940dd5a57Smrg	bluegene*)
48040dd5a57Smrg		basic_machine=powerpc-ibm
48140dd5a57Smrg		os=-cnk
48240dd5a57Smrg		;;
48340dd5a57Smrg	c90)
48440dd5a57Smrg		basic_machine=c90-cray
48540dd5a57Smrg		os=-unicos
48640dd5a57Smrg		;;
48740dd5a57Smrg        cegcc)
48840dd5a57Smrg		basic_machine=arm-unknown
48940dd5a57Smrg		os=-cegcc
49040dd5a57Smrg		;;
49140dd5a57Smrg	convex-c1)
49240dd5a57Smrg		basic_machine=c1-convex
49340dd5a57Smrg		os=-bsd
49440dd5a57Smrg		;;
49540dd5a57Smrg	convex-c2)
49640dd5a57Smrg		basic_machine=c2-convex
49740dd5a57Smrg		os=-bsd
49840dd5a57Smrg		;;
49940dd5a57Smrg	convex-c32)
50040dd5a57Smrg		basic_machine=c32-convex
50140dd5a57Smrg		os=-bsd
50240dd5a57Smrg		;;
50340dd5a57Smrg	convex-c34)
50440dd5a57Smrg		basic_machine=c34-convex
50540dd5a57Smrg		os=-bsd
50640dd5a57Smrg		;;
50740dd5a57Smrg	convex-c38)
50840dd5a57Smrg		basic_machine=c38-convex
50940dd5a57Smrg		os=-bsd
51040dd5a57Smrg		;;
51140dd5a57Smrg	cray | j90)
51240dd5a57Smrg		basic_machine=j90-cray
51340dd5a57Smrg		os=-unicos
51440dd5a57Smrg		;;
51540dd5a57Smrg	craynv)
51640dd5a57Smrg		basic_machine=craynv-cray
51740dd5a57Smrg		os=-unicosmp
51840dd5a57Smrg		;;
51940dd5a57Smrg	cr16)
52040dd5a57Smrg		basic_machine=cr16-unknown
52140dd5a57Smrg		os=-elf
52240dd5a57Smrg		;;
52340dd5a57Smrg	crds | unos)
52440dd5a57Smrg		basic_machine=m68k-crds
52540dd5a57Smrg		;;
52640dd5a57Smrg	crisv32 | crisv32-* | etraxfs*)
52740dd5a57Smrg		basic_machine=crisv32-axis
52840dd5a57Smrg		;;
52940dd5a57Smrg	cris | cris-* | etrax*)
53040dd5a57Smrg		basic_machine=cris-axis
53140dd5a57Smrg		;;
53240dd5a57Smrg	crx)
53340dd5a57Smrg		basic_machine=crx-unknown
53440dd5a57Smrg		os=-elf
53540dd5a57Smrg		;;
53640dd5a57Smrg	da30 | da30-*)
53740dd5a57Smrg		basic_machine=m68k-da30
53840dd5a57Smrg		;;
53940dd5a57Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
54040dd5a57Smrg		basic_machine=mips-dec
54140dd5a57Smrg		;;
54240dd5a57Smrg	decsystem10* | dec10*)
54340dd5a57Smrg		basic_machine=pdp10-dec
54440dd5a57Smrg		os=-tops10
54540dd5a57Smrg		;;
54640dd5a57Smrg	decsystem20* | dec20*)
54740dd5a57Smrg		basic_machine=pdp10-dec
54840dd5a57Smrg		os=-tops20
54940dd5a57Smrg		;;
55040dd5a57Smrg	delta | 3300 | motorola-3300 | motorola-delta \
55140dd5a57Smrg	      | 3300-motorola | delta-motorola)
55240dd5a57Smrg		basic_machine=m68k-motorola
55340dd5a57Smrg		;;
55440dd5a57Smrg	delta88)
55540dd5a57Smrg		basic_machine=m88k-motorola
55640dd5a57Smrg		os=-sysv3
55740dd5a57Smrg		;;
55840dd5a57Smrg	dicos)
55940dd5a57Smrg		basic_machine=i686-pc
56040dd5a57Smrg		os=-dicos
56140dd5a57Smrg		;;
56240dd5a57Smrg	djgpp)
56340dd5a57Smrg		basic_machine=i586-pc
56440dd5a57Smrg		os=-msdosdjgpp
56540dd5a57Smrg		;;
56640dd5a57Smrg	dpx20 | dpx20-*)
56740dd5a57Smrg		basic_machine=rs6000-bull
56840dd5a57Smrg		os=-bosx
56940dd5a57Smrg		;;
57040dd5a57Smrg	dpx2* | dpx2*-bull)
57140dd5a57Smrg		basic_machine=m68k-bull
57240dd5a57Smrg		os=-sysv3
57340dd5a57Smrg		;;
57440dd5a57Smrg	ebmon29k)
57540dd5a57Smrg		basic_machine=a29k-amd
57640dd5a57Smrg		os=-ebmon
57740dd5a57Smrg		;;
57840dd5a57Smrg	elxsi)
57940dd5a57Smrg		basic_machine=elxsi-elxsi
58040dd5a57Smrg		os=-bsd
58140dd5a57Smrg		;;
58240dd5a57Smrg	encore | umax | mmax)
58340dd5a57Smrg		basic_machine=ns32k-encore
58440dd5a57Smrg		;;
58540dd5a57Smrg	es1800 | OSE68k | ose68k | ose | OSE)
58640dd5a57Smrg		basic_machine=m68k-ericsson
58740dd5a57Smrg		os=-ose
58840dd5a57Smrg		;;
58940dd5a57Smrg	fx2800)
59040dd5a57Smrg		basic_machine=i860-alliant
59140dd5a57Smrg		;;
59240dd5a57Smrg	genix)
59340dd5a57Smrg		basic_machine=ns32k-ns
59440dd5a57Smrg		;;
59540dd5a57Smrg	gmicro)
59640dd5a57Smrg		basic_machine=tron-gmicro
59740dd5a57Smrg		os=-sysv
59840dd5a57Smrg		;;
59940dd5a57Smrg	go32)
60040dd5a57Smrg		basic_machine=i386-pc
60140dd5a57Smrg		os=-go32
60240dd5a57Smrg		;;
60340dd5a57Smrg	h3050r* | hiux*)
60440dd5a57Smrg		basic_machine=hppa1.1-hitachi
60540dd5a57Smrg		os=-hiuxwe2
60640dd5a57Smrg		;;
60740dd5a57Smrg	h8300hms)
60840dd5a57Smrg		basic_machine=h8300-hitachi
60940dd5a57Smrg		os=-hms
61040dd5a57Smrg		;;
61140dd5a57Smrg	h8300xray)
61240dd5a57Smrg		basic_machine=h8300-hitachi
61340dd5a57Smrg		os=-xray
61440dd5a57Smrg		;;
61540dd5a57Smrg	h8500hms)
61640dd5a57Smrg		basic_machine=h8500-hitachi
61740dd5a57Smrg		os=-hms
61840dd5a57Smrg		;;
61940dd5a57Smrg	harris)
62040dd5a57Smrg		basic_machine=m88k-harris
62140dd5a57Smrg		os=-sysv3
62240dd5a57Smrg		;;
62340dd5a57Smrg	hp300-*)
62440dd5a57Smrg		basic_machine=m68k-hp
62540dd5a57Smrg		;;
62640dd5a57Smrg	hp300bsd)
62740dd5a57Smrg		basic_machine=m68k-hp
62840dd5a57Smrg		os=-bsd
62940dd5a57Smrg		;;
63040dd5a57Smrg	hp300hpux)
63140dd5a57Smrg		basic_machine=m68k-hp
63240dd5a57Smrg		os=-hpux
63340dd5a57Smrg		;;
63440dd5a57Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
63540dd5a57Smrg		basic_machine=hppa1.0-hp
63640dd5a57Smrg		;;
63740dd5a57Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
63840dd5a57Smrg		basic_machine=m68000-hp
63940dd5a57Smrg		;;
64040dd5a57Smrg	hp9k3[2-9][0-9])
64140dd5a57Smrg		basic_machine=m68k-hp
64240dd5a57Smrg		;;
64340dd5a57Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
64440dd5a57Smrg		basic_machine=hppa1.0-hp
64540dd5a57Smrg		;;
64640dd5a57Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
64740dd5a57Smrg		basic_machine=hppa1.1-hp
64840dd5a57Smrg		;;
64940dd5a57Smrg	hp9k78[0-9] | hp78[0-9])
65040dd5a57Smrg		# FIXME: really hppa2.0-hp
65140dd5a57Smrg		basic_machine=hppa1.1-hp
65240dd5a57Smrg		;;
65340dd5a57Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
65440dd5a57Smrg		# FIXME: really hppa2.0-hp
65540dd5a57Smrg		basic_machine=hppa1.1-hp
65640dd5a57Smrg		;;
65740dd5a57Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
65840dd5a57Smrg		basic_machine=hppa1.1-hp
65940dd5a57Smrg		;;
66040dd5a57Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
66140dd5a57Smrg		basic_machine=hppa1.0-hp
66240dd5a57Smrg		;;
66340dd5a57Smrg	hppa-next)
66440dd5a57Smrg		os=-nextstep3
66540dd5a57Smrg		;;
66640dd5a57Smrg	hppaosf)
66740dd5a57Smrg		basic_machine=hppa1.1-hp
66840dd5a57Smrg		os=-osf
66940dd5a57Smrg		;;
67040dd5a57Smrg	hppro)
67140dd5a57Smrg		basic_machine=hppa1.1-hp
67240dd5a57Smrg		os=-proelf
67340dd5a57Smrg		;;
67440dd5a57Smrg	i370-ibm* | ibm*)
67540dd5a57Smrg		basic_machine=i370-ibm
67640dd5a57Smrg		;;
67740dd5a57Smrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
67840dd5a57Smrg	i*86v32)
67940dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
68040dd5a57Smrg		os=-sysv32
68140dd5a57Smrg		;;
68240dd5a57Smrg	i*86v4*)
68340dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
68440dd5a57Smrg		os=-sysv4
68540dd5a57Smrg		;;
68640dd5a57Smrg	i*86v)
68740dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
68840dd5a57Smrg		os=-sysv
68940dd5a57Smrg		;;
69040dd5a57Smrg	i*86sol2)
69140dd5a57Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
69240dd5a57Smrg		os=-solaris2
69340dd5a57Smrg		;;
69440dd5a57Smrg	i386mach)
69540dd5a57Smrg		basic_machine=i386-mach
69640dd5a57Smrg		os=-mach
69740dd5a57Smrg		;;
69840dd5a57Smrg	i386-vsta | vsta)
69940dd5a57Smrg		basic_machine=i386-unknown
70040dd5a57Smrg		os=-vsta
70140dd5a57Smrg		;;
70240dd5a57Smrg	iris | iris4d)
70340dd5a57Smrg		basic_machine=mips-sgi
70440dd5a57Smrg		case $os in
70540dd5a57Smrg		    -irix*)
70640dd5a57Smrg			;;
70740dd5a57Smrg		    *)
70840dd5a57Smrg			os=-irix4
70940dd5a57Smrg			;;
71040dd5a57Smrg		esac
71140dd5a57Smrg		;;
71240dd5a57Smrg	isi68 | isi)
71340dd5a57Smrg		basic_machine=m68k-isi
71440dd5a57Smrg		os=-sysv
71540dd5a57Smrg		;;
71640dd5a57Smrg	m68knommu)
71740dd5a57Smrg		basic_machine=m68k-unknown
71840dd5a57Smrg		os=-linux
71940dd5a57Smrg		;;
72040dd5a57Smrg	m68knommu-*)
72140dd5a57Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
72240dd5a57Smrg		os=-linux
72340dd5a57Smrg		;;
72440dd5a57Smrg	m88k-omron*)
72540dd5a57Smrg		basic_machine=m88k-omron
72640dd5a57Smrg		;;
72740dd5a57Smrg	magnum | m3230)
72840dd5a57Smrg		basic_machine=mips-mips
72940dd5a57Smrg		os=-sysv
73040dd5a57Smrg		;;
73140dd5a57Smrg	merlin)
73240dd5a57Smrg		basic_machine=ns32k-utek
73340dd5a57Smrg		os=-sysv
73440dd5a57Smrg		;;
73540dd5a57Smrg        microblaze)
73640dd5a57Smrg		basic_machine=microblaze-xilinx
73740dd5a57Smrg		;;
73840dd5a57Smrg	mingw32)
73940dd5a57Smrg		basic_machine=i386-pc
74040dd5a57Smrg		os=-mingw32
74140dd5a57Smrg		;;
74240dd5a57Smrg	mingw32ce)
74340dd5a57Smrg		basic_machine=arm-unknown
74440dd5a57Smrg		os=-mingw32ce
74540dd5a57Smrg		;;
74640dd5a57Smrg	miniframe)
74740dd5a57Smrg		basic_machine=m68000-convergent
74840dd5a57Smrg		;;
74940dd5a57Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
75040dd5a57Smrg		basic_machine=m68k-atari
75140dd5a57Smrg		os=-mint
75240dd5a57Smrg		;;
75340dd5a57Smrg	mips3*-*)
75440dd5a57Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
75540dd5a57Smrg		;;
75640dd5a57Smrg	mips3*)
75740dd5a57Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
75840dd5a57Smrg		;;
75940dd5a57Smrg	monitor)
76040dd5a57Smrg		basic_machine=m68k-rom68k
76140dd5a57Smrg		os=-coff
76240dd5a57Smrg		;;
76340dd5a57Smrg	morphos)
76440dd5a57Smrg		basic_machine=powerpc-unknown
76540dd5a57Smrg		os=-morphos
76640dd5a57Smrg		;;
76740dd5a57Smrg	msdos)
76840dd5a57Smrg		basic_machine=i386-pc
76940dd5a57Smrg		os=-msdos
77040dd5a57Smrg		;;
77140dd5a57Smrg	ms1-*)
77240dd5a57Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
77340dd5a57Smrg		;;
77440dd5a57Smrg	mvs)
77540dd5a57Smrg		basic_machine=i370-ibm
77640dd5a57Smrg		os=-mvs
77740dd5a57Smrg		;;
77840dd5a57Smrg	ncr3000)
77940dd5a57Smrg		basic_machine=i486-ncr
78040dd5a57Smrg		os=-sysv4
78140dd5a57Smrg		;;
78240dd5a57Smrg	netbsd386)
78340dd5a57Smrg		basic_machine=i386-unknown
78440dd5a57Smrg		os=-netbsd
78540dd5a57Smrg		;;
78640dd5a57Smrg	netwinder)
78740dd5a57Smrg		basic_machine=armv4l-rebel
78840dd5a57Smrg		os=-linux
78940dd5a57Smrg		;;
79040dd5a57Smrg	news | news700 | news800 | news900)
79140dd5a57Smrg		basic_machine=m68k-sony
79240dd5a57Smrg		os=-newsos
79340dd5a57Smrg		;;
79440dd5a57Smrg	news1000)
79540dd5a57Smrg		basic_machine=m68030-sony
79640dd5a57Smrg		os=-newsos
79740dd5a57Smrg		;;
79840dd5a57Smrg	news-3600 | risc-news)
79940dd5a57Smrg		basic_machine=mips-sony
80040dd5a57Smrg		os=-newsos
80140dd5a57Smrg		;;
80240dd5a57Smrg	necv70)
80340dd5a57Smrg		basic_machine=v70-nec
80440dd5a57Smrg		os=-sysv
80540dd5a57Smrg		;;
80640dd5a57Smrg	next | m*-next )
80740dd5a57Smrg		basic_machine=m68k-next
80840dd5a57Smrg		case $os in
80940dd5a57Smrg		    -nextstep* )
81040dd5a57Smrg			;;
81140dd5a57Smrg		    -ns2*)
81240dd5a57Smrg		      os=-nextstep2
81340dd5a57Smrg			;;
81440dd5a57Smrg		    *)
81540dd5a57Smrg		      os=-nextstep3
81640dd5a57Smrg			;;
81740dd5a57Smrg		esac
81840dd5a57Smrg		;;
81940dd5a57Smrg	nh3000)
82040dd5a57Smrg		basic_machine=m68k-harris
82140dd5a57Smrg		os=-cxux
82240dd5a57Smrg		;;
82340dd5a57Smrg	nh[45]000)
82440dd5a57Smrg		basic_machine=m88k-harris
82540dd5a57Smrg		os=-cxux
82640dd5a57Smrg		;;
82740dd5a57Smrg	nindy960)
82840dd5a57Smrg		basic_machine=i960-intel
82940dd5a57Smrg		os=-nindy
83040dd5a57Smrg		;;
83140dd5a57Smrg	mon960)
83240dd5a57Smrg		basic_machine=i960-intel
83340dd5a57Smrg		os=-mon960
83440dd5a57Smrg		;;
83540dd5a57Smrg	nonstopux)
83640dd5a57Smrg		basic_machine=mips-compaq
83740dd5a57Smrg		os=-nonstopux
83840dd5a57Smrg		;;
83940dd5a57Smrg	np1)
84040dd5a57Smrg		basic_machine=np1-gould
84140dd5a57Smrg		;;
84240dd5a57Smrg	nsr-tandem)
84340dd5a57Smrg		basic_machine=nsr-tandem
84440dd5a57Smrg		;;
84540dd5a57Smrg	op50n-* | op60c-*)
84640dd5a57Smrg		basic_machine=hppa1.1-oki
84740dd5a57Smrg		os=-proelf
84840dd5a57Smrg		;;
84940dd5a57Smrg	openrisc | openrisc-*)
85040dd5a57Smrg		basic_machine=or32-unknown
85140dd5a57Smrg		;;
85240dd5a57Smrg	os400)
85340dd5a57Smrg		basic_machine=powerpc-ibm
85440dd5a57Smrg		os=-os400
85540dd5a57Smrg		;;
85640dd5a57Smrg	OSE68000 | ose68000)
85740dd5a57Smrg		basic_machine=m68000-ericsson
85840dd5a57Smrg		os=-ose
85940dd5a57Smrg		;;
86040dd5a57Smrg	os68k)
86140dd5a57Smrg		basic_machine=m68k-none
86240dd5a57Smrg		os=-os68k
86340dd5a57Smrg		;;
86440dd5a57Smrg	pa-hitachi)
86540dd5a57Smrg		basic_machine=hppa1.1-hitachi
86640dd5a57Smrg		os=-hiuxwe2
86740dd5a57Smrg		;;
86840dd5a57Smrg	paragon)
86940dd5a57Smrg		basic_machine=i860-intel
87040dd5a57Smrg		os=-osf
87140dd5a57Smrg		;;
87240dd5a57Smrg	parisc)
87340dd5a57Smrg		basic_machine=hppa-unknown
87440dd5a57Smrg		os=-linux
87540dd5a57Smrg		;;
87640dd5a57Smrg	parisc-*)
87740dd5a57Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
87840dd5a57Smrg		os=-linux
87940dd5a57Smrg		;;
88040dd5a57Smrg	pbd)
88140dd5a57Smrg		basic_machine=sparc-tti
88240dd5a57Smrg		;;
88340dd5a57Smrg	pbb)
88440dd5a57Smrg		basic_machine=m68k-tti
88540dd5a57Smrg		;;
88640dd5a57Smrg	pc532 | pc532-*)
88740dd5a57Smrg		basic_machine=ns32k-pc532
88840dd5a57Smrg		;;
88940dd5a57Smrg	pc98)
89040dd5a57Smrg		basic_machine=i386-pc
89140dd5a57Smrg		;;
89240dd5a57Smrg	pc98-*)
89340dd5a57Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
89440dd5a57Smrg		;;
89540dd5a57Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
89640dd5a57Smrg		basic_machine=i586-pc
89740dd5a57Smrg		;;
89840dd5a57Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
89940dd5a57Smrg		basic_machine=i686-pc
90040dd5a57Smrg		;;
90140dd5a57Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
90240dd5a57Smrg		basic_machine=i686-pc
90340dd5a57Smrg		;;
90440dd5a57Smrg	pentium4)
90540dd5a57Smrg		basic_machine=i786-pc
90640dd5a57Smrg		;;
90740dd5a57Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
90840dd5a57Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
90940dd5a57Smrg		;;
91040dd5a57Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
91140dd5a57Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
91240dd5a57Smrg		;;
91340dd5a57Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
91440dd5a57Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
91540dd5a57Smrg		;;
91640dd5a57Smrg	pentium4-*)
91740dd5a57Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
91840dd5a57Smrg		;;
91940dd5a57Smrg	pn)
92040dd5a57Smrg		basic_machine=pn-gould
92140dd5a57Smrg		;;
92240dd5a57Smrg	power)	basic_machine=power-ibm
92340dd5a57Smrg		;;
92440dd5a57Smrg	ppc)	basic_machine=powerpc-unknown
92540dd5a57Smrg		;;
92640dd5a57Smrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
92740dd5a57Smrg		;;
92840dd5a57Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
92940dd5a57Smrg		basic_machine=powerpcle-unknown
93040dd5a57Smrg		;;
93140dd5a57Smrg	ppcle-* | powerpclittle-*)
93240dd5a57Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
93340dd5a57Smrg		;;
93440dd5a57Smrg	ppc64)	basic_machine=powerpc64-unknown
93540dd5a57Smrg		;;
93640dd5a57Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
93740dd5a57Smrg		;;
93840dd5a57Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
93940dd5a57Smrg		basic_machine=powerpc64le-unknown
94040dd5a57Smrg		;;
94140dd5a57Smrg	ppc64le-* | powerpc64little-*)
94240dd5a57Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
94340dd5a57Smrg		;;
94440dd5a57Smrg	ps2)
94540dd5a57Smrg		basic_machine=i386-ibm
94640dd5a57Smrg		;;
94740dd5a57Smrg	pw32)
94840dd5a57Smrg		basic_machine=i586-unknown
94940dd5a57Smrg		os=-pw32
95040dd5a57Smrg		;;
95140dd5a57Smrg	rdos)
95240dd5a57Smrg		basic_machine=i386-pc
95340dd5a57Smrg		os=-rdos
95440dd5a57Smrg		;;
95540dd5a57Smrg	rom68k)
95640dd5a57Smrg		basic_machine=m68k-rom68k
95740dd5a57Smrg		os=-coff
95840dd5a57Smrg		;;
95940dd5a57Smrg	rm[46]00)
96040dd5a57Smrg		basic_machine=mips-siemens
96140dd5a57Smrg		;;
96240dd5a57Smrg	rtpc | rtpc-*)
96340dd5a57Smrg		basic_machine=romp-ibm
96440dd5a57Smrg		;;
96540dd5a57Smrg	s390 | s390-*)
96640dd5a57Smrg		basic_machine=s390-ibm
96740dd5a57Smrg		;;
96840dd5a57Smrg	s390x | s390x-*)
96940dd5a57Smrg		basic_machine=s390x-ibm
97040dd5a57Smrg		;;
97140dd5a57Smrg	sa29200)
97240dd5a57Smrg		basic_machine=a29k-amd
97340dd5a57Smrg		os=-udi
97440dd5a57Smrg		;;
97540dd5a57Smrg	sb1)
97640dd5a57Smrg		basic_machine=mipsisa64sb1-unknown
97740dd5a57Smrg		;;
97840dd5a57Smrg	sb1el)
97940dd5a57Smrg		basic_machine=mipsisa64sb1el-unknown
98040dd5a57Smrg		;;
98140dd5a57Smrg	sde)
98240dd5a57Smrg		basic_machine=mipsisa32-sde
98340dd5a57Smrg		os=-elf
98440dd5a57Smrg		;;
98540dd5a57Smrg	sei)
98640dd5a57Smrg		basic_machine=mips-sei
98740dd5a57Smrg		os=-seiux
98840dd5a57Smrg		;;
98940dd5a57Smrg	sequent)
99040dd5a57Smrg		basic_machine=i386-sequent
99140dd5a57Smrg		;;
99240dd5a57Smrg	sh)
99340dd5a57Smrg		basic_machine=sh-hitachi
99440dd5a57Smrg		os=-hms
99540dd5a57Smrg		;;
99640dd5a57Smrg	sh5el)
99740dd5a57Smrg		basic_machine=sh5le-unknown
99840dd5a57Smrg		;;
99940dd5a57Smrg	sh64)
100040dd5a57Smrg		basic_machine=sh64-unknown
100140dd5a57Smrg		;;
100240dd5a57Smrg	sparclite-wrs | simso-wrs)
100340dd5a57Smrg		basic_machine=sparclite-wrs
100440dd5a57Smrg		os=-vxworks
100540dd5a57Smrg		;;
100640dd5a57Smrg	sps7)
100740dd5a57Smrg		basic_machine=m68k-bull
100840dd5a57Smrg		os=-sysv2
100940dd5a57Smrg		;;
101040dd5a57Smrg	spur)
101140dd5a57Smrg		basic_machine=spur-unknown
101240dd5a57Smrg		;;
101340dd5a57Smrg	st2000)
101440dd5a57Smrg		basic_machine=m68k-tandem
101540dd5a57Smrg		;;
101640dd5a57Smrg	stratus)
101740dd5a57Smrg		basic_machine=i860-stratus
101840dd5a57Smrg		os=-sysv4
101940dd5a57Smrg		;;
102040dd5a57Smrg	sun2)
102140dd5a57Smrg		basic_machine=m68000-sun
102240dd5a57Smrg		;;
102340dd5a57Smrg	sun2os3)
102440dd5a57Smrg		basic_machine=m68000-sun
102540dd5a57Smrg		os=-sunos3
102640dd5a57Smrg		;;
102740dd5a57Smrg	sun2os4)
102840dd5a57Smrg		basic_machine=m68000-sun
102940dd5a57Smrg		os=-sunos4
103040dd5a57Smrg		;;
103140dd5a57Smrg	sun3os3)
103240dd5a57Smrg		basic_machine=m68k-sun
103340dd5a57Smrg		os=-sunos3
103440dd5a57Smrg		;;
103540dd5a57Smrg	sun3os4)
103640dd5a57Smrg		basic_machine=m68k-sun
103740dd5a57Smrg		os=-sunos4
103840dd5a57Smrg		;;
103940dd5a57Smrg	sun4os3)
104040dd5a57Smrg		basic_machine=sparc-sun
104140dd5a57Smrg		os=-sunos3
104240dd5a57Smrg		;;
104340dd5a57Smrg	sun4os4)
104440dd5a57Smrg		basic_machine=sparc-sun
104540dd5a57Smrg		os=-sunos4
104640dd5a57Smrg		;;
104740dd5a57Smrg	sun4sol2)
104840dd5a57Smrg		basic_machine=sparc-sun
104940dd5a57Smrg		os=-solaris2
105040dd5a57Smrg		;;
105140dd5a57Smrg	sun3 | sun3-*)
105240dd5a57Smrg		basic_machine=m68k-sun
105340dd5a57Smrg		;;
105440dd5a57Smrg	sun4)
105540dd5a57Smrg		basic_machine=sparc-sun
105640dd5a57Smrg		;;
105740dd5a57Smrg	sun386 | sun386i | roadrunner)
105840dd5a57Smrg		basic_machine=i386-sun
105940dd5a57Smrg		;;
106040dd5a57Smrg	sv1)
106140dd5a57Smrg		basic_machine=sv1-cray
106240dd5a57Smrg		os=-unicos
106340dd5a57Smrg		;;
106440dd5a57Smrg	symmetry)
106540dd5a57Smrg		basic_machine=i386-sequent
106640dd5a57Smrg		os=-dynix
106740dd5a57Smrg		;;
106840dd5a57Smrg	t3e)
106940dd5a57Smrg		basic_machine=alphaev5-cray
107040dd5a57Smrg		os=-unicos
107140dd5a57Smrg		;;
107240dd5a57Smrg	t90)
107340dd5a57Smrg		basic_machine=t90-cray
107440dd5a57Smrg		os=-unicos
107540dd5a57Smrg		;;
107640dd5a57Smrg	tic54x | c54x*)
107740dd5a57Smrg		basic_machine=tic54x-unknown
107840dd5a57Smrg		os=-coff
107940dd5a57Smrg		;;
108040dd5a57Smrg	tic55x | c55x*)
108140dd5a57Smrg		basic_machine=tic55x-unknown
108240dd5a57Smrg		os=-coff
108340dd5a57Smrg		;;
108440dd5a57Smrg	tic6x | c6x*)
108540dd5a57Smrg		basic_machine=tic6x-unknown
108640dd5a57Smrg		os=-coff
108740dd5a57Smrg		;;
108840dd5a57Smrg	tile*)
108940dd5a57Smrg		basic_machine=tile-unknown
109040dd5a57Smrg		os=-linux-gnu
109140dd5a57Smrg		;;
109240dd5a57Smrg	tx39)
109340dd5a57Smrg		basic_machine=mipstx39-unknown
109440dd5a57Smrg		;;
109540dd5a57Smrg	tx39el)
109640dd5a57Smrg		basic_machine=mipstx39el-unknown
109740dd5a57Smrg		;;
109840dd5a57Smrg	toad1)
109940dd5a57Smrg		basic_machine=pdp10-xkl
110040dd5a57Smrg		os=-tops20
110140dd5a57Smrg		;;
110240dd5a57Smrg	tower | tower-32)
110340dd5a57Smrg		basic_machine=m68k-ncr
110440dd5a57Smrg		;;
110540dd5a57Smrg	tpf)
110640dd5a57Smrg		basic_machine=s390x-ibm
110740dd5a57Smrg		os=-tpf
110840dd5a57Smrg		;;
110940dd5a57Smrg	udi29k)
111040dd5a57Smrg		basic_machine=a29k-amd
111140dd5a57Smrg		os=-udi
111240dd5a57Smrg		;;
111340dd5a57Smrg	ultra3)
111440dd5a57Smrg		basic_machine=a29k-nyu
111540dd5a57Smrg		os=-sym1
111640dd5a57Smrg		;;
111740dd5a57Smrg	v810 | necv810)
111840dd5a57Smrg		basic_machine=v810-nec
111940dd5a57Smrg		os=-none
112040dd5a57Smrg		;;
112140dd5a57Smrg	vaxv)
112240dd5a57Smrg		basic_machine=vax-dec
112340dd5a57Smrg		os=-sysv
112440dd5a57Smrg		;;
112540dd5a57Smrg	vms)
112640dd5a57Smrg		basic_machine=vax-dec
112740dd5a57Smrg		os=-vms
112840dd5a57Smrg		;;
112940dd5a57Smrg	vpp*|vx|vx-*)
113040dd5a57Smrg		basic_machine=f301-fujitsu
113140dd5a57Smrg		;;
113240dd5a57Smrg	vxworks960)
113340dd5a57Smrg		basic_machine=i960-wrs
113440dd5a57Smrg		os=-vxworks
113540dd5a57Smrg		;;
113640dd5a57Smrg	vxworks68)
113740dd5a57Smrg		basic_machine=m68k-wrs
113840dd5a57Smrg		os=-vxworks
113940dd5a57Smrg		;;
114040dd5a57Smrg	vxworks29k)
114140dd5a57Smrg		basic_machine=a29k-wrs
114240dd5a57Smrg		os=-vxworks
114340dd5a57Smrg		;;
114440dd5a57Smrg	w65*)
114540dd5a57Smrg		basic_machine=w65-wdc
114640dd5a57Smrg		os=-none
114740dd5a57Smrg		;;
114840dd5a57Smrg	w89k-*)
114940dd5a57Smrg		basic_machine=hppa1.1-winbond
115040dd5a57Smrg		os=-proelf
115140dd5a57Smrg		;;
115240dd5a57Smrg	xbox)
115340dd5a57Smrg		basic_machine=i686-pc
115440dd5a57Smrg		os=-mingw32
115540dd5a57Smrg		;;
115640dd5a57Smrg	xps | xps100)
115740dd5a57Smrg		basic_machine=xps100-honeywell
115840dd5a57Smrg		;;
115940dd5a57Smrg	ymp)
116040dd5a57Smrg		basic_machine=ymp-cray
116140dd5a57Smrg		os=-unicos
116240dd5a57Smrg		;;
116340dd5a57Smrg	z8k-*-coff)
116440dd5a57Smrg		basic_machine=z8k-unknown
116540dd5a57Smrg		os=-sim
116640dd5a57Smrg		;;
116740dd5a57Smrg	z80-*-coff)
116840dd5a57Smrg		basic_machine=z80-unknown
116940dd5a57Smrg		os=-sim
117040dd5a57Smrg		;;
117140dd5a57Smrg	none)
117240dd5a57Smrg		basic_machine=none-none
117340dd5a57Smrg		os=-none
117440dd5a57Smrg		;;
117540dd5a57Smrg
117640dd5a57Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
117740dd5a57Smrg# some cases the only manufacturer, in others, it is the most popular.
117840dd5a57Smrg	w89k)
117940dd5a57Smrg		basic_machine=hppa1.1-winbond
118040dd5a57Smrg		;;
118140dd5a57Smrg	op50n)
118240dd5a57Smrg		basic_machine=hppa1.1-oki
118340dd5a57Smrg		;;
118440dd5a57Smrg	op60c)
118540dd5a57Smrg		basic_machine=hppa1.1-oki
118640dd5a57Smrg		;;
118740dd5a57Smrg	romp)
118840dd5a57Smrg		basic_machine=romp-ibm
118940dd5a57Smrg		;;
119040dd5a57Smrg	mmix)
119140dd5a57Smrg		basic_machine=mmix-knuth
119240dd5a57Smrg		;;
119340dd5a57Smrg	rs6000)
119440dd5a57Smrg		basic_machine=rs6000-ibm
119540dd5a57Smrg		;;
119640dd5a57Smrg	vax)
119740dd5a57Smrg		basic_machine=vax-dec
119840dd5a57Smrg		;;
119940dd5a57Smrg	pdp10)
120040dd5a57Smrg		# there are many clones, so DEC is not a safe bet
120140dd5a57Smrg		basic_machine=pdp10-unknown
120240dd5a57Smrg		;;
120340dd5a57Smrg	pdp11)
120440dd5a57Smrg		basic_machine=pdp11-dec
120540dd5a57Smrg		;;
120640dd5a57Smrg	we32k)
120740dd5a57Smrg		basic_machine=we32k-att
120840dd5a57Smrg		;;
120940dd5a57Smrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
121040dd5a57Smrg		basic_machine=sh-unknown
121140dd5a57Smrg		;;
121240dd5a57Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
121340dd5a57Smrg		basic_machine=sparc-sun
121440dd5a57Smrg		;;
121540dd5a57Smrg	cydra)
121640dd5a57Smrg		basic_machine=cydra-cydrome
121740dd5a57Smrg		;;
121840dd5a57Smrg	orion)
121940dd5a57Smrg		basic_machine=orion-highlevel
122040dd5a57Smrg		;;
122140dd5a57Smrg	orion105)
122240dd5a57Smrg		basic_machine=clipper-highlevel
122340dd5a57Smrg		;;
122440dd5a57Smrg	mac | mpw | mac-mpw)
122540dd5a57Smrg		basic_machine=m68k-apple
122640dd5a57Smrg		;;
122740dd5a57Smrg	pmac | pmac-mpw)
122840dd5a57Smrg		basic_machine=powerpc-apple
122940dd5a57Smrg		;;
123040dd5a57Smrg	*-unknown)
123140dd5a57Smrg		# Make sure to match an already-canonicalized machine name.
123240dd5a57Smrg		;;
123340dd5a57Smrg	*)
123440dd5a57Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
123540dd5a57Smrg		exit 1
123640dd5a57Smrg		;;
123740dd5a57Smrgesac
123840dd5a57Smrg
123940dd5a57Smrg# Here we canonicalize certain aliases for manufacturers.
124040dd5a57Smrgcase $basic_machine in
124140dd5a57Smrg	*-digital*)
124240dd5a57Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
124340dd5a57Smrg		;;
124440dd5a57Smrg	*-commodore*)
124540dd5a57Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
124640dd5a57Smrg		;;
124740dd5a57Smrg	*)
124840dd5a57Smrg		;;
124940dd5a57Smrgesac
125040dd5a57Smrg
125140dd5a57Smrg# Decode manufacturer-specific aliases for certain operating systems.
125240dd5a57Smrg
125340dd5a57Smrgif [ x"$os" != x"" ]
125440dd5a57Smrgthen
125540dd5a57Smrgcase $os in
125640dd5a57Smrg        # First match some system type aliases
125740dd5a57Smrg        # that might get confused with valid system types.
125840dd5a57Smrg	# -solaris* is a basic system type, with this one exception.
125940dd5a57Smrg        -auroraux)
126040dd5a57Smrg	        os=-auroraux
126140dd5a57Smrg		;;
126240dd5a57Smrg	-solaris1 | -solaris1.*)
126340dd5a57Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
126440dd5a57Smrg		;;
126540dd5a57Smrg	-solaris)
126640dd5a57Smrg		os=-solaris2
126740dd5a57Smrg		;;
126840dd5a57Smrg	-svr4*)
126940dd5a57Smrg		os=-sysv4
127040dd5a57Smrg		;;
127140dd5a57Smrg	-unixware*)
127240dd5a57Smrg		os=-sysv4.2uw
127340dd5a57Smrg		;;
127440dd5a57Smrg	-gnu/linux*)
127540dd5a57Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
127640dd5a57Smrg		;;
127740dd5a57Smrg	# First accept the basic system types.
127840dd5a57Smrg	# The portable systems comes first.
127940dd5a57Smrg	# Each alternative MUST END IN A *, to match a version number.
128040dd5a57Smrg	# -sysv* is not here because it comes later, after sysvr4.
128140dd5a57Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
128240dd5a57Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
128340dd5a57Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
128440dd5a57Smrg	      | -sym* | -kopensolaris* \
128540dd5a57Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
128640dd5a57Smrg	      | -aos* | -aros* \
128740dd5a57Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
128840dd5a57Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
128940dd5a57Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
129040dd5a57Smrg	      | -openbsd* | -solidbsd* \
129140dd5a57Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
129240dd5a57Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
129340dd5a57Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
129440dd5a57Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
129540dd5a57Smrg	      | -chorusos* | -chorusrdb* | -cegcc* \
129640dd5a57Smrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
129740dd5a57Smrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
129840dd5a57Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
129940dd5a57Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
130040dd5a57Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
130140dd5a57Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
130240dd5a57Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
130340dd5a57Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
130440dd5a57Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
130540dd5a57Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
130640dd5a57Smrg	# Remember, each alternative MUST END IN *, to match a version number.
130740dd5a57Smrg		;;
130840dd5a57Smrg	-qnx*)
130940dd5a57Smrg		case $basic_machine in
131040dd5a57Smrg		    x86-* | i*86-*)
131140dd5a57Smrg			;;
131240dd5a57Smrg		    *)
131340dd5a57Smrg			os=-nto$os
131440dd5a57Smrg			;;
131540dd5a57Smrg		esac
131640dd5a57Smrg		;;
131740dd5a57Smrg	-nto-qnx*)
131840dd5a57Smrg		;;
131940dd5a57Smrg	-nto*)
132040dd5a57Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
132140dd5a57Smrg		;;
132240dd5a57Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
132340dd5a57Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
132440dd5a57Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
132540dd5a57Smrg		;;
132640dd5a57Smrg	-mac*)
132740dd5a57Smrg		os=`echo $os | sed -e 's|mac|macos|'`
132840dd5a57Smrg		;;
132940dd5a57Smrg	-linux-dietlibc)
133040dd5a57Smrg		os=-linux-dietlibc
133140dd5a57Smrg		;;
133240dd5a57Smrg	-linux*)
133340dd5a57Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
133440dd5a57Smrg		;;
133540dd5a57Smrg	-sunos5*)
133640dd5a57Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
133740dd5a57Smrg		;;
133840dd5a57Smrg	-sunos6*)
133940dd5a57Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
134040dd5a57Smrg		;;
134140dd5a57Smrg	-opened*)
134240dd5a57Smrg		os=-openedition
134340dd5a57Smrg		;;
134440dd5a57Smrg        -os400*)
134540dd5a57Smrg		os=-os400
134640dd5a57Smrg		;;
134740dd5a57Smrg	-wince*)
134840dd5a57Smrg		os=-wince
134940dd5a57Smrg		;;
135040dd5a57Smrg	-osfrose*)
135140dd5a57Smrg		os=-osfrose
135240dd5a57Smrg		;;
135340dd5a57Smrg	-osf*)
135440dd5a57Smrg		os=-osf
135540dd5a57Smrg		;;
135640dd5a57Smrg	-utek*)
135740dd5a57Smrg		os=-bsd
135840dd5a57Smrg		;;
135940dd5a57Smrg	-dynix*)
136040dd5a57Smrg		os=-bsd
136140dd5a57Smrg		;;
136240dd5a57Smrg	-acis*)
136340dd5a57Smrg		os=-aos
136440dd5a57Smrg		;;
136540dd5a57Smrg	-atheos*)
136640dd5a57Smrg		os=-atheos
136740dd5a57Smrg		;;
136840dd5a57Smrg	-syllable*)
136940dd5a57Smrg		os=-syllable
137040dd5a57Smrg		;;
137140dd5a57Smrg	-386bsd)
137240dd5a57Smrg		os=-bsd
137340dd5a57Smrg		;;
137440dd5a57Smrg	-ctix* | -uts*)
137540dd5a57Smrg		os=-sysv
137640dd5a57Smrg		;;
137740dd5a57Smrg	-nova*)
137840dd5a57Smrg		os=-rtmk-nova
137940dd5a57Smrg		;;
138040dd5a57Smrg	-ns2 )
138140dd5a57Smrg		os=-nextstep2
138240dd5a57Smrg		;;
138340dd5a57Smrg	-nsk*)
138440dd5a57Smrg		os=-nsk
138540dd5a57Smrg		;;
138640dd5a57Smrg	# Preserve the version number of sinix5.
138740dd5a57Smrg	-sinix5.*)
138840dd5a57Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
138940dd5a57Smrg		;;
139040dd5a57Smrg	-sinix*)
139140dd5a57Smrg		os=-sysv4
139240dd5a57Smrg		;;
139340dd5a57Smrg        -tpf*)
139440dd5a57Smrg		os=-tpf
139540dd5a57Smrg		;;
139640dd5a57Smrg	-triton*)
139740dd5a57Smrg		os=-sysv3
139840dd5a57Smrg		;;
139940dd5a57Smrg	-oss*)
140040dd5a57Smrg		os=-sysv3
140140dd5a57Smrg		;;
140240dd5a57Smrg	-svr4)
140340dd5a57Smrg		os=-sysv4
140440dd5a57Smrg		;;
140540dd5a57Smrg	-svr3)
140640dd5a57Smrg		os=-sysv3
140740dd5a57Smrg		;;
140840dd5a57Smrg	-sysvr4)
140940dd5a57Smrg		os=-sysv4
141040dd5a57Smrg		;;
141140dd5a57Smrg	# This must come after -sysvr4.
141240dd5a57Smrg	-sysv*)
141340dd5a57Smrg		;;
141440dd5a57Smrg	-ose*)
141540dd5a57Smrg		os=-ose
141640dd5a57Smrg		;;
141740dd5a57Smrg	-es1800*)
141840dd5a57Smrg		os=-ose
141940dd5a57Smrg		;;
142040dd5a57Smrg	-xenix)
142140dd5a57Smrg		os=-xenix
142240dd5a57Smrg		;;
142340dd5a57Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
142440dd5a57Smrg		os=-mint
142540dd5a57Smrg		;;
142640dd5a57Smrg	-aros*)
142740dd5a57Smrg		os=-aros
142840dd5a57Smrg		;;
142940dd5a57Smrg	-kaos*)
143040dd5a57Smrg		os=-kaos
143140dd5a57Smrg		;;
143240dd5a57Smrg	-zvmoe)
143340dd5a57Smrg		os=-zvmoe
143440dd5a57Smrg		;;
143540dd5a57Smrg	-dicos*)
143640dd5a57Smrg		os=-dicos
143740dd5a57Smrg		;;
143840dd5a57Smrg	-none)
143940dd5a57Smrg		;;
144040dd5a57Smrg	*)
144140dd5a57Smrg		# Get rid of the `-' at the beginning of $os.
144240dd5a57Smrg		os=`echo $os | sed 's/[^-]*-//'`
144340dd5a57Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
144440dd5a57Smrg		exit 1
144540dd5a57Smrg		;;
144640dd5a57Smrgesac
144740dd5a57Smrgelse
144840dd5a57Smrg
144940dd5a57Smrg# Here we handle the default operating systems that come with various machines.
145040dd5a57Smrg# The value should be what the vendor currently ships out the door with their
145140dd5a57Smrg# machine or put another way, the most popular os provided with the machine.
145240dd5a57Smrg
145340dd5a57Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
145440dd5a57Smrg# "-sun"), then you have to tell the case statement up towards the top
145540dd5a57Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
145640dd5a57Smrg# will signal an error saying that MANUFACTURER isn't an operating
145740dd5a57Smrg# system, and we'll never get to this point.
145840dd5a57Smrg
145940dd5a57Smrgcase $basic_machine in
146040dd5a57Smrg        score-*)
146140dd5a57Smrg		os=-elf
146240dd5a57Smrg		;;
146340dd5a57Smrg        spu-*)
146440dd5a57Smrg		os=-elf
146540dd5a57Smrg		;;
146640dd5a57Smrg	*-acorn)
146740dd5a57Smrg		os=-riscix1.2
146840dd5a57Smrg		;;
146940dd5a57Smrg	arm*-rebel)
147040dd5a57Smrg		os=-linux
147140dd5a57Smrg		;;
147240dd5a57Smrg	arm*-semi)
147340dd5a57Smrg		os=-aout
147440dd5a57Smrg		;;
147540dd5a57Smrg        c4x-* | tic4x-*)
147640dd5a57Smrg        	os=-coff
147740dd5a57Smrg		;;
147840dd5a57Smrg	# This must come before the *-dec entry.
147940dd5a57Smrg	pdp10-*)
148040dd5a57Smrg		os=-tops20
148140dd5a57Smrg		;;
148240dd5a57Smrg	pdp11-*)
148340dd5a57Smrg		os=-none
148440dd5a57Smrg		;;
148540dd5a57Smrg	*-dec | vax-*)
148640dd5a57Smrg		os=-ultrix4.2
148740dd5a57Smrg		;;
148840dd5a57Smrg	m68*-apollo)
148940dd5a57Smrg		os=-domain
149040dd5a57Smrg		;;
149140dd5a57Smrg	i386-sun)
149240dd5a57Smrg		os=-sunos4.0.2
149340dd5a57Smrg		;;
149440dd5a57Smrg	m68000-sun)
149540dd5a57Smrg		os=-sunos3
149640dd5a57Smrg		# This also exists in the configure program, but was not the
149740dd5a57Smrg		# default.
149840dd5a57Smrg		# os=-sunos4
149940dd5a57Smrg		;;
150040dd5a57Smrg	m68*-cisco)
150140dd5a57Smrg		os=-aout
150240dd5a57Smrg		;;
150340dd5a57Smrg        mep-*)
150440dd5a57Smrg		os=-elf
150540dd5a57Smrg		;;
150640dd5a57Smrg	mips*-cisco)
150740dd5a57Smrg		os=-elf
150840dd5a57Smrg		;;
150940dd5a57Smrg	mips*-*)
151040dd5a57Smrg		os=-elf
151140dd5a57Smrg		;;
151240dd5a57Smrg	or32-*)
151340dd5a57Smrg		os=-coff
151440dd5a57Smrg		;;
151540dd5a57Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
151640dd5a57Smrg		os=-sysv3
151740dd5a57Smrg		;;
151840dd5a57Smrg	sparc-* | *-sun)
151940dd5a57Smrg		os=-sunos4.1.1
152040dd5a57Smrg		;;
152140dd5a57Smrg	*-be)
152240dd5a57Smrg		os=-beos
152340dd5a57Smrg		;;
152440dd5a57Smrg	*-haiku)
152540dd5a57Smrg		os=-haiku
152640dd5a57Smrg		;;
152740dd5a57Smrg	*-ibm)
152840dd5a57Smrg		os=-aix
152940dd5a57Smrg		;;
153040dd5a57Smrg    	*-knuth)
153140dd5a57Smrg		os=-mmixware
153240dd5a57Smrg		;;
153340dd5a57Smrg	*-wec)
153440dd5a57Smrg		os=-proelf
153540dd5a57Smrg		;;
153640dd5a57Smrg	*-winbond)
153740dd5a57Smrg		os=-proelf
153840dd5a57Smrg		;;
153940dd5a57Smrg	*-oki)
154040dd5a57Smrg		os=-proelf
154140dd5a57Smrg		;;
154240dd5a57Smrg	*-hp)
154340dd5a57Smrg		os=-hpux
154440dd5a57Smrg		;;
154540dd5a57Smrg	*-hitachi)
154640dd5a57Smrg		os=-hiux
154740dd5a57Smrg		;;
154840dd5a57Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
154940dd5a57Smrg		os=-sysv
155040dd5a57Smrg		;;
155140dd5a57Smrg	*-cbm)
155240dd5a57Smrg		os=-amigaos
155340dd5a57Smrg		;;
155440dd5a57Smrg	*-dg)
155540dd5a57Smrg		os=-dgux
155640dd5a57Smrg		;;
155740dd5a57Smrg	*-dolphin)
155840dd5a57Smrg		os=-sysv3
155940dd5a57Smrg		;;
156040dd5a57Smrg	m68k-ccur)
156140dd5a57Smrg		os=-rtu
156240dd5a57Smrg		;;
156340dd5a57Smrg	m88k-omron*)
156440dd5a57Smrg		os=-luna
156540dd5a57Smrg		;;
156640dd5a57Smrg	*-next )
156740dd5a57Smrg		os=-nextstep
156840dd5a57Smrg		;;
156940dd5a57Smrg	*-sequent)
157040dd5a57Smrg		os=-ptx
157140dd5a57Smrg		;;
157240dd5a57Smrg	*-crds)
157340dd5a57Smrg		os=-unos
157440dd5a57Smrg		;;
157540dd5a57Smrg	*-ns)
157640dd5a57Smrg		os=-genix
157740dd5a57Smrg		;;
157840dd5a57Smrg	i370-*)
157940dd5a57Smrg		os=-mvs
158040dd5a57Smrg		;;
158140dd5a57Smrg	*-next)
158240dd5a57Smrg		os=-nextstep3
158340dd5a57Smrg		;;
158440dd5a57Smrg	*-gould)
158540dd5a57Smrg		os=-sysv
158640dd5a57Smrg		;;
158740dd5a57Smrg	*-highlevel)
158840dd5a57Smrg		os=-bsd
158940dd5a57Smrg		;;
159040dd5a57Smrg	*-encore)
159140dd5a57Smrg		os=-bsd
159240dd5a57Smrg		;;
159340dd5a57Smrg	*-sgi)
159440dd5a57Smrg		os=-irix
159540dd5a57Smrg		;;
159640dd5a57Smrg	*-siemens)
159740dd5a57Smrg		os=-sysv4
159840dd5a57Smrg		;;
159940dd5a57Smrg	*-masscomp)
160040dd5a57Smrg		os=-rtu
160140dd5a57Smrg		;;
160240dd5a57Smrg	f30[01]-fujitsu | f700-fujitsu)
160340dd5a57Smrg		os=-uxpv
160440dd5a57Smrg		;;
160540dd5a57Smrg	*-rom68k)
160640dd5a57Smrg		os=-coff
160740dd5a57Smrg		;;
160840dd5a57Smrg	*-*bug)
160940dd5a57Smrg		os=-coff
161040dd5a57Smrg		;;
161140dd5a57Smrg	*-apple)
161240dd5a57Smrg		os=-macos
161340dd5a57Smrg		;;
161440dd5a57Smrg	*-atari*)
161540dd5a57Smrg		os=-mint
161640dd5a57Smrg		;;
161740dd5a57Smrg	*)
161840dd5a57Smrg		os=-none
161940dd5a57Smrg		;;
162040dd5a57Smrgesac
162140dd5a57Smrgfi
162240dd5a57Smrg
162340dd5a57Smrg# Here we handle the case where we know the os, and the CPU type, but not the
162440dd5a57Smrg# manufacturer.  We pick the logical manufacturer.
162540dd5a57Smrgvendor=unknown
162640dd5a57Smrgcase $basic_machine in
162740dd5a57Smrg	*-unknown)
162840dd5a57Smrg		case $os in
162940dd5a57Smrg			-riscix*)
163040dd5a57Smrg				vendor=acorn
163140dd5a57Smrg				;;
163240dd5a57Smrg			-sunos*)
163340dd5a57Smrg				vendor=sun
163440dd5a57Smrg				;;
163540dd5a57Smrg			-cnk*|-aix*)
163640dd5a57Smrg				vendor=ibm
163740dd5a57Smrg				;;
163840dd5a57Smrg			-beos*)
163940dd5a57Smrg				vendor=be
164040dd5a57Smrg				;;
164140dd5a57Smrg			-hpux*)
164240dd5a57Smrg				vendor=hp
164340dd5a57Smrg				;;
164440dd5a57Smrg			-mpeix*)
164540dd5a57Smrg				vendor=hp
164640dd5a57Smrg				;;
164740dd5a57Smrg			-hiux*)
164840dd5a57Smrg				vendor=hitachi
164940dd5a57Smrg				;;
165040dd5a57Smrg			-unos*)
165140dd5a57Smrg				vendor=crds
165240dd5a57Smrg				;;
165340dd5a57Smrg			-dgux*)
165440dd5a57Smrg				vendor=dg
165540dd5a57Smrg				;;
165640dd5a57Smrg			-luna*)
165740dd5a57Smrg				vendor=omron
165840dd5a57Smrg				;;
165940dd5a57Smrg			-genix*)
166040dd5a57Smrg				vendor=ns
166140dd5a57Smrg				;;
166240dd5a57Smrg			-mvs* | -opened*)
166340dd5a57Smrg				vendor=ibm
166440dd5a57Smrg				;;
166540dd5a57Smrg			-os400*)
166640dd5a57Smrg				vendor=ibm
166740dd5a57Smrg				;;
166840dd5a57Smrg			-ptx*)
166940dd5a57Smrg				vendor=sequent
167040dd5a57Smrg				;;
167140dd5a57Smrg			-tpf*)
167240dd5a57Smrg				vendor=ibm
167340dd5a57Smrg				;;
167440dd5a57Smrg			-vxsim* | -vxworks* | -windiss*)
167540dd5a57Smrg				vendor=wrs
167640dd5a57Smrg				;;
167740dd5a57Smrg			-aux*)
167840dd5a57Smrg				vendor=apple
167940dd5a57Smrg				;;
168040dd5a57Smrg			-hms*)
168140dd5a57Smrg				vendor=hitachi
168240dd5a57Smrg				;;
168340dd5a57Smrg			-mpw* | -macos*)
168440dd5a57Smrg				vendor=apple
168540dd5a57Smrg				;;
168640dd5a57Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
168740dd5a57Smrg				vendor=atari
168840dd5a57Smrg				;;
168940dd5a57Smrg			-vos*)
169040dd5a57Smrg				vendor=stratus
169140dd5a57Smrg				;;
169240dd5a57Smrg		esac
169340dd5a57Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
169440dd5a57Smrg		;;
169540dd5a57Smrgesac
169640dd5a57Smrg
169740dd5a57Smrgecho $basic_machine$os
169840dd5a57Smrgexit
169940dd5a57Smrg
170040dd5a57Smrg# Local variables:
170140dd5a57Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
170240dd5a57Smrg# time-stamp-start: "timestamp='"
170340dd5a57Smrg# time-stamp-format: "%:y-%02m-%02d"
170440dd5a57Smrg# time-stamp-end: "'"
170540dd5a57Smrg# End:
1706