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