1132451Sroberto#! /bin/sh
2132451Sroberto# Configuration validation subroutine script.
3132451Sroberto#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4290000Sglebius#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5290000Sglebius#   2011 Free Software Foundation, Inc.
6132451Sroberto
7290000Sglebiustimestamp='2011-06-03'
8132451Sroberto
9132451Sroberto# This file is (in principle) common to ALL GNU software.
10132451Sroberto# The presence of a machine in this file suggests that SOME GNU software
11132451Sroberto# can handle that machine.  It does not imply ALL GNU software can.
12132451Sroberto#
13132451Sroberto# This file is free software; you can redistribute it and/or modify
14132451Sroberto# it under the terms of the GNU General Public License as published by
15132451Sroberto# the Free Software Foundation; either version 2 of the License, or
16132451Sroberto# (at your option) any later version.
17132451Sroberto#
18132451Sroberto# This program is distributed in the hope that it will be useful,
19132451Sroberto# but WITHOUT ANY WARRANTY; without even the implied warranty of
20132451Sroberto# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21132451Sroberto# GNU General Public License for more details.
22132451Sroberto#
23132451Sroberto# You should have received a copy of the GNU General Public License
24132451Sroberto# along with this program; if not, write to the Free Software
25182007Sroberto# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26182007Sroberto# 02110-1301, USA.
27182007Sroberto#
28132451Sroberto# As a special exception to the GNU General Public License, if you
29132451Sroberto# distribute this file as part of a program that contains a
30132451Sroberto# configuration script generated by Autoconf, you may include it under
31132451Sroberto# the same distribution terms that you use for the rest of that program.
32132451Sroberto
33182007Sroberto
34132451Sroberto# Please send patches to <config-patches@gnu.org>.  Submit a context
35290000Sglebius# diff and a properly formatted GNU ChangeLog entry.
36132451Sroberto#
37132451Sroberto# Configuration subroutine to validate and canonicalize a configuration type.
38132451Sroberto# Supply the specified configuration type as an argument.
39132451Sroberto# If it is invalid, we print an error message on stderr and exit with code 1.
40132451Sroberto# Otherwise, we print the canonical config type on stdout and succeed.
41132451Sroberto
42290000Sglebius# You can get the latest version of this script from:
43290000Sglebius# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44290000Sglebius
45132451Sroberto# This file is supposed to be the same for all GNU packages
46132451Sroberto# and recognize all the CPU types, system types and aliases
47132451Sroberto# that are meaningful with *any* GNU software.
48132451Sroberto# Each package is responsible for reporting which valid configurations
49132451Sroberto# it does not support.  The user should be able to distinguish
50132451Sroberto# a failure to support a valid configuration from a meaningless
51132451Sroberto# configuration.
52132451Sroberto
53132451Sroberto# The goal of this file is to map all the various variations of a given
54132451Sroberto# machine specification into a single specification in the form:
55132451Sroberto#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
56132451Sroberto# or in some cases, the newer four-part form:
57132451Sroberto#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
58132451Sroberto# It is wrong to echo any other type of specification.
59132451Sroberto
60132451Srobertome=`echo "$0" | sed -e 's,.*/,,'`
61132451Sroberto
62132451Srobertousage="\
63132451SrobertoUsage: $0 [OPTION] CPU-MFR-OPSYS
64132451Sroberto       $0 [OPTION] ALIAS
65132451Sroberto
66132451SrobertoCanonicalize a configuration name.
67132451Sroberto
68132451SrobertoOperation modes:
69132451Sroberto  -h, --help         print this help, then exit
70132451Sroberto  -t, --time-stamp   print date of last modification, then exit
71132451Sroberto  -v, --version      print version number, then exit
72132451Sroberto
73132451SrobertoReport bugs and patches to <config-patches@gnu.org>."
74132451Sroberto
75132451Srobertoversion="\
76132451SrobertoGNU config.sub ($timestamp)
77132451Sroberto
78290000SglebiusCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79290000Sglebius2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
80290000SglebiusSoftware Foundation, Inc.
81132451Sroberto
82132451SrobertoThis is free software; see the source for copying conditions.  There is NO
83132451Srobertowarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84132451Sroberto
85132451Srobertohelp="
86132451SrobertoTry \`$me --help' for more information."
87132451Sroberto
88132451Sroberto# Parse command line
89132451Srobertowhile test $# -gt 0 ; do
90132451Sroberto  case $1 in
91132451Sroberto    --time-stamp | --time* | -t )
92182007Sroberto       echo "$timestamp" ; exit ;;
93132451Sroberto    --version | -v )
94182007Sroberto       echo "$version" ; exit ;;
95132451Sroberto    --help | --h* | -h )
96182007Sroberto       echo "$usage"; exit ;;
97132451Sroberto    -- )     # Stop option processing
98132451Sroberto       shift; break ;;
99132451Sroberto    - )	# Use stdin as input.
100132451Sroberto       break ;;
101132451Sroberto    -* )
102132451Sroberto       echo "$me: invalid option $1$help"
103132451Sroberto       exit 1 ;;
104132451Sroberto
105132451Sroberto    *local*)
106132451Sroberto       # First pass through any local machine types.
107132451Sroberto       echo $1
108182007Sroberto       exit ;;
109132451Sroberto
110132451Sroberto    * )
111132451Sroberto       break ;;
112132451Sroberto  esac
113132451Srobertodone
114132451Sroberto
115132451Srobertocase $# in
116132451Sroberto 0) echo "$me: missing argument$help" >&2
117132451Sroberto    exit 1;;
118132451Sroberto 1) ;;
119132451Sroberto *) echo "$me: too many arguments$help" >&2
120132451Sroberto    exit 1;;
121132451Srobertoesac
122132451Sroberto
123132451Sroberto# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124132451Sroberto# Here we must recognize all the valid KERNEL-OS combinations.
125132451Srobertomaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126132451Srobertocase $maybe_os in
127290000Sglebius  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128290000Sglebius  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129290000Sglebius  knetbsd*-gnu* | netbsd*-gnu* | \
130290000Sglebius  kopensolaris*-gnu* | \
131290000Sglebius  storm-chaos* | os2-emx* | rtmk-nova*)
132132451Sroberto    os=-$maybe_os
133132451Sroberto    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
134132451Sroberto    ;;
135132451Sroberto  *)
136132451Sroberto    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
137132451Sroberto    if [ $basic_machine != $1 ]
138132451Sroberto    then os=`echo $1 | sed 's/.*-/-/'`
139132451Sroberto    else os=; fi
140132451Sroberto    ;;
141132451Srobertoesac
142132451Sroberto
143132451Sroberto### Let's recognize common machines as not being operating systems so
144132451Sroberto### that things like config.sub decstation-3100 work.  We also
145132451Sroberto### recognize some manufacturers as not being operating systems, so we
146132451Sroberto### can provide default operating systems below.
147132451Srobertocase $os in
148132451Sroberto	-sun*os*)
149132451Sroberto		# Prevent following clause from handling this invalid input.
150132451Sroberto		;;
151132451Sroberto	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
152132451Sroberto	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
153132451Sroberto	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
154132451Sroberto	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
155132451Sroberto	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
156132451Sroberto	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157290000Sglebius	-apple | -axis | -knuth | -cray | -microblaze)
158132451Sroberto		os=
159132451Sroberto		basic_machine=$1
160132451Sroberto		;;
161290000Sglebius	-bluegene*)
162290000Sglebius		os=-cnk
163290000Sglebius		;;
164132451Sroberto	-sim | -cisco | -oki | -wec | -winbond)
165132451Sroberto		os=
166132451Sroberto		basic_machine=$1
167132451Sroberto		;;
168132451Sroberto	-scout)
169132451Sroberto		;;
170132451Sroberto	-wrs)
171132451Sroberto		os=-vxworks
172132451Sroberto		basic_machine=$1
173132451Sroberto		;;
174132451Sroberto	-chorusos*)
175132451Sroberto		os=-chorusos
176132451Sroberto		basic_machine=$1
177132451Sroberto		;;
178290000Sglebius	-chorusrdb)
179290000Sglebius		os=-chorusrdb
180132451Sroberto		basic_machine=$1
181290000Sglebius		;;
182132451Sroberto	-hiux*)
183132451Sroberto		os=-hiuxwe2
184132451Sroberto		;;
185290000Sglebius	-sco6)
186290000Sglebius		os=-sco5v6
187290000Sglebius		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188290000Sglebius		;;
189132451Sroberto	-sco5)
190132451Sroberto		os=-sco3.2v5
191132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192132451Sroberto		;;
193132451Sroberto	-sco4)
194132451Sroberto		os=-sco3.2v4
195132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196132451Sroberto		;;
197132451Sroberto	-sco3.2.[4-9]*)
198132451Sroberto		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
199132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200132451Sroberto		;;
201132451Sroberto	-sco3.2v[4-9]*)
202132451Sroberto		# Don't forget version if it is 3.2v4 or newer.
203132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204132451Sroberto		;;
205290000Sglebius	-sco5v6*)
206290000Sglebius		# Don't forget version if it is 3.2v4 or newer.
207290000Sglebius		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
208290000Sglebius		;;
209132451Sroberto	-sco*)
210132451Sroberto		os=-sco3.2v2
211132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
212132451Sroberto		;;
213132451Sroberto	-udk*)
214132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
215132451Sroberto		;;
216132451Sroberto	-isc)
217132451Sroberto		os=-isc2.2
218132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
219132451Sroberto		;;
220132451Sroberto	-clix*)
221132451Sroberto		basic_machine=clipper-intergraph
222132451Sroberto		;;
223132451Sroberto	-isc*)
224132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
225132451Sroberto		;;
226132451Sroberto	-lynx*)
227132451Sroberto		os=-lynxos
228132451Sroberto		;;
229132451Sroberto	-ptx*)
230132451Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
231132451Sroberto		;;
232132451Sroberto	-windowsnt*)
233132451Sroberto		os=`echo $os | sed -e 's/windowsnt/winnt/'`
234132451Sroberto		;;
235132451Sroberto	-psos*)
236132451Sroberto		os=-psos
237132451Sroberto		;;
238132451Sroberto	-mint | -mint[0-9]*)
239132451Sroberto		basic_machine=m68k-atari
240132451Sroberto		os=-mint
241132451Sroberto		;;
242132451Srobertoesac
243132451Sroberto
244132451Sroberto# Decode aliases for certain CPU-COMPANY combinations.
245132451Srobertocase $basic_machine in
246132451Sroberto	# Recognize the basic CPU types without company name.
247132451Sroberto	# Some are omitted here because they have special meanings below.
248132451Sroberto	1750a | 580 \
249132451Sroberto	| a29k \
250132451Sroberto	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
251132451Sroberto	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252182007Sroberto	| am33_2.0 \
253290000Sglebius	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
254182007Sroberto	| bfin \
255132451Sroberto	| c4x | clipper \
256132451Sroberto	| d10v | d30v | dlx | dsp16xx \
257290000Sglebius	| fido | fr30 | frv \
258132451Sroberto	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
259132451Sroberto	| i370 | i860 | i960 | ia64 \
260182007Sroberto	| ip2k | iq2000 \
261290000Sglebius	| lm32 \
262290000Sglebius	| m32c | m32r | m32rle | m68000 | m68k | m88k \
263290000Sglebius	| maxq | mb | microblaze | mcore | mep | metag \
264132451Sroberto	| mips | mipsbe | mipseb | mipsel | mipsle \
265132451Sroberto	| mips16 \
266132451Sroberto	| mips64 | mips64el \
267290000Sglebius	| mips64octeon | mips64octeonel \
268290000Sglebius	| mips64orion | mips64orionel \
269290000Sglebius	| mips64r5900 | mips64r5900el \
270132451Sroberto	| mips64vr | mips64vrel \
271132451Sroberto	| mips64vr4100 | mips64vr4100el \
272132451Sroberto	| mips64vr4300 | mips64vr4300el \
273132451Sroberto	| mips64vr5000 | mips64vr5000el \
274182007Sroberto	| mips64vr5900 | mips64vr5900el \
275132451Sroberto	| mipsisa32 | mipsisa32el \
276132451Sroberto	| mipsisa32r2 | mipsisa32r2el \
277132451Sroberto	| mipsisa64 | mipsisa64el \
278182007Sroberto	| mipsisa64r2 | mipsisa64r2el \
279132451Sroberto	| mipsisa64sb1 | mipsisa64sb1el \
280132451Sroberto	| mipsisa64sr71k | mipsisa64sr71kel \
281132451Sroberto	| mipstx39 | mipstx39el \
282132451Sroberto	| mn10200 | mn10300 \
283290000Sglebius	| moxie \
284290000Sglebius	| mt \
285132451Sroberto	| msp430 \
286290000Sglebius	| nds32 | nds32le | nds32be \
287290000Sglebius	| nios | nios2 \
288132451Sroberto	| ns16k | ns32k \
289290000Sglebius	| open8 \
290182007Sroberto	| or32 \
291132451Sroberto	| pdp10 | pdp11 | pj | pjl \
292290000Sglebius	| powerpc | powerpc64 | powerpc64le | powerpcle \
293132451Sroberto	| pyramid \
294290000Sglebius	| rx \
295290000Sglebius	| score \
296290000Sglebius	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
297132451Sroberto	| sh64 | sh64le \
298290000Sglebius	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
299290000Sglebius	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
300290000Sglebius	| spu \
301290000Sglebius	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
302290000Sglebius	| ubicom32 \
303290000Sglebius	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
304132451Sroberto	| we32k \
305290000Sglebius	| x86 | xc16x | xstormy16 | xtensa \
306290000Sglebius	| z8k | z80)
307132451Sroberto		basic_machine=$basic_machine-unknown
308132451Sroberto		;;
309290000Sglebius	c54x)
310290000Sglebius		basic_machine=tic54x-unknown
311182007Sroberto		;;
312290000Sglebius	c55x)
313290000Sglebius		basic_machine=tic55x-unknown
314290000Sglebius		;;
315290000Sglebius	c6x)
316290000Sglebius		basic_machine=tic6x-unknown
317290000Sglebius		;;
318290000Sglebius	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
319132451Sroberto		# Motorola 68HC11/12.
320132451Sroberto		basic_machine=$basic_machine-unknown
321132451Sroberto		os=-none
322132451Sroberto		;;
323132451Sroberto	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
324132451Sroberto		;;
325290000Sglebius	ms1)
326290000Sglebius		basic_machine=mt-unknown
327290000Sglebius		;;
328132451Sroberto
329290000Sglebius	strongarm | thumb | xscale)
330290000Sglebius		basic_machine=arm-unknown
331290000Sglebius		;;
332290000Sglebius
333290000Sglebius	xscaleeb)
334290000Sglebius		basic_machine=armeb-unknown
335290000Sglebius		;;
336290000Sglebius
337290000Sglebius	xscaleel)
338290000Sglebius		basic_machine=armel-unknown
339290000Sglebius		;;
340290000Sglebius
341132451Sroberto	# We use `pc' rather than `unknown'
342132451Sroberto	# because (1) that's what they normally are, and
343132451Sroberto	# (2) the word "unknown" tends to confuse beginning users.
344132451Sroberto	i*86 | x86_64)
345132451Sroberto	  basic_machine=$basic_machine-pc
346132451Sroberto	  ;;
347132451Sroberto	# Object if more than one company name word.
348132451Sroberto	*-*-*)
349132451Sroberto		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
350132451Sroberto		exit 1
351132451Sroberto		;;
352132451Sroberto	# Recognize the basic CPU types with company name.
353132451Sroberto	580-* \
354132451Sroberto	| a29k-* \
355132451Sroberto	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
356132451Sroberto	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
357132451Sroberto	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
358132451Sroberto	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
359290000Sglebius	| avr-* | avr32-* \
360182007Sroberto	| bfin-* | bs2000-* \
361290000Sglebius	| c[123]* | c30-* | [cjt]90-* | c4x-* \
362182007Sroberto	| clipper-* | craynv-* | cydra-* \
363132451Sroberto	| d10v-* | d30v-* | dlx-* \
364132451Sroberto	| elxsi-* \
365290000Sglebius	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
366132451Sroberto	| h8300-* | h8500-* \
367132451Sroberto	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
368132451Sroberto	| i*86-* | i860-* | i960-* | ia64-* \
369182007Sroberto	| ip2k-* | iq2000-* \
370290000Sglebius	| lm32-* \
371290000Sglebius	| m32c-* | m32r-* | m32rle-* \
372132451Sroberto	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
373290000Sglebius	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
374132451Sroberto	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
375132451Sroberto	| mips16-* \
376132451Sroberto	| mips64-* | mips64el-* \
377290000Sglebius	| mips64octeon-* | mips64octeonel-* \
378290000Sglebius	| mips64orion-* | mips64orionel-* \
379290000Sglebius	| mips64r5900-* | mips64r5900el-* \
380132451Sroberto	| mips64vr-* | mips64vrel-* \
381132451Sroberto	| mips64vr4100-* | mips64vr4100el-* \
382132451Sroberto	| mips64vr4300-* | mips64vr4300el-* \
383132451Sroberto	| mips64vr5000-* | mips64vr5000el-* \
384182007Sroberto	| mips64vr5900-* | mips64vr5900el-* \
385132451Sroberto	| mipsisa32-* | mipsisa32el-* \
386132451Sroberto	| mipsisa32r2-* | mipsisa32r2el-* \
387132451Sroberto	| mipsisa64-* | mipsisa64el-* \
388182007Sroberto	| mipsisa64r2-* | mipsisa64r2el-* \
389132451Sroberto	| mipsisa64sb1-* | mipsisa64sb1el-* \
390132451Sroberto	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
391132451Sroberto	| mipstx39-* | mipstx39el-* \
392182007Sroberto	| mmix-* \
393290000Sglebius	| mt-* \
394132451Sroberto	| msp430-* \
395290000Sglebius	| nds32-* | nds32le-* | nds32be-* \
396290000Sglebius	| nios-* | nios2-* \
397182007Sroberto	| none-* | np1-* | ns16k-* | ns32k-* \
398290000Sglebius	| open8-* \
399132451Sroberto	| orion-* \
400132451Sroberto	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
401290000Sglebius	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
402132451Sroberto	| pyramid-* \
403290000Sglebius	| romp-* | rs6000-* | rx-* \
404290000Sglebius	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
405132451Sroberto	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
406290000Sglebius	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
407182007Sroberto	| sparclite-* \
408290000Sglebius	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
409290000Sglebius	| tahoe-* \
410132451Sroberto	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
411290000Sglebius	| tile*-* \
412132451Sroberto	| tron-* \
413290000Sglebius	| ubicom32-* \
414290000Sglebius	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
415290000Sglebius	| vax-* \
416132451Sroberto	| we32k-* \
417290000Sglebius	| x86-* | x86_64-* | xc16x-* | xps100-* \
418290000Sglebius	| xstormy16-* | xtensa*-* \
419132451Sroberto	| ymp-* \
420290000Sglebius	| z8k-* | z80-*)
421132451Sroberto		;;
422290000Sglebius	# Recognize the basic CPU types without company name, with glob match.
423290000Sglebius	xtensa*)
424290000Sglebius		basic_machine=$basic_machine-unknown
425182007Sroberto		;;
426132451Sroberto	# Recognize the various machine names and aliases which stand
427132451Sroberto	# for a CPU type and a company and sometimes even an OS.
428132451Sroberto	386bsd)
429132451Sroberto		basic_machine=i386-unknown
430132451Sroberto		os=-bsd
431132451Sroberto		;;
432132451Sroberto	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
433132451Sroberto		basic_machine=m68000-att
434132451Sroberto		;;
435132451Sroberto	3b*)
436132451Sroberto		basic_machine=we32k-att
437132451Sroberto		;;
438132451Sroberto	a29khif)
439132451Sroberto		basic_machine=a29k-amd
440132451Sroberto		os=-udi
441132451Sroberto		;;
442290000Sglebius	abacus)
443182007Sroberto		basic_machine=abacus-unknown
444182007Sroberto		;;
445132451Sroberto	adobe68k)
446132451Sroberto		basic_machine=m68010-adobe
447132451Sroberto		os=-scout
448132451Sroberto		;;
449132451Sroberto	alliant | fx80)
450132451Sroberto		basic_machine=fx80-alliant
451132451Sroberto		;;
452132451Sroberto	altos | altos3068)
453132451Sroberto		basic_machine=m68k-altos
454132451Sroberto		;;
455132451Sroberto	am29k)
456132451Sroberto		basic_machine=a29k-none
457132451Sroberto		os=-bsd
458132451Sroberto		;;
459132451Sroberto	amd64)
460132451Sroberto		basic_machine=x86_64-pc
461132451Sroberto		;;
462182007Sroberto	amd64-*)
463182007Sroberto		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
464182007Sroberto		;;
465132451Sroberto	amdahl)
466132451Sroberto		basic_machine=580-amdahl
467132451Sroberto		os=-sysv
468132451Sroberto		;;
469132451Sroberto	amiga | amiga-*)
470132451Sroberto		basic_machine=m68k-unknown
471132451Sroberto		;;
472132451Sroberto	amigaos | amigados)
473132451Sroberto		basic_machine=m68k-unknown
474132451Sroberto		os=-amigaos
475132451Sroberto		;;
476132451Sroberto	amigaunix | amix)
477132451Sroberto		basic_machine=m68k-unknown
478132451Sroberto		os=-sysv4
479132451Sroberto		;;
480132451Sroberto	apollo68)
481132451Sroberto		basic_machine=m68k-apollo
482132451Sroberto		os=-sysv
483132451Sroberto		;;
484132451Sroberto	apollo68bsd)
485132451Sroberto		basic_machine=m68k-apollo
486132451Sroberto		os=-bsd
487132451Sroberto		;;
488290000Sglebius	aros)
489290000Sglebius		basic_machine=i386-pc
490290000Sglebius		os=-aros
491290000Sglebius		;;
492132451Sroberto	aux)
493132451Sroberto		basic_machine=m68k-apple
494132451Sroberto		os=-aux
495132451Sroberto		;;
496132451Sroberto	balance)
497132451Sroberto		basic_machine=ns32k-sequent
498132451Sroberto		os=-dynix
499132451Sroberto		;;
500290000Sglebius	blackfin)
501290000Sglebius		basic_machine=bfin-unknown
502290000Sglebius		os=-linux
503290000Sglebius		;;
504290000Sglebius	blackfin-*)
505290000Sglebius		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
506290000Sglebius		os=-linux
507290000Sglebius		;;
508290000Sglebius	bluegene*)
509290000Sglebius		basic_machine=powerpc-ibm
510290000Sglebius		os=-cnk
511290000Sglebius		;;
512290000Sglebius	c54x-*)
513290000Sglebius		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
514290000Sglebius		;;
515290000Sglebius	c55x-*)
516290000Sglebius		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
517290000Sglebius		;;
518290000Sglebius	c6x-*)
519290000Sglebius		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
520290000Sglebius		;;
521132451Sroberto	c90)
522132451Sroberto		basic_machine=c90-cray
523132451Sroberto		os=-unicos
524132451Sroberto		;;
525290000Sglebius	cegcc)
526290000Sglebius		basic_machine=arm-unknown
527290000Sglebius		os=-cegcc
528290000Sglebius		;;
529132451Sroberto	convex-c1)
530132451Sroberto		basic_machine=c1-convex
531132451Sroberto		os=-bsd
532132451Sroberto		;;
533132451Sroberto	convex-c2)
534132451Sroberto		basic_machine=c2-convex
535132451Sroberto		os=-bsd
536132451Sroberto		;;
537132451Sroberto	convex-c32)
538132451Sroberto		basic_machine=c32-convex
539132451Sroberto		os=-bsd
540132451Sroberto		;;
541132451Sroberto	convex-c34)
542132451Sroberto		basic_machine=c34-convex
543132451Sroberto		os=-bsd
544132451Sroberto		;;
545132451Sroberto	convex-c38)
546132451Sroberto		basic_machine=c38-convex
547132451Sroberto		os=-bsd
548132451Sroberto		;;
549132451Sroberto	cray | j90)
550132451Sroberto		basic_machine=j90-cray
551132451Sroberto		os=-unicos
552132451Sroberto		;;
553182007Sroberto	craynv)
554182007Sroberto		basic_machine=craynv-cray
555182007Sroberto		os=-unicosmp
556182007Sroberto		;;
557290000Sglebius	cr16 | cr16-*)
558290000Sglebius		basic_machine=cr16-unknown
559182007Sroberto		os=-elf
560182007Sroberto		;;
561132451Sroberto	crds | unos)
562132451Sroberto		basic_machine=m68k-crds
563132451Sroberto		;;
564182007Sroberto	crisv32 | crisv32-* | etraxfs*)
565182007Sroberto		basic_machine=crisv32-axis
566182007Sroberto		;;
567132451Sroberto	cris | cris-* | etrax*)
568132451Sroberto		basic_machine=cris-axis
569132451Sroberto		;;
570182007Sroberto	crx)
571182007Sroberto		basic_machine=crx-unknown
572182007Sroberto		os=-elf
573182007Sroberto		;;
574132451Sroberto	da30 | da30-*)
575132451Sroberto		basic_machine=m68k-da30
576132451Sroberto		;;
577132451Sroberto	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
578132451Sroberto		basic_machine=mips-dec
579132451Sroberto		;;
580132451Sroberto	decsystem10* | dec10*)
581132451Sroberto		basic_machine=pdp10-dec
582132451Sroberto		os=-tops10
583132451Sroberto		;;
584132451Sroberto	decsystem20* | dec20*)
585132451Sroberto		basic_machine=pdp10-dec
586132451Sroberto		os=-tops20
587132451Sroberto		;;
588132451Sroberto	delta | 3300 | motorola-3300 | motorola-delta \
589132451Sroberto	      | 3300-motorola | delta-motorola)
590132451Sroberto		basic_machine=m68k-motorola
591132451Sroberto		;;
592132451Sroberto	delta88)
593132451Sroberto		basic_machine=m88k-motorola
594132451Sroberto		os=-sysv3
595132451Sroberto		;;
596290000Sglebius	dicos)
597290000Sglebius		basic_machine=i686-pc
598290000Sglebius		os=-dicos
599290000Sglebius		;;
600182007Sroberto	djgpp)
601182007Sroberto		basic_machine=i586-pc
602182007Sroberto		os=-msdosdjgpp
603182007Sroberto		;;
604132451Sroberto	dpx20 | dpx20-*)
605132451Sroberto		basic_machine=rs6000-bull
606132451Sroberto		os=-bosx
607132451Sroberto		;;
608132451Sroberto	dpx2* | dpx2*-bull)
609132451Sroberto		basic_machine=m68k-bull
610132451Sroberto		os=-sysv3
611132451Sroberto		;;
612132451Sroberto	ebmon29k)
613132451Sroberto		basic_machine=a29k-amd
614132451Sroberto		os=-ebmon
615132451Sroberto		;;
616132451Sroberto	elxsi)
617132451Sroberto		basic_machine=elxsi-elxsi
618132451Sroberto		os=-bsd
619132451Sroberto		;;
620132451Sroberto	encore | umax | mmax)
621132451Sroberto		basic_machine=ns32k-encore
622132451Sroberto		;;
623132451Sroberto	es1800 | OSE68k | ose68k | ose | OSE)
624132451Sroberto		basic_machine=m68k-ericsson
625132451Sroberto		os=-ose
626132451Sroberto		;;
627132451Sroberto	fx2800)
628132451Sroberto		basic_machine=i860-alliant
629132451Sroberto		;;
630132451Sroberto	genix)
631132451Sroberto		basic_machine=ns32k-ns
632132451Sroberto		;;
633132451Sroberto	gmicro)
634132451Sroberto		basic_machine=tron-gmicro
635132451Sroberto		os=-sysv
636132451Sroberto		;;
637132451Sroberto	go32)
638132451Sroberto		basic_machine=i386-pc
639132451Sroberto		os=-go32
640132451Sroberto		;;
641132451Sroberto	h3050r* | hiux*)
642132451Sroberto		basic_machine=hppa1.1-hitachi
643132451Sroberto		os=-hiuxwe2
644132451Sroberto		;;
645132451Sroberto	h8300hms)
646132451Sroberto		basic_machine=h8300-hitachi
647132451Sroberto		os=-hms
648132451Sroberto		;;
649132451Sroberto	h8300xray)
650132451Sroberto		basic_machine=h8300-hitachi
651132451Sroberto		os=-xray
652132451Sroberto		;;
653132451Sroberto	h8500hms)
654132451Sroberto		basic_machine=h8500-hitachi
655132451Sroberto		os=-hms
656132451Sroberto		;;
657132451Sroberto	harris)
658132451Sroberto		basic_machine=m88k-harris
659132451Sroberto		os=-sysv3
660132451Sroberto		;;
661132451Sroberto	hp300-*)
662132451Sroberto		basic_machine=m68k-hp
663132451Sroberto		;;
664132451Sroberto	hp300bsd)
665132451Sroberto		basic_machine=m68k-hp
666132451Sroberto		os=-bsd
667132451Sroberto		;;
668132451Sroberto	hp300hpux)
669132451Sroberto		basic_machine=m68k-hp
670132451Sroberto		os=-hpux
671132451Sroberto		;;
672132451Sroberto	hp3k9[0-9][0-9] | hp9[0-9][0-9])
673132451Sroberto		basic_machine=hppa1.0-hp
674132451Sroberto		;;
675132451Sroberto	hp9k2[0-9][0-9] | hp9k31[0-9])
676132451Sroberto		basic_machine=m68000-hp
677132451Sroberto		;;
678132451Sroberto	hp9k3[2-9][0-9])
679132451Sroberto		basic_machine=m68k-hp
680132451Sroberto		;;
681132451Sroberto	hp9k6[0-9][0-9] | hp6[0-9][0-9])
682132451Sroberto		basic_machine=hppa1.0-hp
683132451Sroberto		;;
684132451Sroberto	hp9k7[0-79][0-9] | hp7[0-79][0-9])
685132451Sroberto		basic_machine=hppa1.1-hp
686132451Sroberto		;;
687132451Sroberto	hp9k78[0-9] | hp78[0-9])
688132451Sroberto		# FIXME: really hppa2.0-hp
689132451Sroberto		basic_machine=hppa1.1-hp
690132451Sroberto		;;
691132451Sroberto	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
692132451Sroberto		# FIXME: really hppa2.0-hp
693132451Sroberto		basic_machine=hppa1.1-hp
694132451Sroberto		;;
695132451Sroberto	hp9k8[0-9][13679] | hp8[0-9][13679])
696132451Sroberto		basic_machine=hppa1.1-hp
697132451Sroberto		;;
698132451Sroberto	hp9k8[0-9][0-9] | hp8[0-9][0-9])
699132451Sroberto		basic_machine=hppa1.0-hp
700132451Sroberto		;;
701132451Sroberto	hppa-next)
702132451Sroberto		os=-nextstep3
703132451Sroberto		;;
704132451Sroberto	hppaosf)
705132451Sroberto		basic_machine=hppa1.1-hp
706132451Sroberto		os=-osf
707132451Sroberto		;;
708132451Sroberto	hppro)
709132451Sroberto		basic_machine=hppa1.1-hp
710132451Sroberto		os=-proelf
711132451Sroberto		;;
712132451Sroberto	i370-ibm* | ibm*)
713132451Sroberto		basic_machine=i370-ibm
714132451Sroberto		;;
715132451Sroberto# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
716132451Sroberto	i*86v32)
717132451Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
718132451Sroberto		os=-sysv32
719132451Sroberto		;;
720132451Sroberto	i*86v4*)
721132451Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
722132451Sroberto		os=-sysv4
723132451Sroberto		;;
724132451Sroberto	i*86v)
725132451Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
726132451Sroberto		os=-sysv
727132451Sroberto		;;
728132451Sroberto	i*86sol2)
729132451Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
730132451Sroberto		os=-solaris2
731132451Sroberto		;;
732132451Sroberto	i386mach)
733132451Sroberto		basic_machine=i386-mach
734132451Sroberto		os=-mach
735132451Sroberto		;;
736132451Sroberto	i386-vsta | vsta)
737132451Sroberto		basic_machine=i386-unknown
738132451Sroberto		os=-vsta
739132451Sroberto		;;
740132451Sroberto	iris | iris4d)
741132451Sroberto		basic_machine=mips-sgi
742132451Sroberto		case $os in
743132451Sroberto		    -irix*)
744132451Sroberto			;;
745132451Sroberto		    *)
746132451Sroberto			os=-irix4
747132451Sroberto			;;
748132451Sroberto		esac
749132451Sroberto		;;
750132451Sroberto	isi68 | isi)
751132451Sroberto		basic_machine=m68k-isi
752132451Sroberto		os=-sysv
753132451Sroberto		;;
754290000Sglebius	m68knommu)
755290000Sglebius		basic_machine=m68k-unknown
756290000Sglebius		os=-linux
757290000Sglebius		;;
758290000Sglebius	m68knommu-*)
759290000Sglebius		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
760290000Sglebius		os=-linux
761290000Sglebius		;;
762132451Sroberto	m88k-omron*)
763132451Sroberto		basic_machine=m88k-omron
764132451Sroberto		;;
765132451Sroberto	magnum | m3230)
766132451Sroberto		basic_machine=mips-mips
767132451Sroberto		os=-sysv
768132451Sroberto		;;
769132451Sroberto	merlin)
770132451Sroberto		basic_machine=ns32k-utek
771132451Sroberto		os=-sysv
772132451Sroberto		;;
773290000Sglebius	microblaze)
774290000Sglebius		basic_machine=microblaze-xilinx
775290000Sglebius		;;
776132451Sroberto	mingw32)
777132451Sroberto		basic_machine=i386-pc
778132451Sroberto		os=-mingw32
779132451Sroberto		;;
780290000Sglebius	mingw32ce)
781290000Sglebius		basic_machine=arm-unknown
782290000Sglebius		os=-mingw32ce
783290000Sglebius		;;
784132451Sroberto	miniframe)
785132451Sroberto		basic_machine=m68000-convergent
786132451Sroberto		;;
787132451Sroberto	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
788132451Sroberto		basic_machine=m68k-atari
789132451Sroberto		os=-mint
790132451Sroberto		;;
791132451Sroberto	mips3*-*)
792132451Sroberto		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
793132451Sroberto		;;
794132451Sroberto	mips3*)
795132451Sroberto		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
796132451Sroberto		;;
797132451Sroberto	monitor)
798132451Sroberto		basic_machine=m68k-rom68k
799132451Sroberto		os=-coff
800132451Sroberto		;;
801132451Sroberto	morphos)
802132451Sroberto		basic_machine=powerpc-unknown
803132451Sroberto		os=-morphos
804132451Sroberto		;;
805132451Sroberto	msdos)
806132451Sroberto		basic_machine=i386-pc
807132451Sroberto		os=-msdos
808132451Sroberto		;;
809290000Sglebius	ms1-*)
810290000Sglebius		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
811290000Sglebius		;;
812132451Sroberto	mvs)
813132451Sroberto		basic_machine=i370-ibm
814132451Sroberto		os=-mvs
815132451Sroberto		;;
816132451Sroberto	ncr3000)
817132451Sroberto		basic_machine=i486-ncr
818132451Sroberto		os=-sysv4
819132451Sroberto		;;
820132451Sroberto	netbsd386)
821132451Sroberto		basic_machine=i386-unknown
822132451Sroberto		os=-netbsd
823132451Sroberto		;;
824132451Sroberto	netwinder)
825132451Sroberto		basic_machine=armv4l-rebel
826132451Sroberto		os=-linux
827132451Sroberto		;;
828132451Sroberto	news | news700 | news800 | news900)
829132451Sroberto		basic_machine=m68k-sony
830132451Sroberto		os=-newsos
831132451Sroberto		;;
832132451Sroberto	news1000)
833132451Sroberto		basic_machine=m68030-sony
834132451Sroberto		os=-newsos
835132451Sroberto		;;
836132451Sroberto	news-3600 | risc-news)
837132451Sroberto		basic_machine=mips-sony
838132451Sroberto		os=-newsos
839132451Sroberto		;;
840132451Sroberto	necv70)
841132451Sroberto		basic_machine=v70-nec
842132451Sroberto		os=-sysv
843132451Sroberto		;;
844132451Sroberto	next | m*-next )
845132451Sroberto		basic_machine=m68k-next
846132451Sroberto		case $os in
847132451Sroberto		    -nextstep* )
848132451Sroberto			;;
849132451Sroberto		    -ns2*)
850132451Sroberto		      os=-nextstep2
851132451Sroberto			;;
852132451Sroberto		    *)
853132451Sroberto		      os=-nextstep3
854132451Sroberto			;;
855132451Sroberto		esac
856132451Sroberto		;;
857132451Sroberto	nh3000)
858132451Sroberto		basic_machine=m68k-harris
859132451Sroberto		os=-cxux
860132451Sroberto		;;
861132451Sroberto	nh[45]000)
862132451Sroberto		basic_machine=m88k-harris
863132451Sroberto		os=-cxux
864132451Sroberto		;;
865132451Sroberto	nindy960)
866132451Sroberto		basic_machine=i960-intel
867132451Sroberto		os=-nindy
868132451Sroberto		;;
869132451Sroberto	mon960)
870132451Sroberto		basic_machine=i960-intel
871132451Sroberto		os=-mon960
872132451Sroberto		;;
873132451Sroberto	nonstopux)
874132451Sroberto		basic_machine=mips-compaq
875132451Sroberto		os=-nonstopux
876132451Sroberto		;;
877132451Sroberto	np1)
878132451Sroberto		basic_machine=np1-gould
879132451Sroberto		;;
880290000Sglebius	neo-tandem)
881290000Sglebius		basic_machine=neo-tandem
882290000Sglebius		;;
883290000Sglebius	nse-tandem)
884290000Sglebius		basic_machine=nse-tandem
885290000Sglebius		;;
886132451Sroberto	nsr-tandem)
887132451Sroberto		basic_machine=nsr-tandem
888132451Sroberto		;;
889132451Sroberto	op50n-* | op60c-*)
890132451Sroberto		basic_machine=hppa1.1-oki
891132451Sroberto		os=-proelf
892132451Sroberto		;;
893182007Sroberto	openrisc | openrisc-*)
894132451Sroberto		basic_machine=or32-unknown
895132451Sroberto		;;
896182007Sroberto	os400)
897182007Sroberto		basic_machine=powerpc-ibm
898182007Sroberto		os=-os400
899182007Sroberto		;;
900132451Sroberto	OSE68000 | ose68000)
901132451Sroberto		basic_machine=m68000-ericsson
902132451Sroberto		os=-ose
903132451Sroberto		;;
904132451Sroberto	os68k)
905132451Sroberto		basic_machine=m68k-none
906132451Sroberto		os=-os68k
907132451Sroberto		;;
908132451Sroberto	pa-hitachi)
909132451Sroberto		basic_machine=hppa1.1-hitachi
910132451Sroberto		os=-hiuxwe2
911132451Sroberto		;;
912132451Sroberto	paragon)
913132451Sroberto		basic_machine=i860-intel
914132451Sroberto		os=-osf
915132451Sroberto		;;
916290000Sglebius	parisc)
917290000Sglebius		basic_machine=hppa-unknown
918290000Sglebius		os=-linux
919290000Sglebius		;;
920290000Sglebius	parisc-*)
921290000Sglebius		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
922290000Sglebius		os=-linux
923290000Sglebius		;;
924132451Sroberto	pbd)
925132451Sroberto		basic_machine=sparc-tti
926132451Sroberto		;;
927132451Sroberto	pbb)
928132451Sroberto		basic_machine=m68k-tti
929132451Sroberto		;;
930132451Sroberto	pc532 | pc532-*)
931132451Sroberto		basic_machine=ns32k-pc532
932132451Sroberto		;;
933290000Sglebius	pc98)
934290000Sglebius		basic_machine=i386-pc
935290000Sglebius		;;
936290000Sglebius	pc98-*)
937290000Sglebius		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
938290000Sglebius		;;
939132451Sroberto	pentium | p5 | k5 | k6 | nexgen | viac3)
940132451Sroberto		basic_machine=i586-pc
941132451Sroberto		;;
942132451Sroberto	pentiumpro | p6 | 6x86 | athlon | athlon_*)
943132451Sroberto		basic_machine=i686-pc
944132451Sroberto		;;
945132451Sroberto	pentiumii | pentium2 | pentiumiii | pentium3)
946132451Sroberto		basic_machine=i686-pc
947132451Sroberto		;;
948132451Sroberto	pentium4)
949132451Sroberto		basic_machine=i786-pc
950132451Sroberto		;;
951132451Sroberto	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
952132451Sroberto		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
953132451Sroberto		;;
954132451Sroberto	pentiumpro-* | p6-* | 6x86-* | athlon-*)
955132451Sroberto		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
956132451Sroberto		;;
957132451Sroberto	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
958132451Sroberto		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
959132451Sroberto		;;
960132451Sroberto	pentium4-*)
961132451Sroberto		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
962132451Sroberto		;;
963132451Sroberto	pn)
964132451Sroberto		basic_machine=pn-gould
965132451Sroberto		;;
966132451Sroberto	power)	basic_machine=power-ibm
967132451Sroberto		;;
968290000Sglebius	ppc | ppcbe)	basic_machine=powerpc-unknown
969132451Sroberto		;;
970290000Sglebius	ppc-* | ppcbe-*)
971290000Sglebius		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
972132451Sroberto		;;
973132451Sroberto	ppcle | powerpclittle | ppc-le | powerpc-little)
974132451Sroberto		basic_machine=powerpcle-unknown
975132451Sroberto		;;
976132451Sroberto	ppcle-* | powerpclittle-*)
977132451Sroberto		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
978132451Sroberto		;;
979132451Sroberto	ppc64)	basic_machine=powerpc64-unknown
980132451Sroberto		;;
981132451Sroberto	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
982132451Sroberto		;;
983132451Sroberto	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
984132451Sroberto		basic_machine=powerpc64le-unknown
985132451Sroberto		;;
986132451Sroberto	ppc64le-* | powerpc64little-*)
987132451Sroberto		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
988132451Sroberto		;;
989132451Sroberto	ps2)
990132451Sroberto		basic_machine=i386-ibm
991132451Sroberto		;;
992132451Sroberto	pw32)
993132451Sroberto		basic_machine=i586-unknown
994132451Sroberto		os=-pw32
995132451Sroberto		;;
996290000Sglebius	rdos)
997290000Sglebius		basic_machine=i386-pc
998290000Sglebius		os=-rdos
999290000Sglebius		;;
1000132451Sroberto	rom68k)
1001132451Sroberto		basic_machine=m68k-rom68k
1002132451Sroberto		os=-coff
1003132451Sroberto		;;
1004132451Sroberto	rm[46]00)
1005132451Sroberto		basic_machine=mips-siemens
1006132451Sroberto		;;
1007132451Sroberto	rtpc | rtpc-*)
1008132451Sroberto		basic_machine=romp-ibm
1009132451Sroberto		;;
1010132451Sroberto	s390 | s390-*)
1011132451Sroberto		basic_machine=s390-ibm
1012132451Sroberto		;;
1013132451Sroberto	s390x | s390x-*)
1014132451Sroberto		basic_machine=s390x-ibm
1015132451Sroberto		;;
1016132451Sroberto	sa29200)
1017132451Sroberto		basic_machine=a29k-amd
1018132451Sroberto		os=-udi
1019132451Sroberto		;;
1020132451Sroberto	sb1)
1021132451Sroberto		basic_machine=mipsisa64sb1-unknown
1022132451Sroberto		;;
1023132451Sroberto	sb1el)
1024132451Sroberto		basic_machine=mipsisa64sb1el-unknown
1025132451Sroberto		;;
1026290000Sglebius	sde)
1027290000Sglebius		basic_machine=mipsisa32-sde
1028290000Sglebius		os=-elf
1029290000Sglebius		;;
1030132451Sroberto	sei)
1031132451Sroberto		basic_machine=mips-sei
1032132451Sroberto		os=-seiux
1033132451Sroberto		;;
1034132451Sroberto	sequent)
1035132451Sroberto		basic_machine=i386-sequent
1036132451Sroberto		;;
1037132451Sroberto	sh)
1038132451Sroberto		basic_machine=sh-hitachi
1039132451Sroberto		os=-hms
1040132451Sroberto		;;
1041290000Sglebius	sh5el)
1042290000Sglebius		basic_machine=sh5le-unknown
1043290000Sglebius		;;
1044132451Sroberto	sh64)
1045132451Sroberto		basic_machine=sh64-unknown
1046132451Sroberto		;;
1047132451Sroberto	sparclite-wrs | simso-wrs)
1048132451Sroberto		basic_machine=sparclite-wrs
1049132451Sroberto		os=-vxworks
1050132451Sroberto		;;
1051132451Sroberto	sps7)
1052132451Sroberto		basic_machine=m68k-bull
1053132451Sroberto		os=-sysv2
1054132451Sroberto		;;
1055132451Sroberto	spur)
1056132451Sroberto		basic_machine=spur-unknown
1057132451Sroberto		;;
1058132451Sroberto	st2000)
1059132451Sroberto		basic_machine=m68k-tandem
1060132451Sroberto		;;
1061132451Sroberto	stratus)
1062132451Sroberto		basic_machine=i860-stratus
1063132451Sroberto		os=-sysv4
1064132451Sroberto		;;
1065290000Sglebius	strongarm-* | thumb-*)
1066290000Sglebius		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1067290000Sglebius		;;
1068132451Sroberto	sun2)
1069132451Sroberto		basic_machine=m68000-sun
1070132451Sroberto		;;
1071132451Sroberto	sun2os3)
1072132451Sroberto		basic_machine=m68000-sun
1073132451Sroberto		os=-sunos3
1074132451Sroberto		;;
1075132451Sroberto	sun2os4)
1076132451Sroberto		basic_machine=m68000-sun
1077132451Sroberto		os=-sunos4
1078132451Sroberto		;;
1079132451Sroberto	sun3os3)
1080132451Sroberto		basic_machine=m68k-sun
1081132451Sroberto		os=-sunos3
1082132451Sroberto		;;
1083132451Sroberto	sun3os4)
1084132451Sroberto		basic_machine=m68k-sun
1085132451Sroberto		os=-sunos4
1086132451Sroberto		;;
1087132451Sroberto	sun4os3)
1088132451Sroberto		basic_machine=sparc-sun
1089132451Sroberto		os=-sunos3
1090132451Sroberto		;;
1091132451Sroberto	sun4os4)
1092132451Sroberto		basic_machine=sparc-sun
1093132451Sroberto		os=-sunos4
1094132451Sroberto		;;
1095132451Sroberto	sun4sol2)
1096132451Sroberto		basic_machine=sparc-sun
1097132451Sroberto		os=-solaris2
1098132451Sroberto		;;
1099132451Sroberto	sun3 | sun3-*)
1100132451Sroberto		basic_machine=m68k-sun
1101132451Sroberto		;;
1102132451Sroberto	sun4)
1103132451Sroberto		basic_machine=sparc-sun
1104132451Sroberto		;;
1105132451Sroberto	sun386 | sun386i | roadrunner)
1106132451Sroberto		basic_machine=i386-sun
1107132451Sroberto		;;
1108132451Sroberto	sv1)
1109132451Sroberto		basic_machine=sv1-cray
1110132451Sroberto		os=-unicos
1111132451Sroberto		;;
1112132451Sroberto	symmetry)
1113132451Sroberto		basic_machine=i386-sequent
1114132451Sroberto		os=-dynix
1115132451Sroberto		;;
1116132451Sroberto	t3e)
1117132451Sroberto		basic_machine=alphaev5-cray
1118132451Sroberto		os=-unicos
1119132451Sroberto		;;
1120132451Sroberto	t90)
1121132451Sroberto		basic_machine=t90-cray
1122132451Sroberto		os=-unicos
1123132451Sroberto		;;
1124290000Sglebius	tile*)
1125290000Sglebius		basic_machine=$basic_machine-unknown
1126290000Sglebius		os=-linux-gnu
1127132451Sroberto		;;
1128132451Sroberto	tx39)
1129132451Sroberto		basic_machine=mipstx39-unknown
1130132451Sroberto		;;
1131132451Sroberto	tx39el)
1132132451Sroberto		basic_machine=mipstx39el-unknown
1133132451Sroberto		;;
1134132451Sroberto	toad1)
1135132451Sroberto		basic_machine=pdp10-xkl
1136132451Sroberto		os=-tops20
1137132451Sroberto		;;
1138132451Sroberto	tower | tower-32)
1139132451Sroberto		basic_machine=m68k-ncr
1140132451Sroberto		;;
1141182007Sroberto	tpf)
1142182007Sroberto		basic_machine=s390x-ibm
1143182007Sroberto		os=-tpf
1144182007Sroberto		;;
1145132451Sroberto	udi29k)
1146132451Sroberto		basic_machine=a29k-amd
1147132451Sroberto		os=-udi
1148132451Sroberto		;;
1149132451Sroberto	ultra3)
1150132451Sroberto		basic_machine=a29k-nyu
1151132451Sroberto		os=-sym1
1152132451Sroberto		;;
1153132451Sroberto	v810 | necv810)
1154132451Sroberto		basic_machine=v810-nec
1155132451Sroberto		os=-none
1156132451Sroberto		;;
1157132451Sroberto	vaxv)
1158132451Sroberto		basic_machine=vax-dec
1159132451Sroberto		os=-sysv
1160132451Sroberto		;;
1161132451Sroberto	vms)
1162132451Sroberto		basic_machine=vax-dec
1163132451Sroberto		os=-vms
1164132451Sroberto		;;
1165132451Sroberto	vpp*|vx|vx-*)
1166132451Sroberto		basic_machine=f301-fujitsu
1167132451Sroberto		;;
1168132451Sroberto	vxworks960)
1169132451Sroberto		basic_machine=i960-wrs
1170132451Sroberto		os=-vxworks
1171132451Sroberto		;;
1172132451Sroberto	vxworks68)
1173132451Sroberto		basic_machine=m68k-wrs
1174132451Sroberto		os=-vxworks
1175132451Sroberto		;;
1176132451Sroberto	vxworks29k)
1177132451Sroberto		basic_machine=a29k-wrs
1178132451Sroberto		os=-vxworks
1179132451Sroberto		;;
1180132451Sroberto	w65*)
1181132451Sroberto		basic_machine=w65-wdc
1182132451Sroberto		os=-none
1183132451Sroberto		;;
1184132451Sroberto	w89k-*)
1185132451Sroberto		basic_machine=hppa1.1-winbond
1186132451Sroberto		os=-proelf
1187132451Sroberto		;;
1188182007Sroberto	xbox)
1189182007Sroberto		basic_machine=i686-pc
1190182007Sroberto		os=-mingw32
1191182007Sroberto		;;
1192132451Sroberto	xps | xps100)
1193132451Sroberto		basic_machine=xps100-honeywell
1194132451Sroberto		;;
1195290000Sglebius	xscale-* | xscalee[bl]-*)
1196290000Sglebius		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1197290000Sglebius		;;
1198132451Sroberto	ymp)
1199132451Sroberto		basic_machine=ymp-cray
1200132451Sroberto		os=-unicos
1201132451Sroberto		;;
1202132451Sroberto	z8k-*-coff)
1203132451Sroberto		basic_machine=z8k-unknown
1204132451Sroberto		os=-sim
1205132451Sroberto		;;
1206290000Sglebius	z80-*-coff)
1207290000Sglebius		basic_machine=z80-unknown
1208290000Sglebius		os=-sim
1209290000Sglebius		;;
1210132451Sroberto	none)
1211132451Sroberto		basic_machine=none-none
1212132451Sroberto		os=-none
1213132451Sroberto		;;
1214132451Sroberto
1215132451Sroberto# Here we handle the default manufacturer of certain CPU types.  It is in
1216132451Sroberto# some cases the only manufacturer, in others, it is the most popular.
1217132451Sroberto	w89k)
1218132451Sroberto		basic_machine=hppa1.1-winbond
1219132451Sroberto		;;
1220132451Sroberto	op50n)
1221132451Sroberto		basic_machine=hppa1.1-oki
1222132451Sroberto		;;
1223132451Sroberto	op60c)
1224132451Sroberto		basic_machine=hppa1.1-oki
1225132451Sroberto		;;
1226132451Sroberto	romp)
1227132451Sroberto		basic_machine=romp-ibm
1228132451Sroberto		;;
1229182007Sroberto	mmix)
1230182007Sroberto		basic_machine=mmix-knuth
1231182007Sroberto		;;
1232132451Sroberto	rs6000)
1233132451Sroberto		basic_machine=rs6000-ibm
1234132451Sroberto		;;
1235132451Sroberto	vax)
1236132451Sroberto		basic_machine=vax-dec
1237132451Sroberto		;;
1238132451Sroberto	pdp10)
1239132451Sroberto		# there are many clones, so DEC is not a safe bet
1240132451Sroberto		basic_machine=pdp10-unknown
1241132451Sroberto		;;
1242132451Sroberto	pdp11)
1243132451Sroberto		basic_machine=pdp11-dec
1244132451Sroberto		;;
1245132451Sroberto	we32k)
1246132451Sroberto		basic_machine=we32k-att
1247132451Sroberto		;;
1248290000Sglebius	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1249132451Sroberto		basic_machine=sh-unknown
1250132451Sroberto		;;
1251290000Sglebius	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1252132451Sroberto		basic_machine=sparc-sun
1253132451Sroberto		;;
1254132451Sroberto	cydra)
1255132451Sroberto		basic_machine=cydra-cydrome
1256132451Sroberto		;;
1257132451Sroberto	orion)
1258132451Sroberto		basic_machine=orion-highlevel
1259132451Sroberto		;;
1260132451Sroberto	orion105)
1261132451Sroberto		basic_machine=clipper-highlevel
1262132451Sroberto		;;
1263132451Sroberto	mac | mpw | mac-mpw)
1264132451Sroberto		basic_machine=m68k-apple
1265132451Sroberto		;;
1266132451Sroberto	pmac | pmac-mpw)
1267132451Sroberto		basic_machine=powerpc-apple
1268132451Sroberto		;;
1269132451Sroberto	*-unknown)
1270132451Sroberto		# Make sure to match an already-canonicalized machine name.
1271132451Sroberto		;;
1272132451Sroberto	*)
1273132451Sroberto		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1274132451Sroberto		exit 1
1275132451Sroberto		;;
1276132451Srobertoesac
1277132451Sroberto
1278132451Sroberto# Here we canonicalize certain aliases for manufacturers.
1279132451Srobertocase $basic_machine in
1280132451Sroberto	*-digital*)
1281132451Sroberto		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1282132451Sroberto		;;
1283132451Sroberto	*-commodore*)
1284132451Sroberto		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1285132451Sroberto		;;
1286132451Sroberto	*)
1287132451Sroberto		;;
1288132451Srobertoesac
1289132451Sroberto
1290132451Sroberto# Decode manufacturer-specific aliases for certain operating systems.
1291132451Sroberto
1292132451Srobertoif [ x"$os" != x"" ]
1293132451Srobertothen
1294132451Srobertocase $os in
1295290000Sglebius	# First match some system type aliases
1296290000Sglebius	# that might get confused with valid system types.
1297132451Sroberto	# -solaris* is a basic system type, with this one exception.
1298290000Sglebius	-auroraux)
1299290000Sglebius		os=-auroraux
1300290000Sglebius		;;
1301132451Sroberto	-solaris1 | -solaris1.*)
1302132451Sroberto		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1303132451Sroberto		;;
1304132451Sroberto	-solaris)
1305132451Sroberto		os=-solaris2
1306132451Sroberto		;;
1307132451Sroberto	-svr4*)
1308132451Sroberto		os=-sysv4
1309132451Sroberto		;;
1310132451Sroberto	-unixware*)
1311132451Sroberto		os=-sysv4.2uw
1312132451Sroberto		;;
1313132451Sroberto	-gnu/linux*)
1314132451Sroberto		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1315132451Sroberto		;;
1316132451Sroberto	# First accept the basic system types.
1317132451Sroberto	# The portable systems comes first.
1318132451Sroberto	# Each alternative MUST END IN A *, to match a version number.
1319132451Sroberto	# -sysv* is not here because it comes later, after sysvr4.
1320132451Sroberto	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1321290000Sglebius	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1322290000Sglebius	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1323290000Sglebius	      | -sym* | -kopensolaris* \
1324132451Sroberto	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1325290000Sglebius	      | -aos* | -aros* \
1326132451Sroberto	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1327132451Sroberto	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1328290000Sglebius	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1329290000Sglebius	      | -openbsd* | -solidbsd* \
1330182007Sroberto	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1331182007Sroberto	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1332132451Sroberto	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1333132451Sroberto	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1334290000Sglebius	      | -chorusos* | -chorusrdb* | -cegcc* \
1335132451Sroberto	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1336290000Sglebius	      | -mingw32* | -linux-gnu* | -linux-android* \
1337290000Sglebius	      | -linux-newlib* | -linux-uclibc* \
1338290000Sglebius	      | -uxpv* | -beos* | -mpeix* | -udk* \
1339132451Sroberto	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1340132451Sroberto	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1341132451Sroberto	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1342132451Sroberto	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1343132451Sroberto	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1344182007Sroberto	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1345290000Sglebius	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1346132451Sroberto	# Remember, each alternative MUST END IN *, to match a version number.
1347132451Sroberto		;;
1348132451Sroberto	-qnx*)
1349132451Sroberto		case $basic_machine in
1350132451Sroberto		    x86-* | i*86-*)
1351132451Sroberto			;;
1352132451Sroberto		    *)
1353132451Sroberto			os=-nto$os
1354132451Sroberto			;;
1355132451Sroberto		esac
1356132451Sroberto		;;
1357132451Sroberto	-nto-qnx*)
1358132451Sroberto		;;
1359132451Sroberto	-nto*)
1360132451Sroberto		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1361132451Sroberto		;;
1362132451Sroberto	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1363182007Sroberto	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1364132451Sroberto	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1365132451Sroberto		;;
1366132451Sroberto	-mac*)
1367132451Sroberto		os=`echo $os | sed -e 's|mac|macos|'`
1368132451Sroberto		;;
1369182007Sroberto	-linux-dietlibc)
1370182007Sroberto		os=-linux-dietlibc
1371182007Sroberto		;;
1372132451Sroberto	-linux*)
1373132451Sroberto		os=`echo $os | sed -e 's|linux|linux-gnu|'`
1374132451Sroberto		;;
1375132451Sroberto	-sunos5*)
1376132451Sroberto		os=`echo $os | sed -e 's|sunos5|solaris2|'`
1377132451Sroberto		;;
1378132451Sroberto	-sunos6*)
1379132451Sroberto		os=`echo $os | sed -e 's|sunos6|solaris3|'`
1380132451Sroberto		;;
1381132451Sroberto	-opened*)
1382132451Sroberto		os=-openedition
1383132451Sroberto		;;
1384290000Sglebius	-os400*)
1385182007Sroberto		os=-os400
1386182007Sroberto		;;
1387132451Sroberto	-wince*)
1388132451Sroberto		os=-wince
1389132451Sroberto		;;
1390132451Sroberto	-osfrose*)
1391132451Sroberto		os=-osfrose
1392132451Sroberto		;;
1393132451Sroberto	-osf*)
1394132451Sroberto		os=-osf
1395132451Sroberto		;;
1396132451Sroberto	-utek*)
1397132451Sroberto		os=-bsd
1398132451Sroberto		;;
1399132451Sroberto	-dynix*)
1400132451Sroberto		os=-bsd
1401132451Sroberto		;;
1402132451Sroberto	-acis*)
1403132451Sroberto		os=-aos
1404132451Sroberto		;;
1405132451Sroberto	-atheos*)
1406132451Sroberto		os=-atheos
1407132451Sroberto		;;
1408182007Sroberto	-syllable*)
1409182007Sroberto		os=-syllable
1410182007Sroberto		;;
1411132451Sroberto	-386bsd)
1412132451Sroberto		os=-bsd
1413132451Sroberto		;;
1414132451Sroberto	-ctix* | -uts*)
1415132451Sroberto		os=-sysv
1416132451Sroberto		;;
1417132451Sroberto	-nova*)
1418132451Sroberto		os=-rtmk-nova
1419132451Sroberto		;;
1420132451Sroberto	-ns2 )
1421132451Sroberto		os=-nextstep2
1422132451Sroberto		;;
1423132451Sroberto	-nsk*)
1424132451Sroberto		os=-nsk
1425132451Sroberto		;;
1426132451Sroberto	# Preserve the version number of sinix5.
1427132451Sroberto	-sinix5.*)
1428132451Sroberto		os=`echo $os | sed -e 's|sinix|sysv|'`
1429132451Sroberto		;;
1430132451Sroberto	-sinix*)
1431132451Sroberto		os=-sysv4
1432132451Sroberto		;;
1433290000Sglebius	-tpf*)
1434182007Sroberto		os=-tpf
1435182007Sroberto		;;
1436132451Sroberto	-triton*)
1437132451Sroberto		os=-sysv3
1438132451Sroberto		;;
1439132451Sroberto	-oss*)
1440132451Sroberto		os=-sysv3
1441132451Sroberto		;;
1442132451Sroberto	-svr4)
1443132451Sroberto		os=-sysv4
1444132451Sroberto		;;
1445132451Sroberto	-svr3)
1446132451Sroberto		os=-sysv3
1447132451Sroberto		;;
1448132451Sroberto	-sysvr4)
1449132451Sroberto		os=-sysv4
1450132451Sroberto		;;
1451132451Sroberto	# This must come after -sysvr4.
1452132451Sroberto	-sysv*)
1453132451Sroberto		;;
1454132451Sroberto	-ose*)
1455132451Sroberto		os=-ose
1456132451Sroberto		;;
1457132451Sroberto	-es1800*)
1458132451Sroberto		os=-ose
1459132451Sroberto		;;
1460132451Sroberto	-xenix)
1461132451Sroberto		os=-xenix
1462132451Sroberto		;;
1463132451Sroberto	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1464132451Sroberto		os=-mint
1465132451Sroberto		;;
1466132451Sroberto	-aros*)
1467132451Sroberto		os=-aros
1468132451Sroberto		;;
1469132451Sroberto	-kaos*)
1470132451Sroberto		os=-kaos
1471132451Sroberto		;;
1472182007Sroberto	-zvmoe)
1473182007Sroberto		os=-zvmoe
1474182007Sroberto		;;
1475290000Sglebius	-dicos*)
1476290000Sglebius		os=-dicos
1477290000Sglebius		;;
1478290000Sglebius	-nacl*)
1479290000Sglebius		;;
1480132451Sroberto	-none)
1481132451Sroberto		;;
1482132451Sroberto	*)
1483132451Sroberto		# Get rid of the `-' at the beginning of $os.
1484132451Sroberto		os=`echo $os | sed 's/[^-]*-//'`
1485132451Sroberto		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1486132451Sroberto		exit 1
1487132451Sroberto		;;
1488132451Srobertoesac
1489132451Srobertoelse
1490132451Sroberto
1491132451Sroberto# Here we handle the default operating systems that come with various machines.
1492132451Sroberto# The value should be what the vendor currently ships out the door with their
1493132451Sroberto# machine or put another way, the most popular os provided with the machine.
1494132451Sroberto
1495132451Sroberto# Note that if you're going to try to match "-MANUFACTURER" here (say,
1496132451Sroberto# "-sun"), then you have to tell the case statement up towards the top
1497132451Sroberto# that MANUFACTURER isn't an operating system.  Otherwise, code above
1498132451Sroberto# will signal an error saying that MANUFACTURER isn't an operating
1499132451Sroberto# system, and we'll never get to this point.
1500132451Sroberto
1501132451Srobertocase $basic_machine in
1502290000Sglebius	score-*)
1503290000Sglebius		os=-elf
1504290000Sglebius		;;
1505290000Sglebius	spu-*)
1506290000Sglebius		os=-elf
1507290000Sglebius		;;
1508132451Sroberto	*-acorn)
1509132451Sroberto		os=-riscix1.2
1510132451Sroberto		;;
1511132451Sroberto	arm*-rebel)
1512132451Sroberto		os=-linux
1513132451Sroberto		;;
1514132451Sroberto	arm*-semi)
1515132451Sroberto		os=-aout
1516132451Sroberto		;;
1517290000Sglebius	c4x-* | tic4x-*)
1518290000Sglebius		os=-coff
1519290000Sglebius		;;
1520290000Sglebius	tic54x-*)
1521290000Sglebius		os=-coff
1522290000Sglebius		;;
1523290000Sglebius	tic55x-*)
1524290000Sglebius		os=-coff
1525290000Sglebius		;;
1526290000Sglebius	tic6x-*)
1527290000Sglebius		os=-coff
1528290000Sglebius		;;
1529132451Sroberto	# This must come before the *-dec entry.
1530132451Sroberto	pdp10-*)
1531132451Sroberto		os=-tops20
1532132451Sroberto		;;
1533132451Sroberto	pdp11-*)
1534132451Sroberto		os=-none
1535132451Sroberto		;;
1536132451Sroberto	*-dec | vax-*)
1537132451Sroberto		os=-ultrix4.2
1538132451Sroberto		;;
1539132451Sroberto	m68*-apollo)
1540132451Sroberto		os=-domain
1541132451Sroberto		;;
1542132451Sroberto	i386-sun)
1543132451Sroberto		os=-sunos4.0.2
1544132451Sroberto		;;
1545132451Sroberto	m68000-sun)
1546132451Sroberto		os=-sunos3
1547132451Sroberto		# This also exists in the configure program, but was not the
1548132451Sroberto		# default.
1549132451Sroberto		# os=-sunos4
1550132451Sroberto		;;
1551132451Sroberto	m68*-cisco)
1552132451Sroberto		os=-aout
1553132451Sroberto		;;
1554290000Sglebius	mep-*)
1555290000Sglebius		os=-elf
1556290000Sglebius		;;
1557132451Sroberto	mips*-cisco)
1558132451Sroberto		os=-elf
1559132451Sroberto		;;
1560132451Sroberto	mips*-*)
1561132451Sroberto		os=-elf
1562132451Sroberto		;;
1563132451Sroberto	or32-*)
1564132451Sroberto		os=-coff
1565132451Sroberto		;;
1566132451Sroberto	*-tti)	# must be before sparc entry or we get the wrong os.
1567132451Sroberto		os=-sysv3
1568132451Sroberto		;;
1569132451Sroberto	sparc-* | *-sun)
1570132451Sroberto		os=-sunos4.1.1
1571132451Sroberto		;;
1572132451Sroberto	*-be)
1573132451Sroberto		os=-beos
1574132451Sroberto		;;
1575182007Sroberto	*-haiku)
1576182007Sroberto		os=-haiku
1577182007Sroberto		;;
1578132451Sroberto	*-ibm)
1579132451Sroberto		os=-aix
1580132451Sroberto		;;
1581290000Sglebius	*-knuth)
1582182007Sroberto		os=-mmixware
1583182007Sroberto		;;
1584132451Sroberto	*-wec)
1585132451Sroberto		os=-proelf
1586132451Sroberto		;;
1587132451Sroberto	*-winbond)
1588132451Sroberto		os=-proelf
1589132451Sroberto		;;
1590132451Sroberto	*-oki)
1591132451Sroberto		os=-proelf
1592132451Sroberto		;;
1593132451Sroberto	*-hp)
1594132451Sroberto		os=-hpux
1595132451Sroberto		;;
1596132451Sroberto	*-hitachi)
1597132451Sroberto		os=-hiux
1598132451Sroberto		;;
1599132451Sroberto	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1600132451Sroberto		os=-sysv
1601132451Sroberto		;;
1602132451Sroberto	*-cbm)
1603132451Sroberto		os=-amigaos
1604132451Sroberto		;;
1605132451Sroberto	*-dg)
1606132451Sroberto		os=-dgux
1607132451Sroberto		;;
1608132451Sroberto	*-dolphin)
1609132451Sroberto		os=-sysv3
1610132451Sroberto		;;
1611132451Sroberto	m68k-ccur)
1612132451Sroberto		os=-rtu
1613132451Sroberto		;;
1614132451Sroberto	m88k-omron*)
1615132451Sroberto		os=-luna
1616132451Sroberto		;;
1617132451Sroberto	*-next )
1618132451Sroberto		os=-nextstep
1619132451Sroberto		;;
1620132451Sroberto	*-sequent)
1621132451Sroberto		os=-ptx
1622132451Sroberto		;;
1623132451Sroberto	*-crds)
1624132451Sroberto		os=-unos
1625132451Sroberto		;;
1626132451Sroberto	*-ns)
1627132451Sroberto		os=-genix
1628132451Sroberto		;;
1629132451Sroberto	i370-*)
1630132451Sroberto		os=-mvs
1631132451Sroberto		;;
1632132451Sroberto	*-next)
1633132451Sroberto		os=-nextstep3
1634132451Sroberto		;;
1635132451Sroberto	*-gould)
1636132451Sroberto		os=-sysv
1637132451Sroberto		;;
1638132451Sroberto	*-highlevel)
1639132451Sroberto		os=-bsd
1640132451Sroberto		;;
1641132451Sroberto	*-encore)
1642132451Sroberto		os=-bsd
1643132451Sroberto		;;
1644132451Sroberto	*-sgi)
1645132451Sroberto		os=-irix
1646132451Sroberto		;;
1647132451Sroberto	*-siemens)
1648132451Sroberto		os=-sysv4
1649132451Sroberto		;;
1650132451Sroberto	*-masscomp)
1651132451Sroberto		os=-rtu
1652132451Sroberto		;;
1653132451Sroberto	f30[01]-fujitsu | f700-fujitsu)
1654132451Sroberto		os=-uxpv
1655132451Sroberto		;;
1656132451Sroberto	*-rom68k)
1657132451Sroberto		os=-coff
1658132451Sroberto		;;
1659132451Sroberto	*-*bug)
1660132451Sroberto		os=-coff
1661132451Sroberto		;;
1662132451Sroberto	*-apple)
1663132451Sroberto		os=-macos
1664132451Sroberto		;;
1665132451Sroberto	*-atari*)
1666132451Sroberto		os=-mint
1667132451Sroberto		;;
1668132451Sroberto	*)
1669132451Sroberto		os=-none
1670132451Sroberto		;;
1671132451Srobertoesac
1672132451Srobertofi
1673132451Sroberto
1674132451Sroberto# Here we handle the case where we know the os, and the CPU type, but not the
1675132451Sroberto# manufacturer.  We pick the logical manufacturer.
1676132451Srobertovendor=unknown
1677132451Srobertocase $basic_machine in
1678132451Sroberto	*-unknown)
1679132451Sroberto		case $os in
1680132451Sroberto			-riscix*)
1681132451Sroberto				vendor=acorn
1682132451Sroberto				;;
1683132451Sroberto			-sunos*)
1684132451Sroberto				vendor=sun
1685132451Sroberto				;;
1686290000Sglebius			-cnk*|-aix*)
1687132451Sroberto				vendor=ibm
1688132451Sroberto				;;
1689132451Sroberto			-beos*)
1690132451Sroberto				vendor=be
1691132451Sroberto				;;
1692132451Sroberto			-hpux*)
1693132451Sroberto				vendor=hp
1694132451Sroberto				;;
1695132451Sroberto			-mpeix*)
1696132451Sroberto				vendor=hp
1697132451Sroberto				;;
1698132451Sroberto			-hiux*)
1699132451Sroberto				vendor=hitachi
1700132451Sroberto				;;
1701132451Sroberto			-unos*)
1702132451Sroberto				vendor=crds
1703132451Sroberto				;;
1704132451Sroberto			-dgux*)
1705132451Sroberto				vendor=dg
1706132451Sroberto				;;
1707132451Sroberto			-luna*)
1708132451Sroberto				vendor=omron
1709132451Sroberto				;;
1710132451Sroberto			-genix*)
1711132451Sroberto				vendor=ns
1712132451Sroberto				;;
1713132451Sroberto			-mvs* | -opened*)
1714132451Sroberto				vendor=ibm
1715132451Sroberto				;;
1716182007Sroberto			-os400*)
1717182007Sroberto				vendor=ibm
1718182007Sroberto				;;
1719132451Sroberto			-ptx*)
1720132451Sroberto				vendor=sequent
1721132451Sroberto				;;
1722182007Sroberto			-tpf*)
1723182007Sroberto				vendor=ibm
1724182007Sroberto				;;
1725132451Sroberto			-vxsim* | -vxworks* | -windiss*)
1726132451Sroberto				vendor=wrs
1727132451Sroberto				;;
1728132451Sroberto			-aux*)
1729132451Sroberto				vendor=apple
1730132451Sroberto				;;
1731132451Sroberto			-hms*)
1732132451Sroberto				vendor=hitachi
1733132451Sroberto				;;
1734132451Sroberto			-mpw* | -macos*)
1735132451Sroberto				vendor=apple
1736132451Sroberto				;;
1737132451Sroberto			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1738132451Sroberto				vendor=atari
1739132451Sroberto				;;
1740132451Sroberto			-vos*)
1741132451Sroberto				vendor=stratus
1742132451Sroberto				;;
1743132451Sroberto		esac
1744132451Sroberto		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1745132451Sroberto		;;
1746132451Srobertoesac
1747132451Sroberto
1748132451Srobertoecho $basic_machine$os
1749182007Srobertoexit
1750132451Sroberto
1751132451Sroberto# Local variables:
1752132451Sroberto# eval: (add-hook 'write-file-hooks 'time-stamp)
1753132451Sroberto# time-stamp-start: "timestamp='"
1754132451Sroberto# time-stamp-format: "%:y-%02m-%02d"
1755132451Sroberto# time-stamp-end: "'"
1756132451Sroberto# End:
1757