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