config.sub revision 267654
1251876Speter#! /bin/sh
2251876Speter# Configuration validation subroutine script.
3251876Speter#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4251876Speter#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5251876Speter#   Free Software Foundation, Inc.
6251876Speter
7251876Spetertimestamp='2009-12-31'
8251876Speter
9251876Speter# This file is (in principle) common to ALL GNU software.
10251876Speter# The presence of a machine in this file suggests that SOME GNU software
11251876Speter# can handle that machine.  It does not imply ALL GNU software can.
12251876Speter#
13251876Speter# This file is free software; you can redistribute it and/or modify
14251876Speter# it under the terms of the GNU General Public License as published by
15251876Speter# the Free Software Foundation; either version 2 of the License, or
16251876Speter# (at your option) any later version.
17251876Speter#
18251876Speter# This program is distributed in the hope that it will be useful,
19251876Speter# but WITHOUT ANY WARRANTY; without even the implied warranty of
20251876Speter# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21251876Speter# GNU General Public License for more details.
22251876Speter#
23251876Speter# You should have received a copy of the GNU General Public License
24251876Speter# along with this program; if not, write to the Free Software
25251876Speter# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26251876Speter# 02110-1301, USA.
27251876Speter#
28251876Speter# As a special exception to the GNU General Public License, if you
29251876Speter# distribute this file as part of a program that contains a
30251876Speter# configuration script generated by Autoconf, you may include it under
31251876Speter# the same distribution terms that you use for the rest of that program.
32251876Speter
33251876Speter
34251876Speter# Please send patches to <config-patches@gnu.org>.  Submit a context
35251876Speter# diff and a properly formatted GNU ChangeLog entry.
36251876Speter#
37251876Speter# Configuration subroutine to validate and canonicalize a configuration type.
38251876Speter# Supply the specified configuration type as an argument.
39251876Speter# If it is invalid, we print an error message on stderr and exit with code 1.
40251876Speter# Otherwise, we print the canonical config type on stdout and succeed.
41251876Speter
42251876Speter# You can get the latest version of this script from:
43251876Speter# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44251876Speter
45251876Speter# This file is supposed to be the same for all GNU packages
46251876Speter# and recognize all the CPU types, system types and aliases
47251876Speter# that are meaningful with *any* GNU software.
48251876Speter# Each package is responsible for reporting which valid configurations
49251876Speter# it does not support.  The user should be able to distinguish
50251876Speter# a failure to support a valid configuration from a meaningless
51251876Speter# configuration.
52251876Speter
53251876Speter# The goal of this file is to map all the various variations of a given
54251876Speter# machine specification into a single specification in the form:
55251876Speter#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
56251876Speter# or in some cases, the newer four-part form:
57251876Speter#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
58251876Speter# It is wrong to echo any other type of specification.
59251876Speter
60251876Speterme=`echo "$0" | sed -e 's,.*/,,'`
61251876Speter
62251876Speterusage="\
63251876SpeterUsage: $0 [OPTION] CPU-MFR-OPSYS
64251876Speter       $0 [OPTION] ALIAS
65251876Speter
66251876SpeterCanonicalize a configuration name.
67251876Speter
68251876SpeterOperation modes:
69251876Speter  -h, --help         print this help, then exit
70251876Speter  -t, --time-stamp   print date of last modification, then exit
71251876Speter  -v, --version      print version number, then exit
72251876Speter
73251876SpeterReport bugs and patches to <config-patches@gnu.org>."
74251876Speter
75251876Speterversion="\
76251876SpeterGNU config.sub ($timestamp)
77251876Speter
78251876SpeterCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79251876Speter2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
80251876SpeterSoftware Foundation, Inc.
81251876Speter
82251876SpeterThis is free software; see the source for copying conditions.  There is NO
83251876Speterwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
84251876Speter
85251876Speterhelp="
86251876SpeterTry \`$me --help' for more information."
87251876Speter
88251876Speter# Parse command line
89251876Speterwhile test $# -gt 0 ; do
90251876Speter  case $1 in
91251876Speter    --time-stamp | --time* | -t )
92251876Speter       echo "$timestamp" ; exit ;;
93251876Speter    --version | -v )
94251876Speter       echo "$version" ; exit ;;
95251876Speter    --help | --h* | -h )
96251876Speter       echo "$usage"; exit ;;
97251876Speter    -- )     # Stop option processing
98251876Speter       shift; break ;;
99251876Speter    - )	# Use stdin as input.
100251876Speter       break ;;
101251876Speter    -* )
102251876Speter       echo "$me: invalid option $1$help"
103251876Speter       exit 1 ;;
104251876Speter
105251876Speter    *local*)
106251876Speter       # First pass through any local machine types.
107251876Speter       echo $1
108251876Speter       exit ;;
109251876Speter
110251876Speter    * )
111251876Speter       break ;;
112251876Speter  esac
113251876Speterdone
114251876Speter
115251876Spetercase $# in
116251876Speter 0) echo "$me: missing argument$help" >&2
117251876Speter    exit 1;;
118251876Speter 1) ;;
119251876Speter *) echo "$me: too many arguments$help" >&2
120251876Speter    exit 1;;
121251876Speteresac
122251876Speter
123251876Speter# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
124251876Speter# Here we must recognize all the valid KERNEL-OS combinations.
125251876Spetermaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
126251876Spetercase $maybe_os in
127251876Speter  nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
128251876Speter  uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
129251876Speter  kopensolaris*-gnu* | \
130251876Speter  storm-chaos* | os2-emx* | rtmk-nova*)
131251876Speter    os=-$maybe_os
132251876Speter    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
133251876Speter    ;;
134251876Speter  *)
135251876Speter    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
136251876Speter    if [ $basic_machine != $1 ]
137251876Speter    then os=`echo $1 | sed 's/.*-/-/'`
138251876Speter    else os=; fi
139251876Speter    ;;
140251876Speteresac
141251876Speter
142251876Speter### Let's recognize common machines as not being operating systems so
143251876Speter### that things like config.sub decstation-3100 work.  We also
144251876Speter### recognize some manufacturers as not being operating systems, so we
145251876Speter### can provide default operating systems below.
146251876Spetercase $os in
147251876Speter	-sun*os*)
148251876Speter		# Prevent following clause from handling this invalid input.
149251876Speter		;;
150251876Speter	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
151251876Speter	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
152251876Speter	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
153251876Speter	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
154251876Speter	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
155251876Speter	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
156251876Speter	-apple | -axis | -knuth | -cray | -microblaze)
157251876Speter		os=
158251876Speter		basic_machine=$1
159251876Speter		;;
160251876Speter        -bluegene*)
161251876Speter	        os=-cnk
162251876Speter		;;
163251876Speter	-sim | -cisco | -oki | -wec | -winbond)
164251876Speter		os=
165251876Speter		basic_machine=$1
166251876Speter		;;
167251876Speter	-scout)
168251876Speter		;;
169251876Speter	-wrs)
170251876Speter		os=-vxworks
171251876Speter		basic_machine=$1
172251876Speter		;;
173251876Speter	-chorusos*)
174251876Speter		os=-chorusos
175251876Speter		basic_machine=$1
176251876Speter		;;
177251876Speter 	-chorusrdb)
178251876Speter 		os=-chorusrdb
179251876Speter		basic_machine=$1
180251876Speter 		;;
181251876Speter	-hiux*)
182251876Speter		os=-hiuxwe2
183251876Speter		;;
184251876Speter	-sco6)
185251876Speter		os=-sco5v6
186251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
187251876Speter		;;
188251876Speter	-sco5)
189251876Speter		os=-sco3.2v5
190251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
191251876Speter		;;
192251876Speter	-sco4)
193251876Speter		os=-sco3.2v4
194251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
195251876Speter		;;
196251876Speter	-sco3.2.[4-9]*)
197251876Speter		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
198251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
199251876Speter		;;
200251876Speter	-sco3.2v[4-9]*)
201251876Speter		# Don't forget version if it is 3.2v4 or newer.
202251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
203251876Speter		;;
204251876Speter	-sco5v6*)
205251876Speter		# Don't forget version if it is 3.2v4 or newer.
206251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207251876Speter		;;
208251876Speter	-sco*)
209251876Speter		os=-sco3.2v2
210251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211251876Speter		;;
212251876Speter	-udk*)
213251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
214251876Speter		;;
215251876Speter	-isc)
216251876Speter		os=-isc2.2
217251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
218251876Speter		;;
219251876Speter	-clix*)
220251876Speter		basic_machine=clipper-intergraph
221251876Speter		;;
222251876Speter	-isc*)
223251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
224251876Speter		;;
225251876Speter	-lynx*)
226251876Speter		os=-lynxos
227251876Speter		;;
228251876Speter	-ptx*)
229251876Speter		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
230251876Speter		;;
231251876Speter	-windowsnt*)
232251876Speter		os=`echo $os | sed -e 's/windowsnt/winnt/'`
233251876Speter		;;
234251876Speter	-psos*)
235251876Speter		os=-psos
236251876Speter		;;
237251876Speter	-mint | -mint[0-9]*)
238251876Speter		basic_machine=m68k-atari
239		os=-mint
240		;;
241esac
242
243# Decode aliases for certain CPU-COMPANY combinations.
244case $basic_machine in
245	# Recognize the basic CPU types without company name.
246	# Some are omitted here because they have special meanings below.
247	1750a | 580 \
248	| a29k \
249	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
250	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
251	| am33_2.0 \
252	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
253	| bfin \
254	| c4x | clipper \
255	| d10v | d30v | dlx | dsp16xx \
256	| fido | fr30 | frv \
257	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
258	| i370 | i860 | i960 | ia64 \
259	| ip2k | iq2000 \
260	| lm32 \
261	| m32c | m32r | m32rle | m68000 | m68k | m88k \
262	| maxq | mb | microblaze | mcore | mep | metag \
263	| mips | mipsbe | mipseb | mipsel | mipsle \
264	| mips16 \
265	| mips64 | mips64el \
266	| mips64octeon | mips64octeonel \
267	| mips64orion | mips64orionel \
268	| mips64r5900 | mips64r5900el \
269	| mips64vr | mips64vrel \
270	| mips64vr4100 | mips64vr4100el \
271	| mips64vr4300 | mips64vr4300el \
272	| mips64vr5000 | mips64vr5000el \
273	| mips64vr5900 | mips64vr5900el \
274	| mipsisa32 | mipsisa32el \
275	| mipsisa32r2 | mipsisa32r2el \
276	| mipsisa64 | mipsisa64el \
277	| mipsisa64r2 | mipsisa64r2el \
278	| mipsisa64sb1 | mipsisa64sb1el \
279	| mipsisa64sr71k | mipsisa64sr71kel \
280	| mipstx39 | mipstx39el \
281	| mn10200 | mn10300 \
282	| moxie \
283	| mt \
284	| msp430 \
285	| nios | nios2 \
286	| ns16k | ns32k \
287	| or32 \
288	| pdp10 | pdp11 | pj | pjl \
289	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
290	| pyramid \
291	| rx \
292	| score \
293	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
294	| sh64 | sh64le \
295	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
296	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
297	| spu | strongarm \
298	| tahoe | thumb | tic4x | tic80 | tron \
299	| ubicom32 \
300	| v850 | v850e \
301	| we32k \
302	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
303	| z8k | z80)
304		basic_machine=$basic_machine-unknown
305		;;
306	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
307		# Motorola 68HC11/12.
308		basic_machine=$basic_machine-unknown
309		os=-none
310		;;
311	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
312		;;
313	ms1)
314		basic_machine=mt-unknown
315		;;
316
317	# We use `pc' rather than `unknown'
318	# because (1) that's what they normally are, and
319	# (2) the word "unknown" tends to confuse beginning users.
320	i*86 | x86_64)
321	  basic_machine=$basic_machine-pc
322	  ;;
323	# Object if more than one company name word.
324	*-*-*)
325		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
326		exit 1
327		;;
328	# Recognize the basic CPU types with company name.
329	580-* \
330	| a29k-* \
331	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
332	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
333	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
334	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
335	| avr-* | avr32-* \
336	| bfin-* | bs2000-* \
337	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
338	| clipper-* | craynv-* | cydra-* \
339	| d10v-* | d30v-* | dlx-* \
340	| elxsi-* \
341	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
342	| h8300-* | h8500-* \
343	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
344	| i*86-* | i860-* | i960-* | ia64-* \
345	| ip2k-* | iq2000-* \
346	| lm32-* \
347	| m32c-* | m32r-* | m32rle-* \
348	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
349	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
350	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
351	| mips16-* \
352	| mips64-* | mips64el-* \
353	| mips64octeon-* | mips64octeonel-* \
354	| mips64orion-* | mips64orionel-* \
355	| mips64r5900-* | mips64r5900el-* \
356	| mips64vr-* | mips64vrel-* \
357	| mips64vr4100-* | mips64vr4100el-* \
358	| mips64vr4300-* | mips64vr4300el-* \
359	| mips64vr5000-* | mips64vr5000el-* \
360	| mips64vr5900-* | mips64vr5900el-* \
361	| mipsisa32-* | mipsisa32el-* \
362	| mipsisa32r2-* | mipsisa32r2el-* \
363	| mipsisa64-* | mipsisa64el-* \
364	| mipsisa64r2-* | mipsisa64r2el-* \
365	| mipsisa64sb1-* | mipsisa64sb1el-* \
366	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
367	| mipstx39-* | mipstx39el-* \
368	| mmix-* \
369	| mt-* \
370	| msp430-* \
371	| nios-* | nios2-* \
372	| none-* | np1-* | ns16k-* | ns32k-* \
373	| orion-* \
374	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
375	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
376	| pyramid-* \
377	| romp-* | rs6000-* | rx-* \
378	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
379	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
380	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
381	| sparclite-* \
382	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
383	| tahoe-* | thumb-* \
384	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
385	| tron-* \
386	| ubicom32-* \
387	| v850-* | v850e-* | vax-* \
388	| we32k-* \
389	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
390	| xstormy16-* | xtensa*-* \
391	| ymp-* \
392	| z8k-* | z80-*)
393		;;
394	# Recognize the basic CPU types without company name, with glob match.
395	xtensa*)
396		basic_machine=$basic_machine-unknown
397		;;
398	# Recognize the various machine names and aliases which stand
399	# for a CPU type and a company and sometimes even an OS.
400	386bsd)
401		basic_machine=i386-unknown
402		os=-bsd
403		;;
404	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
405		basic_machine=m68000-att
406		;;
407	3b*)
408		basic_machine=we32k-att
409		;;
410	a29khif)
411		basic_machine=a29k-amd
412		os=-udi
413		;;
414    	abacus)
415		basic_machine=abacus-unknown
416		;;
417	adobe68k)
418		basic_machine=m68010-adobe
419		os=-scout
420		;;
421	alliant | fx80)
422		basic_machine=fx80-alliant
423		;;
424	altos | altos3068)
425		basic_machine=m68k-altos
426		;;
427	am29k)
428		basic_machine=a29k-none
429		os=-bsd
430		;;
431	amd64)
432		basic_machine=x86_64-pc
433		;;
434	amd64-*)
435		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
436		;;
437	amdahl)
438		basic_machine=580-amdahl
439		os=-sysv
440		;;
441	amiga | amiga-*)
442		basic_machine=m68k-unknown
443		;;
444	amigaos | amigados)
445		basic_machine=m68k-unknown
446		os=-amigaos
447		;;
448	amigaunix | amix)
449		basic_machine=m68k-unknown
450		os=-sysv4
451		;;
452	apollo68)
453		basic_machine=m68k-apollo
454		os=-sysv
455		;;
456	apollo68bsd)
457		basic_machine=m68k-apollo
458		os=-bsd
459		;;
460	aros)
461		basic_machine=i386-pc
462		os=-aros
463		;;
464	aux)
465		basic_machine=m68k-apple
466		os=-aux
467		;;
468	balance)
469		basic_machine=ns32k-sequent
470		os=-dynix
471		;;
472	blackfin)
473		basic_machine=bfin-unknown
474		os=-linux
475		;;
476	blackfin-*)
477		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
478		os=-linux
479		;;
480	bluegene*)
481		basic_machine=powerpc-ibm
482		os=-cnk
483		;;
484	c90)
485		basic_machine=c90-cray
486		os=-unicos
487		;;
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