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