126497Sache#! /bin/sh
2119610Sache# Configuration validation subroutine script.
3119610Sache#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4119610Sache#   2000, 2001, 2002 Free Software Foundation, Inc.
5119610Sache
6136644Sachetimestamp='2002-11-30'
7119610Sache
826497Sache# This file is (in principle) common to ALL GNU software.
926497Sache# The presence of a machine in this file suggests that SOME GNU software
1026497Sache# can handle that machine.  It does not imply ALL GNU software can.
1126497Sache#
1226497Sache# This file is free software; you can redistribute it and/or modify
1326497Sache# it under the terms of the GNU General Public License as published by
1426497Sache# the Free Software Foundation; either version 2 of the License, or
1526497Sache# (at your option) any later version.
1626497Sache#
1726497Sache# This program is distributed in the hope that it will be useful,
1826497Sache# but WITHOUT ANY WARRANTY; without even the implied warranty of
1926497Sache# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2026497Sache# GNU General Public License for more details.
2126497Sache#
2226497Sache# You should have received a copy of the GNU General Public License
2326497Sache# along with this program; if not, write to the Free Software
2426497Sache# Foundation, Inc., 59 Temple Place - Suite 330,
2526497Sache# Boston, MA 02111-1307, USA.
2626497Sache
2726497Sache# As a special exception to the GNU General Public License, if you
2826497Sache# distribute this file as part of a program that contains a
2926497Sache# configuration script generated by Autoconf, you may include it under
3026497Sache# the same distribution terms that you use for the rest of that program.
3126497Sache
32119610Sache# Please send patches to <config-patches@gnu.org>.  Submit a context
33119610Sache# diff and a properly formatted ChangeLog entry.
34119610Sache#
3526497Sache# Configuration subroutine to validate and canonicalize a configuration type.
3626497Sache# Supply the specified configuration type as an argument.
3726497Sache# If it is invalid, we print an error message on stderr and exit with code 1.
3826497Sache# Otherwise, we print the canonical config type on stdout and succeed.
3926497Sache
4026497Sache# This file is supposed to be the same for all GNU packages
4126497Sache# and recognize all the CPU types, system types and aliases
4226497Sache# that are meaningful with *any* GNU software.
4326497Sache# Each package is responsible for reporting which valid configurations
4426497Sache# it does not support.  The user should be able to distinguish
4526497Sache# a failure to support a valid configuration from a meaningless
4626497Sache# configuration.
4726497Sache
4826497Sache# The goal of this file is to map all the various variations of a given
4926497Sache# machine specification into a single specification in the form:
5026497Sache#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
5126497Sache# or in some cases, the newer four-part form:
5226497Sache#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
5326497Sache# It is wrong to echo any other type of specification.
5426497Sache
55119610Sacheme=`echo "$0" | sed -e 's,.*/,,'`
5626497Sache
57119610Sacheusage="\
58119610SacheUsage: $0 [OPTION] CPU-MFR-OPSYS
59119610Sache       $0 [OPTION] ALIAS
60119610Sache
61119610SacheCanonicalize a configuration name.
62119610Sache
63119610SacheOperation modes:
64119610Sache  -h, --help         print this help, then exit
65119610Sache  -t, --time-stamp   print date of last modification, then exit
66119610Sache  -v, --version      print version number, then exit
67119610Sache
68119610SacheReport bugs and patches to <config-patches@gnu.org>."
69119610Sache
70119610Sacheversion="\
71119610SacheGNU config.sub ($timestamp)
72119610Sache
73119610SacheCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
74119610SacheFree Software Foundation, Inc.
75119610Sache
76119610SacheThis is free software; see the source for copying conditions.  There is NO
77119610Sachewarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
78119610Sache
79119610Sachehelp="
80119610SacheTry \`$me --help' for more information."
81119610Sache
82119610Sache# Parse command line
83119610Sachewhile test $# -gt 0 ; do
84119610Sache  case $1 in
85119610Sache    --time-stamp | --time* | -t )
86119610Sache       echo "$timestamp" ; exit 0 ;;
87119610Sache    --version | -v )
88119610Sache       echo "$version" ; exit 0 ;;
89119610Sache    --help | --h* | -h )
90119610Sache       echo "$usage"; exit 0 ;;
91119610Sache    -- )     # Stop option processing
92119610Sache       shift; break ;;
93119610Sache    - )	# Use stdin as input.
94119610Sache       break ;;
95119610Sache    -* )
96119610Sache       echo "$me: invalid option $1$help"
97119610Sache       exit 1 ;;
98119610Sache
99119610Sache    *local*)
100119610Sache       # First pass through any local machine types.
101119610Sache       echo $1
102119610Sache       exit 0;;
103119610Sache
104119610Sache    * )
105119610Sache       break ;;
106119610Sache  esac
107119610Sachedone
108119610Sache
109119610Sachecase $# in
110119610Sache 0) echo "$me: missing argument$help" >&2
111119610Sache    exit 1;;
112119610Sache 1) ;;
113119610Sache *) echo "$me: too many arguments$help" >&2
114119610Sache    exit 1;;
11526497Sacheesac
11626497Sache
11726497Sache# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
11826497Sache# Here we must recognize all the valid KERNEL-OS combinations.
11926497Sachemaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
12026497Sachecase $maybe_os in
121136644Sache  nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
12226497Sache    os=-$maybe_os
12326497Sache    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
12426497Sache    ;;
12526497Sache  *)
12626497Sache    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
12726497Sache    if [ $basic_machine != $1 ]
12826497Sache    then os=`echo $1 | sed 's/.*-/-/'`
12926497Sache    else os=; fi
13026497Sache    ;;
13126497Sacheesac
13226497Sache
13326497Sache### Let's recognize common machines as not being operating systems so
13426497Sache### that things like config.sub decstation-3100 work.  We also
13526497Sache### recognize some manufacturers as not being operating systems, so we
13626497Sache### can provide default operating systems below.
13726497Sachecase $os in
13826497Sache	-sun*os*)
13926497Sache		# Prevent following clause from handling this invalid input.
14026497Sache		;;
14126497Sache	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
14226497Sache	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
14326497Sache	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
14426497Sache	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
14526497Sache	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
14626497Sache	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
147119610Sache	-apple | -axis)
14826497Sache		os=
14926497Sache		basic_machine=$1
15026497Sache		;;
15158310Sache	-sim | -cisco | -oki | -wec | -winbond)
15258310Sache		os=
15358310Sache		basic_machine=$1
15458310Sache		;;
15558310Sache	-scout)
15658310Sache		;;
15758310Sache	-wrs)
158119610Sache		os=-vxworks
15958310Sache		basic_machine=$1
16058310Sache		;;
161119610Sache	-chorusos*)
162119610Sache		os=-chorusos
163119610Sache		basic_machine=$1
164119610Sache		;;
165119610Sache 	-chorusrdb)
166119610Sache 		os=-chorusrdb
167119610Sache		basic_machine=$1
168119610Sache 		;;
16926497Sache	-hiux*)
17026497Sache		os=-hiuxwe2
17126497Sache		;;
17226497Sache	-sco5)
17347558Sache		os=-sco3.2v5
17426497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
17526497Sache		;;
17626497Sache	-sco4)
17726497Sache		os=-sco3.2v4
17826497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
17926497Sache		;;
18026497Sache	-sco3.2.[4-9]*)
18126497Sache		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
18226497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18326497Sache		;;
18426497Sache	-sco3.2v[4-9]*)
18526497Sache		# Don't forget version if it is 3.2v4 or newer.
18626497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
18726497Sache		;;
18826497Sache	-sco*)
18926497Sache		os=-sco3.2v2
19026497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19126497Sache		;;
19258310Sache	-udk*)
19358310Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19458310Sache		;;
19526497Sache	-isc)
19626497Sache		os=-isc2.2
19726497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
19826497Sache		;;
19926497Sache	-clix*)
20026497Sache		basic_machine=clipper-intergraph
20126497Sache		;;
20226497Sache	-isc*)
20326497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
20426497Sache		;;
20526497Sache	-lynx*)
20626497Sache		os=-lynxos
20726497Sache		;;
20826497Sache	-ptx*)
20926497Sache		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
21026497Sache		;;
21126497Sache	-windowsnt*)
21226497Sache		os=`echo $os | sed -e 's/windowsnt/winnt/'`
21326497Sache		;;
21426497Sache	-psos*)
21526497Sache		os=-psos
21626497Sache		;;
217119610Sache	-mint | -mint[0-9]*)
218119610Sache		basic_machine=m68k-atari
219119610Sache		os=-mint
220119610Sache		;;
22126497Sacheesac
22226497Sache
22326497Sache# Decode aliases for certain CPU-COMPANY combinations.
22426497Sachecase $basic_machine in
22526497Sache	# Recognize the basic CPU types without company name.
22626497Sache	# Some are omitted here because they have special meanings below.
227119610Sache	1750a | 580 \
228119610Sache	| a29k \
229119610Sache	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
230119610Sache	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
231119610Sache	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
232136644Sache	| clipper \
233136644Sache	| d10v | d30v | dlx | dsp16xx \
234136644Sache	| fr30 | frv \
235119610Sache	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
236119610Sache	| i370 | i860 | i960 | ia64 \
237136644Sache	| ip2k \
238119610Sache	| m32r | m68000 | m68k | m88k | mcore \
239136644Sache	| mips | mipsbe | mipseb | mipsel | mipsle \
240136644Sache	| mips16 \
241136644Sache	| mips64 | mips64el \
242136644Sache	| mips64vr | mips64vrel \
243136644Sache	| mips64orion | mips64orionel \
244136644Sache	| mips64vr4100 | mips64vr4100el \
245136644Sache	| mips64vr4300 | mips64vr4300el \
246136644Sache	| mips64vr5000 | mips64vr5000el \
247136644Sache	| mipsisa32 | mipsisa32el \
248136644Sache	| mipsisa64 | mipsisa64el \
249136644Sache	| mipsisa64sb1 | mipsisa64sb1el \
250136644Sache	| mipsisa64sr71k | mipsisa64sr71kel \
251136644Sache	| mipstx39 | mipstx39el \
252119610Sache	| mn10200 | mn10300 \
253119610Sache	| ns16k | ns32k \
254119610Sache	| openrisc | or32 \
255119610Sache	| pdp10 | pdp11 | pj | pjl \
256119610Sache	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
257119610Sache	| pyramid \
258136644Sache	| sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
259136644Sache	| sh64 | sh64le \
260119610Sache	| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
261119610Sache	| strongarm \
262119610Sache	| tahoe | thumb | tic80 | tron \
263119610Sache	| v850 | v850e \
264119610Sache	| we32k \
265119610Sache	| x86 | xscale | xstormy16 | xtensa \
266119610Sache	| z8k)
26726497Sache		basic_machine=$basic_machine-unknown
26826497Sache		;;
269119610Sache	m6811 | m68hc11 | m6812 | m68hc12)
270119610Sache		# Motorola 68HC11/12.
271119610Sache		basic_machine=$basic_machine-unknown
272119610Sache		os=-none
27358310Sache		;;
274119610Sache	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
275119610Sache		;;
27658310Sache
27726497Sache	# We use `pc' rather than `unknown'
27826497Sache	# because (1) that's what they normally are, and
27926497Sache	# (2) the word "unknown" tends to confuse beginning users.
280136644Sache	i*86 | x86_64 | amd64)
28126497Sache	  basic_machine=$basic_machine-pc
28226497Sache	  ;;
28326497Sache	# Object if more than one company name word.
28426497Sache	*-*-*)
28526497Sache		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
28626497Sache		exit 1
28726497Sache		;;
28826497Sache	# Recognize the basic CPU types with company name.
289119610Sache	580-* \
290119610Sache	| a29k-* \
291119610Sache	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
292119610Sache	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
293119610Sache	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
294136644Sache	| amd64-* \
295136644Sache	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
296119610Sache	| avr-* \
297119610Sache	| bs2000-* \
298136644Sache	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \
299119610Sache	| clipper-* | cydra-* \
300136644Sache	| d10v-* | d30v-* | dlx-* \
301119610Sache	| elxsi-* \
302136644Sache	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
303119610Sache	| h8300-* | h8500-* \
304119610Sache	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
305119610Sache	| i*86-* | i860-* | i960-* | ia64-* \
306136644Sache	| ip2k-* \
307119610Sache	| m32r-* \
308119610Sache	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
309119610Sache	| m88110-* | m88k-* | mcore-* \
310136644Sache	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
311136644Sache	| mips16-* \
312136644Sache	| mips64-* | mips64el-* \
313136644Sache	| mips64vr-* | mips64vrel-* \
314136644Sache	| mips64orion-* | mips64orionel-* \
315136644Sache	| mips64vr4100-* | mips64vr4100el-* \
316136644Sache	| mips64vr4300-* | mips64vr4300el-* \
317136644Sache	| mips64vr5000-* | mips64vr5000el-* \
318136644Sache	| mipsisa32-* | mipsisa32el-* \
319136644Sache	| mipsisa64-* | mipsisa64el-* \
320136644Sache	| mipsisa64sb1-* | mipsisa64sb1el-* \
321136644Sache	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
322136644Sache	| mipstx39 | mipstx39el \
323119610Sache	| none-* | np1-* | ns16k-* | ns32k-* \
324119610Sache	| orion-* \
325119610Sache	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
326119610Sache	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
327119610Sache	| pyramid-* \
328119610Sache	| romp-* | rs6000-* \
329136644Sache	| sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
330136644Sache	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
331119610Sache	| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
332119610Sache	| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
333136644Sache	| tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \
334119610Sache	| v850-* | v850e-* | vax-* \
335119610Sache	| we32k-* \
336119610Sache	| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
337119610Sache	| xtensa-* \
338119610Sache	| ymp-* \
339119610Sache	| z8k-*)
34058310Sache		;;
34126497Sache	# Recognize the various machine names and aliases which stand
34226497Sache	# for a CPU type and a company and sometimes even an OS.
34358310Sache	386bsd)
34458310Sache		basic_machine=i386-unknown
34558310Sache		os=-bsd
34658310Sache		;;
34726497Sache	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
34826497Sache		basic_machine=m68000-att
34926497Sache		;;
35026497Sache	3b*)
35126497Sache		basic_machine=we32k-att
35226497Sache		;;
35358310Sache	a29khif)
35458310Sache		basic_machine=a29k-amd
35558310Sache		os=-udi
35658310Sache		;;
35758310Sache	adobe68k)
35858310Sache		basic_machine=m68010-adobe
35958310Sache		os=-scout
36058310Sache		;;
36126497Sache	alliant | fx80)
36226497Sache		basic_machine=fx80-alliant
36326497Sache		;;
36426497Sache	altos | altos3068)
36526497Sache		basic_machine=m68k-altos
36626497Sache		;;
36726497Sache	am29k)
36826497Sache		basic_machine=a29k-none
36926497Sache		os=-bsd
37026497Sache		;;
37126497Sache	amdahl)
37226497Sache		basic_machine=580-amdahl
37326497Sache		os=-sysv
37426497Sache		;;
37526497Sache	amiga | amiga-*)
37647558Sache		basic_machine=m68k-unknown
37726497Sache		;;
37858310Sache	amigaos | amigados)
379119610Sache		basic_machine=m68k-unknown
38047558Sache		os=-amigaos
38147558Sache		;;
38226497Sache	amigaunix | amix)
383119610Sache		basic_machine=m68k-unknown
38426497Sache		os=-sysv4
38526497Sache		;;
38626497Sache	apollo68)
38726497Sache		basic_machine=m68k-apollo
38826497Sache		os=-sysv
38926497Sache		;;
39058310Sache	apollo68bsd)
39158310Sache		basic_machine=m68k-apollo
39258310Sache		os=-bsd
39358310Sache		;;
39426497Sache	aux)
39526497Sache		basic_machine=m68k-apple
39626497Sache		os=-aux
39726497Sache		;;
39826497Sache	balance)
39926497Sache		basic_machine=ns32k-sequent
40026497Sache		os=-dynix
40126497Sache		;;
402119610Sache	c90)
403119610Sache		basic_machine=c90-cray
404119610Sache		os=-unicos
405119610Sache		;;
40626497Sache	convex-c1)
40726497Sache		basic_machine=c1-convex
40826497Sache		os=-bsd
40926497Sache		;;
41026497Sache	convex-c2)
41126497Sache		basic_machine=c2-convex
41226497Sache		os=-bsd
41326497Sache		;;
41426497Sache	convex-c32)
41526497Sache		basic_machine=c32-convex
41626497Sache		os=-bsd
41726497Sache		;;
41826497Sache	convex-c34)
41926497Sache		basic_machine=c34-convex
42026497Sache		os=-bsd
42126497Sache		;;
42226497Sache	convex-c38)
42326497Sache		basic_machine=c38-convex
42426497Sache		os=-bsd
42526497Sache		;;
426119610Sache	cray | j90)
427119610Sache		basic_machine=j90-cray
42826497Sache		os=-unicos
42926497Sache		;;
43026497Sache	crds | unos)
43126497Sache		basic_machine=m68k-crds
43226497Sache		;;
433119610Sache	cris | cris-* | etrax*)
434119610Sache		basic_machine=cris-axis
435119610Sache		;;
43626497Sache	da30 | da30-*)
43726497Sache		basic_machine=m68k-da30
43826497Sache		;;
43926497Sache	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
44026497Sache		basic_machine=mips-dec
44126497Sache		;;
442119610Sache	decsystem10* | dec10*)
443119610Sache		basic_machine=pdp10-dec
444119610Sache		os=-tops10
445119610Sache		;;
446119610Sache	decsystem20* | dec20*)
447119610Sache		basic_machine=pdp10-dec
448119610Sache		os=-tops20
449119610Sache		;;
45026497Sache	delta | 3300 | motorola-3300 | motorola-delta \
45126497Sache	      | 3300-motorola | delta-motorola)
45226497Sache		basic_machine=m68k-motorola
45326497Sache		;;
45426497Sache	delta88)
45526497Sache		basic_machine=m88k-motorola
45626497Sache		os=-sysv3
45726497Sache		;;
45826497Sache	dpx20 | dpx20-*)
45926497Sache		basic_machine=rs6000-bull
46026497Sache		os=-bosx
46126497Sache		;;
46226497Sache	dpx2* | dpx2*-bull)
46326497Sache		basic_machine=m68k-bull
46426497Sache		os=-sysv3
46526497Sache		;;
46626497Sache	ebmon29k)
46726497Sache		basic_machine=a29k-amd
46826497Sache		os=-ebmon
46926497Sache		;;
47026497Sache	elxsi)
47126497Sache		basic_machine=elxsi-elxsi
47226497Sache		os=-bsd
47326497Sache		;;
474136644Sache	encore | umax | mmax)
47526497Sache		basic_machine=ns32k-encore
47626497Sache		;;
47758310Sache	es1800 | OSE68k | ose68k | ose | OSE)
47858310Sache		basic_machine=m68k-ericsson
47958310Sache		os=-ose
48058310Sache		;;
48126497Sache	fx2800)
48226497Sache		basic_machine=i860-alliant
48326497Sache		;;
48426497Sache	genix)
48526497Sache		basic_machine=ns32k-ns
48626497Sache		;;
48726497Sache	gmicro)
48826497Sache		basic_machine=tron-gmicro
48926497Sache		os=-sysv
49026497Sache		;;
491119610Sache	go32)
492119610Sache		basic_machine=i386-pc
493119610Sache		os=-go32
494119610Sache		;;
49526497Sache	h3050r* | hiux*)
49626497Sache		basic_machine=hppa1.1-hitachi
49726497Sache		os=-hiuxwe2
49826497Sache		;;
49926497Sache	h8300hms)
50026497Sache		basic_machine=h8300-hitachi
50126497Sache		os=-hms
50226497Sache		;;
50358310Sache	h8300xray)
50458310Sache		basic_machine=h8300-hitachi
50558310Sache		os=-xray
50658310Sache		;;
50758310Sache	h8500hms)
50858310Sache		basic_machine=h8500-hitachi
50958310Sache		os=-hms
51058310Sache		;;
51126497Sache	harris)
51226497Sache		basic_machine=m88k-harris
51326497Sache		os=-sysv3
51426497Sache		;;
51526497Sache	hp300-*)
51626497Sache		basic_machine=m68k-hp
51726497Sache		;;
51826497Sache	hp300bsd)
51926497Sache		basic_machine=m68k-hp
52026497Sache		os=-bsd
52126497Sache		;;
52226497Sache	hp300hpux)
52326497Sache		basic_machine=m68k-hp
52426497Sache		os=-hpux
52526497Sache		;;
52658310Sache	hp3k9[0-9][0-9] | hp9[0-9][0-9])
52758310Sache		basic_machine=hppa1.0-hp
52858310Sache		;;
52926497Sache	hp9k2[0-9][0-9] | hp9k31[0-9])
53026497Sache		basic_machine=m68000-hp
53126497Sache		;;
53226497Sache	hp9k3[2-9][0-9])
53326497Sache		basic_machine=m68k-hp
53426497Sache		;;
53558310Sache	hp9k6[0-9][0-9] | hp6[0-9][0-9])
53658310Sache		basic_machine=hppa1.0-hp
53758310Sache		;;
53858310Sache	hp9k7[0-79][0-9] | hp7[0-79][0-9])
53926497Sache		basic_machine=hppa1.1-hp
54026497Sache		;;
54158310Sache	hp9k78[0-9] | hp78[0-9])
54258310Sache		# FIXME: really hppa2.0-hp
54358310Sache		basic_machine=hppa1.1-hp
54458310Sache		;;
54558310Sache	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
54658310Sache		# FIXME: really hppa2.0-hp
54758310Sache		basic_machine=hppa1.1-hp
54858310Sache		;;
54958310Sache	hp9k8[0-9][13679] | hp8[0-9][13679])
55058310Sache		basic_machine=hppa1.1-hp
55158310Sache		;;
55226497Sache	hp9k8[0-9][0-9] | hp8[0-9][0-9])
55326497Sache		basic_machine=hppa1.0-hp
55426497Sache		;;
55526497Sache	hppa-next)
55626497Sache		os=-nextstep3
55726497Sache		;;
55858310Sache	hppaosf)
55958310Sache		basic_machine=hppa1.1-hp
56058310Sache		os=-osf
56158310Sache		;;
56258310Sache	hppro)
56358310Sache		basic_machine=hppa1.1-hp
56458310Sache		os=-proelf
56558310Sache		;;
56626497Sache	i370-ibm* | ibm*)
56726497Sache		basic_machine=i370-ibm
56826497Sache		;;
56926497Sache# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
570119610Sache	i*86v32)
57126497Sache		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
57226497Sache		os=-sysv32
57326497Sache		;;
574119610Sache	i*86v4*)
57526497Sache		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
57626497Sache		os=-sysv4
57726497Sache		;;
578119610Sache	i*86v)
57926497Sache		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
58026497Sache		os=-sysv
58126497Sache		;;
582119610Sache	i*86sol2)
58326497Sache		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
58426497Sache		os=-solaris2
58526497Sache		;;
58658310Sache	i386mach)
58758310Sache		basic_machine=i386-mach
58858310Sache		os=-mach
58958310Sache		;;
59058310Sache	i386-vsta | vsta)
59158310Sache		basic_machine=i386-unknown
59258310Sache		os=-vsta
59358310Sache		;;
59426497Sache	iris | iris4d)
59526497Sache		basic_machine=mips-sgi
59626497Sache		case $os in
59726497Sache		    -irix*)
59826497Sache			;;
59926497Sache		    *)
60026497Sache			os=-irix4
60126497Sache			;;
60226497Sache		esac
60326497Sache		;;
60426497Sache	isi68 | isi)
60526497Sache		basic_machine=m68k-isi
60626497Sache		os=-sysv
60726497Sache		;;
608136644Sache	m88k-omron*)
60926497Sache		basic_machine=m88k-omron
61026497Sache		;;
61126497Sache	magnum | m3230)
61226497Sache		basic_machine=mips-mips
61326497Sache		os=-sysv
61426497Sache		;;
61526497Sache	merlin)
61626497Sache		basic_machine=ns32k-utek
61726497Sache		os=-sysv
61826497Sache		;;
619119610Sache	mingw32)
620119610Sache		basic_machine=i386-pc
621119610Sache		os=-mingw32
622119610Sache		;;
62326497Sache	miniframe)
62426497Sache		basic_machine=m68000-convergent
62526497Sache		;;
626119610Sache	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
62758310Sache		basic_machine=m68k-atari
62858310Sache		os=-mint
62958310Sache		;;
63026497Sache	mips3*-*)
63126497Sache		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
63226497Sache		;;
63326497Sache	mips3*)
63426497Sache		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
63526497Sache		;;
636119610Sache	mmix*)
637119610Sache		basic_machine=mmix-knuth
638119610Sache		os=-mmixware
639119610Sache		;;
64058310Sache	monitor)
64158310Sache		basic_machine=m68k-rom68k
64258310Sache		os=-coff
64358310Sache		;;
644119610Sache	morphos)
645119610Sache		basic_machine=powerpc-unknown
646119610Sache		os=-morphos
647119610Sache		;;
64858310Sache	msdos)
649119610Sache		basic_machine=i386-pc
65058310Sache		os=-msdos
65158310Sache		;;
652119610Sache	mvs)
653119610Sache		basic_machine=i370-ibm
654119610Sache		os=-mvs
655119610Sache		;;
65626497Sache	ncr3000)
65726497Sache		basic_machine=i486-ncr
65826497Sache		os=-sysv4
65926497Sache		;;
66058310Sache	netbsd386)
66158310Sache		basic_machine=i386-unknown
66258310Sache		os=-netbsd
66358310Sache		;;
66458310Sache	netwinder)
665119610Sache		basic_machine=armv4l-rebel
66658310Sache		os=-linux
66758310Sache		;;
66826497Sache	news | news700 | news800 | news900)
66926497Sache		basic_machine=m68k-sony
67026497Sache		os=-newsos
67126497Sache		;;
67226497Sache	news1000)
67326497Sache		basic_machine=m68030-sony
67426497Sache		os=-newsos
67526497Sache		;;
67626497Sache	news-3600 | risc-news)
67726497Sache		basic_machine=mips-sony
67826497Sache		os=-newsos
67926497Sache		;;
680119610Sache	necv70)
681119610Sache		basic_machine=v70-nec
682119610Sache		os=-sysv
683119610Sache		;;
68426497Sache	next | m*-next )
68526497Sache		basic_machine=m68k-next
68626497Sache		case $os in
68726497Sache		    -nextstep* )
68826497Sache			;;
68926497Sache		    -ns2*)
69026497Sache		      os=-nextstep2
69126497Sache			;;
69226497Sache		    *)
69326497Sache		      os=-nextstep3
69426497Sache			;;
69526497Sache		esac
69626497Sache		;;
69726497Sache	nh3000)
69826497Sache		basic_machine=m68k-harris
69926497Sache		os=-cxux
70026497Sache		;;
70126497Sache	nh[45]000)
70226497Sache		basic_machine=m88k-harris
70326497Sache		os=-cxux
70426497Sache		;;
70526497Sache	nindy960)
70626497Sache		basic_machine=i960-intel
70726497Sache		os=-nindy
70826497Sache		;;
709119610Sache	mon960)
710119610Sache		basic_machine=i960-intel
711119610Sache		os=-mon960
712119610Sache		;;
713119610Sache	nonstopux)
714119610Sache		basic_machine=mips-compaq
715119610Sache		os=-nonstopux
716119610Sache		;;
71726497Sache	np1)
71826497Sache		basic_machine=np1-gould
71926497Sache		;;
720119610Sache	nsr-tandem)
721119610Sache		basic_machine=nsr-tandem
72247558Sache		;;
723119610Sache	op50n-* | op60c-*)
724119610Sache		basic_machine=hppa1.1-oki
725119610Sache		os=-proelf
726119610Sache		;;
727119610Sache	or32 | or32-*)
728119610Sache		basic_machine=or32-unknown
729119610Sache		os=-coff
730119610Sache		;;
731119610Sache	OSE68000 | ose68000)
732119610Sache		basic_machine=m68000-ericsson
733119610Sache		os=-ose
734119610Sache		;;
735119610Sache	os68k)
736119610Sache		basic_machine=m68k-none
737119610Sache		os=-os68k
738119610Sache		;;
73926497Sache	pa-hitachi)
74026497Sache		basic_machine=hppa1.1-hitachi
74126497Sache		os=-hiuxwe2
74226497Sache		;;
74326497Sache	paragon)
74426497Sache		basic_machine=i860-intel
74526497Sache		os=-osf
74626497Sache		;;
74726497Sache	pbd)
74826497Sache		basic_machine=sparc-tti
74926497Sache		;;
75026497Sache	pbb)
75126497Sache		basic_machine=m68k-tti
75226497Sache		;;
753136644Sache	pc532 | pc532-*)
75426497Sache		basic_machine=ns32k-pc532
75526497Sache		;;
756119610Sache	pentium | p5 | k5 | k6 | nexgen | viac3)
757119610Sache		basic_machine=i586-pc
75826497Sache		;;
759136644Sache	pentiumpro | p6 | 6x86 | athlon | athlon_*)
760119610Sache		basic_machine=i686-pc
761119610Sache		;;
76258310Sache	pentiumii | pentium2)
763119610Sache		basic_machine=i686-pc
76426497Sache		;;
765119610Sache	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
76626497Sache		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
76726497Sache		;;
768119610Sache	pentiumpro-* | p6-* | 6x86-* | athlon-*)
76926497Sache		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
77026497Sache		;;
77158310Sache	pentiumii-* | pentium2-*)
772119610Sache		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
77326497Sache		;;
77426497Sache	pn)
77526497Sache		basic_machine=pn-gould
77626497Sache		;;
777119610Sache	power)	basic_machine=power-ibm
77826497Sache		;;
77926497Sache	ppc)	basic_machine=powerpc-unknown
780136644Sache		;;
78126497Sache	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
78226497Sache		;;
78326497Sache	ppcle | powerpclittle | ppc-le | powerpc-little)
78426497Sache		basic_machine=powerpcle-unknown
785136644Sache		;;
78626497Sache	ppcle-* | powerpclittle-*)
78726497Sache		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
78826497Sache		;;
789119610Sache	ppc64)	basic_machine=powerpc64-unknown
790136644Sache		;;
791119610Sache	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
792119610Sache		;;
793119610Sache	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
794119610Sache		basic_machine=powerpc64le-unknown
795136644Sache		;;
796119610Sache	ppc64le-* | powerpc64little-*)
797119610Sache		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
798119610Sache		;;
79926497Sache	ps2)
80026497Sache		basic_machine=i386-ibm
80126497Sache		;;
802119610Sache	pw32)
803119610Sache		basic_machine=i586-unknown
804119610Sache		os=-pw32
805119610Sache		;;
806119610Sache	rom68k)
807119610Sache		basic_machine=m68k-rom68k
808119610Sache		os=-coff
809119610Sache		;;
81026497Sache	rm[46]00)
81126497Sache		basic_machine=mips-siemens
81226497Sache		;;
81326497Sache	rtpc | rtpc-*)
81426497Sache		basic_machine=romp-ibm
81526497Sache		;;
816119610Sache	s390 | s390-*)
81775406Sache		basic_machine=s390-ibm
81875406Sache		;;
819119610Sache	s390x | s390x-*)
820119610Sache		basic_machine=s390x-ibm
821119610Sache		;;
822119610Sache	sa29200)
823119610Sache		basic_machine=a29k-amd
824119610Sache		os=-udi
825119610Sache		;;
826136644Sache	sb1)
827136644Sache		basic_machine=mipsisa64sb1-unknown
828136644Sache		;;
829136644Sache	sb1el)
830136644Sache		basic_machine=mipsisa64sb1el-unknown
831136644Sache		;;
83226497Sache	sequent)
83326497Sache		basic_machine=i386-sequent
83426497Sache		;;
83526497Sache	sh)
83626497Sache		basic_machine=sh-hitachi
83726497Sache		os=-hms
83826497Sache		;;
839119610Sache	sparclite-wrs | simso-wrs)
840119610Sache		basic_machine=sparclite-wrs
841119610Sache		os=-vxworks
842119610Sache		;;
84326497Sache	sps7)
84426497Sache		basic_machine=m68k-bull
84526497Sache		os=-sysv2
84626497Sache		;;
84726497Sache	spur)
84826497Sache		basic_machine=spur-unknown
84926497Sache		;;
850119610Sache	st2000)
851119610Sache		basic_machine=m68k-tandem
852119610Sache		;;
853119610Sache	stratus)
854119610Sache		basic_machine=i860-stratus
855119610Sache		os=-sysv4
856119610Sache		;;
85726497Sache	sun2)
85826497Sache		basic_machine=m68000-sun
85926497Sache		;;
86026497Sache	sun2os3)
86126497Sache		basic_machine=m68000-sun
86226497Sache		os=-sunos3
86326497Sache		;;
86426497Sache	sun2os4)
86526497Sache		basic_machine=m68000-sun
86626497Sache		os=-sunos4
86726497Sache		;;
86826497Sache	sun3os3)
86926497Sache		basic_machine=m68k-sun
87026497Sache		os=-sunos3
87126497Sache		;;
87226497Sache	sun3os4)
87326497Sache		basic_machine=m68k-sun
87426497Sache		os=-sunos4
87526497Sache		;;
87626497Sache	sun4os3)
87726497Sache		basic_machine=sparc-sun
87826497Sache		os=-sunos3
87926497Sache		;;
88026497Sache	sun4os4)
88126497Sache		basic_machine=sparc-sun
88226497Sache		os=-sunos4
88326497Sache		;;
88426497Sache	sun4sol2)
88526497Sache		basic_machine=sparc-sun
88626497Sache		os=-solaris2
88726497Sache		;;
88826497Sache	sun3 | sun3-*)
88926497Sache		basic_machine=m68k-sun
89026497Sache		;;
89126497Sache	sun4)
89226497Sache		basic_machine=sparc-sun
89326497Sache		;;
89426497Sache	sun386 | sun386i | roadrunner)
89526497Sache		basic_machine=i386-sun
89626497Sache		;;
897136644Sache	sv1)
898119610Sache		basic_machine=sv1-cray
899119610Sache		os=-unicos
900119610Sache		;;
90126497Sache	symmetry)
90226497Sache		basic_machine=i386-sequent
90326497Sache		os=-dynix
90426497Sache		;;
905119610Sache	t3d)
906119610Sache		basic_machine=alpha-cray
907119610Sache		os=-unicos
908119610Sache		;;
909119610Sache	t3e)
910119610Sache		basic_machine=alphaev5-cray
911119610Sache		os=-unicos
912119610Sache		;;
913119610Sache	t90)
914119610Sache		basic_machine=t90-cray
915119610Sache		os=-unicos
916119610Sache		;;
917136644Sache        tic4x | c4x*)
918136644Sache		basic_machine=tic4x-unknown
919136644Sache		os=-coff
920136644Sache		;;
921119610Sache	tic54x | c54x*)
922119610Sache		basic_machine=tic54x-unknown
923119610Sache		os=-coff
924119610Sache		;;
925119610Sache	tx39)
926119610Sache		basic_machine=mipstx39-unknown
927119610Sache		;;
928119610Sache	tx39el)
929119610Sache		basic_machine=mipstx39el-unknown
930119610Sache		;;
931119610Sache	toad1)
932119610Sache		basic_machine=pdp10-xkl
933119610Sache		os=-tops20
934119610Sache		;;
93526497Sache	tower | tower-32)
93626497Sache		basic_machine=m68k-ncr
93726497Sache		;;
93826497Sache	udi29k)
93926497Sache		basic_machine=a29k-amd
94026497Sache		os=-udi
94126497Sache		;;
94226497Sache	ultra3)
94326497Sache		basic_machine=a29k-nyu
94426497Sache		os=-sym1
94526497Sache		;;
946119610Sache	v810 | necv810)
947119610Sache		basic_machine=v810-nec
948119610Sache		os=-none
949119610Sache		;;
95026497Sache	vaxv)
95126497Sache		basic_machine=vax-dec
95226497Sache		os=-sysv
95326497Sache		;;
95426497Sache	vms)
95526497Sache		basic_machine=vax-dec
95626497Sache		os=-vms
95726497Sache		;;
95826497Sache	vpp*|vx|vx-*)
959136644Sache		basic_machine=f301-fujitsu
960136644Sache		;;
96126497Sache	vxworks960)
96226497Sache		basic_machine=i960-wrs
96326497Sache		os=-vxworks
96426497Sache		;;
96526497Sache	vxworks68)
96626497Sache		basic_machine=m68k-wrs
96726497Sache		os=-vxworks
96826497Sache		;;
96926497Sache	vxworks29k)
97026497Sache		basic_machine=a29k-wrs
97126497Sache		os=-vxworks
97226497Sache		;;
973119610Sache	w65*)
974119610Sache		basic_machine=w65-wdc
975119610Sache		os=-none
97626497Sache		;;
977119610Sache	w89k-*)
978119610Sache		basic_machine=hppa1.1-winbond
979119610Sache		os=-proelf
980119610Sache		;;
981136644Sache	xps | xps100)
98226497Sache		basic_machine=xps100-honeywell
98326497Sache		;;
984119610Sache	ymp)
985119610Sache		basic_machine=ymp-cray
986119610Sache		os=-unicos
987119610Sache		;;
988119610Sache	z8k-*-coff)
989119610Sache		basic_machine=z8k-unknown
990119610Sache		os=-sim
991119610Sache		;;
99226497Sache	none)
99326497Sache		basic_machine=none-none
99426497Sache		os=-none
99526497Sache		;;
99626497Sache
99726497Sache# Here we handle the default manufacturer of certain CPU types.  It is in
99826497Sache# some cases the only manufacturer, in others, it is the most popular.
999119610Sache	w89k)
1000119610Sache		basic_machine=hppa1.1-winbond
100126497Sache		;;
1002119610Sache	op50n)
1003119610Sache		basic_machine=hppa1.1-oki
1004119610Sache		;;
1005119610Sache	op60c)
1006119610Sache		basic_machine=hppa1.1-oki
1007119610Sache		;;
100826497Sache	romp)
100926497Sache		basic_machine=romp-ibm
101026497Sache		;;
101126497Sache	rs6000)
101226497Sache		basic_machine=rs6000-ibm
101326497Sache		;;
101426497Sache	vax)
101526497Sache		basic_machine=vax-dec
101626497Sache		;;
1017119610Sache	pdp10)
1018119610Sache		# there are many clones, so DEC is not a safe bet
1019119610Sache		basic_machine=pdp10-unknown
1020119610Sache		;;
102126497Sache	pdp11)
102226497Sache		basic_machine=pdp11-dec
102326497Sache		;;
102426497Sache	we32k)
102526497Sache		basic_machine=we32k-att
102626497Sache		;;
1027136644Sache	sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
1028119610Sache		basic_machine=sh-unknown
1029119610Sache		;;
1030119610Sache	sh64)
1031119610Sache		basic_machine=sh64-unknown
1032119610Sache		;;
1033119610Sache	sparc | sparcv9 | sparcv9b)
103426497Sache		basic_machine=sparc-sun
103526497Sache		;;
1036136644Sache	cydra)
103726497Sache		basic_machine=cydra-cydrome
103826497Sache		;;
103926497Sache	orion)
104026497Sache		basic_machine=orion-highlevel
104126497Sache		;;
104226497Sache	orion105)
104326497Sache		basic_machine=clipper-highlevel
104426497Sache		;;
1045119610Sache	mac | mpw | mac-mpw)
1046119610Sache		basic_machine=m68k-apple
1047119610Sache		;;
1048119610Sache	pmac | pmac-mpw)
1049119610Sache		basic_machine=powerpc-apple
1050119610Sache		;;
1051119610Sache	*-unknown)
1052119610Sache		# Make sure to match an already-canonicalized machine name.
1053119610Sache		;;
105426497Sache	*)
105526497Sache		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
105626497Sache		exit 1
105726497Sache		;;
105826497Sacheesac
105926497Sache
106026497Sache# Here we canonicalize certain aliases for manufacturers.
106126497Sachecase $basic_machine in
106226497Sache	*-digital*)
106326497Sache		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
106426497Sache		;;
106526497Sache	*-commodore*)
106626497Sache		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
106726497Sache		;;
106826497Sache	*)
106926497Sache		;;
107026497Sacheesac
107126497Sache
107226497Sache# Decode manufacturer-specific aliases for certain operating systems.
107326497Sache
107426497Sacheif [ x"$os" != x"" ]
107526497Sachethen
107626497Sachecase $os in
1077119610Sache        # First match some system type aliases
1078119610Sache        # that might get confused with valid system types.
107926497Sache	# -solaris* is a basic system type, with this one exception.
108026497Sache	-solaris1 | -solaris1.*)
108126497Sache		os=`echo $os | sed -e 's|solaris1|sunos4|'`
108226497Sache		;;
108326497Sache	-solaris)
108426497Sache		os=-solaris2
108526497Sache		;;
108658310Sache	-svr4*)
108726497Sache		os=-sysv4
108826497Sache		;;
1089119610Sache	-unixware*)
1090119610Sache		os=-sysv4.2uw
109158310Sache		;;
109226497Sache	-gnu/linux*)
109326497Sache		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
109426497Sache		;;
109526497Sache	# First accept the basic system types.
109626497Sache	# The portable systems comes first.
109726497Sache	# Each alternative MUST END IN A *, to match a version number.
109826497Sache	# -sysv* is not here because it comes later, after sysvr4.
109926497Sache	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
110026497Sache	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
110126497Sache	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
110258310Sache	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
110358310Sache	      | -aos* \
110426497Sache	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
110526497Sache	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
110626497Sache	      | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
110758310Sache	      | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
110826497Sache	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
110926497Sache	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
1110119610Sache	      | -chorusos* | -chorusrdb* \
111175406Sache	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
111258310Sache	      | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
1113136644Sache	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
1114119610Sache	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
1115119610Sache	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
1116119610Sache	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
1117136644Sache	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
1118136644Sache	      | -powermax* | -dnix*)
111926497Sache	# Remember, each alternative MUST END IN *, to match a version number.
112026497Sache		;;
1121119610Sache	-qnx*)
1122119610Sache		case $basic_machine in
1123119610Sache		    x86-* | i*86-*)
1124119610Sache			;;
1125119610Sache		    *)
1126119610Sache			os=-nto$os
1127119610Sache			;;
1128119610Sache		esac
1129119610Sache		;;
1130136644Sache	-nto-qnx*)
1131136644Sache		;;
1132119610Sache	-nto*)
1133136644Sache		os=`echo $os | sed -e 's|nto|nto-qnx|'`
1134119610Sache		;;
1135119610Sache	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
1136119610Sache	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
1137119610Sache	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
1138119610Sache		;;
1139119610Sache	-mac*)
1140119610Sache		os=`echo $os | sed -e 's|mac|macos|'`
1141119610Sache		;;
114226497Sache	-linux*)
114326497Sache		os=`echo $os | sed -e 's|linux|linux-gnu|'`
114426497Sache		;;
114526497Sache	-sunos5*)
114626497Sache		os=`echo $os | sed -e 's|sunos5|solaris2|'`
114726497Sache		;;
114826497Sache	-sunos6*)
114926497Sache		os=`echo $os | sed -e 's|sunos6|solaris3|'`
115026497Sache		;;
1151119610Sache	-opened*)
1152119610Sache		os=-openedition
1153119610Sache		;;
1154119610Sache	-wince*)
1155119610Sache		os=-wince
1156119610Sache		;;
115726497Sache	-osfrose*)
115826497Sache		os=-osfrose
115926497Sache		;;
116026497Sache	-osf*)
116126497Sache		os=-osf
116226497Sache		;;
116326497Sache	-utek*)
116426497Sache		os=-bsd
116526497Sache		;;
116626497Sache	-dynix*)
116726497Sache		os=-bsd
116826497Sache		;;
116926497Sache	-acis*)
117026497Sache		os=-aos
117126497Sache		;;
1172119610Sache	-atheos*)
1173119610Sache		os=-atheos
1174119610Sache		;;
1175119610Sache	-386bsd)
1176119610Sache		os=-bsd
1177119610Sache		;;
117826497Sache	-ctix* | -uts*)
117926497Sache		os=-sysv
118026497Sache		;;
1181119610Sache	-nova*)
1182119610Sache		os=-rtmk-nova
1183119610Sache		;;
118426497Sache	-ns2 )
1185136644Sache		os=-nextstep2
118626497Sache		;;
1187119610Sache	-nsk*)
1188119610Sache		os=-nsk
1189119610Sache		;;
119026497Sache	# Preserve the version number of sinix5.
119126497Sache	-sinix5.*)
119226497Sache		os=`echo $os | sed -e 's|sinix|sysv|'`
119326497Sache		;;
119426497Sache	-sinix*)
119526497Sache		os=-sysv4
119626497Sache		;;
119726497Sache	-triton*)
119826497Sache		os=-sysv3
119926497Sache		;;
120026497Sache	-oss*)
120126497Sache		os=-sysv3
120226497Sache		;;
120326497Sache	-svr4)
120426497Sache		os=-sysv4
120526497Sache		;;
120626497Sache	-svr3)
120726497Sache		os=-sysv3
120826497Sache		;;
120926497Sache	-sysvr4)
121026497Sache		os=-sysv4
121126497Sache		;;
1212119610Sache	# This must come after -sysvr4.
121326497Sache	-sysv*)
121426497Sache		;;
1215119610Sache	-ose*)
1216119610Sache		os=-ose
1217119610Sache		;;
1218119610Sache	-es1800*)
1219119610Sache		os=-ose
1220119610Sache		;;
122126497Sache	-xenix)
122226497Sache		os=-xenix
122326497Sache		;;
1224136644Sache	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1225136644Sache		os=-mint
1226119610Sache		;;
122726497Sache	-none)
122826497Sache		;;
122926497Sache	*)
123026497Sache		# Get rid of the `-' at the beginning of $os.
123126497Sache		os=`echo $os | sed 's/[^-]*-//'`
123226497Sache		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
123326497Sache		exit 1
123426497Sache		;;
123526497Sacheesac
123626497Sacheelse
123726497Sache
123826497Sache# Here we handle the default operating systems that come with various machines.
123926497Sache# The value should be what the vendor currently ships out the door with their
124026497Sache# machine or put another way, the most popular os provided with the machine.
124126497Sache
124226497Sache# Note that if you're going to try to match "-MANUFACTURER" here (say,
124326497Sache# "-sun"), then you have to tell the case statement up towards the top
124426497Sache# that MANUFACTURER isn't an operating system.  Otherwise, code above
124526497Sache# will signal an error saying that MANUFACTURER isn't an operating
124626497Sache# system, and we'll never get to this point.
124726497Sache
124826497Sachecase $basic_machine in
124926497Sache	*-acorn)
125026497Sache		os=-riscix1.2
125126497Sache		;;
1252119610Sache	arm*-rebel)
1253119610Sache		os=-linux
1254119610Sache		;;
125526497Sache	arm*-semi)
125626497Sache		os=-aout
125726497Sache		;;
1258119610Sache	# This must come before the *-dec entry.
1259119610Sache	pdp10-*)
1260119610Sache		os=-tops20
1261119610Sache		;;
1262136644Sache	pdp11-*)
126326497Sache		os=-none
126426497Sache		;;
126526497Sache	*-dec | vax-*)
126626497Sache		os=-ultrix4.2
126726497Sache		;;
126826497Sache	m68*-apollo)
126926497Sache		os=-domain
127026497Sache		;;
127126497Sache	i386-sun)
127226497Sache		os=-sunos4.0.2
127326497Sache		;;
127426497Sache	m68000-sun)
127526497Sache		os=-sunos3
127626497Sache		# This also exists in the configure program, but was not the
127726497Sache		# default.
127826497Sache		# os=-sunos4
127926497Sache		;;
1280119610Sache	m68*-cisco)
1281119610Sache		os=-aout
1282119610Sache		;;
1283119610Sache	mips*-cisco)
1284119610Sache		os=-elf
1285119610Sache		;;
1286119610Sache	mips*-*)
1287119610Sache		os=-elf
1288119610Sache		;;
1289119610Sache	or32-*)
1290119610Sache		os=-coff
1291119610Sache		;;
129226497Sache	*-tti)	# must be before sparc entry or we get the wrong os.
129326497Sache		os=-sysv3
129426497Sache		;;
129526497Sache	sparc-* | *-sun)
129626497Sache		os=-sunos4.1.1
129726497Sache		;;
129847558Sache	*-be)
129947558Sache		os=-beos
130047558Sache		;;
130126497Sache	*-ibm)
130226497Sache		os=-aix
130326497Sache		;;
1304119610Sache	*-wec)
1305119610Sache		os=-proelf
1306119610Sache		;;
1307119610Sache	*-winbond)
1308119610Sache		os=-proelf
1309119610Sache		;;
1310119610Sache	*-oki)
1311119610Sache		os=-proelf
1312119610Sache		;;
131326497Sache	*-hp)
131426497Sache		os=-hpux
131526497Sache		;;
131626497Sache	*-hitachi)
131726497Sache		os=-hiux
131826497Sache		;;
131926497Sache	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
132026497Sache		os=-sysv
132126497Sache		;;
132226497Sache	*-cbm)
132347558Sache		os=-amigaos
132426497Sache		;;
132526497Sache	*-dg)
132626497Sache		os=-dgux
132726497Sache		;;
132826497Sache	*-dolphin)
132926497Sache		os=-sysv3
133026497Sache		;;
133126497Sache	m68k-ccur)
133226497Sache		os=-rtu
133326497Sache		;;
133426497Sache	m88k-omron*)
133526497Sache		os=-luna
133626497Sache		;;
133726497Sache	*-next )
133826497Sache		os=-nextstep
133926497Sache		;;
134026497Sache	*-sequent)
134126497Sache		os=-ptx
134226497Sache		;;
134326497Sache	*-crds)
134426497Sache		os=-unos
134526497Sache		;;
134626497Sache	*-ns)
134726497Sache		os=-genix
134826497Sache		;;
134926497Sache	i370-*)
135026497Sache		os=-mvs
135126497Sache		;;
135226497Sache	*-next)
135326497Sache		os=-nextstep3
135426497Sache		;;
1355136644Sache	*-gould)
135626497Sache		os=-sysv
135726497Sache		;;
1358136644Sache	*-highlevel)
135926497Sache		os=-bsd
136026497Sache		;;
136126497Sache	*-encore)
136226497Sache		os=-bsd
136326497Sache		;;
1364136644Sache	*-sgi)
136526497Sache		os=-irix
136626497Sache		;;
1367136644Sache	*-siemens)
136826497Sache		os=-sysv4
136926497Sache		;;
137026497Sache	*-masscomp)
137126497Sache		os=-rtu
137226497Sache		;;
1373119610Sache	f30[01]-fujitsu | f700-fujitsu)
137426497Sache		os=-uxpv
137526497Sache		;;
1376119610Sache	*-rom68k)
1377119610Sache		os=-coff
1378119610Sache		;;
1379119610Sache	*-*bug)
1380119610Sache		os=-coff
1381119610Sache		;;
1382119610Sache	*-apple)
1383119610Sache		os=-macos
1384119610Sache		;;
1385119610Sache	*-atari*)
1386119610Sache		os=-mint
1387119610Sache		;;
138826497Sache	*)
138926497Sache		os=-none
139026497Sache		;;
139126497Sacheesac
139226497Sachefi
139326497Sache
139426497Sache# Here we handle the case where we know the os, and the CPU type, but not the
139526497Sache# manufacturer.  We pick the logical manufacturer.
139626497Sachevendor=unknown
139726497Sachecase $basic_machine in
139826497Sache	*-unknown)
139926497Sache		case $os in
140026497Sache			-riscix*)
140126497Sache				vendor=acorn
140226497Sache				;;
140326497Sache			-sunos*)
140426497Sache				vendor=sun
140526497Sache				;;
140626497Sache			-aix*)
140726497Sache				vendor=ibm
140826497Sache				;;
1409119610Sache			-beos*)
1410119610Sache				vendor=be
1411119610Sache				;;
141226497Sache			-hpux*)
141326497Sache				vendor=hp
141426497Sache				;;
1415119610Sache			-mpeix*)
1416119610Sache				vendor=hp
1417119610Sache				;;
141826497Sache			-hiux*)
141926497Sache				vendor=hitachi
142026497Sache				;;
142126497Sache			-unos*)
142226497Sache				vendor=crds
142326497Sache				;;
142426497Sache			-dgux*)
142526497Sache				vendor=dg
142626497Sache				;;
142726497Sache			-luna*)
142826497Sache				vendor=omron
142926497Sache				;;
143026497Sache			-genix*)
143126497Sache				vendor=ns
143226497Sache				;;
1433119610Sache			-mvs* | -opened*)
143426497Sache				vendor=ibm
143526497Sache				;;
143626497Sache			-ptx*)
143726497Sache				vendor=sequent
143826497Sache				;;
1439136644Sache			-vxsim* | -vxworks* | -windiss*)
144026497Sache				vendor=wrs
144126497Sache				;;
144226497Sache			-aux*)
144326497Sache				vendor=apple
144426497Sache				;;
1445119610Sache			-hms*)
1446119610Sache				vendor=hitachi
1447119610Sache				;;
1448119610Sache			-mpw* | -macos*)
1449119610Sache				vendor=apple
1450119610Sache				;;
1451119610Sache			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
1452119610Sache				vendor=atari
1453119610Sache				;;
1454119610Sache			-vos*)
1455119610Sache				vendor=stratus
1456119610Sache				;;
145726497Sache		esac
145826497Sache		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
145926497Sache		;;
146026497Sacheesac
146126497Sache
146226497Sacheecho $basic_machine$os
1463119610Sacheexit 0
1464119610Sache
1465119610Sache# Local variables:
1466119610Sache# eval: (add-hook 'write-file-hooks 'time-stamp)
1467119610Sache# time-stamp-start: "timestamp='"
1468119610Sache# time-stamp-format: "%:y-%02m-%02d"
1469119610Sache# time-stamp-end: "'"
1470119610Sache# End:
1471