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