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