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