config.sub revision 214478
1132718Skan#! /bin/sh
2169689Skan# Configuration validation subroutine script.
3132718Skan#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4132718Skan#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5132718Skan#   Free Software Foundation, Inc.
6132718Skan
7132718Skantimestamp='2009-12-31'
8132718Skan
9132718Skan# This file is (in principle) common to ALL GNU software.
10132718Skan# The presence of a machine in this file suggests that SOME GNU software
11132718Skan# can handle that machine.  It does not imply ALL GNU software can.
12132718Skan#
13132718Skan# This file is free software; you can redistribute it and/or modify
14132718Skan# it under the terms of the GNU General Public License as published by
15132718Skan# the Free Software Foundation; either version 2 of the License, or
16132718Skan# (at your option) any later version.
17132718Skan#
18169689Skan# This program is distributed in the hope that it will be useful,
19169689Skan# but WITHOUT ANY WARRANTY; without even the implied warranty of
20132718Skan# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21132718Skan# GNU General Public License for more details.
22132718Skan#
23132718Skan# You should have received a copy of the GNU General Public License
24132718Skan# along with this program; if not, write to the Free Software
25132718Skan# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26132718Skan# 02110-1301, USA.
27169689Skan#
28132718Skan# As a special exception to the GNU General Public License, if you
29132718Skan# distribute this file as part of a program that contains a
30132718Skan# configuration script generated by Autoconf, you may include it under
31132718Skan# the same distribution terms that you use for the rest of that program.
32132718Skan
33132718Skan
34132718Skan# Please send patches to <config-patches@gnu.org>.  Submit a context
35132718Skan# diff and a properly formatted GNU ChangeLog entry.
36132718Skan#
37132718Skan# Configuration subroutine to validate and canonicalize a configuration type.
38132718Skan# Supply the specified configuration type as an argument.
39132718Skan# If it is invalid, we print an error message on stderr and exit with code 1.
40132718Skan# Otherwise, we print the canonical config type on stdout and succeed.
41132718Skan
42132718Skan# You can get the latest version of this script from:
43132718Skan# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44132718Skan
45132718Skan# This file is supposed to be the same for all GNU packages
46132718Skan# and recognize all the CPU types, system types and aliases
47132718Skan# that are meaningful with *any* GNU software.
48132718Skan# Each package is responsible for reporting which valid configurations
49132718Skan# it does not support.  The user should be able to distinguish
50132718Skan# a failure to support a valid configuration from a meaningless
51132718Skan# configuration.
52132718Skan
53132718Skan# The goal of this file is to map all the various variations of a given
54132718Skan# machine specification into a single specification in the form:
55132718Skan#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
56132718Skan# or in some cases, the newer four-part form:
57132718Skan#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
58132718Skan# It is wrong to echo any other type of specification.
59132718Skan
60132718Skanme=`echo "$0" | sed -e 's,.*/,,'`
61132718Skan
62132718Skanusage="\
63132718SkanUsage: $0 [OPTION] CPU-MFR-OPSYS
64132718Skan       $0 [OPTION] ALIAS
65132718Skan
66132718SkanCanonicalize a configuration name.
67132718Skan
68132718SkanOperation modes:
69132718Skan  -h, --help         print this help, then exit
70132718Skan  -t, --time-stamp   print date of last modification, then exit
71132718Skan  -v, --version      print version number, then exit
72132718Skan
73132718SkanReport bugs and patches to <config-patches@gnu.org>."
74132718Skan
75132718Skanversion="\
76132718SkanGNU config.sub ($timestamp)
77132718Skan
78132718SkanCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79132718Skan2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80132718SkanSoftware Foundation, Inc.
81132718Skan
82132718SkanThis is free software; see the source for copying conditions.  There is NO
83169689Skanwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84132718Skan
85169689Skanhelp="
86132718SkanTry \`$me --help' for more information."
87169689Skan
88169689Skan# Parse command line
89169689Skanwhile test $# -gt 0 ; do
90169689Skan  case $1 in
91169689Skan    --time-stamp | --time* | -t )
92169689Skan       echo "$timestamp" ; exit ;;
93169689Skan    --version | -v )
94169689Skan       echo "$version" ; exit ;;
95169689Skan    --help | --h* | -h )
96169689Skan       echo "$usage"; exit ;;
97169689Skan    -- )     # Stop option processing
98169689Skan       shift; break ;;
99169689Skan    - )	# Use stdin as input.
100169689Skan       break ;;
101169689Skan    -* )
102169689Skan       echo "$me: invalid option $1$help"
103169689Skan       exit 1 ;;
104169689Skan
105169689Skan    *local*)
106169689Skan       # First pass through any local machine types.
107169689Skan       echo $1
108169689Skan       exit ;;
109169689Skan
110169689Skan    * )
111169689Skan       break ;;
112169689Skan  esac
113169689Skandone
114169689Skan
115169689Skancase $# in
116169689Skan 0) echo "$me: missing argument$help" >&2
117169689Skan    exit 1;;
118169689Skan 1) ;;
119169689Skan *) echo "$me: too many arguments$help" >&2
120169689Skan    exit 1;;
121169689Skanesac
122169689Skan
123169689Skan# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124169689Skan# Here we must recognize all the valid KERNEL-OS combinations.
125169689Skanmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126169689Skancase $maybe_os in
127169689Skan  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
128169689Skan  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
129169689Skan  kopensolaris*-gnu* | \
130169689Skan  storm-chaos* | os2-emx* | rtmk-nova*)
131169689Skan    os=-$maybe_os
132169689Skan    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
133169689Skan    ;;
134169689Skan  *)
135169689Skan    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
136169689Skan    if [ $basic_machine != $1 ]
137169689Skan    then os=`echo $1 | sed 's/.*-/-/'`
138132718Skan    else os=; fi
139132718Skan    ;;
140132718Skanesac
141132718Skan
142132718Skan### Let's recognize common machines as not being operating systems so
143132718Skan### that things like config.sub decstation-3100 work.  We also
144132718Skan### recognize some manufacturers as not being operating systems, so we
145132718Skan### can provide default operating systems below.
146132718Skancase $os in
147132718Skan	-sun*os*)
148132718Skan		# Prevent following clause from handling this invalid input.
149132718Skan		;;
150132718Skan	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
151132718Skan	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
152132718Skan	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
153132718Skan	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
154132718Skan	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
155132718Skan	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
156132718Skan	-apple | -axis | -knuth | -cray | -microblaze)
157132718Skan		os=
158132718Skan		basic_machine=$1
159132718Skan		;;
160132718Skan        -bluegene*)
161132718Skan	        os=-cnk
162132718Skan		;;
163132718Skan	-sim | -cisco | -oki | -wec | -winbond)
164169689Skan		os=
165169689Skan		basic_machine=$1
166132718Skan		;;
167132718Skan	-scout)
168132718Skan		;;
169169689Skan	-wrs)
170169689Skan		os=-vxworks
171169689Skan		basic_machine=$1
172169689Skan		;;
173169689Skan	-chorusos*)
174132718Skan		os=-chorusos
175169689Skan		basic_machine=$1
176169689Skan		;;
177132718Skan 	-chorusrdb)
178169689Skan 		os=-chorusrdb
179132718Skan		basic_machine=$1
180132718Skan 		;;
181169689Skan	-hiux*)
182169689Skan		os=-hiuxwe2
183132718Skan		;;
184169689Skan	-sco6)
185132718Skan		os=-sco5v6
186132718Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187169689Skan		;;
188169689Skan	-sco5)
189169689Skan		os=-sco3.2v5
190132718Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191132718Skan		;;
192132718Skan	-sco4)
193132718Skan		os=-sco3.2v4
194169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195132718Skan		;;
196169689Skan	-sco3.2.[4-9]*)
197169689Skan		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
198132718Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199169689Skan		;;
200132718Skan	-sco3.2v[4-9]*)
201169689Skan		# Don't forget version if it is 3.2v4 or newer.
202169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203169689Skan		;;
204132718Skan	-sco5v6*)
205169689Skan		# Don't forget version if it is 3.2v4 or newer.
206169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207169689Skan		;;
208169689Skan	-sco*)
209169689Skan		os=-sco3.2v2
210169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211169689Skan		;;
212169689Skan	-udk*)
213169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
214169689Skan		;;
215169689Skan	-isc)
216169689Skan		os=-isc2.2
217169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
218169689Skan		;;
219169689Skan	-clix*)
220169689Skan		basic_machine=clipper-intergraph
221169689Skan		;;
222169689Skan	-isc*)
223169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
224169689Skan		;;
225169689Skan	-lynx*)
226169689Skan		os=-lynxos
227169689Skan		;;
228169689Skan	-ptx*)
229169689Skan		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
230169689Skan		;;
231169689Skan	-windowsnt*)
232169689Skan		os=`echo $os | sed -e 's/windowsnt/winnt/'`
233169689Skan		;;
234169689Skan	-psos*)
235169689Skan		os=-psos
236169689Skan		;;
237169689Skan	-mint | -mint[0-9]*)
238169689Skan		basic_machine=m68k-atari
239169689Skan		os=-mint
240169689Skan		;;
241132718Skanesac
242132718Skan
243132718Skan# Decode aliases for certain CPU-COMPANY combinations.
244169689Skancase $basic_machine in
245132718Skan	# Recognize the basic CPU types without company name.
246132718Skan	# Some are omitted here because they have special meanings below.
247132718Skan	1750a | 580 \
248132718Skan	| a29k \
249132718Skan	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
250132718Skan	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
251132718Skan	| am33_2.0 \
252132718Skan	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
253132718Skan	| bfin \
254132718Skan	| c4x | clipper \
255132718Skan	| d10v | d30v | dlx | dsp16xx \
256132718Skan	| fido | fr30 | frv \
257132718Skan	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
258132718Skan	| i370 | i860 | i960 | ia64 \
259132718Skan	| ip2k | iq2000 \
260132718Skan	| lm32 \
261132718Skan	| m32c | m32r | m32rle | m68000 | m68k | m88k \
262132718Skan	| maxq | mb | microblaze | mcore | mep | metag \
263132718Skan	| mips | mipsbe | mipseb | mipsel | mipsle \
264132718Skan	| mips16 \
265169689Skan	| mips64 | mips64el \
266132718Skan	| mips64octeon | mips64octeonel \
267132718Skan	| mips64orion | mips64orionel \
268169689Skan	| mips64r5900 | mips64r5900el \
269132718Skan	| mips64vr | mips64vrel \
270132718Skan	| mips64vr4100 | mips64vr4100el \
271132718Skan	| mips64vr4300 | mips64vr4300el \
272132718Skan	| mips64vr5000 | mips64vr5000el \
273132718Skan	| mips64vr5900 | mips64vr5900el \
274132718Skan	| mipsisa32 | mipsisa32el \
275169689Skan	| mipsisa32r2 | mipsisa32r2el \
276169689Skan	| mipsisa64 | mipsisa64el \
277132718Skan	| mipsisa64r2 | mipsisa64r2el \
278132718Skan	| mipsisa64sb1 | mipsisa64sb1el \
279132718Skan	| mipsisa64sr71k | mipsisa64sr71kel \
280132718Skan	| mipstx39 | mipstx39el \
281132718Skan	| mn10200 | mn10300 \
282132718Skan	| moxie \
283169689Skan	| mt \
284169689Skan	| msp430 \
285132718Skan	| nios | nios2 \
286132718Skan	| ns16k | ns32k \
287132718Skan	| or32 \
288132718Skan	| pdp10 | pdp11 | pj | pjl \
289132718Skan	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
290132718Skan	| pyramid \
291169689Skan	| rx \
292169689Skan	| score \
293132718Skan	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
294132718Skan	| sh64 | sh64le \
295132718Skan	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
296132718Skan	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
297132718Skan	| spu | strongarm \
298132718Skan	| tahoe | thumb | tic4x | tic80 | tron \
299169689Skan	| ubicom32 \
300169689Skan	| v850 | v850e \
301132718Skan	| we32k \
302132718Skan	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
303132718Skan	| z8k | z80)
304132718Skan		basic_machine=$basic_machine-unknown
305132718Skan		;;
306132718Skan	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
307169689Skan		# Motorola 68HC11/12.
308169689Skan		basic_machine=$basic_machine-unknown
309132718Skan		os=-none
310132718Skan		;;
311132718Skan	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
312132718Skan		;;
313132718Skan	ms1)
314132718Skan		basic_machine=mt-unknown
315169689Skan		;;
316169689Skan
317132718Skan	# We use `pc' rather than `unknown'
318132718Skan	# because (1) that's what they normally are, and
319132718Skan	# (2) the word "unknown" tends to confuse beginning users.
320132718Skan	i*86 | x86_64)
321132718Skan	  basic_machine=$basic_machine-pc
322132718Skan	  ;;
323169689Skan	# Object if more than one company name word.
324132718Skan	*-*-*)
325132718Skan		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
326132718Skan		exit 1
327169689Skan		;;
328132718Skan	# Recognize the basic CPU types with company name.
329169689Skan	580-* \
330132718Skan	| a29k-* \
331132718Skan	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
332132718Skan	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
333132718Skan	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
334132718Skan	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
335132718Skan	| avr-* | avr32-* \
336132718Skan	| bfin-* | bs2000-* \
337132718Skan	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
338169689Skan	| clipper-* | craynv-* | cydra-* \
339169689Skan	| d10v-* | d30v-* | dlx-* \
340169689Skan	| elxsi-* \
341169689Skan	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
342169689Skan	| h8300-* | h8500-* \
343169689Skan	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
344132718Skan	| i*86-* | i860-* | i960-* | ia64-* \
345169689Skan	| ip2k-* | iq2000-* \
346169689Skan	| lm32-* \
347169689Skan	| m32c-* | m32r-* | m32rle-* \
348132718Skan	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
349132718Skan	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
350169689Skan	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
351132718Skan	| mips16-* \
352132718Skan	| mips64-* | mips64el-* \
353169689Skan	| mips64octeon-* | mips64octeonel-* \
354132718Skan	| mips64orion-* | mips64orionel-* \
355132718Skan	| mips64r5900-* | mips64r5900el-* \
356132718Skan	| mips64vr-* | mips64vrel-* \
357132718Skan	| mips64vr4100-* | mips64vr4100el-* \
358169689Skan	| mips64vr4300-* | mips64vr4300el-* \
359132718Skan	| mips64vr5000-* | mips64vr5000el-* \
360132718Skan	| mips64vr5900-* | mips64vr5900el-* \
361169689Skan	| mipsisa32-* | mipsisa32el-* \
362132718Skan	| mipsisa32r2-* | mipsisa32r2el-* \
363132718Skan	| mipsisa64-* | mipsisa64el-* \
364132718Skan	| mipsisa64r2-* | mipsisa64r2el-* \
365132718Skan	| mipsisa64sb1-* | mipsisa64sb1el-* \
366132718Skan	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
367132718Skan	| mipstx39-* | mipstx39el-* \
368132718Skan	| mmix-* \
369132718Skan	| mt-* \
370132718Skan	| msp430-* \
371132718Skan	| nios-* | nios2-* \
372132718Skan	| none-* | np1-* | ns16k-* | ns32k-* \
373132718Skan	| orion-* \
374132718Skan	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
375169689Skan	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
376169689Skan	| pyramid-* \
377132718Skan	| romp-* | rs6000-* | rx-* \
378132718Skan	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
379169689Skan	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
380169689Skan	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
381132718Skan	| sparclite-* \
382132718Skan	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
383169689Skan	| tahoe-* | thumb-* \
384169689Skan	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
385132718Skan	| tron-* \
386132718Skan	| ubicom32-* \
387132718Skan	| v850-* | v850e-* | vax-* \
388132718Skan	| we32k-* \
389169689Skan	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
390169689Skan	| xstormy16-* | xtensa*-* \
391132718Skan	| ymp-* \
392132718Skan	| z8k-* | z80-*)
393132718Skan		;;
394132718Skan	# Recognize the basic CPU types without company name, with glob match.
395169689Skan	xtensa*)
396169689Skan		basic_machine=$basic_machine-unknown
397169689Skan		;;
398169689Skan	# Recognize the various machine names and aliases which stand
399169689Skan	# for a CPU type and a company and sometimes even an OS.
400132718Skan	386bsd)
401169689Skan		basic_machine=i386-unknown
402169689Skan		os=-bsd
403132718Skan		;;
404169689Skan	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
405169689Skan		basic_machine=m68000-att
406132718Skan		;;
407132718Skan	3b*)
408169689Skan		basic_machine=we32k-att
409169689Skan		;;
410132718Skan	a29khif)
411132718Skan		basic_machine=a29k-amd
412169689Skan		os=-udi
413169689Skan		;;
414169689Skan    	abacus)
415169689Skan		basic_machine=abacus-unknown
416169689Skan		;;
417169689Skan	adobe68k)
418132718Skan		basic_machine=m68010-adobe
419132718Skan		os=-scout
420132718Skan		;;
421132718Skan	alliant | fx80)
422132718Skan		basic_machine=fx80-alliant
423132718Skan		;;
424132718Skan	altos | altos3068)
425132718Skan		basic_machine=m68k-altos
426132718Skan		;;
427132718Skan	am29k)
428169689Skan		basic_machine=a29k-none
429169689Skan		os=-bsd
430169689Skan		;;
431169689Skan	amd64)
432169689Skan		basic_machine=x86_64-pc
433132718Skan		;;
434132718Skan	amd64-*)
435132718Skan		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
436169689Skan		;;
437169689Skan	amdahl)
438169689Skan		basic_machine=580-amdahl
439169689Skan		os=-sysv
440132718Skan		;;
441169689Skan	amiga | amiga-*)
442169689Skan		basic_machine=m68k-unknown
443169689Skan		;;
444169689Skan	amigaos | amigados)
445169689Skan		basic_machine=m68k-unknown
446169689Skan		os=-amigaos
447169689Skan		;;
448169689Skan	amigaunix | amix)
449169689Skan		basic_machine=m68k-unknown
450169689Skan		os=-sysv4
451169689Skan		;;
452169689Skan	apollo68)
453169689Skan		basic_machine=m68k-apollo
454169689Skan		os=-sysv
455132718Skan		;;
456132718Skan	apollo68bsd)
457132718Skan		basic_machine=m68k-apollo
458169689Skan		os=-bsd
459169689Skan		;;
460132718Skan	aros)
461132718Skan		basic_machine=i386-pc
462132718Skan		os=-aros
463132718Skan		;;
464169689Skan	aux)
465169689Skan		basic_machine=m68k-apple
466132718Skan		os=-aux
467132718Skan		;;
468132718Skan	balance)
469132718Skan		basic_machine=ns32k-sequent
470169689Skan		os=-dynix
471169689Skan		;;
472132718Skan	blackfin)
473169689Skan		basic_machine=bfin-unknown
474169689Skan		os=-linux
475169689Skan		;;
476132718Skan	blackfin-*)
477132718Skan		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
478132718Skan		os=-linux
479132718Skan		;;
480132718Skan	bluegene*)
481132718Skan		basic_machine=powerpc-ibm
482132718Skan		os=-cnk
483132718Skan		;;
484132718Skan	c90)
485132718Skan		basic_machine=c90-cray
486132718Skan		os=-unicos
487132718Skan		;;
488        cegcc)
489		basic_machine=arm-unknown
490		os=-cegcc
491		;;
492	convex-c1)
493		basic_machine=c1-convex
494		os=-bsd
495		;;
496	convex-c2)
497		basic_machine=c2-convex
498		os=-bsd
499		;;
500	convex-c32)
501		basic_machine=c32-convex
502		os=-bsd
503		;;
504	convex-c34)
505		basic_machine=c34-convex
506		os=-bsd
507		;;
508	convex-c38)
509		basic_machine=c38-convex
510		os=-bsd
511		;;
512	cray | j90)
513		basic_machine=j90-cray
514		os=-unicos
515		;;
516	craynv)
517		basic_machine=craynv-cray
518		os=-unicosmp
519		;;
520	cr16)
521		basic_machine=cr16-unknown
522		os=-elf
523		;;
524	crds | unos)
525		basic_machine=m68k-crds
526		;;
527	crisv32 | crisv32-* | etraxfs*)
528		basic_machine=crisv32-axis
529		;;
530	cris | cris-* | etrax*)
531		basic_machine=cris-axis
532		;;
533	crx)
534		basic_machine=crx-unknown
535		os=-elf
536		;;
537	da30 | da30-*)
538		basic_machine=m68k-da30
539		;;
540	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
541		basic_machine=mips-dec
542		;;
543	decsystem10* | dec10*)
544		basic_machine=pdp10-dec
545		os=-tops10
546		;;
547	decsystem20* | dec20*)
548		basic_machine=pdp10-dec
549		os=-tops20
550		;;
551	delta | 3300 | motorola-3300 | motorola-delta \
552	      | 3300-motorola | delta-motorola)
553		basic_machine=m68k-motorola
554		;;
555	delta88)
556		basic_machine=m88k-motorola
557		os=-sysv3
558		;;
559	dicos)
560		basic_machine=i686-pc
561		os=-dicos
562		;;
563	djgpp)
564		basic_machine=i586-pc
565		os=-msdosdjgpp
566		;;
567	dpx20 | dpx20-*)
568		basic_machine=rs6000-bull
569		os=-bosx
570		;;
571	dpx2* | dpx2*-bull)
572		basic_machine=m68k-bull
573		os=-sysv3
574		;;
575	ebmon29k)
576		basic_machine=a29k-amd
577		os=-ebmon
578		;;
579	elxsi)
580		basic_machine=elxsi-elxsi
581		os=-bsd
582		;;
583	encore | umax | mmax)
584		basic_machine=ns32k-encore
585		;;
586	es1800 | OSE68k | ose68k | ose | OSE)
587		basic_machine=m68k-ericsson
588		os=-ose
589		;;
590	fx2800)
591		basic_machine=i860-alliant
592		;;
593	genix)
594		basic_machine=ns32k-ns
595		;;
596	gmicro)
597		basic_machine=tron-gmicro
598		os=-sysv
599		;;
600	go32)
601		basic_machine=i386-pc
602		os=-go32
603		;;
604	h3050r* | hiux*)
605		basic_machine=hppa1.1-hitachi
606		os=-hiuxwe2
607		;;
608	h8300hms)
609		basic_machine=h8300-hitachi
610		os=-hms
611		;;
612	h8300xray)
613		basic_machine=h8300-hitachi
614		os=-xray
615		;;
616	h8500hms)
617		basic_machine=h8500-hitachi
618		os=-hms
619		;;
620	harris)
621		basic_machine=m88k-harris
622		os=-sysv3
623		;;
624	hp300-*)
625		basic_machine=m68k-hp
626		;;
627	hp300bsd)
628		basic_machine=m68k-hp
629		os=-bsd
630		;;
631	hp300hpux)
632		basic_machine=m68k-hp
633		os=-hpux
634		;;
635	hp3k9[0-9][0-9] | hp9[0-9][0-9])
636		basic_machine=hppa1.0-hp
637		;;
638	hp9k2[0-9][0-9] | hp9k31[0-9])
639		basic_machine=m68000-hp
640		;;
641	hp9k3[2-9][0-9])
642		basic_machine=m68k-hp
643		;;
644	hp9k6[0-9][0-9] | hp6[0-9][0-9])
645		basic_machine=hppa1.0-hp
646		;;
647	hp9k7[0-79][0-9] | hp7[0-79][0-9])
648		basic_machine=hppa1.1-hp
649		;;
650	hp9k78[0-9] | hp78[0-9])
651		# FIXME: really hppa2.0-hp
652		basic_machine=hppa1.1-hp
653		;;
654	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
655		# FIXME: really hppa2.0-hp
656		basic_machine=hppa1.1-hp
657		;;
658	hp9k8[0-9][13679] | hp8[0-9][13679])
659		basic_machine=hppa1.1-hp
660		;;
661	hp9k8[0-9][0-9] | hp8[0-9][0-9])
662		basic_machine=hppa1.0-hp
663		;;
664	hppa-next)
665		os=-nextstep3
666		;;
667	hppaosf)
668		basic_machine=hppa1.1-hp
669		os=-osf
670		;;
671	hppro)
672		basic_machine=hppa1.1-hp
673		os=-proelf
674		;;
675	i370-ibm* | ibm*)
676		basic_machine=i370-ibm
677		;;
678# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
679	i*86v32)
680		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
681		os=-sysv32
682		;;
683	i*86v4*)
684		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
685		os=-sysv4
686		;;
687	i*86v)
688		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
689		os=-sysv
690		;;
691	i*86sol2)
692		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
693		os=-solaris2
694		;;
695	i386mach)
696		basic_machine=i386-mach
697		os=-mach
698		;;
699	i386-vsta | vsta)
700		basic_machine=i386-unknown
701		os=-vsta
702		;;
703	iris | iris4d)
704		basic_machine=mips-sgi
705		case $os in
706		    -irix*)
707			;;
708		    *)
709			os=-irix4
710			;;
711		esac
712		;;
713	isi68 | isi)
714		basic_machine=m68k-isi
715		os=-sysv
716		;;
717	m68knommu)
718		basic_machine=m68k-unknown
719		os=-linux
720		;;
721	m68knommu-*)
722		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
723		os=-linux
724		;;
725	m88k-omron*)
726		basic_machine=m88k-omron
727		;;
728	magnum | m3230)
729		basic_machine=mips-mips
730		os=-sysv
731		;;
732	merlin)
733		basic_machine=ns32k-utek
734		os=-sysv
735		;;
736        microblaze)
737		basic_machine=microblaze-xilinx
738		;;
739	mingw32)
740		basic_machine=i386-pc
741		os=-mingw32
742		;;
743	mingw32ce)
744		basic_machine=arm-unknown
745		os=-mingw32ce
746		;;
747	miniframe)
748		basic_machine=m68000-convergent
749		;;
750	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
751		basic_machine=m68k-atari
752		os=-mint
753		;;
754	mips3*-*)
755		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
756		;;
757	mips3*)
758		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
759		;;
760	monitor)
761		basic_machine=m68k-rom68k
762		os=-coff
763		;;
764	morphos)
765		basic_machine=powerpc-unknown
766		os=-morphos
767		;;
768	msdos)
769		basic_machine=i386-pc
770		os=-msdos
771		;;
772	ms1-*)
773		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
774		;;
775	mvs)
776		basic_machine=i370-ibm
777		os=-mvs
778		;;
779	ncr3000)
780		basic_machine=i486-ncr
781		os=-sysv4
782		;;
783	netbsd386)
784		basic_machine=i386-unknown
785		os=-netbsd
786		;;
787	netwinder)
788		basic_machine=armv4l-rebel
789		os=-linux
790		;;
791	news | news700 | news800 | news900)
792		basic_machine=m68k-sony
793		os=-newsos
794		;;
795	news1000)
796		basic_machine=m68030-sony
797		os=-newsos
798		;;
799	news-3600 | risc-news)
800		basic_machine=mips-sony
801		os=-newsos
802		;;
803	necv70)
804		basic_machine=v70-nec
805		os=-sysv
806		;;
807	next | m*-next )
808		basic_machine=m68k-next
809		case $os in
810		    -nextstep* )
811			;;
812		    -ns2*)
813		      os=-nextstep2
814			;;
815		    *)
816		      os=-nextstep3
817			;;
818		esac
819		;;
820	nh3000)
821		basic_machine=m68k-harris
822		os=-cxux
823		;;
824	nh[45]000)
825		basic_machine=m88k-harris
826		os=-cxux
827		;;
828	nindy960)
829		basic_machine=i960-intel
830		os=-nindy
831		;;
832	mon960)
833		basic_machine=i960-intel
834		os=-mon960
835		;;
836	nonstopux)
837		basic_machine=mips-compaq
838		os=-nonstopux
839		;;
840	np1)
841		basic_machine=np1-gould
842		;;
843	nsr-tandem)
844		basic_machine=nsr-tandem
845		;;
846	op50n-* | op60c-*)
847		basic_machine=hppa1.1-oki
848		os=-proelf
849		;;
850	openrisc | openrisc-*)
851		basic_machine=or32-unknown
852		;;
853	os400)
854		basic_machine=powerpc-ibm
855		os=-os400
856		;;
857	OSE68000 | ose68000)
858		basic_machine=m68000-ericsson
859		os=-ose
860		;;
861	os68k)
862		basic_machine=m68k-none
863		os=-os68k
864		;;
865	pa-hitachi)
866		basic_machine=hppa1.1-hitachi
867		os=-hiuxwe2
868		;;
869	paragon)
870		basic_machine=i860-intel
871		os=-osf
872		;;
873	parisc)
874		basic_machine=hppa-unknown
875		os=-linux
876		;;
877	parisc-*)
878		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
879		os=-linux
880		;;
881	pbd)
882		basic_machine=sparc-tti
883		;;
884	pbb)
885		basic_machine=m68k-tti
886		;;
887	pc532 | pc532-*)
888		basic_machine=ns32k-pc532
889		;;
890	pc98)
891		basic_machine=i386-pc
892		;;
893	pc98-*)
894		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
895		;;
896	pentium | p5 | k5 | k6 | nexgen | viac3)
897		basic_machine=i586-pc
898		;;
899	pentiumpro | p6 | 6x86 | athlon | athlon_*)
900		basic_machine=i686-pc
901		;;
902	pentiumii | pentium2 | pentiumiii | pentium3)
903		basic_machine=i686-pc
904		;;
905	pentium4)
906		basic_machine=i786-pc
907		;;
908	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
909		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
910		;;
911	pentiumpro-* | p6-* | 6x86-* | athlon-*)
912		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
913		;;
914	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
915		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
916		;;
917	pentium4-*)
918		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
919		;;
920	pn)
921		basic_machine=pn-gould
922		;;
923	power)	basic_machine=power-ibm
924		;;
925	ppc)	basic_machine=powerpc-unknown
926		;;
927	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
928		;;
929	ppcle | powerpclittle | ppc-le | powerpc-little)
930		basic_machine=powerpcle-unknown
931		;;
932	ppcle-* | powerpclittle-*)
933		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
934		;;
935	ppc64)	basic_machine=powerpc64-unknown
936		;;
937	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
938		;;
939	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
940		basic_machine=powerpc64le-unknown
941		;;
942	ppc64le-* | powerpc64little-*)
943		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
944		;;
945	ps2)
946		basic_machine=i386-ibm
947		;;
948	pw32)
949		basic_machine=i586-unknown
950		os=-pw32
951		;;
952	rdos)
953		basic_machine=i386-pc
954		os=-rdos
955		;;
956	rom68k)
957		basic_machine=m68k-rom68k
958		os=-coff
959		;;
960	rm[46]00)
961		basic_machine=mips-siemens
962		;;
963	rtpc | rtpc-*)
964		basic_machine=romp-ibm
965		;;
966	s390 | s390-*)
967		basic_machine=s390-ibm
968		;;
969	s390x | s390x-*)
970		basic_machine=s390x-ibm
971		;;
972	sa29200)
973		basic_machine=a29k-amd
974		os=-udi
975		;;
976	sb1)
977		basic_machine=mipsisa64sb1-unknown
978		;;
979	sb1el)
980		basic_machine=mipsisa64sb1el-unknown
981		;;
982	sde)
983		basic_machine=mipsisa32-sde
984		os=-elf
985		;;
986	sei)
987		basic_machine=mips-sei
988		os=-seiux
989		;;
990	sequent)
991		basic_machine=i386-sequent
992		;;
993	sh)
994		basic_machine=sh-hitachi
995		os=-hms
996		;;
997	sh5el)
998		basic_machine=sh5le-unknown
999		;;
1000	sh64)
1001		basic_machine=sh64-unknown
1002		;;
1003	sparclite-wrs | simso-wrs)
1004		basic_machine=sparclite-wrs
1005		os=-vxworks
1006		;;
1007	sps7)
1008		basic_machine=m68k-bull
1009		os=-sysv2
1010		;;
1011	spur)
1012		basic_machine=spur-unknown
1013		;;
1014	st2000)
1015		basic_machine=m68k-tandem
1016		;;
1017	stratus)
1018		basic_machine=i860-stratus
1019		os=-sysv4
1020		;;
1021	sun2)
1022		basic_machine=m68000-sun
1023		;;
1024	sun2os3)
1025		basic_machine=m68000-sun
1026		os=-sunos3
1027		;;
1028	sun2os4)
1029		basic_machine=m68000-sun
1030		os=-sunos4
1031		;;
1032	sun3os3)
1033		basic_machine=m68k-sun
1034		os=-sunos3
1035		;;
1036	sun3os4)
1037		basic_machine=m68k-sun
1038		os=-sunos4
1039		;;
1040	sun4os3)
1041		basic_machine=sparc-sun
1042		os=-sunos3
1043		;;
1044	sun4os4)
1045		basic_machine=sparc-sun
1046		os=-sunos4
1047		;;
1048	sun4sol2)
1049		basic_machine=sparc-sun
1050		os=-solaris2
1051		;;
1052	sun3 | sun3-*)
1053		basic_machine=m68k-sun
1054		;;
1055	sun4)
1056		basic_machine=sparc-sun
1057		;;
1058	sun386 | sun386i | roadrunner)
1059		basic_machine=i386-sun
1060		;;
1061	sv1)
1062		basic_machine=sv1-cray
1063		os=-unicos
1064		;;
1065	symmetry)
1066		basic_machine=i386-sequent
1067		os=-dynix
1068		;;
1069	t3e)
1070		basic_machine=alphaev5-cray
1071		os=-unicos
1072		;;
1073	t90)
1074		basic_machine=t90-cray
1075		os=-unicos
1076		;;
1077	tic54x | c54x*)
1078		basic_machine=tic54x-unknown
1079		os=-coff
1080		;;
1081	tic55x | c55x*)
1082		basic_machine=tic55x-unknown
1083		os=-coff
1084		;;
1085	tic6x | c6x*)
1086		basic_machine=tic6x-unknown
1087		os=-coff
1088		;;
1089	tile*)
1090		basic_machine=tile-unknown
1091		os=-linux-gnu
1092		;;
1093	tx39)
1094		basic_machine=mipstx39-unknown
1095		;;
1096	tx39el)
1097		basic_machine=mipstx39el-unknown
1098		;;
1099	toad1)
1100		basic_machine=pdp10-xkl
1101		os=-tops20
1102		;;
1103	tower | tower-32)
1104		basic_machine=m68k-ncr
1105		;;
1106	tpf)
1107		basic_machine=s390x-ibm
1108		os=-tpf
1109		;;
1110	udi29k)
1111		basic_machine=a29k-amd
1112		os=-udi
1113		;;
1114	ultra3)
1115		basic_machine=a29k-nyu
1116		os=-sym1
1117		;;
1118	v810 | necv810)
1119		basic_machine=v810-nec
1120		os=-none
1121		;;
1122	vaxv)
1123		basic_machine=vax-dec
1124		os=-sysv
1125		;;
1126	vms)
1127		basic_machine=vax-dec
1128		os=-vms
1129		;;
1130	vpp*|vx|vx-*)
1131		basic_machine=f301-fujitsu
1132		;;
1133	vxworks960)
1134		basic_machine=i960-wrs
1135		os=-vxworks
1136		;;
1137	vxworks68)
1138		basic_machine=m68k-wrs
1139		os=-vxworks
1140		;;
1141	vxworks29k)
1142		basic_machine=a29k-wrs
1143		os=-vxworks
1144		;;
1145	w65*)
1146		basic_machine=w65-wdc
1147		os=-none
1148		;;
1149	w89k-*)
1150		basic_machine=hppa1.1-winbond
1151		os=-proelf
1152		;;
1153	xbox)
1154		basic_machine=i686-pc
1155		os=-mingw32
1156		;;
1157	xps | xps100)
1158		basic_machine=xps100-honeywell
1159		;;
1160	ymp)
1161		basic_machine=ymp-cray
1162		os=-unicos
1163		;;
1164	z8k-*-coff)
1165		basic_machine=z8k-unknown
1166		os=-sim
1167		;;
1168	z80-*-coff)
1169		basic_machine=z80-unknown
1170		os=-sim
1171		;;
1172	none)
1173		basic_machine=none-none
1174		os=-none
1175		;;
1176
1177# Here we handle the default manufacturer of certain CPU types.  It is in
1178# some cases the only manufacturer, in others, it is the most popular.
1179	w89k)
1180		basic_machine=hppa1.1-winbond
1181		;;
1182	op50n)
1183		basic_machine=hppa1.1-oki
1184		;;
1185	op60c)
1186		basic_machine=hppa1.1-oki
1187		;;
1188	romp)
1189		basic_machine=romp-ibm
1190		;;
1191	mmix)
1192		basic_machine=mmix-knuth
1193		;;
1194	rs6000)
1195		basic_machine=rs6000-ibm
1196		;;
1197	vax)
1198		basic_machine=vax-dec
1199		;;
1200	pdp10)
1201		# there are many clones, so DEC is not a safe bet
1202		basic_machine=pdp10-unknown
1203		;;
1204	pdp11)
1205		basic_machine=pdp11-dec
1206		;;
1207	we32k)
1208		basic_machine=we32k-att
1209		;;
1210	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
1211		basic_machine=sh-unknown
1212		;;
1213	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
1214		basic_machine=sparc-sun
1215		;;
1216	cydra)
1217		basic_machine=cydra-cydrome
1218		;;
1219	orion)
1220		basic_machine=orion-highlevel
1221		;;
1222	orion105)
1223		basic_machine=clipper-highlevel
1224		;;
1225	mac | mpw | mac-mpw)
1226		basic_machine=m68k-apple
1227		;;
1228	pmac | pmac-mpw)
1229		basic_machine=powerpc-apple
1230		;;
1231	*-unknown)
1232		# Make sure to match an already-canonicalized machine name.
1233		;;
1234	*)
1235		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
1236		exit 1
1237		;;
1238esac
1239
1240# Here we canonicalize certain aliases for manufacturers.
1241case $basic_machine in
1242	*-digital*)
1243		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
1244		;;
1245	*-commodore*)
1246		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
1247		;;
1248	*)
1249		;;
1250esac
1251
1252# Decode manufacturer-specific aliases for certain operating systems.
1253
1254if [ x"$os" != x"" ]
1255then
1256case $os in
1257        # First match some system type aliases
1258        # that might get confused with valid system types.
1259	# -solaris* is a basic system type, with this one exception.
1260        -auroraux)
1261	        os=-auroraux
1262		;;
1263	-solaris1 | -solaris1.*)
1264		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1265		;;
1266	-solaris)
1267		os=-solaris2
1268		;;
1269	-svr4*)
1270		os=-sysv4
1271		;;
1272	-unixware*)
1273		os=-sysv4.2uw
1274		;;
1275	-gnu/linux*)
1276		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1277		;;
1278	# First accept the basic system types.
1279	# The portable systems comes first.
1280	# Each alternative MUST END IN A *, to match a version number.
1281	# -sysv* is not here because it comes later, after sysvr4.
1282	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1283	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1284	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1285	      | -sym* | -kopensolaris* \
1286	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1287	      | -aos* | -aros* \
1288	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1289	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1290	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1291	      | -openbsd* | -solidbsd* \
1292	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1293	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1294	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1295	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1296	      | -chorusos* | -chorusrdb* | -cegcc* \
1297	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1298	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1299	      | -uxpv* | -beos* | -mpeix* | -udk* \
1300	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1301	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1302	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1303	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1304	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1305	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1306	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
1307	# Remember, each alternative MUST END IN *, to match a version number.
1308		;;
1309	-qnx*)
1310		case $basic_machine in
1311		    x86-* | i*86-*)
1312			;;
1313		    *)
1314			os=-nto$os
1315			;;
1316		esac
1317		;;
1318	-nto-qnx*)
1319		;;
1320	-nto*)
1321		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1322		;;
1323	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1324	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1325	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1326		;;
1327	-mac*)
1328		os=`echo $os | sed -e 's|mac|macos|'`
1329		;;
1330	-linux-dietlibc)
1331		os=-linux-dietlibc
1332		;;
1333	-linux*)
1334		os=`echo $os | sed -e 's|linux|linux-gnu|'`
1335		;;
1336	-sunos5*)
1337		os=`echo $os | sed -e 's|sunos5|solaris2|'`
1338		;;
1339	-sunos6*)
1340		os=`echo $os | sed -e 's|sunos6|solaris3|'`
1341		;;
1342	-opened*)
1343		os=-openedition
1344		;;
1345        -os400*)
1346		os=-os400
1347		;;
1348	-wince*)
1349		os=-wince
1350		;;
1351	-osfrose*)
1352		os=-osfrose
1353		;;
1354	-osf*)
1355		os=-osf
1356		;;
1357	-utek*)
1358		os=-bsd
1359		;;
1360	-dynix*)
1361		os=-bsd
1362		;;
1363	-acis*)
1364		os=-aos
1365		;;
1366	-atheos*)
1367		os=-atheos
1368		;;
1369	-syllable*)
1370		os=-syllable
1371		;;
1372	-386bsd)
1373		os=-bsd
1374		;;
1375	-ctix* | -uts*)
1376		os=-sysv
1377		;;
1378	-nova*)
1379		os=-rtmk-nova
1380		;;
1381	-ns2 )
1382		os=-nextstep2
1383		;;
1384	-nsk*)
1385		os=-nsk
1386		;;
1387	# Preserve the version number of sinix5.
1388	-sinix5.*)
1389		os=`echo $os | sed -e 's|sinix|sysv|'`
1390		;;
1391	-sinix*)
1392		os=-sysv4
1393		;;
1394        -tpf*)
1395		os=-tpf
1396		;;
1397	-triton*)
1398		os=-sysv3
1399		;;
1400	-oss*)
1401		os=-sysv3
1402		;;
1403	-svr4)
1404		os=-sysv4
1405		;;
1406	-svr3)
1407		os=-sysv3
1408		;;
1409	-sysvr4)
1410		os=-sysv4
1411		;;
1412	# This must come after -sysvr4.
1413	-sysv*)
1414		;;
1415	-ose*)
1416		os=-ose
1417		;;
1418	-es1800*)
1419		os=-ose
1420		;;
1421	-xenix)
1422		os=-xenix
1423		;;
1424	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1425		os=-mint
1426		;;
1427	-aros*)
1428		os=-aros
1429		;;
1430	-kaos*)
1431		os=-kaos
1432		;;
1433	-zvmoe)
1434		os=-zvmoe
1435		;;
1436	-dicos*)
1437		os=-dicos
1438		;;
1439        -nacl*)
1440	        ;;
1441	-none)
1442		;;
1443	*)
1444		# Get rid of the `-' at the beginning of $os.
1445		os=`echo $os | sed 's/[^-]*-//'`
1446		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1447		exit 1
1448		;;
1449esac
1450else
1451
1452# Here we handle the default operating systems that come with various machines.
1453# The value should be what the vendor currently ships out the door with their
1454# machine or put another way, the most popular os provided with the machine.
1455
1456# Note that if you're going to try to match "-MANUFACTURER" here (say,
1457# "-sun"), then you have to tell the case statement up towards the top
1458# that MANUFACTURER isn't an operating system.  Otherwise, code above
1459# will signal an error saying that MANUFACTURER isn't an operating
1460# system, and we'll never get to this point.
1461
1462case $basic_machine in
1463        score-*)
1464		os=-elf
1465		;;
1466        spu-*)
1467		os=-elf
1468		;;
1469	*-acorn)
1470		os=-riscix1.2
1471		;;
1472	arm*-rebel)
1473		os=-linux
1474		;;
1475	arm*-semi)
1476		os=-aout
1477		;;
1478        c4x-* | tic4x-*)
1479        	os=-coff
1480		;;
1481	# This must come before the *-dec entry.
1482	pdp10-*)
1483		os=-tops20
1484		;;
1485	pdp11-*)
1486		os=-none
1487		;;
1488	*-dec | vax-*)
1489		os=-ultrix4.2
1490		;;
1491	m68*-apollo)
1492		os=-domain
1493		;;
1494	i386-sun)
1495		os=-sunos4.0.2
1496		;;
1497	m68000-sun)
1498		os=-sunos3
1499		# This also exists in the configure program, but was not the
1500		# default.
1501		# os=-sunos4
1502		;;
1503	m68*-cisco)
1504		os=-aout
1505		;;
1506        mep-*)
1507		os=-elf
1508		;;
1509	mips*-cisco)
1510		os=-elf
1511		;;
1512	mips*-*)
1513		os=-elf
1514		;;
1515	or32-*)
1516		os=-coff
1517		;;
1518	*-tti)	# must be before sparc entry or we get the wrong os.
1519		os=-sysv3
1520		;;
1521	sparc-* | *-sun)
1522		os=-sunos4.1.1
1523		;;
1524	*-be)
1525		os=-beos
1526		;;
1527	*-haiku)
1528		os=-haiku
1529		;;
1530	*-ibm)
1531		os=-aix
1532		;;
1533    	*-knuth)
1534		os=-mmixware
1535		;;
1536	*-wec)
1537		os=-proelf
1538		;;
1539	*-winbond)
1540		os=-proelf
1541		;;
1542	*-oki)
1543		os=-proelf
1544		;;
1545	*-hp)
1546		os=-hpux
1547		;;
1548	*-hitachi)
1549		os=-hiux
1550		;;
1551	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1552		os=-sysv
1553		;;
1554	*-cbm)
1555		os=-amigaos
1556		;;
1557	*-dg)
1558		os=-dgux
1559		;;
1560	*-dolphin)
1561		os=-sysv3
1562		;;
1563	m68k-ccur)
1564		os=-rtu
1565		;;
1566	m88k-omron*)
1567		os=-luna
1568		;;
1569	*-next )
1570		os=-nextstep
1571		;;
1572	*-sequent)
1573		os=-ptx
1574		;;
1575	*-crds)
1576		os=-unos
1577		;;
1578	*-ns)
1579		os=-genix
1580		;;
1581	i370-*)
1582		os=-mvs
1583		;;
1584	*-next)
1585		os=-nextstep3
1586		;;
1587	*-gould)
1588		os=-sysv
1589		;;
1590	*-highlevel)
1591		os=-bsd
1592		;;
1593	*-encore)
1594		os=-bsd
1595		;;
1596	*-sgi)
1597		os=-irix
1598		;;
1599	*-siemens)
1600		os=-sysv4
1601		;;
1602	*-masscomp)
1603		os=-rtu
1604		;;
1605	f30[01]-fujitsu | f700-fujitsu)
1606		os=-uxpv
1607		;;
1608	*-rom68k)
1609		os=-coff
1610		;;
1611	*-*bug)
1612		os=-coff
1613		;;
1614	*-apple)
1615		os=-macos
1616		;;
1617	*-atari*)
1618		os=-mint
1619		;;
1620	*)
1621		os=-none
1622		;;
1623esac
1624fi
1625
1626# Here we handle the case where we know the os, and the CPU type, but not the
1627# manufacturer.  We pick the logical manufacturer.
1628vendor=unknown
1629case $basic_machine in
1630	*-unknown)
1631		case $os in
1632			-riscix*)
1633				vendor=acorn
1634				;;
1635			-sunos*)
1636				vendor=sun
1637				;;
1638			-cnk*|-aix*)
1639				vendor=ibm
1640				;;
1641			-beos*)
1642				vendor=be
1643				;;
1644			-hpux*)
1645				vendor=hp
1646				;;
1647			-mpeix*)
1648				vendor=hp
1649				;;
1650			-hiux*)
1651				vendor=hitachi
1652				;;
1653			-unos*)
1654				vendor=crds
1655				;;
1656			-dgux*)
1657				vendor=dg
1658				;;
1659			-luna*)
1660				vendor=omron
1661				;;
1662			-genix*)
1663				vendor=ns
1664				;;
1665			-mvs* | -opened*)
1666				vendor=ibm
1667				;;
1668			-os400*)
1669				vendor=ibm
1670				;;
1671			-ptx*)
1672				vendor=sequent
1673				;;
1674			-tpf*)
1675				vendor=ibm
1676				;;
1677			-vxsim* | -vxworks* | -windiss*)
1678				vendor=wrs
1679				;;
1680			-aux*)
1681				vendor=apple
1682				;;
1683			-hms*)
1684				vendor=hitachi
1685				;;
1686			-mpw* | -macos*)
1687				vendor=apple
1688				;;
1689			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1690				vendor=atari
1691				;;
1692			-vos*)
1693				vendor=stratus
1694				;;
1695		esac
1696		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1697		;;
1698esac
1699
1700echo $basic_machine$os
1701exit
1702
1703# Local variables:
1704# eval: (add-hook 'write-file-hooks 'time-stamp)
1705# time-stamp-start: "timestamp='"
1706# time-stamp-format: "%:y-%02m-%02d"
1707# time-stamp-end: "'"
1708# End:
1709