config.sub revision fc27e79c
1659607e0Smrg#! /bin/sh
2659607e0Smrg# Configuration validation subroutine script.
3659607e0Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4fc27e79cSmrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5fc27e79cSmrg#   Free Software Foundation, Inc.
6659607e0Smrg
7fc27e79cSmrgtimestamp='2008-01-16'
8659607e0Smrg
9659607e0Smrg# This file is (in principle) common to ALL GNU software.
10659607e0Smrg# The presence of a machine in this file suggests that SOME GNU software
11659607e0Smrg# can handle that machine.  It does not imply ALL GNU software can.
12659607e0Smrg#
13659607e0Smrg# This file is free software; you can redistribute it and/or modify
14659607e0Smrg# it under the terms of the GNU General Public License as published by
15659607e0Smrg# the Free Software Foundation; either version 2 of the License, or
16659607e0Smrg# (at your option) any later version.
17659607e0Smrg#
18659607e0Smrg# This program is distributed in the hope that it will be useful,
19659607e0Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
20659607e0Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21659607e0Smrg# GNU General Public License for more details.
22659607e0Smrg#
23659607e0Smrg# You should have received a copy of the GNU General Public License
24659607e0Smrg# along with this program; if not, write to the Free Software
25659607e0Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26659607e0Smrg# 02110-1301, USA.
27659607e0Smrg#
28659607e0Smrg# As a special exception to the GNU General Public License, if you
29659607e0Smrg# distribute this file as part of a program that contains a
30659607e0Smrg# configuration script generated by Autoconf, you may include it under
31659607e0Smrg# the same distribution terms that you use for the rest of that program.
32659607e0Smrg
33659607e0Smrg
34659607e0Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
35659607e0Smrg# diff and a properly formatted ChangeLog entry.
36659607e0Smrg#
37659607e0Smrg# Configuration subroutine to validate and canonicalize a configuration type.
38659607e0Smrg# Supply the specified configuration type as an argument.
39659607e0Smrg# If it is invalid, we print an error message on stderr and exit with code 1.
40659607e0Smrg# Otherwise, we print the canonical config type on stdout and succeed.
41659607e0Smrg
42659607e0Smrg# This file is supposed to be the same for all GNU packages
43659607e0Smrg# and recognize all the CPU types, system types and aliases
44659607e0Smrg# that are meaningful with *any* GNU software.
45659607e0Smrg# Each package is responsible for reporting which valid configurations
46659607e0Smrg# it does not support.  The user should be able to distinguish
47659607e0Smrg# a failure to support a valid configuration from a meaningless
48659607e0Smrg# configuration.
49659607e0Smrg
50659607e0Smrg# The goal of this file is to map all the various variations of a given
51659607e0Smrg# machine specification into a single specification in the form:
52659607e0Smrg#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
53659607e0Smrg# or in some cases, the newer four-part form:
54659607e0Smrg#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
55659607e0Smrg# It is wrong to echo any other type of specification.
56659607e0Smrg
57659607e0Smrgme=`echo "$0" | sed -e 's,.*/,,'`
58659607e0Smrg
59659607e0Smrgusage="\
60659607e0SmrgUsage: $0 [OPTION] CPU-MFR-OPSYS
61659607e0Smrg       $0 [OPTION] ALIAS
62659607e0Smrg
63659607e0SmrgCanonicalize a configuration name.
64659607e0Smrg
65659607e0SmrgOperation modes:
66659607e0Smrg  -h, --help         print this help, then exit
67659607e0Smrg  -t, --time-stamp   print date of last modification, then exit
68659607e0Smrg  -v, --version      print version number, then exit
69659607e0Smrg
70659607e0SmrgReport bugs and patches to <config-patches@gnu.org>."
71659607e0Smrg
72659607e0Smrgversion="\
73659607e0SmrgGNU config.sub ($timestamp)
74659607e0Smrg
75fc27e79cSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
76fc27e79cSmrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
77659607e0Smrg
78659607e0SmrgThis is free software; see the source for copying conditions.  There is NO
79659607e0Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
80659607e0Smrg
81659607e0Smrghelp="
82659607e0SmrgTry \`$me --help' for more information."
83659607e0Smrg
84659607e0Smrg# Parse command line
85659607e0Smrgwhile test $# -gt 0 ; do
86659607e0Smrg  case $1 in
87659607e0Smrg    --time-stamp | --time* | -t )
88659607e0Smrg       echo "$timestamp" ; exit ;;
89659607e0Smrg    --version | -v )
90659607e0Smrg       echo "$version" ; exit ;;
91659607e0Smrg    --help | --h* | -h )
92659607e0Smrg       echo "$usage"; exit ;;
93659607e0Smrg    -- )     # Stop option processing
94659607e0Smrg       shift; break ;;
95659607e0Smrg    - )	# Use stdin as input.
96659607e0Smrg       break ;;
97659607e0Smrg    -* )
98659607e0Smrg       echo "$me: invalid option $1$help"
99659607e0Smrg       exit 1 ;;
100659607e0Smrg
101659607e0Smrg    *local*)
102659607e0Smrg       # First pass through any local machine types.
103659607e0Smrg       echo $1
104659607e0Smrg       exit ;;
105659607e0Smrg
106659607e0Smrg    * )
107659607e0Smrg       break ;;
108659607e0Smrg  esac
109659607e0Smrgdone
110659607e0Smrg
111659607e0Smrgcase $# in
112659607e0Smrg 0) echo "$me: missing argument$help" >&2
113659607e0Smrg    exit 1;;
114659607e0Smrg 1) ;;
115659607e0Smrg *) echo "$me: too many arguments$help" >&2
116659607e0Smrg    exit 1;;
117659607e0Smrgesac
118659607e0Smrg
119659607e0Smrg# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
120659607e0Smrg# Here we must recognize all the valid KERNEL-OS combinations.
121659607e0Smrgmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
122659607e0Smrgcase $maybe_os in
123659607e0Smrg  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
124659607e0Smrg  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
125659607e0Smrg  storm-chaos* | os2-emx* | rtmk-nova*)
126659607e0Smrg    os=-$maybe_os
127659607e0Smrg    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
128659607e0Smrg    ;;
129659607e0Smrg  *)
130659607e0Smrg    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
131659607e0Smrg    if [ $basic_machine != $1 ]
132659607e0Smrg    then os=`echo $1 | sed 's/.*-/-/'`
133659607e0Smrg    else os=; fi
134659607e0Smrg    ;;
135659607e0Smrgesac
136659607e0Smrg
137659607e0Smrg### Let's recognize common machines as not being operating systems so
138659607e0Smrg### that things like config.sub decstation-3100 work.  We also
139659607e0Smrg### recognize some manufacturers as not being operating systems, so we
140659607e0Smrg### can provide default operating systems below.
141659607e0Smrgcase $os in
142659607e0Smrg	-sun*os*)
143659607e0Smrg		# Prevent following clause from handling this invalid input.
144659607e0Smrg		;;
145659607e0Smrg	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
146659607e0Smrg	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
147659607e0Smrg	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
148659607e0Smrg	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
149659607e0Smrg	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
150659607e0Smrg	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
151659607e0Smrg	-apple | -axis | -knuth | -cray)
152659607e0Smrg		os=
153659607e0Smrg		basic_machine=$1
154659607e0Smrg		;;
155659607e0Smrg	-sim | -cisco | -oki | -wec | -winbond)
156659607e0Smrg		os=
157659607e0Smrg		basic_machine=$1
158659607e0Smrg		;;
159659607e0Smrg	-scout)
160659607e0Smrg		;;
161659607e0Smrg	-wrs)
162659607e0Smrg		os=-vxworks
163659607e0Smrg		basic_machine=$1
164659607e0Smrg		;;
165659607e0Smrg	-chorusos*)
166659607e0Smrg		os=-chorusos
167659607e0Smrg		basic_machine=$1
168659607e0Smrg		;;
169659607e0Smrg 	-chorusrdb)
170659607e0Smrg 		os=-chorusrdb
171659607e0Smrg		basic_machine=$1
172659607e0Smrg 		;;
173659607e0Smrg	-hiux*)
174659607e0Smrg		os=-hiuxwe2
175659607e0Smrg		;;
176659607e0Smrg	-sco6)
177659607e0Smrg		os=-sco5v6
178659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
179659607e0Smrg		;;
180659607e0Smrg	-sco5)
181659607e0Smrg		os=-sco3.2v5
182659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
183659607e0Smrg		;;
184659607e0Smrg	-sco4)
185659607e0Smrg		os=-sco3.2v4
186659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187659607e0Smrg		;;
188659607e0Smrg	-sco3.2.[4-9]*)
189659607e0Smrg		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
190659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191659607e0Smrg		;;
192659607e0Smrg	-sco3.2v[4-9]*)
193659607e0Smrg		# Don't forget version if it is 3.2v4 or newer.
194659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195659607e0Smrg		;;
196659607e0Smrg	-sco5v6*)
197659607e0Smrg		# Don't forget version if it is 3.2v4 or newer.
198659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199659607e0Smrg		;;
200659607e0Smrg	-sco*)
201659607e0Smrg		os=-sco3.2v2
202659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203659607e0Smrg		;;
204659607e0Smrg	-udk*)
205659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
206659607e0Smrg		;;
207659607e0Smrg	-isc)
208659607e0Smrg		os=-isc2.2
209659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
210659607e0Smrg		;;
211659607e0Smrg	-clix*)
212659607e0Smrg		basic_machine=clipper-intergraph
213659607e0Smrg		;;
214659607e0Smrg	-isc*)
215659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
216659607e0Smrg		;;
217659607e0Smrg	-lynx*)
218659607e0Smrg		os=-lynxos
219659607e0Smrg		;;
220659607e0Smrg	-ptx*)
221659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
222659607e0Smrg		;;
223659607e0Smrg	-windowsnt*)
224659607e0Smrg		os=`echo $os | sed -e 's/windowsnt/winnt/'`
225659607e0Smrg		;;
226659607e0Smrg	-psos*)
227659607e0Smrg		os=-psos
228659607e0Smrg		;;
229659607e0Smrg	-mint | -mint[0-9]*)
230659607e0Smrg		basic_machine=m68k-atari
231659607e0Smrg		os=-mint
232659607e0Smrg		;;
233659607e0Smrgesac
234659607e0Smrg
235659607e0Smrg# Decode aliases for certain CPU-COMPANY combinations.
236659607e0Smrgcase $basic_machine in
237659607e0Smrg	# Recognize the basic CPU types without company name.
238659607e0Smrg	# Some are omitted here because they have special meanings below.
239659607e0Smrg	1750a | 580 \
240659607e0Smrg	| a29k \
241659607e0Smrg	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
242659607e0Smrg	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
243659607e0Smrg	| am33_2.0 \
244fc27e79cSmrg	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
245659607e0Smrg	| bfin \
246659607e0Smrg	| c4x | clipper \
247659607e0Smrg	| d10v | d30v | dlx | dsp16xx \
248fc27e79cSmrg	| fido | fr30 | frv \
249659607e0Smrg	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
250659607e0Smrg	| i370 | i860 | i960 | ia64 \
251659607e0Smrg	| ip2k | iq2000 \
252fc27e79cSmrg	| m32c | m32r | m32rle | m68000 | m68k | m88k \
253fc27e79cSmrg	| maxq | mb | microblaze | mcore | mep \
254659607e0Smrg	| mips | mipsbe | mipseb | mipsel | mipsle \
255659607e0Smrg	| mips16 \
256659607e0Smrg	| mips64 | mips64el \
257659607e0Smrg	| mips64vr | mips64vrel \
258659607e0Smrg	| mips64orion | mips64orionel \
259659607e0Smrg	| mips64vr4100 | mips64vr4100el \
260659607e0Smrg	| mips64vr4300 | mips64vr4300el \
261659607e0Smrg	| mips64vr5000 | mips64vr5000el \
262659607e0Smrg	| mips64vr5900 | mips64vr5900el \
263659607e0Smrg	| mipsisa32 | mipsisa32el \
264659607e0Smrg	| mipsisa32r2 | mipsisa32r2el \
265659607e0Smrg	| mipsisa64 | mipsisa64el \
266659607e0Smrg	| mipsisa64r2 | mipsisa64r2el \
267659607e0Smrg	| mipsisa64sb1 | mipsisa64sb1el \
268659607e0Smrg	| mipsisa64sr71k | mipsisa64sr71kel \
269659607e0Smrg	| mipstx39 | mipstx39el \
270659607e0Smrg	| mn10200 | mn10300 \
271659607e0Smrg	| mt \
272659607e0Smrg	| msp430 \
273fc27e79cSmrg	| nios | nios2 \
274659607e0Smrg	| ns16k | ns32k \
275659607e0Smrg	| or32 \
276659607e0Smrg	| pdp10 | pdp11 | pj | pjl \
277659607e0Smrg	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
278659607e0Smrg	| pyramid \
279fc27e79cSmrg	| score \
280fc27e79cSmrg	| sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
281659607e0Smrg	| sh64 | sh64le \
282fc27e79cSmrg	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
283fc27e79cSmrg	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
284fc27e79cSmrg	| spu | strongarm \
285659607e0Smrg	| tahoe | thumb | tic4x | tic80 | tron \
286659607e0Smrg	| v850 | v850e \
287659607e0Smrg	| we32k \
288fc27e79cSmrg	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
289659607e0Smrg	| z8k)
290659607e0Smrg		basic_machine=$basic_machine-unknown
291659607e0Smrg		;;
292659607e0Smrg	m6811 | m68hc11 | m6812 | m68hc12)
293659607e0Smrg		# Motorola 68HC11/12.
294659607e0Smrg		basic_machine=$basic_machine-unknown
295659607e0Smrg		os=-none
296659607e0Smrg		;;
297659607e0Smrg	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
298659607e0Smrg		;;
299659607e0Smrg	ms1)
300659607e0Smrg		basic_machine=mt-unknown
301659607e0Smrg		;;
302659607e0Smrg
303659607e0Smrg	# We use `pc' rather than `unknown'
304659607e0Smrg	# because (1) that's what they normally are, and
305659607e0Smrg	# (2) the word "unknown" tends to confuse beginning users.
306659607e0Smrg	i*86 | x86_64)
307659607e0Smrg	  basic_machine=$basic_machine-pc
308659607e0Smrg	  ;;
309659607e0Smrg	# Object if more than one company name word.
310659607e0Smrg	*-*-*)
311659607e0Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
312659607e0Smrg		exit 1
313659607e0Smrg		;;
314659607e0Smrg	# Recognize the basic CPU types with company name.
315659607e0Smrg	580-* \
316659607e0Smrg	| a29k-* \
317659607e0Smrg	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
318659607e0Smrg	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
319659607e0Smrg	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
320659607e0Smrg	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
321fc27e79cSmrg	| avr-* | avr32-* \
322659607e0Smrg	| bfin-* | bs2000-* \
323659607e0Smrg	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
324659607e0Smrg	| clipper-* | craynv-* | cydra-* \
325659607e0Smrg	| d10v-* | d30v-* | dlx-* \
326659607e0Smrg	| elxsi-* \
327fc27e79cSmrg	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
328659607e0Smrg	| h8300-* | h8500-* \
329659607e0Smrg	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
330659607e0Smrg	| i*86-* | i860-* | i960-* | ia64-* \
331659607e0Smrg	| ip2k-* | iq2000-* \
332fc27e79cSmrg	| m32c-* | m32r-* | m32rle-* \
333659607e0Smrg	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
334659607e0Smrg	| m88110-* | m88k-* | maxq-* | mcore-* \
335659607e0Smrg	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
336659607e0Smrg	| mips16-* \
337659607e0Smrg	| mips64-* | mips64el-* \
338659607e0Smrg	| mips64vr-* | mips64vrel-* \
339659607e0Smrg	| mips64orion-* | mips64orionel-* \
340659607e0Smrg	| mips64vr4100-* | mips64vr4100el-* \
341659607e0Smrg	| mips64vr4300-* | mips64vr4300el-* \
342659607e0Smrg	| mips64vr5000-* | mips64vr5000el-* \
343659607e0Smrg	| mips64vr5900-* | mips64vr5900el-* \
344659607e0Smrg	| mipsisa32-* | mipsisa32el-* \
345659607e0Smrg	| mipsisa32r2-* | mipsisa32r2el-* \
346659607e0Smrg	| mipsisa64-* | mipsisa64el-* \
347659607e0Smrg	| mipsisa64r2-* | mipsisa64r2el-* \
348659607e0Smrg	| mipsisa64sb1-* | mipsisa64sb1el-* \
349659607e0Smrg	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
350659607e0Smrg	| mipstx39-* | mipstx39el-* \
351659607e0Smrg	| mmix-* \
352659607e0Smrg	| mt-* \
353659607e0Smrg	| msp430-* \
354fc27e79cSmrg	| nios-* | nios2-* \
355659607e0Smrg	| none-* | np1-* | ns16k-* | ns32k-* \
356659607e0Smrg	| orion-* \
357659607e0Smrg	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
358659607e0Smrg	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
359659607e0Smrg	| pyramid-* \
360659607e0Smrg	| romp-* | rs6000-* \
361fc27e79cSmrg	| sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
362659607e0Smrg	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
363fc27e79cSmrg	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
364659607e0Smrg	| sparclite-* \
365fc27e79cSmrg	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
366659607e0Smrg	| tahoe-* | thumb-* \
367659607e0Smrg	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
368659607e0Smrg	| tron-* \
369659607e0Smrg	| v850-* | v850e-* | vax-* \
370659607e0Smrg	| we32k-* \
371fc27e79cSmrg	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
372fc27e79cSmrg	| xstormy16-* | xtensa*-* \
373659607e0Smrg	| ymp-* \
374659607e0Smrg	| z8k-*)
375659607e0Smrg		;;
376fc27e79cSmrg	# Recognize the basic CPU types without company name, with glob match.
377fc27e79cSmrg	xtensa*)
378fc27e79cSmrg		basic_machine=$basic_machine-unknown
3796aab59a7Smrg		;;
380659607e0Smrg	# Recognize the various machine names and aliases which stand
381659607e0Smrg	# for a CPU type and a company and sometimes even an OS.
382659607e0Smrg	386bsd)
383659607e0Smrg		basic_machine=i386-unknown
384659607e0Smrg		os=-bsd
385659607e0Smrg		;;
386659607e0Smrg	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
387659607e0Smrg		basic_machine=m68000-att
388659607e0Smrg		;;
389659607e0Smrg	3b*)
390659607e0Smrg		basic_machine=we32k-att
391659607e0Smrg		;;
392659607e0Smrg	a29khif)
393659607e0Smrg		basic_machine=a29k-amd
394659607e0Smrg		os=-udi
395659607e0Smrg		;;
396659607e0Smrg    	abacus)
397659607e0Smrg		basic_machine=abacus-unknown
398659607e0Smrg		;;
399659607e0Smrg	adobe68k)
400659607e0Smrg		basic_machine=m68010-adobe
401659607e0Smrg		os=-scout
402659607e0Smrg		;;
403659607e0Smrg	alliant | fx80)
404659607e0Smrg		basic_machine=fx80-alliant
405659607e0Smrg		;;
406659607e0Smrg	altos | altos3068)
407659607e0Smrg		basic_machine=m68k-altos
408659607e0Smrg		;;
409659607e0Smrg	am29k)
410659607e0Smrg		basic_machine=a29k-none
411659607e0Smrg		os=-bsd
412659607e0Smrg		;;
413659607e0Smrg	amd64)
414659607e0Smrg		basic_machine=x86_64-pc
415659607e0Smrg		;;
416659607e0Smrg	amd64-*)
417659607e0Smrg		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
418659607e0Smrg		;;
419659607e0Smrg	amdahl)
420659607e0Smrg		basic_machine=580-amdahl
421659607e0Smrg		os=-sysv
422659607e0Smrg		;;
423659607e0Smrg	amiga | amiga-*)
424659607e0Smrg		basic_machine=m68k-unknown
425659607e0Smrg		;;
426659607e0Smrg	amigaos | amigados)
427659607e0Smrg		basic_machine=m68k-unknown
428659607e0Smrg		os=-amigaos
429659607e0Smrg		;;
430659607e0Smrg	amigaunix | amix)
431659607e0Smrg		basic_machine=m68k-unknown
432659607e0Smrg		os=-sysv4
433659607e0Smrg		;;
434659607e0Smrg	apollo68)
435659607e0Smrg		basic_machine=m68k-apollo
436659607e0Smrg		os=-sysv
437659607e0Smrg		;;
438659607e0Smrg	apollo68bsd)
439659607e0Smrg		basic_machine=m68k-apollo
440659607e0Smrg		os=-bsd
441659607e0Smrg		;;
442659607e0Smrg	aux)
443659607e0Smrg		basic_machine=m68k-apple
444659607e0Smrg		os=-aux
445659607e0Smrg		;;
446659607e0Smrg	balance)
447659607e0Smrg		basic_machine=ns32k-sequent
448659607e0Smrg		os=-dynix
449659607e0Smrg		;;
450fc27e79cSmrg	blackfin)
451fc27e79cSmrg		basic_machine=bfin-unknown
452fc27e79cSmrg		os=-linux
453fc27e79cSmrg		;;
454fc27e79cSmrg	blackfin-*)
455fc27e79cSmrg		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
456fc27e79cSmrg		os=-linux
457fc27e79cSmrg		;;
458659607e0Smrg	c90)
459659607e0Smrg		basic_machine=c90-cray
460659607e0Smrg		os=-unicos
461659607e0Smrg		;;
462659607e0Smrg	convex-c1)
463659607e0Smrg		basic_machine=c1-convex
464659607e0Smrg		os=-bsd
465659607e0Smrg		;;
466659607e0Smrg	convex-c2)
467659607e0Smrg		basic_machine=c2-convex
468659607e0Smrg		os=-bsd
469659607e0Smrg		;;
470659607e0Smrg	convex-c32)
471659607e0Smrg		basic_machine=c32-convex
472659607e0Smrg		os=-bsd
473659607e0Smrg		;;
474659607e0Smrg	convex-c34)
475659607e0Smrg		basic_machine=c34-convex
476659607e0Smrg		os=-bsd
477659607e0Smrg		;;
478659607e0Smrg	convex-c38)
479659607e0Smrg		basic_machine=c38-convex
480659607e0Smrg		os=-bsd
481659607e0Smrg		;;
482659607e0Smrg	cray | j90)
483659607e0Smrg		basic_machine=j90-cray
484659607e0Smrg		os=-unicos
485659607e0Smrg		;;
486659607e0Smrg	craynv)
487659607e0Smrg		basic_machine=craynv-cray
488659607e0Smrg		os=-unicosmp
489659607e0Smrg		;;
490fc27e79cSmrg	cr16)
491fc27e79cSmrg		basic_machine=cr16-unknown
492659607e0Smrg		os=-elf
493659607e0Smrg		;;
494659607e0Smrg	crds | unos)
495659607e0Smrg		basic_machine=m68k-crds
496659607e0Smrg		;;
497659607e0Smrg	crisv32 | crisv32-* | etraxfs*)
498659607e0Smrg		basic_machine=crisv32-axis
499659607e0Smrg		;;
500659607e0Smrg	cris | cris-* | etrax*)
501659607e0Smrg		basic_machine=cris-axis
502659607e0Smrg		;;
503659607e0Smrg	crx)
504659607e0Smrg		basic_machine=crx-unknown
505659607e0Smrg		os=-elf
506659607e0Smrg		;;
507659607e0Smrg	da30 | da30-*)
508659607e0Smrg		basic_machine=m68k-da30
509659607e0Smrg		;;
510659607e0Smrg	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
511659607e0Smrg		basic_machine=mips-dec
512659607e0Smrg		;;
513659607e0Smrg	decsystem10* | dec10*)
514659607e0Smrg		basic_machine=pdp10-dec
515659607e0Smrg		os=-tops10
516659607e0Smrg		;;
517659607e0Smrg	decsystem20* | dec20*)
518659607e0Smrg		basic_machine=pdp10-dec
519659607e0Smrg		os=-tops20
520659607e0Smrg		;;
521659607e0Smrg	delta | 3300 | motorola-3300 | motorola-delta \
522659607e0Smrg	      | 3300-motorola | delta-motorola)
523659607e0Smrg		basic_machine=m68k-motorola
524659607e0Smrg		;;
525659607e0Smrg	delta88)
526659607e0Smrg		basic_machine=m88k-motorola
527659607e0Smrg		os=-sysv3
528659607e0Smrg		;;
529659607e0Smrg	djgpp)
530659607e0Smrg		basic_machine=i586-pc
531659607e0Smrg		os=-msdosdjgpp
532659607e0Smrg		;;
533659607e0Smrg	dpx20 | dpx20-*)
534659607e0Smrg		basic_machine=rs6000-bull
535659607e0Smrg		os=-bosx
536659607e0Smrg		;;
537659607e0Smrg	dpx2* | dpx2*-bull)
538659607e0Smrg		basic_machine=m68k-bull
539659607e0Smrg		os=-sysv3
540659607e0Smrg		;;
541659607e0Smrg	ebmon29k)
542659607e0Smrg		basic_machine=a29k-amd
543659607e0Smrg		os=-ebmon
544659607e0Smrg		;;
545659607e0Smrg	elxsi)
546659607e0Smrg		basic_machine=elxsi-elxsi
547659607e0Smrg		os=-bsd
548659607e0Smrg		;;
549659607e0Smrg	encore | umax | mmax)
550659607e0Smrg		basic_machine=ns32k-encore
551659607e0Smrg		;;
552659607e0Smrg	es1800 | OSE68k | ose68k | ose | OSE)
553659607e0Smrg		basic_machine=m68k-ericsson
554659607e0Smrg		os=-ose
555659607e0Smrg		;;
556659607e0Smrg	fx2800)
557659607e0Smrg		basic_machine=i860-alliant
558659607e0Smrg		;;
559659607e0Smrg	genix)
560659607e0Smrg		basic_machine=ns32k-ns
561659607e0Smrg		;;
562659607e0Smrg	gmicro)
563659607e0Smrg		basic_machine=tron-gmicro
564659607e0Smrg		os=-sysv
565659607e0Smrg		;;
566659607e0Smrg	go32)
567659607e0Smrg		basic_machine=i386-pc
568659607e0Smrg		os=-go32
569659607e0Smrg		;;
570659607e0Smrg	h3050r* | hiux*)
571659607e0Smrg		basic_machine=hppa1.1-hitachi
572659607e0Smrg		os=-hiuxwe2
573659607e0Smrg		;;
574659607e0Smrg	h8300hms)
575659607e0Smrg		basic_machine=h8300-hitachi
576659607e0Smrg		os=-hms
577659607e0Smrg		;;
578659607e0Smrg	h8300xray)
579659607e0Smrg		basic_machine=h8300-hitachi
580659607e0Smrg		os=-xray
581659607e0Smrg		;;
582659607e0Smrg	h8500hms)
583659607e0Smrg		basic_machine=h8500-hitachi
584659607e0Smrg		os=-hms
585659607e0Smrg		;;
586659607e0Smrg	harris)
587659607e0Smrg		basic_machine=m88k-harris
588659607e0Smrg		os=-sysv3
589659607e0Smrg		;;
590659607e0Smrg	hp300-*)
591659607e0Smrg		basic_machine=m68k-hp
592659607e0Smrg		;;
593659607e0Smrg	hp300bsd)
594659607e0Smrg		basic_machine=m68k-hp
595659607e0Smrg		os=-bsd
596659607e0Smrg		;;
597659607e0Smrg	hp300hpux)
598659607e0Smrg		basic_machine=m68k-hp
599659607e0Smrg		os=-hpux
600659607e0Smrg		;;
601659607e0Smrg	hp3k9[0-9][0-9] | hp9[0-9][0-9])
602659607e0Smrg		basic_machine=hppa1.0-hp
603659607e0Smrg		;;
604659607e0Smrg	hp9k2[0-9][0-9] | hp9k31[0-9])
605659607e0Smrg		basic_machine=m68000-hp
606659607e0Smrg		;;
607659607e0Smrg	hp9k3[2-9][0-9])
608659607e0Smrg		basic_machine=m68k-hp
609659607e0Smrg		;;
610659607e0Smrg	hp9k6[0-9][0-9] | hp6[0-9][0-9])
611659607e0Smrg		basic_machine=hppa1.0-hp
612659607e0Smrg		;;
613659607e0Smrg	hp9k7[0-79][0-9] | hp7[0-79][0-9])
614659607e0Smrg		basic_machine=hppa1.1-hp
615659607e0Smrg		;;
616659607e0Smrg	hp9k78[0-9] | hp78[0-9])
617659607e0Smrg		# FIXME: really hppa2.0-hp
618659607e0Smrg		basic_machine=hppa1.1-hp
619659607e0Smrg		;;
620659607e0Smrg	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
621659607e0Smrg		# FIXME: really hppa2.0-hp
622659607e0Smrg		basic_machine=hppa1.1-hp
623659607e0Smrg		;;
624659607e0Smrg	hp9k8[0-9][13679] | hp8[0-9][13679])
625659607e0Smrg		basic_machine=hppa1.1-hp
626659607e0Smrg		;;
627659607e0Smrg	hp9k8[0-9][0-9] | hp8[0-9][0-9])
628659607e0Smrg		basic_machine=hppa1.0-hp
629659607e0Smrg		;;
630659607e0Smrg	hppa-next)
631659607e0Smrg		os=-nextstep3
632659607e0Smrg		;;
633659607e0Smrg	hppaosf)
634659607e0Smrg		basic_machine=hppa1.1-hp
635659607e0Smrg		os=-osf
636659607e0Smrg		;;
637659607e0Smrg	hppro)
638659607e0Smrg		basic_machine=hppa1.1-hp
639659607e0Smrg		os=-proelf
640659607e0Smrg		;;
641659607e0Smrg	i370-ibm* | ibm*)
642659607e0Smrg		basic_machine=i370-ibm
643659607e0Smrg		;;
644659607e0Smrg# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
645659607e0Smrg	i*86v32)
646659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
647659607e0Smrg		os=-sysv32
648659607e0Smrg		;;
649659607e0Smrg	i*86v4*)
650659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
651659607e0Smrg		os=-sysv4
652659607e0Smrg		;;
653659607e0Smrg	i*86v)
654659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
655659607e0Smrg		os=-sysv
656659607e0Smrg		;;
657659607e0Smrg	i*86sol2)
658659607e0Smrg		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
659659607e0Smrg		os=-solaris2
660659607e0Smrg		;;
661659607e0Smrg	i386mach)
662659607e0Smrg		basic_machine=i386-mach
663659607e0Smrg		os=-mach
664659607e0Smrg		;;
665659607e0Smrg	i386-vsta | vsta)
666659607e0Smrg		basic_machine=i386-unknown
667659607e0Smrg		os=-vsta
668659607e0Smrg		;;
669659607e0Smrg	iris | iris4d)
670659607e0Smrg		basic_machine=mips-sgi
671659607e0Smrg		case $os in
672659607e0Smrg		    -irix*)
673659607e0Smrg			;;
674659607e0Smrg		    *)
675659607e0Smrg			os=-irix4
676659607e0Smrg			;;
677659607e0Smrg		esac
678659607e0Smrg		;;
679659607e0Smrg	isi68 | isi)
680659607e0Smrg		basic_machine=m68k-isi
681659607e0Smrg		os=-sysv
682659607e0Smrg		;;
683fc27e79cSmrg	m68knommu)
684fc27e79cSmrg		basic_machine=m68k-unknown
685fc27e79cSmrg		os=-linux
686fc27e79cSmrg		;;
687fc27e79cSmrg	m68knommu-*)
688fc27e79cSmrg		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
689fc27e79cSmrg		os=-linux
690fc27e79cSmrg		;;
691659607e0Smrg	m88k-omron*)
692659607e0Smrg		basic_machine=m88k-omron
693659607e0Smrg		;;
694659607e0Smrg	magnum | m3230)
695659607e0Smrg		basic_machine=mips-mips
696659607e0Smrg		os=-sysv
697659607e0Smrg		;;
698659607e0Smrg	merlin)
699659607e0Smrg		basic_machine=ns32k-utek
700659607e0Smrg		os=-sysv
701659607e0Smrg		;;
702659607e0Smrg	mingw32)
703659607e0Smrg		basic_machine=i386-pc
704659607e0Smrg		os=-mingw32
705659607e0Smrg		;;
706fc27e79cSmrg	mingw32ce)
707fc27e79cSmrg		basic_machine=arm-unknown
708fc27e79cSmrg		os=-mingw32ce
709fc27e79cSmrg		;;
710659607e0Smrg	miniframe)
711659607e0Smrg		basic_machine=m68000-convergent
712659607e0Smrg		;;
713659607e0Smrg	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
714659607e0Smrg		basic_machine=m68k-atari
715659607e0Smrg		os=-mint
716659607e0Smrg		;;
717659607e0Smrg	mips3*-*)
718659607e0Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
719659607e0Smrg		;;
720659607e0Smrg	mips3*)
721659607e0Smrg		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
722659607e0Smrg		;;
723659607e0Smrg	monitor)
724659607e0Smrg		basic_machine=m68k-rom68k
725659607e0Smrg		os=-coff
726659607e0Smrg		;;
727659607e0Smrg	morphos)
728659607e0Smrg		basic_machine=powerpc-unknown
729659607e0Smrg		os=-morphos
730659607e0Smrg		;;
731659607e0Smrg	msdos)
732659607e0Smrg		basic_machine=i386-pc
733659607e0Smrg		os=-msdos
734659607e0Smrg		;;
735659607e0Smrg	ms1-*)
736659607e0Smrg		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
737659607e0Smrg		;;
738659607e0Smrg	mvs)
739659607e0Smrg		basic_machine=i370-ibm
740659607e0Smrg		os=-mvs
741659607e0Smrg		;;
742659607e0Smrg	ncr3000)
743659607e0Smrg		basic_machine=i486-ncr
744659607e0Smrg		os=-sysv4
745659607e0Smrg		;;
746659607e0Smrg	netbsd386)
747659607e0Smrg		basic_machine=i386-unknown
748659607e0Smrg		os=-netbsd
749659607e0Smrg		;;
750659607e0Smrg	netwinder)
751659607e0Smrg		basic_machine=armv4l-rebel
752659607e0Smrg		os=-linux
753659607e0Smrg		;;
754659607e0Smrg	news | news700 | news800 | news900)
755659607e0Smrg		basic_machine=m68k-sony
756659607e0Smrg		os=-newsos
757659607e0Smrg		;;
758659607e0Smrg	news1000)
759659607e0Smrg		basic_machine=m68030-sony
760659607e0Smrg		os=-newsos
761659607e0Smrg		;;
762659607e0Smrg	news-3600 | risc-news)
763659607e0Smrg		basic_machine=mips-sony
764659607e0Smrg		os=-newsos
765659607e0Smrg		;;
766659607e0Smrg	necv70)
767659607e0Smrg		basic_machine=v70-nec
768659607e0Smrg		os=-sysv
769659607e0Smrg		;;
770659607e0Smrg	next | m*-next )
771659607e0Smrg		basic_machine=m68k-next
772659607e0Smrg		case $os in
773659607e0Smrg		    -nextstep* )
774659607e0Smrg			;;
775659607e0Smrg		    -ns2*)
776659607e0Smrg		      os=-nextstep2
777659607e0Smrg			;;
778659607e0Smrg		    *)
779659607e0Smrg		      os=-nextstep3
780659607e0Smrg			;;
781659607e0Smrg		esac
782659607e0Smrg		;;
783659607e0Smrg	nh3000)
784659607e0Smrg		basic_machine=m68k-harris
785659607e0Smrg		os=-cxux
786659607e0Smrg		;;
787659607e0Smrg	nh[45]000)
788659607e0Smrg		basic_machine=m88k-harris
789659607e0Smrg		os=-cxux
790659607e0Smrg		;;
791659607e0Smrg	nindy960)
792659607e0Smrg		basic_machine=i960-intel
793659607e0Smrg		os=-nindy
794659607e0Smrg		;;
795659607e0Smrg	mon960)
796659607e0Smrg		basic_machine=i960-intel
797659607e0Smrg		os=-mon960
798659607e0Smrg		;;
799659607e0Smrg	nonstopux)
800659607e0Smrg		basic_machine=mips-compaq
801659607e0Smrg		os=-nonstopux
802659607e0Smrg		;;
803659607e0Smrg	np1)
804659607e0Smrg		basic_machine=np1-gould
805659607e0Smrg		;;
806659607e0Smrg	nsr-tandem)
807659607e0Smrg		basic_machine=nsr-tandem
808659607e0Smrg		;;
809659607e0Smrg	op50n-* | op60c-*)
810659607e0Smrg		basic_machine=hppa1.1-oki
811659607e0Smrg		os=-proelf
812659607e0Smrg		;;
813659607e0Smrg	openrisc | openrisc-*)
814659607e0Smrg		basic_machine=or32-unknown
815659607e0Smrg		;;
816659607e0Smrg	os400)
817659607e0Smrg		basic_machine=powerpc-ibm
818659607e0Smrg		os=-os400
819659607e0Smrg		;;
820659607e0Smrg	OSE68000 | ose68000)
821659607e0Smrg		basic_machine=m68000-ericsson
822659607e0Smrg		os=-ose
823659607e0Smrg		;;
824659607e0Smrg	os68k)
825659607e0Smrg		basic_machine=m68k-none
826659607e0Smrg		os=-os68k
827659607e0Smrg		;;
828659607e0Smrg	pa-hitachi)
829659607e0Smrg		basic_machine=hppa1.1-hitachi
830659607e0Smrg		os=-hiuxwe2
831659607e0Smrg		;;
832659607e0Smrg	paragon)
833659607e0Smrg		basic_machine=i860-intel
834659607e0Smrg		os=-osf
835659607e0Smrg		;;
836fc27e79cSmrg	parisc)
837fc27e79cSmrg		basic_machine=hppa-unknown
838fc27e79cSmrg		os=-linux
839fc27e79cSmrg		;;
840fc27e79cSmrg	parisc-*)
841fc27e79cSmrg		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
842fc27e79cSmrg		os=-linux
843fc27e79cSmrg		;;
844659607e0Smrg	pbd)
845659607e0Smrg		basic_machine=sparc-tti
846659607e0Smrg		;;
847659607e0Smrg	pbb)
848659607e0Smrg		basic_machine=m68k-tti
849659607e0Smrg		;;
850659607e0Smrg	pc532 | pc532-*)
851659607e0Smrg		basic_machine=ns32k-pc532
852659607e0Smrg		;;
853fc27e79cSmrg	pc98)
854fc27e79cSmrg		basic_machine=i386-pc
855fc27e79cSmrg		;;
856fc27e79cSmrg	pc98-*)
857fc27e79cSmrg		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
858fc27e79cSmrg		;;
859659607e0Smrg	pentium | p5 | k5 | k6 | nexgen | viac3)
860659607e0Smrg		basic_machine=i586-pc
861659607e0Smrg		;;
862659607e0Smrg	pentiumpro | p6 | 6x86 | athlon | athlon_*)
863659607e0Smrg		basic_machine=i686-pc
864659607e0Smrg		;;
865659607e0Smrg	pentiumii | pentium2 | pentiumiii | pentium3)
866659607e0Smrg		basic_machine=i686-pc
867659607e0Smrg		;;
868659607e0Smrg	pentium4)
869659607e0Smrg		basic_machine=i786-pc
870659607e0Smrg		;;
871659607e0Smrg	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
872659607e0Smrg		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
873659607e0Smrg		;;
874659607e0Smrg	pentiumpro-* | p6-* | 6x86-* | athlon-*)
875659607e0Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
876659607e0Smrg		;;
877659607e0Smrg	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
878659607e0Smrg		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
879659607e0Smrg		;;
880659607e0Smrg	pentium4-*)
881659607e0Smrg		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
882659607e0Smrg		;;
883659607e0Smrg	pn)
884659607e0Smrg		basic_machine=pn-gould
885659607e0Smrg		;;
886659607e0Smrg	power)	basic_machine=power-ibm
887659607e0Smrg		;;
888659607e0Smrg	ppc)	basic_machine=powerpc-unknown
889659607e0Smrg		;;
890659607e0Smrg	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
891659607e0Smrg		;;
892659607e0Smrg	ppcle | powerpclittle | ppc-le | powerpc-little)
893659607e0Smrg		basic_machine=powerpcle-unknown
894659607e0Smrg		;;
895659607e0Smrg	ppcle-* | powerpclittle-*)
896659607e0Smrg		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
897659607e0Smrg		;;
898659607e0Smrg	ppc64)	basic_machine=powerpc64-unknown
899659607e0Smrg		;;
900659607e0Smrg	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
901659607e0Smrg		;;
902659607e0Smrg	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
903659607e0Smrg		basic_machine=powerpc64le-unknown
904659607e0Smrg		;;
905659607e0Smrg	ppc64le-* | powerpc64little-*)
906659607e0Smrg		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
907659607e0Smrg		;;
908659607e0Smrg	ps2)
909659607e0Smrg		basic_machine=i386-ibm
910659607e0Smrg		;;
911659607e0Smrg	pw32)
912659607e0Smrg		basic_machine=i586-unknown
913659607e0Smrg		os=-pw32
914659607e0Smrg		;;
915659607e0Smrg	rdos)
916659607e0Smrg		basic_machine=i386-pc
917659607e0Smrg		os=-rdos
918659607e0Smrg		;;
919659607e0Smrg	rom68k)
920659607e0Smrg		basic_machine=m68k-rom68k
921659607e0Smrg		os=-coff
922659607e0Smrg		;;
923659607e0Smrg	rm[46]00)
924659607e0Smrg		basic_machine=mips-siemens
925659607e0Smrg		;;
926659607e0Smrg	rtpc | rtpc-*)
927659607e0Smrg		basic_machine=romp-ibm
928659607e0Smrg		;;
929659607e0Smrg	s390 | s390-*)
930659607e0Smrg		basic_machine=s390-ibm
931659607e0Smrg		;;
932659607e0Smrg	s390x | s390x-*)
933659607e0Smrg		basic_machine=s390x-ibm
934659607e0Smrg		;;
935659607e0Smrg	sa29200)
936659607e0Smrg		basic_machine=a29k-amd
937659607e0Smrg		os=-udi
938659607e0Smrg		;;
939659607e0Smrg	sb1)
940659607e0Smrg		basic_machine=mipsisa64sb1-unknown
941659607e0Smrg		;;
942659607e0Smrg	sb1el)
943659607e0Smrg		basic_machine=mipsisa64sb1el-unknown
944659607e0Smrg		;;
945fc27e79cSmrg	sde)
946fc27e79cSmrg		basic_machine=mipsisa32-sde
947fc27e79cSmrg		os=-elf
948fc27e79cSmrg		;;
949659607e0Smrg	sei)
950659607e0Smrg		basic_machine=mips-sei
951659607e0Smrg		os=-seiux
952659607e0Smrg		;;
953659607e0Smrg	sequent)
954659607e0Smrg		basic_machine=i386-sequent
955659607e0Smrg		;;
956659607e0Smrg	sh)
957659607e0Smrg		basic_machine=sh-hitachi
958659607e0Smrg		os=-hms
959659607e0Smrg		;;
960fc27e79cSmrg	sh5el)
961fc27e79cSmrg		basic_machine=sh5le-unknown
962fc27e79cSmrg		;;
963659607e0Smrg	sh64)
964659607e0Smrg		basic_machine=sh64-unknown
965659607e0Smrg		;;
966659607e0Smrg	sparclite-wrs | simso-wrs)
967659607e0Smrg		basic_machine=sparclite-wrs
968659607e0Smrg		os=-vxworks
969659607e0Smrg		;;
970659607e0Smrg	sps7)
971659607e0Smrg		basic_machine=m68k-bull
972659607e0Smrg		os=-sysv2
973659607e0Smrg		;;
974659607e0Smrg	spur)
975659607e0Smrg		basic_machine=spur-unknown
976659607e0Smrg		;;
977659607e0Smrg	st2000)
978659607e0Smrg		basic_machine=m68k-tandem
979659607e0Smrg		;;
980659607e0Smrg	stratus)
981659607e0Smrg		basic_machine=i860-stratus
982659607e0Smrg		os=-sysv4
983659607e0Smrg		;;
984659607e0Smrg	sun2)
985659607e0Smrg		basic_machine=m68000-sun
986659607e0Smrg		;;
987659607e0Smrg	sun2os3)
988659607e0Smrg		basic_machine=m68000-sun
989659607e0Smrg		os=-sunos3
990659607e0Smrg		;;
991659607e0Smrg	sun2os4)
992659607e0Smrg		basic_machine=m68000-sun
993659607e0Smrg		os=-sunos4
994659607e0Smrg		;;
995659607e0Smrg	sun3os3)
996659607e0Smrg		basic_machine=m68k-sun
997659607e0Smrg		os=-sunos3
998659607e0Smrg		;;
999659607e0Smrg	sun3os4)
1000659607e0Smrg		basic_machine=m68k-sun
1001659607e0Smrg		os=-sunos4
1002659607e0Smrg		;;
1003659607e0Smrg	sun4os3)
1004659607e0Smrg		basic_machine=sparc-sun
1005659607e0Smrg		os=-sunos3
1006659607e0Smrg		;;
1007659607e0Smrg	sun4os4)
1008659607e0Smrg		basic_machine=sparc-sun
1009659607e0Smrg		os=-sunos4
1010659607e0Smrg		;;
1011659607e0Smrg	sun4sol2)
1012659607e0Smrg		basic_machine=sparc-sun
1013659607e0Smrg		os=-solaris2
1014659607e0Smrg		;;
1015659607e0Smrg	sun3 | sun3-*)
1016659607e0Smrg		basic_machine=m68k-sun
1017659607e0Smrg		;;
1018659607e0Smrg	sun4)
1019659607e0Smrg		basic_machine=sparc-sun
1020659607e0Smrg		;;
1021659607e0Smrg	sun386 | sun386i | roadrunner)
1022659607e0Smrg		basic_machine=i386-sun
1023659607e0Smrg		;;
1024659607e0Smrg	sv1)
1025659607e0Smrg		basic_machine=sv1-cray
1026659607e0Smrg		os=-unicos
1027659607e0Smrg		;;
1028659607e0Smrg	symmetry)
1029659607e0Smrg		basic_machine=i386-sequent
1030659607e0Smrg		os=-dynix
1031659607e0Smrg		;;
1032659607e0Smrg	t3e)
1033659607e0Smrg		basic_machine=alphaev5-cray
1034659607e0Smrg		os=-unicos
1035659607e0Smrg		;;
1036659607e0Smrg	t90)
1037659607e0Smrg		basic_machine=t90-cray
1038659607e0Smrg		os=-unicos
1039659607e0Smrg		;;
1040659607e0Smrg	tic54x | c54x*)
1041659607e0Smrg		basic_machine=tic54x-unknown
1042659607e0Smrg		os=-coff
1043659607e0Smrg		;;
1044659607e0Smrg	tic55x | c55x*)
1045659607e0Smrg		basic_machine=tic55x-unknown
1046659607e0Smrg		os=-coff
1047659607e0Smrg		;;
1048659607e0Smrg	tic6x | c6x*)
1049659607e0Smrg		basic_machine=tic6x-unknown
1050659607e0Smrg		os=-coff
1051659607e0Smrg		;;
1052fc27e79cSmrg	tile*)
1053fc27e79cSmrg		basic_machine=tile-unknown
1054fc27e79cSmrg		os=-linux-gnu
1055fc27e79cSmrg		;;
1056659607e0Smrg	tx39)
1057659607e0Smrg		basic_machine=mipstx39-unknown
1058659607e0Smrg		;;
1059659607e0Smrg	tx39el)
1060659607e0Smrg		basic_machine=mipstx39el-unknown
1061659607e0Smrg		;;
1062659607e0Smrg	toad1)
1063659607e0Smrg		basic_machine=pdp10-xkl
1064659607e0Smrg		os=-tops20
1065659607e0Smrg		;;
1066659607e0Smrg	tower | tower-32)
1067659607e0Smrg		basic_machine=m68k-ncr
1068659607e0Smrg		;;
1069659607e0Smrg	tpf)
1070659607e0Smrg		basic_machine=s390x-ibm
1071659607e0Smrg		os=-tpf
1072659607e0Smrg		;;
1073659607e0Smrg	udi29k)
1074659607e0Smrg		basic_machine=a29k-amd
1075659607e0Smrg		os=-udi
1076659607e0Smrg		;;
1077659607e0Smrg	ultra3)
1078659607e0Smrg		basic_machine=a29k-nyu
1079659607e0Smrg		os=-sym1
1080659607e0Smrg		;;
1081659607e0Smrg	v810 | necv810)
1082659607e0Smrg		basic_machine=v810-nec
1083659607e0Smrg		os=-none
1084659607e0Smrg		;;
1085659607e0Smrg	vaxv)
1086659607e0Smrg		basic_machine=vax-dec
1087659607e0Smrg		os=-sysv
1088659607e0Smrg		;;
1089659607e0Smrg	vms)
1090659607e0Smrg		basic_machine=vax-dec
1091659607e0Smrg		os=-vms
1092659607e0Smrg		;;
1093659607e0Smrg	vpp*|vx|vx-*)
1094659607e0Smrg		basic_machine=f301-fujitsu
1095659607e0Smrg		;;
1096659607e0Smrg	vxworks960)
1097659607e0Smrg		basic_machine=i960-wrs
1098659607e0Smrg		os=-vxworks
1099659607e0Smrg		;;
1100659607e0Smrg	vxworks68)
1101659607e0Smrg		basic_machine=m68k-wrs
1102659607e0Smrg		os=-vxworks
1103659607e0Smrg		;;
1104659607e0Smrg	vxworks29k)
1105659607e0Smrg		basic_machine=a29k-wrs
1106659607e0Smrg		os=-vxworks
1107659607e0Smrg		;;
1108659607e0Smrg	w65*)
1109659607e0Smrg		basic_machine=w65-wdc
1110659607e0Smrg		os=-none
1111659607e0Smrg		;;
1112659607e0Smrg	w89k-*)
1113659607e0Smrg		basic_machine=hppa1.1-winbond
1114659607e0Smrg		os=-proelf
1115659607e0Smrg		;;
1116659607e0Smrg	xbox)
1117659607e0Smrg		basic_machine=i686-pc
1118659607e0Smrg		os=-mingw32
1119659607e0Smrg		;;
1120659607e0Smrg	xps | xps100)
1121659607e0Smrg		basic_machine=xps100-honeywell
1122659607e0Smrg		;;
1123659607e0Smrg	ymp)
1124659607e0Smrg		basic_machine=ymp-cray
1125659607e0Smrg		os=-unicos
1126659607e0Smrg		;;
1127659607e0Smrg	z8k-*-coff)
1128659607e0Smrg		basic_machine=z8k-unknown
1129659607e0Smrg		os=-sim
1130659607e0Smrg		;;
1131659607e0Smrg	none)
1132659607e0Smrg		basic_machine=none-none
1133659607e0Smrg		os=-none
1134659607e0Smrg		;;
1135659607e0Smrg
1136659607e0Smrg# Here we handle the default manufacturer of certain CPU types.  It is in
1137659607e0Smrg# some cases the only manufacturer, in others, it is the most popular.
1138659607e0Smrg	w89k)
1139659607e0Smrg		basic_machine=hppa1.1-winbond
1140659607e0Smrg		;;
1141659607e0Smrg	op50n)
1142659607e0Smrg		basic_machine=hppa1.1-oki
1143659607e0Smrg		;;
1144659607e0Smrg	op60c)
1145659607e0Smrg		basic_machine=hppa1.1-oki
1146659607e0Smrg		;;
1147659607e0Smrg	romp)
1148659607e0Smrg		basic_machine=romp-ibm
1149659607e0Smrg		;;
1150659607e0Smrg	mmix)
1151659607e0Smrg		basic_machine=mmix-knuth
1152659607e0Smrg		;;
1153659607e0Smrg	rs6000)
1154659607e0Smrg		basic_machine=rs6000-ibm
1155659607e0Smrg		;;
1156659607e0Smrg	vax)
1157659607e0Smrg		basic_machine=vax-dec
1158659607e0Smrg		;;
1159659607e0Smrg	pdp10)
1160659607e0Smrg		# there are many clones, so DEC is not a safe bet
1161659607e0Smrg		basic_machine=pdp10-unknown
1162659607e0Smrg		;;
1163659607e0Smrg	pdp11)
1164659607e0Smrg		basic_machine=pdp11-dec
1165659607e0Smrg		;;
1166659607e0Smrg	we32k)
1167659607e0Smrg		basic_machine=we32k-att
1168659607e0Smrg		;;
1169659607e0Smrg	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
1170659607e0Smrg		basic_machine=sh-unknown
1171659607e0Smrg		;;
1172fc27e79cSmrg	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1173659607e0Smrg		basic_machine=sparc-sun
1174659607e0Smrg		;;
1175659607e0Smrg	cydra)
1176659607e0Smrg		basic_machine=cydra-cydrome
1177659607e0Smrg		;;
1178659607e0Smrg	orion)
1179659607e0Smrg		basic_machine=orion-highlevel
1180659607e0Smrg		;;
1181659607e0Smrg	orion105)
1182659607e0Smrg		basic_machine=clipper-highlevel
1183659607e0Smrg		;;
1184659607e0Smrg	mac | mpw | mac-mpw)
1185659607e0Smrg		basic_machine=m68k-apple
1186659607e0Smrg		;;
1187659607e0Smrg	pmac | pmac-mpw)
1188659607e0Smrg		basic_machine=powerpc-apple
1189659607e0Smrg		;;
1190659607e0Smrg	*-unknown)
1191659607e0Smrg		# Make sure to match an already-canonicalized machine name.
1192659607e0Smrg		;;
1193659607e0Smrg	*)
1194659607e0Smrg		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1195659607e0Smrg		exit 1
1196659607e0Smrg		;;
1197659607e0Smrgesac
1198659607e0Smrg
1199659607e0Smrg# Here we canonicalize certain aliases for manufacturers.
1200659607e0Smrgcase $basic_machine in
1201659607e0Smrg	*-digital*)
1202659607e0Smrg		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1203659607e0Smrg		;;
1204659607e0Smrg	*-commodore*)
1205659607e0Smrg		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1206659607e0Smrg		;;
1207659607e0Smrg	*)
1208659607e0Smrg		;;
1209659607e0Smrgesac
1210659607e0Smrg
1211659607e0Smrg# Decode manufacturer-specific aliases for certain operating systems.
1212659607e0Smrg
1213659607e0Smrgif [ x"$os" != x"" ]
1214659607e0Smrgthen
1215659607e0Smrgcase $os in
1216659607e0Smrg        # First match some system type aliases
1217659607e0Smrg        # that might get confused with valid system types.
1218659607e0Smrg	# -solaris* is a basic system type, with this one exception.
1219659607e0Smrg	-solaris1 | -solaris1.*)
1220659607e0Smrg		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1221659607e0Smrg		;;
1222659607e0Smrg	-solaris)
1223659607e0Smrg		os=-solaris2
1224659607e0Smrg		;;
1225659607e0Smrg	-svr4*)
1226659607e0Smrg		os=-sysv4
1227659607e0Smrg		;;
1228659607e0Smrg	-unixware*)
1229659607e0Smrg		os=-sysv4.2uw
1230659607e0Smrg		;;
1231659607e0Smrg	-gnu/linux*)
1232659607e0Smrg		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1233659607e0Smrg		;;
1234659607e0Smrg	# First accept the basic system types.
1235659607e0Smrg	# The portable systems comes first.
1236659607e0Smrg	# Each alternative MUST END IN A *, to match a version number.
1237659607e0Smrg	# -sysv* is not here because it comes later, after sysvr4.
1238659607e0Smrg	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1239659607e0Smrg	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1240659607e0Smrg	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1241659607e0Smrg	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1242659607e0Smrg	      | -aos* \
1243659607e0Smrg	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1244659607e0Smrg	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1245fc27e79cSmrg	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1246fc27e79cSmrg	      | -openbsd* | -solidbsd* \
1247659607e0Smrg	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1248659607e0Smrg	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1249659607e0Smrg	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1250659607e0Smrg	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1251659607e0Smrg	      | -chorusos* | -chorusrdb* \
1252659607e0Smrg	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1253659607e0Smrg	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1254659607e0Smrg	      | -uxpv* | -beos* | -mpeix* | -udk* \
1255659607e0Smrg	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1256659607e0Smrg	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1257659607e0Smrg	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1258659607e0Smrg	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1259659607e0Smrg	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1260659607e0Smrg	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1261fc27e79cSmrg	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
1262659607e0Smrg	# Remember, each alternative MUST END IN *, to match a version number.
1263659607e0Smrg		;;
1264659607e0Smrg	-qnx*)
1265659607e0Smrg		case $basic_machine in
1266659607e0Smrg		    x86-* | i*86-*)
1267659607e0Smrg			;;
1268659607e0Smrg		    *)
1269659607e0Smrg			os=-nto$os
1270659607e0Smrg			;;
1271659607e0Smrg		esac
1272659607e0Smrg		;;
1273659607e0Smrg	-nto-qnx*)
1274659607e0Smrg		;;
1275659607e0Smrg	-nto*)
1276659607e0Smrg		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1277659607e0Smrg		;;
1278659607e0Smrg	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1279659607e0Smrg	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1280659607e0Smrg	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1281659607e0Smrg		;;
1282659607e0Smrg	-mac*)
1283659607e0Smrg		os=`echo $os | sed -e 's|mac|macos|'`
1284659607e0Smrg		;;
1285659607e0Smrg	-linux-dietlibc)
1286659607e0Smrg		os=-linux-dietlibc
1287659607e0Smrg		;;
1288659607e0Smrg	-linux*)
1289659607e0Smrg		os=`echo $os | sed -e 's|linux|linux-gnu|'`
1290659607e0Smrg		;;
1291659607e0Smrg	-sunos5*)
1292659607e0Smrg		os=`echo $os | sed -e 's|sunos5|solaris2|'`
1293659607e0Smrg		;;
1294659607e0Smrg	-sunos6*)
1295659607e0Smrg		os=`echo $os | sed -e 's|sunos6|solaris3|'`
1296659607e0Smrg		;;
1297659607e0Smrg	-opened*)
1298659607e0Smrg		os=-openedition
1299659607e0Smrg		;;
1300659607e0Smrg        -os400*)
1301659607e0Smrg		os=-os400
1302659607e0Smrg		;;
1303659607e0Smrg	-wince*)
1304659607e0Smrg		os=-wince
1305659607e0Smrg		;;
1306659607e0Smrg	-osfrose*)
1307659607e0Smrg		os=-osfrose
1308659607e0Smrg		;;
1309659607e0Smrg	-osf*)
1310659607e0Smrg		os=-osf
1311659607e0Smrg		;;
1312659607e0Smrg	-utek*)
1313659607e0Smrg		os=-bsd
1314659607e0Smrg		;;
1315659607e0Smrg	-dynix*)
1316659607e0Smrg		os=-bsd
1317659607e0Smrg		;;
1318659607e0Smrg	-acis*)
1319659607e0Smrg		os=-aos
1320659607e0Smrg		;;
1321659607e0Smrg	-atheos*)
1322659607e0Smrg		os=-atheos
1323659607e0Smrg		;;
1324659607e0Smrg	-syllable*)
1325659607e0Smrg		os=-syllable
1326659607e0Smrg		;;
1327659607e0Smrg	-386bsd)
1328659607e0Smrg		os=-bsd
1329659607e0Smrg		;;
1330659607e0Smrg	-ctix* | -uts*)
1331659607e0Smrg		os=-sysv
1332659607e0Smrg		;;
1333659607e0Smrg	-nova*)
1334659607e0Smrg		os=-rtmk-nova
1335659607e0Smrg		;;
1336659607e0Smrg	-ns2 )
1337659607e0Smrg		os=-nextstep2
1338659607e0Smrg		;;
1339659607e0Smrg	-nsk*)
1340659607e0Smrg		os=-nsk
1341659607e0Smrg		;;
1342659607e0Smrg	# Preserve the version number of sinix5.
1343659607e0Smrg	-sinix5.*)
1344659607e0Smrg		os=`echo $os | sed -e 's|sinix|sysv|'`
1345659607e0Smrg		;;
1346659607e0Smrg	-sinix*)
1347659607e0Smrg		os=-sysv4
1348659607e0Smrg		;;
1349659607e0Smrg        -tpf*)
1350659607e0Smrg		os=-tpf
1351659607e0Smrg		;;
1352659607e0Smrg	-triton*)
1353659607e0Smrg		os=-sysv3
1354659607e0Smrg		;;
1355659607e0Smrg	-oss*)
1356659607e0Smrg		os=-sysv3
1357659607e0Smrg		;;
1358659607e0Smrg	-svr4)
1359659607e0Smrg		os=-sysv4
1360659607e0Smrg		;;
1361659607e0Smrg	-svr3)
1362659607e0Smrg		os=-sysv3
1363659607e0Smrg		;;
1364659607e0Smrg	-sysvr4)
1365659607e0Smrg		os=-sysv4
1366659607e0Smrg		;;
1367659607e0Smrg	# This must come after -sysvr4.
1368659607e0Smrg	-sysv*)
1369659607e0Smrg		;;
1370659607e0Smrg	-ose*)
1371659607e0Smrg		os=-ose
1372659607e0Smrg		;;
1373659607e0Smrg	-es1800*)
1374659607e0Smrg		os=-ose
1375659607e0Smrg		;;
1376659607e0Smrg	-xenix)
1377659607e0Smrg		os=-xenix
1378659607e0Smrg		;;
1379659607e0Smrg	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1380659607e0Smrg		os=-mint
1381659607e0Smrg		;;
1382659607e0Smrg	-aros*)
1383659607e0Smrg		os=-aros
1384659607e0Smrg		;;
1385659607e0Smrg	-kaos*)
1386659607e0Smrg		os=-kaos
1387659607e0Smrg		;;
1388659607e0Smrg	-zvmoe)
1389659607e0Smrg		os=-zvmoe
1390659607e0Smrg		;;
1391659607e0Smrg	-none)
1392659607e0Smrg		;;
1393659607e0Smrg	*)
1394659607e0Smrg		# Get rid of the `-' at the beginning of $os.
1395659607e0Smrg		os=`echo $os | sed 's/[^-]*-//'`
1396659607e0Smrg		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1397659607e0Smrg		exit 1
1398659607e0Smrg		;;
1399659607e0Smrgesac
1400659607e0Smrgelse
1401659607e0Smrg
1402659607e0Smrg# Here we handle the default operating systems that come with various machines.
1403659607e0Smrg# The value should be what the vendor currently ships out the door with their
1404659607e0Smrg# machine or put another way, the most popular os provided with the machine.
1405659607e0Smrg
1406659607e0Smrg# Note that if you're going to try to match "-MANUFACTURER" here (say,
1407659607e0Smrg# "-sun"), then you have to tell the case statement up towards the top
1408659607e0Smrg# that MANUFACTURER isn't an operating system.  Otherwise, code above
1409659607e0Smrg# will signal an error saying that MANUFACTURER isn't an operating
1410659607e0Smrg# system, and we'll never get to this point.
1411659607e0Smrg
1412659607e0Smrgcase $basic_machine in
1413fc27e79cSmrg        score-*)
1414fc27e79cSmrg		os=-elf
1415fc27e79cSmrg		;;
1416fc27e79cSmrg        spu-*)
1417fc27e79cSmrg		os=-elf
1418fc27e79cSmrg		;;
1419659607e0Smrg	*-acorn)
1420659607e0Smrg		os=-riscix1.2
1421659607e0Smrg		;;
1422659607e0Smrg	arm*-rebel)
1423659607e0Smrg		os=-linux
1424659607e0Smrg		;;
1425659607e0Smrg	arm*-semi)
1426659607e0Smrg		os=-aout
1427659607e0Smrg		;;
1428fc27e79cSmrg        c4x-* | tic4x-*)
1429fc27e79cSmrg        	os=-coff
1430fc27e79cSmrg		;;
1431659607e0Smrg	# This must come before the *-dec entry.
1432659607e0Smrg	pdp10-*)
1433659607e0Smrg		os=-tops20
1434659607e0Smrg		;;
1435659607e0Smrg	pdp11-*)
1436659607e0Smrg		os=-none
1437659607e0Smrg		;;
1438659607e0Smrg	*-dec | vax-*)
1439659607e0Smrg		os=-ultrix4.2
1440659607e0Smrg		;;
1441659607e0Smrg	m68*-apollo)
1442659607e0Smrg		os=-domain
1443659607e0Smrg		;;
1444659607e0Smrg	i386-sun)
1445659607e0Smrg		os=-sunos4.0.2
1446659607e0Smrg		;;
1447659607e0Smrg	m68000-sun)
1448659607e0Smrg		os=-sunos3
1449659607e0Smrg		# This also exists in the configure program, but was not the
1450659607e0Smrg		# default.
1451659607e0Smrg		# os=-sunos4
1452659607e0Smrg		;;
1453659607e0Smrg	m68*-cisco)
1454659607e0Smrg		os=-aout
1455659607e0Smrg		;;
1456fc27e79cSmrg        mep-*)
1457fc27e79cSmrg		os=-elf
1458fc27e79cSmrg		;;
1459659607e0Smrg	mips*-cisco)
1460659607e0Smrg		os=-elf
1461659607e0Smrg		;;
1462659607e0Smrg	mips*-*)
1463659607e0Smrg		os=-elf
1464659607e0Smrg		;;
1465659607e0Smrg	or32-*)
1466659607e0Smrg		os=-coff
1467659607e0Smrg		;;
1468659607e0Smrg	*-tti)	# must be before sparc entry or we get the wrong os.
1469659607e0Smrg		os=-sysv3
1470659607e0Smrg		;;
1471659607e0Smrg	sparc-* | *-sun)
1472659607e0Smrg		os=-sunos4.1.1
1473659607e0Smrg		;;
1474659607e0Smrg	*-be)
1475659607e0Smrg		os=-beos
1476659607e0Smrg		;;
1477659607e0Smrg	*-haiku)
1478659607e0Smrg		os=-haiku
1479659607e0Smrg		;;
1480659607e0Smrg	*-ibm)
1481659607e0Smrg		os=-aix
1482659607e0Smrg		;;
1483659607e0Smrg    	*-knuth)
1484659607e0Smrg		os=-mmixware
1485659607e0Smrg		;;
1486659607e0Smrg	*-wec)
1487659607e0Smrg		os=-proelf
1488659607e0Smrg		;;
1489659607e0Smrg	*-winbond)
1490659607e0Smrg		os=-proelf
1491659607e0Smrg		;;
1492659607e0Smrg	*-oki)
1493659607e0Smrg		os=-proelf
1494659607e0Smrg		;;
1495659607e0Smrg	*-hp)
1496659607e0Smrg		os=-hpux
1497659607e0Smrg		;;
1498659607e0Smrg	*-hitachi)
1499659607e0Smrg		os=-hiux
1500659607e0Smrg		;;
1501659607e0Smrg	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1502659607e0Smrg		os=-sysv
1503659607e0Smrg		;;
1504659607e0Smrg	*-cbm)
1505659607e0Smrg		os=-amigaos
1506659607e0Smrg		;;
1507659607e0Smrg	*-dg)
1508659607e0Smrg		os=-dgux
1509659607e0Smrg		;;
1510659607e0Smrg	*-dolphin)
1511659607e0Smrg		os=-sysv3
1512659607e0Smrg		;;
1513659607e0Smrg	m68k-ccur)
1514659607e0Smrg		os=-rtu
1515659607e0Smrg		;;
1516659607e0Smrg	m88k-omron*)
1517659607e0Smrg		os=-luna
1518659607e0Smrg		;;
1519659607e0Smrg	*-next )
1520659607e0Smrg		os=-nextstep
1521659607e0Smrg		;;
1522659607e0Smrg	*-sequent)
1523659607e0Smrg		os=-ptx
1524659607e0Smrg		;;
1525659607e0Smrg	*-crds)
1526659607e0Smrg		os=-unos
1527659607e0Smrg		;;
1528659607e0Smrg	*-ns)
1529659607e0Smrg		os=-genix
1530659607e0Smrg		;;
1531659607e0Smrg	i370-*)
1532659607e0Smrg		os=-mvs
1533659607e0Smrg		;;
1534659607e0Smrg	*-next)
1535659607e0Smrg		os=-nextstep3
1536659607e0Smrg		;;
1537659607e0Smrg	*-gould)
1538659607e0Smrg		os=-sysv
1539659607e0Smrg		;;
1540659607e0Smrg	*-highlevel)
1541659607e0Smrg		os=-bsd
1542659607e0Smrg		;;
1543659607e0Smrg	*-encore)
1544659607e0Smrg		os=-bsd
1545659607e0Smrg		;;
1546659607e0Smrg	*-sgi)
1547659607e0Smrg		os=-irix
1548659607e0Smrg		;;
1549659607e0Smrg	*-siemens)
1550659607e0Smrg		os=-sysv4
1551659607e0Smrg		;;
1552659607e0Smrg	*-masscomp)
1553659607e0Smrg		os=-rtu
1554659607e0Smrg		;;
1555659607e0Smrg	f30[01]-fujitsu | f700-fujitsu)
1556659607e0Smrg		os=-uxpv
1557659607e0Smrg		;;
1558659607e0Smrg	*-rom68k)
1559659607e0Smrg		os=-coff
1560659607e0Smrg		;;
1561659607e0Smrg	*-*bug)
1562659607e0Smrg		os=-coff
1563659607e0Smrg		;;
1564659607e0Smrg	*-apple)
1565659607e0Smrg		os=-macos
1566659607e0Smrg		;;
1567659607e0Smrg	*-atari*)
1568659607e0Smrg		os=-mint
1569659607e0Smrg		;;
1570659607e0Smrg	*)
1571659607e0Smrg		os=-none
1572659607e0Smrg		;;
1573659607e0Smrgesac
1574659607e0Smrgfi
1575659607e0Smrg
1576659607e0Smrg# Here we handle the case where we know the os, and the CPU type, but not the
1577659607e0Smrg# manufacturer.  We pick the logical manufacturer.
1578659607e0Smrgvendor=unknown
1579659607e0Smrgcase $basic_machine in
1580659607e0Smrg	*-unknown)
1581659607e0Smrg		case $os in
1582659607e0Smrg			-riscix*)
1583659607e0Smrg				vendor=acorn
1584659607e0Smrg				;;
1585659607e0Smrg			-sunos*)
1586659607e0Smrg				vendor=sun
1587659607e0Smrg				;;
1588659607e0Smrg			-aix*)
1589659607e0Smrg				vendor=ibm
1590659607e0Smrg				;;
1591659607e0Smrg			-beos*)
1592659607e0Smrg				vendor=be
1593659607e0Smrg				;;
1594659607e0Smrg			-hpux*)
1595659607e0Smrg				vendor=hp
1596659607e0Smrg				;;
1597659607e0Smrg			-mpeix*)
1598659607e0Smrg				vendor=hp
1599659607e0Smrg				;;
1600659607e0Smrg			-hiux*)
1601659607e0Smrg				vendor=hitachi
1602659607e0Smrg				;;
1603659607e0Smrg			-unos*)
1604659607e0Smrg				vendor=crds
1605659607e0Smrg				;;
1606659607e0Smrg			-dgux*)
1607659607e0Smrg				vendor=dg
1608659607e0Smrg				;;
1609659607e0Smrg			-luna*)
1610659607e0Smrg				vendor=omron
1611659607e0Smrg				;;
1612659607e0Smrg			-genix*)
1613659607e0Smrg				vendor=ns
1614659607e0Smrg				;;
1615659607e0Smrg			-mvs* | -opened*)
1616659607e0Smrg				vendor=ibm
1617659607e0Smrg				;;
1618659607e0Smrg			-os400*)
1619659607e0Smrg				vendor=ibm
1620659607e0Smrg				;;
1621659607e0Smrg			-ptx*)
1622659607e0Smrg				vendor=sequent
1623659607e0Smrg				;;
1624659607e0Smrg			-tpf*)
1625659607e0Smrg				vendor=ibm
1626659607e0Smrg				;;
1627659607e0Smrg			-vxsim* | -vxworks* | -windiss*)
1628659607e0Smrg				vendor=wrs
1629659607e0Smrg				;;
1630659607e0Smrg			-aux*)
1631659607e0Smrg				vendor=apple
1632659607e0Smrg				;;
1633659607e0Smrg			-hms*)
1634659607e0Smrg				vendor=hitachi
1635659607e0Smrg				;;
1636659607e0Smrg			-mpw* | -macos*)
1637659607e0Smrg				vendor=apple
1638659607e0Smrg				;;
1639659607e0Smrg			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1640659607e0Smrg				vendor=atari
1641659607e0Smrg				;;
1642659607e0Smrg			-vos*)
1643659607e0Smrg				vendor=stratus
1644659607e0Smrg				;;
1645659607e0Smrg		esac
1646659607e0Smrg		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1647659607e0Smrg		;;
1648659607e0Smrgesac
1649659607e0Smrg
1650659607e0Smrgecho $basic_machine$os
1651659607e0Smrgexit
1652659607e0Smrg
1653659607e0Smrg# Local variables:
1654659607e0Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1655659607e0Smrg# time-stamp-start: "timestamp='"
1656659607e0Smrg# time-stamp-format: "%:y-%02m-%02d"
1657659607e0Smrg# time-stamp-end: "'"
1658659607e0Smrg# End:
1659