config.sub revision 50276
1169691Skan#! /bin/sh
2169691Skan# Configuration validation subroutine script, version 1.1.
3169691Skan#   Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
4169691Skan# This file is (in principle) common to ALL GNU software.
5169691Skan# The presence of a machine in this file suggests that SOME GNU software
6169691Skan# can handle that machine.  It does not imply ALL GNU software can.
7169691Skan#
8169691Skan# This file is free software; you can redistribute it and/or modify
9169691Skan# it under the terms of the GNU General Public License as published by
10169691Skan# the Free Software Foundation; either version 2 of the License, or
11169691Skan# (at your option) any later version.
12169691Skan#
13169691Skan# This program is distributed in the hope that it will be useful,
14169691Skan# but WITHOUT ANY WARRANTY; without even the implied warranty of
15169691Skan# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16169691Skan# GNU General Public License for more details.
17169691Skan#
18169691Skan# You should have received a copy of the GNU General Public License
19169691Skan# along with this program; if not, write to the Free Software
20169691Skan# Foundation, Inc., 59 Temple Place - Suite 330,
21169691Skan# Boston, MA 02111-1307, USA.
22169691Skan
23169691Skan# As a special exception to the GNU General Public License, if you
24169691Skan# distribute this file as part of a program that contains a
25169691Skan# configuration script generated by Autoconf, you may include it under
26169691Skan# the same distribution terms that you use for the rest of that program.
27169691Skan
28169691Skan# Configuration subroutine to validate and canonicalize a configuration type.
29169691Skan# Supply the specified configuration type as an argument.
30169691Skan# If it is invalid, we print an error message on stderr and exit with code 1.
31169691Skan# Otherwise, we print the canonical config type on stdout and succeed.
32169691Skan
33169691Skan# This file is supposed to be the same for all GNU packages
34169691Skan# and recognize all the CPU types, system types and aliases
35169691Skan# that are meaningful with *any* GNU software.
36169691Skan# Each package is responsible for reporting which valid configurations
37169691Skan# it does not support.  The user should be able to distinguish
38169691Skan# a failure to support a valid configuration from a meaningless
39169691Skan# 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# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
68# Here we must recognize all the valid KERNEL-OS combinations.
69maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
70case $maybe_os in
71  linux-gnu*)
72    os=-$maybe_os
73    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
74    ;;
75  *)
76    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
77    if [ $basic_machine != $1 ]
78    then os=`echo $1 | sed 's/.*-/-/'`
79    else os=; fi
80    ;;
81esac
82
83### Let's recognize common machines as not being operating systems so
84### that things like config.sub decstation-3100 work.  We also
85### recognize some manufacturers as not being operating systems, so we
86### can provide default operating systems below.
87case $os in
88	-sun*os*)
89		# Prevent following clause from handling this invalid input.
90		;;
91	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
92	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
93	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
94	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
95	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
96	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
97	-apple)
98		os=
99		basic_machine=$1
100		;;
101	-hiux*)
102		os=-hiuxwe2
103		;;
104	-sco5)
105		os=sco3.2v5
106		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
107		;;
108	-sco4)
109		os=-sco3.2v4
110		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
111		;;
112	-sco3.2.[4-9]*)
113		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
114		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
115		;;
116	-sco3.2v[4-9]*)
117		# Don't forget version if it is 3.2v4 or newer.
118		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
119		;;
120	-sco*)
121		os=-sco3.2v2
122		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
123		;;
124	-isc)
125		os=-isc2.2
126		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
127		;;
128	-clix*)
129		basic_machine=clipper-intergraph
130		;;
131	-isc*)
132		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
133		;;
134	-lynx*)
135		os=-lynxos
136		;;
137	-ptx*)
138		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
139		;;
140	-windowsnt*)
141		os=`echo $os | sed -e 's/windowsnt/winnt/'`
142		;;
143	-psos*)
144		os=-psos
145		;;
146esac
147
148# Decode aliases for certain CPU-COMPANY combinations.
149case $basic_machine in
150	# Recognize the basic CPU types without company name.
151	# Some are omitted here because they have special meanings below.
152	tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
153		| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
154		| 580 | i960 | h8300 \
155		| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w \
156		| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
157		| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
158		| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
159		| mipstx39 | mipstx39el \
160		| sparc | sparclet | sparclite | sparc64 | v850)
161		basic_machine=$basic_machine-unknown
162		;;
163	# We use `pc' rather than `unknown'
164	# because (1) that's what they normally are, and
165	# (2) the word "unknown" tends to confuse beginning users.
166	i[34567]86)
167	  basic_machine=$basic_machine-pc
168	  ;;
169	# Object if more than one company name word.
170	*-*-*)
171		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
172		exit 1
173		;;
174	# Recognize the basic CPU types with company name.
175	vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
176	      | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
177	      | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
178	      | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
179	      | xmp-* | ymp-* \
180	      | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
181	      | alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
182	      | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
183	      | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
184	      | sparc64-* | mips64-* | mipsel-* \
185	      | mips64el-* | mips64orion-* | mips64orionel-*  \
186	      | mipstx39-* | mipstx39el-* \
187	      | f301-*)
188		;;
189	# Recognize the various machine names and aliases which stand
190	# for a CPU type and a company and sometimes even an OS.
191	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
192		basic_machine=m68000-att
193		;;
194	3b*)
195		basic_machine=we32k-att
196		;;
197	alliant | fx80)
198		basic_machine=fx80-alliant
199		;;
200	altos | altos3068)
201		basic_machine=m68k-altos
202		;;
203	am29k)
204		basic_machine=a29k-none
205		os=-bsd
206		;;
207	amdahl)
208		basic_machine=580-amdahl
209		os=-sysv
210		;;
211	amiga | amiga-*)
212		basic_machine=m68k-cbm
213		;;
214	amigaos | amigados)
215		basic_machine=m68k-cbm
216		os=-amigaos
217		;;
218	amigaunix | amix)
219		basic_machine=m68k-cbm
220		os=-sysv4
221		;;
222	apollo68)
223		basic_machine=m68k-apollo
224		os=-sysv
225		;;
226	aux)
227		basic_machine=m68k-apple
228		os=-aux
229		;;
230	balance)
231		basic_machine=ns32k-sequent
232		os=-dynix
233		;;
234	convex-c1)
235		basic_machine=c1-convex
236		os=-bsd
237		;;
238	convex-c2)
239		basic_machine=c2-convex
240		os=-bsd
241		;;
242	convex-c32)
243		basic_machine=c32-convex
244		os=-bsd
245		;;
246	convex-c34)
247		basic_machine=c34-convex
248		os=-bsd
249		;;
250	convex-c38)
251		basic_machine=c38-convex
252		os=-bsd
253		;;
254	cray | ymp)
255		basic_machine=ymp-cray
256		os=-unicos
257		;;
258	cray2)
259		basic_machine=cray2-cray
260		os=-unicos
261		;;
262	[ctj]90-cray)
263		basic_machine=c90-cray
264		os=-unicos
265		;;
266	crds | unos)
267		basic_machine=m68k-crds
268		;;
269	da30 | da30-*)
270		basic_machine=m68k-da30
271		;;
272	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
273		basic_machine=mips-dec
274		;;
275	delta | 3300 | motorola-3300 | motorola-delta \
276	      | 3300-motorola | delta-motorola)
277		basic_machine=m68k-motorola
278		;;
279	delta88)
280		basic_machine=m88k-motorola
281		os=-sysv3
282		;;
283	dpx20 | dpx20-*)
284		basic_machine=rs6000-bull
285		os=-bosx
286		;;
287	dpx2* | dpx2*-bull)
288		basic_machine=m68k-bull
289		os=-sysv3
290		;;
291	ebmon29k)
292		basic_machine=a29k-amd
293		os=-ebmon
294		;;
295	elxsi)
296		basic_machine=elxsi-elxsi
297		os=-bsd
298		;;
299	encore | umax | mmax)
300		basic_machine=ns32k-encore
301		;;
302	fx2800)
303		basic_machine=i860-alliant
304		;;
305	genix)
306		basic_machine=ns32k-ns
307		;;
308	gmicro)
309		basic_machine=tron-gmicro
310		os=-sysv
311		;;
312	h3050r* | hiux*)
313		basic_machine=hppa1.1-hitachi
314		os=-hiuxwe2
315		;;
316	h8300hms)
317		basic_machine=h8300-hitachi
318		os=-hms
319		;;
320	harris)
321		basic_machine=m88k-harris
322		os=-sysv3
323		;;
324	hp300-*)
325		basic_machine=m68k-hp
326		;;
327	hp300bsd)
328		basic_machine=m68k-hp
329		os=-bsd
330		;;
331	hp300hpux)
332		basic_machine=m68k-hp
333		os=-hpux
334		;;
335	hp9k2[0-9][0-9] | hp9k31[0-9])
336		basic_machine=m68000-hp
337		;;
338	hp9k3[2-9][0-9])
339		basic_machine=m68k-hp
340		;;
341	hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
342		basic_machine=hppa1.1-hp
343		;;
344	hp9k8[0-9][0-9] | hp8[0-9][0-9])
345		basic_machine=hppa1.0-hp
346		;;
347	hppa-next)
348		os=-nextstep3
349		;;
350	i370-ibm* | ibm*)
351		basic_machine=i370-ibm
352		os=-mvs
353		;;
354	s390 | s390-ibm*)
355# OS/390 support after:
356#  Linkname: Mortice Kern Systems (MKS) Inc. - OS/390 OpenEdition -- GNU Utilities Downloads
357#       URL: http://www.mks.com/s390/gnu/download.htm#autoconf
358		basic_machine=s390-ibm  #  /* S/390 -- gil -- 1419 */
359		os=-os390
360		;;
361# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
362	i[34567]86v32)
363		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
364		os=-sysv32
365		;;
366	i[34567]86v4*)
367		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
368		os=-sysv4
369		;;
370	i[34567]86v)
371		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
372		os=-sysv
373		;;
374	i[34567]86sol2)
375		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
376		os=-solaris2
377		;;
378	iris | iris4d)
379		basic_machine=mips-sgi
380		case $os in
381		    -irix*)
382			;;
383		    *)
384			os=-irix4
385			;;
386		esac
387		;;
388	isi68 | isi)
389		basic_machine=m68k-isi
390		os=-sysv
391		;;
392	m88k-omron*)
393		basic_machine=m88k-omron
394		;;
395	magnum | m3230)
396		basic_machine=mips-mips
397		os=-sysv
398		;;
399	merlin)
400		basic_machine=ns32k-utek
401		os=-sysv
402		;;
403	miniframe)
404		basic_machine=m68000-convergent
405		;;
406	mipsel*-linux*)
407		basic_machine=mipsel-unknown
408		os=-linux-gnu
409		;;
410	mips*-linux*)
411		basic_machine=mips-unknown
412		os=-linux-gnu
413		;;
414	mips3*-*)
415		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
416		;;
417	mips3*)
418		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
419		;;
420	ncr3000)
421		basic_machine=i486-ncr
422		os=-sysv4
423		;;
424	news | news700 | news800 | news900)
425		basic_machine=m68k-sony
426		os=-newsos
427		;;
428	news1000)
429		basic_machine=m68030-sony
430		os=-newsos
431		;;
432	news-3600 | risc-news)
433		basic_machine=mips-sony
434		os=-newsos
435		;;
436	next | m*-next )
437		basic_machine=m68k-next
438		case $os in
439		    -nextstep* )
440			;;
441		    -ns2*)
442		      os=-nextstep2
443			;;
444		    *)
445		      os=-nextstep3
446			;;
447		esac
448		;;
449	nh3000)
450		basic_machine=m68k-harris
451		os=-cxux
452		;;
453	nh[45]000)
454		basic_machine=m88k-harris
455		os=-cxux
456		;;
457	nindy960)
458		basic_machine=i960-intel
459		os=-nindy
460		;;
461	np1)
462		basic_machine=np1-gould
463		;;
464	pa-hitachi)
465		basic_machine=hppa1.1-hitachi
466		os=-hiuxwe2
467		;;
468	paragon)
469		basic_machine=i860-intel
470		os=-osf
471		;;
472	pbd)
473		basic_machine=sparc-tti
474		;;
475	pbb)
476		basic_machine=m68k-tti
477		;;
478        pc532 | pc532-*)
479		basic_machine=ns32k-pc532
480		;;
481	pentium | p5 | k5 | nexen)
482		basic_machine=i586-pc
483		;;
484	pentiumpro | p6 | k6 | 6x86)
485		basic_machine=i686-pc
486		;;
487	pentiumii | pentium2)
488		basic_machine=i786-pc
489		;;
490	pentium-* | p5-* | k5-* | nexen-*)
491		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
492		;;
493	pentiumpro-* | p6-* | k6-* | 6x86-*)
494		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
495		;;
496	pentiumii-* | pentium2-*)
497		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
498		;;
499	pn)
500		basic_machine=pn-gould
501		;;
502	power)	basic_machine=rs6000-ibm
503		;;
504	ppc)	basic_machine=powerpc-unknown
505	        ;;
506	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
507		;;
508	ppcle | powerpclittle | ppc-le | powerpc-little)
509		basic_machine=powerpcle-unknown
510	        ;;
511	ppcle-* | powerpclittle-*)
512		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
513		;;
514	ps2)
515		basic_machine=i386-ibm
516		;;
517	rm[46]00)
518		basic_machine=mips-siemens
519		;;
520	rtpc | rtpc-*)
521		basic_machine=romp-ibm
522		;;
523	sequent)
524		basic_machine=i386-sequent
525		;;
526	sh)
527		basic_machine=sh-hitachi
528		os=-hms
529		;;
530	sps7)
531		basic_machine=m68k-bull
532		os=-sysv2
533		;;
534	spur)
535		basic_machine=spur-unknown
536		;;
537	sun2)
538		basic_machine=m68000-sun
539		;;
540	sun2os3)
541		basic_machine=m68000-sun
542		os=-sunos3
543		;;
544	sun2os4)
545		basic_machine=m68000-sun
546		os=-sunos4
547		;;
548	sun3os3)
549		basic_machine=m68k-sun
550		os=-sunos3
551		;;
552	sun3os4)
553		basic_machine=m68k-sun
554		os=-sunos4
555		;;
556	sun4os3)
557		basic_machine=sparc-sun
558		os=-sunos3
559		;;
560	sun4os4)
561		basic_machine=sparc-sun
562		os=-sunos4
563		;;
564	sun4sol2)
565		basic_machine=sparc-sun
566		os=-solaris2
567		;;
568	sun3 | sun3-*)
569		basic_machine=m68k-sun
570		;;
571	sun4)
572		basic_machine=sparc-sun
573		;;
574	sun386 | sun386i | roadrunner)
575		basic_machine=i386-sun
576		;;
577	symmetry)
578		basic_machine=i386-sequent
579		os=-dynix
580		;;
581	tx39)
582		basic_machine=mipstx39-unknown
583		;;
584	tx39el)
585		basic_machine=mipstx39el-unknown
586		;;
587	tower | tower-32)
588		basic_machine=m68k-ncr
589		;;
590	udi29k)
591		basic_machine=a29k-amd
592		os=-udi
593		;;
594	ultra3)
595		basic_machine=a29k-nyu
596		os=-sym1
597		;;
598	vaxv)
599		basic_machine=vax-dec
600		os=-sysv
601		;;
602	vms)
603		basic_machine=vax-dec
604		os=-vms
605		;;
606	vpp*|vx|vx-*)
607               basic_machine=f301-fujitsu
608               ;;
609	vxworks960)
610		basic_machine=i960-wrs
611		os=-vxworks
612		;;
613	vxworks68)
614		basic_machine=m68k-wrs
615		os=-vxworks
616		;;
617	vxworks29k)
618		basic_machine=a29k-wrs
619		os=-vxworks
620		;;
621	xmp)
622		basic_machine=xmp-cray
623		os=-unicos
624		;;
625        xps | xps100)
626		basic_machine=xps100-honeywell
627		;;
628	none)
629		basic_machine=none-none
630		os=-none
631		;;
632
633# Here we handle the default manufacturer of certain CPU types.  It is in
634# some cases the only manufacturer, in others, it is the most popular.
635	mips)
636		if [ x$os = x-linux-gnu ]; then
637			basic_machine=mips-unknown
638		else
639			basic_machine=mips-mips
640		fi
641		;;
642	romp)
643		basic_machine=romp-ibm
644		;;
645	rs6000)
646		basic_machine=rs6000-ibm
647		;;
648	vax)
649		basic_machine=vax-dec
650		;;
651	pdp11)
652		basic_machine=pdp11-dec
653		;;
654	we32k)
655		basic_machine=we32k-att
656		;;
657	sparc)
658		basic_machine=sparc-sun
659		;;
660        cydra)
661		basic_machine=cydra-cydrome
662		;;
663	orion)
664		basic_machine=orion-highlevel
665		;;
666	orion105)
667		basic_machine=clipper-highlevel
668		;;
669	*)
670		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
671		exit 1
672		;;
673esac
674
675# Here we canonicalize certain aliases for manufacturers.
676case $basic_machine in
677	*-digital*)
678		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
679		;;
680	*-commodore*)
681		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
682		;;
683	*)
684		;;
685esac
686
687# Decode manufacturer-specific aliases for certain operating systems.
688
689if [ x"$os" != x"" ]
690then
691case $os in
692        # First match some system type aliases
693        # that might get confused with valid system types.
694	# -solaris* is a basic system type, with this one exception.
695	-solaris1 | -solaris1.*)
696		os=`echo $os | sed -e 's|solaris1|sunos4|'`
697		;;
698	-solaris)
699		os=-solaris2
700		;;
701	-svr4*)
702		os=-sysv4
703		;;
704	-unixware*)
705		os=-sysv4.2uw
706		;;
707	-gnu/linux*)
708		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
709		;;
710	# First accept the basic system types.
711	# The portable systems comes first.
712	# Each alternative MUST END IN A *, to match a version number.
713	# -sysv* is not here because it comes later, after sysvr4.
714	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
715	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
716	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
717	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
718	      | -aos* \
719	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* | -os390* \
720	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
721	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
722	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
723	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
724	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
725	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
726	      | -mingw32* | -linux-gnu* | -uxpv* | -beos*)
727	# Remember, each alternative MUST END IN *, to match a version number.
728		;;
729	-linux*)
730		os=`echo $os | sed -e 's|linux|linux-gnu|'`
731		;;
732	-sunos5*)
733		os=`echo $os | sed -e 's|sunos5|solaris2|'`
734		;;
735	-sunos6*)
736		os=`echo $os | sed -e 's|sunos6|solaris3|'`
737		;;
738	-osfrose*)
739		os=-osfrose
740		;;
741	-osf*)
742		os=-osf
743		;;
744	-utek*)
745		os=-bsd
746		;;
747	-dynix*)
748		os=-bsd
749		;;
750	-acis*)
751		os=-aos
752		;;
753	-ctix* | -uts*)
754		os=-sysv
755		;;
756	-ns2 )
757	        os=-nextstep2
758		;;
759	# Preserve the version number of sinix5.
760	-sinix5.*)
761		os=`echo $os | sed -e 's|sinix|sysv|'`
762		;;
763	-sinix*)
764		os=-sysv4
765		;;
766	-triton*)
767		os=-sysv3
768		;;
769	-oss*)
770		os=-sysv3
771		;;
772	-svr4)
773		os=-sysv4
774		;;
775	-svr3)
776		os=-sysv3
777		;;
778	-sysvr4)
779		os=-sysv4
780		;;
781	# This must come after -sysvr4.
782	-sysv*)
783		;;
784	-xenix)
785		os=-xenix
786		;;
787	-none)
788		;;
789	*)
790		# Get rid of the `-' at the beginning of $os.
791		os=`echo $os | sed 's/[^-]*-//'`
792		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
793		exit 1
794		;;
795esac
796else
797
798# Here we handle the default operating systems that come with various machines.
799# The value should be what the vendor currently ships out the door with their
800# machine or put another way, the most popular os provided with the machine.
801
802# Note that if you're going to try to match "-MANUFACTURER" here (say,
803# "-sun"), then you have to tell the case statement up towards the top
804# that MANUFACTURER isn't an operating system.  Otherwise, code above
805# will signal an error saying that MANUFACTURER isn't an operating
806# system, and we'll never get to this point.
807
808case $basic_machine in
809	*-acorn)
810		os=-riscix1.2
811		;;
812	arm*-semi)
813		os=-aout
814		;;
815        pdp11-*)
816		os=-none
817		;;
818	*-dec | vax-*)
819		os=-ultrix4.2
820		;;
821	m68*-apollo)
822		os=-domain
823		;;
824	i386-sun)
825		os=-sunos4.0.2
826		;;
827	m68000-sun)
828		os=-sunos3
829		# This also exists in the configure program, but was not the
830		# default.
831		# os=-sunos4
832		;;
833	*-tti)	# must be before sparc entry or we get the wrong os.
834		os=-sysv3
835		;;
836	sparc-* | *-sun)
837		os=-sunos4.1.1
838		;;
839	*-be)
840		os=-beos
841		;;
842	s390-ibm)
843		os=-os390  #  /* S/390 -- gil -- 1451 */
844		;;
845	*-ibm)
846		os=-aix
847		;;
848	*-hp)
849		os=-hpux
850		;;
851	*-hitachi)
852		os=-hiux
853		;;
854	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
855		os=-sysv
856		;;
857	*-cbm)
858		os=-amigaos
859		;;
860	*-dg)
861		os=-dgux
862		;;
863	*-dolphin)
864		os=-sysv3
865		;;
866	m68k-ccur)
867		os=-rtu
868		;;
869	m88k-omron*)
870		os=-luna
871		;;
872	*-next )
873		os=-nextstep
874		;;
875	*-sequent)
876		os=-ptx
877		;;
878	*-crds)
879		os=-unos
880		;;
881	*-ns)
882		os=-genix
883		;;
884	i370-*)
885		os=-mvs
886		;;
887	*-next)
888		os=-nextstep3
889		;;
890        *-gould)
891		os=-sysv
892		;;
893        *-highlevel)
894		os=-bsd
895		;;
896	*-encore)
897		os=-bsd
898		;;
899        *-sgi)
900		os=-irix
901		;;
902        *-siemens)
903		os=-sysv4
904		;;
905	*-masscomp)
906		os=-rtu
907		;;
908	f301-fujitsu)
909		os=-uxpv
910		;;
911	*)
912		os=-none
913		;;
914esac
915fi
916
917# Here we handle the case where we know the os, and the CPU type, but not the
918# manufacturer.  We pick the logical manufacturer.
919vendor=unknown
920case $basic_machine in
921	*-unknown)
922		case $os in
923			-riscix*)
924				vendor=acorn
925				;;
926			-sunos*)
927				vendor=sun
928				;;
929			-aix*)
930				vendor=ibm
931				;;
932			-hpux*)
933				vendor=hp
934				;;
935			-hiux*)
936				vendor=hitachi
937				;;
938			-unos*)
939				vendor=crds
940				;;
941			-dgux*)
942				vendor=dg
943				;;
944			-luna*)
945				vendor=omron
946				;;
947			-genix*)
948				vendor=ns
949				;;
950			-mvs*)
951				vendor=ibm
952				;;
953			-ptx*)
954				vendor=sequent
955				;;
956			-vxsim* | -vxworks*)
957				vendor=wrs
958				;;
959			-aux*)
960				vendor=apple
961				;;
962		esac
963		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
964		;;
965esac
966
967echo $basic_machine$os
968