config.sub revision 38889
1#! /bin/sh
2# Configuration validation subroutine script, version 1.1.
3#   Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
4# This file is (in principle) common to ALL GNU software.
5# The presence of a machine in this file suggests that SOME GNU software
6# can handle that machine.  It does not imply ALL GNU software can.
7#
8# This file is free software; you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 2 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, write to the Free Software
20# Foundation, Inc., 59 Temple Place - Suite 330,
21# Boston, MA 02111-1307, USA.
22
23# As a special exception to the GNU General Public License, if you
24# distribute this file as part of a program that contains a
25# configuration script generated by Autoconf, you may include it under
26# the same distribution terms that you use for the rest of that program.
27
28# Configuration subroutine to validate and canonicalize a configuration type.
29# Supply the specified configuration type as an argument.
30# If it is invalid, we print an error message on stderr and exit with code 1.
31# Otherwise, we print the canonical config type on stdout and succeed.
32
33# This file is supposed to be the same for all GNU packages
34# and recognize all the CPU types, system types and aliases
35# that are meaningful with *any* GNU software.
36# Each package is responsible for reporting which valid configurations
37# it does not support.  The user should be able to distinguish
38# a failure to support a valid configuration from a meaningless
39# configuration.
40
41# The goal of this file is to map all the various variations of a given
42# machine specification into a single specification in the form:
43#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
44# or in some cases, the newer four-part form:
45#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
46# It is wrong to echo any other type of specification.
47
48if [ x$1 = x ]
49then
50	echo Configuration name missing. 1>&2
51	echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
52	echo "or     $0 ALIAS" 1>&2
53	echo where ALIAS is a recognized configuration type. 1>&2
54	exit 1
55fi
56
57# First pass through any local machine types.
58case $1 in
59	*local*)
60		echo $1
61		exit 0
62		;;
63	*)
64	;;
65esac
66
67# CYGNUS LOCAL marketing-names
68# Here we handle any "marketing" names - translating them to
69#  standard triplets
70case $1 in 
71	mips-tx39-elf)
72		set mipstx39-unknown-elf
73                ;;
74	*)
75		;;
76esac
77# END CYGNUS LOCAL marketing-names
78
79# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
80# Here we must recognize all the valid KERNEL-OS combinations.
81maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
82case $maybe_os in
83  linux-gnu*)
84    os=-$maybe_os
85    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
86    ;;
87  *)
88    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
89    if [ $basic_machine != $1 ]
90    then os=`echo $1 | sed 's/.*-/-/'`
91    else os=; fi
92    ;;
93esac
94
95### Let's recognize common machines as not being operating systems so
96### that things like config.sub decstation-3100 work.  We also
97### recognize some manufacturers as not being operating systems, so we
98### can provide default operating systems below.
99case $os in
100	-sun*os*)
101		# Prevent following clause from handling this invalid input.
102		;;
103	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
104	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
105	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
106	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
107	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
108	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
109	-apple)
110		os=
111		basic_machine=$1
112		;;
113	-sim | -cisco | -oki | -wec | -winbond )	# CYGNUS LOCAL
114		os=
115		basic_machine=$1
116		;;
117	-scout)						# CYGNUS LOCAL
118		;;
119	-wrs)						# CYGNUS LOCAL
120		os=vxworks
121		basic_machine=$1
122		;;
123	-hiux*)
124		os=-hiuxwe2
125		;;
126	-sco5)
127		os=sco3.2v5
128		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
129		;;
130	-sco4)
131		os=-sco3.2v4
132		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
133		;;
134	-sco3.2.[4-9]*)
135		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
136		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
137		;;
138	-sco3.2v[4-9]*)
139		# Don't forget version if it is 3.2v4 or newer.
140		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
141		;;
142	-sco*)
143		os=-sco3.2v2
144		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
145		;;
146	-isc)
147		os=-isc2.2
148		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
149		;;
150	-clix*)
151		basic_machine=clipper-intergraph
152		;;
153	-isc*)
154		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
155		;;
156	-lynx*)
157		os=-lynxos
158		;;
159	-ptx*)
160		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
161		;;
162	-windowsnt*)
163		os=`echo $os | sed -e 's/windowsnt/winnt/'`
164		;;
165	-psos*)
166		os=-psos
167		;;
168esac
169
170# Decode aliases for certain CPU-COMPANY combinations.
171case $basic_machine in
172	# Recognize the basic CPU types without company name.
173	# Some are omitted here because they have special meanings below.
174	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
175		| arme[lb] | pyramid | mn10200 | mn10300 \
176		| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
177		| alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \
178		| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
179		| 1750a | dsp16xx | pdp11 \
180		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
181		| mipstx39 | mipstx39el \
182		| sparc | sparclet | sparclite | sparc64 | v850)
183		basic_machine=$basic_machine-unknown
184		;;
185	m88110 | m680[01234]0 | m683?2 | m68360 | z8k | v70 | h8500 | w65) # CYGNUS LOCAL
186		basic_machine=$basic_machine-unknown
187		;;
188	thumb)
189		basic_machine=$basic_machine-unknown
190		;;
191	mips64vr4300 | mips64vr4300el) # CYGNUS LOCAL jsmith/vr4300
192		basic_machine=$basic_machine-unknown
193		;;
194	mips64vr4100 | mips64vr4100el) # CYGNUS LOCAL jsmith/vr4100
195		basic_machine=$basic_machine-unknown
196		;;
197	mips64vr5000 | mips64vr5000el) # CYGNUS LOCAL ian/vr5000
198		basic_machine=$basic_machine-unknown
199		;;
200	mips16) # CYGNUS LOCAL krk/mips16
201		basic_machine=$basic_machine-unknown
202		;;
203	tic30) # CYGNUS LOCAL ian/tic30
204		basic_machine=$basic_machine-unknown
205		;;
206	c30) # CYGNUS LOCAL ian/tic30
207		basic_machine=tic30-unknown
208		;;
209	d10v)				# CYGNUS LOCAL meissner/d10v
210		basic_machine=$basic_machine-unknown
211		;;
212	# We use `pc' rather than `unknown'
213	# because (1) that's what they normally are, and
214	# (2) the word "unknown" tends to confuse beginning users.
215	i[3456]86)
216	  basic_machine=$basic_machine-pc
217	  ;;
218	# Object if more than one company name word.
219	*-*-*)
220		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
221		exit 1
222		;;
223	# Recognize the basic CPU types with company name.
224	vax-* | tahoe-* | i[3456]86-* | i860-* | m32r-* | m68k-* | m68000-* \
225	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
226	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
227	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
228	      | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
229	      | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \
230	      | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \
231	      | xps100-* | clipper-* | orion-* \
232	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
233	      | sparc64-* | mips64-* | mipsel-* \
234	      | mips64el-* | mips64orion-* | mips64orionel-* \
235	      | mipstx39-* | mipstx39el-* \
236	      | f301-*)
237		;;
238	m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # CYGNUS LOCAL
239		;;
240	thumb-*) # CYGNUS LOCAL angela/thumb
241		;;
242	v850-*) # CYGNUS LOCAL
243	        ;;
244	mips64vr4300-* | mips64vr4300el-*) # CYGNUS LOCAL jsmith/vr4300
245		;;
246	mips64vr4100-* | mips64vr4100el-*) # CYGNUS LOCAL jsmith/vr4100
247		;;
248	mips16-*) # CYGNUS LOCAL krk/mips16
249		;;
250	tic30-*) # CYGNUS LOCAL ian/tic30
251		;;
252	c30-*) # CYGNUS LOCAL ian/tic30
253		basic_machine=tic30-unknown
254		;;
255	# Recognize the various machine names and aliases which stand
256	# for a CPU type and a company and sometimes even an OS.
257	386bsd)						# CYGNUS LOCAL
258		basic_machine=i386-unknown
259		os=-bsd
260		;;
261	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
262		basic_machine=m68000-att
263		;;
264	3b*)
265		basic_machine=we32k-att
266		;;
267	a29khif)					# CYGNUS LOCAL
268		basic_machine=a29k-amd
269		os=-udi
270		;;
271	adobe68k)					# CYGNUS LOCAL
272		basic_machine=m68010-adobe
273		os=-scout
274		;;
275	alliant | fx80)
276		basic_machine=fx80-alliant
277		;;
278	altos | altos3068)
279		basic_machine=m68k-altos
280		;;
281	am29k)
282		basic_machine=a29k-none
283		os=-bsd
284		;;
285	amdahl)
286		basic_machine=580-amdahl
287		os=-sysv
288		;;
289	amiga | amiga-*)
290		basic_machine=m68k-cbm
291		;;
292	amigados)
293		basic_machine=m68k-cbm
294		os=-amigados
295		;;
296	amigaunix | amix)
297		basic_machine=m68k-cbm
298		os=-sysv4
299		;;
300	apollo68)
301		basic_machine=m68k-apollo
302		os=-sysv
303		;;
304	apollo68bsd)					# CYGNUS LOCAL
305		basic_machine=m68k-apollo
306		os=-bsd
307		;;
308	aux)
309		basic_machine=m68k-apple
310		os=-aux
311		;;
312	balance)
313		basic_machine=ns32k-sequent
314		os=-dynix
315		;;
316	convex-c1)
317		basic_machine=c1-convex
318		os=-bsd
319		;;
320	convex-c2)
321		basic_machine=c2-convex
322		os=-bsd
323		;;
324	convex-c32)
325		basic_machine=c32-convex
326		os=-bsd
327		;;
328	convex-c34)
329		basic_machine=c34-convex
330		os=-bsd
331		;;
332	convex-c38)
333		basic_machine=c38-convex
334		os=-bsd
335		;;
336	cray | ymp)
337		basic_machine=ymp-cray
338		os=-unicos
339		;;
340	cray2)
341		basic_machine=cray2-cray
342		os=-unicos
343		;;
344	[ctj]90-cray)
345		basic_machine=c90-cray
346		os=-unicos
347		;;
348	crds | unos)
349		basic_machine=m68k-crds
350		;;
351	da30 | da30-*)
352		basic_machine=m68k-da30
353		;;
354	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
355		basic_machine=mips-dec
356		;;
357	delta | 3300 | motorola-3300 | motorola-delta \
358	      | 3300-motorola | delta-motorola)
359		basic_machine=m68k-motorola
360		;;
361	delta88)
362		basic_machine=m88k-motorola
363		os=-sysv3
364		;;
365	dpx20 | dpx20-*)
366		basic_machine=rs6000-bull
367		os=-bosx
368		;;
369	dpx2* | dpx2*-bull)
370		basic_machine=m68k-bull
371		os=-sysv3
372		;;
373	ebmon29k)
374		basic_machine=a29k-amd
375		os=-ebmon
376		;;
377	elxsi)
378		basic_machine=elxsi-elxsi
379		os=-bsd
380		;;
381	encore | umax | mmax)
382		basic_machine=ns32k-encore
383		;;
384	es1800 | OSE68k | ose68k | ose | OSE)		# CYGNUS LOCAL
385		basic_machine=m68k-ericsson
386		os=-ose
387		;;
388	fx2800)
389		basic_machine=i860-alliant
390		;;
391	genix)
392		basic_machine=ns32k-ns
393		;;
394	gmicro)
395		basic_machine=tron-gmicro
396		os=-sysv
397		;;
398	h3050r* | hiux*)
399		basic_machine=hppa1.1-hitachi
400		os=-hiuxwe2
401		;;
402	h8300hms)
403		basic_machine=h8300-hitachi
404		os=-hms
405		;;
406	h8300xray)					# CYGNUS LOCAL
407		basic_machine=h8300-hitachi
408		os=-xray
409		;;
410	h8500hms)					# CYGNUS LOCAL
411		basic_machine=h8500-hitachi
412		os=-hms
413		;;
414	harris)
415		basic_machine=m88k-harris
416		os=-sysv3
417		;;
418	hp300-*)
419		basic_machine=m68k-hp
420		;;
421	hp300bsd)
422		basic_machine=m68k-hp
423		os=-bsd
424		;;
425	hp300hpux)
426		basic_machine=m68k-hp
427		os=-hpux
428		;;
429        w89k-*)						# CYGNUS LOCAL
430                basic_machine=hppa1.1-winbond
431                os=-proelf
432                ;;
433        op50n-*)					# CYGNUS LOCAL
434                basic_machine=hppa1.1-oki
435                os=-proelf
436                ;;
437        op60c-*)					# CYGNUS LOCAL
438                basic_machine=hppa1.1-oki
439                os=-proelf
440                ;;
441        hppro)						# CYGNUS LOCAL
442                basic_machine=hppa1.1-hp
443                os=-proelf
444                ;;
445	hp9k2[0-9][0-9] | hp9k31[0-9])
446		basic_machine=m68000-hp
447		;;
448	hp9k3[2-9][0-9])
449		basic_machine=m68k-hp
450		;;
451	hp9k6[0-9][0-9] | hp6[0-9][0-9] )
452		basic_machine=hppa1.0-hp
453		;;
454	hp9k7[0-79][0-9] | hp7[0-79][0-9] )
455		basic_machine=hppa1.1-hp
456		;;
457	hp9k78[0-9] | hp78[0-9] )
458		# FIXME: really hppa2.0-hp
459		basic_machine=hppa1.1-hp
460		;;
461	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
462	hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
463		# FIXME: really hppa2.0-hp
464		basic_machine=hppa1.1-hp
465		;;
466	hp9k8[0-9][13679] | hp8[0-9][13679] )
467		basic_machine=hppa1.1-hp
468		;;
469	hp9k8[0-9][0-9] | hp8[0-9][0-9])
470		basic_machine=hppa1.0-hp
471		;;
472	hppa-next)
473		os=-nextstep3
474		;;
475	hppaosf)					# CYGNUS LOCAL
476		basic_machine=hppa1.1-hp
477		os=-osf
478		;;
479	i370-ibm* | ibm*)
480		basic_machine=i370-ibm
481		os=-mvs
482		;;
483# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
484	i[3456]86v32)
485		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
486		os=-sysv32
487		;;
488	i[3456]86v4*)
489		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
490		os=-sysv4
491		;;
492	i[3456]86v)
493		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
494		os=-sysv
495		;;
496	i[3456]86sol2)
497		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
498		os=-solaris2
499		;;
500	i386mach)					# CYGNUS LOCAL
501		basic_machine=i386-mach
502		os=-mach
503		;;
504	i386-vsta | vsta)				# CYGNUS LOCAL
505		basic_machine=i386-unknown
506		os=-vsta
507		;;
508	i386-go32 | go32)				# CYGNUS LOCAL
509		basic_machine=i386-unknown
510		os=-go32
511		;;
512	i386-mingw32 | mingw32)
513		basic_machine=i386-unknown
514		os=-mingw32
515		;;
516	iris | iris4d)
517		basic_machine=mips-sgi
518		case $os in
519		    -irix*)
520			;;
521		    *)
522			os=-irix4
523			;;
524		esac
525		;;
526	isi68 | isi)
527		basic_machine=m68k-isi
528		os=-sysv
529		;;
530	m88k-omron*)
531		basic_machine=m88k-omron
532		;;
533	magnum | m3230)
534		basic_machine=mips-mips
535		os=-sysv
536		;;
537	merlin)
538		basic_machine=ns32k-utek
539		os=-sysv
540		;;
541	miniframe)
542		basic_machine=m68000-convergent
543		;;
544	mipsel*-linux*)
545		basic_machine=mipsel-unknown
546		os=-linux-gnu
547		;;
548	mips*-linux*)
549		basic_machine=mips-unknown
550		os=-linux-gnu
551		;;
552	mips3*-*)
553		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
554		;;
555	mips3*)
556		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
557		;;
558	monitor)					# CYGNUS LOCAL
559		basic_machine=m68k-rom68k
560		os=-coff
561		;;
562	msdos)						# CYGNUS LOCAL
563		basic_machine=i386-unknown	
564		os=-msdos
565		;;
566	ncr3000)
567		basic_machine=i486-ncr
568		os=-sysv4
569		;;
570	netbsd386)
571		basic_machine=i386-unknown		# CYGNUS LOCAL
572		os=-netbsd
573		;;
574	news | news700 | news800 | news900)
575		basic_machine=m68k-sony
576		os=-newsos
577		;;
578	news1000)
579		basic_machine=m68030-sony
580		os=-newsos
581		;;
582	news-3600 | risc-news)
583		basic_machine=mips-sony
584		os=-newsos
585		;;
586	necv70)						# CYGNUS LOCAL
587		basic_machine=v70-nec
588		os=-sysv
589		;;
590	next | m*-next )
591		basic_machine=m68k-next
592		case $os in
593		    -nextstep* )
594			;;
595		    -ns2*)
596		      os=-nextstep2
597			;;
598		    *)
599		      os=-nextstep3
600			;;
601		esac
602		;;
603	nh3000)
604		basic_machine=m68k-harris
605		os=-cxux
606		;;
607	nh[45]000)
608		basic_machine=m88k-harris
609		os=-cxux
610		;;
611	nindy960)
612		basic_machine=i960-intel
613		os=-nindy
614		;;
615	mon960)						# CYGNUS LOCAL
616		basic_machine=i960-intel
617		os=-mon960
618		;;
619	np1)
620		basic_machine=np1-gould
621		;;
622	OSE68000 | ose68000)				# CYGNUS LOCAL
623		basic_machine=m68000-ericsson
624		os=-ose
625		;;
626	os68k)						# CYGNUS LOCAL
627		basic_machine=m68k-none
628		os=-os68k
629		;;
630	pa-hitachi)
631		basic_machine=hppa1.1-hitachi
632		os=-hiuxwe2
633		;;
634	paragon)
635		basic_machine=i860-intel
636		os=-osf
637		;;
638	pbd)
639		basic_machine=sparc-tti
640		;;
641	pbb)
642		basic_machine=m68k-tti
643		;;
644        pc532 | pc532-*)
645		basic_machine=ns32k-pc532
646		;;
647	pentium | p5)
648		basic_machine=i586-intel
649		;;
650	pentiumpro | p6)
651		basic_machine=i686-intel
652		;;
653	pentium-* | p5-*)
654		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
655		;;
656	pentiumpro-* | p6-*)
657		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
658		;;
659	k5)
660		# We don't have specific support for AMD's K5 yet, so just call it a Pentium
661		basic_machine=i586-amd
662		;;
663	nexen)
664		# We don't have specific support for Nexgen yet, so just call it a Pentium
665		basic_machine=i586-nexgen
666		;;
667	pn)
668		basic_machine=pn-gould
669		;;
670	power)	basic_machine=rs6000-ibm
671		;;
672	ppc)	basic_machine=powerpc-unknown
673	        ;;
674	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
675		;;
676	ppcle | powerpclittle | ppc-le | powerpc-little)
677		basic_machine=powerpcle-unknown
678	        ;;
679	ppcle-* | powerpclittle-*)
680		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
681		;;
682	ps2)
683		basic_machine=i386-ibm
684		;;
685	rom68k)						# CYGNUS LOCAL
686		basic_machine=m68k-rom68k
687		os=-coff
688		;;
689	rm[46]00)
690		basic_machine=mips-siemens
691		;;
692	rtpc | rtpc-*)
693		basic_machine=romp-ibm
694		;;
695	sa29200)					# CYGNUS LOCAL
696		basic_machine=a29k-amd
697		os=-udi
698		;;
699	sequent)
700		basic_machine=i386-sequent
701		;;
702	sh)
703		basic_machine=sh-hitachi
704		os=-hms
705		;;
706	sparclite-wrs)					# CYGNUS LOCAL
707		basic_machine=sparclite-wrs
708		os=-vxworks
709		;;
710	sps7)
711		basic_machine=m68k-bull
712		os=-sysv2
713		;;
714	spur)
715		basic_machine=spur-unknown
716		;;
717	st2000)						# CYGNUS LOCAL
718		basic_machine=m68k-tandem
719		;;
720	stratus)					# CYGNUS LOCAL
721		basic_machine=i860-stratus
722		os=-sysv4
723		;;
724	sun2)
725		basic_machine=m68000-sun
726		;;
727	sun2os3)
728		basic_machine=m68000-sun
729		os=-sunos3
730		;;
731	sun2os4)
732		basic_machine=m68000-sun
733		os=-sunos4
734		;;
735	sun3os3)
736		basic_machine=m68k-sun
737		os=-sunos3
738		;;
739	sun3os4)
740		basic_machine=m68k-sun
741		os=-sunos4
742		;;
743	sun4os3)
744		basic_machine=sparc-sun
745		os=-sunos3
746		;;
747	sun4os4)
748		basic_machine=sparc-sun
749		os=-sunos4
750		;;
751	sun4sol2)
752		basic_machine=sparc-sun
753		os=-solaris2
754		;;
755	sun3 | sun3-*)
756		basic_machine=m68k-sun
757		;;
758	sun4)
759		basic_machine=sparc-sun
760		;;
761	sun386 | sun386i | roadrunner)
762		basic_machine=i386-sun
763		;;
764	symmetry)
765		basic_machine=i386-sequent
766		os=-dynix
767		;;
768	tx39)
769		basic_machine=mipstx39-unknown
770		;;
771	tx39el)
772		basic_machine=mipstx39el-unknown
773		;;
774	tower | tower-32)
775		basic_machine=m68k-ncr
776		;;
777	udi29k)
778		basic_machine=a29k-amd
779		os=-udi
780		;;
781	ultra3)
782		basic_machine=a29k-nyu
783		os=-sym1
784		;;
785	v810 | necv810)					# CYGNUS LOCAL
786		basic_machine=v810-nec
787		os=-none
788		;;
789	vaxv)
790		basic_machine=vax-dec
791		os=-sysv
792		;;
793	vms)
794		basic_machine=vax-dec
795		os=-vms
796		;;
797	vpp*|vx|vx-*)
798               basic_machine=f301-fujitsu
799               ;;
800	vxworks960)
801		basic_machine=i960-wrs
802		os=-vxworks
803		;;
804	vxworks68)
805		basic_machine=m68k-wrs
806		os=-vxworks
807		;;
808	vxworks29k)
809		basic_machine=a29k-wrs
810		os=-vxworks
811		;;
812	w65*)						# CYGNUS LOCAL
813 		basic_machine=w65-wdc
814 		os=-none
815		;;
816	xmp)
817		basic_machine=xmp-cray
818		os=-unicos
819		;;
820        xps | xps100)
821		basic_machine=xps100-honeywell
822		;;
823	z8k-*-coff)					# CYGNUS LOCAL
824		basic_machine=z8k-unknown
825		os=-sim
826		;;
827	none)
828		basic_machine=none-none
829		os=-none
830		;;
831
832# Here we handle the default manufacturer of certain CPU types.  It is in
833# some cases the only manufacturer, in others, it is the most popular.
834	w89k)						# CYGNUS LOCAL
835		basic_machine=hppa1.1-winbond
836		;;
837	op50n)						# CYGNUS LOCAL
838		basic_machine=hppa1.1-oki
839		;;
840	op60c)						# CYGNUS LOCAL
841		basic_machine=hppa1.1-oki
842		;;
843	mips)
844		if [ x$os = x-linux-gnu ]; then
845			basic_machine=mips-unknown
846		else
847			basic_machine=mips-mips
848		fi
849		;;
850	romp)
851		basic_machine=romp-ibm
852		;;
853	rs6000)
854		basic_machine=rs6000-ibm
855		;;
856	vax)
857		basic_machine=vax-dec
858		;;
859	pdp11)
860		basic_machine=pdp11-dec
861		;;
862	we32k)
863		basic_machine=we32k-att
864		;;
865	sparc)
866		basic_machine=sparc-sun
867		;;
868        cydra)
869		basic_machine=cydra-cydrome
870		;;
871	orion)
872		basic_machine=orion-highlevel
873		;;
874	orion105)
875		basic_machine=clipper-highlevel
876		;;
877	mac | mpw | mac-mpw)				# CYGNUS LOCAL
878		basic_machine=m68k-apple
879		;;
880	pmac | pmac-mpw)				# CYGNUS LOCAL
881		basic_machine=powerpc-apple
882		;;
883	*)
884		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
885		exit 1
886		;;
887esac
888
889# Here we canonicalize certain aliases for manufacturers.
890case $basic_machine in
891	*-digital*)
892		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
893		;;
894	*-commodore*)
895		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
896		;;
897	*)
898		;;
899esac
900
901# Decode manufacturer-specific aliases for certain operating systems.
902
903if [ x"$os" != x"" ]
904then
905case $os in
906        # First match some system type aliases
907        # that might get confused with valid system types.
908	# -solaris* is a basic system type, with this one exception.
909	-solaris1 | -solaris1.*)
910		os=`echo $os | sed -e 's|solaris1|sunos4|'`
911		;;
912	-solaris)
913		os=-solaris2
914		;;
915	-unixware* | svr4*)
916		os=-sysv4
917		;;
918	-gnu/linux*)
919		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
920		;;
921	# First accept the basic system types.
922	# The portable systems comes first.
923	# Each alternative MUST END IN A *, to match a version number.
924	# -sysv* is not here because it comes later, after sysvr4.
925	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
926	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
927	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
928	      | -amigados* | -msdos* | -newsos* | -unicos* | -aof* | -aos* \
929	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
930	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
931	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
932	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
933	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
934	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
935	      | -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
936	      | -mingw32* | -linux-gnu* | -uxpv*)
937	# Remember, each alternative MUST END IN *, to match a version number.
938		;;
939	# CYGNUS LOCAL
940	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
941	      | -windows* | -osx | -abug |  -netware* | -os9* | -beos* \
942	      | -macos* | -mpw* | -magic* | -mon960* | -lnews* )
943		;;
944	-mac*)
945		os=`echo $os | sed -e 's|mac|macos|'`
946		;;
947	# END CYGNUS LOCAL
948	-linux*)
949		os=`echo $os | sed -e 's|linux|linux-gnu|'`
950		;;
951	-sunos5*)
952		os=`echo $os | sed -e 's|sunos5|solaris2|'`
953		;;
954	-sunos6*)
955		os=`echo $os | sed -e 's|sunos6|solaris3|'`
956		;;
957	-osfrose*)
958		os=-osfrose
959		;;
960	-osf*)
961		os=-osf
962		;;
963	-utek*)
964		os=-bsd
965		;;
966	-dynix*)
967		os=-bsd
968		;;
969	-acis*)
970		os=-aos
971		;;
972	-386bsd)					# CYGNUS LOCAL
973		os=-bsd
974		;;
975	-ctix* | -uts*)
976		os=-sysv
977		;;
978	-ns2 )
979	        os=-nextstep2
980		;;
981	# Preserve the version number of sinix5.
982	-sinix5.*)
983		os=`echo $os | sed -e 's|sinix|sysv|'`
984		;;
985	-sinix*)
986		os=-sysv4
987		;;
988	-triton*)
989		os=-sysv3
990		;;
991	-oss*)
992		os=-sysv3
993		;;
994	-svr4)
995		os=-sysv4
996		;;
997	-svr3)
998		os=-sysv3
999		;;
1000	-sysvr4)
1001		os=-sysv4
1002		;;
1003	# This must come after -sysvr4.
1004	-sysv*)
1005		;;
1006	-ose*)						# CYGNUS LOCAL
1007		os=-ose
1008		;;
1009	-es1800*)					# CYGNUS LOCAL
1010		os=-ose
1011		;;
1012	-xenix)
1013		os=-xenix
1014		;;
1015	-none)
1016		;;
1017	*)
1018		# Get rid of the `-' at the beginning of $os.
1019		os=`echo $os | sed 's/[^-]*-//'`
1020		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
1021		exit 1
1022		;;
1023esac
1024else
1025
1026# Here we handle the default operating systems that come with various machines.
1027# The value should be what the vendor currently ships out the door with their
1028# machine or put another way, the most popular os provided with the machine.
1029
1030# Note that if you're going to try to match "-MANUFACTURER" here (say,
1031# "-sun"), then you have to tell the case statement up towards the top
1032# that MANUFACTURER isn't an operating system.  Otherwise, code above
1033# will signal an error saying that MANUFACTURER isn't an operating
1034# system, and we'll never get to this point.
1035
1036case $basic_machine in
1037	*-acorn)
1038		os=-riscix1.2
1039		;;
1040	arm*-semi)
1041		os=-aout
1042		;;
1043        pdp11-*)
1044		os=-none
1045		;;
1046	*-dec | vax-*)
1047		os=-ultrix4.2
1048		;;
1049	m68*-apollo)
1050		os=-domain
1051		;;
1052	i386-sun)
1053		os=-sunos4.0.2
1054		;;
1055	m68000-sun)
1056		os=-sunos3
1057		# This also exists in the configure program, but was not the
1058		# default.
1059		# os=-sunos4
1060		;;
1061	m68*-cisco)					# CYGNUS LOCAL
1062		os=-aout
1063		;;
1064	mips*-cisco)					# CYGNUS LOCAL
1065		os=-elf
1066		;;
1067        mips*-*)                                        # CYGNUS LOCAL
1068                os=-elf
1069                ;;
1070	*-tti)	# must be before sparc entry or we get the wrong os.
1071		os=-sysv3
1072		;;
1073	sparc-* | *-sun)
1074		os=-sunos4.1.1
1075		;;
1076	*-be)						# CYGNUS LOCAL
1077		os=-beos
1078		;;
1079	*-ibm)
1080		os=-aix
1081		;;
1082	*-wec)						# CYGNUS LOCAL
1083		os=-proelf
1084		;;
1085	*-winbond)					# CYGNUS LOCAL
1086		os=-proelf
1087		;;
1088	*-oki)						# CYGNUS LOCAL
1089		os=-proelf
1090		;;
1091	*-hp)
1092		os=-hpux
1093		;;
1094	*-hitachi)
1095		os=-hiux
1096		;;
1097	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1098		os=-sysv
1099		;;
1100	*-cbm)
1101		os=-amigados
1102		;;
1103	*-dg)
1104		os=-dgux
1105		;;
1106	*-dolphin)
1107		os=-sysv3
1108		;;
1109	m68k-ccur)
1110		os=-rtu
1111		;;
1112	m88k-omron*)
1113		os=-luna
1114		;;
1115	*-next )
1116		os=-nextstep
1117		;;
1118	*-sequent)
1119		os=-ptx
1120		;;
1121	*-crds)
1122		os=-unos
1123		;;
1124	*-ns)
1125		os=-genix
1126		;;
1127	i370-*)
1128		os=-mvs
1129		;;
1130	*-next)
1131		os=-nextstep3
1132		;;
1133        *-gould)
1134		os=-sysv
1135		;;
1136        *-highlevel)
1137		os=-bsd
1138		;;
1139	*-encore)
1140		os=-bsd
1141		;;
1142        *-sgi)
1143		os=-irix
1144		;;
1145        *-siemens)
1146		os=-sysv4
1147		;;
1148	*-masscomp)
1149		os=-rtu
1150		;;
1151	f301-fujitsu)
1152		os=-uxpv
1153		;;
1154	*-rom68k)					# CYGNUS LOCAL
1155		os=-coff
1156		;;
1157	*-*bug)						# CYGNUS LOCAL
1158		os=-coff
1159		;;
1160	*-apple)					# CYGNUS LOCAL
1161		os=-macos
1162		;;
1163	*)
1164		os=-none
1165		;;
1166esac
1167fi
1168
1169# Here we handle the case where we know the os, and the CPU type, but not the
1170# manufacturer.  We pick the logical manufacturer.
1171vendor=unknown
1172case $basic_machine in
1173	*-unknown)
1174		case $os in
1175			-riscix*)
1176				vendor=acorn
1177				;;
1178			-sunos*)
1179				vendor=sun
1180				;;
1181			-aix*)
1182				vendor=ibm
1183				;;
1184			-beos*)						# CYGNUS LOCAL
1185				vendor=be
1186				;;
1187			-hpux*)
1188				vendor=hp
1189				;;
1190			-hiux*)
1191				vendor=hitachi
1192				;;
1193			-unos*)
1194				vendor=crds
1195				;;
1196			-dgux*)
1197				vendor=dg
1198				;;
1199			-luna*)
1200				vendor=omron
1201				;;
1202			-genix*)
1203				vendor=ns
1204				;;
1205			-mvs*)
1206				vendor=ibm
1207				;;
1208			-ptx*)
1209				vendor=sequent
1210				;;
1211			-vxsim* | -vxworks*)
1212				vendor=wrs
1213				;;
1214			-aux*)
1215				vendor=apple
1216				;;
1217			-hms*)				# CYGNUS LOCAL
1218				vendor=hitachi
1219				;;
1220			-mpw* | -macos*)		# CYGNUS LOCAL
1221				vendor=apple
1222				;;
1223		esac
1224		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
1225		;;
1226esac
1227
1228echo $basic_machine$os
1229