config.sub revision 00084f2c
127702724Smrg#! /bin/sh
227702724Smrg# Configuration validation subroutine script.
327702724Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
400084f2cSmrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5e19dfac4Smrg#   Free Software Foundation, Inc.
627702724Smrg
700084f2cSmrgtimestamp='2010-01-22'
827702724Smrg
927702724Smrg# This file is (in principle) common to ALL GNU software.
1027702724Smrg# The presence of a machine in this file suggests that SOME GNU software
1127702724Smrg# can handle that machine.  It does not imply ALL GNU software can.
1227702724Smrg#
1327702724Smrg# This file is free software; you can redistribute it and/or modify
1427702724Smrg# it under the terms of the GNU General Public License as published by
1527702724Smrg# the Free Software Foundation; either version 2 of the License, or
1627702724Smrg# (at your option) any later version.
1727702724Smrg#
1827702724Smrg# This program is distributed in the hope that it will be useful,
1927702724Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
2027702724Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2127702724Smrg# GNU General Public License for more details.
2227702724Smrg#
2327702724Smrg# You should have received a copy of the GNU General Public License
2427702724Smrg# along with this program; if not, write to the Free Software
2527702724Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2627702724Smrg# 02110-1301, USA.
2727702724Smrg#
2827702724Smrg# As a special exception to the GNU General Public License, if you
2927702724Smrg# distribute this file as part of a program that contains a
3027702724Smrg# configuration script generated by Autoconf, you may include it under
3127702724Smrg# the same distribution terms that you use for the rest of that program.
3227702724Smrg
3327702724Smrg
3427702724Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3500084f2cSmrg# diff and a properly formatted GNU ChangeLog entry.
3627702724Smrg#
3727702724Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3827702724Smrg# Supply the specified configuration type as an argument.
3927702724Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
4027702724Smrg# Otherwise, we print the canonical config type on stdout and succeed.
4127702724Smrg
4200084f2cSmrg# You can get the latest version of this script from:
4300084f2cSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
4400084f2cSmrg
4527702724Smrg# This file is supposed to be the same for all GNU packages
4627702724Smrg# and recognize all the CPU types, system types and aliases
4727702724Smrg# that are meaningful with *any* GNU software.
4827702724Smrg# Each package is responsible for reporting which valid configurations
4927702724Smrg# it does not support.  The user should be able to distinguish
5027702724Smrg# a failure to support a valid configuration from a meaningless
5127702724Smrg# configuration.
5227702724Smrg
5327702724Smrg# The goal of this file is to map all the various variations of a given
5427702724Smrg# machine specification into a single specification in the form:
5527702724Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5627702724Smrg# or in some cases, the newer four-part form:
5727702724Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5827702724Smrg# It is wrong to echo any other type of specification.
5927702724Smrg
6027702724Smrgme=`echo "$0" | sed -e 's,.*/,,'`
6127702724Smrg
6227702724Smrgusage="\
6327702724SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
6427702724Smrg       $0 [OPTION] ALIAS
6527702724Smrg
6627702724SmrgCanonicalize a configuration name.
6727702724Smrg
6827702724SmrgOperation modes:
6927702724Smrg  -h, --help         print this help, then exit
7027702724Smrg  -t, --time-stamp   print date of last modification, then exit
7127702724Smrg  -v, --version      print version number, then exit
7227702724Smrg
7327702724SmrgReport bugs and patches to <config-patches@gnu.org>."
7427702724Smrg
7527702724Smrgversion="\
7627702724SmrgGNU config.sub ($timestamp)
7727702724Smrg
7800084f2cSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
7900084f2cSmrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
8000084f2cSmrgSoftware Foundation, Inc.
8127702724Smrg
8227702724SmrgThis is free software; see the source for copying conditions.  There is NO
8327702724Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8427702724Smrg
8527702724Smrghelp="
8627702724SmrgTry \`$me --help' for more information."
8727702724Smrg
8827702724Smrg# Parse command line
8927702724Smrgwhile test $# -gt 0 ; do
9027702724Smrg  case $1 in
9127702724Smrg    --time-stamp | --time* | -t )
9227702724Smrg       echo "$timestamp" ; exit ;;
9327702724Smrg    --version | -v )
9427702724Smrg       echo "$version" ; exit ;;
9527702724Smrg    --help | --h* | -h )
9627702724Smrg       echo "$usage"; exit ;;
9727702724Smrg    -- )     # Stop option processing
9827702724Smrg       shift; break ;;
9927702724Smrg    - )	# Use stdin as input.
10027702724Smrg       break ;;
10127702724Smrg    -* )
10227702724Smrg       echo "$me: invalid option $1$help"
10327702724Smrg       exit 1 ;;
10427702724Smrg
10527702724Smrg    *local*)
10627702724Smrg       # First pass through any local machine types.
10727702724Smrg       echo $1
10827702724Smrg       exit ;;
10927702724Smrg
11027702724Smrg    * )
11127702724Smrg       break ;;
11227702724Smrg  esac
11327702724Smrgdone
11427702724Smrg
11527702724Smrgcase $# in
11627702724Smrg 0) echo "$me: missing argument$help" >&2
11727702724Smrg    exit 1;;
11827702724Smrg 1) ;;
11927702724Smrg *) echo "$me: too many arguments$help" >&2
12027702724Smrg    exit 1;;
12127702724Smrgesac
12227702724Smrg
12327702724Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
12427702724Smrg# Here we must recognize all the valid KERNEL-OS combinations.
12527702724Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12627702724Smrgcase $maybe_os in
12727702724Smrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
12827702724Smrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
12900084f2cSmrg  kopensolaris*-gnu* | \
13027702724Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
13127702724Smrg    os=-$maybe_os
13227702724Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
13327702724Smrg    ;;
13427702724Smrg  *)
13527702724Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13627702724Smrg    if [ $basic_machine != $1 ]
13727702724Smrg    then os=`echo $1 | sed 's/.*-/-/'`
13827702724Smrg    else os=; fi
13927702724Smrg    ;;
14027702724Smrgesac
14127702724Smrg
14227702724Smrg### Let's recognize common machines as not being operating systems so
14327702724Smrg### that things like config.sub decstation-3100 work.  We also
14427702724Smrg### recognize some manufacturers as not being operating systems, so we
14527702724Smrg### can provide default operating systems below.
14627702724Smrgcase $os in
14727702724Smrg	-sun*os*)
14827702724Smrg		# Prevent following clause from handling this invalid input.
14927702724Smrg		;;
15027702724Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
15127702724Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
15227702724Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
15327702724Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
15427702724Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15527702724Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15600084f2cSmrg	-apple | -axis | -knuth | -cray | -microblaze)
15727702724Smrg		os=
15827702724Smrg		basic_machine=$1
15927702724Smrg		;;
16000084f2cSmrg        -bluegene*)
16100084f2cSmrg	        os=-cnk
16200084f2cSmrg		;;
16327702724Smrg	-sim | -cisco | -oki | -wec | -winbond)
16427702724Smrg		os=
16527702724Smrg		basic_machine=$1
16627702724Smrg		;;
16727702724Smrg	-scout)
16827702724Smrg		;;
16927702724Smrg	-wrs)
17027702724Smrg		os=-vxworks
17127702724Smrg		basic_machine=$1
17227702724Smrg		;;
17327702724Smrg	-chorusos*)
17427702724Smrg		os=-chorusos
17527702724Smrg		basic_machine=$1
17627702724Smrg		;;
17727702724Smrg 	-chorusrdb)
17827702724Smrg 		os=-chorusrdb
17927702724Smrg		basic_machine=$1
18027702724Smrg 		;;
18127702724Smrg	-hiux*)
18227702724Smrg		os=-hiuxwe2
18327702724Smrg		;;
18427702724Smrg	-sco6)
18527702724Smrg		os=-sco5v6
18627702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18727702724Smrg		;;
18827702724Smrg	-sco5)
18927702724Smrg		os=-sco3.2v5
19027702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19127702724Smrg		;;
19227702724Smrg	-sco4)
19327702724Smrg		os=-sco3.2v4
19427702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19527702724Smrg		;;
19627702724Smrg	-sco3.2.[4-9]*)
19727702724Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19827702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19927702724Smrg		;;
20027702724Smrg	-sco3.2v[4-9]*)
20127702724Smrg		# Don't forget version if it is 3.2v4 or newer.
20227702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20327702724Smrg		;;
20427702724Smrg	-sco5v6*)
20527702724Smrg		# Don't forget version if it is 3.2v4 or newer.
20627702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20727702724Smrg		;;
20827702724Smrg	-sco*)
20927702724Smrg		os=-sco3.2v2
21027702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21127702724Smrg		;;
21227702724Smrg	-udk*)
21327702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21427702724Smrg		;;
21527702724Smrg	-isc)
21627702724Smrg		os=-isc2.2
21727702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21827702724Smrg		;;
21927702724Smrg	-clix*)
22027702724Smrg		basic_machine=clipper-intergraph
22127702724Smrg		;;
22227702724Smrg	-isc*)
22327702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
22427702724Smrg		;;
22527702724Smrg	-lynx*)
22627702724Smrg		os=-lynxos
22727702724Smrg		;;
22827702724Smrg	-ptx*)
22927702724Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
23027702724Smrg		;;
23127702724Smrg	-windowsnt*)
23227702724Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
23327702724Smrg		;;
23427702724Smrg	-psos*)
23527702724Smrg		os=-psos
23627702724Smrg		;;
23727702724Smrg	-mint | -mint[0-9]*)
23827702724Smrg		basic_machine=m68k-atari
23927702724Smrg		os=-mint
24027702724Smrg		;;
24127702724Smrgesac
24227702724Smrg
24327702724Smrg# Decode aliases for certain CPU-COMPANY combinations.
24427702724Smrgcase $basic_machine in
24527702724Smrg	# Recognize the basic CPU types without company name.
24627702724Smrg	# Some are omitted here because they have special meanings below.
24727702724Smrg	1750a | 580 \
24827702724Smrg	| a29k \
24927702724Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
25027702724Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
25127702724Smrg	| am33_2.0 \
252e19dfac4Smrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
25327702724Smrg	| bfin \
25427702724Smrg	| c4x | clipper \
25527702724Smrg	| d10v | d30v | dlx | dsp16xx \
256e19dfac4Smrg	| fido | fr30 | frv \
25727702724Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
25827702724Smrg	| i370 | i860 | i960 | ia64 \
25927702724Smrg	| ip2k | iq2000 \
26000084f2cSmrg	| lm32 \
261e19dfac4Smrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
26200084f2cSmrg	| maxq | mb | microblaze | mcore | mep | metag \
26327702724Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
26427702724Smrg	| mips16 \
26527702724Smrg	| mips64 | mips64el \
26600084f2cSmrg	| mips64octeon | mips64octeonel \
26727702724Smrg	| mips64orion | mips64orionel \
26800084f2cSmrg	| mips64r5900 | mips64r5900el \
26900084f2cSmrg	| mips64vr | mips64vrel \
27027702724Smrg	| mips64vr4100 | mips64vr4100el \
27127702724Smrg	| mips64vr4300 | mips64vr4300el \
27227702724Smrg	| mips64vr5000 | mips64vr5000el \
27327702724Smrg	| mips64vr5900 | mips64vr5900el \
27427702724Smrg	| mipsisa32 | mipsisa32el \
27527702724Smrg	| mipsisa32r2 | mipsisa32r2el \
27627702724Smrg	| mipsisa64 | mipsisa64el \
27727702724Smrg	| mipsisa64r2 | mipsisa64r2el \
27827702724Smrg	| mipsisa64sb1 | mipsisa64sb1el \
27927702724Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
28027702724Smrg	| mipstx39 | mipstx39el \
28127702724Smrg	| mn10200 | mn10300 \
28200084f2cSmrg	| moxie \
28327702724Smrg	| mt \
28427702724Smrg	| msp430 \
28527702724Smrg	| nios | nios2 \
28627702724Smrg	| ns16k | ns32k \
28727702724Smrg	| or32 \
28827702724Smrg	| pdp10 | pdp11 | pj | pjl \
28927702724Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
29027702724Smrg	| pyramid \
29100084f2cSmrg	| rx \
292e19dfac4Smrg	| score \
29300084f2cSmrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
29427702724Smrg	| sh64 | sh64le \
295e19dfac4Smrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
296e19dfac4Smrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
297e19dfac4Smrg	| spu | strongarm \
29827702724Smrg	| tahoe | thumb | tic4x | tic80 | tron \
29900084f2cSmrg	| ubicom32 \
30027702724Smrg	| v850 | v850e \
30127702724Smrg	| we32k \
302e19dfac4Smrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
30300084f2cSmrg	| z8k | z80)
30427702724Smrg		basic_machine=$basic_machine-unknown
30527702724Smrg		;;
30600084f2cSmrg	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
30727702724Smrg		# Motorola 68HC11/12.
30827702724Smrg		basic_machine=$basic_machine-unknown
30927702724Smrg		os=-none
31027702724Smrg		;;
31127702724Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
31227702724Smrg		;;
31327702724Smrg	ms1)
31427702724Smrg		basic_machine=mt-unknown
31527702724Smrg		;;
31627702724Smrg
31727702724Smrg	# We use `pc' rather than `unknown'
31827702724Smrg	# because (1) that's what they normally are, and
31927702724Smrg	# (2) the word "unknown" tends to confuse beginning users.
32027702724Smrg	i*86 | x86_64)
32127702724Smrg	  basic_machine=$basic_machine-pc
32227702724Smrg	  ;;
32327702724Smrg	# Object if more than one company name word.
32427702724Smrg	*-*-*)
32527702724Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
32627702724Smrg		exit 1
32727702724Smrg		;;
32827702724Smrg	# Recognize the basic CPU types with company name.
32927702724Smrg	580-* \
33027702724Smrg	| a29k-* \
33127702724Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
33227702724Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
33327702724Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
33427702724Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
335e19dfac4Smrg	| avr-* | avr32-* \
33627702724Smrg	| bfin-* | bs2000-* \
33727702724Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
33827702724Smrg	| clipper-* | craynv-* | cydra-* \
33927702724Smrg	| d10v-* | d30v-* | dlx-* \
34027702724Smrg	| elxsi-* \
341e19dfac4Smrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
34227702724Smrg	| h8300-* | h8500-* \
34327702724Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
34427702724Smrg	| i*86-* | i860-* | i960-* | ia64-* \
34527702724Smrg	| ip2k-* | iq2000-* \
34600084f2cSmrg	| lm32-* \
347e19dfac4Smrg	| m32c-* | m32r-* | m32rle-* \
34827702724Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
34900084f2cSmrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
35027702724Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
35127702724Smrg	| mips16-* \
35227702724Smrg	| mips64-* | mips64el-* \
35300084f2cSmrg	| mips64octeon-* | mips64octeonel-* \
35427702724Smrg	| mips64orion-* | mips64orionel-* \
35500084f2cSmrg	| mips64r5900-* | mips64r5900el-* \
35600084f2cSmrg	| mips64vr-* | mips64vrel-* \
35727702724Smrg	| mips64vr4100-* | mips64vr4100el-* \
35827702724Smrg	| mips64vr4300-* | mips64vr4300el-* \
35927702724Smrg	| mips64vr5000-* | mips64vr5000el-* \
36027702724Smrg	| mips64vr5900-* | mips64vr5900el-* \
36127702724Smrg	| mipsisa32-* | mipsisa32el-* \
36227702724Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
36327702724Smrg	| mipsisa64-* | mipsisa64el-* \
36427702724Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
36527702724Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
36627702724Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
36727702724Smrg	| mipstx39-* | mipstx39el-* \
36827702724Smrg	| mmix-* \
36927702724Smrg	| mt-* \
37027702724Smrg	| msp430-* \
37127702724Smrg	| nios-* | nios2-* \
37227702724Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
37327702724Smrg	| orion-* \
37427702724Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
37527702724Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
37627702724Smrg	| pyramid-* \
37700084f2cSmrg	| romp-* | rs6000-* | rx-* \
37800084f2cSmrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
37927702724Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
380e19dfac4Smrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
38127702724Smrg	| sparclite-* \
382e19dfac4Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
38327702724Smrg	| tahoe-* | thumb-* \
38427702724Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
38500084f2cSmrg	| tile-* | tilegx-* \
38627702724Smrg	| tron-* \
38700084f2cSmrg	| ubicom32-* \
38827702724Smrg	| v850-* | v850e-* | vax-* \
38927702724Smrg	| we32k-* \
390e19dfac4Smrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
391e19dfac4Smrg	| xstormy16-* | xtensa*-* \
39227702724Smrg	| ymp-* \
39300084f2cSmrg	| z8k-* | z80-*)
39427702724Smrg		;;
395e19dfac4Smrg	# Recognize the basic CPU types without company name, with glob match.
396e19dfac4Smrg	xtensa*)
397e19dfac4Smrg		basic_machine=$basic_machine-unknown
39827702724Smrg		;;
39927702724Smrg	# Recognize the various machine names and aliases which stand
40027702724Smrg	# for a CPU type and a company and sometimes even an OS.
40127702724Smrg	386bsd)
40227702724Smrg		basic_machine=i386-unknown
40327702724Smrg		os=-bsd
40427702724Smrg		;;
40527702724Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
40627702724Smrg		basic_machine=m68000-att
40727702724Smrg		;;
40827702724Smrg	3b*)
40927702724Smrg		basic_machine=we32k-att
41027702724Smrg		;;
41127702724Smrg	a29khif)
41227702724Smrg		basic_machine=a29k-amd
41327702724Smrg		os=-udi
41427702724Smrg		;;
41527702724Smrg    	abacus)
41627702724Smrg		basic_machine=abacus-unknown
41727702724Smrg		;;
41827702724Smrg	adobe68k)
41927702724Smrg		basic_machine=m68010-adobe
42027702724Smrg		os=-scout
42127702724Smrg		;;
42227702724Smrg	alliant | fx80)
42327702724Smrg		basic_machine=fx80-alliant
42427702724Smrg		;;
42527702724Smrg	altos | altos3068)
42627702724Smrg		basic_machine=m68k-altos
42727702724Smrg		;;
42827702724Smrg	am29k)
42927702724Smrg		basic_machine=a29k-none
43027702724Smrg		os=-bsd
43127702724Smrg		;;
43227702724Smrg	amd64)
43327702724Smrg		basic_machine=x86_64-pc
43427702724Smrg		;;
43527702724Smrg	amd64-*)
43627702724Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
43727702724Smrg		;;
43827702724Smrg	amdahl)
43927702724Smrg		basic_machine=580-amdahl
44027702724Smrg		os=-sysv
44127702724Smrg		;;
44227702724Smrg	amiga | amiga-*)
44327702724Smrg		basic_machine=m68k-unknown
44427702724Smrg		;;
44527702724Smrg	amigaos | amigados)
44627702724Smrg		basic_machine=m68k-unknown
44727702724Smrg		os=-amigaos
44827702724Smrg		;;
44927702724Smrg	amigaunix | amix)
45027702724Smrg		basic_machine=m68k-unknown
45127702724Smrg		os=-sysv4
45227702724Smrg		;;
45327702724Smrg	apollo68)
45427702724Smrg		basic_machine=m68k-apollo
45527702724Smrg		os=-sysv
45627702724Smrg		;;
45727702724Smrg	apollo68bsd)
45827702724Smrg		basic_machine=m68k-apollo
45927702724Smrg		os=-bsd
46027702724Smrg		;;
46100084f2cSmrg	aros)
46200084f2cSmrg		basic_machine=i386-pc
46300084f2cSmrg		os=-aros
46400084f2cSmrg		;;
46527702724Smrg	aux)
46627702724Smrg		basic_machine=m68k-apple
46727702724Smrg		os=-aux
46827702724Smrg		;;
46927702724Smrg	balance)
47027702724Smrg		basic_machine=ns32k-sequent
47127702724Smrg		os=-dynix
47227702724Smrg		;;
473e19dfac4Smrg	blackfin)
474e19dfac4Smrg		basic_machine=bfin-unknown
475e19dfac4Smrg		os=-linux
476e19dfac4Smrg		;;
477e19dfac4Smrg	blackfin-*)
478e19dfac4Smrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
479e19dfac4Smrg		os=-linux
480e19dfac4Smrg		;;
48100084f2cSmrg	bluegene*)
48200084f2cSmrg		basic_machine=powerpc-ibm
48300084f2cSmrg		os=-cnk
48400084f2cSmrg		;;
48527702724Smrg	c90)
48627702724Smrg		basic_machine=c90-cray
48727702724Smrg		os=-unicos
48827702724Smrg		;;
48900084f2cSmrg        cegcc)
49000084f2cSmrg		basic_machine=arm-unknown
49100084f2cSmrg		os=-cegcc
49200084f2cSmrg		;;
49327702724Smrg	convex-c1)
49427702724Smrg		basic_machine=c1-convex
49527702724Smrg		os=-bsd
49627702724Smrg		;;
49727702724Smrg	convex-c2)
49827702724Smrg		basic_machine=c2-convex
49927702724Smrg		os=-bsd
50027702724Smrg		;;
50127702724Smrg	convex-c32)
50227702724Smrg		basic_machine=c32-convex
50327702724Smrg		os=-bsd
50427702724Smrg		;;
50527702724Smrg	convex-c34)
50627702724Smrg		basic_machine=c34-convex
50727702724Smrg		os=-bsd
50827702724Smrg		;;
50927702724Smrg	convex-c38)
51027702724Smrg		basic_machine=c38-convex
51127702724Smrg		os=-bsd
51227702724Smrg		;;
51327702724Smrg	cray | j90)
51427702724Smrg		basic_machine=j90-cray
51527702724Smrg		os=-unicos
51627702724Smrg		;;
51727702724Smrg	craynv)
51827702724Smrg		basic_machine=craynv-cray
51927702724Smrg		os=-unicosmp
52027702724Smrg		;;
521e19dfac4Smrg	cr16)
522e19dfac4Smrg		basic_machine=cr16-unknown
52327702724Smrg		os=-elf
52427702724Smrg		;;
52527702724Smrg	crds | unos)
52627702724Smrg		basic_machine=m68k-crds
52727702724Smrg		;;
52827702724Smrg	crisv32 | crisv32-* | etraxfs*)
52927702724Smrg		basic_machine=crisv32-axis
53027702724Smrg		;;
53127702724Smrg	cris | cris-* | etrax*)
53227702724Smrg		basic_machine=cris-axis
53327702724Smrg		;;
53427702724Smrg	crx)
53527702724Smrg		basic_machine=crx-unknown
53627702724Smrg		os=-elf
53727702724Smrg		;;
53827702724Smrg	da30 | da30-*)
53927702724Smrg		basic_machine=m68k-da30
54027702724Smrg		;;
54127702724Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
54227702724Smrg		basic_machine=mips-dec
54327702724Smrg		;;
54427702724Smrg	decsystem10* | dec10*)
54527702724Smrg		basic_machine=pdp10-dec
54627702724Smrg		os=-tops10
54727702724Smrg		;;
54827702724Smrg	decsystem20* | dec20*)
54927702724Smrg		basic_machine=pdp10-dec
55027702724Smrg		os=-tops20
55127702724Smrg		;;
55227702724Smrg	delta | 3300 | motorola-3300 | motorola-delta \
55327702724Smrg	      | 3300-motorola | delta-motorola)
55427702724Smrg		basic_machine=m68k-motorola
55527702724Smrg		;;
55627702724Smrg	delta88)
55727702724Smrg		basic_machine=m88k-motorola
55827702724Smrg		os=-sysv3
55927702724Smrg		;;
56000084f2cSmrg	dicos)
56100084f2cSmrg		basic_machine=i686-pc
56200084f2cSmrg		os=-dicos
56300084f2cSmrg		;;
56427702724Smrg	djgpp)
56527702724Smrg		basic_machine=i586-pc
56627702724Smrg		os=-msdosdjgpp
56727702724Smrg		;;
56827702724Smrg	dpx20 | dpx20-*)
56927702724Smrg		basic_machine=rs6000-bull
57027702724Smrg		os=-bosx
57127702724Smrg		;;
57227702724Smrg	dpx2* | dpx2*-bull)
57327702724Smrg		basic_machine=m68k-bull
57427702724Smrg		os=-sysv3
57527702724Smrg		;;
57627702724Smrg	ebmon29k)
57727702724Smrg		basic_machine=a29k-amd
57827702724Smrg		os=-ebmon
57927702724Smrg		;;
58027702724Smrg	elxsi)
58127702724Smrg		basic_machine=elxsi-elxsi
58227702724Smrg		os=-bsd
58327702724Smrg		;;
58427702724Smrg	encore | umax | mmax)
58527702724Smrg		basic_machine=ns32k-encore
58627702724Smrg		;;
58727702724Smrg	es1800 | OSE68k | ose68k | ose | OSE)
58827702724Smrg		basic_machine=m68k-ericsson
58927702724Smrg		os=-ose
59027702724Smrg		;;
59127702724Smrg	fx2800)
59227702724Smrg		basic_machine=i860-alliant
59327702724Smrg		;;
59427702724Smrg	genix)
59527702724Smrg		basic_machine=ns32k-ns
59627702724Smrg		;;
59727702724Smrg	gmicro)
59827702724Smrg		basic_machine=tron-gmicro
59927702724Smrg		os=-sysv
60027702724Smrg		;;
60127702724Smrg	go32)
60227702724Smrg		basic_machine=i386-pc
60327702724Smrg		os=-go32
60427702724Smrg		;;
60527702724Smrg	h3050r* | hiux*)
60627702724Smrg		basic_machine=hppa1.1-hitachi
60727702724Smrg		os=-hiuxwe2
60827702724Smrg		;;
60927702724Smrg	h8300hms)
61027702724Smrg		basic_machine=h8300-hitachi
61127702724Smrg		os=-hms
61227702724Smrg		;;
61327702724Smrg	h8300xray)
61427702724Smrg		basic_machine=h8300-hitachi
61527702724Smrg		os=-xray
61627702724Smrg		;;
61727702724Smrg	h8500hms)
61827702724Smrg		basic_machine=h8500-hitachi
61927702724Smrg		os=-hms
62027702724Smrg		;;
62127702724Smrg	harris)
62227702724Smrg		basic_machine=m88k-harris
62327702724Smrg		os=-sysv3
62427702724Smrg		;;
62527702724Smrg	hp300-*)
62627702724Smrg		basic_machine=m68k-hp
62727702724Smrg		;;
62827702724Smrg	hp300bsd)
62927702724Smrg		basic_machine=m68k-hp
63027702724Smrg		os=-bsd
63127702724Smrg		;;
63227702724Smrg	hp300hpux)
63327702724Smrg		basic_machine=m68k-hp
63427702724Smrg		os=-hpux
63527702724Smrg		;;
63627702724Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
63727702724Smrg		basic_machine=hppa1.0-hp
63827702724Smrg		;;
63927702724Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
64027702724Smrg		basic_machine=m68000-hp
64127702724Smrg		;;
64227702724Smrg	hp9k3[2-9][0-9])
64327702724Smrg		basic_machine=m68k-hp
64427702724Smrg		;;
64527702724Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
64627702724Smrg		basic_machine=hppa1.0-hp
64727702724Smrg		;;
64827702724Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
64927702724Smrg		basic_machine=hppa1.1-hp
65027702724Smrg		;;
65127702724Smrg	hp9k78[0-9] | hp78[0-9])
65227702724Smrg		# FIXME: really hppa2.0-hp
65327702724Smrg		basic_machine=hppa1.1-hp
65427702724Smrg		;;
65527702724Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
65627702724Smrg		# FIXME: really hppa2.0-hp
65727702724Smrg		basic_machine=hppa1.1-hp
65827702724Smrg		;;
65927702724Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
66027702724Smrg		basic_machine=hppa1.1-hp
66127702724Smrg		;;
66227702724Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
66327702724Smrg		basic_machine=hppa1.0-hp
66427702724Smrg		;;
66527702724Smrg	hppa-next)
66627702724Smrg		os=-nextstep3
66727702724Smrg		;;
66827702724Smrg	hppaosf)
66927702724Smrg		basic_machine=hppa1.1-hp
67027702724Smrg		os=-osf
67127702724Smrg		;;
67227702724Smrg	hppro)
67327702724Smrg		basic_machine=hppa1.1-hp
67427702724Smrg		os=-proelf
67527702724Smrg		;;
67627702724Smrg	i370-ibm* | ibm*)
67727702724Smrg		basic_machine=i370-ibm
67827702724Smrg		;;
67927702724Smrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
68027702724Smrg	i*86v32)
68127702724Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
68227702724Smrg		os=-sysv32
68327702724Smrg		;;
68427702724Smrg	i*86v4*)
68527702724Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
68627702724Smrg		os=-sysv4
68727702724Smrg		;;
68827702724Smrg	i*86v)
68927702724Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
69027702724Smrg		os=-sysv
69127702724Smrg		;;
69227702724Smrg	i*86sol2)
69327702724Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
69427702724Smrg		os=-solaris2
69527702724Smrg		;;
69627702724Smrg	i386mach)
69727702724Smrg		basic_machine=i386-mach
69827702724Smrg		os=-mach
69927702724Smrg		;;
70027702724Smrg	i386-vsta | vsta)
70127702724Smrg		basic_machine=i386-unknown
70227702724Smrg		os=-vsta
70327702724Smrg		;;
70427702724Smrg	iris | iris4d)
70527702724Smrg		basic_machine=mips-sgi
70627702724Smrg		case $os in
70727702724Smrg		    -irix*)
70827702724Smrg			;;
70927702724Smrg		    *)
71027702724Smrg			os=-irix4
71127702724Smrg			;;
71227702724Smrg		esac
71327702724Smrg		;;
71427702724Smrg	isi68 | isi)
71527702724Smrg		basic_machine=m68k-isi
71627702724Smrg		os=-sysv
71727702724Smrg		;;
718e19dfac4Smrg	m68knommu)
719e19dfac4Smrg		basic_machine=m68k-unknown
720e19dfac4Smrg		os=-linux
721e19dfac4Smrg		;;
722e19dfac4Smrg	m68knommu-*)
723e19dfac4Smrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
724e19dfac4Smrg		os=-linux
725e19dfac4Smrg		;;
72627702724Smrg	m88k-omron*)
72727702724Smrg		basic_machine=m88k-omron
72827702724Smrg		;;
72927702724Smrg	magnum | m3230)
73027702724Smrg		basic_machine=mips-mips
73127702724Smrg		os=-sysv
73227702724Smrg		;;
73327702724Smrg	merlin)
73427702724Smrg		basic_machine=ns32k-utek
73527702724Smrg		os=-sysv
73627702724Smrg		;;
73700084f2cSmrg        microblaze)
73800084f2cSmrg		basic_machine=microblaze-xilinx
73900084f2cSmrg		;;
74027702724Smrg	mingw32)
74127702724Smrg		basic_machine=i386-pc
74227702724Smrg		os=-mingw32
74327702724Smrg		;;
744e19dfac4Smrg	mingw32ce)
745e19dfac4Smrg		basic_machine=arm-unknown
746e19dfac4Smrg		os=-mingw32ce
747e19dfac4Smrg		;;
74827702724Smrg	miniframe)
74927702724Smrg		basic_machine=m68000-convergent
75027702724Smrg		;;
75127702724Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
75227702724Smrg		basic_machine=m68k-atari
75327702724Smrg		os=-mint
75427702724Smrg		;;
75527702724Smrg	mips3*-*)
75627702724Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
75727702724Smrg		;;
75827702724Smrg	mips3*)
75927702724Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
76027702724Smrg		;;
76127702724Smrg	monitor)
76227702724Smrg		basic_machine=m68k-rom68k
76327702724Smrg		os=-coff
76427702724Smrg		;;
76527702724Smrg	morphos)
76627702724Smrg		basic_machine=powerpc-unknown
76727702724Smrg		os=-morphos
76827702724Smrg		;;
76927702724Smrg	msdos)
77027702724Smrg		basic_machine=i386-pc
77127702724Smrg		os=-msdos
77227702724Smrg		;;
77327702724Smrg	ms1-*)
77427702724Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
77527702724Smrg		;;
77627702724Smrg	mvs)
77727702724Smrg		basic_machine=i370-ibm
77827702724Smrg		os=-mvs
77927702724Smrg		;;
78027702724Smrg	ncr3000)
78127702724Smrg		basic_machine=i486-ncr
78227702724Smrg		os=-sysv4
78327702724Smrg		;;
78427702724Smrg	netbsd386)
78527702724Smrg		basic_machine=i386-unknown
78627702724Smrg		os=-netbsd
78727702724Smrg		;;
78827702724Smrg	netwinder)
78927702724Smrg		basic_machine=armv4l-rebel
79027702724Smrg		os=-linux
79127702724Smrg		;;
79227702724Smrg	news | news700 | news800 | news900)
79327702724Smrg		basic_machine=m68k-sony
79427702724Smrg		os=-newsos
79527702724Smrg		;;
79627702724Smrg	news1000)
79727702724Smrg		basic_machine=m68030-sony
79827702724Smrg		os=-newsos
79927702724Smrg		;;
80027702724Smrg	news-3600 | risc-news)
80127702724Smrg		basic_machine=mips-sony
80227702724Smrg		os=-newsos
80327702724Smrg		;;
80427702724Smrg	necv70)
80527702724Smrg		basic_machine=v70-nec
80627702724Smrg		os=-sysv
80727702724Smrg		;;
80827702724Smrg	next | m*-next )
80927702724Smrg		basic_machine=m68k-next
81027702724Smrg		case $os in
81127702724Smrg		    -nextstep* )
81227702724Smrg			;;
81327702724Smrg		    -ns2*)
81427702724Smrg		      os=-nextstep2
81527702724Smrg			;;
81627702724Smrg		    *)
81727702724Smrg		      os=-nextstep3
81827702724Smrg			;;
81927702724Smrg		esac
82027702724Smrg		;;
82127702724Smrg	nh3000)
82227702724Smrg		basic_machine=m68k-harris
82327702724Smrg		os=-cxux
82427702724Smrg		;;
82527702724Smrg	nh[45]000)
82627702724Smrg		basic_machine=m88k-harris
82727702724Smrg		os=-cxux
82827702724Smrg		;;
82927702724Smrg	nindy960)
83027702724Smrg		basic_machine=i960-intel
83127702724Smrg		os=-nindy
83227702724Smrg		;;
83327702724Smrg	mon960)
83427702724Smrg		basic_machine=i960-intel
83527702724Smrg		os=-mon960
83627702724Smrg		;;
83727702724Smrg	nonstopux)
83827702724Smrg		basic_machine=mips-compaq
83927702724Smrg		os=-nonstopux
84027702724Smrg		;;
84127702724Smrg	np1)
84227702724Smrg		basic_machine=np1-gould
84327702724Smrg		;;
84427702724Smrg	nsr-tandem)
84527702724Smrg		basic_machine=nsr-tandem
84627702724Smrg		;;
84727702724Smrg	op50n-* | op60c-*)
84827702724Smrg		basic_machine=hppa1.1-oki
84927702724Smrg		os=-proelf
85027702724Smrg		;;
85127702724Smrg	openrisc | openrisc-*)
85227702724Smrg		basic_machine=or32-unknown
85327702724Smrg		;;
85427702724Smrg	os400)
85527702724Smrg		basic_machine=powerpc-ibm
85627702724Smrg		os=-os400
85727702724Smrg		;;
85827702724Smrg	OSE68000 | ose68000)
85927702724Smrg		basic_machine=m68000-ericsson
86027702724Smrg		os=-ose
86127702724Smrg		;;
86227702724Smrg	os68k)
86327702724Smrg		basic_machine=m68k-none
86427702724Smrg		os=-os68k
86527702724Smrg		;;
86627702724Smrg	pa-hitachi)
86727702724Smrg		basic_machine=hppa1.1-hitachi
86827702724Smrg		os=-hiuxwe2
86927702724Smrg		;;
87027702724Smrg	paragon)
87127702724Smrg		basic_machine=i860-intel
87227702724Smrg		os=-osf
87327702724Smrg		;;
874e19dfac4Smrg	parisc)
875e19dfac4Smrg		basic_machine=hppa-unknown
876e19dfac4Smrg		os=-linux
877e19dfac4Smrg		;;
878e19dfac4Smrg	parisc-*)
879e19dfac4Smrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
880e19dfac4Smrg		os=-linux
881e19dfac4Smrg		;;
88227702724Smrg	pbd)
88327702724Smrg		basic_machine=sparc-tti
88427702724Smrg		;;
88527702724Smrg	pbb)
88627702724Smrg		basic_machine=m68k-tti
88727702724Smrg		;;
88827702724Smrg	pc532 | pc532-*)
88927702724Smrg		basic_machine=ns32k-pc532
89027702724Smrg		;;
89127702724Smrg	pc98)
89227702724Smrg		basic_machine=i386-pc
89327702724Smrg		;;
89427702724Smrg	pc98-*)
89527702724Smrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
89627702724Smrg		;;
89727702724Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
89827702724Smrg		basic_machine=i586-pc
89927702724Smrg		;;
90027702724Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
90127702724Smrg		basic_machine=i686-pc
90227702724Smrg		;;
90327702724Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
90427702724Smrg		basic_machine=i686-pc
90527702724Smrg		;;
90627702724Smrg	pentium4)
90727702724Smrg		basic_machine=i786-pc
90827702724Smrg		;;
90927702724Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
91027702724Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
91127702724Smrg		;;
91227702724Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
91327702724Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
91427702724Smrg		;;
91527702724Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
91627702724Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
91727702724Smrg		;;
91827702724Smrg	pentium4-*)
91927702724Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
92027702724Smrg		;;
92127702724Smrg	pn)
92227702724Smrg		basic_machine=pn-gould
92327702724Smrg		;;
92427702724Smrg	power)	basic_machine=power-ibm
92527702724Smrg		;;
92627702724Smrg	ppc)	basic_machine=powerpc-unknown
92727702724Smrg		;;
92827702724Smrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
92927702724Smrg		;;
93027702724Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
93127702724Smrg		basic_machine=powerpcle-unknown
93227702724Smrg		;;
93327702724Smrg	ppcle-* | powerpclittle-*)
93427702724Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
93527702724Smrg		;;
93627702724Smrg	ppc64)	basic_machine=powerpc64-unknown
93727702724Smrg		;;
93827702724Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
93927702724Smrg		;;
94027702724Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
94127702724Smrg		basic_machine=powerpc64le-unknown
94227702724Smrg		;;
94327702724Smrg	ppc64le-* | powerpc64little-*)
94427702724Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
94527702724Smrg		;;
94627702724Smrg	ps2)
94727702724Smrg		basic_machine=i386-ibm
94827702724Smrg		;;
94927702724Smrg	pw32)
95027702724Smrg		basic_machine=i586-unknown
95127702724Smrg		os=-pw32
95227702724Smrg		;;
95327702724Smrg	rdos)
95427702724Smrg		basic_machine=i386-pc
95527702724Smrg		os=-rdos
95627702724Smrg		;;
95727702724Smrg	rom68k)
95827702724Smrg		basic_machine=m68k-rom68k
95927702724Smrg		os=-coff
96027702724Smrg		;;
96127702724Smrg	rm[46]00)
96227702724Smrg		basic_machine=mips-siemens
96327702724Smrg		;;
96427702724Smrg	rtpc | rtpc-*)
96527702724Smrg		basic_machine=romp-ibm
96627702724Smrg		;;
96727702724Smrg	s390 | s390-*)
96827702724Smrg		basic_machine=s390-ibm
96927702724Smrg		;;
97027702724Smrg	s390x | s390x-*)
97127702724Smrg		basic_machine=s390x-ibm
97227702724Smrg		;;
97327702724Smrg	sa29200)
97427702724Smrg		basic_machine=a29k-amd
97527702724Smrg		os=-udi
97627702724Smrg		;;
97727702724Smrg	sb1)
97827702724Smrg		basic_machine=mipsisa64sb1-unknown
97927702724Smrg		;;
98027702724Smrg	sb1el)
98127702724Smrg		basic_machine=mipsisa64sb1el-unknown
98227702724Smrg		;;
983e19dfac4Smrg	sde)
984e19dfac4Smrg		basic_machine=mipsisa32-sde
985e19dfac4Smrg		os=-elf
986e19dfac4Smrg		;;
98727702724Smrg	sei)
98827702724Smrg		basic_machine=mips-sei
98927702724Smrg		os=-seiux
99027702724Smrg		;;
99127702724Smrg	sequent)
99227702724Smrg		basic_machine=i386-sequent
99327702724Smrg		;;
99427702724Smrg	sh)
99527702724Smrg		basic_machine=sh-hitachi
99627702724Smrg		os=-hms
99727702724Smrg		;;
998e19dfac4Smrg	sh5el)
999e19dfac4Smrg		basic_machine=sh5le-unknown
1000e19dfac4Smrg		;;
100127702724Smrg	sh64)
100227702724Smrg		basic_machine=sh64-unknown
100327702724Smrg		;;
100427702724Smrg	sparclite-wrs | simso-wrs)
100527702724Smrg		basic_machine=sparclite-wrs
100627702724Smrg		os=-vxworks
100727702724Smrg		;;
100827702724Smrg	sps7)
100927702724Smrg		basic_machine=m68k-bull
101027702724Smrg		os=-sysv2
101127702724Smrg		;;
101227702724Smrg	spur)
101327702724Smrg		basic_machine=spur-unknown
101427702724Smrg		;;
101527702724Smrg	st2000)
101627702724Smrg		basic_machine=m68k-tandem
101727702724Smrg		;;
101827702724Smrg	stratus)
101927702724Smrg		basic_machine=i860-stratus
102027702724Smrg		os=-sysv4
102127702724Smrg		;;
102227702724Smrg	sun2)
102327702724Smrg		basic_machine=m68000-sun
102427702724Smrg		;;
102527702724Smrg	sun2os3)
102627702724Smrg		basic_machine=m68000-sun
102727702724Smrg		os=-sunos3
102827702724Smrg		;;
102927702724Smrg	sun2os4)
103027702724Smrg		basic_machine=m68000-sun
103127702724Smrg		os=-sunos4
103227702724Smrg		;;
103327702724Smrg	sun3os3)
103427702724Smrg		basic_machine=m68k-sun
103527702724Smrg		os=-sunos3
103627702724Smrg		;;
103727702724Smrg	sun3os4)
103827702724Smrg		basic_machine=m68k-sun
103927702724Smrg		os=-sunos4
104027702724Smrg		;;
104127702724Smrg	sun4os3)
104227702724Smrg		basic_machine=sparc-sun
104327702724Smrg		os=-sunos3
104427702724Smrg		;;
104527702724Smrg	sun4os4)
104627702724Smrg		basic_machine=sparc-sun
104727702724Smrg		os=-sunos4
104827702724Smrg		;;
104927702724Smrg	sun4sol2)
105027702724Smrg		basic_machine=sparc-sun
105127702724Smrg		os=-solaris2
105227702724Smrg		;;
105327702724Smrg	sun3 | sun3-*)
105427702724Smrg		basic_machine=m68k-sun
105527702724Smrg		;;
105627702724Smrg	sun4)
105727702724Smrg		basic_machine=sparc-sun
105827702724Smrg		;;
105927702724Smrg	sun386 | sun386i | roadrunner)
106027702724Smrg		basic_machine=i386-sun
106127702724Smrg		;;
106227702724Smrg	sv1)
106327702724Smrg		basic_machine=sv1-cray
106427702724Smrg		os=-unicos
106527702724Smrg		;;
106627702724Smrg	symmetry)
106727702724Smrg		basic_machine=i386-sequent
106827702724Smrg		os=-dynix
106927702724Smrg		;;
107027702724Smrg	t3e)
107127702724Smrg		basic_machine=alphaev5-cray
107227702724Smrg		os=-unicos
107327702724Smrg		;;
107427702724Smrg	t90)
107527702724Smrg		basic_machine=t90-cray
107627702724Smrg		os=-unicos
107727702724Smrg		;;
107827702724Smrg	tic54x | c54x*)
107927702724Smrg		basic_machine=tic54x-unknown
108027702724Smrg		os=-coff
108127702724Smrg		;;
108227702724Smrg	tic55x | c55x*)
108327702724Smrg		basic_machine=tic55x-unknown
108427702724Smrg		os=-coff
108527702724Smrg		;;
108627702724Smrg	tic6x | c6x*)
108727702724Smrg		basic_machine=tic6x-unknown
108827702724Smrg		os=-coff
108927702724Smrg		;;
109000084f2cSmrg        # This must be matched before tile*.
109100084f2cSmrg        tilegx*)
109200084f2cSmrg		basic_machine=tilegx-unknown
109300084f2cSmrg		os=-linux-gnu
109400084f2cSmrg		;;
1095e19dfac4Smrg	tile*)
1096e19dfac4Smrg		basic_machine=tile-unknown
1097e19dfac4Smrg		os=-linux-gnu
1098e19dfac4Smrg		;;
109927702724Smrg	tx39)
110027702724Smrg		basic_machine=mipstx39-unknown
110127702724Smrg		;;
110227702724Smrg	tx39el)
110327702724Smrg		basic_machine=mipstx39el-unknown
110427702724Smrg		;;
110527702724Smrg	toad1)
110627702724Smrg		basic_machine=pdp10-xkl
110727702724Smrg		os=-tops20
110827702724Smrg		;;
110927702724Smrg	tower | tower-32)
111027702724Smrg		basic_machine=m68k-ncr
111127702724Smrg		;;
111227702724Smrg	tpf)
111327702724Smrg		basic_machine=s390x-ibm
111427702724Smrg		os=-tpf
111527702724Smrg		;;
111627702724Smrg	udi29k)
111727702724Smrg		basic_machine=a29k-amd
111827702724Smrg		os=-udi
111927702724Smrg		;;
112027702724Smrg	ultra3)
112127702724Smrg		basic_machine=a29k-nyu
112227702724Smrg		os=-sym1
112327702724Smrg		;;
112427702724Smrg	v810 | necv810)
112527702724Smrg		basic_machine=v810-nec
112627702724Smrg		os=-none
112727702724Smrg		;;
112827702724Smrg	vaxv)
112927702724Smrg		basic_machine=vax-dec
113027702724Smrg		os=-sysv
113127702724Smrg		;;
113227702724Smrg	vms)
113327702724Smrg		basic_machine=vax-dec
113427702724Smrg		os=-vms
113527702724Smrg		;;
113627702724Smrg	vpp*|vx|vx-*)
113727702724Smrg		basic_machine=f301-fujitsu
113827702724Smrg		;;
113927702724Smrg	vxworks960)
114027702724Smrg		basic_machine=i960-wrs
114127702724Smrg		os=-vxworks
114227702724Smrg		;;
114327702724Smrg	vxworks68)
114427702724Smrg		basic_machine=m68k-wrs
114527702724Smrg		os=-vxworks
114627702724Smrg		;;
114727702724Smrg	vxworks29k)
114827702724Smrg		basic_machine=a29k-wrs
114927702724Smrg		os=-vxworks
115027702724Smrg		;;
115127702724Smrg	w65*)
115227702724Smrg		basic_machine=w65-wdc
115327702724Smrg		os=-none
115427702724Smrg		;;
115527702724Smrg	w89k-*)
115627702724Smrg		basic_machine=hppa1.1-winbond
115727702724Smrg		os=-proelf
115827702724Smrg		;;
115927702724Smrg	xbox)
116027702724Smrg		basic_machine=i686-pc
116127702724Smrg		os=-mingw32
116227702724Smrg		;;
116327702724Smrg	xps | xps100)
116427702724Smrg		basic_machine=xps100-honeywell
116527702724Smrg		;;
116627702724Smrg	ymp)
116727702724Smrg		basic_machine=ymp-cray
116827702724Smrg		os=-unicos
116927702724Smrg		;;
117027702724Smrg	z8k-*-coff)
117127702724Smrg		basic_machine=z8k-unknown
117227702724Smrg		os=-sim
117327702724Smrg		;;
117400084f2cSmrg	z80-*-coff)
117500084f2cSmrg		basic_machine=z80-unknown
117600084f2cSmrg		os=-sim
117700084f2cSmrg		;;
117827702724Smrg	none)
117927702724Smrg		basic_machine=none-none
118027702724Smrg		os=-none
118127702724Smrg		;;
118227702724Smrg
118327702724Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
118427702724Smrg# some cases the only manufacturer, in others, it is the most popular.
118527702724Smrg	w89k)
118627702724Smrg		basic_machine=hppa1.1-winbond
118727702724Smrg		;;
118827702724Smrg	op50n)
118927702724Smrg		basic_machine=hppa1.1-oki
119027702724Smrg		;;
119127702724Smrg	op60c)
119227702724Smrg		basic_machine=hppa1.1-oki
119327702724Smrg		;;
119427702724Smrg	romp)
119527702724Smrg		basic_machine=romp-ibm
119627702724Smrg		;;
119727702724Smrg	mmix)
119827702724Smrg		basic_machine=mmix-knuth
119927702724Smrg		;;
120027702724Smrg	rs6000)
120127702724Smrg		basic_machine=rs6000-ibm
120227702724Smrg		;;
120327702724Smrg	vax)
120427702724Smrg		basic_machine=vax-dec
120527702724Smrg		;;
120627702724Smrg	pdp10)
120727702724Smrg		# there are many clones, so DEC is not a safe bet
120827702724Smrg		basic_machine=pdp10-unknown
120927702724Smrg		;;
121027702724Smrg	pdp11)
121127702724Smrg		basic_machine=pdp11-dec
121227702724Smrg		;;
121327702724Smrg	we32k)
121427702724Smrg		basic_machine=we32k-att
121527702724Smrg		;;
121600084f2cSmrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
121727702724Smrg		basic_machine=sh-unknown
121827702724Smrg		;;
1219e19dfac4Smrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
122027702724Smrg		basic_machine=sparc-sun
122127702724Smrg		;;
122227702724Smrg	cydra)
122327702724Smrg		basic_machine=cydra-cydrome
122427702724Smrg		;;
122527702724Smrg	orion)
122627702724Smrg		basic_machine=orion-highlevel
122727702724Smrg		;;
122827702724Smrg	orion105)
122927702724Smrg		basic_machine=clipper-highlevel
123027702724Smrg		;;
123127702724Smrg	mac | mpw | mac-mpw)
123227702724Smrg		basic_machine=m68k-apple
123327702724Smrg		;;
123427702724Smrg	pmac | pmac-mpw)
123527702724Smrg		basic_machine=powerpc-apple
123627702724Smrg		;;
123727702724Smrg	*-unknown)
123827702724Smrg		# Make sure to match an already-canonicalized machine name.
123927702724Smrg		;;
124027702724Smrg	*)
124127702724Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
124227702724Smrg		exit 1
124327702724Smrg		;;
124427702724Smrgesac
124527702724Smrg
124627702724Smrg# Here we canonicalize certain aliases for manufacturers.
124727702724Smrgcase $basic_machine in
124827702724Smrg	*-digital*)
124927702724Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
125027702724Smrg		;;
125127702724Smrg	*-commodore*)
125227702724Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
125327702724Smrg		;;
125427702724Smrg	*)
125527702724Smrg		;;
125627702724Smrgesac
125727702724Smrg
125827702724Smrg# Decode manufacturer-specific aliases for certain operating systems.
125927702724Smrg
126027702724Smrgif [ x"$os" != x"" ]
126127702724Smrgthen
126227702724Smrgcase $os in
126327702724Smrg        # First match some system type aliases
126427702724Smrg        # that might get confused with valid system types.
126527702724Smrg	# -solaris* is a basic system type, with this one exception.
126600084f2cSmrg        -auroraux)
126700084f2cSmrg	        os=-auroraux
126800084f2cSmrg		;;
126927702724Smrg	-solaris1 | -solaris1.*)
127027702724Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
127127702724Smrg		;;
127227702724Smrg	-solaris)
127327702724Smrg		os=-solaris2
127427702724Smrg		;;
127527702724Smrg	-svr4*)
127627702724Smrg		os=-sysv4
127727702724Smrg		;;
127827702724Smrg	-unixware*)
127927702724Smrg		os=-sysv4.2uw
128027702724Smrg		;;
128127702724Smrg	-gnu/linux*)
128227702724Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
128327702724Smrg		;;
128427702724Smrg	# First accept the basic system types.
128527702724Smrg	# The portable systems comes first.
128627702724Smrg	# Each alternative MUST END IN A *, to match a version number.
128727702724Smrg	# -sysv* is not here because it comes later, after sysvr4.
128827702724Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
128900084f2cSmrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
129000084f2cSmrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
129100084f2cSmrg	      | -sym* | -kopensolaris* \
129227702724Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
129300084f2cSmrg	      | -aos* | -aros* \
129427702724Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
129527702724Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
129627702724Smrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
129727702724Smrg	      | -openbsd* | -solidbsd* \
129827702724Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
129927702724Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
130027702724Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
130127702724Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
130200084f2cSmrg	      | -chorusos* | -chorusrdb* | -cegcc* \
130327702724Smrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
130427702724Smrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
130527702724Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
130627702724Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
130727702724Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
130827702724Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
130927702724Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
131027702724Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
131127702724Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
131200084f2cSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
131327702724Smrg	# Remember, each alternative MUST END IN *, to match a version number.
131427702724Smrg		;;
131527702724Smrg	-qnx*)
131627702724Smrg		case $basic_machine in
131727702724Smrg		    x86-* | i*86-*)
131827702724Smrg			;;
131927702724Smrg		    *)
132027702724Smrg			os=-nto$os
132127702724Smrg			;;
132227702724Smrg		esac
132327702724Smrg		;;
132427702724Smrg	-nto-qnx*)
132527702724Smrg		;;
132627702724Smrg	-nto*)
132727702724Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
132827702724Smrg		;;
132927702724Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
133027702724Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
133127702724Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
133227702724Smrg		;;
133327702724Smrg	-mac*)
133427702724Smrg		os=`echo $os | sed -e 's|mac|macos|'`
133527702724Smrg		;;
133627702724Smrg	-linux-dietlibc)
133727702724Smrg		os=-linux-dietlibc
133827702724Smrg		;;
133927702724Smrg	-linux*)
134027702724Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
134127702724Smrg		;;
134227702724Smrg	-sunos5*)
134327702724Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
134427702724Smrg		;;
134527702724Smrg	-sunos6*)
134627702724Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
134727702724Smrg		;;
134827702724Smrg	-opened*)
134927702724Smrg		os=-openedition
135027702724Smrg		;;
135127702724Smrg        -os400*)
135227702724Smrg		os=-os400
135327702724Smrg		;;
135427702724Smrg	-wince*)
135527702724Smrg		os=-wince
135627702724Smrg		;;
135727702724Smrg	-osfrose*)
135827702724Smrg		os=-osfrose
135927702724Smrg		;;
136027702724Smrg	-osf*)
136127702724Smrg		os=-osf
136227702724Smrg		;;
136327702724Smrg	-utek*)
136427702724Smrg		os=-bsd
136527702724Smrg		;;
136627702724Smrg	-dynix*)
136727702724Smrg		os=-bsd
136827702724Smrg		;;
136927702724Smrg	-acis*)
137027702724Smrg		os=-aos
137127702724Smrg		;;
137227702724Smrg	-atheos*)
137327702724Smrg		os=-atheos
137427702724Smrg		;;
137527702724Smrg	-syllable*)
137627702724Smrg		os=-syllable
137727702724Smrg		;;
137827702724Smrg	-386bsd)
137927702724Smrg		os=-bsd
138027702724Smrg		;;
138127702724Smrg	-ctix* | -uts*)
138227702724Smrg		os=-sysv
138327702724Smrg		;;
138427702724Smrg	-nova*)
138527702724Smrg		os=-rtmk-nova
138627702724Smrg		;;
138727702724Smrg	-ns2 )
138827702724Smrg		os=-nextstep2
138927702724Smrg		;;
139027702724Smrg	-nsk*)
139127702724Smrg		os=-nsk
139227702724Smrg		;;
139327702724Smrg	# Preserve the version number of sinix5.
139427702724Smrg	-sinix5.*)
139527702724Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
139627702724Smrg		;;
139727702724Smrg	-sinix*)
139827702724Smrg		os=-sysv4
139927702724Smrg		;;
140027702724Smrg        -tpf*)
140127702724Smrg		os=-tpf
140227702724Smrg		;;
140327702724Smrg	-triton*)
140427702724Smrg		os=-sysv3
140527702724Smrg		;;
140627702724Smrg	-oss*)
140727702724Smrg		os=-sysv3
140827702724Smrg		;;
140927702724Smrg	-svr4)
141027702724Smrg		os=-sysv4
141127702724Smrg		;;
141227702724Smrg	-svr3)
141327702724Smrg		os=-sysv3
141427702724Smrg		;;
141527702724Smrg	-sysvr4)
141627702724Smrg		os=-sysv4
141727702724Smrg		;;
141827702724Smrg	# This must come after -sysvr4.
141927702724Smrg	-sysv*)
142027702724Smrg		;;
142127702724Smrg	-ose*)
142227702724Smrg		os=-ose
142327702724Smrg		;;
142427702724Smrg	-es1800*)
142527702724Smrg		os=-ose
142627702724Smrg		;;
142727702724Smrg	-xenix)
142827702724Smrg		os=-xenix
142927702724Smrg		;;
143027702724Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
143127702724Smrg		os=-mint
143227702724Smrg		;;
143327702724Smrg	-aros*)
143427702724Smrg		os=-aros
143527702724Smrg		;;
143627702724Smrg	-kaos*)
143727702724Smrg		os=-kaos
143827702724Smrg		;;
143927702724Smrg	-zvmoe)
144027702724Smrg		os=-zvmoe
144127702724Smrg		;;
144200084f2cSmrg	-dicos*)
144300084f2cSmrg		os=-dicos
144400084f2cSmrg		;;
144500084f2cSmrg        -nacl*)
144600084f2cSmrg	        ;;
144727702724Smrg	-none)
144827702724Smrg		;;
144927702724Smrg	*)
145027702724Smrg		# Get rid of the `-' at the beginning of $os.
145127702724Smrg		os=`echo $os | sed 's/[^-]*-//'`
145227702724Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
145327702724Smrg		exit 1
145427702724Smrg		;;
145527702724Smrgesac
145627702724Smrgelse
145727702724Smrg
145827702724Smrg# Here we handle the default operating systems that come with various machines.
145927702724Smrg# The value should be what the vendor currently ships out the door with their
146027702724Smrg# machine or put another way, the most popular os provided with the machine.
146127702724Smrg
146227702724Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
146327702724Smrg# "-sun"), then you have to tell the case statement up towards the top
146427702724Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
146527702724Smrg# will signal an error saying that MANUFACTURER isn't an operating
146627702724Smrg# system, and we'll never get to this point.
146727702724Smrg
146827702724Smrgcase $basic_machine in
1469e19dfac4Smrg        score-*)
1470e19dfac4Smrg		os=-elf
1471e19dfac4Smrg		;;
1472e19dfac4Smrg        spu-*)
1473e19dfac4Smrg		os=-elf
1474e19dfac4Smrg		;;
147527702724Smrg	*-acorn)
147627702724Smrg		os=-riscix1.2
147727702724Smrg		;;
147827702724Smrg	arm*-rebel)
147927702724Smrg		os=-linux
148027702724Smrg		;;
148127702724Smrg	arm*-semi)
148227702724Smrg		os=-aout
148327702724Smrg		;;
1484e19dfac4Smrg        c4x-* | tic4x-*)
1485e19dfac4Smrg        	os=-coff
1486e19dfac4Smrg		;;
148727702724Smrg	# This must come before the *-dec entry.
148827702724Smrg	pdp10-*)
148927702724Smrg		os=-tops20
149027702724Smrg		;;
149127702724Smrg	pdp11-*)
149227702724Smrg		os=-none
149327702724Smrg		;;
149427702724Smrg	*-dec | vax-*)
149527702724Smrg		os=-ultrix4.2
149627702724Smrg		;;
149727702724Smrg	m68*-apollo)
149827702724Smrg		os=-domain
149927702724Smrg		;;
150027702724Smrg	i386-sun)
150127702724Smrg		os=-sunos4.0.2
150227702724Smrg		;;
150327702724Smrg	m68000-sun)
150427702724Smrg		os=-sunos3
150527702724Smrg		# This also exists in the configure program, but was not the
150627702724Smrg		# default.
150727702724Smrg		# os=-sunos4
150827702724Smrg		;;
150927702724Smrg	m68*-cisco)
151027702724Smrg		os=-aout
151127702724Smrg		;;
1512e19dfac4Smrg        mep-*)
1513e19dfac4Smrg		os=-elf
1514e19dfac4Smrg		;;
151527702724Smrg	mips*-cisco)
151627702724Smrg		os=-elf
151727702724Smrg		;;
151827702724Smrg	mips*-*)
151927702724Smrg		os=-elf
152027702724Smrg		;;
152127702724Smrg	or32-*)
152227702724Smrg		os=-coff
152327702724Smrg		;;
152427702724Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
152527702724Smrg		os=-sysv3
152627702724Smrg		;;
152727702724Smrg	sparc-* | *-sun)
152827702724Smrg		os=-sunos4.1.1
152927702724Smrg		;;
153027702724Smrg	*-be)
153127702724Smrg		os=-beos
153227702724Smrg		;;
153327702724Smrg	*-haiku)
153427702724Smrg		os=-haiku
153527702724Smrg		;;
153627702724Smrg	*-ibm)
153727702724Smrg		os=-aix
153827702724Smrg		;;
153927702724Smrg    	*-knuth)
154027702724Smrg		os=-mmixware
154127702724Smrg		;;
154227702724Smrg	*-wec)
154327702724Smrg		os=-proelf
154427702724Smrg		;;
154527702724Smrg	*-winbond)
154627702724Smrg		os=-proelf
154727702724Smrg		;;
154827702724Smrg	*-oki)
154927702724Smrg		os=-proelf
155027702724Smrg		;;
155127702724Smrg	*-hp)
155227702724Smrg		os=-hpux
155327702724Smrg		;;
155427702724Smrg	*-hitachi)
155527702724Smrg		os=-hiux
155627702724Smrg		;;
155727702724Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
155827702724Smrg		os=-sysv
155927702724Smrg		;;
156027702724Smrg	*-cbm)
156127702724Smrg		os=-amigaos
156227702724Smrg		;;
156327702724Smrg	*-dg)
156427702724Smrg		os=-dgux
156527702724Smrg		;;
156627702724Smrg	*-dolphin)
156727702724Smrg		os=-sysv3
156827702724Smrg		;;
156927702724Smrg	m68k-ccur)
157027702724Smrg		os=-rtu
157127702724Smrg		;;
157227702724Smrg	m88k-omron*)
157327702724Smrg		os=-luna
157427702724Smrg		;;
157527702724Smrg	*-next )
157627702724Smrg		os=-nextstep
157727702724Smrg		;;
157827702724Smrg	*-sequent)
157927702724Smrg		os=-ptx
158027702724Smrg		;;
158127702724Smrg	*-crds)
158227702724Smrg		os=-unos
158327702724Smrg		;;
158427702724Smrg	*-ns)
158527702724Smrg		os=-genix
158627702724Smrg		;;
158727702724Smrg	i370-*)
158827702724Smrg		os=-mvs
158927702724Smrg		;;
159027702724Smrg	*-next)
159127702724Smrg		os=-nextstep3
159227702724Smrg		;;
159327702724Smrg	*-gould)
159427702724Smrg		os=-sysv
159527702724Smrg		;;
159627702724Smrg	*-highlevel)
159727702724Smrg		os=-bsd
159827702724Smrg		;;
159927702724Smrg	*-encore)
160027702724Smrg		os=-bsd
160127702724Smrg		;;
160227702724Smrg	*-sgi)
160327702724Smrg		os=-irix
160427702724Smrg		;;
160527702724Smrg	*-siemens)
160627702724Smrg		os=-sysv4
160727702724Smrg		;;
160827702724Smrg	*-masscomp)
160927702724Smrg		os=-rtu
161027702724Smrg		;;
161127702724Smrg	f30[01]-fujitsu | f700-fujitsu)
161227702724Smrg		os=-uxpv
161327702724Smrg		;;
161427702724Smrg	*-rom68k)
161527702724Smrg		os=-coff
161627702724Smrg		;;
161727702724Smrg	*-*bug)
161827702724Smrg		os=-coff
161927702724Smrg		;;
162027702724Smrg	*-apple)
162127702724Smrg		os=-macos
162227702724Smrg		;;
162327702724Smrg	*-atari*)
162427702724Smrg		os=-mint
162527702724Smrg		;;
162627702724Smrg	*)
162727702724Smrg		os=-none
162827702724Smrg		;;
162927702724Smrgesac
163027702724Smrgfi
163127702724Smrg
163227702724Smrg# Here we handle the case where we know the os, and the CPU type, but not the
163327702724Smrg# manufacturer.  We pick the logical manufacturer.
163427702724Smrgvendor=unknown
163527702724Smrgcase $basic_machine in
163627702724Smrg	*-unknown)
163727702724Smrg		case $os in
163827702724Smrg			-riscix*)
163927702724Smrg				vendor=acorn
164027702724Smrg				;;
164127702724Smrg			-sunos*)
164227702724Smrg				vendor=sun
164327702724Smrg				;;
164400084f2cSmrg			-cnk*|-aix*)
164527702724Smrg				vendor=ibm
164627702724Smrg				;;
164727702724Smrg			-beos*)
164827702724Smrg				vendor=be
164927702724Smrg				;;
165027702724Smrg			-hpux*)
165127702724Smrg				vendor=hp
165227702724Smrg				;;
165327702724Smrg			-mpeix*)
165427702724Smrg				vendor=hp
165527702724Smrg				;;
165627702724Smrg			-hiux*)
165727702724Smrg				vendor=hitachi
165827702724Smrg				;;
165927702724Smrg			-unos*)
166027702724Smrg				vendor=crds
166127702724Smrg				;;
166227702724Smrg			-dgux*)
166327702724Smrg				vendor=dg
166427702724Smrg				;;
166527702724Smrg			-luna*)
166627702724Smrg				vendor=omron
166727702724Smrg				;;
166827702724Smrg			-genix*)
166927702724Smrg				vendor=ns
167027702724Smrg				;;
167127702724Smrg			-mvs* | -opened*)
167227702724Smrg				vendor=ibm
167327702724Smrg				;;
167427702724Smrg			-os400*)
167527702724Smrg				vendor=ibm
167627702724Smrg				;;
167727702724Smrg			-ptx*)
167827702724Smrg				vendor=sequent
167927702724Smrg				;;
168027702724Smrg			-tpf*)
168127702724Smrg				vendor=ibm
168227702724Smrg				;;
168327702724Smrg			-vxsim* | -vxworks* | -windiss*)
168427702724Smrg				vendor=wrs
168527702724Smrg				;;
168627702724Smrg			-aux*)
168727702724Smrg				vendor=apple
168827702724Smrg				;;
168927702724Smrg			-hms*)
169027702724Smrg				vendor=hitachi
169127702724Smrg				;;
169227702724Smrg			-mpw* | -macos*)
169327702724Smrg				vendor=apple
169427702724Smrg				;;
169527702724Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
169627702724Smrg				vendor=atari
169727702724Smrg				;;
169827702724Smrg			-vos*)
169927702724Smrg				vendor=stratus
170027702724Smrg				;;
170127702724Smrg		esac
170227702724Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
170327702724Smrg		;;
170427702724Smrgesac
170527702724Smrg
170627702724Smrgecho $basic_machine$os
170727702724Smrgexit
170827702724Smrg
170927702724Smrg# Local variables:
171027702724Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
171127702724Smrg# time-stamp-start: "timestamp='"
171227702724Smrg# time-stamp-format: "%:y-%02m-%02d"
171327702724Smrg# time-stamp-end: "'"
171427702724Smrg# End:
1715