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