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