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