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