152f9793fSmrg#! /bin/sh
252f9793fSmrg# Configuration validation subroutine script.
352f9793fSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
42faa96e0Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
52faa96e0Smrg#   Free Software Foundation, Inc.
652f9793fSmrg
72faa96e0Smrgtimestamp='2008-01-16'
852f9793fSmrg
952f9793fSmrg# This file is (in principle) common to ALL GNU software.
1052f9793fSmrg# The presence of a machine in this file suggests that SOME GNU software
1152f9793fSmrg# can handle that machine.  It does not imply ALL GNU software can.
1252f9793fSmrg#
1352f9793fSmrg# This file is free software; you can redistribute it and/or modify
1452f9793fSmrg# it under the terms of the GNU General Public License as published by
1552f9793fSmrg# the Free Software Foundation; either version 2 of the License, or
1652f9793fSmrg# (at your option) any later version.
1752f9793fSmrg#
1852f9793fSmrg# This program is distributed in the hope that it will be useful,
1952f9793fSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
2052f9793fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2152f9793fSmrg# GNU General Public License for more details.
2252f9793fSmrg#
2352f9793fSmrg# You should have received a copy of the GNU General Public License
2452f9793fSmrg# along with this program; if not, write to the Free Software
2552f9793fSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2652f9793fSmrg# 02110-1301, USA.
2752f9793fSmrg#
2852f9793fSmrg# As a special exception to the GNU General Public License, if you
2952f9793fSmrg# distribute this file as part of a program that contains a
3052f9793fSmrg# configuration script generated by Autoconf, you may include it under
3152f9793fSmrg# the same distribution terms that you use for the rest of that program.
3252f9793fSmrg
3352f9793fSmrg
3452f9793fSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3552f9793fSmrg# diff and a properly formatted ChangeLog entry.
3652f9793fSmrg#
3752f9793fSmrg# Configuration subroutine to validate and canonicalize a configuration type.
3852f9793fSmrg# Supply the specified configuration type as an argument.
3952f9793fSmrg# If it is invalid, we print an error message on stderr and exit with code 1.
4052f9793fSmrg# Otherwise, we print the canonical config type on stdout and succeed.
4152f9793fSmrg
4252f9793fSmrg# This file is supposed to be the same for all GNU packages
4352f9793fSmrg# and recognize all the CPU types, system types and aliases
4452f9793fSmrg# that are meaningful with *any* GNU software.
4552f9793fSmrg# Each package is responsible for reporting which valid configurations
4652f9793fSmrg# it does not support.  The user should be able to distinguish
4752f9793fSmrg# a failure to support a valid configuration from a meaningless
4852f9793fSmrg# configuration.
4952f9793fSmrg
5052f9793fSmrg# The goal of this file is to map all the various variations of a given
5152f9793fSmrg# machine specification into a single specification in the form:
5252f9793fSmrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5352f9793fSmrg# or in some cases, the newer four-part form:
5452f9793fSmrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5552f9793fSmrg# It is wrong to echo any other type of specification.
5652f9793fSmrg
5752f9793fSmrgme=`echo "$0" | sed -e 's,.*/,,'`
5852f9793fSmrg
5952f9793fSmrgusage="\
6052f9793fSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
6152f9793fSmrg       $0 [OPTION] ALIAS
6252f9793fSmrg
6352f9793fSmrgCanonicalize a configuration name.
6452f9793fSmrg
6552f9793fSmrgOperation modes:
6652f9793fSmrg  -h, --help         print this help, then exit
6752f9793fSmrg  -t, --time-stamp   print date of last modification, then exit
6852f9793fSmrg  -v, --version      print version number, then exit
6952f9793fSmrg
7052f9793fSmrgReport bugs and patches to <config-patches@gnu.org>."
7152f9793fSmrg
7252f9793fSmrgversion="\
7352f9793fSmrgGNU config.sub ($timestamp)
7452f9793fSmrg
752faa96e0SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
762faa96e0Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
7752f9793fSmrg
7852f9793fSmrgThis is free software; see the source for copying conditions.  There is NO
7952f9793fSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8052f9793fSmrg
8152f9793fSmrghelp="
8252f9793fSmrgTry \`$me --help' for more information."
8352f9793fSmrg
8452f9793fSmrg# Parse command line
8552f9793fSmrgwhile test $# -gt 0 ; do
8652f9793fSmrg  case $1 in
8752f9793fSmrg    --time-stamp | --time* | -t )
8852f9793fSmrg       echo "$timestamp" ; exit ;;
8952f9793fSmrg    --version | -v )
9052f9793fSmrg       echo "$version" ; exit ;;
9152f9793fSmrg    --help | --h* | -h )
9252f9793fSmrg       echo "$usage"; exit ;;
9352f9793fSmrg    -- )     # Stop option processing
9452f9793fSmrg       shift; break ;;
9552f9793fSmrg    - )	# Use stdin as input.
9652f9793fSmrg       break ;;
9752f9793fSmrg    -* )
9852f9793fSmrg       echo "$me: invalid option $1$help"
9952f9793fSmrg       exit 1 ;;
10052f9793fSmrg
10152f9793fSmrg    *local*)
10252f9793fSmrg       # First pass through any local machine types.
10352f9793fSmrg       echo $1
10452f9793fSmrg       exit ;;
10552f9793fSmrg
10652f9793fSmrg    * )
10752f9793fSmrg       break ;;
10852f9793fSmrg  esac
10952f9793fSmrgdone
11052f9793fSmrg
11152f9793fSmrgcase $# in
11252f9793fSmrg 0) echo "$me: missing argument$help" >&2
11352f9793fSmrg    exit 1;;
11452f9793fSmrg 1) ;;
11552f9793fSmrg *) echo "$me: too many arguments$help" >&2
11652f9793fSmrg    exit 1;;
11752f9793fSmrgesac
11852f9793fSmrg
11952f9793fSmrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
12052f9793fSmrg# Here we must recognize all the valid KERNEL-OS combinations.
12152f9793fSmrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12252f9793fSmrgcase $maybe_os in
12352f9793fSmrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
12452f9793fSmrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
12552f9793fSmrg  storm-chaos* | os2-emx* | rtmk-nova*)
12652f9793fSmrg    os=-$maybe_os
12752f9793fSmrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
12852f9793fSmrg    ;;
12952f9793fSmrg  *)
13052f9793fSmrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13152f9793fSmrg    if [ $basic_machine != $1 ]
13252f9793fSmrg    then os=`echo $1 | sed 's/.*-/-/'`
13352f9793fSmrg    else os=; fi
13452f9793fSmrg    ;;
13552f9793fSmrgesac
13652f9793fSmrg
13752f9793fSmrg### Let's recognize common machines as not being operating systems so
13852f9793fSmrg### that things like config.sub decstation-3100 work.  We also
13952f9793fSmrg### recognize some manufacturers as not being operating systems, so we
14052f9793fSmrg### can provide default operating systems below.
14152f9793fSmrgcase $os in
14252f9793fSmrg	-sun*os*)
14352f9793fSmrg		# Prevent following clause from handling this invalid input.
14452f9793fSmrg		;;
14552f9793fSmrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
14652f9793fSmrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
14752f9793fSmrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
14852f9793fSmrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
14952f9793fSmrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15052f9793fSmrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15152f9793fSmrg	-apple | -axis | -knuth | -cray)
15252f9793fSmrg		os=
15352f9793fSmrg		basic_machine=$1
15452f9793fSmrg		;;
15552f9793fSmrg	-sim | -cisco | -oki | -wec | -winbond)
15652f9793fSmrg		os=
15752f9793fSmrg		basic_machine=$1
15852f9793fSmrg		;;
15952f9793fSmrg	-scout)
16052f9793fSmrg		;;
16152f9793fSmrg	-wrs)
16252f9793fSmrg		os=-vxworks
16352f9793fSmrg		basic_machine=$1
16452f9793fSmrg		;;
16552f9793fSmrg	-chorusos*)
16652f9793fSmrg		os=-chorusos
16752f9793fSmrg		basic_machine=$1
16852f9793fSmrg		;;
16952f9793fSmrg 	-chorusrdb)
17052f9793fSmrg 		os=-chorusrdb
17152f9793fSmrg		basic_machine=$1
17252f9793fSmrg 		;;
17352f9793fSmrg	-hiux*)
17452f9793fSmrg		os=-hiuxwe2
17552f9793fSmrg		;;
17652f9793fSmrg	-sco6)
17752f9793fSmrg		os=-sco5v6
17852f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
17952f9793fSmrg		;;
18052f9793fSmrg	-sco5)
18152f9793fSmrg		os=-sco3.2v5
18252f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18352f9793fSmrg		;;
18452f9793fSmrg	-sco4)
18552f9793fSmrg		os=-sco3.2v4
18652f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18752f9793fSmrg		;;
18852f9793fSmrg	-sco3.2.[4-9]*)
18952f9793fSmrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19052f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19152f9793fSmrg		;;
19252f9793fSmrg	-sco3.2v[4-9]*)
19352f9793fSmrg		# Don't forget version if it is 3.2v4 or newer.
19452f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19552f9793fSmrg		;;
19652f9793fSmrg	-sco5v6*)
19752f9793fSmrg		# Don't forget version if it is 3.2v4 or newer.
19852f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19952f9793fSmrg		;;
20052f9793fSmrg	-sco*)
20152f9793fSmrg		os=-sco3.2v2
20252f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20352f9793fSmrg		;;
20452f9793fSmrg	-udk*)
20552f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20652f9793fSmrg		;;
20752f9793fSmrg	-isc)
20852f9793fSmrg		os=-isc2.2
20952f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21052f9793fSmrg		;;
21152f9793fSmrg	-clix*)
21252f9793fSmrg		basic_machine=clipper-intergraph
21352f9793fSmrg		;;
21452f9793fSmrg	-isc*)
21552f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21652f9793fSmrg		;;
21752f9793fSmrg	-lynx*)
21852f9793fSmrg		os=-lynxos
21952f9793fSmrg		;;
22052f9793fSmrg	-ptx*)
22152f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
22252f9793fSmrg		;;
22352f9793fSmrg	-windowsnt*)
22452f9793fSmrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
22552f9793fSmrg		;;
22652f9793fSmrg	-psos*)
22752f9793fSmrg		os=-psos
22852f9793fSmrg		;;
22952f9793fSmrg	-mint | -mint[0-9]*)
23052f9793fSmrg		basic_machine=m68k-atari
23152f9793fSmrg		os=-mint
23252f9793fSmrg		;;
23352f9793fSmrgesac
23452f9793fSmrg
23552f9793fSmrg# Decode aliases for certain CPU-COMPANY combinations.
23652f9793fSmrgcase $basic_machine in
23752f9793fSmrg	# Recognize the basic CPU types without company name.
23852f9793fSmrg	# Some are omitted here because they have special meanings below.
23952f9793fSmrg	1750a | 580 \
24052f9793fSmrg	| a29k \
24152f9793fSmrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
24252f9793fSmrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
24352f9793fSmrg	| am33_2.0 \
2442faa96e0Smrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
24552f9793fSmrg	| bfin \
24652f9793fSmrg	| c4x | clipper \
24752f9793fSmrg	| d10v | d30v | dlx | dsp16xx \
2482faa96e0Smrg	| fido | fr30 | frv \
24952f9793fSmrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
25052f9793fSmrg	| i370 | i860 | i960 | ia64 \
25152f9793fSmrg	| ip2k | iq2000 \
2522faa96e0Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2532faa96e0Smrg	| maxq | mb | microblaze | mcore | mep \
25452f9793fSmrg	| mips | mipsbe | mipseb | mipsel | mipsle \
25552f9793fSmrg	| mips16 \
25652f9793fSmrg	| mips64 | mips64el \
25752f9793fSmrg	| mips64vr | mips64vrel \
25852f9793fSmrg	| mips64orion | mips64orionel \
25952f9793fSmrg	| mips64vr4100 | mips64vr4100el \
26052f9793fSmrg	| mips64vr4300 | mips64vr4300el \
26152f9793fSmrg	| mips64vr5000 | mips64vr5000el \
26252f9793fSmrg	| mips64vr5900 | mips64vr5900el \
26352f9793fSmrg	| mipsisa32 | mipsisa32el \
26452f9793fSmrg	| mipsisa32r2 | mipsisa32r2el \
26552f9793fSmrg	| mipsisa64 | mipsisa64el \
26652f9793fSmrg	| mipsisa64r2 | mipsisa64r2el \
26752f9793fSmrg	| mipsisa64sb1 | mipsisa64sb1el \
26852f9793fSmrg	| mipsisa64sr71k | mipsisa64sr71kel \
26952f9793fSmrg	| mipstx39 | mipstx39el \
27052f9793fSmrg	| mn10200 | mn10300 \
27152f9793fSmrg	| mt \
27252f9793fSmrg	| msp430 \
27352f9793fSmrg	| nios | nios2 \
27452f9793fSmrg	| ns16k | ns32k \
27552f9793fSmrg	| or32 \
27652f9793fSmrg	| pdp10 | pdp11 | pj | pjl \
27752f9793fSmrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
27852f9793fSmrg	| pyramid \
2792faa96e0Smrg	| score \
2802faa96e0Smrg	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
28152f9793fSmrg	| sh64 | sh64le \
2822faa96e0Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
2832faa96e0Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
2842faa96e0Smrg	| spu | strongarm \
28552f9793fSmrg	| tahoe | thumb | tic4x | tic80 | tron \
28652f9793fSmrg	| v850 | v850e \
28752f9793fSmrg	| we32k \
2882faa96e0Smrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
28952f9793fSmrg	| z8k)
29052f9793fSmrg		basic_machine=$basic_machine-unknown
29152f9793fSmrg		;;
29252f9793fSmrg	m6811 | m68hc11 | m6812 | m68hc12)
29352f9793fSmrg		# Motorola 68HC11/12.
29452f9793fSmrg		basic_machine=$basic_machine-unknown
29552f9793fSmrg		os=-none
29652f9793fSmrg		;;
29752f9793fSmrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
29852f9793fSmrg		;;
29952f9793fSmrg	ms1)
30052f9793fSmrg		basic_machine=mt-unknown
30152f9793fSmrg		;;
30252f9793fSmrg
30352f9793fSmrg	# We use `pc' rather than `unknown'
30452f9793fSmrg	# because (1) that's what they normally are, and
30552f9793fSmrg	# (2) the word "unknown" tends to confuse beginning users.
30652f9793fSmrg	i*86 | x86_64)
30752f9793fSmrg	  basic_machine=$basic_machine-pc
30852f9793fSmrg	  ;;
30952f9793fSmrg	# Object if more than one company name word.
31052f9793fSmrg	*-*-*)
31152f9793fSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
31252f9793fSmrg		exit 1
31352f9793fSmrg		;;
31452f9793fSmrg	# Recognize the basic CPU types with company name.
31552f9793fSmrg	580-* \
31652f9793fSmrg	| a29k-* \
31752f9793fSmrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
31852f9793fSmrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
31952f9793fSmrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
32052f9793fSmrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
3212faa96e0Smrg	| avr-* | avr32-* \
32252f9793fSmrg	| bfin-* | bs2000-* \
32352f9793fSmrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
32452f9793fSmrg	| clipper-* | craynv-* | cydra-* \
32552f9793fSmrg	| d10v-* | d30v-* | dlx-* \
32652f9793fSmrg	| elxsi-* \
3272faa96e0Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
32852f9793fSmrg	| h8300-* | h8500-* \
32952f9793fSmrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
33052f9793fSmrg	| i*86-* | i860-* | i960-* | ia64-* \
33152f9793fSmrg	| ip2k-* | iq2000-* \
3322faa96e0Smrg	| m32c-* | m32r-* | m32rle-* \
33352f9793fSmrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
33452f9793fSmrg	| m88110-* | m88k-* | maxq-* | mcore-* \
33552f9793fSmrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
33652f9793fSmrg	| mips16-* \
33752f9793fSmrg	| mips64-* | mips64el-* \
33852f9793fSmrg	| mips64vr-* | mips64vrel-* \
33952f9793fSmrg	| mips64orion-* | mips64orionel-* \
34052f9793fSmrg	| mips64vr4100-* | mips64vr4100el-* \
34152f9793fSmrg	| mips64vr4300-* | mips64vr4300el-* \
34252f9793fSmrg	| mips64vr5000-* | mips64vr5000el-* \
34352f9793fSmrg	| mips64vr5900-* | mips64vr5900el-* \
34452f9793fSmrg	| mipsisa32-* | mipsisa32el-* \
34552f9793fSmrg	| mipsisa32r2-* | mipsisa32r2el-* \
34652f9793fSmrg	| mipsisa64-* | mipsisa64el-* \
34752f9793fSmrg	| mipsisa64r2-* | mipsisa64r2el-* \
34852f9793fSmrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
34952f9793fSmrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
35052f9793fSmrg	| mipstx39-* | mipstx39el-* \
35152f9793fSmrg	| mmix-* \
35252f9793fSmrg	| mt-* \
35352f9793fSmrg	| msp430-* \
35452f9793fSmrg	| nios-* | nios2-* \
35552f9793fSmrg	| none-* | np1-* | ns16k-* | ns32k-* \
35652f9793fSmrg	| orion-* \
35752f9793fSmrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
35852f9793fSmrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
35952f9793fSmrg	| pyramid-* \
36052f9793fSmrg	| romp-* | rs6000-* \
3612faa96e0Smrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
36252f9793fSmrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
3632faa96e0Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
36452f9793fSmrg	| sparclite-* \
3652faa96e0Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
36652f9793fSmrg	| tahoe-* | thumb-* \
36752f9793fSmrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
36852f9793fSmrg	| tron-* \
36952f9793fSmrg	| v850-* | v850e-* | vax-* \
37052f9793fSmrg	| we32k-* \
3712faa96e0Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
3722faa96e0Smrg	| xstormy16-* | xtensa*-* \
37352f9793fSmrg	| ymp-* \
37452f9793fSmrg	| z8k-*)
37552f9793fSmrg		;;
3762faa96e0Smrg	# Recognize the basic CPU types without company name, with glob match.
3772faa96e0Smrg	xtensa*)
3782faa96e0Smrg		basic_machine=$basic_machine-unknown
37952f9793fSmrg		;;
38052f9793fSmrg	# Recognize the various machine names and aliases which stand
38152f9793fSmrg	# for a CPU type and a company and sometimes even an OS.
38252f9793fSmrg	386bsd)
38352f9793fSmrg		basic_machine=i386-unknown
38452f9793fSmrg		os=-bsd
38552f9793fSmrg		;;
38652f9793fSmrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
38752f9793fSmrg		basic_machine=m68000-att
38852f9793fSmrg		;;
38952f9793fSmrg	3b*)
39052f9793fSmrg		basic_machine=we32k-att
39152f9793fSmrg		;;
39252f9793fSmrg	a29khif)
39352f9793fSmrg		basic_machine=a29k-amd
39452f9793fSmrg		os=-udi
39552f9793fSmrg		;;
39652f9793fSmrg    	abacus)
39752f9793fSmrg		basic_machine=abacus-unknown
39852f9793fSmrg		;;
39952f9793fSmrg	adobe68k)
40052f9793fSmrg		basic_machine=m68010-adobe
40152f9793fSmrg		os=-scout
40252f9793fSmrg		;;
40352f9793fSmrg	alliant | fx80)
40452f9793fSmrg		basic_machine=fx80-alliant
40552f9793fSmrg		;;
40652f9793fSmrg	altos | altos3068)
40752f9793fSmrg		basic_machine=m68k-altos
40852f9793fSmrg		;;
40952f9793fSmrg	am29k)
41052f9793fSmrg		basic_machine=a29k-none
41152f9793fSmrg		os=-bsd
41252f9793fSmrg		;;
41352f9793fSmrg	amd64)
41452f9793fSmrg		basic_machine=x86_64-pc
41552f9793fSmrg		;;
41652f9793fSmrg	amd64-*)
41752f9793fSmrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
41852f9793fSmrg		;;
41952f9793fSmrg	amdahl)
42052f9793fSmrg		basic_machine=580-amdahl
42152f9793fSmrg		os=-sysv
42252f9793fSmrg		;;
42352f9793fSmrg	amiga | amiga-*)
42452f9793fSmrg		basic_machine=m68k-unknown
42552f9793fSmrg		;;
42652f9793fSmrg	amigaos | amigados)
42752f9793fSmrg		basic_machine=m68k-unknown
42852f9793fSmrg		os=-amigaos
42952f9793fSmrg		;;
43052f9793fSmrg	amigaunix | amix)
43152f9793fSmrg		basic_machine=m68k-unknown
43252f9793fSmrg		os=-sysv4
43352f9793fSmrg		;;
43452f9793fSmrg	apollo68)
43552f9793fSmrg		basic_machine=m68k-apollo
43652f9793fSmrg		os=-sysv
43752f9793fSmrg		;;
43852f9793fSmrg	apollo68bsd)
43952f9793fSmrg		basic_machine=m68k-apollo
44052f9793fSmrg		os=-bsd
44152f9793fSmrg		;;
44252f9793fSmrg	aux)
44352f9793fSmrg		basic_machine=m68k-apple
44452f9793fSmrg		os=-aux
44552f9793fSmrg		;;
44652f9793fSmrg	balance)
44752f9793fSmrg		basic_machine=ns32k-sequent
44852f9793fSmrg		os=-dynix
44952f9793fSmrg		;;
4502faa96e0Smrg	blackfin)
4512faa96e0Smrg		basic_machine=bfin-unknown
4522faa96e0Smrg		os=-linux
4532faa96e0Smrg		;;
4542faa96e0Smrg	blackfin-*)
4552faa96e0Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
4562faa96e0Smrg		os=-linux
4572faa96e0Smrg		;;
45852f9793fSmrg	c90)
45952f9793fSmrg		basic_machine=c90-cray
46052f9793fSmrg		os=-unicos
46152f9793fSmrg		;;
46252f9793fSmrg	convex-c1)
46352f9793fSmrg		basic_machine=c1-convex
46452f9793fSmrg		os=-bsd
46552f9793fSmrg		;;
46652f9793fSmrg	convex-c2)
46752f9793fSmrg		basic_machine=c2-convex
46852f9793fSmrg		os=-bsd
46952f9793fSmrg		;;
47052f9793fSmrg	convex-c32)
47152f9793fSmrg		basic_machine=c32-convex
47252f9793fSmrg		os=-bsd
47352f9793fSmrg		;;
47452f9793fSmrg	convex-c34)
47552f9793fSmrg		basic_machine=c34-convex
47652f9793fSmrg		os=-bsd
47752f9793fSmrg		;;
47852f9793fSmrg	convex-c38)
47952f9793fSmrg		basic_machine=c38-convex
48052f9793fSmrg		os=-bsd
48152f9793fSmrg		;;
48252f9793fSmrg	cray | j90)
48352f9793fSmrg		basic_machine=j90-cray
48452f9793fSmrg		os=-unicos
48552f9793fSmrg		;;
48652f9793fSmrg	craynv)
48752f9793fSmrg		basic_machine=craynv-cray
48852f9793fSmrg		os=-unicosmp
48952f9793fSmrg		;;
4902faa96e0Smrg	cr16)
4912faa96e0Smrg		basic_machine=cr16-unknown
49252f9793fSmrg		os=-elf
49352f9793fSmrg		;;
49452f9793fSmrg	crds | unos)
49552f9793fSmrg		basic_machine=m68k-crds
49652f9793fSmrg		;;
49752f9793fSmrg	crisv32 | crisv32-* | etraxfs*)
49852f9793fSmrg		basic_machine=crisv32-axis
49952f9793fSmrg		;;
50052f9793fSmrg	cris | cris-* | etrax*)
50152f9793fSmrg		basic_machine=cris-axis
50252f9793fSmrg		;;
50352f9793fSmrg	crx)
50452f9793fSmrg		basic_machine=crx-unknown
50552f9793fSmrg		os=-elf
50652f9793fSmrg		;;
50752f9793fSmrg	da30 | da30-*)
50852f9793fSmrg		basic_machine=m68k-da30
50952f9793fSmrg		;;
51052f9793fSmrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
51152f9793fSmrg		basic_machine=mips-dec
51252f9793fSmrg		;;
51352f9793fSmrg	decsystem10* | dec10*)
51452f9793fSmrg		basic_machine=pdp10-dec
51552f9793fSmrg		os=-tops10
51652f9793fSmrg		;;
51752f9793fSmrg	decsystem20* | dec20*)
51852f9793fSmrg		basic_machine=pdp10-dec
51952f9793fSmrg		os=-tops20
52052f9793fSmrg		;;
52152f9793fSmrg	delta | 3300 | motorola-3300 | motorola-delta \
52252f9793fSmrg	      | 3300-motorola | delta-motorola)
52352f9793fSmrg		basic_machine=m68k-motorola
52452f9793fSmrg		;;
52552f9793fSmrg	delta88)
52652f9793fSmrg		basic_machine=m88k-motorola
52752f9793fSmrg		os=-sysv3
52852f9793fSmrg		;;
52952f9793fSmrg	djgpp)
53052f9793fSmrg		basic_machine=i586-pc
53152f9793fSmrg		os=-msdosdjgpp
53252f9793fSmrg		;;
53352f9793fSmrg	dpx20 | dpx20-*)
53452f9793fSmrg		basic_machine=rs6000-bull
53552f9793fSmrg		os=-bosx
53652f9793fSmrg		;;
53752f9793fSmrg	dpx2* | dpx2*-bull)
53852f9793fSmrg		basic_machine=m68k-bull
53952f9793fSmrg		os=-sysv3
54052f9793fSmrg		;;
54152f9793fSmrg	ebmon29k)
54252f9793fSmrg		basic_machine=a29k-amd
54352f9793fSmrg		os=-ebmon
54452f9793fSmrg		;;
54552f9793fSmrg	elxsi)
54652f9793fSmrg		basic_machine=elxsi-elxsi
54752f9793fSmrg		os=-bsd
54852f9793fSmrg		;;
54952f9793fSmrg	encore | umax | mmax)
55052f9793fSmrg		basic_machine=ns32k-encore
55152f9793fSmrg		;;
55252f9793fSmrg	es1800 | OSE68k | ose68k | ose | OSE)
55352f9793fSmrg		basic_machine=m68k-ericsson
55452f9793fSmrg		os=-ose
55552f9793fSmrg		;;
55652f9793fSmrg	fx2800)
55752f9793fSmrg		basic_machine=i860-alliant
55852f9793fSmrg		;;
55952f9793fSmrg	genix)
56052f9793fSmrg		basic_machine=ns32k-ns
56152f9793fSmrg		;;
56252f9793fSmrg	gmicro)
56352f9793fSmrg		basic_machine=tron-gmicro
56452f9793fSmrg		os=-sysv
56552f9793fSmrg		;;
56652f9793fSmrg	go32)
56752f9793fSmrg		basic_machine=i386-pc
56852f9793fSmrg		os=-go32
56952f9793fSmrg		;;
57052f9793fSmrg	h3050r* | hiux*)
57152f9793fSmrg		basic_machine=hppa1.1-hitachi
57252f9793fSmrg		os=-hiuxwe2
57352f9793fSmrg		;;
57452f9793fSmrg	h8300hms)
57552f9793fSmrg		basic_machine=h8300-hitachi
57652f9793fSmrg		os=-hms
57752f9793fSmrg		;;
57852f9793fSmrg	h8300xray)
57952f9793fSmrg		basic_machine=h8300-hitachi
58052f9793fSmrg		os=-xray
58152f9793fSmrg		;;
58252f9793fSmrg	h8500hms)
58352f9793fSmrg		basic_machine=h8500-hitachi
58452f9793fSmrg		os=-hms
58552f9793fSmrg		;;
58652f9793fSmrg	harris)
58752f9793fSmrg		basic_machine=m88k-harris
58852f9793fSmrg		os=-sysv3
58952f9793fSmrg		;;
59052f9793fSmrg	hp300-*)
59152f9793fSmrg		basic_machine=m68k-hp
59252f9793fSmrg		;;
59352f9793fSmrg	hp300bsd)
59452f9793fSmrg		basic_machine=m68k-hp
59552f9793fSmrg		os=-bsd
59652f9793fSmrg		;;
59752f9793fSmrg	hp300hpux)
59852f9793fSmrg		basic_machine=m68k-hp
59952f9793fSmrg		os=-hpux
60052f9793fSmrg		;;
60152f9793fSmrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
60252f9793fSmrg		basic_machine=hppa1.0-hp
60352f9793fSmrg		;;
60452f9793fSmrg	hp9k2[0-9][0-9] | hp9k31[0-9])
60552f9793fSmrg		basic_machine=m68000-hp
60652f9793fSmrg		;;
60752f9793fSmrg	hp9k3[2-9][0-9])
60852f9793fSmrg		basic_machine=m68k-hp
60952f9793fSmrg		;;
61052f9793fSmrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
61152f9793fSmrg		basic_machine=hppa1.0-hp
61252f9793fSmrg		;;
61352f9793fSmrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
61452f9793fSmrg		basic_machine=hppa1.1-hp
61552f9793fSmrg		;;
61652f9793fSmrg	hp9k78[0-9] | hp78[0-9])
61752f9793fSmrg		# FIXME: really hppa2.0-hp
61852f9793fSmrg		basic_machine=hppa1.1-hp
61952f9793fSmrg		;;
62052f9793fSmrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
62152f9793fSmrg		# FIXME: really hppa2.0-hp
62252f9793fSmrg		basic_machine=hppa1.1-hp
62352f9793fSmrg		;;
62452f9793fSmrg	hp9k8[0-9][13679] | hp8[0-9][13679])
62552f9793fSmrg		basic_machine=hppa1.1-hp
62652f9793fSmrg		;;
62752f9793fSmrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
62852f9793fSmrg		basic_machine=hppa1.0-hp
62952f9793fSmrg		;;
63052f9793fSmrg	hppa-next)
63152f9793fSmrg		os=-nextstep3
63252f9793fSmrg		;;
63352f9793fSmrg	hppaosf)
63452f9793fSmrg		basic_machine=hppa1.1-hp
63552f9793fSmrg		os=-osf
63652f9793fSmrg		;;
63752f9793fSmrg	hppro)
63852f9793fSmrg		basic_machine=hppa1.1-hp
63952f9793fSmrg		os=-proelf
64052f9793fSmrg		;;
64152f9793fSmrg	i370-ibm* | ibm*)
64252f9793fSmrg		basic_machine=i370-ibm
64352f9793fSmrg		;;
64452f9793fSmrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
64552f9793fSmrg	i*86v32)
64652f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
64752f9793fSmrg		os=-sysv32
64852f9793fSmrg		;;
64952f9793fSmrg	i*86v4*)
65052f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
65152f9793fSmrg		os=-sysv4
65252f9793fSmrg		;;
65352f9793fSmrg	i*86v)
65452f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
65552f9793fSmrg		os=-sysv
65652f9793fSmrg		;;
65752f9793fSmrg	i*86sol2)
65852f9793fSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
65952f9793fSmrg		os=-solaris2
66052f9793fSmrg		;;
66152f9793fSmrg	i386mach)
66252f9793fSmrg		basic_machine=i386-mach
66352f9793fSmrg		os=-mach
66452f9793fSmrg		;;
66552f9793fSmrg	i386-vsta | vsta)
66652f9793fSmrg		basic_machine=i386-unknown
66752f9793fSmrg		os=-vsta
66852f9793fSmrg		;;
66952f9793fSmrg	iris | iris4d)
67052f9793fSmrg		basic_machine=mips-sgi
67152f9793fSmrg		case $os in
67252f9793fSmrg		    -irix*)
67352f9793fSmrg			;;
67452f9793fSmrg		    *)
67552f9793fSmrg			os=-irix4
67652f9793fSmrg			;;
67752f9793fSmrg		esac
67852f9793fSmrg		;;
67952f9793fSmrg	isi68 | isi)
68052f9793fSmrg		basic_machine=m68k-isi
68152f9793fSmrg		os=-sysv
68252f9793fSmrg		;;
6832faa96e0Smrg	m68knommu)
6842faa96e0Smrg		basic_machine=m68k-unknown
6852faa96e0Smrg		os=-linux
6862faa96e0Smrg		;;
6872faa96e0Smrg	m68knommu-*)
6882faa96e0Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
6892faa96e0Smrg		os=-linux
6902faa96e0Smrg		;;
69152f9793fSmrg	m88k-omron*)
69252f9793fSmrg		basic_machine=m88k-omron
69352f9793fSmrg		;;
69452f9793fSmrg	magnum | m3230)
69552f9793fSmrg		basic_machine=mips-mips
69652f9793fSmrg		os=-sysv
69752f9793fSmrg		;;
69852f9793fSmrg	merlin)
69952f9793fSmrg		basic_machine=ns32k-utek
70052f9793fSmrg		os=-sysv
70152f9793fSmrg		;;
70252f9793fSmrg	mingw32)
70352f9793fSmrg		basic_machine=i386-pc
70452f9793fSmrg		os=-mingw32
70552f9793fSmrg		;;
7062faa96e0Smrg	mingw32ce)
7072faa96e0Smrg		basic_machine=arm-unknown
7082faa96e0Smrg		os=-mingw32ce
7092faa96e0Smrg		;;
71052f9793fSmrg	miniframe)
71152f9793fSmrg		basic_machine=m68000-convergent
71252f9793fSmrg		;;
71352f9793fSmrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
71452f9793fSmrg		basic_machine=m68k-atari
71552f9793fSmrg		os=-mint
71652f9793fSmrg		;;
71752f9793fSmrg	mips3*-*)
71852f9793fSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
71952f9793fSmrg		;;
72052f9793fSmrg	mips3*)
72152f9793fSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
72252f9793fSmrg		;;
72352f9793fSmrg	monitor)
72452f9793fSmrg		basic_machine=m68k-rom68k
72552f9793fSmrg		os=-coff
72652f9793fSmrg		;;
72752f9793fSmrg	morphos)
72852f9793fSmrg		basic_machine=powerpc-unknown
72952f9793fSmrg		os=-morphos
73052f9793fSmrg		;;
73152f9793fSmrg	msdos)
73252f9793fSmrg		basic_machine=i386-pc
73352f9793fSmrg		os=-msdos
73452f9793fSmrg		;;
73552f9793fSmrg	ms1-*)
73652f9793fSmrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
73752f9793fSmrg		;;
73852f9793fSmrg	mvs)
73952f9793fSmrg		basic_machine=i370-ibm
74052f9793fSmrg		os=-mvs
74152f9793fSmrg		;;
74252f9793fSmrg	ncr3000)
74352f9793fSmrg		basic_machine=i486-ncr
74452f9793fSmrg		os=-sysv4
74552f9793fSmrg		;;
74652f9793fSmrg	netbsd386)
74752f9793fSmrg		basic_machine=i386-unknown
74852f9793fSmrg		os=-netbsd
74952f9793fSmrg		;;
75052f9793fSmrg	netwinder)
75152f9793fSmrg		basic_machine=armv4l-rebel
75252f9793fSmrg		os=-linux
75352f9793fSmrg		;;
75452f9793fSmrg	news | news700 | news800 | news900)
75552f9793fSmrg		basic_machine=m68k-sony
75652f9793fSmrg		os=-newsos
75752f9793fSmrg		;;
75852f9793fSmrg	news1000)
75952f9793fSmrg		basic_machine=m68030-sony
76052f9793fSmrg		os=-newsos
76152f9793fSmrg		;;
76252f9793fSmrg	news-3600 | risc-news)
76352f9793fSmrg		basic_machine=mips-sony
76452f9793fSmrg		os=-newsos
76552f9793fSmrg		;;
76652f9793fSmrg	necv70)
76752f9793fSmrg		basic_machine=v70-nec
76852f9793fSmrg		os=-sysv
76952f9793fSmrg		;;
77052f9793fSmrg	next | m*-next )
77152f9793fSmrg		basic_machine=m68k-next
77252f9793fSmrg		case $os in
77352f9793fSmrg		    -nextstep* )
77452f9793fSmrg			;;
77552f9793fSmrg		    -ns2*)
77652f9793fSmrg		      os=-nextstep2
77752f9793fSmrg			;;
77852f9793fSmrg		    *)
77952f9793fSmrg		      os=-nextstep3
78052f9793fSmrg			;;
78152f9793fSmrg		esac
78252f9793fSmrg		;;
78352f9793fSmrg	nh3000)
78452f9793fSmrg		basic_machine=m68k-harris
78552f9793fSmrg		os=-cxux
78652f9793fSmrg		;;
78752f9793fSmrg	nh[45]000)
78852f9793fSmrg		basic_machine=m88k-harris
78952f9793fSmrg		os=-cxux
79052f9793fSmrg		;;
79152f9793fSmrg	nindy960)
79252f9793fSmrg		basic_machine=i960-intel
79352f9793fSmrg		os=-nindy
79452f9793fSmrg		;;
79552f9793fSmrg	mon960)
79652f9793fSmrg		basic_machine=i960-intel
79752f9793fSmrg		os=-mon960
79852f9793fSmrg		;;
79952f9793fSmrg	nonstopux)
80052f9793fSmrg		basic_machine=mips-compaq
80152f9793fSmrg		os=-nonstopux
80252f9793fSmrg		;;
80352f9793fSmrg	np1)
80452f9793fSmrg		basic_machine=np1-gould
80552f9793fSmrg		;;
80652f9793fSmrg	nsr-tandem)
80752f9793fSmrg		basic_machine=nsr-tandem
80852f9793fSmrg		;;
80952f9793fSmrg	op50n-* | op60c-*)
81052f9793fSmrg		basic_machine=hppa1.1-oki
81152f9793fSmrg		os=-proelf
81252f9793fSmrg		;;
81352f9793fSmrg	openrisc | openrisc-*)
81452f9793fSmrg		basic_machine=or32-unknown
81552f9793fSmrg		;;
81652f9793fSmrg	os400)
81752f9793fSmrg		basic_machine=powerpc-ibm
81852f9793fSmrg		os=-os400
81952f9793fSmrg		;;
82052f9793fSmrg	OSE68000 | ose68000)
82152f9793fSmrg		basic_machine=m68000-ericsson
82252f9793fSmrg		os=-ose
82352f9793fSmrg		;;
82452f9793fSmrg	os68k)
82552f9793fSmrg		basic_machine=m68k-none
82652f9793fSmrg		os=-os68k
82752f9793fSmrg		;;
82852f9793fSmrg	pa-hitachi)
82952f9793fSmrg		basic_machine=hppa1.1-hitachi
83052f9793fSmrg		os=-hiuxwe2
83152f9793fSmrg		;;
83252f9793fSmrg	paragon)
83352f9793fSmrg		basic_machine=i860-intel
83452f9793fSmrg		os=-osf
83552f9793fSmrg		;;
8362faa96e0Smrg	parisc)
8372faa96e0Smrg		basic_machine=hppa-unknown
8382faa96e0Smrg		os=-linux
8392faa96e0Smrg		;;
8402faa96e0Smrg	parisc-*)
8412faa96e0Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
8422faa96e0Smrg		os=-linux
8432faa96e0Smrg		;;
84452f9793fSmrg	pbd)
84552f9793fSmrg		basic_machine=sparc-tti
84652f9793fSmrg		;;
84752f9793fSmrg	pbb)
84852f9793fSmrg		basic_machine=m68k-tti
84952f9793fSmrg		;;
85052f9793fSmrg	pc532 | pc532-*)
85152f9793fSmrg		basic_machine=ns32k-pc532
85252f9793fSmrg		;;
85352f9793fSmrg	pc98)
85452f9793fSmrg		basic_machine=i386-pc
85552f9793fSmrg		;;
85652f9793fSmrg	pc98-*)
85752f9793fSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
85852f9793fSmrg		;;
85952f9793fSmrg	pentium | p5 | k5 | k6 | nexgen | viac3)
86052f9793fSmrg		basic_machine=i586-pc
86152f9793fSmrg		;;
86252f9793fSmrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
86352f9793fSmrg		basic_machine=i686-pc
86452f9793fSmrg		;;
86552f9793fSmrg	pentiumii | pentium2 | pentiumiii | pentium3)
86652f9793fSmrg		basic_machine=i686-pc
86752f9793fSmrg		;;
86852f9793fSmrg	pentium4)
86952f9793fSmrg		basic_machine=i786-pc
87052f9793fSmrg		;;
87152f9793fSmrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
87252f9793fSmrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
87352f9793fSmrg		;;
87452f9793fSmrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
87552f9793fSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
87652f9793fSmrg		;;
87752f9793fSmrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
87852f9793fSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
87952f9793fSmrg		;;
88052f9793fSmrg	pentium4-*)
88152f9793fSmrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
88252f9793fSmrg		;;
88352f9793fSmrg	pn)
88452f9793fSmrg		basic_machine=pn-gould
88552f9793fSmrg		;;
88652f9793fSmrg	power)	basic_machine=power-ibm
88752f9793fSmrg		;;
88852f9793fSmrg	ppc)	basic_machine=powerpc-unknown
88952f9793fSmrg		;;
89052f9793fSmrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
89152f9793fSmrg		;;
89252f9793fSmrg	ppcle | powerpclittle | ppc-le | powerpc-little)
89352f9793fSmrg		basic_machine=powerpcle-unknown
89452f9793fSmrg		;;
89552f9793fSmrg	ppcle-* | powerpclittle-*)
89652f9793fSmrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
89752f9793fSmrg		;;
89852f9793fSmrg	ppc64)	basic_machine=powerpc64-unknown
89952f9793fSmrg		;;
90052f9793fSmrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
90152f9793fSmrg		;;
90252f9793fSmrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
90352f9793fSmrg		basic_machine=powerpc64le-unknown
90452f9793fSmrg		;;
90552f9793fSmrg	ppc64le-* | powerpc64little-*)
90652f9793fSmrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
90752f9793fSmrg		;;
90852f9793fSmrg	ps2)
90952f9793fSmrg		basic_machine=i386-ibm
91052f9793fSmrg		;;
91152f9793fSmrg	pw32)
91252f9793fSmrg		basic_machine=i586-unknown
91352f9793fSmrg		os=-pw32
91452f9793fSmrg		;;
91552f9793fSmrg	rdos)
91652f9793fSmrg		basic_machine=i386-pc
91752f9793fSmrg		os=-rdos
91852f9793fSmrg		;;
91952f9793fSmrg	rom68k)
92052f9793fSmrg		basic_machine=m68k-rom68k
92152f9793fSmrg		os=-coff
92252f9793fSmrg		;;
92352f9793fSmrg	rm[46]00)
92452f9793fSmrg		basic_machine=mips-siemens
92552f9793fSmrg		;;
92652f9793fSmrg	rtpc | rtpc-*)
92752f9793fSmrg		basic_machine=romp-ibm
92852f9793fSmrg		;;
92952f9793fSmrg	s390 | s390-*)
93052f9793fSmrg		basic_machine=s390-ibm
93152f9793fSmrg		;;
93252f9793fSmrg	s390x | s390x-*)
93352f9793fSmrg		basic_machine=s390x-ibm
93452f9793fSmrg		;;
93552f9793fSmrg	sa29200)
93652f9793fSmrg		basic_machine=a29k-amd
93752f9793fSmrg		os=-udi
93852f9793fSmrg		;;
93952f9793fSmrg	sb1)
94052f9793fSmrg		basic_machine=mipsisa64sb1-unknown
94152f9793fSmrg		;;
94252f9793fSmrg	sb1el)
94352f9793fSmrg		basic_machine=mipsisa64sb1el-unknown
94452f9793fSmrg		;;
9452faa96e0Smrg	sde)
9462faa96e0Smrg		basic_machine=mipsisa32-sde
9472faa96e0Smrg		os=-elf
9482faa96e0Smrg		;;
94952f9793fSmrg	sei)
95052f9793fSmrg		basic_machine=mips-sei
95152f9793fSmrg		os=-seiux
95252f9793fSmrg		;;
95352f9793fSmrg	sequent)
95452f9793fSmrg		basic_machine=i386-sequent
95552f9793fSmrg		;;
95652f9793fSmrg	sh)
95752f9793fSmrg		basic_machine=sh-hitachi
95852f9793fSmrg		os=-hms
95952f9793fSmrg		;;
9602faa96e0Smrg	sh5el)
9612faa96e0Smrg		basic_machine=sh5le-unknown
9622faa96e0Smrg		;;
96352f9793fSmrg	sh64)
96452f9793fSmrg		basic_machine=sh64-unknown
96552f9793fSmrg		;;
96652f9793fSmrg	sparclite-wrs | simso-wrs)
96752f9793fSmrg		basic_machine=sparclite-wrs
96852f9793fSmrg		os=-vxworks
96952f9793fSmrg		;;
97052f9793fSmrg	sps7)
97152f9793fSmrg		basic_machine=m68k-bull
97252f9793fSmrg		os=-sysv2
97352f9793fSmrg		;;
97452f9793fSmrg	spur)
97552f9793fSmrg		basic_machine=spur-unknown
97652f9793fSmrg		;;
97752f9793fSmrg	st2000)
97852f9793fSmrg		basic_machine=m68k-tandem
97952f9793fSmrg		;;
98052f9793fSmrg	stratus)
98152f9793fSmrg		basic_machine=i860-stratus
98252f9793fSmrg		os=-sysv4
98352f9793fSmrg		;;
98452f9793fSmrg	sun2)
98552f9793fSmrg		basic_machine=m68000-sun
98652f9793fSmrg		;;
98752f9793fSmrg	sun2os3)
98852f9793fSmrg		basic_machine=m68000-sun
98952f9793fSmrg		os=-sunos3
99052f9793fSmrg		;;
99152f9793fSmrg	sun2os4)
99252f9793fSmrg		basic_machine=m68000-sun
99352f9793fSmrg		os=-sunos4
99452f9793fSmrg		;;
99552f9793fSmrg	sun3os3)
99652f9793fSmrg		basic_machine=m68k-sun
99752f9793fSmrg		os=-sunos3
99852f9793fSmrg		;;
99952f9793fSmrg	sun3os4)
100052f9793fSmrg		basic_machine=m68k-sun
100152f9793fSmrg		os=-sunos4
100252f9793fSmrg		;;
100352f9793fSmrg	sun4os3)
100452f9793fSmrg		basic_machine=sparc-sun
100552f9793fSmrg		os=-sunos3
100652f9793fSmrg		;;
100752f9793fSmrg	sun4os4)
100852f9793fSmrg		basic_machine=sparc-sun
100952f9793fSmrg		os=-sunos4
101052f9793fSmrg		;;
101152f9793fSmrg	sun4sol2)
101252f9793fSmrg		basic_machine=sparc-sun
101352f9793fSmrg		os=-solaris2
101452f9793fSmrg		;;
101552f9793fSmrg	sun3 | sun3-*)
101652f9793fSmrg		basic_machine=m68k-sun
101752f9793fSmrg		;;
101852f9793fSmrg	sun4)
101952f9793fSmrg		basic_machine=sparc-sun
102052f9793fSmrg		;;
102152f9793fSmrg	sun386 | sun386i | roadrunner)
102252f9793fSmrg		basic_machine=i386-sun
102352f9793fSmrg		;;
102452f9793fSmrg	sv1)
102552f9793fSmrg		basic_machine=sv1-cray
102652f9793fSmrg		os=-unicos
102752f9793fSmrg		;;
102852f9793fSmrg	symmetry)
102952f9793fSmrg		basic_machine=i386-sequent
103052f9793fSmrg		os=-dynix
103152f9793fSmrg		;;
103252f9793fSmrg	t3e)
103352f9793fSmrg		basic_machine=alphaev5-cray
103452f9793fSmrg		os=-unicos
103552f9793fSmrg		;;
103652f9793fSmrg	t90)
103752f9793fSmrg		basic_machine=t90-cray
103852f9793fSmrg		os=-unicos
103952f9793fSmrg		;;
104052f9793fSmrg	tic54x | c54x*)
104152f9793fSmrg		basic_machine=tic54x-unknown
104252f9793fSmrg		os=-coff
104352f9793fSmrg		;;
104452f9793fSmrg	tic55x | c55x*)
104552f9793fSmrg		basic_machine=tic55x-unknown
104652f9793fSmrg		os=-coff
104752f9793fSmrg		;;
104852f9793fSmrg	tic6x | c6x*)
104952f9793fSmrg		basic_machine=tic6x-unknown
105052f9793fSmrg		os=-coff
105152f9793fSmrg		;;
10522faa96e0Smrg	tile*)
10532faa96e0Smrg		basic_machine=tile-unknown
10542faa96e0Smrg		os=-linux-gnu
10552faa96e0Smrg		;;
105652f9793fSmrg	tx39)
105752f9793fSmrg		basic_machine=mipstx39-unknown
105852f9793fSmrg		;;
105952f9793fSmrg	tx39el)
106052f9793fSmrg		basic_machine=mipstx39el-unknown
106152f9793fSmrg		;;
106252f9793fSmrg	toad1)
106352f9793fSmrg		basic_machine=pdp10-xkl
106452f9793fSmrg		os=-tops20
106552f9793fSmrg		;;
106652f9793fSmrg	tower | tower-32)
106752f9793fSmrg		basic_machine=m68k-ncr
106852f9793fSmrg		;;
106952f9793fSmrg	tpf)
107052f9793fSmrg		basic_machine=s390x-ibm
107152f9793fSmrg		os=-tpf
107252f9793fSmrg		;;
107352f9793fSmrg	udi29k)
107452f9793fSmrg		basic_machine=a29k-amd
107552f9793fSmrg		os=-udi
107652f9793fSmrg		;;
107752f9793fSmrg	ultra3)
107852f9793fSmrg		basic_machine=a29k-nyu
107952f9793fSmrg		os=-sym1
108052f9793fSmrg		;;
108152f9793fSmrg	v810 | necv810)
108252f9793fSmrg		basic_machine=v810-nec
108352f9793fSmrg		os=-none
108452f9793fSmrg		;;
108552f9793fSmrg	vaxv)
108652f9793fSmrg		basic_machine=vax-dec
108752f9793fSmrg		os=-sysv
108852f9793fSmrg		;;
108952f9793fSmrg	vms)
109052f9793fSmrg		basic_machine=vax-dec
109152f9793fSmrg		os=-vms
109252f9793fSmrg		;;
109352f9793fSmrg	vpp*|vx|vx-*)
109452f9793fSmrg		basic_machine=f301-fujitsu
109552f9793fSmrg		;;
109652f9793fSmrg	vxworks960)
109752f9793fSmrg		basic_machine=i960-wrs
109852f9793fSmrg		os=-vxworks
109952f9793fSmrg		;;
110052f9793fSmrg	vxworks68)
110152f9793fSmrg		basic_machine=m68k-wrs
110252f9793fSmrg		os=-vxworks
110352f9793fSmrg		;;
110452f9793fSmrg	vxworks29k)
110552f9793fSmrg		basic_machine=a29k-wrs
110652f9793fSmrg		os=-vxworks
110752f9793fSmrg		;;
110852f9793fSmrg	w65*)
110952f9793fSmrg		basic_machine=w65-wdc
111052f9793fSmrg		os=-none
111152f9793fSmrg		;;
111252f9793fSmrg	w89k-*)
111352f9793fSmrg		basic_machine=hppa1.1-winbond
111452f9793fSmrg		os=-proelf
111552f9793fSmrg		;;
111652f9793fSmrg	xbox)
111752f9793fSmrg		basic_machine=i686-pc
111852f9793fSmrg		os=-mingw32
111952f9793fSmrg		;;
112052f9793fSmrg	xps | xps100)
112152f9793fSmrg		basic_machine=xps100-honeywell
112252f9793fSmrg		;;
112352f9793fSmrg	ymp)
112452f9793fSmrg		basic_machine=ymp-cray
112552f9793fSmrg		os=-unicos
112652f9793fSmrg		;;
112752f9793fSmrg	z8k-*-coff)
112852f9793fSmrg		basic_machine=z8k-unknown
112952f9793fSmrg		os=-sim
113052f9793fSmrg		;;
113152f9793fSmrg	none)
113252f9793fSmrg		basic_machine=none-none
113352f9793fSmrg		os=-none
113452f9793fSmrg		;;
113552f9793fSmrg
113652f9793fSmrg# Here we handle the default manufacturer of certain CPU types.  It is in
113752f9793fSmrg# some cases the only manufacturer, in others, it is the most popular.
113852f9793fSmrg	w89k)
113952f9793fSmrg		basic_machine=hppa1.1-winbond
114052f9793fSmrg		;;
114152f9793fSmrg	op50n)
114252f9793fSmrg		basic_machine=hppa1.1-oki
114352f9793fSmrg		;;
114452f9793fSmrg	op60c)
114552f9793fSmrg		basic_machine=hppa1.1-oki
114652f9793fSmrg		;;
114752f9793fSmrg	romp)
114852f9793fSmrg		basic_machine=romp-ibm
114952f9793fSmrg		;;
115052f9793fSmrg	mmix)
115152f9793fSmrg		basic_machine=mmix-knuth
115252f9793fSmrg		;;
115352f9793fSmrg	rs6000)
115452f9793fSmrg		basic_machine=rs6000-ibm
115552f9793fSmrg		;;
115652f9793fSmrg	vax)
115752f9793fSmrg		basic_machine=vax-dec
115852f9793fSmrg		;;
115952f9793fSmrg	pdp10)
116052f9793fSmrg		# there are many clones, so DEC is not a safe bet
116152f9793fSmrg		basic_machine=pdp10-unknown
116252f9793fSmrg		;;
116352f9793fSmrg	pdp11)
116452f9793fSmrg		basic_machine=pdp11-dec
116552f9793fSmrg		;;
116652f9793fSmrg	we32k)
116752f9793fSmrg		basic_machine=we32k-att
116852f9793fSmrg		;;
116952f9793fSmrg	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
117052f9793fSmrg		basic_machine=sh-unknown
117152f9793fSmrg		;;
11722faa96e0Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
117352f9793fSmrg		basic_machine=sparc-sun
117452f9793fSmrg		;;
117552f9793fSmrg	cydra)
117652f9793fSmrg		basic_machine=cydra-cydrome
117752f9793fSmrg		;;
117852f9793fSmrg	orion)
117952f9793fSmrg		basic_machine=orion-highlevel
118052f9793fSmrg		;;
118152f9793fSmrg	orion105)
118252f9793fSmrg		basic_machine=clipper-highlevel
118352f9793fSmrg		;;
118452f9793fSmrg	mac | mpw | mac-mpw)
118552f9793fSmrg		basic_machine=m68k-apple
118652f9793fSmrg		;;
118752f9793fSmrg	pmac | pmac-mpw)
118852f9793fSmrg		basic_machine=powerpc-apple
118952f9793fSmrg		;;
119052f9793fSmrg	*-unknown)
119152f9793fSmrg		# Make sure to match an already-canonicalized machine name.
119252f9793fSmrg		;;
119352f9793fSmrg	*)
119452f9793fSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
119552f9793fSmrg		exit 1
119652f9793fSmrg		;;
119752f9793fSmrgesac
119852f9793fSmrg
119952f9793fSmrg# Here we canonicalize certain aliases for manufacturers.
120052f9793fSmrgcase $basic_machine in
120152f9793fSmrg	*-digital*)
120252f9793fSmrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
120352f9793fSmrg		;;
120452f9793fSmrg	*-commodore*)
120552f9793fSmrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
120652f9793fSmrg		;;
120752f9793fSmrg	*)
120852f9793fSmrg		;;
120952f9793fSmrgesac
121052f9793fSmrg
121152f9793fSmrg# Decode manufacturer-specific aliases for certain operating systems.
121252f9793fSmrg
121352f9793fSmrgif [ x"$os" != x"" ]
121452f9793fSmrgthen
121552f9793fSmrgcase $os in
121652f9793fSmrg        # First match some system type aliases
121752f9793fSmrg        # that might get confused with valid system types.
121852f9793fSmrg	# -solaris* is a basic system type, with this one exception.
121952f9793fSmrg	-solaris1 | -solaris1.*)
122052f9793fSmrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
122152f9793fSmrg		;;
122252f9793fSmrg	-solaris)
122352f9793fSmrg		os=-solaris2
122452f9793fSmrg		;;
122552f9793fSmrg	-svr4*)
122652f9793fSmrg		os=-sysv4
122752f9793fSmrg		;;
122852f9793fSmrg	-unixware*)
122952f9793fSmrg		os=-sysv4.2uw
123052f9793fSmrg		;;
123152f9793fSmrg	-gnu/linux*)
123252f9793fSmrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
123352f9793fSmrg		;;
123452f9793fSmrg	# First accept the basic system types.
123552f9793fSmrg	# The portable systems comes first.
123652f9793fSmrg	# Each alternative MUST END IN A *, to match a version number.
123752f9793fSmrg	# -sysv* is not here because it comes later, after sysvr4.
123852f9793fSmrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
123952f9793fSmrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
124052f9793fSmrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
124152f9793fSmrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
124252f9793fSmrg	      | -aos* \
124352f9793fSmrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
124452f9793fSmrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
124552f9793fSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
124652f9793fSmrg	      | -openbsd* | -solidbsd* \
124752f9793fSmrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
124852f9793fSmrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
124952f9793fSmrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
125052f9793fSmrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
125152f9793fSmrg	      | -chorusos* | -chorusrdb* \
125252f9793fSmrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
125352f9793fSmrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
125452f9793fSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
125552f9793fSmrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
125652f9793fSmrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
125752f9793fSmrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
125852f9793fSmrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
125952f9793fSmrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
126052f9793fSmrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
12612faa96e0Smrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
126252f9793fSmrg	# Remember, each alternative MUST END IN *, to match a version number.
126352f9793fSmrg		;;
126452f9793fSmrg	-qnx*)
126552f9793fSmrg		case $basic_machine in
126652f9793fSmrg		    x86-* | i*86-*)
126752f9793fSmrg			;;
126852f9793fSmrg		    *)
126952f9793fSmrg			os=-nto$os
127052f9793fSmrg			;;
127152f9793fSmrg		esac
127252f9793fSmrg		;;
127352f9793fSmrg	-nto-qnx*)
127452f9793fSmrg		;;
127552f9793fSmrg	-nto*)
127652f9793fSmrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
127752f9793fSmrg		;;
127852f9793fSmrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
127952f9793fSmrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
128052f9793fSmrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
128152f9793fSmrg		;;
128252f9793fSmrg	-mac*)
128352f9793fSmrg		os=`echo $os | sed -e 's|mac|macos|'`
128452f9793fSmrg		;;
128552f9793fSmrg	-linux-dietlibc)
128652f9793fSmrg		os=-linux-dietlibc
128752f9793fSmrg		;;
128852f9793fSmrg	-linux*)
128952f9793fSmrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
129052f9793fSmrg		;;
129152f9793fSmrg	-sunos5*)
129252f9793fSmrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
129352f9793fSmrg		;;
129452f9793fSmrg	-sunos6*)
129552f9793fSmrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
129652f9793fSmrg		;;
129752f9793fSmrg	-opened*)
129852f9793fSmrg		os=-openedition
129952f9793fSmrg		;;
130052f9793fSmrg        -os400*)
130152f9793fSmrg		os=-os400
130252f9793fSmrg		;;
130352f9793fSmrg	-wince*)
130452f9793fSmrg		os=-wince
130552f9793fSmrg		;;
130652f9793fSmrg	-osfrose*)
130752f9793fSmrg		os=-osfrose
130852f9793fSmrg		;;
130952f9793fSmrg	-osf*)
131052f9793fSmrg		os=-osf
131152f9793fSmrg		;;
131252f9793fSmrg	-utek*)
131352f9793fSmrg		os=-bsd
131452f9793fSmrg		;;
131552f9793fSmrg	-dynix*)
131652f9793fSmrg		os=-bsd
131752f9793fSmrg		;;
131852f9793fSmrg	-acis*)
131952f9793fSmrg		os=-aos
132052f9793fSmrg		;;
132152f9793fSmrg	-atheos*)
132252f9793fSmrg		os=-atheos
132352f9793fSmrg		;;
132452f9793fSmrg	-syllable*)
132552f9793fSmrg		os=-syllable
132652f9793fSmrg		;;
132752f9793fSmrg	-386bsd)
132852f9793fSmrg		os=-bsd
132952f9793fSmrg		;;
133052f9793fSmrg	-ctix* | -uts*)
133152f9793fSmrg		os=-sysv
133252f9793fSmrg		;;
133352f9793fSmrg	-nova*)
133452f9793fSmrg		os=-rtmk-nova
133552f9793fSmrg		;;
133652f9793fSmrg	-ns2 )
133752f9793fSmrg		os=-nextstep2
133852f9793fSmrg		;;
133952f9793fSmrg	-nsk*)
134052f9793fSmrg		os=-nsk
134152f9793fSmrg		;;
134252f9793fSmrg	# Preserve the version number of sinix5.
134352f9793fSmrg	-sinix5.*)
134452f9793fSmrg		os=`echo $os | sed -e 's|sinix|sysv|'`
134552f9793fSmrg		;;
134652f9793fSmrg	-sinix*)
134752f9793fSmrg		os=-sysv4
134852f9793fSmrg		;;
134952f9793fSmrg        -tpf*)
135052f9793fSmrg		os=-tpf
135152f9793fSmrg		;;
135252f9793fSmrg	-triton*)
135352f9793fSmrg		os=-sysv3
135452f9793fSmrg		;;
135552f9793fSmrg	-oss*)
135652f9793fSmrg		os=-sysv3
135752f9793fSmrg		;;
135852f9793fSmrg	-svr4)
135952f9793fSmrg		os=-sysv4
136052f9793fSmrg		;;
136152f9793fSmrg	-svr3)
136252f9793fSmrg		os=-sysv3
136352f9793fSmrg		;;
136452f9793fSmrg	-sysvr4)
136552f9793fSmrg		os=-sysv4
136652f9793fSmrg		;;
136752f9793fSmrg	# This must come after -sysvr4.
136852f9793fSmrg	-sysv*)
136952f9793fSmrg		;;
137052f9793fSmrg	-ose*)
137152f9793fSmrg		os=-ose
137252f9793fSmrg		;;
137352f9793fSmrg	-es1800*)
137452f9793fSmrg		os=-ose
137552f9793fSmrg		;;
137652f9793fSmrg	-xenix)
137752f9793fSmrg		os=-xenix
137852f9793fSmrg		;;
137952f9793fSmrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
138052f9793fSmrg		os=-mint
138152f9793fSmrg		;;
138252f9793fSmrg	-aros*)
138352f9793fSmrg		os=-aros
138452f9793fSmrg		;;
138552f9793fSmrg	-kaos*)
138652f9793fSmrg		os=-kaos
138752f9793fSmrg		;;
138852f9793fSmrg	-zvmoe)
138952f9793fSmrg		os=-zvmoe
139052f9793fSmrg		;;
139152f9793fSmrg	-none)
139252f9793fSmrg		;;
139352f9793fSmrg	*)
139452f9793fSmrg		# Get rid of the `-' at the beginning of $os.
139552f9793fSmrg		os=`echo $os | sed 's/[^-]*-//'`
139652f9793fSmrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
139752f9793fSmrg		exit 1
139852f9793fSmrg		;;
139952f9793fSmrgesac
140052f9793fSmrgelse
140152f9793fSmrg
140252f9793fSmrg# Here we handle the default operating systems that come with various machines.
140352f9793fSmrg# The value should be what the vendor currently ships out the door with their
140452f9793fSmrg# machine or put another way, the most popular os provided with the machine.
140552f9793fSmrg
140652f9793fSmrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
140752f9793fSmrg# "-sun"), then you have to tell the case statement up towards the top
140852f9793fSmrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
140952f9793fSmrg# will signal an error saying that MANUFACTURER isn't an operating
141052f9793fSmrg# system, and we'll never get to this point.
141152f9793fSmrg
141252f9793fSmrgcase $basic_machine in
14132faa96e0Smrg        score-*)
14142faa96e0Smrg		os=-elf
14152faa96e0Smrg		;;
14162faa96e0Smrg        spu-*)
14172faa96e0Smrg		os=-elf
14182faa96e0Smrg		;;
141952f9793fSmrg	*-acorn)
142052f9793fSmrg		os=-riscix1.2
142152f9793fSmrg		;;
142252f9793fSmrg	arm*-rebel)
142352f9793fSmrg		os=-linux
142452f9793fSmrg		;;
142552f9793fSmrg	arm*-semi)
142652f9793fSmrg		os=-aout
142752f9793fSmrg		;;
14282faa96e0Smrg        c4x-* | tic4x-*)
14292faa96e0Smrg        	os=-coff
14302faa96e0Smrg		;;
143152f9793fSmrg	# This must come before the *-dec entry.
143252f9793fSmrg	pdp10-*)
143352f9793fSmrg		os=-tops20
143452f9793fSmrg		;;
143552f9793fSmrg	pdp11-*)
143652f9793fSmrg		os=-none
143752f9793fSmrg		;;
143852f9793fSmrg	*-dec | vax-*)
143952f9793fSmrg		os=-ultrix4.2
144052f9793fSmrg		;;
144152f9793fSmrg	m68*-apollo)
144252f9793fSmrg		os=-domain
144352f9793fSmrg		;;
144452f9793fSmrg	i386-sun)
144552f9793fSmrg		os=-sunos4.0.2
144652f9793fSmrg		;;
144752f9793fSmrg	m68000-sun)
144852f9793fSmrg		os=-sunos3
144952f9793fSmrg		# This also exists in the configure program, but was not the
145052f9793fSmrg		# default.
145152f9793fSmrg		# os=-sunos4
145252f9793fSmrg		;;
145352f9793fSmrg	m68*-cisco)
145452f9793fSmrg		os=-aout
145552f9793fSmrg		;;
14562faa96e0Smrg        mep-*)
14572faa96e0Smrg		os=-elf
14582faa96e0Smrg		;;
145952f9793fSmrg	mips*-cisco)
146052f9793fSmrg		os=-elf
146152f9793fSmrg		;;
146252f9793fSmrg	mips*-*)
146352f9793fSmrg		os=-elf
146452f9793fSmrg		;;
146552f9793fSmrg	or32-*)
146652f9793fSmrg		os=-coff
146752f9793fSmrg		;;
146852f9793fSmrg	*-tti)	# must be before sparc entry or we get the wrong os.
146952f9793fSmrg		os=-sysv3
147052f9793fSmrg		;;
147152f9793fSmrg	sparc-* | *-sun)
147252f9793fSmrg		os=-sunos4.1.1
147352f9793fSmrg		;;
147452f9793fSmrg	*-be)
147552f9793fSmrg		os=-beos
147652f9793fSmrg		;;
147752f9793fSmrg	*-haiku)
147852f9793fSmrg		os=-haiku
147952f9793fSmrg		;;
148052f9793fSmrg	*-ibm)
148152f9793fSmrg		os=-aix
148252f9793fSmrg		;;
148352f9793fSmrg    	*-knuth)
148452f9793fSmrg		os=-mmixware
148552f9793fSmrg		;;
148652f9793fSmrg	*-wec)
148752f9793fSmrg		os=-proelf
148852f9793fSmrg		;;
148952f9793fSmrg	*-winbond)
149052f9793fSmrg		os=-proelf
149152f9793fSmrg		;;
149252f9793fSmrg	*-oki)
149352f9793fSmrg		os=-proelf
149452f9793fSmrg		;;
149552f9793fSmrg	*-hp)
149652f9793fSmrg		os=-hpux
149752f9793fSmrg		;;
149852f9793fSmrg	*-hitachi)
149952f9793fSmrg		os=-hiux
150052f9793fSmrg		;;
150152f9793fSmrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
150252f9793fSmrg		os=-sysv
150352f9793fSmrg		;;
150452f9793fSmrg	*-cbm)
150552f9793fSmrg		os=-amigaos
150652f9793fSmrg		;;
150752f9793fSmrg	*-dg)
150852f9793fSmrg		os=-dgux
150952f9793fSmrg		;;
151052f9793fSmrg	*-dolphin)
151152f9793fSmrg		os=-sysv3
151252f9793fSmrg		;;
151352f9793fSmrg	m68k-ccur)
151452f9793fSmrg		os=-rtu
151552f9793fSmrg		;;
151652f9793fSmrg	m88k-omron*)
151752f9793fSmrg		os=-luna
151852f9793fSmrg		;;
151952f9793fSmrg	*-next )
152052f9793fSmrg		os=-nextstep
152152f9793fSmrg		;;
152252f9793fSmrg	*-sequent)
152352f9793fSmrg		os=-ptx
152452f9793fSmrg		;;
152552f9793fSmrg	*-crds)
152652f9793fSmrg		os=-unos
152752f9793fSmrg		;;
152852f9793fSmrg	*-ns)
152952f9793fSmrg		os=-genix
153052f9793fSmrg		;;
153152f9793fSmrg	i370-*)
153252f9793fSmrg		os=-mvs
153352f9793fSmrg		;;
153452f9793fSmrg	*-next)
153552f9793fSmrg		os=-nextstep3
153652f9793fSmrg		;;
153752f9793fSmrg	*-gould)
153852f9793fSmrg		os=-sysv
153952f9793fSmrg		;;
154052f9793fSmrg	*-highlevel)
154152f9793fSmrg		os=-bsd
154252f9793fSmrg		;;
154352f9793fSmrg	*-encore)
154452f9793fSmrg		os=-bsd
154552f9793fSmrg		;;
154652f9793fSmrg	*-sgi)
154752f9793fSmrg		os=-irix
154852f9793fSmrg		;;
154952f9793fSmrg	*-siemens)
155052f9793fSmrg		os=-sysv4
155152f9793fSmrg		;;
155252f9793fSmrg	*-masscomp)
155352f9793fSmrg		os=-rtu
155452f9793fSmrg		;;
155552f9793fSmrg	f30[01]-fujitsu | f700-fujitsu)
155652f9793fSmrg		os=-uxpv
155752f9793fSmrg		;;
155852f9793fSmrg	*-rom68k)
155952f9793fSmrg		os=-coff
156052f9793fSmrg		;;
156152f9793fSmrg	*-*bug)
156252f9793fSmrg		os=-coff
156352f9793fSmrg		;;
156452f9793fSmrg	*-apple)
156552f9793fSmrg		os=-macos
156652f9793fSmrg		;;
156752f9793fSmrg	*-atari*)
156852f9793fSmrg		os=-mint
156952f9793fSmrg		;;
157052f9793fSmrg	*)
157152f9793fSmrg		os=-none
157252f9793fSmrg		;;
157352f9793fSmrgesac
157452f9793fSmrgfi
157552f9793fSmrg
157652f9793fSmrg# Here we handle the case where we know the os, and the CPU type, but not the
157752f9793fSmrg# manufacturer.  We pick the logical manufacturer.
157852f9793fSmrgvendor=unknown
157952f9793fSmrgcase $basic_machine in
158052f9793fSmrg	*-unknown)
158152f9793fSmrg		case $os in
158252f9793fSmrg			-riscix*)
158352f9793fSmrg				vendor=acorn
158452f9793fSmrg				;;
158552f9793fSmrg			-sunos*)
158652f9793fSmrg				vendor=sun
158752f9793fSmrg				;;
158852f9793fSmrg			-aix*)
158952f9793fSmrg				vendor=ibm
159052f9793fSmrg				;;
159152f9793fSmrg			-beos*)
159252f9793fSmrg				vendor=be
159352f9793fSmrg				;;
159452f9793fSmrg			-hpux*)
159552f9793fSmrg				vendor=hp
159652f9793fSmrg				;;
159752f9793fSmrg			-mpeix*)
159852f9793fSmrg				vendor=hp
159952f9793fSmrg				;;
160052f9793fSmrg			-hiux*)
160152f9793fSmrg				vendor=hitachi
160252f9793fSmrg				;;
160352f9793fSmrg			-unos*)
160452f9793fSmrg				vendor=crds
160552f9793fSmrg				;;
160652f9793fSmrg			-dgux*)
160752f9793fSmrg				vendor=dg
160852f9793fSmrg				;;
160952f9793fSmrg			-luna*)
161052f9793fSmrg				vendor=omron
161152f9793fSmrg				;;
161252f9793fSmrg			-genix*)
161352f9793fSmrg				vendor=ns
161452f9793fSmrg				;;
161552f9793fSmrg			-mvs* | -opened*)
161652f9793fSmrg				vendor=ibm
161752f9793fSmrg				;;
161852f9793fSmrg			-os400*)
161952f9793fSmrg				vendor=ibm
162052f9793fSmrg				;;
162152f9793fSmrg			-ptx*)
162252f9793fSmrg				vendor=sequent
162352f9793fSmrg				;;
162452f9793fSmrg			-tpf*)
162552f9793fSmrg				vendor=ibm
162652f9793fSmrg				;;
162752f9793fSmrg			-vxsim* | -vxworks* | -windiss*)
162852f9793fSmrg				vendor=wrs
162952f9793fSmrg				;;
163052f9793fSmrg			-aux*)
163152f9793fSmrg				vendor=apple
163252f9793fSmrg				;;
163352f9793fSmrg			-hms*)
163452f9793fSmrg				vendor=hitachi
163552f9793fSmrg				;;
163652f9793fSmrg			-mpw* | -macos*)
163752f9793fSmrg				vendor=apple
163852f9793fSmrg				;;
163952f9793fSmrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
164052f9793fSmrg				vendor=atari
164152f9793fSmrg				;;
164252f9793fSmrg			-vos*)
164352f9793fSmrg				vendor=stratus
164452f9793fSmrg				;;
164552f9793fSmrg		esac
164652f9793fSmrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
164752f9793fSmrg		;;
164852f9793fSmrgesac
164952f9793fSmrg
165052f9793fSmrgecho $basic_machine$os
165152f9793fSmrgexit
165252f9793fSmrg
165352f9793fSmrg# Local variables:
165452f9793fSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
165552f9793fSmrg# time-stamp-start: "timestamp='"
165652f9793fSmrg# time-stamp-format: "%:y-%02m-%02d"
165752f9793fSmrg# time-stamp-end: "'"
165852f9793fSmrg# End:
1659