config.sub revision 70f7c90c
1a850946eSmrg#! /bin/sh
2a850946eSmrg# Configuration validation subroutine script.
3a850946eSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
470f7c90cSmrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
570f7c90cSmrg#   Free Software Foundation, Inc.
6a850946eSmrg
770f7c90cSmrgtimestamp='2009-04-17'
8a850946eSmrg
9a850946eSmrg# This file is (in principle) common to ALL GNU software.
10a850946eSmrg# The presence of a machine in this file suggests that SOME GNU software
11a850946eSmrg# can handle that machine.  It does not imply ALL GNU software can.
12a850946eSmrg#
13a850946eSmrg# This file is free software; you can redistribute it and/or modify
14a850946eSmrg# it under the terms of the GNU General Public License as published by
15a850946eSmrg# the Free Software Foundation; either version 2 of the License, or
16a850946eSmrg# (at your option) any later version.
17a850946eSmrg#
18a850946eSmrg# This program is distributed in the hope that it will be useful,
19a850946eSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
20a850946eSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21a850946eSmrg# GNU General Public License for more details.
22a850946eSmrg#
23a850946eSmrg# You should have received a copy of the GNU General Public License
24a850946eSmrg# along with this program; if not, write to the Free Software
2570f7c90cSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2670f7c90cSmrg# 02110-1301, USA.
2770f7c90cSmrg#
28a850946eSmrg# As a special exception to the GNU General Public License, if you
29a850946eSmrg# distribute this file as part of a program that contains a
30a850946eSmrg# configuration script generated by Autoconf, you may include it under
31a850946eSmrg# the same distribution terms that you use for the rest of that program.
32a850946eSmrg
3370f7c90cSmrg
34a850946eSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
35a850946eSmrg# diff and a properly formatted ChangeLog entry.
36a850946eSmrg#
37a850946eSmrg# Configuration subroutine to validate and canonicalize a configuration type.
38a850946eSmrg# Supply the specified configuration type as an argument.
39a850946eSmrg# If it is invalid, we print an error message on stderr and exit with code 1.
40a850946eSmrg# Otherwise, we print the canonical config type on stdout and succeed.
41a850946eSmrg
42a850946eSmrg# This file is supposed to be the same for all GNU packages
43a850946eSmrg# and recognize all the CPU types, system types and aliases
44a850946eSmrg# that are meaningful with *any* GNU software.
45a850946eSmrg# Each package is responsible for reporting which valid configurations
46a850946eSmrg# it does not support.  The user should be able to distinguish
47a850946eSmrg# a failure to support a valid configuration from a meaningless
48a850946eSmrg# configuration.
49a850946eSmrg
50a850946eSmrg# The goal of this file is to map all the various variations of a given
51a850946eSmrg# machine specification into a single specification in the form:
52a850946eSmrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
53a850946eSmrg# or in some cases, the newer four-part form:
54a850946eSmrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55a850946eSmrg# It is wrong to echo any other type of specification.
56a850946eSmrg
57a850946eSmrgme=`echo "$0" | sed -e 's,.*/,,'`
58a850946eSmrg
59a850946eSmrgusage="\
60a850946eSmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
61a850946eSmrg       $0 [OPTION] ALIAS
62a850946eSmrg
63a850946eSmrgCanonicalize a configuration name.
64a850946eSmrg
65a850946eSmrgOperation modes:
66a850946eSmrg  -h, --help         print this help, then exit
67a850946eSmrg  -t, --time-stamp   print date of last modification, then exit
68a850946eSmrg  -v, --version      print version number, then exit
69a850946eSmrg
70a850946eSmrgReport bugs and patches to <config-patches@gnu.org>."
71a850946eSmrg
72a850946eSmrgversion="\
73a850946eSmrgGNU config.sub ($timestamp)
74a850946eSmrg
7570f7c90cSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
7670f7c90cSmrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
77a850946eSmrg
78a850946eSmrgThis is free software; see the source for copying conditions.  There is NO
79a850946eSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80a850946eSmrg
81a850946eSmrghelp="
82a850946eSmrgTry \`$me --help' for more information."
83a850946eSmrg
84a850946eSmrg# Parse command line
85a850946eSmrgwhile test $# -gt 0 ; do
86a850946eSmrg  case $1 in
87a850946eSmrg    --time-stamp | --time* | -t )
8870f7c90cSmrg       echo "$timestamp" ; exit ;;
89a850946eSmrg    --version | -v )
9070f7c90cSmrg       echo "$version" ; exit ;;
91a850946eSmrg    --help | --h* | -h )
9270f7c90cSmrg       echo "$usage"; exit ;;
93a850946eSmrg    -- )     # Stop option processing
94a850946eSmrg       shift; break ;;
95a850946eSmrg    - )	# Use stdin as input.
96a850946eSmrg       break ;;
97a850946eSmrg    -* )
98a850946eSmrg       echo "$me: invalid option $1$help"
99a850946eSmrg       exit 1 ;;
100a850946eSmrg
101a850946eSmrg    *local*)
102a850946eSmrg       # First pass through any local machine types.
103a850946eSmrg       echo $1
10470f7c90cSmrg       exit ;;
105a850946eSmrg
106a850946eSmrg    * )
107a850946eSmrg       break ;;
108a850946eSmrg  esac
109a850946eSmrgdone
110a850946eSmrg
111a850946eSmrgcase $# in
112a850946eSmrg 0) echo "$me: missing argument$help" >&2
113a850946eSmrg    exit 1;;
114a850946eSmrg 1) ;;
115a850946eSmrg *) echo "$me: too many arguments$help" >&2
116a850946eSmrg    exit 1;;
117a850946eSmrgesac
118a850946eSmrg
119a850946eSmrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120a850946eSmrg# Here we must recognize all the valid KERNEL-OS combinations.
121a850946eSmrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122a850946eSmrgcase $maybe_os in
12370f7c90cSmrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
12470f7c90cSmrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
12570f7c90cSmrg  kopensolaris*-gnu* | \
12670f7c90cSmrg  storm-chaos* | os2-emx* | rtmk-nova*)
127a850946eSmrg    os=-$maybe_os
128a850946eSmrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
129a850946eSmrg    ;;
130a850946eSmrg  *)
131a850946eSmrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132a850946eSmrg    if [ $basic_machine != $1 ]
133a850946eSmrg    then os=`echo $1 | sed 's/.*-/-/'`
134a850946eSmrg    else os=; fi
135a850946eSmrg    ;;
136a850946eSmrgesac
137a850946eSmrg
138a850946eSmrg### Let's recognize common machines as not being operating systems so
139a850946eSmrg### that things like config.sub decstation-3100 work.  We also
140a850946eSmrg### recognize some manufacturers as not being operating systems, so we
141a850946eSmrg### can provide default operating systems below.
142a850946eSmrgcase $os in
143a850946eSmrg	-sun*os*)
144a850946eSmrg		# Prevent following clause from handling this invalid input.
145a850946eSmrg		;;
146a850946eSmrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
147a850946eSmrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148a850946eSmrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149a850946eSmrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150a850946eSmrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151a850946eSmrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
15270f7c90cSmrg	-apple | -axis | -knuth | -cray)
153a850946eSmrg		os=
154a850946eSmrg		basic_machine=$1
155a850946eSmrg		;;
156a850946eSmrg	-sim | -cisco | -oki | -wec | -winbond)
157a850946eSmrg		os=
158a850946eSmrg		basic_machine=$1
159a850946eSmrg		;;
160a850946eSmrg	-scout)
161a850946eSmrg		;;
162a850946eSmrg	-wrs)
163a850946eSmrg		os=-vxworks
164a850946eSmrg		basic_machine=$1
165a850946eSmrg		;;
166a850946eSmrg	-chorusos*)
167a850946eSmrg		os=-chorusos
168a850946eSmrg		basic_machine=$1
169a850946eSmrg		;;
170a850946eSmrg 	-chorusrdb)
171a850946eSmrg 		os=-chorusrdb
172a850946eSmrg		basic_machine=$1
173a850946eSmrg 		;;
174a850946eSmrg	-hiux*)
175a850946eSmrg		os=-hiuxwe2
176a850946eSmrg		;;
17770f7c90cSmrg	-sco6)
17870f7c90cSmrg		os=-sco5v6
17970f7c90cSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18070f7c90cSmrg		;;
181a850946eSmrg	-sco5)
182a850946eSmrg		os=-sco3.2v5
183a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
184a850946eSmrg		;;
185a850946eSmrg	-sco4)
186a850946eSmrg		os=-sco3.2v4
187a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188a850946eSmrg		;;
189a850946eSmrg	-sco3.2.[4-9]*)
190a850946eSmrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
191a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192a850946eSmrg		;;
193a850946eSmrg	-sco3.2v[4-9]*)
194a850946eSmrg		# Don't forget version if it is 3.2v4 or newer.
195a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196a850946eSmrg		;;
19770f7c90cSmrg	-sco5v6*)
19870f7c90cSmrg		# Don't forget version if it is 3.2v4 or newer.
19970f7c90cSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20070f7c90cSmrg		;;
201a850946eSmrg	-sco*)
202a850946eSmrg		os=-sco3.2v2
203a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204a850946eSmrg		;;
205a850946eSmrg	-udk*)
206a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207a850946eSmrg		;;
208a850946eSmrg	-isc)
209a850946eSmrg		os=-isc2.2
210a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211a850946eSmrg		;;
212a850946eSmrg	-clix*)
213a850946eSmrg		basic_machine=clipper-intergraph
214a850946eSmrg		;;
215a850946eSmrg	-isc*)
216a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
217a850946eSmrg		;;
218a850946eSmrg	-lynx*)
219a850946eSmrg		os=-lynxos
220a850946eSmrg		;;
221a850946eSmrg	-ptx*)
222a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
223a850946eSmrg		;;
224a850946eSmrg	-windowsnt*)
225a850946eSmrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
226a850946eSmrg		;;
227a850946eSmrg	-psos*)
228a850946eSmrg		os=-psos
229a850946eSmrg		;;
230a850946eSmrg	-mint | -mint[0-9]*)
231a850946eSmrg		basic_machine=m68k-atari
232a850946eSmrg		os=-mint
233a850946eSmrg		;;
234a850946eSmrgesac
235a850946eSmrg
236a850946eSmrg# Decode aliases for certain CPU-COMPANY combinations.
237a850946eSmrgcase $basic_machine in
238a850946eSmrg	# Recognize the basic CPU types without company name.
239a850946eSmrg	# Some are omitted here because they have special meanings below.
240a850946eSmrg	1750a | 580 \
241a850946eSmrg	| a29k \
242a850946eSmrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
243a850946eSmrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
24470f7c90cSmrg	| am33_2.0 \
24570f7c90cSmrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
24670f7c90cSmrg	| bfin \
247a850946eSmrg	| c4x | clipper \
248a850946eSmrg	| d10v | d30v | dlx | dsp16xx \
24970f7c90cSmrg	| fido | fr30 | frv \
250a850946eSmrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
251a850946eSmrg	| i370 | i860 | i960 | ia64 \
25270f7c90cSmrg	| ip2k | iq2000 \
25370f7c90cSmrg	| lm32 \
25470f7c90cSmrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
25570f7c90cSmrg	| maxq | mb | microblaze | mcore | mep | metag \
256a850946eSmrg	| mips | mipsbe | mipseb | mipsel | mipsle \
257a850946eSmrg	| mips16 \
258a850946eSmrg	| mips64 | mips64el \
25970f7c90cSmrg	| mips64octeon | mips64octeonel \
260a850946eSmrg	| mips64orion | mips64orionel \
26170f7c90cSmrg	| mips64r5900 | mips64r5900el \
26270f7c90cSmrg	| mips64vr | mips64vrel \
263a850946eSmrg	| mips64vr4100 | mips64vr4100el \
264a850946eSmrg	| mips64vr4300 | mips64vr4300el \
265a850946eSmrg	| mips64vr5000 | mips64vr5000el \
26670f7c90cSmrg	| mips64vr5900 | mips64vr5900el \
267a850946eSmrg	| mipsisa32 | mipsisa32el \
268a850946eSmrg	| mipsisa32r2 | mipsisa32r2el \
269a850946eSmrg	| mipsisa64 | mipsisa64el \
27070f7c90cSmrg	| mipsisa64r2 | mipsisa64r2el \
271a850946eSmrg	| mipsisa64sb1 | mipsisa64sb1el \
272a850946eSmrg	| mipsisa64sr71k | mipsisa64sr71kel \
273a850946eSmrg	| mipstx39 | mipstx39el \
274a850946eSmrg	| mn10200 | mn10300 \
27570f7c90cSmrg	| moxie \
27670f7c90cSmrg	| mt \
277a850946eSmrg	| msp430 \
27870f7c90cSmrg	| nios | nios2 \
279a850946eSmrg	| ns16k | ns32k \
28070f7c90cSmrg	| or32 \
281a850946eSmrg	| pdp10 | pdp11 | pj | pjl \
282a850946eSmrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
283a850946eSmrg	| pyramid \
28470f7c90cSmrg	| score \
28570f7c90cSmrg	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
286a850946eSmrg	| sh64 | sh64le \
28770f7c90cSmrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
28870f7c90cSmrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
28970f7c90cSmrg	| spu | strongarm \
290a850946eSmrg	| tahoe | thumb | tic4x | tic80 | tron \
291a850946eSmrg	| v850 | v850e \
292a850946eSmrg	| we32k \
29370f7c90cSmrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
29470f7c90cSmrg	| z8k | z80)
295a850946eSmrg		basic_machine=$basic_machine-unknown
296a850946eSmrg		;;
297a850946eSmrg	m6811 | m68hc11 | m6812 | m68hc12)
298a850946eSmrg		# Motorola 68HC11/12.
299a850946eSmrg		basic_machine=$basic_machine-unknown
300a850946eSmrg		os=-none
301a850946eSmrg		;;
302a850946eSmrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
303a850946eSmrg		;;
30470f7c90cSmrg	ms1)
30570f7c90cSmrg		basic_machine=mt-unknown
30670f7c90cSmrg		;;
307a850946eSmrg
308a850946eSmrg	# We use `pc' rather than `unknown'
309a850946eSmrg	# because (1) that's what they normally are, and
310a850946eSmrg	# (2) the word "unknown" tends to confuse beginning users.
311a850946eSmrg	i*86 | x86_64)
312a850946eSmrg	  basic_machine=$basic_machine-pc
313a850946eSmrg	  ;;
314a850946eSmrg	# Object if more than one company name word.
315a850946eSmrg	*-*-*)
316a850946eSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
317a850946eSmrg		exit 1
318a850946eSmrg		;;
319a850946eSmrg	# Recognize the basic CPU types with company name.
320a850946eSmrg	580-* \
321a850946eSmrg	| a29k-* \
322a850946eSmrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
323a850946eSmrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
324a850946eSmrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
325a850946eSmrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
32670f7c90cSmrg	| avr-* | avr32-* \
32770f7c90cSmrg	| bfin-* | bs2000-* \
328a850946eSmrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
32970f7c90cSmrg	| clipper-* | craynv-* | cydra-* \
330a850946eSmrg	| d10v-* | d30v-* | dlx-* \
331a850946eSmrg	| elxsi-* \
33270f7c90cSmrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
333a850946eSmrg	| h8300-* | h8500-* \
334a850946eSmrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
335a850946eSmrg	| i*86-* | i860-* | i960-* | ia64-* \
33670f7c90cSmrg	| ip2k-* | iq2000-* \
33770f7c90cSmrg	| lm32-* \
33870f7c90cSmrg	| m32c-* | m32r-* | m32rle-* \
339a850946eSmrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
34070f7c90cSmrg	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
341a850946eSmrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
342a850946eSmrg	| mips16-* \
343a850946eSmrg	| mips64-* | mips64el-* \
34470f7c90cSmrg	| mips64octeon-* | mips64octeonel-* \
345a850946eSmrg	| mips64orion-* | mips64orionel-* \
34670f7c90cSmrg	| mips64r5900-* | mips64r5900el-* \
34770f7c90cSmrg	| mips64vr-* | mips64vrel-* \
348a850946eSmrg	| mips64vr4100-* | mips64vr4100el-* \
349a850946eSmrg	| mips64vr4300-* | mips64vr4300el-* \
350a850946eSmrg	| mips64vr5000-* | mips64vr5000el-* \
35170f7c90cSmrg	| mips64vr5900-* | mips64vr5900el-* \
352a850946eSmrg	| mipsisa32-* | mipsisa32el-* \
353a850946eSmrg	| mipsisa32r2-* | mipsisa32r2el-* \
354a850946eSmrg	| mipsisa64-* | mipsisa64el-* \
35570f7c90cSmrg	| mipsisa64r2-* | mipsisa64r2el-* \
356a850946eSmrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
357a850946eSmrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
358a850946eSmrg	| mipstx39-* | mipstx39el-* \
35970f7c90cSmrg	| mmix-* \
36070f7c90cSmrg	| mt-* \
361a850946eSmrg	| msp430-* \
36270f7c90cSmrg	| nios-* | nios2-* \
36370f7c90cSmrg	| none-* | np1-* | ns16k-* | ns32k-* \
364a850946eSmrg	| orion-* \
365a850946eSmrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
366a850946eSmrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
367a850946eSmrg	| pyramid-* \
368a850946eSmrg	| romp-* | rs6000-* \
36970f7c90cSmrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
370a850946eSmrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
37170f7c90cSmrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
37270f7c90cSmrg	| sparclite-* \
37370f7c90cSmrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
374a850946eSmrg	| tahoe-* | thumb-* \
37570f7c90cSmrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
376a850946eSmrg	| tron-* \
377a850946eSmrg	| v850-* | v850e-* | vax-* \
378a850946eSmrg	| we32k-* \
37970f7c90cSmrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
38070f7c90cSmrg	| xstormy16-* | xtensa*-* \
381a850946eSmrg	| ymp-* \
38270f7c90cSmrg	| z8k-* | z80-*)
38370f7c90cSmrg		;;
38470f7c90cSmrg	# Recognize the basic CPU types without company name, with glob match.
38570f7c90cSmrg	xtensa*)
38670f7c90cSmrg		basic_machine=$basic_machine-unknown
387a850946eSmrg		;;
388a850946eSmrg	# Recognize the various machine names and aliases which stand
389a850946eSmrg	# for a CPU type and a company and sometimes even an OS.
390a850946eSmrg	386bsd)
391a850946eSmrg		basic_machine=i386-unknown
392a850946eSmrg		os=-bsd
393a850946eSmrg		;;
394a850946eSmrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
395a850946eSmrg		basic_machine=m68000-att
396a850946eSmrg		;;
397a850946eSmrg	3b*)
398a850946eSmrg		basic_machine=we32k-att
399a850946eSmrg		;;
400a850946eSmrg	a29khif)
401a850946eSmrg		basic_machine=a29k-amd
402a850946eSmrg		os=-udi
403a850946eSmrg		;;
40470f7c90cSmrg    	abacus)
40570f7c90cSmrg		basic_machine=abacus-unknown
40670f7c90cSmrg		;;
407a850946eSmrg	adobe68k)
408a850946eSmrg		basic_machine=m68010-adobe
409a850946eSmrg		os=-scout
410a850946eSmrg		;;
411a850946eSmrg	alliant | fx80)
412a850946eSmrg		basic_machine=fx80-alliant
413a850946eSmrg		;;
414a850946eSmrg	altos | altos3068)
415a850946eSmrg		basic_machine=m68k-altos
416a850946eSmrg		;;
417a850946eSmrg	am29k)
418a850946eSmrg		basic_machine=a29k-none
419a850946eSmrg		os=-bsd
420a850946eSmrg		;;
421a850946eSmrg	amd64)
422a850946eSmrg		basic_machine=x86_64-pc
423a850946eSmrg		;;
42470f7c90cSmrg	amd64-*)
42570f7c90cSmrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
42670f7c90cSmrg		;;
427a850946eSmrg	amdahl)
428a850946eSmrg		basic_machine=580-amdahl
429a850946eSmrg		os=-sysv
430a850946eSmrg		;;
431a850946eSmrg	amiga | amiga-*)
432a850946eSmrg		basic_machine=m68k-unknown
433a850946eSmrg		;;
434a850946eSmrg	amigaos | amigados)
435a850946eSmrg		basic_machine=m68k-unknown
436a850946eSmrg		os=-amigaos
437a850946eSmrg		;;
438a850946eSmrg	amigaunix | amix)
439a850946eSmrg		basic_machine=m68k-unknown
440a850946eSmrg		os=-sysv4
441a850946eSmrg		;;
442a850946eSmrg	apollo68)
443a850946eSmrg		basic_machine=m68k-apollo
444a850946eSmrg		os=-sysv
445a850946eSmrg		;;
446a850946eSmrg	apollo68bsd)
447a850946eSmrg		basic_machine=m68k-apollo
448a850946eSmrg		os=-bsd
449a850946eSmrg		;;
45070f7c90cSmrg	aros)
45170f7c90cSmrg		basic_machine=i386-pc
45270f7c90cSmrg		os=-aros
45370f7c90cSmrg		;;
454a850946eSmrg	aux)
455a850946eSmrg		basic_machine=m68k-apple
456a850946eSmrg		os=-aux
457a850946eSmrg		;;
458a850946eSmrg	balance)
459a850946eSmrg		basic_machine=ns32k-sequent
460a850946eSmrg		os=-dynix
461a850946eSmrg		;;
46270f7c90cSmrg	blackfin)
46370f7c90cSmrg		basic_machine=bfin-unknown
46470f7c90cSmrg		os=-linux
46570f7c90cSmrg		;;
46670f7c90cSmrg	blackfin-*)
46770f7c90cSmrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
46870f7c90cSmrg		os=-linux
46970f7c90cSmrg		;;
470a850946eSmrg	c90)
471a850946eSmrg		basic_machine=c90-cray
472a850946eSmrg		os=-unicos
473a850946eSmrg		;;
47470f7c90cSmrg        cegcc)
47570f7c90cSmrg		basic_machine=arm-unknown
47670f7c90cSmrg		os=-cegcc
47770f7c90cSmrg		;;
478a850946eSmrg	convex-c1)
479a850946eSmrg		basic_machine=c1-convex
480a850946eSmrg		os=-bsd
481a850946eSmrg		;;
482a850946eSmrg	convex-c2)
483a850946eSmrg		basic_machine=c2-convex
484a850946eSmrg		os=-bsd
485a850946eSmrg		;;
486a850946eSmrg	convex-c32)
487a850946eSmrg		basic_machine=c32-convex
488a850946eSmrg		os=-bsd
489a850946eSmrg		;;
490a850946eSmrg	convex-c34)
491a850946eSmrg		basic_machine=c34-convex
492a850946eSmrg		os=-bsd
493a850946eSmrg		;;
494a850946eSmrg	convex-c38)
495a850946eSmrg		basic_machine=c38-convex
496a850946eSmrg		os=-bsd
497a850946eSmrg		;;
498a850946eSmrg	cray | j90)
499a850946eSmrg		basic_machine=j90-cray
500a850946eSmrg		os=-unicos
501a850946eSmrg		;;
50270f7c90cSmrg	craynv)
50370f7c90cSmrg		basic_machine=craynv-cray
50470f7c90cSmrg		os=-unicosmp
50570f7c90cSmrg		;;
50670f7c90cSmrg	cr16)
50770f7c90cSmrg		basic_machine=cr16-unknown
50870f7c90cSmrg		os=-elf
50970f7c90cSmrg		;;
510a850946eSmrg	crds | unos)
511a850946eSmrg		basic_machine=m68k-crds
512a850946eSmrg		;;
51370f7c90cSmrg	crisv32 | crisv32-* | etraxfs*)
51470f7c90cSmrg		basic_machine=crisv32-axis
51570f7c90cSmrg		;;
516a850946eSmrg	cris | cris-* | etrax*)
517a850946eSmrg		basic_machine=cris-axis
518a850946eSmrg		;;
51970f7c90cSmrg	crx)
52070f7c90cSmrg		basic_machine=crx-unknown
52170f7c90cSmrg		os=-elf
52270f7c90cSmrg		;;
523a850946eSmrg	da30 | da30-*)
524a850946eSmrg		basic_machine=m68k-da30
525a850946eSmrg		;;
526a850946eSmrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
527a850946eSmrg		basic_machine=mips-dec
528a850946eSmrg		;;
529a850946eSmrg	decsystem10* | dec10*)
530a850946eSmrg		basic_machine=pdp10-dec
531a850946eSmrg		os=-tops10
532a850946eSmrg		;;
533a850946eSmrg	decsystem20* | dec20*)
534a850946eSmrg		basic_machine=pdp10-dec
535a850946eSmrg		os=-tops20
536a850946eSmrg		;;
537a850946eSmrg	delta | 3300 | motorola-3300 | motorola-delta \
538a850946eSmrg	      | 3300-motorola | delta-motorola)
539a850946eSmrg		basic_machine=m68k-motorola
540a850946eSmrg		;;
541a850946eSmrg	delta88)
542a850946eSmrg		basic_machine=m88k-motorola
543a850946eSmrg		os=-sysv3
544a850946eSmrg		;;
54570f7c90cSmrg	dicos)
54670f7c90cSmrg		basic_machine=i686-pc
54770f7c90cSmrg		os=-dicos
54870f7c90cSmrg		;;
54970f7c90cSmrg	djgpp)
55070f7c90cSmrg		basic_machine=i586-pc
55170f7c90cSmrg		os=-msdosdjgpp
55270f7c90cSmrg		;;
553a850946eSmrg	dpx20 | dpx20-*)
554a850946eSmrg		basic_machine=rs6000-bull
555a850946eSmrg		os=-bosx
556a850946eSmrg		;;
557a850946eSmrg	dpx2* | dpx2*-bull)
558a850946eSmrg		basic_machine=m68k-bull
559a850946eSmrg		os=-sysv3
560a850946eSmrg		;;
561a850946eSmrg	ebmon29k)
562a850946eSmrg		basic_machine=a29k-amd
563a850946eSmrg		os=-ebmon
564a850946eSmrg		;;
565a850946eSmrg	elxsi)
566a850946eSmrg		basic_machine=elxsi-elxsi
567a850946eSmrg		os=-bsd
568a850946eSmrg		;;
569a850946eSmrg	encore | umax | mmax)
570a850946eSmrg		basic_machine=ns32k-encore
571a850946eSmrg		;;
572a850946eSmrg	es1800 | OSE68k | ose68k | ose | OSE)
573a850946eSmrg		basic_machine=m68k-ericsson
574a850946eSmrg		os=-ose
575a850946eSmrg		;;
576a850946eSmrg	fx2800)
577a850946eSmrg		basic_machine=i860-alliant
578a850946eSmrg		;;
579a850946eSmrg	genix)
580a850946eSmrg		basic_machine=ns32k-ns
581a850946eSmrg		;;
582a850946eSmrg	gmicro)
583a850946eSmrg		basic_machine=tron-gmicro
584a850946eSmrg		os=-sysv
585a850946eSmrg		;;
586a850946eSmrg	go32)
587a850946eSmrg		basic_machine=i386-pc
588a850946eSmrg		os=-go32
589a850946eSmrg		;;
590a850946eSmrg	h3050r* | hiux*)
591a850946eSmrg		basic_machine=hppa1.1-hitachi
592a850946eSmrg		os=-hiuxwe2
593a850946eSmrg		;;
594a850946eSmrg	h8300hms)
595a850946eSmrg		basic_machine=h8300-hitachi
596a850946eSmrg		os=-hms
597a850946eSmrg		;;
598a850946eSmrg	h8300xray)
599a850946eSmrg		basic_machine=h8300-hitachi
600a850946eSmrg		os=-xray
601a850946eSmrg		;;
602a850946eSmrg	h8500hms)
603a850946eSmrg		basic_machine=h8500-hitachi
604a850946eSmrg		os=-hms
605a850946eSmrg		;;
606a850946eSmrg	harris)
607a850946eSmrg		basic_machine=m88k-harris
608a850946eSmrg		os=-sysv3
609a850946eSmrg		;;
610a850946eSmrg	hp300-*)
611a850946eSmrg		basic_machine=m68k-hp
612a850946eSmrg		;;
613a850946eSmrg	hp300bsd)
614a850946eSmrg		basic_machine=m68k-hp
615a850946eSmrg		os=-bsd
616a850946eSmrg		;;
617a850946eSmrg	hp300hpux)
618a850946eSmrg		basic_machine=m68k-hp
619a850946eSmrg		os=-hpux
620a850946eSmrg		;;
621a850946eSmrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
622a850946eSmrg		basic_machine=hppa1.0-hp
623a850946eSmrg		;;
624a850946eSmrg	hp9k2[0-9][0-9] | hp9k31[0-9])
625a850946eSmrg		basic_machine=m68000-hp
626a850946eSmrg		;;
627a850946eSmrg	hp9k3[2-9][0-9])
628a850946eSmrg		basic_machine=m68k-hp
629a850946eSmrg		;;
630a850946eSmrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
631a850946eSmrg		basic_machine=hppa1.0-hp
632a850946eSmrg		;;
633a850946eSmrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
634a850946eSmrg		basic_machine=hppa1.1-hp
635a850946eSmrg		;;
636a850946eSmrg	hp9k78[0-9] | hp78[0-9])
637a850946eSmrg		# FIXME: really hppa2.0-hp
638a850946eSmrg		basic_machine=hppa1.1-hp
639a850946eSmrg		;;
640a850946eSmrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
641a850946eSmrg		# FIXME: really hppa2.0-hp
642a850946eSmrg		basic_machine=hppa1.1-hp
643a850946eSmrg		;;
644a850946eSmrg	hp9k8[0-9][13679] | hp8[0-9][13679])
645a850946eSmrg		basic_machine=hppa1.1-hp
646a850946eSmrg		;;
647a850946eSmrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
648a850946eSmrg		basic_machine=hppa1.0-hp
649a850946eSmrg		;;
650a850946eSmrg	hppa-next)
651a850946eSmrg		os=-nextstep3
652a850946eSmrg		;;
653a850946eSmrg	hppaosf)
654a850946eSmrg		basic_machine=hppa1.1-hp
655a850946eSmrg		os=-osf
656a850946eSmrg		;;
657a850946eSmrg	hppro)
658a850946eSmrg		basic_machine=hppa1.1-hp
659a850946eSmrg		os=-proelf
660a850946eSmrg		;;
661a850946eSmrg	i370-ibm* | ibm*)
662a850946eSmrg		basic_machine=i370-ibm
663a850946eSmrg		;;
664a850946eSmrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
665a850946eSmrg	i*86v32)
666a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
667a850946eSmrg		os=-sysv32
668a850946eSmrg		;;
669a850946eSmrg	i*86v4*)
670a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
671a850946eSmrg		os=-sysv4
672a850946eSmrg		;;
673a850946eSmrg	i*86v)
674a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
675a850946eSmrg		os=-sysv
676a850946eSmrg		;;
677a850946eSmrg	i*86sol2)
678a850946eSmrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
679a850946eSmrg		os=-solaris2
680a850946eSmrg		;;
681a850946eSmrg	i386mach)
682a850946eSmrg		basic_machine=i386-mach
683a850946eSmrg		os=-mach
684a850946eSmrg		;;
685a850946eSmrg	i386-vsta | vsta)
686a850946eSmrg		basic_machine=i386-unknown
687a850946eSmrg		os=-vsta
688a850946eSmrg		;;
689a850946eSmrg	iris | iris4d)
690a850946eSmrg		basic_machine=mips-sgi
691a850946eSmrg		case $os in
692a850946eSmrg		    -irix*)
693a850946eSmrg			;;
694a850946eSmrg		    *)
695a850946eSmrg			os=-irix4
696a850946eSmrg			;;
697a850946eSmrg		esac
698a850946eSmrg		;;
699a850946eSmrg	isi68 | isi)
700a850946eSmrg		basic_machine=m68k-isi
701a850946eSmrg		os=-sysv
702a850946eSmrg		;;
70370f7c90cSmrg	m68knommu)
70470f7c90cSmrg		basic_machine=m68k-unknown
70570f7c90cSmrg		os=-linux
70670f7c90cSmrg		;;
70770f7c90cSmrg	m68knommu-*)
70870f7c90cSmrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
70970f7c90cSmrg		os=-linux
71070f7c90cSmrg		;;
711a850946eSmrg	m88k-omron*)
712a850946eSmrg		basic_machine=m88k-omron
713a850946eSmrg		;;
714a850946eSmrg	magnum | m3230)
715a850946eSmrg		basic_machine=mips-mips
716a850946eSmrg		os=-sysv
717a850946eSmrg		;;
718a850946eSmrg	merlin)
719a850946eSmrg		basic_machine=ns32k-utek
720a850946eSmrg		os=-sysv
721a850946eSmrg		;;
722a850946eSmrg	mingw32)
723a850946eSmrg		basic_machine=i386-pc
724a850946eSmrg		os=-mingw32
725a850946eSmrg		;;
72670f7c90cSmrg	mingw32ce)
72770f7c90cSmrg		basic_machine=arm-unknown
72870f7c90cSmrg		os=-mingw32ce
72970f7c90cSmrg		;;
730a850946eSmrg	miniframe)
731a850946eSmrg		basic_machine=m68000-convergent
732a850946eSmrg		;;
733a850946eSmrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
734a850946eSmrg		basic_machine=m68k-atari
735a850946eSmrg		os=-mint
736a850946eSmrg		;;
737a850946eSmrg	mips3*-*)
738a850946eSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
739a850946eSmrg		;;
740a850946eSmrg	mips3*)
741a850946eSmrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
742a850946eSmrg		;;
743a850946eSmrg	monitor)
744a850946eSmrg		basic_machine=m68k-rom68k
745a850946eSmrg		os=-coff
746a850946eSmrg		;;
747a850946eSmrg	morphos)
748a850946eSmrg		basic_machine=powerpc-unknown
749a850946eSmrg		os=-morphos
750a850946eSmrg		;;
751a850946eSmrg	msdos)
752a850946eSmrg		basic_machine=i386-pc
753a850946eSmrg		os=-msdos
754a850946eSmrg		;;
75570f7c90cSmrg	ms1-*)
75670f7c90cSmrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
75770f7c90cSmrg		;;
758a850946eSmrg	mvs)
759a850946eSmrg		basic_machine=i370-ibm
760a850946eSmrg		os=-mvs
761a850946eSmrg		;;
762a850946eSmrg	ncr3000)
763a850946eSmrg		basic_machine=i486-ncr
764a850946eSmrg		os=-sysv4
765a850946eSmrg		;;
766a850946eSmrg	netbsd386)
767a850946eSmrg		basic_machine=i386-unknown
768a850946eSmrg		os=-netbsd
769a850946eSmrg		;;
770a850946eSmrg	netwinder)
771a850946eSmrg		basic_machine=armv4l-rebel
772a850946eSmrg		os=-linux
773a850946eSmrg		;;
774a850946eSmrg	news | news700 | news800 | news900)
775a850946eSmrg		basic_machine=m68k-sony
776a850946eSmrg		os=-newsos
777a850946eSmrg		;;
778a850946eSmrg	news1000)
779a850946eSmrg		basic_machine=m68030-sony
780a850946eSmrg		os=-newsos
781a850946eSmrg		;;
782a850946eSmrg	news-3600 | risc-news)
783a850946eSmrg		basic_machine=mips-sony
784a850946eSmrg		os=-newsos
785a850946eSmrg		;;
786a850946eSmrg	necv70)
787a850946eSmrg		basic_machine=v70-nec
788a850946eSmrg		os=-sysv
789a850946eSmrg		;;
790a850946eSmrg	next | m*-next )
791a850946eSmrg		basic_machine=m68k-next
792a850946eSmrg		case $os in
793a850946eSmrg		    -nextstep* )
794a850946eSmrg			;;
795a850946eSmrg		    -ns2*)
796a850946eSmrg		      os=-nextstep2
797a850946eSmrg			;;
798a850946eSmrg		    *)
799a850946eSmrg		      os=-nextstep3
800a850946eSmrg			;;
801a850946eSmrg		esac
802a850946eSmrg		;;
803a850946eSmrg	nh3000)
804a850946eSmrg		basic_machine=m68k-harris
805a850946eSmrg		os=-cxux
806a850946eSmrg		;;
807a850946eSmrg	nh[45]000)
808a850946eSmrg		basic_machine=m88k-harris
809a850946eSmrg		os=-cxux
810a850946eSmrg		;;
811a850946eSmrg	nindy960)
812a850946eSmrg		basic_machine=i960-intel
813a850946eSmrg		os=-nindy
814a850946eSmrg		;;
815a850946eSmrg	mon960)
816a850946eSmrg		basic_machine=i960-intel
817a850946eSmrg		os=-mon960
818a850946eSmrg		;;
819a850946eSmrg	nonstopux)
820a850946eSmrg		basic_machine=mips-compaq
821a850946eSmrg		os=-nonstopux
822a850946eSmrg		;;
823a850946eSmrg	np1)
824a850946eSmrg		basic_machine=np1-gould
825a850946eSmrg		;;
826a850946eSmrg	nsr-tandem)
827a850946eSmrg		basic_machine=nsr-tandem
828a850946eSmrg		;;
829a850946eSmrg	op50n-* | op60c-*)
830a850946eSmrg		basic_machine=hppa1.1-oki
831a850946eSmrg		os=-proelf
832a850946eSmrg		;;
83370f7c90cSmrg	openrisc | openrisc-*)
834a850946eSmrg		basic_machine=or32-unknown
83570f7c90cSmrg		;;
83670f7c90cSmrg	os400)
83770f7c90cSmrg		basic_machine=powerpc-ibm
83870f7c90cSmrg		os=-os400
839a850946eSmrg		;;
840a850946eSmrg	OSE68000 | ose68000)
841a850946eSmrg		basic_machine=m68000-ericsson
842a850946eSmrg		os=-ose
843a850946eSmrg		;;
844a850946eSmrg	os68k)
845a850946eSmrg		basic_machine=m68k-none
846a850946eSmrg		os=-os68k
847a850946eSmrg		;;
848a850946eSmrg	pa-hitachi)
849a850946eSmrg		basic_machine=hppa1.1-hitachi
850a850946eSmrg		os=-hiuxwe2
851a850946eSmrg		;;
852a850946eSmrg	paragon)
853a850946eSmrg		basic_machine=i860-intel
854a850946eSmrg		os=-osf
855a850946eSmrg		;;
85670f7c90cSmrg	parisc)
85770f7c90cSmrg		basic_machine=hppa-unknown
85870f7c90cSmrg		os=-linux
85970f7c90cSmrg		;;
86070f7c90cSmrg	parisc-*)
86170f7c90cSmrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
86270f7c90cSmrg		os=-linux
86370f7c90cSmrg		;;
864a850946eSmrg	pbd)
865a850946eSmrg		basic_machine=sparc-tti
866a850946eSmrg		;;
867a850946eSmrg	pbb)
868a850946eSmrg		basic_machine=m68k-tti
869a850946eSmrg		;;
870a850946eSmrg	pc532 | pc532-*)
871a850946eSmrg		basic_machine=ns32k-pc532
872a850946eSmrg		;;
87370f7c90cSmrg	pc98)
87470f7c90cSmrg		basic_machine=i386-pc
87570f7c90cSmrg		;;
87670f7c90cSmrg	pc98-*)
87770f7c90cSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
87870f7c90cSmrg		;;
879a850946eSmrg	pentium | p5 | k5 | k6 | nexgen | viac3)
880a850946eSmrg		basic_machine=i586-pc
881a850946eSmrg		;;
882a850946eSmrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
883a850946eSmrg		basic_machine=i686-pc
884a850946eSmrg		;;
885a850946eSmrg	pentiumii | pentium2 | pentiumiii | pentium3)
886a850946eSmrg		basic_machine=i686-pc
887a850946eSmrg		;;
888a850946eSmrg	pentium4)
889a850946eSmrg		basic_machine=i786-pc
890a850946eSmrg		;;
891a850946eSmrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
892a850946eSmrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
893a850946eSmrg		;;
894a850946eSmrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
895a850946eSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
896a850946eSmrg		;;
897a850946eSmrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
898a850946eSmrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
899a850946eSmrg		;;
900a850946eSmrg	pentium4-*)
901a850946eSmrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
902a850946eSmrg		;;
903a850946eSmrg	pn)
904a850946eSmrg		basic_machine=pn-gould
905a850946eSmrg		;;
906a850946eSmrg	power)	basic_machine=power-ibm
907a850946eSmrg		;;
908a850946eSmrg	ppc)	basic_machine=powerpc-unknown
909a850946eSmrg		;;
910a850946eSmrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
911a850946eSmrg		;;
912a850946eSmrg	ppcle | powerpclittle | ppc-le | powerpc-little)
913a850946eSmrg		basic_machine=powerpcle-unknown
914a850946eSmrg		;;
915a850946eSmrg	ppcle-* | powerpclittle-*)
916a850946eSmrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
917a850946eSmrg		;;
918a850946eSmrg	ppc64)	basic_machine=powerpc64-unknown
919a850946eSmrg		;;
920a850946eSmrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
921a850946eSmrg		;;
922a850946eSmrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
923a850946eSmrg		basic_machine=powerpc64le-unknown
924a850946eSmrg		;;
925a850946eSmrg	ppc64le-* | powerpc64little-*)
926a850946eSmrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
927a850946eSmrg		;;
928a850946eSmrg	ps2)
929a850946eSmrg		basic_machine=i386-ibm
930a850946eSmrg		;;
931a850946eSmrg	pw32)
932a850946eSmrg		basic_machine=i586-unknown
933a850946eSmrg		os=-pw32
934a850946eSmrg		;;
93570f7c90cSmrg	rdos)
93670f7c90cSmrg		basic_machine=i386-pc
93770f7c90cSmrg		os=-rdos
93870f7c90cSmrg		;;
939a850946eSmrg	rom68k)
940a850946eSmrg		basic_machine=m68k-rom68k
941a850946eSmrg		os=-coff
942a850946eSmrg		;;
943a850946eSmrg	rm[46]00)
944a850946eSmrg		basic_machine=mips-siemens
945a850946eSmrg		;;
946a850946eSmrg	rtpc | rtpc-*)
947a850946eSmrg		basic_machine=romp-ibm
948a850946eSmrg		;;
94970f7c90cSmrg	s390 | s390-*)
95070f7c90cSmrg		basic_machine=s390-ibm
95170f7c90cSmrg		;;
95270f7c90cSmrg	s390x | s390x-*)
95370f7c90cSmrg		basic_machine=s390x-ibm
95470f7c90cSmrg		;;
955a850946eSmrg	sa29200)
956a850946eSmrg		basic_machine=a29k-amd
957a850946eSmrg		os=-udi
958a850946eSmrg		;;
959a850946eSmrg	sb1)
960a850946eSmrg		basic_machine=mipsisa64sb1-unknown
961a850946eSmrg		;;
962a850946eSmrg	sb1el)
963a850946eSmrg		basic_machine=mipsisa64sb1el-unknown
964a850946eSmrg		;;
96570f7c90cSmrg	sde)
96670f7c90cSmrg		basic_machine=mipsisa32-sde
96770f7c90cSmrg		os=-elf
96870f7c90cSmrg		;;
969a850946eSmrg	sei)
970a850946eSmrg		basic_machine=mips-sei
971a850946eSmrg		os=-seiux
972a850946eSmrg		;;
973a850946eSmrg	sequent)
974a850946eSmrg		basic_machine=i386-sequent
975a850946eSmrg		;;
976a850946eSmrg	sh)
977a850946eSmrg		basic_machine=sh-hitachi
978a850946eSmrg		os=-hms
979a850946eSmrg		;;
98070f7c90cSmrg	sh5el)
98170f7c90cSmrg		basic_machine=sh5le-unknown
98270f7c90cSmrg		;;
983a850946eSmrg	sh64)
984a850946eSmrg		basic_machine=sh64-unknown
985a850946eSmrg		;;
986a850946eSmrg	sparclite-wrs | simso-wrs)
987a850946eSmrg		basic_machine=sparclite-wrs
988a850946eSmrg		os=-vxworks
989a850946eSmrg		;;
990a850946eSmrg	sps7)
991a850946eSmrg		basic_machine=m68k-bull
992a850946eSmrg		os=-sysv2
993a850946eSmrg		;;
994a850946eSmrg	spur)
995a850946eSmrg		basic_machine=spur-unknown
996a850946eSmrg		;;
997a850946eSmrg	st2000)
998a850946eSmrg		basic_machine=m68k-tandem
999a850946eSmrg		;;
1000a850946eSmrg	stratus)
1001a850946eSmrg		basic_machine=i860-stratus
1002a850946eSmrg		os=-sysv4
1003a850946eSmrg		;;
1004a850946eSmrg	sun2)
1005a850946eSmrg		basic_machine=m68000-sun
1006a850946eSmrg		;;
1007a850946eSmrg	sun2os3)
1008a850946eSmrg		basic_machine=m68000-sun
1009a850946eSmrg		os=-sunos3
1010a850946eSmrg		;;
1011a850946eSmrg	sun2os4)
1012a850946eSmrg		basic_machine=m68000-sun
1013a850946eSmrg		os=-sunos4
1014a850946eSmrg		;;
1015a850946eSmrg	sun3os3)
1016a850946eSmrg		basic_machine=m68k-sun
1017a850946eSmrg		os=-sunos3
1018a850946eSmrg		;;
1019a850946eSmrg	sun3os4)
1020a850946eSmrg		basic_machine=m68k-sun
1021a850946eSmrg		os=-sunos4
1022a850946eSmrg		;;
1023a850946eSmrg	sun4os3)
1024a850946eSmrg		basic_machine=sparc-sun
1025a850946eSmrg		os=-sunos3
1026a850946eSmrg		;;
1027a850946eSmrg	sun4os4)
1028a850946eSmrg		basic_machine=sparc-sun
1029a850946eSmrg		os=-sunos4
1030a850946eSmrg		;;
1031a850946eSmrg	sun4sol2)
1032a850946eSmrg		basic_machine=sparc-sun
1033a850946eSmrg		os=-solaris2
1034a850946eSmrg		;;
1035a850946eSmrg	sun3 | sun3-*)
1036a850946eSmrg		basic_machine=m68k-sun
1037a850946eSmrg		;;
1038a850946eSmrg	sun4)
1039a850946eSmrg		basic_machine=sparc-sun
1040a850946eSmrg		;;
1041a850946eSmrg	sun386 | sun386i | roadrunner)
1042a850946eSmrg		basic_machine=i386-sun
1043a850946eSmrg		;;
1044a850946eSmrg	sv1)
1045a850946eSmrg		basic_machine=sv1-cray
1046a850946eSmrg		os=-unicos
1047a850946eSmrg		;;
1048a850946eSmrg	symmetry)
1049a850946eSmrg		basic_machine=i386-sequent
1050a850946eSmrg		os=-dynix
1051a850946eSmrg		;;
1052a850946eSmrg	t3e)
1053a850946eSmrg		basic_machine=alphaev5-cray
1054a850946eSmrg		os=-unicos
1055a850946eSmrg		;;
1056a850946eSmrg	t90)
1057a850946eSmrg		basic_machine=t90-cray
1058a850946eSmrg		os=-unicos
1059a850946eSmrg		;;
1060a850946eSmrg	tic54x | c54x*)
1061a850946eSmrg		basic_machine=tic54x-unknown
1062a850946eSmrg		os=-coff
1063a850946eSmrg		;;
1064a850946eSmrg	tic55x | c55x*)
1065a850946eSmrg		basic_machine=tic55x-unknown
1066a850946eSmrg		os=-coff
1067a850946eSmrg		;;
1068a850946eSmrg	tic6x | c6x*)
1069a850946eSmrg		basic_machine=tic6x-unknown
1070a850946eSmrg		os=-coff
1071a850946eSmrg		;;
107270f7c90cSmrg	tile*)
107370f7c90cSmrg		basic_machine=tile-unknown
107470f7c90cSmrg		os=-linux-gnu
107570f7c90cSmrg		;;
1076a850946eSmrg	tx39)
1077a850946eSmrg		basic_machine=mipstx39-unknown
1078a850946eSmrg		;;
1079a850946eSmrg	tx39el)
1080a850946eSmrg		basic_machine=mipstx39el-unknown
1081a850946eSmrg		;;
1082a850946eSmrg	toad1)
1083a850946eSmrg		basic_machine=pdp10-xkl
1084a850946eSmrg		os=-tops20
1085a850946eSmrg		;;
1086a850946eSmrg	tower | tower-32)
1087a850946eSmrg		basic_machine=m68k-ncr
1088a850946eSmrg		;;
108970f7c90cSmrg	tpf)
109070f7c90cSmrg		basic_machine=s390x-ibm
109170f7c90cSmrg		os=-tpf
109270f7c90cSmrg		;;
1093a850946eSmrg	udi29k)
1094a850946eSmrg		basic_machine=a29k-amd
1095a850946eSmrg		os=-udi
1096a850946eSmrg		;;
1097a850946eSmrg	ultra3)
1098a850946eSmrg		basic_machine=a29k-nyu
1099a850946eSmrg		os=-sym1
1100a850946eSmrg		;;
1101a850946eSmrg	v810 | necv810)
1102a850946eSmrg		basic_machine=v810-nec
1103a850946eSmrg		os=-none
1104a850946eSmrg		;;
1105a850946eSmrg	vaxv)
1106a850946eSmrg		basic_machine=vax-dec
1107a850946eSmrg		os=-sysv
1108a850946eSmrg		;;
1109a850946eSmrg	vms)
1110a850946eSmrg		basic_machine=vax-dec
1111a850946eSmrg		os=-vms
1112a850946eSmrg		;;
1113a850946eSmrg	vpp*|vx|vx-*)
1114a850946eSmrg		basic_machine=f301-fujitsu
1115a850946eSmrg		;;
1116a850946eSmrg	vxworks960)
1117a850946eSmrg		basic_machine=i960-wrs
1118a850946eSmrg		os=-vxworks
1119a850946eSmrg		;;
1120a850946eSmrg	vxworks68)
1121a850946eSmrg		basic_machine=m68k-wrs
1122a850946eSmrg		os=-vxworks
1123a850946eSmrg		;;
1124a850946eSmrg	vxworks29k)
1125a850946eSmrg		basic_machine=a29k-wrs
1126a850946eSmrg		os=-vxworks
1127a850946eSmrg		;;
1128a850946eSmrg	w65*)
1129a850946eSmrg		basic_machine=w65-wdc
1130a850946eSmrg		os=-none
1131a850946eSmrg		;;
1132a850946eSmrg	w89k-*)
1133a850946eSmrg		basic_machine=hppa1.1-winbond
1134a850946eSmrg		os=-proelf
1135a850946eSmrg		;;
113670f7c90cSmrg	xbox)
113770f7c90cSmrg		basic_machine=i686-pc
113870f7c90cSmrg		os=-mingw32
113970f7c90cSmrg		;;
1140a850946eSmrg	xps | xps100)
1141a850946eSmrg		basic_machine=xps100-honeywell
1142a850946eSmrg		;;
1143a850946eSmrg	ymp)
1144a850946eSmrg		basic_machine=ymp-cray
1145a850946eSmrg		os=-unicos
1146a850946eSmrg		;;
1147a850946eSmrg	z8k-*-coff)
1148a850946eSmrg		basic_machine=z8k-unknown
1149a850946eSmrg		os=-sim
1150a850946eSmrg		;;
115170f7c90cSmrg	z80-*-coff)
115270f7c90cSmrg		basic_machine=z80-unknown
115370f7c90cSmrg		os=-sim
115470f7c90cSmrg		;;
1155a850946eSmrg	none)
1156a850946eSmrg		basic_machine=none-none
1157a850946eSmrg		os=-none
1158a850946eSmrg		;;
1159a850946eSmrg
1160a850946eSmrg# Here we handle the default manufacturer of certain CPU types.  It is in
1161a850946eSmrg# some cases the only manufacturer, in others, it is the most popular.
1162a850946eSmrg	w89k)
1163a850946eSmrg		basic_machine=hppa1.1-winbond
1164a850946eSmrg		;;
1165a850946eSmrg	op50n)
1166a850946eSmrg		basic_machine=hppa1.1-oki
1167a850946eSmrg		;;
1168a850946eSmrg	op60c)
1169a850946eSmrg		basic_machine=hppa1.1-oki
1170a850946eSmrg		;;
1171a850946eSmrg	romp)
1172a850946eSmrg		basic_machine=romp-ibm
1173a850946eSmrg		;;
117470f7c90cSmrg	mmix)
117570f7c90cSmrg		basic_machine=mmix-knuth
117670f7c90cSmrg		;;
1177a850946eSmrg	rs6000)
1178a850946eSmrg		basic_machine=rs6000-ibm
1179a850946eSmrg		;;
1180a850946eSmrg	vax)
1181a850946eSmrg		basic_machine=vax-dec
1182a850946eSmrg		;;
1183a850946eSmrg	pdp10)
1184a850946eSmrg		# there are many clones, so DEC is not a safe bet
1185a850946eSmrg		basic_machine=pdp10-unknown
1186a850946eSmrg		;;
1187a850946eSmrg	pdp11)
1188a850946eSmrg		basic_machine=pdp11-dec
1189a850946eSmrg		;;
1190a850946eSmrg	we32k)
1191a850946eSmrg		basic_machine=we32k-att
1192a850946eSmrg		;;
119370f7c90cSmrg	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1194a850946eSmrg		basic_machine=sh-unknown
1195a850946eSmrg		;;
119670f7c90cSmrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1197a850946eSmrg		basic_machine=sparc-sun
1198a850946eSmrg		;;
1199a850946eSmrg	cydra)
1200a850946eSmrg		basic_machine=cydra-cydrome
1201a850946eSmrg		;;
1202a850946eSmrg	orion)
1203a850946eSmrg		basic_machine=orion-highlevel
1204a850946eSmrg		;;
1205a850946eSmrg	orion105)
1206a850946eSmrg		basic_machine=clipper-highlevel
1207a850946eSmrg		;;
1208a850946eSmrg	mac | mpw | mac-mpw)
1209a850946eSmrg		basic_machine=m68k-apple
1210a850946eSmrg		;;
1211a850946eSmrg	pmac | pmac-mpw)
1212a850946eSmrg		basic_machine=powerpc-apple
1213a850946eSmrg		;;
1214a850946eSmrg	*-unknown)
1215a850946eSmrg		# Make sure to match an already-canonicalized machine name.
1216a850946eSmrg		;;
1217a850946eSmrg	*)
1218a850946eSmrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1219a850946eSmrg		exit 1
1220a850946eSmrg		;;
1221a850946eSmrgesac
1222a850946eSmrg
1223a850946eSmrg# Here we canonicalize certain aliases for manufacturers.
1224a850946eSmrgcase $basic_machine in
1225a850946eSmrg	*-digital*)
1226a850946eSmrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1227a850946eSmrg		;;
1228a850946eSmrg	*-commodore*)
1229a850946eSmrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1230a850946eSmrg		;;
1231a850946eSmrg	*)
1232a850946eSmrg		;;
1233a850946eSmrgesac
1234a850946eSmrg
1235a850946eSmrg# Decode manufacturer-specific aliases for certain operating systems.
1236a850946eSmrg
1237a850946eSmrgif [ x"$os" != x"" ]
1238a850946eSmrgthen
1239a850946eSmrgcase $os in
1240a850946eSmrg        # First match some system type aliases
1241a850946eSmrg        # that might get confused with valid system types.
1242a850946eSmrg	# -solaris* is a basic system type, with this one exception.
1243a850946eSmrg	-solaris1 | -solaris1.*)
1244a850946eSmrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1245a850946eSmrg		;;
1246a850946eSmrg	-solaris)
1247a850946eSmrg		os=-solaris2
1248a850946eSmrg		;;
1249a850946eSmrg	-svr4*)
1250a850946eSmrg		os=-sysv4
1251a850946eSmrg		;;
1252a850946eSmrg	-unixware*)
1253a850946eSmrg		os=-sysv4.2uw
1254a850946eSmrg		;;
1255a850946eSmrg	-gnu/linux*)
1256a850946eSmrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1257a850946eSmrg		;;
1258a850946eSmrg	# First accept the basic system types.
1259a850946eSmrg	# The portable systems comes first.
1260a850946eSmrg	# Each alternative MUST END IN A *, to match a version number.
1261a850946eSmrg	# -sysv* is not here because it comes later, after sysvr4.
1262a850946eSmrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1263a850946eSmrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1264a850946eSmrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
126570f7c90cSmrg	      | -kopensolaris* \
1266a850946eSmrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
126770f7c90cSmrg	      | -aos* | -aros* \
1268a850946eSmrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1269a850946eSmrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
127070f7c90cSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
127170f7c90cSmrg	      | -openbsd* | -solidbsd* \
127270f7c90cSmrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
127370f7c90cSmrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1274a850946eSmrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1275a850946eSmrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
127670f7c90cSmrg	      | -chorusos* | -chorusrdb* | -cegcc* \
1277a850946eSmrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
127870f7c90cSmrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
127970f7c90cSmrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
1280a850946eSmrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1281a850946eSmrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1282a850946eSmrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1283a850946eSmrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1284a850946eSmrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
128570f7c90cSmrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
128670f7c90cSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1287a850946eSmrg	# Remember, each alternative MUST END IN *, to match a version number.
1288a850946eSmrg		;;
1289a850946eSmrg	-qnx*)
1290a850946eSmrg		case $basic_machine in
1291a850946eSmrg		    x86-* | i*86-*)
1292a850946eSmrg			;;
1293a850946eSmrg		    *)
1294a850946eSmrg			os=-nto$os
1295a850946eSmrg			;;
1296a850946eSmrg		esac
1297a850946eSmrg		;;
1298a850946eSmrg	-nto-qnx*)
1299a850946eSmrg		;;
1300a850946eSmrg	-nto*)
1301a850946eSmrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1302a850946eSmrg		;;
1303a850946eSmrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
130470f7c90cSmrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1305a850946eSmrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1306a850946eSmrg		;;
1307a850946eSmrg	-mac*)
1308a850946eSmrg		os=`echo $os | sed -e 's|mac|macos|'`
1309a850946eSmrg		;;
131070f7c90cSmrg	-linux-dietlibc)
131170f7c90cSmrg		os=-linux-dietlibc
131270f7c90cSmrg		;;
1313a850946eSmrg	-linux*)
1314a850946eSmrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
1315a850946eSmrg		;;
1316a850946eSmrg	-sunos5*)
1317a850946eSmrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
1318a850946eSmrg		;;
1319a850946eSmrg	-sunos6*)
1320a850946eSmrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
1321a850946eSmrg		;;
1322a850946eSmrg	-opened*)
1323a850946eSmrg		os=-openedition
1324a850946eSmrg		;;
132570f7c90cSmrg        -os400*)
132670f7c90cSmrg		os=-os400
132770f7c90cSmrg		;;
1328a850946eSmrg	-wince*)
1329a850946eSmrg		os=-wince
1330a850946eSmrg		;;
1331a850946eSmrg	-osfrose*)
1332a850946eSmrg		os=-osfrose
1333a850946eSmrg		;;
1334a850946eSmrg	-osf*)
1335a850946eSmrg		os=-osf
1336a850946eSmrg		;;
1337a850946eSmrg	-utek*)
1338a850946eSmrg		os=-bsd
1339a850946eSmrg		;;
1340a850946eSmrg	-dynix*)
1341a850946eSmrg		os=-bsd
1342a850946eSmrg		;;
1343a850946eSmrg	-acis*)
1344a850946eSmrg		os=-aos
1345a850946eSmrg		;;
1346a850946eSmrg	-atheos*)
1347a850946eSmrg		os=-atheos
1348a850946eSmrg		;;
134970f7c90cSmrg	-syllable*)
135070f7c90cSmrg		os=-syllable
135170f7c90cSmrg		;;
1352a850946eSmrg	-386bsd)
1353a850946eSmrg		os=-bsd
1354a850946eSmrg		;;
1355a850946eSmrg	-ctix* | -uts*)
1356a850946eSmrg		os=-sysv
1357a850946eSmrg		;;
1358a850946eSmrg	-nova*)
1359a850946eSmrg		os=-rtmk-nova
1360a850946eSmrg		;;
1361a850946eSmrg	-ns2 )
1362a850946eSmrg		os=-nextstep2
1363a850946eSmrg		;;
1364a850946eSmrg	-nsk*)
1365a850946eSmrg		os=-nsk
1366a850946eSmrg		;;
1367a850946eSmrg	# Preserve the version number of sinix5.
1368a850946eSmrg	-sinix5.*)
1369a850946eSmrg		os=`echo $os | sed -e 's|sinix|sysv|'`
1370a850946eSmrg		;;
1371a850946eSmrg	-sinix*)
1372a850946eSmrg		os=-sysv4
1373a850946eSmrg		;;
137470f7c90cSmrg        -tpf*)
137570f7c90cSmrg		os=-tpf
137670f7c90cSmrg		;;
1377a850946eSmrg	-triton*)
1378a850946eSmrg		os=-sysv3
1379a850946eSmrg		;;
1380a850946eSmrg	-oss*)
1381a850946eSmrg		os=-sysv3
1382a850946eSmrg		;;
1383a850946eSmrg	-svr4)
1384a850946eSmrg		os=-sysv4
1385a850946eSmrg		;;
1386a850946eSmrg	-svr3)
1387a850946eSmrg		os=-sysv3
1388a850946eSmrg		;;
1389a850946eSmrg	-sysvr4)
1390a850946eSmrg		os=-sysv4
1391a850946eSmrg		;;
1392a850946eSmrg	# This must come after -sysvr4.
1393a850946eSmrg	-sysv*)
1394a850946eSmrg		;;
1395a850946eSmrg	-ose*)
1396a850946eSmrg		os=-ose
1397a850946eSmrg		;;
1398a850946eSmrg	-es1800*)
1399a850946eSmrg		os=-ose
1400a850946eSmrg		;;
1401a850946eSmrg	-xenix)
1402a850946eSmrg		os=-xenix
1403a850946eSmrg		;;
1404a850946eSmrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1405a850946eSmrg		os=-mint
1406a850946eSmrg		;;
1407a850946eSmrg	-aros*)
1408a850946eSmrg		os=-aros
1409a850946eSmrg		;;
1410a850946eSmrg	-kaos*)
1411a850946eSmrg		os=-kaos
1412a850946eSmrg		;;
141370f7c90cSmrg	-zvmoe)
141470f7c90cSmrg		os=-zvmoe
141570f7c90cSmrg		;;
141670f7c90cSmrg	-dicos*)
141770f7c90cSmrg		os=-dicos
141870f7c90cSmrg		;;
1419a850946eSmrg	-none)
1420a850946eSmrg		;;
1421a850946eSmrg	*)
1422a850946eSmrg		# Get rid of the `-' at the beginning of $os.
1423a850946eSmrg		os=`echo $os | sed 's/[^-]*-//'`
1424a850946eSmrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1425a850946eSmrg		exit 1
1426a850946eSmrg		;;
1427a850946eSmrgesac
1428a850946eSmrgelse
1429a850946eSmrg
1430a850946eSmrg# Here we handle the default operating systems that come with various machines.
1431a850946eSmrg# The value should be what the vendor currently ships out the door with their
1432a850946eSmrg# machine or put another way, the most popular os provided with the machine.
1433a850946eSmrg
1434a850946eSmrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
1435a850946eSmrg# "-sun"), then you have to tell the case statement up towards the top
1436a850946eSmrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
1437a850946eSmrg# will signal an error saying that MANUFACTURER isn't an operating
1438a850946eSmrg# system, and we'll never get to this point.
1439a850946eSmrg
1440a850946eSmrgcase $basic_machine in
144170f7c90cSmrg        score-*)
144270f7c90cSmrg		os=-elf
144370f7c90cSmrg		;;
144470f7c90cSmrg        spu-*)
144570f7c90cSmrg		os=-elf
144670f7c90cSmrg		;;
1447a850946eSmrg	*-acorn)
1448a850946eSmrg		os=-riscix1.2
1449a850946eSmrg		;;
1450a850946eSmrg	arm*-rebel)
1451a850946eSmrg		os=-linux
1452a850946eSmrg		;;
1453a850946eSmrg	arm*-semi)
1454a850946eSmrg		os=-aout
1455a850946eSmrg		;;
145670f7c90cSmrg        c4x-* | tic4x-*)
145770f7c90cSmrg        	os=-coff
1458a850946eSmrg		;;
1459a850946eSmrg	# This must come before the *-dec entry.
1460a850946eSmrg	pdp10-*)
1461a850946eSmrg		os=-tops20
1462a850946eSmrg		;;
1463a850946eSmrg	pdp11-*)
1464a850946eSmrg		os=-none
1465a850946eSmrg		;;
1466a850946eSmrg	*-dec | vax-*)
1467a850946eSmrg		os=-ultrix4.2
1468a850946eSmrg		;;
1469a850946eSmrg	m68*-apollo)
1470a850946eSmrg		os=-domain
1471a850946eSmrg		;;
1472a850946eSmrg	i386-sun)
1473a850946eSmrg		os=-sunos4.0.2
1474a850946eSmrg		;;
1475a850946eSmrg	m68000-sun)
1476a850946eSmrg		os=-sunos3
1477a850946eSmrg		# This also exists in the configure program, but was not the
1478a850946eSmrg		# default.
1479a850946eSmrg		# os=-sunos4
1480a850946eSmrg		;;
1481a850946eSmrg	m68*-cisco)
1482a850946eSmrg		os=-aout
1483a850946eSmrg		;;
148470f7c90cSmrg        mep-*)
148570f7c90cSmrg		os=-elf
148670f7c90cSmrg		;;
1487a850946eSmrg	mips*-cisco)
1488a850946eSmrg		os=-elf
1489a850946eSmrg		;;
1490a850946eSmrg	mips*-*)
1491a850946eSmrg		os=-elf
1492a850946eSmrg		;;
1493a850946eSmrg	or32-*)
1494a850946eSmrg		os=-coff
1495a850946eSmrg		;;
1496a850946eSmrg	*-tti)	# must be before sparc entry or we get the wrong os.
1497a850946eSmrg		os=-sysv3
1498a850946eSmrg		;;
1499a850946eSmrg	sparc-* | *-sun)
1500a850946eSmrg		os=-sunos4.1.1
1501a850946eSmrg		;;
1502a850946eSmrg	*-be)
1503a850946eSmrg		os=-beos
1504a850946eSmrg		;;
150570f7c90cSmrg	*-haiku)
150670f7c90cSmrg		os=-haiku
150770f7c90cSmrg		;;
1508a850946eSmrg	*-ibm)
1509a850946eSmrg		os=-aix
1510a850946eSmrg		;;
151170f7c90cSmrg    	*-knuth)
151270f7c90cSmrg		os=-mmixware
151370f7c90cSmrg		;;
1514a850946eSmrg	*-wec)
1515a850946eSmrg		os=-proelf
1516a850946eSmrg		;;
1517a850946eSmrg	*-winbond)
1518a850946eSmrg		os=-proelf
1519a850946eSmrg		;;
1520a850946eSmrg	*-oki)
1521a850946eSmrg		os=-proelf
1522a850946eSmrg		;;
1523a850946eSmrg	*-hp)
1524a850946eSmrg		os=-hpux
1525a850946eSmrg		;;
1526a850946eSmrg	*-hitachi)
1527a850946eSmrg		os=-hiux
1528a850946eSmrg		;;
1529a850946eSmrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1530a850946eSmrg		os=-sysv
1531a850946eSmrg		;;
1532a850946eSmrg	*-cbm)
1533a850946eSmrg		os=-amigaos
1534a850946eSmrg		;;
1535a850946eSmrg	*-dg)
1536a850946eSmrg		os=-dgux
1537a850946eSmrg		;;
1538a850946eSmrg	*-dolphin)
1539a850946eSmrg		os=-sysv3
1540a850946eSmrg		;;
1541a850946eSmrg	m68k-ccur)
1542a850946eSmrg		os=-rtu
1543a850946eSmrg		;;
1544a850946eSmrg	m88k-omron*)
1545a850946eSmrg		os=-luna
1546a850946eSmrg		;;
1547a850946eSmrg	*-next )
1548a850946eSmrg		os=-nextstep
1549a850946eSmrg		;;
1550a850946eSmrg	*-sequent)
1551a850946eSmrg		os=-ptx
1552a850946eSmrg		;;
1553a850946eSmrg	*-crds)
1554a850946eSmrg		os=-unos
1555a850946eSmrg		;;
1556a850946eSmrg	*-ns)
1557a850946eSmrg		os=-genix
1558a850946eSmrg		;;
1559a850946eSmrg	i370-*)
1560a850946eSmrg		os=-mvs
1561a850946eSmrg		;;
1562a850946eSmrg	*-next)
1563a850946eSmrg		os=-nextstep3
1564a850946eSmrg		;;
1565a850946eSmrg	*-gould)
1566a850946eSmrg		os=-sysv
1567a850946eSmrg		;;
1568a850946eSmrg	*-highlevel)
1569a850946eSmrg		os=-bsd
1570a850946eSmrg		;;
1571a850946eSmrg	*-encore)
1572a850946eSmrg		os=-bsd
1573a850946eSmrg		;;
1574a850946eSmrg	*-sgi)
1575a850946eSmrg		os=-irix
1576a850946eSmrg		;;
1577a850946eSmrg	*-siemens)
1578a850946eSmrg		os=-sysv4
1579a850946eSmrg		;;
1580a850946eSmrg	*-masscomp)
1581a850946eSmrg		os=-rtu
1582a850946eSmrg		;;
1583a850946eSmrg	f30[01]-fujitsu | f700-fujitsu)
1584a850946eSmrg		os=-uxpv
1585a850946eSmrg		;;
1586a850946eSmrg	*-rom68k)
1587a850946eSmrg		os=-coff
1588a850946eSmrg		;;
1589a850946eSmrg	*-*bug)
1590a850946eSmrg		os=-coff
1591a850946eSmrg		;;
1592a850946eSmrg	*-apple)
1593a850946eSmrg		os=-macos
1594a850946eSmrg		;;
1595a850946eSmrg	*-atari*)
1596a850946eSmrg		os=-mint
1597a850946eSmrg		;;
1598a850946eSmrg	*)
1599a850946eSmrg		os=-none
1600a850946eSmrg		;;
1601a850946eSmrgesac
1602a850946eSmrgfi
1603a850946eSmrg
1604a850946eSmrg# Here we handle the case where we know the os, and the CPU type, but not the
1605a850946eSmrg# manufacturer.  We pick the logical manufacturer.
1606a850946eSmrgvendor=unknown
1607a850946eSmrgcase $basic_machine in
1608a850946eSmrg	*-unknown)
1609a850946eSmrg		case $os in
1610a850946eSmrg			-riscix*)
1611a850946eSmrg				vendor=acorn
1612a850946eSmrg				;;
1613a850946eSmrg			-sunos*)
1614a850946eSmrg				vendor=sun
1615a850946eSmrg				;;
1616a850946eSmrg			-aix*)
1617a850946eSmrg				vendor=ibm
1618a850946eSmrg				;;
1619a850946eSmrg			-beos*)
1620a850946eSmrg				vendor=be
1621a850946eSmrg				;;
1622a850946eSmrg			-hpux*)
1623a850946eSmrg				vendor=hp
1624a850946eSmrg				;;
1625a850946eSmrg			-mpeix*)
1626a850946eSmrg				vendor=hp
1627a850946eSmrg				;;
1628a850946eSmrg			-hiux*)
1629a850946eSmrg				vendor=hitachi
1630a850946eSmrg				;;
1631a850946eSmrg			-unos*)
1632a850946eSmrg				vendor=crds
1633a850946eSmrg				;;
1634a850946eSmrg			-dgux*)
1635a850946eSmrg				vendor=dg
1636a850946eSmrg				;;
1637a850946eSmrg			-luna*)
1638a850946eSmrg				vendor=omron
1639a850946eSmrg				;;
1640a850946eSmrg			-genix*)
1641a850946eSmrg				vendor=ns
1642a850946eSmrg				;;
1643a850946eSmrg			-mvs* | -opened*)
1644a850946eSmrg				vendor=ibm
1645a850946eSmrg				;;
164670f7c90cSmrg			-os400*)
164770f7c90cSmrg				vendor=ibm
164870f7c90cSmrg				;;
1649a850946eSmrg			-ptx*)
1650a850946eSmrg				vendor=sequent
1651a850946eSmrg				;;
165270f7c90cSmrg			-tpf*)
165370f7c90cSmrg				vendor=ibm
165470f7c90cSmrg				;;
1655a850946eSmrg			-vxsim* | -vxworks* | -windiss*)
1656a850946eSmrg				vendor=wrs
1657a850946eSmrg				;;
1658a850946eSmrg			-aux*)
1659a850946eSmrg				vendor=apple
1660a850946eSmrg				;;
1661a850946eSmrg			-hms*)
1662a850946eSmrg				vendor=hitachi
1663a850946eSmrg				;;
1664a850946eSmrg			-mpw* | -macos*)
1665a850946eSmrg				vendor=apple
1666a850946eSmrg				;;
1667a850946eSmrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1668a850946eSmrg				vendor=atari
1669a850946eSmrg				;;
1670a850946eSmrg			-vos*)
1671a850946eSmrg				vendor=stratus
1672a850946eSmrg				;;
1673a850946eSmrg		esac
1674a850946eSmrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1675a850946eSmrg		;;
1676a850946eSmrgesac
1677a850946eSmrg
1678a850946eSmrgecho $basic_machine$os
167970f7c90cSmrgexit
1680a850946eSmrg
1681a850946eSmrg# Local variables:
1682a850946eSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1683a850946eSmrg# time-stamp-start: "timestamp='"
1684a850946eSmrg# time-stamp-format: "%:y-%02m-%02d"
1685a850946eSmrg# time-stamp-end: "'"
1686a850946eSmrg# End:
1687