154359Sroberto#! /bin/sh
282498Sroberto# Configuration validation subroutine script.
3132451Sroberto#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4290001Sglebius#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5290001Sglebius#   2011 Free Software Foundation, Inc.
682498Sroberto
7290001Sglebiustimestamp='2011-06-03'
882498Sroberto
954359Sroberto# This file is (in principle) common to ALL GNU software.
1054359Sroberto# The presence of a machine in this file suggests that SOME GNU software
1154359Sroberto# can handle that machine.  It does not imply ALL GNU software can.
1254359Sroberto#
1354359Sroberto# This file is free software; you can redistribute it and/or modify
1454359Sroberto# it under the terms of the GNU General Public License as published by
1554359Sroberto# the Free Software Foundation; either version 2 of the License, or
1654359Sroberto# (at your option) any later version.
1754359Sroberto#
1854359Sroberto# This program is distributed in the hope that it will be useful,
1954359Sroberto# but WITHOUT ANY WARRANTY; without even the implied warranty of
2054359Sroberto# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2154359Sroberto# GNU General Public License for more details.
2254359Sroberto#
2354359Sroberto# You should have received a copy of the GNU General Public License
2454359Sroberto# along with this program; if not, write to the Free Software
25182007Sroberto# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
26182007Sroberto# 02110-1301, USA.
27182007Sroberto#
2854359Sroberto# As a special exception to the GNU General Public License, if you
2954359Sroberto# distribute this file as part of a program that contains a
3054359Sroberto# configuration script generated by Autoconf, you may include it under
3154359Sroberto# the same distribution terms that you use for the rest of that program.
3254359Sroberto
33182007Sroberto
34132451Sroberto# Please send patches to <config-patches@gnu.org>.  Submit a context
35290001Sglebius# diff and a properly formatted GNU ChangeLog entry.
3682498Sroberto#
3754359Sroberto# Configuration subroutine to validate and canonicalize a configuration type.
3854359Sroberto# Supply the specified configuration type as an argument.
3954359Sroberto# If it is invalid, we print an error message on stderr and exit with code 1.
4054359Sroberto# Otherwise, we print the canonical config type on stdout and succeed.
4154359Sroberto
42290001Sglebius# You can get the latest version of this script from:
43290001Sglebius# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
44290001Sglebius
4554359Sroberto# This file is supposed to be the same for all GNU packages
4654359Sroberto# and recognize all the CPU types, system types and aliases
4754359Sroberto# that are meaningful with *any* GNU software.
4854359Sroberto# Each package is responsible for reporting which valid configurations
4954359Sroberto# it does not support.  The user should be able to distinguish
5054359Sroberto# a failure to support a valid configuration from a meaningless
5154359Sroberto# configuration.
5254359Sroberto
5354359Sroberto# The goal of this file is to map all the various variations of a given
5454359Sroberto# machine specification into a single specification in the form:
5554359Sroberto#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5654359Sroberto# or in some cases, the newer four-part form:
5754359Sroberto#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5854359Sroberto# It is wrong to echo any other type of specification.
5954359Sroberto
6082498Srobertome=`echo "$0" | sed -e 's,.*/,,'`
6154359Sroberto
6282498Srobertousage="\
6382498SrobertoUsage: $0 [OPTION] CPU-MFR-OPSYS
6482498Sroberto       $0 [OPTION] ALIAS
6582498Sroberto
6682498SrobertoCanonicalize a configuration name.
6782498Sroberto
6882498SrobertoOperation modes:
6982498Sroberto  -h, --help         print this help, then exit
7082498Sroberto  -t, --time-stamp   print date of last modification, then exit
7182498Sroberto  -v, --version      print version number, then exit
7282498Sroberto
7382498SrobertoReport bugs and patches to <config-patches@gnu.org>."
7482498Sroberto
7582498Srobertoversion="\
7682498SrobertoGNU config.sub ($timestamp)
7782498Sroberto
78290001SglebiusCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
79290001Sglebius2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free
80290001SglebiusSoftware Foundation, Inc.
8182498Sroberto
8282498SrobertoThis is free software; see the source for copying conditions.  There is NO
8382498Srobertowarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
8482498Sroberto
8582498Srobertohelp="
8682498SrobertoTry \`$me --help' for more information."
8782498Sroberto
8882498Sroberto# Parse command line
8982498Srobertowhile test $# -gt 0 ; do
9082498Sroberto  case $1 in
9182498Sroberto    --time-stamp | --time* | -t )
92182007Sroberto       echo "$timestamp" ; exit ;;
9382498Sroberto    --version | -v )
94182007Sroberto       echo "$version" ; exit ;;
9582498Sroberto    --help | --h* | -h )
96182007Sroberto       echo "$usage"; exit ;;
9782498Sroberto    -- )     # Stop option processing
9882498Sroberto       shift; break ;;
9982498Sroberto    - )	# Use stdin as input.
10082498Sroberto       break ;;
10182498Sroberto    -* )
10282498Sroberto       echo "$me: invalid option $1$help"
10382498Sroberto       exit 1 ;;
10482498Sroberto
10582498Sroberto    *local*)
10682498Sroberto       # First pass through any local machine types.
10782498Sroberto       echo $1
108182007Sroberto       exit ;;
10982498Sroberto
11082498Sroberto    * )
11182498Sroberto       break ;;
11282498Sroberto  esac
11382498Srobertodone
11482498Sroberto
11582498Srobertocase $# in
11682498Sroberto 0) echo "$me: missing argument$help" >&2
11782498Sroberto    exit 1;;
11882498Sroberto 1) ;;
11982498Sroberto *) echo "$me: too many arguments$help" >&2
12082498Sroberto    exit 1;;
12154359Srobertoesac
12254359Sroberto
12354359Sroberto# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
12454359Sroberto# Here we must recognize all the valid KERNEL-OS combinations.
12554359Srobertomaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12654359Srobertocase $maybe_os in
127290001Sglebius  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
128290001Sglebius  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
129290001Sglebius  knetbsd*-gnu* | netbsd*-gnu* | \
130290001Sglebius  kopensolaris*-gnu* | \
131290001Sglebius  storm-chaos* | os2-emx* | rtmk-nova*)
13254359Sroberto    os=-$maybe_os
13354359Sroberto    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
13454359Sroberto    ;;
13554359Sroberto  *)
13654359Sroberto    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
13754359Sroberto    if [ $basic_machine != $1 ]
13854359Sroberto    then os=`echo $1 | sed 's/.*-/-/'`
13954359Sroberto    else os=; fi
14054359Sroberto    ;;
14154359Srobertoesac
14254359Sroberto
14354359Sroberto### Let's recognize common machines as not being operating systems so
14454359Sroberto### that things like config.sub decstation-3100 work.  We also
14554359Sroberto### recognize some manufacturers as not being operating systems, so we
14654359Sroberto### can provide default operating systems below.
14754359Srobertocase $os in
14854359Sroberto	-sun*os*)
14954359Sroberto		# Prevent following clause from handling this invalid input.
15054359Sroberto		;;
15154359Sroberto	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
15254359Sroberto	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
15354359Sroberto	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
15454359Sroberto	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
15554359Sroberto	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
15654359Sroberto	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
157290001Sglebius	-apple | -axis | -knuth | -cray | -microblaze)
15854359Sroberto		os=
15954359Sroberto		basic_machine=$1
16054359Sroberto		;;
161290001Sglebius	-bluegene*)
162290001Sglebius		os=-cnk
163290001Sglebius		;;
16454359Sroberto	-sim | -cisco | -oki | -wec | -winbond)
16554359Sroberto		os=
16654359Sroberto		basic_machine=$1
16754359Sroberto		;;
16854359Sroberto	-scout)
16954359Sroberto		;;
17054359Sroberto	-wrs)
17182498Sroberto		os=-vxworks
17254359Sroberto		basic_machine=$1
17354359Sroberto		;;
17482498Sroberto	-chorusos*)
17582498Sroberto		os=-chorusos
17682498Sroberto		basic_machine=$1
17782498Sroberto		;;
178290001Sglebius	-chorusrdb)
179290001Sglebius		os=-chorusrdb
18082498Sroberto		basic_machine=$1
181290001Sglebius		;;
18254359Sroberto	-hiux*)
18354359Sroberto		os=-hiuxwe2
18454359Sroberto		;;
185290001Sglebius	-sco6)
186290001Sglebius		os=-sco5v6
187290001Sglebius		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
188290001Sglebius		;;
18954359Sroberto	-sco5)
19054359Sroberto		os=-sco3.2v5
19154359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19254359Sroberto		;;
19354359Sroberto	-sco4)
19454359Sroberto		os=-sco3.2v4
19554359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19654359Sroberto		;;
19754359Sroberto	-sco3.2.[4-9]*)
19854359Sroberto		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
19954359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20054359Sroberto		;;
20154359Sroberto	-sco3.2v[4-9]*)
20254359Sroberto		# Don't forget version if it is 3.2v4 or newer.
20354359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20454359Sroberto		;;
205290001Sglebius	-sco5v6*)
206290001Sglebius		# Don't forget version if it is 3.2v4 or newer.
207290001Sglebius		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
208290001Sglebius		;;
20954359Sroberto	-sco*)
21054359Sroberto		os=-sco3.2v2
21154359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21254359Sroberto		;;
21354359Sroberto	-udk*)
21454359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21554359Sroberto		;;
21654359Sroberto	-isc)
21754359Sroberto		os=-isc2.2
21854359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
21954359Sroberto		;;
22054359Sroberto	-clix*)
22154359Sroberto		basic_machine=clipper-intergraph
22254359Sroberto		;;
22354359Sroberto	-isc*)
22454359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
22554359Sroberto		;;
22654359Sroberto	-lynx*)
22754359Sroberto		os=-lynxos
22854359Sroberto		;;
22954359Sroberto	-ptx*)
23054359Sroberto		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
23154359Sroberto		;;
23254359Sroberto	-windowsnt*)
23354359Sroberto		os=`echo $os | sed -e 's/windowsnt/winnt/'`
23454359Sroberto		;;
23554359Sroberto	-psos*)
23654359Sroberto		os=-psos
23754359Sroberto		;;
23882498Sroberto	-mint | -mint[0-9]*)
23982498Sroberto		basic_machine=m68k-atari
24082498Sroberto		os=-mint
24182498Sroberto		;;
24254359Srobertoesac
24354359Sroberto
24454359Sroberto# Decode aliases for certain CPU-COMPANY combinations.
24554359Srobertocase $basic_machine in
24654359Sroberto	# Recognize the basic CPU types without company name.
24754359Sroberto	# Some are omitted here because they have special meanings below.
248106424Sroberto	1750a | 580 \
249106424Sroberto	| a29k \
250106424Sroberto	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
251132451Sroberto	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
252182007Sroberto	| am33_2.0 \
253290001Sglebius	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
254182007Sroberto	| bfin \
255106424Sroberto	| c4x | clipper \
256132451Sroberto	| d10v | d30v | dlx | dsp16xx \
257290001Sglebius	| fido | fr30 | frv \
258106424Sroberto	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
259106424Sroberto	| i370 | i860 | i960 | ia64 \
260182007Sroberto	| ip2k | iq2000 \
261290001Sglebius	| lm32 \
262290001Sglebius	| m32c | m32r | m32rle | m68000 | m68k | m88k \
263290001Sglebius	| maxq | mb | microblaze | mcore | mep | metag \
264132451Sroberto	| mips | mipsbe | mipseb | mipsel | mipsle \
265132451Sroberto	| mips16 \
266132451Sroberto	| mips64 | mips64el \
267290001Sglebius	| mips64octeon | mips64octeonel \
268290001Sglebius	| mips64orion | mips64orionel \
269290001Sglebius	| mips64r5900 | mips64r5900el \
270132451Sroberto	| mips64vr | mips64vrel \
271132451Sroberto	| mips64vr4100 | mips64vr4100el \
272132451Sroberto	| mips64vr4300 | mips64vr4300el \
273132451Sroberto	| mips64vr5000 | mips64vr5000el \
274182007Sroberto	| mips64vr5900 | mips64vr5900el \
275132451Sroberto	| mipsisa32 | mipsisa32el \
276132451Sroberto	| mipsisa32r2 | mipsisa32r2el \
277132451Sroberto	| mipsisa64 | mipsisa64el \
278182007Sroberto	| mipsisa64r2 | mipsisa64r2el \
279132451Sroberto	| mipsisa64sb1 | mipsisa64sb1el \
280132451Sroberto	| mipsisa64sr71k | mipsisa64sr71kel \
281132451Sroberto	| mipstx39 | mipstx39el \
282106424Sroberto	| mn10200 | mn10300 \
283290001Sglebius	| moxie \
284290001Sglebius	| mt \
285132451Sroberto	| msp430 \
286290001Sglebius	| nds32 | nds32le | nds32be \
287290001Sglebius	| nios | nios2 \
288106424Sroberto	| ns16k | ns32k \
289290001Sglebius	| open8 \
290182007Sroberto	| or32 \
291106424Sroberto	| pdp10 | pdp11 | pj | pjl \
292290001Sglebius	| powerpc | powerpc64 | powerpc64le | powerpcle \
293106424Sroberto	| pyramid \
294290001Sglebius	| rx \
295290001Sglebius	| score \
296290001Sglebius	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
297132451Sroberto	| sh64 | sh64le \
298290001Sglebius	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
299290001Sglebius	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
300290001Sglebius	| spu \
301290001Sglebius	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
302290001Sglebius	| ubicom32 \
303290001Sglebius	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
304106424Sroberto	| we32k \
305290001Sglebius	| x86 | xc16x | xstormy16 | xtensa \
306290001Sglebius	| z8k | z80)
30754359Sroberto		basic_machine=$basic_machine-unknown
30854359Sroberto		;;
309290001Sglebius	c54x)
310290001Sglebius		basic_machine=tic54x-unknown
311182007Sroberto		;;
312290001Sglebius	c55x)
313290001Sglebius		basic_machine=tic55x-unknown
314290001Sglebius		;;
315290001Sglebius	c6x)
316290001Sglebius		basic_machine=tic6x-unknown
317290001Sglebius		;;
318290001Sglebius	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
31982498Sroberto		# Motorola 68HC11/12.
32082498Sroberto		basic_machine=$basic_machine-unknown
32182498Sroberto		os=-none
32254359Sroberto		;;
32382498Sroberto	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
32482498Sroberto		;;
325290001Sglebius	ms1)
326290001Sglebius		basic_machine=mt-unknown
327290001Sglebius		;;
32854359Sroberto
329290001Sglebius	strongarm | thumb | xscale)
330290001Sglebius		basic_machine=arm-unknown
331290001Sglebius		;;
332290001Sglebius
333290001Sglebius	xscaleeb)
334290001Sglebius		basic_machine=armeb-unknown
335290001Sglebius		;;
336290001Sglebius
337290001Sglebius	xscaleel)
338290001Sglebius		basic_machine=armel-unknown
339290001Sglebius		;;
340290001Sglebius
34154359Sroberto	# We use `pc' rather than `unknown'
34254359Sroberto	# because (1) that's what they normally are, and
34354359Sroberto	# (2) the word "unknown" tends to confuse beginning users.
34482498Sroberto	i*86 | x86_64)
34554359Sroberto	  basic_machine=$basic_machine-pc
34654359Sroberto	  ;;
34754359Sroberto	# Object if more than one company name word.
34854359Sroberto	*-*-*)
34954359Sroberto		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
35054359Sroberto		exit 1
35154359Sroberto		;;
35254359Sroberto	# Recognize the basic CPU types with company name.
353106424Sroberto	580-* \
354106424Sroberto	| a29k-* \
355106424Sroberto	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
356132451Sroberto	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
357132451Sroberto	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
358132451Sroberto	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
359290001Sglebius	| avr-* | avr32-* \
360182007Sroberto	| bfin-* | bs2000-* \
361290001Sglebius	| c[123]* | c30-* | [cjt]90-* | c4x-* \
362182007Sroberto	| clipper-* | craynv-* | cydra-* \
363132451Sroberto	| d10v-* | d30v-* | dlx-* \
364106424Sroberto	| elxsi-* \
365290001Sglebius	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
366106424Sroberto	| h8300-* | h8500-* \
367106424Sroberto	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
368106424Sroberto	| i*86-* | i860-* | i960-* | ia64-* \
369182007Sroberto	| ip2k-* | iq2000-* \
370290001Sglebius	| lm32-* \
371290001Sglebius	| m32c-* | m32r-* | m32rle-* \
372132451Sroberto	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
373290001Sglebius	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
374132451Sroberto	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
375132451Sroberto	| mips16-* \
376132451Sroberto	| mips64-* | mips64el-* \
377290001Sglebius	| mips64octeon-* | mips64octeonel-* \
378290001Sglebius	| mips64orion-* | mips64orionel-* \
379290001Sglebius	| mips64r5900-* | mips64r5900el-* \
380132451Sroberto	| mips64vr-* | mips64vrel-* \
381132451Sroberto	| mips64vr4100-* | mips64vr4100el-* \
382132451Sroberto	| mips64vr4300-* | mips64vr4300el-* \
383132451Sroberto	| mips64vr5000-* | mips64vr5000el-* \
384182007Sroberto	| mips64vr5900-* | mips64vr5900el-* \
385132451Sroberto	| mipsisa32-* | mipsisa32el-* \
386132451Sroberto	| mipsisa32r2-* | mipsisa32r2el-* \
387132451Sroberto	| mipsisa64-* | mipsisa64el-* \
388182007Sroberto	| mipsisa64r2-* | mipsisa64r2el-* \
389132451Sroberto	| mipsisa64sb1-* | mipsisa64sb1el-* \
390132451Sroberto	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
391132451Sroberto	| mipstx39-* | mipstx39el-* \
392182007Sroberto	| mmix-* \
393290001Sglebius	| mt-* \
394132451Sroberto	| msp430-* \
395290001Sglebius	| nds32-* | nds32le-* | nds32be-* \
396290001Sglebius	| nios-* | nios2-* \
397182007Sroberto	| none-* | np1-* | ns16k-* | ns32k-* \
398290001Sglebius	| open8-* \
399106424Sroberto	| orion-* \
400106424Sroberto	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
401290001Sglebius	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
402106424Sroberto	| pyramid-* \
403290001Sglebius	| romp-* | rs6000-* | rx-* \
404290001Sglebius	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
405132451Sroberto	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
406290001Sglebius	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
407182007Sroberto	| sparclite-* \
408290001Sglebius	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
409290001Sglebius	| tahoe-* \
410132451Sroberto	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
411290001Sglebius	| tile*-* \
412132451Sroberto	| tron-* \
413290001Sglebius	| ubicom32-* \
414290001Sglebius	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
415290001Sglebius	| vax-* \
416106424Sroberto	| we32k-* \
417290001Sglebius	| x86-* | x86_64-* | xc16x-* | xps100-* \
418290001Sglebius	| xstormy16-* | xtensa*-* \
419106424Sroberto	| ymp-* \
420290001Sglebius	| z8k-* | z80-*)
42154359Sroberto		;;
422290001Sglebius	# Recognize the basic CPU types without company name, with glob match.
423290001Sglebius	xtensa*)
424290001Sglebius		basic_machine=$basic_machine-unknown
425182007Sroberto		;;
42654359Sroberto	# Recognize the various machine names and aliases which stand
42754359Sroberto	# for a CPU type and a company and sometimes even an OS.
42854359Sroberto	386bsd)
42954359Sroberto		basic_machine=i386-unknown
43054359Sroberto		os=-bsd
43154359Sroberto		;;
43254359Sroberto	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
43354359Sroberto		basic_machine=m68000-att
43454359Sroberto		;;
43554359Sroberto	3b*)
43654359Sroberto		basic_machine=we32k-att
43754359Sroberto		;;
43854359Sroberto	a29khif)
43954359Sroberto		basic_machine=a29k-amd
44054359Sroberto		os=-udi
44154359Sroberto		;;
442290001Sglebius	abacus)
443182007Sroberto		basic_machine=abacus-unknown
444182007Sroberto		;;
44554359Sroberto	adobe68k)
44654359Sroberto		basic_machine=m68010-adobe
44754359Sroberto		os=-scout
44854359Sroberto		;;
44954359Sroberto	alliant | fx80)
45054359Sroberto		basic_machine=fx80-alliant
45154359Sroberto		;;
45254359Sroberto	altos | altos3068)
45354359Sroberto		basic_machine=m68k-altos
45454359Sroberto		;;
45554359Sroberto	am29k)
45654359Sroberto		basic_machine=a29k-none
45754359Sroberto		os=-bsd
45854359Sroberto		;;
459132451Sroberto	amd64)
460132451Sroberto		basic_machine=x86_64-pc
461132451Sroberto		;;
462182007Sroberto	amd64-*)
463182007Sroberto		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
464182007Sroberto		;;
46554359Sroberto	amdahl)
46654359Sroberto		basic_machine=580-amdahl
46754359Sroberto		os=-sysv
46854359Sroberto		;;
46954359Sroberto	amiga | amiga-*)
47082498Sroberto		basic_machine=m68k-unknown
47154359Sroberto		;;
47254359Sroberto	amigaos | amigados)
47382498Sroberto		basic_machine=m68k-unknown
47454359Sroberto		os=-amigaos
47554359Sroberto		;;
47654359Sroberto	amigaunix | amix)
47782498Sroberto		basic_machine=m68k-unknown
47854359Sroberto		os=-sysv4
47954359Sroberto		;;
48054359Sroberto	apollo68)
48154359Sroberto		basic_machine=m68k-apollo
48254359Sroberto		os=-sysv
48354359Sroberto		;;
48454359Sroberto	apollo68bsd)
48554359Sroberto		basic_machine=m68k-apollo
48654359Sroberto		os=-bsd
48754359Sroberto		;;
488290001Sglebius	aros)
489290001Sglebius		basic_machine=i386-pc
490290001Sglebius		os=-aros
491290001Sglebius		;;
49254359Sroberto	aux)
49354359Sroberto		basic_machine=m68k-apple
49454359Sroberto		os=-aux
49554359Sroberto		;;
49654359Sroberto	balance)
49754359Sroberto		basic_machine=ns32k-sequent
49854359Sroberto		os=-dynix
49954359Sroberto		;;
500290001Sglebius	blackfin)
501290001Sglebius		basic_machine=bfin-unknown
502290001Sglebius		os=-linux
503290001Sglebius		;;
504290001Sglebius	blackfin-*)
505290001Sglebius		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
506290001Sglebius		os=-linux
507290001Sglebius		;;
508290001Sglebius	bluegene*)
509290001Sglebius		basic_machine=powerpc-ibm
510290001Sglebius		os=-cnk
511290001Sglebius		;;
512290001Sglebius	c54x-*)
513290001Sglebius		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
514290001Sglebius		;;
515290001Sglebius	c55x-*)
516290001Sglebius		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
517290001Sglebius		;;
518290001Sglebius	c6x-*)
519290001Sglebius		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
520290001Sglebius		;;
521132451Sroberto	c90)
522132451Sroberto		basic_machine=c90-cray
523132451Sroberto		os=-unicos
524132451Sroberto		;;
525290001Sglebius	cegcc)
526290001Sglebius		basic_machine=arm-unknown
527290001Sglebius		os=-cegcc
528290001Sglebius		;;
52954359Sroberto	convex-c1)
53054359Sroberto		basic_machine=c1-convex
53154359Sroberto		os=-bsd
53254359Sroberto		;;
53354359Sroberto	convex-c2)
53454359Sroberto		basic_machine=c2-convex
53554359Sroberto		os=-bsd
53654359Sroberto		;;
53754359Sroberto	convex-c32)
53854359Sroberto		basic_machine=c32-convex
53954359Sroberto		os=-bsd
54054359Sroberto		;;
54154359Sroberto	convex-c34)
54254359Sroberto		basic_machine=c34-convex
54354359Sroberto		os=-bsd
54454359Sroberto		;;
54554359Sroberto	convex-c38)
54654359Sroberto		basic_machine=c38-convex
54754359Sroberto		os=-bsd
54854359Sroberto		;;
549132451Sroberto	cray | j90)
550132451Sroberto		basic_machine=j90-cray
55154359Sroberto		os=-unicos
55254359Sroberto		;;
553182007Sroberto	craynv)
554182007Sroberto		basic_machine=craynv-cray
555182007Sroberto		os=-unicosmp
556182007Sroberto		;;
557290001Sglebius	cr16 | cr16-*)
558290001Sglebius		basic_machine=cr16-unknown
559182007Sroberto		os=-elf
560182007Sroberto		;;
56154359Sroberto	crds | unos)
56254359Sroberto		basic_machine=m68k-crds
56354359Sroberto		;;
564182007Sroberto	crisv32 | crisv32-* | etraxfs*)
565182007Sroberto		basic_machine=crisv32-axis
566182007Sroberto		;;
56782498Sroberto	cris | cris-* | etrax*)
56882498Sroberto		basic_machine=cris-axis
56982498Sroberto		;;
570182007Sroberto	crx)
571182007Sroberto		basic_machine=crx-unknown
572182007Sroberto		os=-elf
573182007Sroberto		;;
57454359Sroberto	da30 | da30-*)
57554359Sroberto		basic_machine=m68k-da30
57654359Sroberto		;;
57754359Sroberto	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
57854359Sroberto		basic_machine=mips-dec
57954359Sroberto		;;
580132451Sroberto	decsystem10* | dec10*)
581132451Sroberto		basic_machine=pdp10-dec
582132451Sroberto		os=-tops10
583132451Sroberto		;;
584132451Sroberto	decsystem20* | dec20*)
585132451Sroberto		basic_machine=pdp10-dec
586132451Sroberto		os=-tops20
587132451Sroberto		;;
58854359Sroberto	delta | 3300 | motorola-3300 | motorola-delta \
58954359Sroberto	      | 3300-motorola | delta-motorola)
59054359Sroberto		basic_machine=m68k-motorola
59154359Sroberto		;;
59254359Sroberto	delta88)
59354359Sroberto		basic_machine=m88k-motorola
59454359Sroberto		os=-sysv3
59554359Sroberto		;;
596290001Sglebius	dicos)
597290001Sglebius		basic_machine=i686-pc
598290001Sglebius		os=-dicos
599290001Sglebius		;;
600182007Sroberto	djgpp)
601182007Sroberto		basic_machine=i586-pc
602182007Sroberto		os=-msdosdjgpp
603182007Sroberto		;;
60454359Sroberto	dpx20 | dpx20-*)
60554359Sroberto		basic_machine=rs6000-bull
60654359Sroberto		os=-bosx
60754359Sroberto		;;
60854359Sroberto	dpx2* | dpx2*-bull)
60954359Sroberto		basic_machine=m68k-bull
61054359Sroberto		os=-sysv3
61154359Sroberto		;;
61254359Sroberto	ebmon29k)
61354359Sroberto		basic_machine=a29k-amd
61454359Sroberto		os=-ebmon
61554359Sroberto		;;
61654359Sroberto	elxsi)
61754359Sroberto		basic_machine=elxsi-elxsi
61854359Sroberto		os=-bsd
61954359Sroberto		;;
62054359Sroberto	encore | umax | mmax)
62154359Sroberto		basic_machine=ns32k-encore
62254359Sroberto		;;
62354359Sroberto	es1800 | OSE68k | ose68k | ose | OSE)
62454359Sroberto		basic_machine=m68k-ericsson
62554359Sroberto		os=-ose
62654359Sroberto		;;
62754359Sroberto	fx2800)
62854359Sroberto		basic_machine=i860-alliant
62954359Sroberto		;;
63054359Sroberto	genix)
63154359Sroberto		basic_machine=ns32k-ns
63254359Sroberto		;;
63354359Sroberto	gmicro)
63454359Sroberto		basic_machine=tron-gmicro
63554359Sroberto		os=-sysv
63654359Sroberto		;;
63782498Sroberto	go32)
63882498Sroberto		basic_machine=i386-pc
63982498Sroberto		os=-go32
64082498Sroberto		;;
64154359Sroberto	h3050r* | hiux*)
64254359Sroberto		basic_machine=hppa1.1-hitachi
64354359Sroberto		os=-hiuxwe2
64454359Sroberto		;;
64554359Sroberto	h8300hms)
64654359Sroberto		basic_machine=h8300-hitachi
64754359Sroberto		os=-hms
64854359Sroberto		;;
64954359Sroberto	h8300xray)
65054359Sroberto		basic_machine=h8300-hitachi
65154359Sroberto		os=-xray
65254359Sroberto		;;
65354359Sroberto	h8500hms)
65454359Sroberto		basic_machine=h8500-hitachi
65554359Sroberto		os=-hms
65654359Sroberto		;;
65754359Sroberto	harris)
65854359Sroberto		basic_machine=m88k-harris
65954359Sroberto		os=-sysv3
66054359Sroberto		;;
66154359Sroberto	hp300-*)
66254359Sroberto		basic_machine=m68k-hp
66354359Sroberto		;;
66454359Sroberto	hp300bsd)
66554359Sroberto		basic_machine=m68k-hp
66654359Sroberto		os=-bsd
66754359Sroberto		;;
66854359Sroberto	hp300hpux)
66954359Sroberto		basic_machine=m68k-hp
67054359Sroberto		os=-hpux
67154359Sroberto		;;
67254359Sroberto	hp3k9[0-9][0-9] | hp9[0-9][0-9])
67354359Sroberto		basic_machine=hppa1.0-hp
67454359Sroberto		;;
67554359Sroberto	hp9k2[0-9][0-9] | hp9k31[0-9])
67654359Sroberto		basic_machine=m68000-hp
67754359Sroberto		;;
67854359Sroberto	hp9k3[2-9][0-9])
67954359Sroberto		basic_machine=m68k-hp
68054359Sroberto		;;
68154359Sroberto	hp9k6[0-9][0-9] | hp6[0-9][0-9])
68254359Sroberto		basic_machine=hppa1.0-hp
68354359Sroberto		;;
68454359Sroberto	hp9k7[0-79][0-9] | hp7[0-79][0-9])
68554359Sroberto		basic_machine=hppa1.1-hp
68654359Sroberto		;;
68754359Sroberto	hp9k78[0-9] | hp78[0-9])
68854359Sroberto		# FIXME: really hppa2.0-hp
68954359Sroberto		basic_machine=hppa1.1-hp
69054359Sroberto		;;
69154359Sroberto	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
69254359Sroberto		# FIXME: really hppa2.0-hp
69354359Sroberto		basic_machine=hppa1.1-hp
69454359Sroberto		;;
69554359Sroberto	hp9k8[0-9][13679] | hp8[0-9][13679])
69654359Sroberto		basic_machine=hppa1.1-hp
69754359Sroberto		;;
69854359Sroberto	hp9k8[0-9][0-9] | hp8[0-9][0-9])
69954359Sroberto		basic_machine=hppa1.0-hp
70054359Sroberto		;;
70154359Sroberto	hppa-next)
70254359Sroberto		os=-nextstep3
70354359Sroberto		;;
70454359Sroberto	hppaosf)
70554359Sroberto		basic_machine=hppa1.1-hp
70654359Sroberto		os=-osf
70754359Sroberto		;;
70854359Sroberto	hppro)
70954359Sroberto		basic_machine=hppa1.1-hp
71054359Sroberto		os=-proelf
71154359Sroberto		;;
71254359Sroberto	i370-ibm* | ibm*)
71354359Sroberto		basic_machine=i370-ibm
71454359Sroberto		;;
71554359Sroberto# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
71682498Sroberto	i*86v32)
71754359Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
71854359Sroberto		os=-sysv32
71954359Sroberto		;;
72082498Sroberto	i*86v4*)
72154359Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
72254359Sroberto		os=-sysv4
72354359Sroberto		;;
72482498Sroberto	i*86v)
72554359Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
72654359Sroberto		os=-sysv
72754359Sroberto		;;
72882498Sroberto	i*86sol2)
72954359Sroberto		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
73054359Sroberto		os=-solaris2
73154359Sroberto		;;
73254359Sroberto	i386mach)
73354359Sroberto		basic_machine=i386-mach
73454359Sroberto		os=-mach
73554359Sroberto		;;
73654359Sroberto	i386-vsta | vsta)
73754359Sroberto		basic_machine=i386-unknown
73854359Sroberto		os=-vsta
73954359Sroberto		;;
74054359Sroberto	iris | iris4d)
74154359Sroberto		basic_machine=mips-sgi
74254359Sroberto		case $os in
74354359Sroberto		    -irix*)
74454359Sroberto			;;
74554359Sroberto		    *)
74654359Sroberto			os=-irix4
74754359Sroberto			;;
74854359Sroberto		esac
74954359Sroberto		;;
75054359Sroberto	isi68 | isi)
75154359Sroberto		basic_machine=m68k-isi
75254359Sroberto		os=-sysv
75354359Sroberto		;;
754290001Sglebius	m68knommu)
755290001Sglebius		basic_machine=m68k-unknown
756290001Sglebius		os=-linux
757290001Sglebius		;;
758290001Sglebius	m68knommu-*)
759290001Sglebius		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
760290001Sglebius		os=-linux
761290001Sglebius		;;
76254359Sroberto	m88k-omron*)
76354359Sroberto		basic_machine=m88k-omron
76454359Sroberto		;;
76554359Sroberto	magnum | m3230)
76654359Sroberto		basic_machine=mips-mips
76754359Sroberto		os=-sysv
76854359Sroberto		;;
76954359Sroberto	merlin)
77054359Sroberto		basic_machine=ns32k-utek
77154359Sroberto		os=-sysv
77254359Sroberto		;;
773290001Sglebius	microblaze)
774290001Sglebius		basic_machine=microblaze-xilinx
775290001Sglebius		;;
77682498Sroberto	mingw32)
77782498Sroberto		basic_machine=i386-pc
77882498Sroberto		os=-mingw32
77982498Sroberto		;;
780290001Sglebius	mingw32ce)
781290001Sglebius		basic_machine=arm-unknown
782290001Sglebius		os=-mingw32ce
783290001Sglebius		;;
78454359Sroberto	miniframe)
78554359Sroberto		basic_machine=m68000-convergent
78654359Sroberto		;;
78782498Sroberto	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
78854359Sroberto		basic_machine=m68k-atari
78954359Sroberto		os=-mint
79054359Sroberto		;;
79154359Sroberto	mips3*-*)
79254359Sroberto		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
79354359Sroberto		;;
79454359Sroberto	mips3*)
79554359Sroberto		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
79654359Sroberto		;;
79754359Sroberto	monitor)
79854359Sroberto		basic_machine=m68k-rom68k
79954359Sroberto		os=-coff
80054359Sroberto		;;
801132451Sroberto	morphos)
802132451Sroberto		basic_machine=powerpc-unknown
803132451Sroberto		os=-morphos
804132451Sroberto		;;
80554359Sroberto	msdos)
80682498Sroberto		basic_machine=i386-pc
80754359Sroberto		os=-msdos
80854359Sroberto		;;
809290001Sglebius	ms1-*)
810290001Sglebius		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
811290001Sglebius		;;
81282498Sroberto	mvs)
81382498Sroberto		basic_machine=i370-ibm
81482498Sroberto		os=-mvs
81582498Sroberto		;;
81654359Sroberto	ncr3000)
81754359Sroberto		basic_machine=i486-ncr
81854359Sroberto		os=-sysv4
81954359Sroberto		;;
82054359Sroberto	netbsd386)
82154359Sroberto		basic_machine=i386-unknown
82254359Sroberto		os=-netbsd
82354359Sroberto		;;
82454359Sroberto	netwinder)
82582498Sroberto		basic_machine=armv4l-rebel
82654359Sroberto		os=-linux
82754359Sroberto		;;
82854359Sroberto	news | news700 | news800 | news900)
82954359Sroberto		basic_machine=m68k-sony
83054359Sroberto		os=-newsos
83154359Sroberto		;;
83254359Sroberto	news1000)
83354359Sroberto		basic_machine=m68030-sony
83454359Sroberto		os=-newsos
83554359Sroberto		;;
83654359Sroberto	news-3600 | risc-news)
83754359Sroberto		basic_machine=mips-sony
83854359Sroberto		os=-newsos
83954359Sroberto		;;
84054359Sroberto	necv70)
84154359Sroberto		basic_machine=v70-nec
84254359Sroberto		os=-sysv
84354359Sroberto		;;
84454359Sroberto	next | m*-next )
84554359Sroberto		basic_machine=m68k-next
84654359Sroberto		case $os in
84754359Sroberto		    -nextstep* )
84854359Sroberto			;;
84954359Sroberto		    -ns2*)
85054359Sroberto		      os=-nextstep2
85154359Sroberto			;;
85254359Sroberto		    *)
85354359Sroberto		      os=-nextstep3
85454359Sroberto			;;
85554359Sroberto		esac
85654359Sroberto		;;
85754359Sroberto	nh3000)
85854359Sroberto		basic_machine=m68k-harris
85954359Sroberto		os=-cxux
86054359Sroberto		;;
86154359Sroberto	nh[45]000)
86254359Sroberto		basic_machine=m88k-harris
86354359Sroberto		os=-cxux
86454359Sroberto		;;
86554359Sroberto	nindy960)
86654359Sroberto		basic_machine=i960-intel
86754359Sroberto		os=-nindy
86854359Sroberto		;;
86954359Sroberto	mon960)
87054359Sroberto		basic_machine=i960-intel
87154359Sroberto		os=-mon960
87254359Sroberto		;;
87382498Sroberto	nonstopux)
87482498Sroberto		basic_machine=mips-compaq
87582498Sroberto		os=-nonstopux
87682498Sroberto		;;
87754359Sroberto	np1)
87854359Sroberto		basic_machine=np1-gould
87954359Sroberto		;;
880290001Sglebius	neo-tandem)
881290001Sglebius		basic_machine=neo-tandem
882290001Sglebius		;;
883290001Sglebius	nse-tandem)
884290001Sglebius		basic_machine=nse-tandem
885290001Sglebius		;;
88682498Sroberto	nsr-tandem)
88782498Sroberto		basic_machine=nsr-tandem
88882498Sroberto		;;
88954359Sroberto	op50n-* | op60c-*)
89054359Sroberto		basic_machine=hppa1.1-oki
89154359Sroberto		os=-proelf
89254359Sroberto		;;
893182007Sroberto	openrisc | openrisc-*)
894132451Sroberto		basic_machine=or32-unknown
895132451Sroberto		;;
896182007Sroberto	os400)
897182007Sroberto		basic_machine=powerpc-ibm
898182007Sroberto		os=-os400
899182007Sroberto		;;
90054359Sroberto	OSE68000 | ose68000)
90154359Sroberto		basic_machine=m68000-ericsson
90254359Sroberto		os=-ose
90354359Sroberto		;;
90454359Sroberto	os68k)
90554359Sroberto		basic_machine=m68k-none
90654359Sroberto		os=-os68k
90754359Sroberto		;;
90854359Sroberto	pa-hitachi)
90954359Sroberto		basic_machine=hppa1.1-hitachi
91054359Sroberto		os=-hiuxwe2
91154359Sroberto		;;
91254359Sroberto	paragon)
91354359Sroberto		basic_machine=i860-intel
91454359Sroberto		os=-osf
91554359Sroberto		;;
916290001Sglebius	parisc)
917290001Sglebius		basic_machine=hppa-unknown
918290001Sglebius		os=-linux
919290001Sglebius		;;
920290001Sglebius	parisc-*)
921290001Sglebius		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
922290001Sglebius		os=-linux
923290001Sglebius		;;
92454359Sroberto	pbd)
92554359Sroberto		basic_machine=sparc-tti
92654359Sroberto		;;
92754359Sroberto	pbb)
92854359Sroberto		basic_machine=m68k-tti
92954359Sroberto		;;
930132451Sroberto	pc532 | pc532-*)
93154359Sroberto		basic_machine=ns32k-pc532
93254359Sroberto		;;
933290001Sglebius	pc98)
934290001Sglebius		basic_machine=i386-pc
935290001Sglebius		;;
936290001Sglebius	pc98-*)
937290001Sglebius		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
938290001Sglebius		;;
939132451Sroberto	pentium | p5 | k5 | k6 | nexgen | viac3)
94054359Sroberto		basic_machine=i586-pc
94154359Sroberto		;;
942132451Sroberto	pentiumpro | p6 | 6x86 | athlon | athlon_*)
94354359Sroberto		basic_machine=i686-pc
94454359Sroberto		;;
945132451Sroberto	pentiumii | pentium2 | pentiumiii | pentium3)
94682498Sroberto		basic_machine=i686-pc
94754359Sroberto		;;
948132451Sroberto	pentium4)
949132451Sroberto		basic_machine=i786-pc
950132451Sroberto		;;
951132451Sroberto	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
95254359Sroberto		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
95354359Sroberto		;;
95482498Sroberto	pentiumpro-* | p6-* | 6x86-* | athlon-*)
95554359Sroberto		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
95654359Sroberto		;;
957132451Sroberto	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
95882498Sroberto		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
95954359Sroberto		;;
960132451Sroberto	pentium4-*)
961132451Sroberto		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
962132451Sroberto		;;
96354359Sroberto	pn)
96454359Sroberto		basic_machine=pn-gould
96554359Sroberto		;;
96682498Sroberto	power)	basic_machine=power-ibm
96754359Sroberto		;;
968290001Sglebius	ppc | ppcbe)	basic_machine=powerpc-unknown
969132451Sroberto		;;
970290001Sglebius	ppc-* | ppcbe-*)
971290001Sglebius		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
97254359Sroberto		;;
97354359Sroberto	ppcle | powerpclittle | ppc-le | powerpc-little)
97454359Sroberto		basic_machine=powerpcle-unknown
975132451Sroberto		;;
97654359Sroberto	ppcle-* | powerpclittle-*)
97754359Sroberto		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
97854359Sroberto		;;
979106424Sroberto	ppc64)	basic_machine=powerpc64-unknown
980132451Sroberto		;;
981106424Sroberto	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
982106424Sroberto		;;
983106424Sroberto	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
984106424Sroberto		basic_machine=powerpc64le-unknown
985132451Sroberto		;;
986106424Sroberto	ppc64le-* | powerpc64little-*)
987106424Sroberto		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
988106424Sroberto		;;
98954359Sroberto	ps2)
99054359Sroberto		basic_machine=i386-ibm
99154359Sroberto		;;
99282498Sroberto	pw32)
99382498Sroberto		basic_machine=i586-unknown
99482498Sroberto		os=-pw32
99582498Sroberto		;;
996290001Sglebius	rdos)
997290001Sglebius		basic_machine=i386-pc
998290001Sglebius		os=-rdos
999290001Sglebius		;;
100054359Sroberto	rom68k)
100154359Sroberto		basic_machine=m68k-rom68k
100254359Sroberto		os=-coff
100354359Sroberto		;;
100454359Sroberto	rm[46]00)
100554359Sroberto		basic_machine=mips-siemens
100654359Sroberto		;;
100754359Sroberto	rtpc | rtpc-*)
100854359Sroberto		basic_machine=romp-ibm
100954359Sroberto		;;
1010132451Sroberto	s390 | s390-*)
1011132451Sroberto		basic_machine=s390-ibm
1012132451Sroberto		;;
1013132451Sroberto	s390x | s390x-*)
1014132451Sroberto		basic_machine=s390x-ibm
1015132451Sroberto		;;
101654359Sroberto	sa29200)
101754359Sroberto		basic_machine=a29k-amd
101854359Sroberto		os=-udi
101954359Sroberto		;;
1020132451Sroberto	sb1)
1021132451Sroberto		basic_machine=mipsisa64sb1-unknown
1022132451Sroberto		;;
1023132451Sroberto	sb1el)
1024132451Sroberto		basic_machine=mipsisa64sb1el-unknown
1025132451Sroberto		;;
1026290001Sglebius	sde)
1027290001Sglebius		basic_machine=mipsisa32-sde
1028290001Sglebius		os=-elf
1029290001Sglebius		;;
1030132451Sroberto	sei)
1031132451Sroberto		basic_machine=mips-sei
1032132451Sroberto		os=-seiux
1033132451Sroberto		;;
103454359Sroberto	sequent)
103554359Sroberto		basic_machine=i386-sequent
103654359Sroberto		;;
103754359Sroberto	sh)
103854359Sroberto		basic_machine=sh-hitachi
103954359Sroberto		os=-hms
104054359Sroberto		;;
1041290001Sglebius	sh5el)
1042290001Sglebius		basic_machine=sh5le-unknown
1043290001Sglebius		;;
1044132451Sroberto	sh64)
1045132451Sroberto		basic_machine=sh64-unknown
1046132451Sroberto		;;
1047132451Sroberto	sparclite-wrs | simso-wrs)
104854359Sroberto		basic_machine=sparclite-wrs
104954359Sroberto		os=-vxworks
105054359Sroberto		;;
105154359Sroberto	sps7)
105254359Sroberto		basic_machine=m68k-bull
105354359Sroberto		os=-sysv2
105454359Sroberto		;;
105554359Sroberto	spur)
105654359Sroberto		basic_machine=spur-unknown
105754359Sroberto		;;
105854359Sroberto	st2000)
105954359Sroberto		basic_machine=m68k-tandem
106054359Sroberto		;;
106154359Sroberto	stratus)
106254359Sroberto		basic_machine=i860-stratus
106354359Sroberto		os=-sysv4
106454359Sroberto		;;
1065290001Sglebius	strongarm-* | thumb-*)
1066290001Sglebius		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
1067290001Sglebius		;;
106854359Sroberto	sun2)
106954359Sroberto		basic_machine=m68000-sun
107054359Sroberto		;;
107154359Sroberto	sun2os3)
107254359Sroberto		basic_machine=m68000-sun
107354359Sroberto		os=-sunos3
107454359Sroberto		;;
107554359Sroberto	sun2os4)
107654359Sroberto		basic_machine=m68000-sun
107754359Sroberto		os=-sunos4
107854359Sroberto		;;
107954359Sroberto	sun3os3)
108054359Sroberto		basic_machine=m68k-sun
108154359Sroberto		os=-sunos3
108254359Sroberto		;;
108354359Sroberto	sun3os4)
108454359Sroberto		basic_machine=m68k-sun
108554359Sroberto		os=-sunos4
108654359Sroberto		;;
108754359Sroberto	sun4os3)
108854359Sroberto		basic_machine=sparc-sun
108954359Sroberto		os=-sunos3
109054359Sroberto		;;
109154359Sroberto	sun4os4)
109254359Sroberto		basic_machine=sparc-sun
109354359Sroberto		os=-sunos4
109454359Sroberto		;;
109554359Sroberto	sun4sol2)
109654359Sroberto		basic_machine=sparc-sun
109754359Sroberto		os=-solaris2
109854359Sroberto		;;
109954359Sroberto	sun3 | sun3-*)
110054359Sroberto		basic_machine=m68k-sun
110154359Sroberto		;;
110254359Sroberto	sun4)
110354359Sroberto		basic_machine=sparc-sun
110454359Sroberto		;;
110554359Sroberto	sun386 | sun386i | roadrunner)
110654359Sroberto		basic_machine=i386-sun
110754359Sroberto		;;
110882498Sroberto	sv1)
110982498Sroberto		basic_machine=sv1-cray
111082498Sroberto		os=-unicos
111182498Sroberto		;;
111254359Sroberto	symmetry)
111354359Sroberto		basic_machine=i386-sequent
111454359Sroberto		os=-dynix
111554359Sroberto		;;
111654359Sroberto	t3e)
1117132451Sroberto		basic_machine=alphaev5-cray
111854359Sroberto		os=-unicos
111954359Sroberto		;;
1120132451Sroberto	t90)
1121132451Sroberto		basic_machine=t90-cray
1122132451Sroberto		os=-unicos
1123132451Sroberto		;;
1124290001Sglebius	tile*)
1125290001Sglebius		basic_machine=$basic_machine-unknown
1126290001Sglebius		os=-linux-gnu
112782498Sroberto		;;
112854359Sroberto	tx39)
112954359Sroberto		basic_machine=mipstx39-unknown
113054359Sroberto		;;
113154359Sroberto	tx39el)
113254359Sroberto		basic_machine=mipstx39el-unknown
113354359Sroberto		;;
1134132451Sroberto	toad1)
1135132451Sroberto		basic_machine=pdp10-xkl
1136132451Sroberto		os=-tops20
1137132451Sroberto		;;
113854359Sroberto	tower | tower-32)
113954359Sroberto		basic_machine=m68k-ncr
114054359Sroberto		;;
1141182007Sroberto	tpf)
1142182007Sroberto		basic_machine=s390x-ibm
1143182007Sroberto		os=-tpf
1144182007Sroberto		;;
114554359Sroberto	udi29k)
114654359Sroberto		basic_machine=a29k-amd
114754359Sroberto		os=-udi
114854359Sroberto		;;
114954359Sroberto	ultra3)
115054359Sroberto		basic_machine=a29k-nyu
115154359Sroberto		os=-sym1
115254359Sroberto		;;
115354359Sroberto	v810 | necv810)
115454359Sroberto		basic_machine=v810-nec
115554359Sroberto		os=-none
115654359Sroberto		;;
115754359Sroberto	vaxv)
115854359Sroberto		basic_machine=vax-dec
115954359Sroberto		os=-sysv
116054359Sroberto		;;
116154359Sroberto	vms)
116254359Sroberto		basic_machine=vax-dec
116354359Sroberto		os=-vms
116454359Sroberto		;;
116554359Sroberto	vpp*|vx|vx-*)
1166132451Sroberto		basic_machine=f301-fujitsu
1167132451Sroberto		;;
116854359Sroberto	vxworks960)
116954359Sroberto		basic_machine=i960-wrs
117054359Sroberto		os=-vxworks
117154359Sroberto		;;
117254359Sroberto	vxworks68)
117354359Sroberto		basic_machine=m68k-wrs
117454359Sroberto		os=-vxworks
117554359Sroberto		;;
117654359Sroberto	vxworks29k)
117754359Sroberto		basic_machine=a29k-wrs
117854359Sroberto		os=-vxworks
117954359Sroberto		;;
118054359Sroberto	w65*)
118154359Sroberto		basic_machine=w65-wdc
118254359Sroberto		os=-none
118354359Sroberto		;;
118454359Sroberto	w89k-*)
118554359Sroberto		basic_machine=hppa1.1-winbond
118654359Sroberto		os=-proelf
118754359Sroberto		;;
1188182007Sroberto	xbox)
1189182007Sroberto		basic_machine=i686-pc
1190182007Sroberto		os=-mingw32
1191182007Sroberto		;;
1192132451Sroberto	xps | xps100)
1193132451Sroberto		basic_machine=xps100-honeywell
119482498Sroberto		;;
1195290001Sglebius	xscale-* | xscalee[bl]-*)
1196290001Sglebius		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
1197290001Sglebius		;;
1198132451Sroberto	ymp)
1199132451Sroberto		basic_machine=ymp-cray
120054359Sroberto		os=-unicos
120154359Sroberto		;;
120254359Sroberto	z8k-*-coff)
120354359Sroberto		basic_machine=z8k-unknown
120454359Sroberto		os=-sim
120554359Sroberto		;;
1206290001Sglebius	z80-*-coff)
1207290001Sglebius		basic_machine=z80-unknown
1208290001Sglebius		os=-sim
1209290001Sglebius		;;
121054359Sroberto	none)
121154359Sroberto		basic_machine=none-none
121254359Sroberto		os=-none
121354359Sroberto		;;
121454359Sroberto
121554359Sroberto# Here we handle the default manufacturer of certain CPU types.  It is in
121654359Sroberto# some cases the only manufacturer, in others, it is the most popular.
121754359Sroberto	w89k)
121854359Sroberto		basic_machine=hppa1.1-winbond
121954359Sroberto		;;
122054359Sroberto	op50n)
122154359Sroberto		basic_machine=hppa1.1-oki
122254359Sroberto		;;
122354359Sroberto	op60c)
122454359Sroberto		basic_machine=hppa1.1-oki
122554359Sroberto		;;
122654359Sroberto	romp)
122754359Sroberto		basic_machine=romp-ibm
122854359Sroberto		;;
1229182007Sroberto	mmix)
1230182007Sroberto		basic_machine=mmix-knuth
1231182007Sroberto		;;
123254359Sroberto	rs6000)
123354359Sroberto		basic_machine=rs6000-ibm
123454359Sroberto		;;
123554359Sroberto	vax)
123654359Sroberto		basic_machine=vax-dec
123754359Sroberto		;;
123882498Sroberto	pdp10)
123982498Sroberto		# there are many clones, so DEC is not a safe bet
124082498Sroberto		basic_machine=pdp10-unknown
124182498Sroberto		;;
124254359Sroberto	pdp11)
124354359Sroberto		basic_machine=pdp11-dec
124454359Sroberto		;;
124554359Sroberto	we32k)
124654359Sroberto		basic_machine=we32k-att
124754359Sroberto		;;
1248290001Sglebius	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
124982498Sroberto		basic_machine=sh-unknown
125082498Sroberto		;;
1251290001Sglebius	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
125254359Sroberto		basic_machine=sparc-sun
125354359Sroberto		;;
1254132451Sroberto	cydra)
125554359Sroberto		basic_machine=cydra-cydrome
125654359Sroberto		;;
125754359Sroberto	orion)
125854359Sroberto		basic_machine=orion-highlevel
125954359Sroberto		;;
126054359Sroberto	orion105)
126154359Sroberto		basic_machine=clipper-highlevel
126254359Sroberto		;;
126354359Sroberto	mac | mpw | mac-mpw)
126454359Sroberto		basic_machine=m68k-apple
126554359Sroberto		;;
126654359Sroberto	pmac | pmac-mpw)
126754359Sroberto		basic_machine=powerpc-apple
126854359Sroberto		;;
126982498Sroberto	*-unknown)
127082498Sroberto		# Make sure to match an already-canonicalized machine name.
127182498Sroberto		;;
127254359Sroberto	*)
127354359Sroberto		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
127454359Sroberto		exit 1
127554359Sroberto		;;
127654359Srobertoesac
127754359Sroberto
127854359Sroberto# Here we canonicalize certain aliases for manufacturers.
127954359Srobertocase $basic_machine in
128054359Sroberto	*-digital*)
128154359Sroberto		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
128254359Sroberto		;;
128354359Sroberto	*-commodore*)
128454359Sroberto		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
128554359Sroberto		;;
128654359Sroberto	*)
128754359Sroberto		;;
128854359Srobertoesac
128954359Sroberto
129054359Sroberto# Decode manufacturer-specific aliases for certain operating systems.
129154359Sroberto
129254359Srobertoif [ x"$os" != x"" ]
129354359Srobertothen
129454359Srobertocase $os in
1295290001Sglebius	# First match some system type aliases
1296290001Sglebius	# that might get confused with valid system types.
129754359Sroberto	# -solaris* is a basic system type, with this one exception.
1298290001Sglebius	-auroraux)
1299290001Sglebius		os=-auroraux
1300290001Sglebius		;;
130154359Sroberto	-solaris1 | -solaris1.*)
130254359Sroberto		os=`echo $os | sed -e 's|solaris1|sunos4|'`
130354359Sroberto		;;
130454359Sroberto	-solaris)
130554359Sroberto		os=-solaris2
130654359Sroberto		;;
130754359Sroberto	-svr4*)
130854359Sroberto		os=-sysv4
130954359Sroberto		;;
131054359Sroberto	-unixware*)
131154359Sroberto		os=-sysv4.2uw
131254359Sroberto		;;
131354359Sroberto	-gnu/linux*)
131454359Sroberto		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
131554359Sroberto		;;
131654359Sroberto	# First accept the basic system types.
131754359Sroberto	# The portable systems comes first.
131854359Sroberto	# Each alternative MUST END IN A *, to match a version number.
131954359Sroberto	# -sysv* is not here because it comes later, after sysvr4.
132054359Sroberto	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
1321290001Sglebius	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
1322290001Sglebius	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
1323290001Sglebius	      | -sym* | -kopensolaris* \
132454359Sroberto	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
1325290001Sglebius	      | -aos* | -aros* \
132654359Sroberto	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
132754359Sroberto	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
1328290001Sglebius	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
1329290001Sglebius	      | -openbsd* | -solidbsd* \
1330182007Sroberto	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
1331182007Sroberto	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
133254359Sroberto	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
133354359Sroberto	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1334290001Sglebius	      | -chorusos* | -chorusrdb* | -cegcc* \
133554359Sroberto	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
1336290001Sglebius	      | -mingw32* | -linux-gnu* | -linux-android* \
1337290001Sglebius	      | -linux-newlib* | -linux-uclibc* \
1338290001Sglebius	      | -uxpv* | -beos* | -mpeix* | -udk* \
1339132451Sroberto	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
134082498Sroberto	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1341106424Sroberto	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1342132451Sroberto	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1343132451Sroberto	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1344182007Sroberto	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
1345290001Sglebius	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
134654359Sroberto	# Remember, each alternative MUST END IN *, to match a version number.
134754359Sroberto		;;
134882498Sroberto	-qnx*)
134982498Sroberto		case $basic_machine in
135082498Sroberto		    x86-* | i*86-*)
135182498Sroberto			;;
135282498Sroberto		    *)
135382498Sroberto			os=-nto$os
135482498Sroberto			;;
135582498Sroberto		esac
135682498Sroberto		;;
1357132451Sroberto	-nto-qnx*)
1358132451Sroberto		;;
135982498Sroberto	-nto*)
1360132451Sroberto		os=`echo $os | sed -e 's|nto|nto-qnx|'`
136182498Sroberto		;;
136254359Sroberto	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1363182007Sroberto	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
136482498Sroberto	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
136554359Sroberto		;;
136654359Sroberto	-mac*)
136754359Sroberto		os=`echo $os | sed -e 's|mac|macos|'`
136854359Sroberto		;;
1369182007Sroberto	-linux-dietlibc)
1370182007Sroberto		os=-linux-dietlibc
1371182007Sroberto		;;
137254359Sroberto	-linux*)
137354359Sroberto		os=`echo $os | sed -e 's|linux|linux-gnu|'`
137454359Sroberto		;;
137554359Sroberto	-sunos5*)
137654359Sroberto		os=`echo $os | sed -e 's|sunos5|solaris2|'`
137754359Sroberto		;;
137854359Sroberto	-sunos6*)
137954359Sroberto		os=`echo $os | sed -e 's|sunos6|solaris3|'`
138054359Sroberto		;;
138182498Sroberto	-opened*)
138282498Sroberto		os=-openedition
138382498Sroberto		;;
1384290001Sglebius	-os400*)
1385182007Sroberto		os=-os400
1386182007Sroberto		;;
138782498Sroberto	-wince*)
138882498Sroberto		os=-wince
138982498Sroberto		;;
139054359Sroberto	-osfrose*)
139154359Sroberto		os=-osfrose
139254359Sroberto		;;
139354359Sroberto	-osf*)
139454359Sroberto		os=-osf
139554359Sroberto		;;
139654359Sroberto	-utek*)
139754359Sroberto		os=-bsd
139854359Sroberto		;;
139954359Sroberto	-dynix*)
140054359Sroberto		os=-bsd
140154359Sroberto		;;
140254359Sroberto	-acis*)
140354359Sroberto		os=-aos
140454359Sroberto		;;
1405132451Sroberto	-atheos*)
1406132451Sroberto		os=-atheos
1407132451Sroberto		;;
1408182007Sroberto	-syllable*)
1409182007Sroberto		os=-syllable
1410182007Sroberto		;;
141154359Sroberto	-386bsd)
141254359Sroberto		os=-bsd
141354359Sroberto		;;
141454359Sroberto	-ctix* | -uts*)
141554359Sroberto		os=-sysv
141654359Sroberto		;;
1417132451Sroberto	-nova*)
1418132451Sroberto		os=-rtmk-nova
1419132451Sroberto		;;
142054359Sroberto	-ns2 )
1421132451Sroberto		os=-nextstep2
142254359Sroberto		;;
142382498Sroberto	-nsk*)
142482498Sroberto		os=-nsk
142582498Sroberto		;;
142654359Sroberto	# Preserve the version number of sinix5.
142754359Sroberto	-sinix5.*)
142854359Sroberto		os=`echo $os | sed -e 's|sinix|sysv|'`
142954359Sroberto		;;
143054359Sroberto	-sinix*)
143154359Sroberto		os=-sysv4
143254359Sroberto		;;
1433290001Sglebius	-tpf*)
1434182007Sroberto		os=-tpf
1435182007Sroberto		;;
143654359Sroberto	-triton*)
143754359Sroberto		os=-sysv3
143854359Sroberto		;;
143954359Sroberto	-oss*)
144054359Sroberto		os=-sysv3
144154359Sroberto		;;
144254359Sroberto	-svr4)
144354359Sroberto		os=-sysv4
144454359Sroberto		;;
144554359Sroberto	-svr3)
144654359Sroberto		os=-sysv3
144754359Sroberto		;;
144854359Sroberto	-sysvr4)
144954359Sroberto		os=-sysv4
145054359Sroberto		;;
145154359Sroberto	# This must come after -sysvr4.
145254359Sroberto	-sysv*)
145354359Sroberto		;;
145454359Sroberto	-ose*)
145554359Sroberto		os=-ose
145654359Sroberto		;;
145754359Sroberto	-es1800*)
145854359Sroberto		os=-ose
145954359Sroberto		;;
146054359Sroberto	-xenix)
146154359Sroberto		os=-xenix
146254359Sroberto		;;
1463132451Sroberto	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1464132451Sroberto		os=-mint
146554359Sroberto		;;
1466132451Sroberto	-aros*)
1467132451Sroberto		os=-aros
1468132451Sroberto		;;
1469132451Sroberto	-kaos*)
1470132451Sroberto		os=-kaos
1471132451Sroberto		;;
1472182007Sroberto	-zvmoe)
1473182007Sroberto		os=-zvmoe
1474182007Sroberto		;;
1475290001Sglebius	-dicos*)
1476290001Sglebius		os=-dicos
1477290001Sglebius		;;
1478290001Sglebius	-nacl*)
1479290001Sglebius		;;
148054359Sroberto	-none)
148154359Sroberto		;;
148254359Sroberto	*)
148354359Sroberto		# Get rid of the `-' at the beginning of $os.
148454359Sroberto		os=`echo $os | sed 's/[^-]*-//'`
148554359Sroberto		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
148654359Sroberto		exit 1
148754359Sroberto		;;
148854359Srobertoesac
148954359Srobertoelse
149054359Sroberto
149154359Sroberto# Here we handle the default operating systems that come with various machines.
149254359Sroberto# The value should be what the vendor currently ships out the door with their
149354359Sroberto# machine or put another way, the most popular os provided with the machine.
149454359Sroberto
149554359Sroberto# Note that if you're going to try to match "-MANUFACTURER" here (say,
149654359Sroberto# "-sun"), then you have to tell the case statement up towards the top
149754359Sroberto# that MANUFACTURER isn't an operating system.  Otherwise, code above
149854359Sroberto# will signal an error saying that MANUFACTURER isn't an operating
149954359Sroberto# system, and we'll never get to this point.
150054359Sroberto
150154359Srobertocase $basic_machine in
1502290001Sglebius	score-*)
1503290001Sglebius		os=-elf
1504290001Sglebius		;;
1505290001Sglebius	spu-*)
1506290001Sglebius		os=-elf
1507290001Sglebius		;;
150854359Sroberto	*-acorn)
150954359Sroberto		os=-riscix1.2
151054359Sroberto		;;
151182498Sroberto	arm*-rebel)
151254359Sroberto		os=-linux
151354359Sroberto		;;
151454359Sroberto	arm*-semi)
151554359Sroberto		os=-aout
151654359Sroberto		;;
1517290001Sglebius	c4x-* | tic4x-*)
1518290001Sglebius		os=-coff
1519290001Sglebius		;;
1520290001Sglebius	tic54x-*)
1521290001Sglebius		os=-coff
1522290001Sglebius		;;
1523290001Sglebius	tic55x-*)
1524290001Sglebius		os=-coff
1525290001Sglebius		;;
1526290001Sglebius	tic6x-*)
1527290001Sglebius		os=-coff
1528290001Sglebius		;;
1529132451Sroberto	# This must come before the *-dec entry.
153082498Sroberto	pdp10-*)
153182498Sroberto		os=-tops20
153282498Sroberto		;;
1533132451Sroberto	pdp11-*)
153454359Sroberto		os=-none
153554359Sroberto		;;
153654359Sroberto	*-dec | vax-*)
153754359Sroberto		os=-ultrix4.2
153854359Sroberto		;;
153954359Sroberto	m68*-apollo)
154054359Sroberto		os=-domain
154154359Sroberto		;;
154254359Sroberto	i386-sun)
154354359Sroberto		os=-sunos4.0.2
154454359Sroberto		;;
154554359Sroberto	m68000-sun)
154654359Sroberto		os=-sunos3
154754359Sroberto		# This also exists in the configure program, but was not the
154854359Sroberto		# default.
154954359Sroberto		# os=-sunos4
155054359Sroberto		;;
155154359Sroberto	m68*-cisco)
155254359Sroberto		os=-aout
155354359Sroberto		;;
1554290001Sglebius	mep-*)
1555290001Sglebius		os=-elf
1556290001Sglebius		;;
155754359Sroberto	mips*-cisco)
155854359Sroberto		os=-elf
155954359Sroberto		;;
156054359Sroberto	mips*-*)
156154359Sroberto		os=-elf
156254359Sroberto		;;
1563132451Sroberto	or32-*)
1564132451Sroberto		os=-coff
1565132451Sroberto		;;
156654359Sroberto	*-tti)	# must be before sparc entry or we get the wrong os.
156754359Sroberto		os=-sysv3
156854359Sroberto		;;
156954359Sroberto	sparc-* | *-sun)
157054359Sroberto		os=-sunos4.1.1
157154359Sroberto		;;
157254359Sroberto	*-be)
157354359Sroberto		os=-beos
157454359Sroberto		;;
1575182007Sroberto	*-haiku)
1576182007Sroberto		os=-haiku
1577182007Sroberto		;;
157854359Sroberto	*-ibm)
157954359Sroberto		os=-aix
158054359Sroberto		;;
1581290001Sglebius	*-knuth)
1582182007Sroberto		os=-mmixware
1583182007Sroberto		;;
158454359Sroberto	*-wec)
158554359Sroberto		os=-proelf
158654359Sroberto		;;
158754359Sroberto	*-winbond)
158854359Sroberto		os=-proelf
158954359Sroberto		;;
159054359Sroberto	*-oki)
159154359Sroberto		os=-proelf
159254359Sroberto		;;
159354359Sroberto	*-hp)
159454359Sroberto		os=-hpux
159554359Sroberto		;;
159654359Sroberto	*-hitachi)
159754359Sroberto		os=-hiux
159854359Sroberto		;;
159954359Sroberto	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
160054359Sroberto		os=-sysv
160154359Sroberto		;;
160254359Sroberto	*-cbm)
160354359Sroberto		os=-amigaos
160454359Sroberto		;;
160554359Sroberto	*-dg)
160654359Sroberto		os=-dgux
160754359Sroberto		;;
160854359Sroberto	*-dolphin)
160954359Sroberto		os=-sysv3
161054359Sroberto		;;
161154359Sroberto	m68k-ccur)
161254359Sroberto		os=-rtu
161354359Sroberto		;;
161454359Sroberto	m88k-omron*)
161554359Sroberto		os=-luna
161654359Sroberto		;;
161754359Sroberto	*-next )
161854359Sroberto		os=-nextstep
161954359Sroberto		;;
162054359Sroberto	*-sequent)
162154359Sroberto		os=-ptx
162254359Sroberto		;;
162354359Sroberto	*-crds)
162454359Sroberto		os=-unos
162554359Sroberto		;;
162654359Sroberto	*-ns)
162754359Sroberto		os=-genix
162854359Sroberto		;;
162954359Sroberto	i370-*)
163054359Sroberto		os=-mvs
163154359Sroberto		;;
163254359Sroberto	*-next)
163354359Sroberto		os=-nextstep3
163454359Sroberto		;;
1635132451Sroberto	*-gould)
163654359Sroberto		os=-sysv
163754359Sroberto		;;
1638132451Sroberto	*-highlevel)
163954359Sroberto		os=-bsd
164054359Sroberto		;;
164154359Sroberto	*-encore)
164254359Sroberto		os=-bsd
164354359Sroberto		;;
1644132451Sroberto	*-sgi)
164554359Sroberto		os=-irix
164654359Sroberto		;;
1647132451Sroberto	*-siemens)
164854359Sroberto		os=-sysv4
164954359Sroberto		;;
165054359Sroberto	*-masscomp)
165154359Sroberto		os=-rtu
165254359Sroberto		;;
165382498Sroberto	f30[01]-fujitsu | f700-fujitsu)
165454359Sroberto		os=-uxpv
165554359Sroberto		;;
165654359Sroberto	*-rom68k)
165754359Sroberto		os=-coff
165854359Sroberto		;;
165954359Sroberto	*-*bug)
166054359Sroberto		os=-coff
166154359Sroberto		;;
166254359Sroberto	*-apple)
166354359Sroberto		os=-macos
166454359Sroberto		;;
166554359Sroberto	*-atari*)
166654359Sroberto		os=-mint
166754359Sroberto		;;
166854359Sroberto	*)
166954359Sroberto		os=-none
167054359Sroberto		;;
167154359Srobertoesac
167254359Srobertofi
167354359Sroberto
167454359Sroberto# Here we handle the case where we know the os, and the CPU type, but not the
167554359Sroberto# manufacturer.  We pick the logical manufacturer.
167654359Srobertovendor=unknown
167754359Srobertocase $basic_machine in
167854359Sroberto	*-unknown)
167954359Sroberto		case $os in
168054359Sroberto			-riscix*)
168154359Sroberto				vendor=acorn
168254359Sroberto				;;
168354359Sroberto			-sunos*)
168454359Sroberto				vendor=sun
168554359Sroberto				;;
1686290001Sglebius			-cnk*|-aix*)
168754359Sroberto				vendor=ibm
168854359Sroberto				;;
168954359Sroberto			-beos*)
169054359Sroberto				vendor=be
169154359Sroberto				;;
169254359Sroberto			-hpux*)
169354359Sroberto				vendor=hp
169454359Sroberto				;;
169554359Sroberto			-mpeix*)
169654359Sroberto				vendor=hp
169754359Sroberto				;;
169854359Sroberto			-hiux*)
169954359Sroberto				vendor=hitachi
170054359Sroberto				;;
170154359Sroberto			-unos*)
170254359Sroberto				vendor=crds
170354359Sroberto				;;
170454359Sroberto			-dgux*)
170554359Sroberto				vendor=dg
170654359Sroberto				;;
170754359Sroberto			-luna*)
170854359Sroberto				vendor=omron
170954359Sroberto				;;
171054359Sroberto			-genix*)
171154359Sroberto				vendor=ns
171254359Sroberto				;;
171382498Sroberto			-mvs* | -opened*)
171454359Sroberto				vendor=ibm
171554359Sroberto				;;
1716182007Sroberto			-os400*)
1717182007Sroberto				vendor=ibm
1718182007Sroberto				;;
171954359Sroberto			-ptx*)
172054359Sroberto				vendor=sequent
172154359Sroberto				;;
1722182007Sroberto			-tpf*)
1723182007Sroberto				vendor=ibm
1724182007Sroberto				;;
1725132451Sroberto			-vxsim* | -vxworks* | -windiss*)
172654359Sroberto				vendor=wrs
172754359Sroberto				;;
172854359Sroberto			-aux*)
172954359Sroberto				vendor=apple
173054359Sroberto				;;
173154359Sroberto			-hms*)
173254359Sroberto				vendor=hitachi
173354359Sroberto				;;
173454359Sroberto			-mpw* | -macos*)
173554359Sroberto				vendor=apple
173654359Sroberto				;;
173782498Sroberto			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
173854359Sroberto				vendor=atari
173954359Sroberto				;;
1740106424Sroberto			-vos*)
1741106424Sroberto				vendor=stratus
1742106424Sroberto				;;
174354359Sroberto		esac
174454359Sroberto		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
174554359Sroberto		;;
174654359Srobertoesac
174754359Sroberto
174854359Srobertoecho $basic_machine$os
1749182007Srobertoexit
175082498Sroberto
175182498Sroberto# Local variables:
175282498Sroberto# eval: (add-hook 'write-file-hooks 'time-stamp)
175382498Sroberto# time-stamp-start: "timestamp='"
175482498Sroberto# time-stamp-format: "%:y-%02m-%02d"
175582498Sroberto# time-stamp-end: "'"
175682498Sroberto# End:
1757