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