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='2009-02-03'
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  kopensolaris*-gnu* | \
126  storm-chaos* | os2-emx* | rtmk-nova*)
127    os=-$maybe_os
128    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
129    ;;
130  *)
131    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
132    if [ $basic_machine != $1 ]
133    then os=`echo $1 | sed 's/.*-/-/'`
134    else os=; fi
135    ;;
136esac
137
138### Let's recognize common machines as not being operating systems so
139### that things like config.sub decstation-3100 work.  We also
140### recognize some manufacturers as not being operating systems, so we
141### can provide default operating systems below.
142case $os in
143	-sun*os*)
144		# Prevent following clause from handling this invalid input.
145		;;
146	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
147	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
148	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
149	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
150	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
151	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
152	-apple | -axis | -knuth | -cray)
153		os=
154		basic_machine=$1
155		;;
156	-sim | -cisco | -oki | -wec | -winbond)
157		os=
158		basic_machine=$1
159		;;
160	-scout)
161		;;
162	-wrs)
163		os=-vxworks
164		basic_machine=$1
165		;;
166	-chorusos*)
167		os=-chorusos
168		basic_machine=$1
169		;;
170 	-chorusrdb)
171 		os=-chorusrdb
172		basic_machine=$1
173 		;;
174	-hiux*)
175		os=-hiuxwe2
176		;;
177	-sco6)
178		os=-sco5v6
179		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
180		;;
181	-sco5)
182		os=-sco3.2v5
183		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
184		;;
185	-sco4)
186		os=-sco3.2v4
187		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188		;;
189	-sco3.2.[4-9]*)
190		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
191		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
192		;;
193	-sco3.2v[4-9]*)
194		# Don't forget version if it is 3.2v4 or newer.
195		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
196		;;
197	-sco5v6*)
198		# Don't forget version if it is 3.2v4 or newer.
199		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
200		;;
201	-sco*)
202		os=-sco3.2v2
203		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
204		;;
205	-udk*)
206		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
207		;;
208	-isc)
209		os=-isc2.2
210		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
211		;;
212	-clix*)
213		basic_machine=clipper-intergraph
214		;;
215	-isc*)
216		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
217		;;
218	-lynx*)
219		os=-lynxos
220		;;
221	-ptx*)
222		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
223		;;
224	-windowsnt*)
225		os=`echo $os | sed -e 's/windowsnt/winnt/'`
226		;;
227	-psos*)
228		os=-psos
229		;;
230	-mint | -mint[0-9]*)
231		basic_machine=m68k-atari
232		os=-mint
233		;;
234esac
235
236# Decode aliases for certain CPU-COMPANY combinations.
237case $basic_machine in
238	# Recognize the basic CPU types without company name.
239	# Some are omitted here because they have special meanings below.
240	1750a | 580 \
241	| a29k \
242	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
243	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
244	| am33_2.0 \
245	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
246	| bfin \
247	| c4x | clipper \
248	| d10v | d30v | dlx | dsp16xx | dvp \
249	| fido | fr30 | frv \
250	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
251	| i370 | i860 | i960 | ia64 \
252	| ip2k | iq2000 \
253	| lm32 \
254	| m32c | m32r | m32rle | m68000 | m68k | m88k \
255	| maxq | mb | microblaze | mcore | mep | metag \
256	| mips | mipsbe | mipseb | mipsel | mipsle \
257	| mips16 \
258	| mips64 | mips64el \
259	| mips64octeon | mips64octeonel \
260	| mips64orion | mips64orionel \
261	| mips64r5900 | mips64r5900el \
262	| mips64vr | mips64vrel \
263	| mips64vr4100 | mips64vr4100el \
264	| mips64vr4300 | mips64vr4300el \
265	| mips64vr5000 | mips64vr5000el \
266	| mips64vr5900 | mips64vr5900el \
267	| mipsisa32 | mipsisa32el \
268	| mipsisa32r2 | mipsisa32r2el \
269	| mipsisa64 | mipsisa64el \
270	| mipsisa64r2 | mipsisa64r2el \
271	| mipsisa64sb1 | mipsisa64sb1el \
272	| mipsisa64sr71k | mipsisa64sr71kel \
273	| mipstx39 | mipstx39el \
274	| mn10200 | mn10300 \
275	| mt \
276	| msp430 \
277	| nios | nios2 \
278	| ns16k | ns32k \
279	| or32 \
280	| pdp10 | pdp11 | pj | pjl \
281	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
282	| pyramid \
283	| score \
284	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
285	| sh64 | sh64le \
286	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
287	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
288	| spu | strongarm \
289	| tahoe | thumb | tic4x | tic80 | tron \
290	| v850 | v850e \
291	| we32k \
292	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
293	| z8k | z80)
294		basic_machine=$basic_machine-unknown
295		;;
296	m6811 | m68hc11 | m6812 | m68hc12)
297		# Motorola 68HC11/12.
298		basic_machine=$basic_machine-unknown
299		os=-none
300		;;
301	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
302		;;
303	ms1)
304		basic_machine=mt-unknown
305		;;
306
307	# We use `pc' rather than `unknown'
308	# because (1) that's what they normally are, and
309	# (2) the word "unknown" tends to confuse beginning users.
310	i*86 | x86_64)
311	  basic_machine=$basic_machine-pc
312	  ;;
313	# Object if more than one company name word.
314	*-*-*)
315		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
316		exit 1
317		;;
318	# Recognize the basic CPU types with company name.
319	580-* \
320	| a29k-* \
321	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
322	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
323	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
324	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
325	| avr-* | avr32-* \
326	| bfin-* | bs2000-* \
327	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
328	| clipper-* | craynv-* | cydra-* \
329	| d10v-* | d30v-* | dlx-* \
330	| elxsi-* \
331	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
332	| h8300-* | h8500-* \
333	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
334	| i*86-* | i860-* | i960-* | ia64-* \
335	| ip2k-* | iq2000-* \
336	| lm32-* \
337	| m32c-* | m32r-* | m32rle-* \
338	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
339	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
340	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
341	| mips16-* \
342	| mips64-* | mips64el-* \
343	| mips64octeon-* | mips64octeonel-* \
344	| mips64orion-* | mips64orionel-* \
345	| mips64r5900-* | mips64r5900el-* \
346	| mips64vr-* | mips64vrel-* \
347	| mips64vr4100-* | mips64vr4100el-* \
348	| mips64vr4300-* | mips64vr4300el-* \
349	| mips64vr5000-* | mips64vr5000el-* \
350	| mips64vr5900-* | mips64vr5900el-* \
351	| mipsisa32-* | mipsisa32el-* \
352	| mipsisa32r2-* | mipsisa32r2el-* \
353	| mipsisa64-* | mipsisa64el-* \
354	| mipsisa64r2-* | mipsisa64r2el-* \
355	| mipsisa64sb1-* | mipsisa64sb1el-* \
356	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
357	| mipstx39-* | mipstx39el-* \
358	| mmix-* \
359	| mt-* \
360	| msp430-* \
361	| nios-* | nios2-* \
362	| none-* | np1-* | ns16k-* | ns32k-* \
363	| orion-* \
364	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
365	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
366	| pyramid-* \
367	| romp-* | rs6000-* \
368	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
369	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
370	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
371	| sparclite-* \
372	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
373	| tahoe-* | thumb-* \
374	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \
375	| tron-* \
376	| v850-* | v850e-* | vax-* \
377	| we32k-* \
378	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
379	| xstormy16-* | xtensa*-* \
380	| ymp-* \
381	| z8k-* | z80-*)
382		;;
383	# Recognize the basic CPU types without company name, with glob match.
384	xtensa*)
385		basic_machine=$basic_machine-unknown
386		;;
387	# Recognize the various machine names and aliases which stand
388	# for a CPU type and a company and sometimes even an OS.
389	386bsd)
390		basic_machine=i386-unknown
391		os=-bsd
392		;;
393	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
394		basic_machine=m68000-att
395		;;
396	3b*)
397		basic_machine=we32k-att
398		;;
399	a29khif)
400		basic_machine=a29k-amd
401		os=-udi
402		;;
403    	abacus)
404		basic_machine=abacus-unknown
405		;;
406	adobe68k)
407		basic_machine=m68010-adobe
408		os=-scout
409		;;
410	alliant | fx80)
411		basic_machine=fx80-alliant
412		;;
413	altos | altos3068)
414		basic_machine=m68k-altos
415		;;
416	am29k)
417		basic_machine=a29k-none
418		os=-bsd
419		;;
420	amd64)
421		basic_machine=x86_64-pc
422		;;
423	amd64-*)
424		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
425		;;
426	amdahl)
427		basic_machine=580-amdahl
428		os=-sysv
429		;;
430	amiga | amiga-*)
431		basic_machine=m68k-unknown
432		;;
433	amigaos | amigados)
434		basic_machine=m68k-unknown
435		os=-amigaos
436		;;
437	amigaunix | amix)
438		basic_machine=m68k-unknown
439		os=-sysv4
440		;;
441	apollo68)
442		basic_machine=m68k-apollo
443		os=-sysv
444		;;
445	apollo68bsd)
446		basic_machine=m68k-apollo
447		os=-bsd
448		;;
449	aros)
450		basic_machine=i386-pc
451		os=-aros
452		;;
453	aux)
454		basic_machine=m68k-apple
455		os=-aux
456		;;
457	balance)
458		basic_machine=ns32k-sequent
459		os=-dynix
460		;;
461	blackfin)
462		basic_machine=bfin-unknown
463		os=-linux
464		;;
465	blackfin-*)
466		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
467		os=-linux
468		;;
469	c90)
470		basic_machine=c90-cray
471		os=-unicos
472		;;
473        cegcc)
474		basic_machine=arm-unknown
475		os=-cegcc
476		;;
477	convex-c1)
478		basic_machine=c1-convex
479		os=-bsd
480		;;
481	convex-c2)
482		basic_machine=c2-convex
483		os=-bsd
484		;;
485	convex-c32)
486		basic_machine=c32-convex
487		os=-bsd
488		;;
489	convex-c34)
490		basic_machine=c34-convex
491		os=-bsd
492		;;
493	convex-c38)
494		basic_machine=c38-convex
495		os=-bsd
496		;;
497	cray | j90)
498		basic_machine=j90-cray
499		os=-unicos
500		;;
501	craynv)
502		basic_machine=craynv-cray
503		os=-unicosmp
504		;;
505	cr16)
506		basic_machine=cr16-unknown
507		os=-elf
508		;;
509	crds | unos)
510		basic_machine=m68k-crds
511		;;
512	crisv32 | crisv32-* | etraxfs*)
513		basic_machine=crisv32-axis
514		;;
515	cris | cris-* | etrax*)
516		basic_machine=cris-axis
517		;;
518	crx)
519		basic_machine=crx-unknown
520		os=-elf
521		;;
522	da30 | da30-*)
523		basic_machine=m68k-da30
524		;;
525	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
526		basic_machine=mips-dec
527		;;
528	decsystem10* | dec10*)
529		basic_machine=pdp10-dec
530		os=-tops10
531		;;
532	decsystem20* | dec20*)
533		basic_machine=pdp10-dec
534		os=-tops20
535		;;
536	delta | 3300 | motorola-3300 | motorola-delta \
537	      | 3300-motorola | delta-motorola)
538		basic_machine=m68k-motorola
539		;;
540	delta88)
541		basic_machine=m88k-motorola
542		os=-sysv3
543		;;
544	dicos)
545		basic_machine=i686-pc
546		os=-dicos
547		;;
548	djgpp)
549		basic_machine=i586-pc
550		os=-msdosdjgpp
551		;;
552	dpx20 | dpx20-*)
553		basic_machine=rs6000-bull
554		os=-bosx
555		;;
556	dpx2* | dpx2*-bull)
557		basic_machine=m68k-bull
558		os=-sysv3
559		;;
560	ebmon29k)
561		basic_machine=a29k-amd
562		os=-ebmon
563		;;
564	elxsi)
565		basic_machine=elxsi-elxsi
566		os=-bsd
567		;;
568	encore | umax | mmax)
569		basic_machine=ns32k-encore
570		;;
571	es1800 | OSE68k | ose68k | ose | OSE)
572		basic_machine=m68k-ericsson
573		os=-ose
574		;;
575	fx2800)
576		basic_machine=i860-alliant
577		;;
578	genix)
579		basic_machine=ns32k-ns
580		;;
581	gmicro)
582		basic_machine=tron-gmicro
583		os=-sysv
584		;;
585	go32)
586		basic_machine=i386-pc
587		os=-go32
588		;;
589	h3050r* | hiux*)
590		basic_machine=hppa1.1-hitachi
591		os=-hiuxwe2
592		;;
593	h8300hms)
594		basic_machine=h8300-hitachi
595		os=-hms
596		;;
597	h8300xray)
598		basic_machine=h8300-hitachi
599		os=-xray
600		;;
601	h8500hms)
602		basic_machine=h8500-hitachi
603		os=-hms
604		;;
605	harris)
606		basic_machine=m88k-harris
607		os=-sysv3
608		;;
609	hp300-*)
610		basic_machine=m68k-hp
611		;;
612	hp300bsd)
613		basic_machine=m68k-hp
614		os=-bsd
615		;;
616	hp300hpux)
617		basic_machine=m68k-hp
618		os=-hpux
619		;;
620	hp3k9[0-9][0-9] | hp9[0-9][0-9])
621		basic_machine=hppa1.0-hp
622		;;
623	hp9k2[0-9][0-9] | hp9k31[0-9])
624		basic_machine=m68000-hp
625		;;
626	hp9k3[2-9][0-9])
627		basic_machine=m68k-hp
628		;;
629	hp9k6[0-9][0-9] | hp6[0-9][0-9])
630		basic_machine=hppa1.0-hp
631		;;
632	hp9k7[0-79][0-9] | hp7[0-79][0-9])
633		basic_machine=hppa1.1-hp
634		;;
635	hp9k78[0-9] | hp78[0-9])
636		# FIXME: really hppa2.0-hp
637		basic_machine=hppa1.1-hp
638		;;
639	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
640		# FIXME: really hppa2.0-hp
641		basic_machine=hppa1.1-hp
642		;;
643	hp9k8[0-9][13679] | hp8[0-9][13679])
644		basic_machine=hppa1.1-hp
645		;;
646	hp9k8[0-9][0-9] | hp8[0-9][0-9])
647		basic_machine=hppa1.0-hp
648		;;
649	hppa-next)
650		os=-nextstep3
651		;;
652	hppaosf)
653		basic_machine=hppa1.1-hp
654		os=-osf
655		;;
656	hppro)
657		basic_machine=hppa1.1-hp
658		os=-proelf
659		;;
660	i370-ibm* | ibm*)
661		basic_machine=i370-ibm
662		;;
663# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
664	i*86v32)
665		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
666		os=-sysv32
667		;;
668	i*86v4*)
669		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
670		os=-sysv4
671		;;
672	i*86v)
673		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
674		os=-sysv
675		;;
676	i*86sol2)
677		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
678		os=-solaris2
679		;;
680	i386mach)
681		basic_machine=i386-mach
682		os=-mach
683		;;
684	i386-vsta | vsta)
685		basic_machine=i386-unknown
686		os=-vsta
687		;;
688	iris | iris4d)
689		basic_machine=mips-sgi
690		case $os in
691		    -irix*)
692			;;
693		    *)
694			os=-irix4
695			;;
696		esac
697		;;
698	isi68 | isi)
699		basic_machine=m68k-isi
700		os=-sysv
701		;;
702	m68knommu)
703		basic_machine=m68k-unknown
704		os=-linux
705		;;
706	m68knommu-*)
707		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
708		os=-linux
709		;;
710	m88k-omron*)
711		basic_machine=m88k-omron
712		;;
713	magnum | m3230)
714		basic_machine=mips-mips
715		os=-sysv
716		;;
717	merlin)
718		basic_machine=ns32k-utek
719		os=-sysv
720		;;
721	mingw32)
722		basic_machine=i386-pc
723		os=-mingw32
724		;;
725	mingw32ce)
726		basic_machine=arm-unknown
727		os=-mingw32ce
728		;;
729	miniframe)
730		basic_machine=m68000-convergent
731		;;
732	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
733		basic_machine=m68k-atari
734		os=-mint
735		;;
736	mipsEE* | ee | ps2)
737		basic_machine=mips64r5900el-scei
738		case $os in
739		    -linux*)
740			;;
741		    *)
742			os=-elf
743			;;
744		esac
745		;;
746	iop)
747		basic_machine=mipsel-scei
748		os=-irx
749		;;
750	dvp)
751		basic_machine=dvp-scei
752		os=-elf
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	-solaris1 | -solaris1.*)
1261		os=`echo $os | sed -e 's|solaris1|sunos4|'`
1262		;;
1263	-solaris)
1264		os=-solaris2
1265		;;
1266	-svr4*)
1267		os=-sysv4
1268		;;
1269	-unixware*)
1270		os=-sysv4.2uw
1271		;;
1272	-gnu/linux*)
1273		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
1274		;;
1275	# First accept the basic system types.
1276	# The portable systems comes first.
1277	# Each alternative MUST END IN A *, to match a version number.
1278	# -sysv* is not here because it comes later, after sysvr4.
1279	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1280	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
1281	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
1282	      | -kopensolaris* \
1283	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1284	      | -aos* | -aros* \
1285	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
1286	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1287	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1288	      | -openbsd* | -solidbsd* \
1289	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1290	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
1291	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
1292	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1293	      | -chorusos* | -chorusrdb* | -cegcc* \
1294	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1295	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
1296	      | -uxpv* | -beos* | -mpeix* | -udk* \
1297	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1298	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1299	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1300	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1301	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1302	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1303	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*)
1304	# Remember, each alternative MUST END IN *, to match a version number.
1305		;;
1306	-qnx*)
1307		case $basic_machine in
1308		    x86-* | i*86-*)
1309			;;
1310		    *)
1311			os=-nto$os
1312			;;
1313		esac
1314		;;
1315	-nto-qnx*)
1316		;;
1317	-nto*)
1318		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1319		;;
1320	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1321	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
1322	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1323		;;
1324	-mac*)
1325		os=`echo $os | sed -e 's|mac|macos|'`
1326		;;
1327	-linux-dietlibc)
1328		os=-linux-dietlibc
1329		;;
1330	-linux*)
1331		os=`echo $os | sed -e 's|linux|linux-gnu|'`
1332		;;
1333	-sunos5*)
1334		os=`echo $os | sed -e 's|sunos5|solaris2|'`
1335		;;
1336	-sunos6*)
1337		os=`echo $os | sed -e 's|sunos6|solaris3|'`
1338		;;
1339	-opened*)
1340		os=-openedition
1341		;;
1342        -os400*)
1343		os=-os400
1344		;;
1345	-wince*)
1346		os=-wince
1347		;;
1348	-osfrose*)
1349		os=-osfrose
1350		;;
1351	-osf*)
1352		os=-osf
1353		;;
1354	-utek*)
1355		os=-bsd
1356		;;
1357	-dynix*)
1358		os=-bsd
1359		;;
1360	-acis*)
1361		os=-aos
1362		;;
1363	-atheos*)
1364		os=-atheos
1365		;;
1366	-syllable*)
1367		os=-syllable
1368		;;
1369	-386bsd)
1370		os=-bsd
1371		;;
1372	-ctix* | -uts*)
1373		os=-sysv
1374		;;
1375	-nova*)
1376		os=-rtmk-nova
1377		;;
1378	-ns2 )
1379		os=-nextstep2
1380		;;
1381	-nsk*)
1382		os=-nsk
1383		;;
1384	# Preserve the version number of sinix5.
1385	-sinix5.*)
1386		os=`echo $os | sed -e 's|sinix|sysv|'`
1387		;;
1388	-sinix*)
1389		os=-sysv4
1390		;;
1391        -tpf*)
1392		os=-tpf
1393		;;
1394	-triton*)
1395		os=-sysv3
1396		;;
1397	-oss*)
1398		os=-sysv3
1399		;;
1400	-svr4)
1401		os=-sysv4
1402		;;
1403	-svr3)
1404		os=-sysv3
1405		;;
1406	-sysvr4)
1407		os=-sysv4
1408		;;
1409	# This must come after -sysvr4.
1410	-sysv*)
1411		;;
1412	-ose*)
1413		os=-ose
1414		;;
1415	-es1800*)
1416		os=-ose
1417		;;
1418	-xenix)
1419		os=-xenix
1420		;;
1421	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1422		os=-mint
1423		;;
1424	-aros*)
1425		os=-aros
1426		;;
1427	-kaos*)
1428		os=-kaos
1429		;;
1430	-zvmoe)
1431		os=-zvmoe
1432		;;
1433	-dicos*)
1434		os=-dicos
1435		;;
1436	-none)
1437		;;
1438	*)
1439		# Get rid of the `-' at the beginning of $os.
1440		os=`echo $os | sed 's/[^-]*-//'`
1441		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1442		exit 1
1443		;;
1444esac
1445else
1446
1447# Here we handle the default operating systems that come with various machines.
1448# The value should be what the vendor currently ships out the door with their
1449# machine or put another way, the most popular os provided with the machine.
1450
1451# Note that if you're going to try to match "-MANUFACTURER" here (say,
1452# "-sun"), then you have to tell the case statement up towards the top
1453# that MANUFACTURER isn't an operating system.  Otherwise, code above
1454# will signal an error saying that MANUFACTURER isn't an operating
1455# system, and we'll never get to this point.
1456
1457case $basic_machine in
1458        score-*)
1459		os=-elf
1460		;;
1461        spu-*)
1462		os=-elf
1463		;;
1464	*-acorn)
1465		os=-riscix1.2
1466		;;
1467	arm*-rebel)
1468		os=-linux
1469		;;
1470	arm*-semi)
1471		os=-aout
1472		;;
1473        c4x-* | tic4x-*)
1474        	os=-coff
1475		;;
1476	# This must come before the *-dec entry.
1477	pdp10-*)
1478		os=-tops20
1479		;;
1480	pdp11-*)
1481		os=-none
1482		;;
1483	*-dec | vax-*)
1484		os=-ultrix4.2
1485		;;
1486	m68*-apollo)
1487		os=-domain
1488		;;
1489	i386-sun)
1490		os=-sunos4.0.2
1491		;;
1492	m68000-sun)
1493		os=-sunos3
1494		# This also exists in the configure program, but was not the
1495		# default.
1496		# os=-sunos4
1497		;;
1498	m68*-cisco)
1499		os=-aout
1500		;;
1501        mep-*)
1502		os=-elf
1503		;;
1504	mips*-cisco)
1505		os=-elf
1506		;;
1507	mips*-*)
1508		os=-elf
1509		;;
1510	or32-*)
1511		os=-coff
1512		;;
1513	*-tti)	# must be before sparc entry or we get the wrong os.
1514		os=-sysv3
1515		;;
1516	sparc-* | *-sun)
1517		os=-sunos4.1.1
1518		;;
1519	*-be)
1520		os=-beos
1521		;;
1522	*-haiku)
1523		os=-haiku
1524		;;
1525	*-ibm)
1526		os=-aix
1527		;;
1528    	*-knuth)
1529		os=-mmixware
1530		;;
1531	*-wec)
1532		os=-proelf
1533		;;
1534	*-winbond)
1535		os=-proelf
1536		;;
1537	*-oki)
1538		os=-proelf
1539		;;
1540	*-hp)
1541		os=-hpux
1542		;;
1543	*-hitachi)
1544		os=-hiux
1545		;;
1546	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1547		os=-sysv
1548		;;
1549	*-cbm)
1550		os=-amigaos
1551		;;
1552	*-dg)
1553		os=-dgux
1554		;;
1555	*-dolphin)
1556		os=-sysv3
1557		;;
1558	m68k-ccur)
1559		os=-rtu
1560		;;
1561	m88k-omron*)
1562		os=-luna
1563		;;
1564	*-next )
1565		os=-nextstep
1566		;;
1567	*-sequent)
1568		os=-ptx
1569		;;
1570	*-crds)
1571		os=-unos
1572		;;
1573	*-ns)
1574		os=-genix
1575		;;
1576	i370-*)
1577		os=-mvs
1578		;;
1579	*-next)
1580		os=-nextstep3
1581		;;
1582	*-gould)
1583		os=-sysv
1584		;;
1585	*-highlevel)
1586		os=-bsd
1587		;;
1588	*-encore)
1589		os=-bsd
1590		;;
1591	*-sgi)
1592		os=-irix
1593		;;
1594	*-siemens)
1595		os=-sysv4
1596		;;
1597	*-masscomp)
1598		os=-rtu
1599		;;
1600	f30[01]-fujitsu | f700-fujitsu)
1601		os=-uxpv
1602		;;
1603	*-rom68k)
1604		os=-coff
1605		;;
1606	*-*bug)
1607		os=-coff
1608		;;
1609	*-apple)
1610		os=-macos
1611		;;
1612	*-atari*)
1613		os=-mint
1614		;;
1615	*)
1616		os=-none
1617		;;
1618esac
1619fi
1620
1621# Here we handle the case where we know the os, and the CPU type, but not the
1622# manufacturer.  We pick the logical manufacturer.
1623vendor=unknown
1624case $basic_machine in
1625	*-unknown)
1626		case $os in
1627			-riscix*)
1628				vendor=acorn
1629				;;
1630			-sunos*)
1631				vendor=sun
1632				;;
1633			-aix*)
1634				vendor=ibm
1635				;;
1636			-beos*)
1637				vendor=be
1638				;;
1639			-hpux*)
1640				vendor=hp
1641				;;
1642			-mpeix*)
1643				vendor=hp
1644				;;
1645			-hiux*)
1646				vendor=hitachi
1647				;;
1648			-unos*)
1649				vendor=crds
1650				;;
1651			-dgux*)
1652				vendor=dg
1653				;;
1654			-luna*)
1655				vendor=omron
1656				;;
1657			-genix*)
1658				vendor=ns
1659				;;
1660			-mvs* | -opened*)
1661				vendor=ibm
1662				;;
1663			-os400*)
1664				vendor=ibm
1665				;;
1666			-ptx*)
1667				vendor=sequent
1668				;;
1669			-tpf*)
1670				vendor=ibm
1671				;;
1672			-vxsim* | -vxworks* | -windiss*)
1673				vendor=wrs
1674				;;
1675			-aux*)
1676				vendor=apple
1677				;;
1678			-hms*)
1679				vendor=hitachi
1680				;;
1681			-mpw* | -macos*)
1682				vendor=apple
1683				;;
1684			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1685				vendor=atari
1686				;;
1687			-vos*)
1688				vendor=stratus
1689				;;
1690		esac
1691		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1692		;;
1693esac
1694
1695echo $basic_machine$os
1696exit
1697
1698# Local variables:
1699# eval: (add-hook 'write-file-hooks 'time-stamp)
1700# time-stamp-start: "timestamp='"
1701# time-stamp-format: "%:y-%02m-%02d"
1702# time-stamp-end: "'"
1703# End:
1704