config.sub revision 76888252
176888252Smrg#! /bin/sh
276888252Smrg# Configuration validation subroutine script.
376888252Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
476888252Smrg#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
576888252Smrg
676888252Smrgtimestamp='2003-06-18'
776888252Smrg
876888252Smrg# This file is (in principle) common to ALL GNU software.
976888252Smrg# The presence of a machine in this file suggests that SOME GNU software
1076888252Smrg# can handle that machine.  It does not imply ALL GNU software can.
1176888252Smrg#
1276888252Smrg# This file is free software; you can redistribute it and/or modify
1376888252Smrg# it under the terms of the GNU General Public License as published by
1476888252Smrg# the Free Software Foundation; either version 2 of the License, or
1576888252Smrg# (at your option) any later version.
1676888252Smrg#
1776888252Smrg# This program is distributed in the hope that it will be useful,
1876888252Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
1976888252Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2076888252Smrg# GNU General Public License for more details.
2176888252Smrg#
2276888252Smrg# You should have received a copy of the GNU General Public License
2376888252Smrg# along with this program; if not, write to the Free Software
2476888252Smrg# Foundation, Inc., 59 Temple Place - Suite 330,
2576888252Smrg# Boston, MA 02111-1307, USA.
2676888252Smrg
2776888252Smrg# As a special exception to the GNU General Public License, if you
2876888252Smrg# distribute this file as part of a program that contains a
2976888252Smrg# configuration script generated by Autoconf, you may include it under
3076888252Smrg# the same distribution terms that you use for the rest of that program.
3176888252Smrg
3276888252Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3376888252Smrg# diff and a properly formatted ChangeLog entry.
3476888252Smrg#
3576888252Smrg# Configuration subroutine to validate and canonicalize a configuration type.
3676888252Smrg# Supply the specified configuration type as an argument.
3776888252Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
3876888252Smrg# Otherwise, we print the canonical config type on stdout and succeed.
3976888252Smrg
4076888252Smrg# This file is supposed to be the same for all GNU packages
4176888252Smrg# and recognize all the CPU types, system types and aliases
4276888252Smrg# that are meaningful with *any* GNU software.
4376888252Smrg# Each package is responsible for reporting which valid configurations
4476888252Smrg# it does not support.  The user should be able to distinguish
4576888252Smrg# a failure to support a valid configuration from a meaningless
4676888252Smrg# configuration.
4776888252Smrg
4876888252Smrg# The goal of this file is to map all the various variations of a given
4976888252Smrg# machine specification into a single specification in the form:
5076888252Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5176888252Smrg# or in some cases, the newer four-part form:
5276888252Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5376888252Smrg# It is wrong to echo any other type of specification.
5476888252Smrg
5576888252Smrgme=`echo "$0" | sed -e 's,.*/,,'`
5676888252Smrg
5776888252Smrgusage="\
5876888252SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
5976888252Smrg       $0 [OPTION] ALIAS
6076888252Smrg
6176888252SmrgCanonicalize a configuration name.
6276888252Smrg
6376888252SmrgOperation modes:
6476888252Smrg  -h, --help         print this help, then exit
6576888252Smrg  -t, --time-stamp   print date of last modification, then exit
6676888252Smrg  -v, --version      print version number, then exit
6776888252Smrg
6876888252SmrgReport bugs and patches to <config-patches@gnu.org>."
6976888252Smrg
7076888252Smrgversion="\
7176888252SmrgGNU config.sub ($timestamp)
7276888252Smrg
7376888252SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
7476888252SmrgFree Software Foundation, Inc.
7576888252Smrg
7676888252SmrgThis is free software; see the source for copying conditions.  There is NO
7776888252Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
7876888252Smrg
7976888252Smrghelp="
8076888252SmrgTry \`$me --help' for more information."
8176888252Smrg
8276888252Smrg# Parse command line
8376888252Smrgwhile test $# -gt 0 ; do
8476888252Smrg  case $1 in
8576888252Smrg    --time-stamp | --time* | -t )
8676888252Smrg       echo "$timestamp" ; exit 0 ;;
8776888252Smrg    --version | -v )
8876888252Smrg       echo "$version" ; exit 0 ;;
8976888252Smrg    --help | --h* | -h )
9076888252Smrg       echo "$usage"; exit 0 ;;
9176888252Smrg    -- )     # Stop option processing
9276888252Smrg       shift; break ;;
9376888252Smrg    - )	# Use stdin as input.
9476888252Smrg       break ;;
9576888252Smrg    -* )
9676888252Smrg       echo "$me: invalid option $1$help"
9776888252Smrg       exit 1 ;;
9876888252Smrg
9976888252Smrg    *local*)
10076888252Smrg       # First pass through any local machine types.
10176888252Smrg       echo $1
10276888252Smrg       exit 0;;
10376888252Smrg
10476888252Smrg    * )
10576888252Smrg       break ;;
10676888252Smrg  esac
10776888252Smrgdone
10876888252Smrg
10976888252Smrgcase $# in
11076888252Smrg 0) echo "$me: missing argument$help" >&2
11176888252Smrg    exit 1;;
11276888252Smrg 1) ;;
11376888252Smrg *) echo "$me: too many arguments$help" >&2
11476888252Smrg    exit 1;;
11576888252Smrgesac
11676888252Smrg
11776888252Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
11876888252Smrg# Here we must recognize all the valid KERNEL-OS combinations.
11976888252Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12076888252Smrgcase $maybe_os in
12176888252Smrg  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
12276888252Smrg    os=-$maybe_os
12376888252Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
12476888252Smrg    ;;
12576888252Smrg  *)
12676888252Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
12776888252Smrg    if [ $basic_machine != $1 ]
12876888252Smrg    then os=`echo $1 | sed 's/.*-/-/'`
12976888252Smrg    else os=; fi
13076888252Smrg    ;;
13176888252Smrgesac
13276888252Smrg
13376888252Smrg### Let's recognize common machines as not being operating systems so
13476888252Smrg### that things like config.sub decstation-3100 work.  We also
13576888252Smrg### recognize some manufacturers as not being operating systems, so we
13676888252Smrg### can provide default operating systems below.
13776888252Smrgcase $os in
13876888252Smrg	-sun*os*)
13976888252Smrg		# Prevent following clause from handling this invalid input.
14076888252Smrg		;;
14176888252Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
14276888252Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
14376888252Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
14476888252Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
14576888252Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
14676888252Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
14776888252Smrg	-apple | -axis)
14876888252Smrg		os=
14976888252Smrg		basic_machine=$1
15076888252Smrg		;;
15176888252Smrg	-sim | -cisco | -oki | -wec | -winbond)
15276888252Smrg		os=
15376888252Smrg		basic_machine=$1
15476888252Smrg		;;
15576888252Smrg	-scout)
15676888252Smrg		;;
15776888252Smrg	-wrs)
15876888252Smrg		os=-vxworks
15976888252Smrg		basic_machine=$1
16076888252Smrg		;;
16176888252Smrg	-chorusos*)
16276888252Smrg		os=-chorusos
16376888252Smrg		basic_machine=$1
16476888252Smrg		;;
16576888252Smrg 	-chorusrdb)
16676888252Smrg 		os=-chorusrdb
16776888252Smrg		basic_machine=$1
16876888252Smrg 		;;
16976888252Smrg	-hiux*)
17076888252Smrg		os=-hiuxwe2
17176888252Smrg		;;
17276888252Smrg	-sco5)
17376888252Smrg		os=-sco3.2v5
17476888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
17576888252Smrg		;;
17676888252Smrg	-sco4)
17776888252Smrg		os=-sco3.2v4
17876888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
17976888252Smrg		;;
18076888252Smrg	-sco3.2.[4-9]*)
18176888252Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
18276888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18376888252Smrg		;;
18476888252Smrg	-sco3.2v[4-9]*)
18576888252Smrg		# Don't forget version if it is 3.2v4 or newer.
18676888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18776888252Smrg		;;
18876888252Smrg	-sco*)
18976888252Smrg		os=-sco3.2v2
19076888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19176888252Smrg		;;
19276888252Smrg	-udk*)
19376888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19476888252Smrg		;;
19576888252Smrg	-isc)
19676888252Smrg		os=-isc2.2
19776888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19876888252Smrg		;;
19976888252Smrg	-clix*)
20076888252Smrg		basic_machine=clipper-intergraph
20176888252Smrg		;;
20276888252Smrg	-isc*)
20376888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20476888252Smrg		;;
20576888252Smrg	-lynx*)
20676888252Smrg		os=-lynxos
20776888252Smrg		;;
20876888252Smrg	-ptx*)
20976888252Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
21076888252Smrg		;;
21176888252Smrg	-windowsnt*)
21276888252Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
21376888252Smrg		;;
21476888252Smrg	-psos*)
21576888252Smrg		os=-psos
21676888252Smrg		;;
21776888252Smrg	-mint | -mint[0-9]*)
21876888252Smrg		basic_machine=m68k-atari
21976888252Smrg		os=-mint
22076888252Smrg		;;
22176888252Smrgesac
22276888252Smrg
22376888252Smrg# Decode aliases for certain CPU-COMPANY combinations.
22476888252Smrgcase $basic_machine in
22576888252Smrg	# Recognize the basic CPU types without company name.
22676888252Smrg	# Some are omitted here because they have special meanings below.
22776888252Smrg	1750a | 580 \
22876888252Smrg	| a29k \
22976888252Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
23076888252Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
23176888252Smrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
23276888252Smrg	| c4x | clipper \
23376888252Smrg	| d10v | d30v | dlx | dsp16xx \
23476888252Smrg	| fr30 | frv \
23576888252Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
23676888252Smrg	| i370 | i860 | i960 | ia64 \
23776888252Smrg	| ip2k \
23876888252Smrg	| m32r | m68000 | m68k | m88k | mcore \
23976888252Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
24076888252Smrg	| mips16 \
24176888252Smrg	| mips64 | mips64el \
24276888252Smrg	| mips64vr | mips64vrel \
24376888252Smrg	| mips64orion | mips64orionel \
24476888252Smrg	| mips64vr4100 | mips64vr4100el \
24576888252Smrg	| mips64vr4300 | mips64vr4300el \
24676888252Smrg	| mips64vr5000 | mips64vr5000el \
24776888252Smrg	| mipsisa32 | mipsisa32el \
24876888252Smrg	| mipsisa32r2 | mipsisa32r2el \
24976888252Smrg	| mipsisa64 | mipsisa64el \
25076888252Smrg	| mipsisa64sb1 | mipsisa64sb1el \
25176888252Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
25276888252Smrg	| mipstx39 | mipstx39el \
25376888252Smrg	| mn10200 | mn10300 \
25476888252Smrg	| msp430 \
25576888252Smrg	| ns16k | ns32k \
25676888252Smrg	| openrisc | or32 \
25776888252Smrg	| pdp10 | pdp11 | pj | pjl \
25876888252Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
25976888252Smrg	| pyramid \
26076888252Smrg	| s390 | s390x \
26176888252Smrg	| sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
26276888252Smrg	| sh64 | sh64le \
26376888252Smrg	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
26476888252Smrg	| strongarm \
26576888252Smrg	| tahoe | thumb | tic4x | tic80 | tron \
26676888252Smrg	| v850 | v850e \
26776888252Smrg	| we32k \
26876888252Smrg	| x86 | xscale | xstormy16 | xtensa \
26976888252Smrg	| z8k)
27076888252Smrg		basic_machine=$basic_machine-unknown
27176888252Smrg		;;
27276888252Smrg	m6811 | m68hc11 | m6812 | m68hc12)
27376888252Smrg		# Motorola 68HC11/12.
27476888252Smrg		basic_machine=$basic_machine-unknown
27576888252Smrg		os=-none
27676888252Smrg		;;
27776888252Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
27876888252Smrg		;;
27976888252Smrg
28076888252Smrg	# We use `pc' rather than `unknown'
28176888252Smrg	# because (1) that's what they normally are, and
28276888252Smrg	# (2) the word "unknown" tends to confuse beginning users.
28376888252Smrg	i*86 | x86_64)
28476888252Smrg	  basic_machine=$basic_machine-pc
28576888252Smrg	  ;;
28676888252Smrg	# Object if more than one company name word.
28776888252Smrg	*-*-*)
28876888252Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
28976888252Smrg		exit 1
29076888252Smrg		;;
29176888252Smrg	# Recognize the basic CPU types with company name.
29276888252Smrg	580-* \
29376888252Smrg	| a29k-* \
29476888252Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
29576888252Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
29676888252Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
29776888252Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
29876888252Smrg	| avr-* \
29976888252Smrg	| bs2000-* \
30076888252Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
30176888252Smrg	| clipper-* | cydra-* \
30276888252Smrg	| d10v-* | d30v-* | dlx-* \
30376888252Smrg	| elxsi-* \
30476888252Smrg	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
30576888252Smrg	| h8300-* | h8500-* \
30676888252Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
30776888252Smrg	| i*86-* | i860-* | i960-* | ia64-* \
30876888252Smrg	| ip2k-* \
30976888252Smrg	| m32r-* \
31076888252Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
31176888252Smrg	| m88110-* | m88k-* | mcore-* \
31276888252Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
31376888252Smrg	| mips16-* \
31476888252Smrg	| mips64-* | mips64el-* \
31576888252Smrg	| mips64vr-* | mips64vrel-* \
31676888252Smrg	| mips64orion-* | mips64orionel-* \
31776888252Smrg	| mips64vr4100-* | mips64vr4100el-* \
31876888252Smrg	| mips64vr4300-* | mips64vr4300el-* \
31976888252Smrg	| mips64vr5000-* | mips64vr5000el-* \
32076888252Smrg	| mipsisa32-* | mipsisa32el-* \
32176888252Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
32276888252Smrg	| mipsisa64-* | mipsisa64el-* \
32376888252Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
32476888252Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
32576888252Smrg	| mipstx39-* | mipstx39el-* \
32676888252Smrg	| msp430-* \
32776888252Smrg	| none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
32876888252Smrg	| orion-* \
32976888252Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
33076888252Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
33176888252Smrg	| pyramid-* \
33276888252Smrg	| romp-* | rs6000-* \
33376888252Smrg	| s390-* | s390x-* \
33476888252Smrg	| sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
33576888252Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
33676888252Smrg	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
33776888252Smrg	| sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
33876888252Smrg	| tahoe-* | thumb-* \
33976888252Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
34076888252Smrg	| tron-* \
34176888252Smrg	| v850-* | v850e-* | vax-* \
34276888252Smrg	| we32k-* \
34376888252Smrg	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
34476888252Smrg	| xtensa-* \
34576888252Smrg	| ymp-* \
34676888252Smrg	| z8k-*)
34776888252Smrg		;;
34876888252Smrg	# Recognize the various machine names and aliases which stand
34976888252Smrg	# for a CPU type and a company and sometimes even an OS.
35076888252Smrg	386bsd)
35176888252Smrg		basic_machine=i386-unknown
35276888252Smrg		os=-bsd
35376888252Smrg		;;
35476888252Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
35576888252Smrg		basic_machine=m68000-att
35676888252Smrg		;;
35776888252Smrg	3b*)
35876888252Smrg		basic_machine=we32k-att
35976888252Smrg		;;
36076888252Smrg	a29khif)
36176888252Smrg		basic_machine=a29k-amd
36276888252Smrg		os=-udi
36376888252Smrg		;;
36476888252Smrg	adobe68k)
36576888252Smrg		basic_machine=m68010-adobe
36676888252Smrg		os=-scout
36776888252Smrg		;;
36876888252Smrg	alliant | fx80)
36976888252Smrg		basic_machine=fx80-alliant
37076888252Smrg		;;
37176888252Smrg	altos | altos3068)
37276888252Smrg		basic_machine=m68k-altos
37376888252Smrg		;;
37476888252Smrg	am29k)
37576888252Smrg		basic_machine=a29k-none
37676888252Smrg		os=-bsd
37776888252Smrg		;;
37876888252Smrg	amd64)
37976888252Smrg		basic_machine=x86_64-pc
38076888252Smrg		;;
38176888252Smrg	amdahl)
38276888252Smrg		basic_machine=580-amdahl
38376888252Smrg		os=-sysv
38476888252Smrg		;;
38576888252Smrg	amiga | amiga-*)
38676888252Smrg		basic_machine=m68k-unknown
38776888252Smrg		;;
38876888252Smrg	amigaos | amigados)
38976888252Smrg		basic_machine=m68k-unknown
39076888252Smrg		os=-amigaos
39176888252Smrg		;;
39276888252Smrg	amigaunix | amix)
39376888252Smrg		basic_machine=m68k-unknown
39476888252Smrg		os=-sysv4
39576888252Smrg		;;
39676888252Smrg	apollo68)
39776888252Smrg		basic_machine=m68k-apollo
39876888252Smrg		os=-sysv
39976888252Smrg		;;
40076888252Smrg	apollo68bsd)
40176888252Smrg		basic_machine=m68k-apollo
40276888252Smrg		os=-bsd
40376888252Smrg		;;
40476888252Smrg	aux)
40576888252Smrg		basic_machine=m68k-apple
40676888252Smrg		os=-aux
40776888252Smrg		;;
40876888252Smrg	balance)
40976888252Smrg		basic_machine=ns32k-sequent
41076888252Smrg		os=-dynix
41176888252Smrg		;;
41276888252Smrg	c90)
41376888252Smrg		basic_machine=c90-cray
41476888252Smrg		os=-unicos
41576888252Smrg		;;
41676888252Smrg	convex-c1)
41776888252Smrg		basic_machine=c1-convex
41876888252Smrg		os=-bsd
41976888252Smrg		;;
42076888252Smrg	convex-c2)
42176888252Smrg		basic_machine=c2-convex
42276888252Smrg		os=-bsd
42376888252Smrg		;;
42476888252Smrg	convex-c32)
42576888252Smrg		basic_machine=c32-convex
42676888252Smrg		os=-bsd
42776888252Smrg		;;
42876888252Smrg	convex-c34)
42976888252Smrg		basic_machine=c34-convex
43076888252Smrg		os=-bsd
43176888252Smrg		;;
43276888252Smrg	convex-c38)
43376888252Smrg		basic_machine=c38-convex
43476888252Smrg		os=-bsd
43576888252Smrg		;;
43676888252Smrg	cray | j90)
43776888252Smrg		basic_machine=j90-cray
43876888252Smrg		os=-unicos
43976888252Smrg		;;
44076888252Smrg	crds | unos)
44176888252Smrg		basic_machine=m68k-crds
44276888252Smrg		;;
44376888252Smrg	cris | cris-* | etrax*)
44476888252Smrg		basic_machine=cris-axis
44576888252Smrg		;;
44676888252Smrg	da30 | da30-*)
44776888252Smrg		basic_machine=m68k-da30
44876888252Smrg		;;
44976888252Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
45076888252Smrg		basic_machine=mips-dec
45176888252Smrg		;;
45276888252Smrg	decsystem10* | dec10*)
45376888252Smrg		basic_machine=pdp10-dec
45476888252Smrg		os=-tops10
45576888252Smrg		;;
45676888252Smrg	decsystem20* | dec20*)
45776888252Smrg		basic_machine=pdp10-dec
45876888252Smrg		os=-tops20
45976888252Smrg		;;
46076888252Smrg	delta | 3300 | motorola-3300 | motorola-delta \
46176888252Smrg	      | 3300-motorola | delta-motorola)
46276888252Smrg		basic_machine=m68k-motorola
46376888252Smrg		;;
46476888252Smrg	delta88)
46576888252Smrg		basic_machine=m88k-motorola
46676888252Smrg		os=-sysv3
46776888252Smrg		;;
46876888252Smrg	dpx20 | dpx20-*)
46976888252Smrg		basic_machine=rs6000-bull
47076888252Smrg		os=-bosx
47176888252Smrg		;;
47276888252Smrg	dpx2* | dpx2*-bull)
47376888252Smrg		basic_machine=m68k-bull
47476888252Smrg		os=-sysv3
47576888252Smrg		;;
47676888252Smrg	ebmon29k)
47776888252Smrg		basic_machine=a29k-amd
47876888252Smrg		os=-ebmon
47976888252Smrg		;;
48076888252Smrg	elxsi)
48176888252Smrg		basic_machine=elxsi-elxsi
48276888252Smrg		os=-bsd
48376888252Smrg		;;
48476888252Smrg	encore | umax | mmax)
48576888252Smrg		basic_machine=ns32k-encore
48676888252Smrg		;;
48776888252Smrg	es1800 | OSE68k | ose68k | ose | OSE)
48876888252Smrg		basic_machine=m68k-ericsson
48976888252Smrg		os=-ose
49076888252Smrg		;;
49176888252Smrg	fx2800)
49276888252Smrg		basic_machine=i860-alliant
49376888252Smrg		;;
49476888252Smrg	genix)
49576888252Smrg		basic_machine=ns32k-ns
49676888252Smrg		;;
49776888252Smrg	gmicro)
49876888252Smrg		basic_machine=tron-gmicro
49976888252Smrg		os=-sysv
50076888252Smrg		;;
50176888252Smrg	go32)
50276888252Smrg		basic_machine=i386-pc
50376888252Smrg		os=-go32
50476888252Smrg		;;
50576888252Smrg	h3050r* | hiux*)
50676888252Smrg		basic_machine=hppa1.1-hitachi
50776888252Smrg		os=-hiuxwe2
50876888252Smrg		;;
50976888252Smrg	h8300hms)
51076888252Smrg		basic_machine=h8300-hitachi
51176888252Smrg		os=-hms
51276888252Smrg		;;
51376888252Smrg	h8300xray)
51476888252Smrg		basic_machine=h8300-hitachi
51576888252Smrg		os=-xray
51676888252Smrg		;;
51776888252Smrg	h8500hms)
51876888252Smrg		basic_machine=h8500-hitachi
51976888252Smrg		os=-hms
52076888252Smrg		;;
52176888252Smrg	harris)
52276888252Smrg		basic_machine=m88k-harris
52376888252Smrg		os=-sysv3
52476888252Smrg		;;
52576888252Smrg	hp300-*)
52676888252Smrg		basic_machine=m68k-hp
52776888252Smrg		;;
52876888252Smrg	hp300bsd)
52976888252Smrg		basic_machine=m68k-hp
53076888252Smrg		os=-bsd
53176888252Smrg		;;
53276888252Smrg	hp300hpux)
53376888252Smrg		basic_machine=m68k-hp
53476888252Smrg		os=-hpux
53576888252Smrg		;;
53676888252Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
53776888252Smrg		basic_machine=hppa1.0-hp
53876888252Smrg		;;
53976888252Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
54076888252Smrg		basic_machine=m68000-hp
54176888252Smrg		;;
54276888252Smrg	hp9k3[2-9][0-9])
54376888252Smrg		basic_machine=m68k-hp
54476888252Smrg		;;
54576888252Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
54676888252Smrg		basic_machine=hppa1.0-hp
54776888252Smrg		;;
54876888252Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
54976888252Smrg		basic_machine=hppa1.1-hp
55076888252Smrg		;;
55176888252Smrg	hp9k78[0-9] | hp78[0-9])
55276888252Smrg		# FIXME: really hppa2.0-hp
55376888252Smrg		basic_machine=hppa1.1-hp
55476888252Smrg		;;
55576888252Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
55676888252Smrg		# FIXME: really hppa2.0-hp
55776888252Smrg		basic_machine=hppa1.1-hp
55876888252Smrg		;;
55976888252Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
56076888252Smrg		basic_machine=hppa1.1-hp
56176888252Smrg		;;
56276888252Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
56376888252Smrg		basic_machine=hppa1.0-hp
56476888252Smrg		;;
56576888252Smrg	hppa-next)
56676888252Smrg		os=-nextstep3
56776888252Smrg		;;
56876888252Smrg	hppaosf)
56976888252Smrg		basic_machine=hppa1.1-hp
57076888252Smrg		os=-osf
57176888252Smrg		;;
57276888252Smrg	hppro)
57376888252Smrg		basic_machine=hppa1.1-hp
57476888252Smrg		os=-proelf
57576888252Smrg		;;
57676888252Smrg	i370-ibm* | ibm*)
57776888252Smrg		basic_machine=i370-ibm
57876888252Smrg		;;
57976888252Smrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
58076888252Smrg	i*86v32)
58176888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
58276888252Smrg		os=-sysv32
58376888252Smrg		;;
58476888252Smrg	i*86v4*)
58576888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
58676888252Smrg		os=-sysv4
58776888252Smrg		;;
58876888252Smrg	i*86v)
58976888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
59076888252Smrg		os=-sysv
59176888252Smrg		;;
59276888252Smrg	i*86sol2)
59376888252Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
59476888252Smrg		os=-solaris2
59576888252Smrg		;;
59676888252Smrg	i386mach)
59776888252Smrg		basic_machine=i386-mach
59876888252Smrg		os=-mach
59976888252Smrg		;;
60076888252Smrg	i386-vsta | vsta)
60176888252Smrg		basic_machine=i386-unknown
60276888252Smrg		os=-vsta
60376888252Smrg		;;
60476888252Smrg	iris | iris4d)
60576888252Smrg		basic_machine=mips-sgi
60676888252Smrg		case $os in
60776888252Smrg		    -irix*)
60876888252Smrg			;;
60976888252Smrg		    *)
61076888252Smrg			os=-irix4
61176888252Smrg			;;
61276888252Smrg		esac
61376888252Smrg		;;
61476888252Smrg	isi68 | isi)
61576888252Smrg		basic_machine=m68k-isi
61676888252Smrg		os=-sysv
61776888252Smrg		;;
61876888252Smrg	m88k-omron*)
61976888252Smrg		basic_machine=m88k-omron
62076888252Smrg		;;
62176888252Smrg	magnum | m3230)
62276888252Smrg		basic_machine=mips-mips
62376888252Smrg		os=-sysv
62476888252Smrg		;;
62576888252Smrg	merlin)
62676888252Smrg		basic_machine=ns32k-utek
62776888252Smrg		os=-sysv
62876888252Smrg		;;
62976888252Smrg	mingw32)
63076888252Smrg		basic_machine=i386-pc
63176888252Smrg		os=-mingw32
63276888252Smrg		;;
63376888252Smrg	miniframe)
63476888252Smrg		basic_machine=m68000-convergent
63576888252Smrg		;;
63676888252Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
63776888252Smrg		basic_machine=m68k-atari
63876888252Smrg		os=-mint
63976888252Smrg		;;
64076888252Smrg	mips3*-*)
64176888252Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
64276888252Smrg		;;
64376888252Smrg	mips3*)
64476888252Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
64576888252Smrg		;;
64676888252Smrg	mmix*)
64776888252Smrg		basic_machine=mmix-knuth
64876888252Smrg		os=-mmixware
64976888252Smrg		;;
65076888252Smrg	monitor)
65176888252Smrg		basic_machine=m68k-rom68k
65276888252Smrg		os=-coff
65376888252Smrg		;;
65476888252Smrg	morphos)
65576888252Smrg		basic_machine=powerpc-unknown
65676888252Smrg		os=-morphos
65776888252Smrg		;;
65876888252Smrg	msdos)
65976888252Smrg		basic_machine=i386-pc
66076888252Smrg		os=-msdos
66176888252Smrg		;;
66276888252Smrg	mvs)
66376888252Smrg		basic_machine=i370-ibm
66476888252Smrg		os=-mvs
66576888252Smrg		;;
66676888252Smrg	ncr3000)
66776888252Smrg		basic_machine=i486-ncr
66876888252Smrg		os=-sysv4
66976888252Smrg		;;
67076888252Smrg	netbsd386)
67176888252Smrg		basic_machine=i386-unknown
67276888252Smrg		os=-netbsd
67376888252Smrg		;;
67476888252Smrg	netwinder)
67576888252Smrg		basic_machine=armv4l-rebel
67676888252Smrg		os=-linux
67776888252Smrg		;;
67876888252Smrg	news | news700 | news800 | news900)
67976888252Smrg		basic_machine=m68k-sony
68076888252Smrg		os=-newsos
68176888252Smrg		;;
68276888252Smrg	news1000)
68376888252Smrg		basic_machine=m68030-sony
68476888252Smrg		os=-newsos
68576888252Smrg		;;
68676888252Smrg	news-3600 | risc-news)
68776888252Smrg		basic_machine=mips-sony
68876888252Smrg		os=-newsos
68976888252Smrg		;;
69076888252Smrg	necv70)
69176888252Smrg		basic_machine=v70-nec
69276888252Smrg		os=-sysv
69376888252Smrg		;;
69476888252Smrg	next | m*-next )
69576888252Smrg		basic_machine=m68k-next
69676888252Smrg		case $os in
69776888252Smrg		    -nextstep* )
69876888252Smrg			;;
69976888252Smrg		    -ns2*)
70076888252Smrg		      os=-nextstep2
70176888252Smrg			;;
70276888252Smrg		    *)
70376888252Smrg		      os=-nextstep3
70476888252Smrg			;;
70576888252Smrg		esac
70676888252Smrg		;;
70776888252Smrg	nh3000)
70876888252Smrg		basic_machine=m68k-harris
70976888252Smrg		os=-cxux
71076888252Smrg		;;
71176888252Smrg	nh[45]000)
71276888252Smrg		basic_machine=m88k-harris
71376888252Smrg		os=-cxux
71476888252Smrg		;;
71576888252Smrg	nindy960)
71676888252Smrg		basic_machine=i960-intel
71776888252Smrg		os=-nindy
71876888252Smrg		;;
71976888252Smrg	mon960)
72076888252Smrg		basic_machine=i960-intel
72176888252Smrg		os=-mon960
72276888252Smrg		;;
72376888252Smrg	nonstopux)
72476888252Smrg		basic_machine=mips-compaq
72576888252Smrg		os=-nonstopux
72676888252Smrg		;;
72776888252Smrg	np1)
72876888252Smrg		basic_machine=np1-gould
72976888252Smrg		;;
73076888252Smrg	nv1)
73176888252Smrg		basic_machine=nv1-cray
73276888252Smrg		os=-unicosmp
73376888252Smrg		;;
73476888252Smrg	nsr-tandem)
73576888252Smrg		basic_machine=nsr-tandem
73676888252Smrg		;;
73776888252Smrg	op50n-* | op60c-*)
73876888252Smrg		basic_machine=hppa1.1-oki
73976888252Smrg		os=-proelf
74076888252Smrg		;;
74176888252Smrg	or32 | or32-*)
74276888252Smrg		basic_machine=or32-unknown
74376888252Smrg		os=-coff
74476888252Smrg		;;
74576888252Smrg	OSE68000 | ose68000)
74676888252Smrg		basic_machine=m68000-ericsson
74776888252Smrg		os=-ose
74876888252Smrg		;;
74976888252Smrg	os68k)
75076888252Smrg		basic_machine=m68k-none
75176888252Smrg		os=-os68k
75276888252Smrg		;;
75376888252Smrg	pa-hitachi)
75476888252Smrg		basic_machine=hppa1.1-hitachi
75576888252Smrg		os=-hiuxwe2
75676888252Smrg		;;
75776888252Smrg	paragon)
75876888252Smrg		basic_machine=i860-intel
75976888252Smrg		os=-osf
76076888252Smrg		;;
76176888252Smrg	pbd)
76276888252Smrg		basic_machine=sparc-tti
76376888252Smrg		;;
76476888252Smrg	pbb)
76576888252Smrg		basic_machine=m68k-tti
76676888252Smrg		;;
76776888252Smrg	pc532 | pc532-*)
76876888252Smrg		basic_machine=ns32k-pc532
76976888252Smrg		;;
77076888252Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
77176888252Smrg		basic_machine=i586-pc
77276888252Smrg		;;
77376888252Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
77476888252Smrg		basic_machine=i686-pc
77576888252Smrg		;;
77676888252Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
77776888252Smrg		basic_machine=i686-pc
77876888252Smrg		;;
77976888252Smrg	pentium4)
78076888252Smrg		basic_machine=i786-pc
78176888252Smrg		;;
78276888252Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
78376888252Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
78476888252Smrg		;;
78576888252Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
78676888252Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
78776888252Smrg		;;
78876888252Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
78976888252Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
79076888252Smrg		;;
79176888252Smrg	pentium4-*)
79276888252Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
79376888252Smrg		;;
79476888252Smrg	pn)
79576888252Smrg		basic_machine=pn-gould
79676888252Smrg		;;
79776888252Smrg	power)	basic_machine=power-ibm
79876888252Smrg		;;
79976888252Smrg	ppc)	basic_machine=powerpc-unknown
80076888252Smrg		;;
80176888252Smrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
80276888252Smrg		;;
80376888252Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
80476888252Smrg		basic_machine=powerpcle-unknown
80576888252Smrg		;;
80676888252Smrg	ppcle-* | powerpclittle-*)
80776888252Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
80876888252Smrg		;;
80976888252Smrg	ppc64)	basic_machine=powerpc64-unknown
81076888252Smrg		;;
81176888252Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
81276888252Smrg		;;
81376888252Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
81476888252Smrg		basic_machine=powerpc64le-unknown
81576888252Smrg		;;
81676888252Smrg	ppc64le-* | powerpc64little-*)
81776888252Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
81876888252Smrg		;;
81976888252Smrg	ps2)
82076888252Smrg		basic_machine=i386-ibm
82176888252Smrg		;;
82276888252Smrg	pw32)
82376888252Smrg		basic_machine=i586-unknown
82476888252Smrg		os=-pw32
82576888252Smrg		;;
82676888252Smrg	rom68k)
82776888252Smrg		basic_machine=m68k-rom68k
82876888252Smrg		os=-coff
82976888252Smrg		;;
83076888252Smrg	rm[46]00)
83176888252Smrg		basic_machine=mips-siemens
83276888252Smrg		;;
83376888252Smrg	rtpc | rtpc-*)
83476888252Smrg		basic_machine=romp-ibm
83576888252Smrg		;;
83676888252Smrg	sa29200)
83776888252Smrg		basic_machine=a29k-amd
83876888252Smrg		os=-udi
83976888252Smrg		;;
84076888252Smrg	sb1)
84176888252Smrg		basic_machine=mipsisa64sb1-unknown
84276888252Smrg		;;
84376888252Smrg	sb1el)
84476888252Smrg		basic_machine=mipsisa64sb1el-unknown
84576888252Smrg		;;
84676888252Smrg	sei)
84776888252Smrg		basic_machine=mips-sei
84876888252Smrg		os=-seiux
84976888252Smrg		;;
85076888252Smrg	sequent)
85176888252Smrg		basic_machine=i386-sequent
85276888252Smrg		;;
85376888252Smrg	sh)
85476888252Smrg		basic_machine=sh-hitachi
85576888252Smrg		os=-hms
85676888252Smrg		;;
85776888252Smrg	sh64)
85876888252Smrg		basic_machine=sh64-unknown
85976888252Smrg		;;
86076888252Smrg	sparclite-wrs | simso-wrs)
86176888252Smrg		basic_machine=sparclite-wrs
86276888252Smrg		os=-vxworks
86376888252Smrg		;;
86476888252Smrg	sps7)
86576888252Smrg		basic_machine=m68k-bull
86676888252Smrg		os=-sysv2
86776888252Smrg		;;
86876888252Smrg	spur)
86976888252Smrg		basic_machine=spur-unknown
87076888252Smrg		;;
87176888252Smrg	st2000)
87276888252Smrg		basic_machine=m68k-tandem
87376888252Smrg		;;
87476888252Smrg	stratus)
87576888252Smrg		basic_machine=i860-stratus
87676888252Smrg		os=-sysv4
87776888252Smrg		;;
87876888252Smrg	sun2)
87976888252Smrg		basic_machine=m68000-sun
88076888252Smrg		;;
88176888252Smrg	sun2os3)
88276888252Smrg		basic_machine=m68000-sun
88376888252Smrg		os=-sunos3
88476888252Smrg		;;
88576888252Smrg	sun2os4)
88676888252Smrg		basic_machine=m68000-sun
88776888252Smrg		os=-sunos4
88876888252Smrg		;;
88976888252Smrg	sun3os3)
89076888252Smrg		basic_machine=m68k-sun
89176888252Smrg		os=-sunos3
89276888252Smrg		;;
89376888252Smrg	sun3os4)
89476888252Smrg		basic_machine=m68k-sun
89576888252Smrg		os=-sunos4
89676888252Smrg		;;
89776888252Smrg	sun4os3)
89876888252Smrg		basic_machine=sparc-sun
89976888252Smrg		os=-sunos3
90076888252Smrg		;;
90176888252Smrg	sun4os4)
90276888252Smrg		basic_machine=sparc-sun
90376888252Smrg		os=-sunos4
90476888252Smrg		;;
90576888252Smrg	sun4sol2)
90676888252Smrg		basic_machine=sparc-sun
90776888252Smrg		os=-solaris2
90876888252Smrg		;;
90976888252Smrg	sun3 | sun3-*)
91076888252Smrg		basic_machine=m68k-sun
91176888252Smrg		;;
91276888252Smrg	sun4)
91376888252Smrg		basic_machine=sparc-sun
91476888252Smrg		;;
91576888252Smrg	sun386 | sun386i | roadrunner)
91676888252Smrg		basic_machine=i386-sun
91776888252Smrg		;;
91876888252Smrg	sv1)
91976888252Smrg		basic_machine=sv1-cray
92076888252Smrg		os=-unicos
92176888252Smrg		;;
92276888252Smrg	symmetry)
92376888252Smrg		basic_machine=i386-sequent
92476888252Smrg		os=-dynix
92576888252Smrg		;;
92676888252Smrg	t3e)
92776888252Smrg		basic_machine=alphaev5-cray
92876888252Smrg		os=-unicos
92976888252Smrg		;;
93076888252Smrg	t90)
93176888252Smrg		basic_machine=t90-cray
93276888252Smrg		os=-unicos
93376888252Smrg		;;
93476888252Smrg	tic54x | c54x*)
93576888252Smrg		basic_machine=tic54x-unknown
93676888252Smrg		os=-coff
93776888252Smrg		;;
93876888252Smrg	tic55x | c55x*)
93976888252Smrg		basic_machine=tic55x-unknown
94076888252Smrg		os=-coff
94176888252Smrg		;;
94276888252Smrg	tic6x | c6x*)
94376888252Smrg		basic_machine=tic6x-unknown
94476888252Smrg		os=-coff
94576888252Smrg		;;
94676888252Smrg	tx39)
94776888252Smrg		basic_machine=mipstx39-unknown
94876888252Smrg		;;
94976888252Smrg	tx39el)
95076888252Smrg		basic_machine=mipstx39el-unknown
95176888252Smrg		;;
95276888252Smrg	toad1)
95376888252Smrg		basic_machine=pdp10-xkl
95476888252Smrg		os=-tops20
95576888252Smrg		;;
95676888252Smrg	tower | tower-32)
95776888252Smrg		basic_machine=m68k-ncr
95876888252Smrg		;;
95976888252Smrg	udi29k)
96076888252Smrg		basic_machine=a29k-amd
96176888252Smrg		os=-udi
96276888252Smrg		;;
96376888252Smrg	ultra3)
96476888252Smrg		basic_machine=a29k-nyu
96576888252Smrg		os=-sym1
96676888252Smrg		;;
96776888252Smrg	v810 | necv810)
96876888252Smrg		basic_machine=v810-nec
96976888252Smrg		os=-none
97076888252Smrg		;;
97176888252Smrg	vaxv)
97276888252Smrg		basic_machine=vax-dec
97376888252Smrg		os=-sysv
97476888252Smrg		;;
97576888252Smrg	vms)
97676888252Smrg		basic_machine=vax-dec
97776888252Smrg		os=-vms
97876888252Smrg		;;
97976888252Smrg	vpp*|vx|vx-*)
98076888252Smrg		basic_machine=f301-fujitsu
98176888252Smrg		;;
98276888252Smrg	vxworks960)
98376888252Smrg		basic_machine=i960-wrs
98476888252Smrg		os=-vxworks
98576888252Smrg		;;
98676888252Smrg	vxworks68)
98776888252Smrg		basic_machine=m68k-wrs
98876888252Smrg		os=-vxworks
98976888252Smrg		;;
99076888252Smrg	vxworks29k)
99176888252Smrg		basic_machine=a29k-wrs
99276888252Smrg		os=-vxworks
99376888252Smrg		;;
99476888252Smrg	w65*)
99576888252Smrg		basic_machine=w65-wdc
99676888252Smrg		os=-none
99776888252Smrg		;;
99876888252Smrg	w89k-*)
99976888252Smrg		basic_machine=hppa1.1-winbond
100076888252Smrg		os=-proelf
100176888252Smrg		;;
100276888252Smrg	xps | xps100)
100376888252Smrg		basic_machine=xps100-honeywell
100476888252Smrg		;;
100576888252Smrg	ymp)
100676888252Smrg		basic_machine=ymp-cray
100776888252Smrg		os=-unicos
100876888252Smrg		;;
100976888252Smrg	z8k-*-coff)
101076888252Smrg		basic_machine=z8k-unknown
101176888252Smrg		os=-sim
101276888252Smrg		;;
101376888252Smrg	none)
101476888252Smrg		basic_machine=none-none
101576888252Smrg		os=-none
101676888252Smrg		;;
101776888252Smrg
101876888252Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
101976888252Smrg# some cases the only manufacturer, in others, it is the most popular.
102076888252Smrg	w89k)
102176888252Smrg		basic_machine=hppa1.1-winbond
102276888252Smrg		;;
102376888252Smrg	op50n)
102476888252Smrg		basic_machine=hppa1.1-oki
102576888252Smrg		;;
102676888252Smrg	op60c)
102776888252Smrg		basic_machine=hppa1.1-oki
102876888252Smrg		;;
102976888252Smrg	romp)
103076888252Smrg		basic_machine=romp-ibm
103176888252Smrg		;;
103276888252Smrg	rs6000)
103376888252Smrg		basic_machine=rs6000-ibm
103476888252Smrg		;;
103576888252Smrg	vax)
103676888252Smrg		basic_machine=vax-dec
103776888252Smrg		;;
103876888252Smrg	pdp10)
103976888252Smrg		# there are many clones, so DEC is not a safe bet
104076888252Smrg		basic_machine=pdp10-unknown
104176888252Smrg		;;
104276888252Smrg	pdp11)
104376888252Smrg		basic_machine=pdp11-dec
104476888252Smrg		;;
104576888252Smrg	we32k)
104676888252Smrg		basic_machine=we32k-att
104776888252Smrg		;;
104876888252Smrg	sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
104976888252Smrg		basic_machine=sh-unknown
105076888252Smrg		;;
105176888252Smrg	sh64)
105276888252Smrg		basic_machine=sh64-unknown
105376888252Smrg		;;
105476888252Smrg	sparc | sparcv8 | sparcv9 | sparcv9b)
105576888252Smrg		basic_machine=sparc-sun
105676888252Smrg		;;
105776888252Smrg	cydra)
105876888252Smrg		basic_machine=cydra-cydrome
105976888252Smrg		;;
106076888252Smrg	orion)
106176888252Smrg		basic_machine=orion-highlevel
106276888252Smrg		;;
106376888252Smrg	orion105)
106476888252Smrg		basic_machine=clipper-highlevel
106576888252Smrg		;;
106676888252Smrg	mac | mpw | mac-mpw)
106776888252Smrg		basic_machine=m68k-apple
106876888252Smrg		;;
106976888252Smrg	pmac | pmac-mpw)
107076888252Smrg		basic_machine=powerpc-apple
107176888252Smrg		;;
107276888252Smrg	*-unknown)
107376888252Smrg		# Make sure to match an already-canonicalized machine name.
107476888252Smrg		;;
107576888252Smrg	*)
107676888252Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
107776888252Smrg		exit 1
107876888252Smrg		;;
107976888252Smrgesac
108076888252Smrg
108176888252Smrg# Here we canonicalize certain aliases for manufacturers.
108276888252Smrgcase $basic_machine in
108376888252Smrg	*-digital*)
108476888252Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
108576888252Smrg		;;
108676888252Smrg	*-commodore*)
108776888252Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
108876888252Smrg		;;
108976888252Smrg	*)
109076888252Smrg		;;
109176888252Smrgesac
109276888252Smrg
109376888252Smrg# Decode manufacturer-specific aliases for certain operating systems.
109476888252Smrg
109576888252Smrgif [ x"$os" != x"" ]
109676888252Smrgthen
109776888252Smrgcase $os in
109876888252Smrg        # First match some system type aliases
109976888252Smrg        # that might get confused with valid system types.
110076888252Smrg	# -solaris* is a basic system type, with this one exception.
110176888252Smrg	-solaris1 | -solaris1.*)
110276888252Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
110376888252Smrg		;;
110476888252Smrg	-solaris)
110576888252Smrg		os=-solaris2
110676888252Smrg		;;
110776888252Smrg	-svr4*)
110876888252Smrg		os=-sysv4
110976888252Smrg		;;
111076888252Smrg	-unixware*)
111176888252Smrg		os=-sysv4.2uw
111276888252Smrg		;;
111376888252Smrg	-gnu/linux*)
111476888252Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
111576888252Smrg		;;
111676888252Smrg	# First accept the basic system types.
111776888252Smrg	# The portable systems comes first.
111876888252Smrg	# Each alternative MUST END IN A *, to match a version number.
111976888252Smrg	# -sysv* is not here because it comes later, after sysvr4.
112076888252Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
112176888252Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
112276888252Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
112376888252Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
112476888252Smrg	      | -aos* \
112576888252Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
112676888252Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
112776888252Smrg	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
112876888252Smrg	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
112976888252Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
113076888252Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
113176888252Smrg	      | -chorusos* | -chorusrdb* \
113276888252Smrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
113376888252Smrg	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
113476888252Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
113576888252Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
113676888252Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
113776888252Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
113876888252Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
113976888252Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
114076888252Smrg	# Remember, each alternative MUST END IN *, to match a version number.
114176888252Smrg		;;
114276888252Smrg	-qnx*)
114376888252Smrg		case $basic_machine in
114476888252Smrg		    x86-* | i*86-*)
114576888252Smrg			;;
114676888252Smrg		    *)
114776888252Smrg			os=-nto$os
114876888252Smrg			;;
114976888252Smrg		esac
115076888252Smrg		;;
115176888252Smrg	-nto-qnx*)
115276888252Smrg		;;
115376888252Smrg	-nto*)
115476888252Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
115576888252Smrg		;;
115676888252Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
115776888252Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
115876888252Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
115976888252Smrg		;;
116076888252Smrg	-mac*)
116176888252Smrg		os=`echo $os | sed -e 's|mac|macos|'`
116276888252Smrg		;;
116376888252Smrg	-linux*)
116476888252Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
116576888252Smrg		;;
116676888252Smrg	-sunos5*)
116776888252Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
116876888252Smrg		;;
116976888252Smrg	-sunos6*)
117076888252Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
117176888252Smrg		;;
117276888252Smrg	-opened*)
117376888252Smrg		os=-openedition
117476888252Smrg		;;
117576888252Smrg	-wince*)
117676888252Smrg		os=-wince
117776888252Smrg		;;
117876888252Smrg	-osfrose*)
117976888252Smrg		os=-osfrose
118076888252Smrg		;;
118176888252Smrg	-osf*)
118276888252Smrg		os=-osf
118376888252Smrg		;;
118476888252Smrg	-utek*)
118576888252Smrg		os=-bsd
118676888252Smrg		;;
118776888252Smrg	-dynix*)
118876888252Smrg		os=-bsd
118976888252Smrg		;;
119076888252Smrg	-acis*)
119176888252Smrg		os=-aos
119276888252Smrg		;;
119376888252Smrg	-atheos*)
119476888252Smrg		os=-atheos
119576888252Smrg		;;
119676888252Smrg	-386bsd)
119776888252Smrg		os=-bsd
119876888252Smrg		;;
119976888252Smrg	-ctix* | -uts*)
120076888252Smrg		os=-sysv
120176888252Smrg		;;
120276888252Smrg	-nova*)
120376888252Smrg		os=-rtmk-nova
120476888252Smrg		;;
120576888252Smrg	-ns2 )
120676888252Smrg		os=-nextstep2
120776888252Smrg		;;
120876888252Smrg	-nsk*)
120976888252Smrg		os=-nsk
121076888252Smrg		;;
121176888252Smrg	# Preserve the version number of sinix5.
121276888252Smrg	-sinix5.*)
121376888252Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
121476888252Smrg		;;
121576888252Smrg	-sinix*)
121676888252Smrg		os=-sysv4
121776888252Smrg		;;
121876888252Smrg	-triton*)
121976888252Smrg		os=-sysv3
122076888252Smrg		;;
122176888252Smrg	-oss*)
122276888252Smrg		os=-sysv3
122376888252Smrg		;;
122476888252Smrg	-svr4)
122576888252Smrg		os=-sysv4
122676888252Smrg		;;
122776888252Smrg	-svr3)
122876888252Smrg		os=-sysv3
122976888252Smrg		;;
123076888252Smrg	-sysvr4)
123176888252Smrg		os=-sysv4
123276888252Smrg		;;
123376888252Smrg	# This must come after -sysvr4.
123476888252Smrg	-sysv*)
123576888252Smrg		;;
123676888252Smrg	-ose*)
123776888252Smrg		os=-ose
123876888252Smrg		;;
123976888252Smrg	-es1800*)
124076888252Smrg		os=-ose
124176888252Smrg		;;
124276888252Smrg	-xenix)
124376888252Smrg		os=-xenix
124476888252Smrg		;;
124576888252Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
124676888252Smrg		os=-mint
124776888252Smrg		;;
124876888252Smrg	-aros*)
124976888252Smrg		os=-aros
125076888252Smrg		;;
125176888252Smrg	-kaos*)
125276888252Smrg		os=-kaos
125376888252Smrg		;;
125476888252Smrg	-none)
125576888252Smrg		;;
125676888252Smrg	*)
125776888252Smrg		# Get rid of the `-' at the beginning of $os.
125876888252Smrg		os=`echo $os | sed 's/[^-]*-//'`
125976888252Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
126076888252Smrg		exit 1
126176888252Smrg		;;
126276888252Smrgesac
126376888252Smrgelse
126476888252Smrg
126576888252Smrg# Here we handle the default operating systems that come with various machines.
126676888252Smrg# The value should be what the vendor currently ships out the door with their
126776888252Smrg# machine or put another way, the most popular os provided with the machine.
126876888252Smrg
126976888252Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
127076888252Smrg# "-sun"), then you have to tell the case statement up towards the top
127176888252Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
127276888252Smrg# will signal an error saying that MANUFACTURER isn't an operating
127376888252Smrg# system, and we'll never get to this point.
127476888252Smrg
127576888252Smrgcase $basic_machine in
127676888252Smrg	*-acorn)
127776888252Smrg		os=-riscix1.2
127876888252Smrg		;;
127976888252Smrg	arm*-rebel)
128076888252Smrg		os=-linux
128176888252Smrg		;;
128276888252Smrg	arm*-semi)
128376888252Smrg		os=-aout
128476888252Smrg		;;
128576888252Smrg	c4x-* | tic4x-*)
128676888252Smrg		os=-coff
128776888252Smrg		;;
128876888252Smrg	# This must come before the *-dec entry.
128976888252Smrg	pdp10-*)
129076888252Smrg		os=-tops20
129176888252Smrg		;;
129276888252Smrg	pdp11-*)
129376888252Smrg		os=-none
129476888252Smrg		;;
129576888252Smrg	*-dec | vax-*)
129676888252Smrg		os=-ultrix4.2
129776888252Smrg		;;
129876888252Smrg	m68*-apollo)
129976888252Smrg		os=-domain
130076888252Smrg		;;
130176888252Smrg	i386-sun)
130276888252Smrg		os=-sunos4.0.2
130376888252Smrg		;;
130476888252Smrg	m68000-sun)
130576888252Smrg		os=-sunos3
130676888252Smrg		# This also exists in the configure program, but was not the
130776888252Smrg		# default.
130876888252Smrg		# os=-sunos4
130976888252Smrg		;;
131076888252Smrg	m68*-cisco)
131176888252Smrg		os=-aout
131276888252Smrg		;;
131376888252Smrg	mips*-cisco)
131476888252Smrg		os=-elf
131576888252Smrg		;;
131676888252Smrg	mips*-*)
131776888252Smrg		os=-elf
131876888252Smrg		;;
131976888252Smrg	or32-*)
132076888252Smrg		os=-coff
132176888252Smrg		;;
132276888252Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
132376888252Smrg		os=-sysv3
132476888252Smrg		;;
132576888252Smrg	sparc-* | *-sun)
132676888252Smrg		os=-sunos4.1.1
132776888252Smrg		;;
132876888252Smrg	*-be)
132976888252Smrg		os=-beos
133076888252Smrg		;;
133176888252Smrg	*-ibm)
133276888252Smrg		os=-aix
133376888252Smrg		;;
133476888252Smrg	*-wec)
133576888252Smrg		os=-proelf
133676888252Smrg		;;
133776888252Smrg	*-winbond)
133876888252Smrg		os=-proelf
133976888252Smrg		;;
134076888252Smrg	*-oki)
134176888252Smrg		os=-proelf
134276888252Smrg		;;
134376888252Smrg	*-hp)
134476888252Smrg		os=-hpux
134576888252Smrg		;;
134676888252Smrg	*-hitachi)
134776888252Smrg		os=-hiux
134876888252Smrg		;;
134976888252Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
135076888252Smrg		os=-sysv
135176888252Smrg		;;
135276888252Smrg	*-cbm)
135376888252Smrg		os=-amigaos
135476888252Smrg		;;
135576888252Smrg	*-dg)
135676888252Smrg		os=-dgux
135776888252Smrg		;;
135876888252Smrg	*-dolphin)
135976888252Smrg		os=-sysv3
136076888252Smrg		;;
136176888252Smrg	m68k-ccur)
136276888252Smrg		os=-rtu
136376888252Smrg		;;
136476888252Smrg	m88k-omron*)
136576888252Smrg		os=-luna
136676888252Smrg		;;
136776888252Smrg	*-next )
136876888252Smrg		os=-nextstep
136976888252Smrg		;;
137076888252Smrg	*-sequent)
137176888252Smrg		os=-ptx
137276888252Smrg		;;
137376888252Smrg	*-crds)
137476888252Smrg		os=-unos
137576888252Smrg		;;
137676888252Smrg	*-ns)
137776888252Smrg		os=-genix
137876888252Smrg		;;
137976888252Smrg	i370-*)
138076888252Smrg		os=-mvs
138176888252Smrg		;;
138276888252Smrg	*-next)
138376888252Smrg		os=-nextstep3
138476888252Smrg		;;
138576888252Smrg	*-gould)
138676888252Smrg		os=-sysv
138776888252Smrg		;;
138876888252Smrg	*-highlevel)
138976888252Smrg		os=-bsd
139076888252Smrg		;;
139176888252Smrg	*-encore)
139276888252Smrg		os=-bsd
139376888252Smrg		;;
139476888252Smrg	*-sgi)
139576888252Smrg		os=-irix
139676888252Smrg		;;
139776888252Smrg	*-siemens)
139876888252Smrg		os=-sysv4
139976888252Smrg		;;
140076888252Smrg	*-masscomp)
140176888252Smrg		os=-rtu
140276888252Smrg		;;
140376888252Smrg	f30[01]-fujitsu | f700-fujitsu)
140476888252Smrg		os=-uxpv
140576888252Smrg		;;
140676888252Smrg	*-rom68k)
140776888252Smrg		os=-coff
140876888252Smrg		;;
140976888252Smrg	*-*bug)
141076888252Smrg		os=-coff
141176888252Smrg		;;
141276888252Smrg	*-apple)
141376888252Smrg		os=-macos
141476888252Smrg		;;
141576888252Smrg	*-atari*)
141676888252Smrg		os=-mint
141776888252Smrg		;;
141876888252Smrg	*)
141976888252Smrg		os=-none
142076888252Smrg		;;
142176888252Smrgesac
142276888252Smrgfi
142376888252Smrg
142476888252Smrg# Here we handle the case where we know the os, and the CPU type, but not the
142576888252Smrg# manufacturer.  We pick the logical manufacturer.
142676888252Smrgvendor=unknown
142776888252Smrgcase $basic_machine in
142876888252Smrg	*-unknown)
142976888252Smrg		case $os in
143076888252Smrg			-riscix*)
143176888252Smrg				vendor=acorn
143276888252Smrg				;;
143376888252Smrg			-sunos*)
143476888252Smrg				vendor=sun
143576888252Smrg				;;
143676888252Smrg			-aix*)
143776888252Smrg				vendor=ibm
143876888252Smrg				;;
143976888252Smrg			-beos*)
144076888252Smrg				vendor=be
144176888252Smrg				;;
144276888252Smrg			-hpux*)
144376888252Smrg				vendor=hp
144476888252Smrg				;;
144576888252Smrg			-mpeix*)
144676888252Smrg				vendor=hp
144776888252Smrg				;;
144876888252Smrg			-hiux*)
144976888252Smrg				vendor=hitachi
145076888252Smrg				;;
145176888252Smrg			-unos*)
145276888252Smrg				vendor=crds
145376888252Smrg				;;
145476888252Smrg			-dgux*)
145576888252Smrg				vendor=dg
145676888252Smrg				;;
145776888252Smrg			-luna*)
145876888252Smrg				vendor=omron
145976888252Smrg				;;
146076888252Smrg			-genix*)
146176888252Smrg				vendor=ns
146276888252Smrg				;;
146376888252Smrg			-mvs* | -opened*)
146476888252Smrg				vendor=ibm
146576888252Smrg				;;
146676888252Smrg			-ptx*)
146776888252Smrg				vendor=sequent
146876888252Smrg				;;
146976888252Smrg			-vxsim* | -vxworks* | -windiss*)
147076888252Smrg				vendor=wrs
147176888252Smrg				;;
147276888252Smrg			-aux*)
147376888252Smrg				vendor=apple
147476888252Smrg				;;
147576888252Smrg			-hms*)
147676888252Smrg				vendor=hitachi
147776888252Smrg				;;
147876888252Smrg			-mpw* | -macos*)
147976888252Smrg				vendor=apple
148076888252Smrg				;;
148176888252Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
148276888252Smrg				vendor=atari
148376888252Smrg				;;
148476888252Smrg			-vos*)
148576888252Smrg				vendor=stratus
148676888252Smrg				;;
148776888252Smrg		esac
148876888252Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
148976888252Smrg		;;
149076888252Smrgesac
149176888252Smrg
149276888252Smrgecho $basic_machine$os
149376888252Smrgexit 0
149476888252Smrg
149576888252Smrg# Local variables:
149676888252Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
149776888252Smrg# time-stamp-start: "timestamp='"
149876888252Smrg# time-stamp-format: "%:y-%02m-%02d"
149976888252Smrg# time-stamp-end: "'"
150076888252Smrg# End:
1501