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