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