xref: /openbsd/usr.sbin/unbound/config.sub (revision d896b962)
1a3167c07Ssthen#! /bin/sh
2933707f3Ssthen# Configuration validation subroutine script.
3*d896b962Ssthen#   Copyright 1992-2024 Free Software Foundation, Inc.
4933707f3Ssthen
5191f22c6Ssthen# shellcheck disable=SC2006,SC2268 # see below for rationale
6191f22c6Ssthen
7*d896b962Ssthentimestamp='2024-01-01'
8933707f3Ssthen
998f3ca02Sbrad# This file is free software; you can redistribute it and/or modify it
1098f3ca02Sbrad# under the terms of the GNU General Public License as published by
11e21c60efSsthen# the Free Software Foundation, either version 3 of the License, or
12933707f3Ssthen# (at your option) any later version.
13933707f3Ssthen#
1498f3ca02Sbrad# This program is distributed in the hope that it will be useful, but
1598f3ca02Sbrad# WITHOUT ANY WARRANTY; without even the implied warranty of
1698f3ca02Sbrad# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1798f3ca02Sbrad# General Public License for more details.
18933707f3Ssthen#
19933707f3Ssthen# You should have received a copy of the GNU General Public License
20a3167c07Ssthen# along with this program; if not, see <https://www.gnu.org/licenses/>.
21933707f3Ssthen#
22933707f3Ssthen# As a special exception to the GNU General Public License, if you
23933707f3Ssthen# distribute this file as part of a program that contains a
24933707f3Ssthen# configuration script generated by Autoconf, you may include it under
2598f3ca02Sbrad# the same distribution terms that you use for the rest of that
2698f3ca02Sbrad# program.  This Exception is an additional permission under section 7
2798f3ca02Sbrad# of the GNU General Public License, version 3 ("GPLv3").
28933707f3Ssthen
29933707f3Ssthen
300990ddf5Ssthen# Please send patches to <config-patches@gnu.org>.
31933707f3Ssthen#
32933707f3Ssthen# Configuration subroutine to validate and canonicalize a configuration type.
33933707f3Ssthen# Supply the specified configuration type as an argument.
34933707f3Ssthen# If it is invalid, we print an error message on stderr and exit with code 1.
35933707f3Ssthen# Otherwise, we print the canonical config type on stdout and succeed.
36933707f3Ssthen
37933707f3Ssthen# You can get the latest version of this script from:
38eba819a2Ssthen# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
39933707f3Ssthen
40933707f3Ssthen# This file is supposed to be the same for all GNU packages
41933707f3Ssthen# and recognize all the CPU types, system types and aliases
42933707f3Ssthen# that are meaningful with *any* GNU software.
43933707f3Ssthen# Each package is responsible for reporting which valid configurations
44933707f3Ssthen# it does not support.  The user should be able to distinguish
45933707f3Ssthen# a failure to support a valid configuration from a meaningless
46933707f3Ssthen# configuration.
47933707f3Ssthen
48933707f3Ssthen# The goal of this file is to map all the various variations of a given
49933707f3Ssthen# machine specification into a single specification in the form:
50933707f3Ssthen#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
51933707f3Ssthen# or in some cases, the newer four-part form:
52933707f3Ssthen#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
53933707f3Ssthen# It is wrong to echo any other type of specification.
54933707f3Ssthen
55191f22c6Ssthen# The "shellcheck disable" line above the timestamp inhibits complaints
56191f22c6Ssthen# about features and limitations of the classic Bourne shell that were
57191f22c6Ssthen# superseded or lifted in POSIX.  However, this script identifies a wide
58191f22c6Ssthen# variety of pre-POSIX systems that do not have POSIX shells at all, and
59191f22c6Ssthen# even some reasonably current systems (Solaris 10 as case-in-point) still
60191f22c6Ssthen# have a pre-POSIX /bin/sh.
61191f22c6Ssthen
62191f22c6Ssthenme=`echo "$0" | sed -e 's,.*/,,'`
63933707f3Ssthen
64933707f3Ssthenusage="\
650990ddf5SsthenUsage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
66933707f3Ssthen
67933707f3SsthenCanonicalize a configuration name.
68933707f3Ssthen
69a3167c07SsthenOptions:
70933707f3Ssthen  -h, --help         print this help, then exit
71933707f3Ssthen  -t, --time-stamp   print date of last modification, then exit
72933707f3Ssthen  -v, --version      print version number, then exit
73933707f3Ssthen
74933707f3SsthenReport bugs and patches to <config-patches@gnu.org>."
75933707f3Ssthen
76933707f3Ssthenversion="\
77933707f3SsthenGNU config.sub ($timestamp)
78933707f3Ssthen
79*d896b962SsthenCopyright 1992-2024 Free Software Foundation, Inc.
80933707f3Ssthen
81933707f3SsthenThis is free software; see the source for copying conditions.  There is NO
82933707f3Ssthenwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
83933707f3Ssthen
84933707f3Ssthenhelp="
858b7325afSsthenTry '$me --help' for more information."
86933707f3Ssthen
87933707f3Ssthen# Parse command line
88933707f3Ssthenwhile test $# -gt 0 ; do
89933707f3Ssthen  case $1 in
90933707f3Ssthen    --time-stamp | --time* | -t )
91933707f3Ssthen       echo "$timestamp" ; exit ;;
92933707f3Ssthen    --version | -v )
93933707f3Ssthen       echo "$version" ; exit ;;
94933707f3Ssthen    --help | --h* | -h )
95933707f3Ssthen       echo "$usage"; exit ;;
96933707f3Ssthen    -- )     # Stop option processing
97933707f3Ssthen       shift; break ;;
98933707f3Ssthen    - )	# Use stdin as input.
99933707f3Ssthen       break ;;
100933707f3Ssthen    -* )
101a3167c07Ssthen       echo "$me: invalid option $1$help" >&2
102933707f3Ssthen       exit 1 ;;
103933707f3Ssthen
104933707f3Ssthen    *local*)
105933707f3Ssthen       # First pass through any local machine types.
106a3167c07Ssthen       echo "$1"
107933707f3Ssthen       exit ;;
108933707f3Ssthen
109933707f3Ssthen    * )
110933707f3Ssthen       break ;;
111933707f3Ssthen  esac
112933707f3Ssthendone
113933707f3Ssthen
114933707f3Ssthencase $# in
115933707f3Ssthen 0) echo "$me: missing argument$help" >&2
116933707f3Ssthen    exit 1;;
117933707f3Ssthen 1) ;;
118933707f3Ssthen *) echo "$me: too many arguments$help" >&2
119933707f3Ssthen    exit 1;;
120933707f3Ssthenesac
121933707f3Ssthen
122a3167c07Ssthen# Split fields of configuration type
123a3167c07Ssthen# shellcheck disable=SC2162
124e21c60efSsthensaved_IFS=$IFS
125a3167c07SsthenIFS="-" read field1 field2 field3 field4 <<EOF
126a3167c07Ssthen$1
127a3167c07SsthenEOF
128e21c60efSsthenIFS=$saved_IFS
129a3167c07Ssthen
130a3167c07Ssthen# Separate into logical components for further validation
131a3167c07Ssthencase $1 in
132a3167c07Ssthen	*-*-*-*-*)
1338b7325afSsthen		echo "Invalid configuration '$1': more than four components" >&2
134a3167c07Ssthen		exit 1
135a3167c07Ssthen		;;
136a3167c07Ssthen	*-*-*-*)
137a3167c07Ssthen		basic_machine=$field1-$field2
138a3167c07Ssthen		basic_os=$field3-$field4
139a3167c07Ssthen		;;
140a3167c07Ssthen	*-*-*)
141a3167c07Ssthen		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
142a3167c07Ssthen		# parts
143a3167c07Ssthen		maybe_os=$field2-$field3
144933707f3Ssthen		case $maybe_os in
145a3167c07Ssthen			nto-qnx* | linux-* | uclinux-uclibc* \
146a3167c07Ssthen			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
147a3167c07Ssthen			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
1488b7325afSsthen			| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
1498b7325afSsthen			| windows-* )
150a3167c07Ssthen				basic_machine=$field1
151a3167c07Ssthen				basic_os=$maybe_os
152933707f3Ssthen				;;
153229e174cSsthen			android-linux)
154a3167c07Ssthen				basic_machine=$field1-unknown
155a3167c07Ssthen				basic_os=linux-android
156229e174cSsthen				;;
157933707f3Ssthen			*)
158a3167c07Ssthen				basic_machine=$field1-$field2
159a3167c07Ssthen				basic_os=$field3
160a3167c07Ssthen				;;
161a3167c07Ssthen		esac
162a3167c07Ssthen		;;
163a3167c07Ssthen	*-*)
164a3167c07Ssthen		# A lone config we happen to match not fitting any pattern
165a3167c07Ssthen		case $field1-$field2 in
166a3167c07Ssthen			decstation-3100)
167a3167c07Ssthen				basic_machine=mips-dec
168a3167c07Ssthen				basic_os=
169a3167c07Ssthen				;;
170a3167c07Ssthen			*-*)
171a3167c07Ssthen				# Second component is usually, but not always the OS
172a3167c07Ssthen				case $field2 in
173a3167c07Ssthen					# Prevent following clause from handling this valid os
174a3167c07Ssthen					sun*os*)
175a3167c07Ssthen						basic_machine=$field1
176a3167c07Ssthen						basic_os=$field2
177a3167c07Ssthen						;;
178e21c60efSsthen					zephyr*)
179e21c60efSsthen						basic_machine=$field1-unknown
180e21c60efSsthen						basic_os=$field2
181e21c60efSsthen						;;
182a3167c07Ssthen					# Manufacturers
183a3167c07Ssthen					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
184a3167c07Ssthen					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
185a3167c07Ssthen					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
186a3167c07Ssthen					| convergent* | ncr* | news | 32* | 3600* | 3100* \
187a3167c07Ssthen					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
188a3167c07Ssthen					| ultra | tti* | harris | dolphin | highlevel | gould \
189a3167c07Ssthen					| cbm | ns | masscomp | apple | axis | knuth | cray \
190a3167c07Ssthen					| microblaze* | sim | cisco \
191a3167c07Ssthen					| oki | wec | wrs | winbond)
192a3167c07Ssthen						basic_machine=$field1-$field2
193a3167c07Ssthen						basic_os=
194a3167c07Ssthen						;;
195a3167c07Ssthen					*)
196a3167c07Ssthen						basic_machine=$field1
197a3167c07Ssthen						basic_os=$field2
198a3167c07Ssthen						;;
199a3167c07Ssthen				esac
200a3167c07Ssthen			;;
201a3167c07Ssthen		esac
202a3167c07Ssthen		;;
203a3167c07Ssthen	*)
204a3167c07Ssthen		# Convert single-component short-hands not valid as part of
205a3167c07Ssthen		# multi-component configurations.
206a3167c07Ssthen		case $field1 in
207a3167c07Ssthen			386bsd)
208a3167c07Ssthen				basic_machine=i386-pc
209a3167c07Ssthen				basic_os=bsd
210a3167c07Ssthen				;;
211a3167c07Ssthen			a29khif)
212a3167c07Ssthen				basic_machine=a29k-amd
213a3167c07Ssthen				basic_os=udi
214a3167c07Ssthen				;;
215a3167c07Ssthen			adobe68k)
216a3167c07Ssthen				basic_machine=m68010-adobe
217a3167c07Ssthen				basic_os=scout
218a3167c07Ssthen				;;
219a3167c07Ssthen			alliant)
220a3167c07Ssthen				basic_machine=fx80-alliant
221a3167c07Ssthen				basic_os=
222a3167c07Ssthen				;;
223a3167c07Ssthen			altos | altos3068)
224a3167c07Ssthen				basic_machine=m68k-altos
225a3167c07Ssthen				basic_os=
226a3167c07Ssthen				;;
227a3167c07Ssthen			am29k)
228a3167c07Ssthen				basic_machine=a29k-none
229a3167c07Ssthen				basic_os=bsd
230a3167c07Ssthen				;;
231a3167c07Ssthen			amdahl)
232a3167c07Ssthen				basic_machine=580-amdahl
233a3167c07Ssthen				basic_os=sysv
234a3167c07Ssthen				;;
235a3167c07Ssthen			amiga)
236a3167c07Ssthen				basic_machine=m68k-unknown
237a3167c07Ssthen				basic_os=
238a3167c07Ssthen				;;
239a3167c07Ssthen			amigaos | amigados)
240a3167c07Ssthen				basic_machine=m68k-unknown
241a3167c07Ssthen				basic_os=amigaos
242a3167c07Ssthen				;;
243a3167c07Ssthen			amigaunix | amix)
244a3167c07Ssthen				basic_machine=m68k-unknown
245a3167c07Ssthen				basic_os=sysv4
246a3167c07Ssthen				;;
247a3167c07Ssthen			apollo68)
248a3167c07Ssthen				basic_machine=m68k-apollo
249a3167c07Ssthen				basic_os=sysv
250a3167c07Ssthen				;;
251a3167c07Ssthen			apollo68bsd)
252a3167c07Ssthen				basic_machine=m68k-apollo
253a3167c07Ssthen				basic_os=bsd
254a3167c07Ssthen				;;
255a3167c07Ssthen			aros)
256a3167c07Ssthen				basic_machine=i386-pc
257a3167c07Ssthen				basic_os=aros
258a3167c07Ssthen				;;
259a3167c07Ssthen			aux)
260a3167c07Ssthen				basic_machine=m68k-apple
261a3167c07Ssthen				basic_os=aux
262a3167c07Ssthen				;;
263a3167c07Ssthen			balance)
264a3167c07Ssthen				basic_machine=ns32k-sequent
265a3167c07Ssthen				basic_os=dynix
266a3167c07Ssthen				;;
267a3167c07Ssthen			blackfin)
268a3167c07Ssthen				basic_machine=bfin-unknown
269a3167c07Ssthen				basic_os=linux
270a3167c07Ssthen				;;
271a3167c07Ssthen			cegcc)
272a3167c07Ssthen				basic_machine=arm-unknown
273a3167c07Ssthen				basic_os=cegcc
274a3167c07Ssthen				;;
275a3167c07Ssthen			convex-c1)
276a3167c07Ssthen				basic_machine=c1-convex
277a3167c07Ssthen				basic_os=bsd
278a3167c07Ssthen				;;
279a3167c07Ssthen			convex-c2)
280a3167c07Ssthen				basic_machine=c2-convex
281a3167c07Ssthen				basic_os=bsd
282a3167c07Ssthen				;;
283a3167c07Ssthen			convex-c32)
284a3167c07Ssthen				basic_machine=c32-convex
285a3167c07Ssthen				basic_os=bsd
286a3167c07Ssthen				;;
287a3167c07Ssthen			convex-c34)
288a3167c07Ssthen				basic_machine=c34-convex
289a3167c07Ssthen				basic_os=bsd
290a3167c07Ssthen				;;
291a3167c07Ssthen			convex-c38)
292a3167c07Ssthen				basic_machine=c38-convex
293a3167c07Ssthen				basic_os=bsd
294a3167c07Ssthen				;;
295a3167c07Ssthen			cray)
296a3167c07Ssthen				basic_machine=j90-cray
297a3167c07Ssthen				basic_os=unicos
298a3167c07Ssthen				;;
299a3167c07Ssthen			crds | unos)
300a3167c07Ssthen				basic_machine=m68k-crds
301a3167c07Ssthen				basic_os=
302a3167c07Ssthen				;;
303a3167c07Ssthen			da30)
304a3167c07Ssthen				basic_machine=m68k-da30
305a3167c07Ssthen				basic_os=
306a3167c07Ssthen				;;
307a3167c07Ssthen			decstation | pmax | pmin | dec3100 | decstatn)
308a3167c07Ssthen				basic_machine=mips-dec
309a3167c07Ssthen				basic_os=
310a3167c07Ssthen				;;
311a3167c07Ssthen			delta88)
312a3167c07Ssthen				basic_machine=m88k-motorola
313a3167c07Ssthen				basic_os=sysv3
314a3167c07Ssthen				;;
315a3167c07Ssthen			dicos)
316a3167c07Ssthen				basic_machine=i686-pc
317a3167c07Ssthen				basic_os=dicos
318a3167c07Ssthen				;;
319a3167c07Ssthen			djgpp)
320a3167c07Ssthen				basic_machine=i586-pc
321a3167c07Ssthen				basic_os=msdosdjgpp
322a3167c07Ssthen				;;
323a3167c07Ssthen			ebmon29k)
324a3167c07Ssthen				basic_machine=a29k-amd
325a3167c07Ssthen				basic_os=ebmon
326a3167c07Ssthen				;;
327a3167c07Ssthen			es1800 | OSE68k | ose68k | ose | OSE)
328a3167c07Ssthen				basic_machine=m68k-ericsson
329a3167c07Ssthen				basic_os=ose
330a3167c07Ssthen				;;
331a3167c07Ssthen			gmicro)
332a3167c07Ssthen				basic_machine=tron-gmicro
333a3167c07Ssthen				basic_os=sysv
334a3167c07Ssthen				;;
335a3167c07Ssthen			go32)
336a3167c07Ssthen				basic_machine=i386-pc
337a3167c07Ssthen				basic_os=go32
338a3167c07Ssthen				;;
339a3167c07Ssthen			h8300hms)
340a3167c07Ssthen				basic_machine=h8300-hitachi
341a3167c07Ssthen				basic_os=hms
342a3167c07Ssthen				;;
343a3167c07Ssthen			h8300xray)
344a3167c07Ssthen				basic_machine=h8300-hitachi
345a3167c07Ssthen				basic_os=xray
346a3167c07Ssthen				;;
347a3167c07Ssthen			h8500hms)
348a3167c07Ssthen				basic_machine=h8500-hitachi
349a3167c07Ssthen				basic_os=hms
350a3167c07Ssthen				;;
351a3167c07Ssthen			harris)
352a3167c07Ssthen				basic_machine=m88k-harris
353a3167c07Ssthen				basic_os=sysv3
354a3167c07Ssthen				;;
355a3167c07Ssthen			hp300 | hp300hpux)
356a3167c07Ssthen				basic_machine=m68k-hp
357a3167c07Ssthen				basic_os=hpux
358a3167c07Ssthen				;;
359a3167c07Ssthen			hp300bsd)
360a3167c07Ssthen				basic_machine=m68k-hp
361a3167c07Ssthen				basic_os=bsd
362a3167c07Ssthen				;;
363a3167c07Ssthen			hppaosf)
364a3167c07Ssthen				basic_machine=hppa1.1-hp
365a3167c07Ssthen				basic_os=osf
366a3167c07Ssthen				;;
367a3167c07Ssthen			hppro)
368a3167c07Ssthen				basic_machine=hppa1.1-hp
369a3167c07Ssthen				basic_os=proelf
370a3167c07Ssthen				;;
371a3167c07Ssthen			i386mach)
372a3167c07Ssthen				basic_machine=i386-mach
373a3167c07Ssthen				basic_os=mach
374a3167c07Ssthen				;;
375a3167c07Ssthen			isi68 | isi)
376a3167c07Ssthen				basic_machine=m68k-isi
377a3167c07Ssthen				basic_os=sysv
378a3167c07Ssthen				;;
379a3167c07Ssthen			m68knommu)
380a3167c07Ssthen				basic_machine=m68k-unknown
381a3167c07Ssthen				basic_os=linux
382a3167c07Ssthen				;;
383a3167c07Ssthen			magnum | m3230)
384a3167c07Ssthen				basic_machine=mips-mips
385a3167c07Ssthen				basic_os=sysv
386a3167c07Ssthen				;;
387a3167c07Ssthen			merlin)
388a3167c07Ssthen				basic_machine=ns32k-utek
389a3167c07Ssthen				basic_os=sysv
390a3167c07Ssthen				;;
391a3167c07Ssthen			mingw64)
392a3167c07Ssthen				basic_machine=x86_64-pc
393a3167c07Ssthen				basic_os=mingw64
394a3167c07Ssthen				;;
395a3167c07Ssthen			mingw32)
396a3167c07Ssthen				basic_machine=i686-pc
397a3167c07Ssthen				basic_os=mingw32
398a3167c07Ssthen				;;
399a3167c07Ssthen			mingw32ce)
400a3167c07Ssthen				basic_machine=arm-unknown
401a3167c07Ssthen				basic_os=mingw32ce
402a3167c07Ssthen				;;
403a3167c07Ssthen			monitor)
404a3167c07Ssthen				basic_machine=m68k-rom68k
405a3167c07Ssthen				basic_os=coff
406a3167c07Ssthen				;;
407a3167c07Ssthen			morphos)
408a3167c07Ssthen				basic_machine=powerpc-unknown
409a3167c07Ssthen				basic_os=morphos
410a3167c07Ssthen				;;
411a3167c07Ssthen			moxiebox)
412a3167c07Ssthen				basic_machine=moxie-unknown
413a3167c07Ssthen				basic_os=moxiebox
414a3167c07Ssthen				;;
415a3167c07Ssthen			msdos)
416a3167c07Ssthen				basic_machine=i386-pc
417a3167c07Ssthen				basic_os=msdos
418a3167c07Ssthen				;;
419a3167c07Ssthen			msys)
420a3167c07Ssthen				basic_machine=i686-pc
421a3167c07Ssthen				basic_os=msys
422a3167c07Ssthen				;;
423a3167c07Ssthen			mvs)
424a3167c07Ssthen				basic_machine=i370-ibm
425a3167c07Ssthen				basic_os=mvs
426a3167c07Ssthen				;;
427a3167c07Ssthen			nacl)
428a3167c07Ssthen				basic_machine=le32-unknown
429a3167c07Ssthen				basic_os=nacl
430a3167c07Ssthen				;;
431a3167c07Ssthen			ncr3000)
432a3167c07Ssthen				basic_machine=i486-ncr
433a3167c07Ssthen				basic_os=sysv4
434a3167c07Ssthen				;;
435a3167c07Ssthen			netbsd386)
436a3167c07Ssthen				basic_machine=i386-pc
437a3167c07Ssthen				basic_os=netbsd
438a3167c07Ssthen				;;
439a3167c07Ssthen			netwinder)
440a3167c07Ssthen				basic_machine=armv4l-rebel
441a3167c07Ssthen				basic_os=linux
442a3167c07Ssthen				;;
443a3167c07Ssthen			news | news700 | news800 | news900)
444a3167c07Ssthen				basic_machine=m68k-sony
445a3167c07Ssthen				basic_os=newsos
446a3167c07Ssthen				;;
447a3167c07Ssthen			news1000)
448a3167c07Ssthen				basic_machine=m68030-sony
449a3167c07Ssthen				basic_os=newsos
450a3167c07Ssthen				;;
451a3167c07Ssthen			necv70)
452a3167c07Ssthen				basic_machine=v70-nec
453a3167c07Ssthen				basic_os=sysv
454a3167c07Ssthen				;;
455a3167c07Ssthen			nh3000)
456a3167c07Ssthen				basic_machine=m68k-harris
457a3167c07Ssthen				basic_os=cxux
458a3167c07Ssthen				;;
459a3167c07Ssthen			nh[45]000)
460a3167c07Ssthen				basic_machine=m88k-harris
461a3167c07Ssthen				basic_os=cxux
462a3167c07Ssthen				;;
463a3167c07Ssthen			nindy960)
464a3167c07Ssthen				basic_machine=i960-intel
465a3167c07Ssthen				basic_os=nindy
466a3167c07Ssthen				;;
467a3167c07Ssthen			mon960)
468a3167c07Ssthen				basic_machine=i960-intel
469a3167c07Ssthen				basic_os=mon960
470a3167c07Ssthen				;;
471a3167c07Ssthen			nonstopux)
472a3167c07Ssthen				basic_machine=mips-compaq
473a3167c07Ssthen				basic_os=nonstopux
474a3167c07Ssthen				;;
475a3167c07Ssthen			os400)
476a3167c07Ssthen				basic_machine=powerpc-ibm
477a3167c07Ssthen				basic_os=os400
478a3167c07Ssthen				;;
479a3167c07Ssthen			OSE68000 | ose68000)
480a3167c07Ssthen				basic_machine=m68000-ericsson
481a3167c07Ssthen				basic_os=ose
482a3167c07Ssthen				;;
483a3167c07Ssthen			os68k)
484a3167c07Ssthen				basic_machine=m68k-none
485a3167c07Ssthen				basic_os=os68k
486a3167c07Ssthen				;;
487a3167c07Ssthen			paragon)
488a3167c07Ssthen				basic_machine=i860-intel
489a3167c07Ssthen				basic_os=osf
490a3167c07Ssthen				;;
491a3167c07Ssthen			parisc)
492a3167c07Ssthen				basic_machine=hppa-unknown
493a3167c07Ssthen				basic_os=linux
494a3167c07Ssthen				;;
495a3167c07Ssthen			psp)
496a3167c07Ssthen				basic_machine=mipsallegrexel-sony
497a3167c07Ssthen				basic_os=psp
498a3167c07Ssthen				;;
499a3167c07Ssthen			pw32)
500a3167c07Ssthen				basic_machine=i586-unknown
501a3167c07Ssthen				basic_os=pw32
502a3167c07Ssthen				;;
503a3167c07Ssthen			rdos | rdos64)
504a3167c07Ssthen				basic_machine=x86_64-pc
505a3167c07Ssthen				basic_os=rdos
506a3167c07Ssthen				;;
507a3167c07Ssthen			rdos32)
508a3167c07Ssthen				basic_machine=i386-pc
509a3167c07Ssthen				basic_os=rdos
510a3167c07Ssthen				;;
511a3167c07Ssthen			rom68k)
512a3167c07Ssthen				basic_machine=m68k-rom68k
513a3167c07Ssthen				basic_os=coff
514a3167c07Ssthen				;;
515a3167c07Ssthen			sa29200)
516a3167c07Ssthen				basic_machine=a29k-amd
517a3167c07Ssthen				basic_os=udi
518a3167c07Ssthen				;;
519a3167c07Ssthen			sei)
520a3167c07Ssthen				basic_machine=mips-sei
521a3167c07Ssthen				basic_os=seiux
522a3167c07Ssthen				;;
523a3167c07Ssthen			sequent)
524a3167c07Ssthen				basic_machine=i386-sequent
525a3167c07Ssthen				basic_os=
526a3167c07Ssthen				;;
527a3167c07Ssthen			sps7)
528a3167c07Ssthen				basic_machine=m68k-bull
529a3167c07Ssthen				basic_os=sysv2
530a3167c07Ssthen				;;
531a3167c07Ssthen			st2000)
532a3167c07Ssthen				basic_machine=m68k-tandem
533a3167c07Ssthen				basic_os=
534a3167c07Ssthen				;;
535a3167c07Ssthen			stratus)
536a3167c07Ssthen				basic_machine=i860-stratus
537a3167c07Ssthen				basic_os=sysv4
538a3167c07Ssthen				;;
539a3167c07Ssthen			sun2)
540a3167c07Ssthen				basic_machine=m68000-sun
541a3167c07Ssthen				basic_os=
542a3167c07Ssthen				;;
543a3167c07Ssthen			sun2os3)
544a3167c07Ssthen				basic_machine=m68000-sun
545a3167c07Ssthen				basic_os=sunos3
546a3167c07Ssthen				;;
547a3167c07Ssthen			sun2os4)
548a3167c07Ssthen				basic_machine=m68000-sun
549a3167c07Ssthen				basic_os=sunos4
550a3167c07Ssthen				;;
551a3167c07Ssthen			sun3)
552a3167c07Ssthen				basic_machine=m68k-sun
553a3167c07Ssthen				basic_os=
554a3167c07Ssthen				;;
555a3167c07Ssthen			sun3os3)
556a3167c07Ssthen				basic_machine=m68k-sun
557a3167c07Ssthen				basic_os=sunos3
558a3167c07Ssthen				;;
559a3167c07Ssthen			sun3os4)
560a3167c07Ssthen				basic_machine=m68k-sun
561a3167c07Ssthen				basic_os=sunos4
562a3167c07Ssthen				;;
563a3167c07Ssthen			sun4)
564a3167c07Ssthen				basic_machine=sparc-sun
565a3167c07Ssthen				basic_os=
566a3167c07Ssthen				;;
567a3167c07Ssthen			sun4os3)
568a3167c07Ssthen				basic_machine=sparc-sun
569a3167c07Ssthen				basic_os=sunos3
570a3167c07Ssthen				;;
571a3167c07Ssthen			sun4os4)
572a3167c07Ssthen				basic_machine=sparc-sun
573a3167c07Ssthen				basic_os=sunos4
574a3167c07Ssthen				;;
575a3167c07Ssthen			sun4sol2)
576a3167c07Ssthen				basic_machine=sparc-sun
577a3167c07Ssthen				basic_os=solaris2
578a3167c07Ssthen				;;
579a3167c07Ssthen			sun386 | sun386i | roadrunner)
580a3167c07Ssthen				basic_machine=i386-sun
581a3167c07Ssthen				basic_os=
582a3167c07Ssthen				;;
583a3167c07Ssthen			sv1)
584a3167c07Ssthen				basic_machine=sv1-cray
585a3167c07Ssthen				basic_os=unicos
586a3167c07Ssthen				;;
587a3167c07Ssthen			symmetry)
588a3167c07Ssthen				basic_machine=i386-sequent
589a3167c07Ssthen				basic_os=dynix
590a3167c07Ssthen				;;
591a3167c07Ssthen			t3e)
592a3167c07Ssthen				basic_machine=alphaev5-cray
593a3167c07Ssthen				basic_os=unicos
594a3167c07Ssthen				;;
595a3167c07Ssthen			t90)
596a3167c07Ssthen				basic_machine=t90-cray
597a3167c07Ssthen				basic_os=unicos
598a3167c07Ssthen				;;
599a3167c07Ssthen			toad1)
600a3167c07Ssthen				basic_machine=pdp10-xkl
601a3167c07Ssthen				basic_os=tops20
602a3167c07Ssthen				;;
603a3167c07Ssthen			tpf)
604a3167c07Ssthen				basic_machine=s390x-ibm
605a3167c07Ssthen				basic_os=tpf
606a3167c07Ssthen				;;
607a3167c07Ssthen			udi29k)
608a3167c07Ssthen				basic_machine=a29k-amd
609a3167c07Ssthen				basic_os=udi
610a3167c07Ssthen				;;
611a3167c07Ssthen			ultra3)
612a3167c07Ssthen				basic_machine=a29k-nyu
613a3167c07Ssthen				basic_os=sym1
614a3167c07Ssthen				;;
615a3167c07Ssthen			v810 | necv810)
616a3167c07Ssthen				basic_machine=v810-nec
617a3167c07Ssthen				basic_os=none
618a3167c07Ssthen				;;
619a3167c07Ssthen			vaxv)
620a3167c07Ssthen				basic_machine=vax-dec
621a3167c07Ssthen				basic_os=sysv
622a3167c07Ssthen				;;
623a3167c07Ssthen			vms)
624a3167c07Ssthen				basic_machine=vax-dec
625a3167c07Ssthen				basic_os=vms
626a3167c07Ssthen				;;
627a3167c07Ssthen			vsta)
628a3167c07Ssthen				basic_machine=i386-pc
629a3167c07Ssthen				basic_os=vsta
630a3167c07Ssthen				;;
631a3167c07Ssthen			vxworks960)
632a3167c07Ssthen				basic_machine=i960-wrs
633a3167c07Ssthen				basic_os=vxworks
634a3167c07Ssthen				;;
635a3167c07Ssthen			vxworks68)
636a3167c07Ssthen				basic_machine=m68k-wrs
637a3167c07Ssthen				basic_os=vxworks
638a3167c07Ssthen				;;
639a3167c07Ssthen			vxworks29k)
640a3167c07Ssthen				basic_machine=a29k-wrs
641a3167c07Ssthen				basic_os=vxworks
642a3167c07Ssthen				;;
643a3167c07Ssthen			xbox)
644a3167c07Ssthen				basic_machine=i686-pc
645a3167c07Ssthen				basic_os=mingw32
646a3167c07Ssthen				;;
647a3167c07Ssthen			ymp)
648a3167c07Ssthen				basic_machine=ymp-cray
649a3167c07Ssthen				basic_os=unicos
650a3167c07Ssthen				;;
651a3167c07Ssthen			*)
652a3167c07Ssthen				basic_machine=$1
653a3167c07Ssthen				basic_os=
654a3167c07Ssthen				;;
655a3167c07Ssthen		esac
656933707f3Ssthen		;;
657933707f3Ssthenesac
658933707f3Ssthen
659a3167c07Ssthen# Decode 1-component or ad-hoc basic machines
660933707f3Ssthencase $basic_machine in
661a3167c07Ssthen	# Here we handle the default manufacturer of certain CPU types.  It is in
662a3167c07Ssthen	# some cases the only manufacturer, in others, it is the most popular.
663a3167c07Ssthen	w89k)
664a3167c07Ssthen		cpu=hppa1.1
665a3167c07Ssthen		vendor=winbond
666a3167c07Ssthen		;;
667a3167c07Ssthen	op50n)
668a3167c07Ssthen		cpu=hppa1.1
669a3167c07Ssthen		vendor=oki
670a3167c07Ssthen		;;
671a3167c07Ssthen	op60c)
672a3167c07Ssthen		cpu=hppa1.1
673a3167c07Ssthen		vendor=oki
674a3167c07Ssthen		;;
675a3167c07Ssthen	ibm*)
676a3167c07Ssthen		cpu=i370
677a3167c07Ssthen		vendor=ibm
678a3167c07Ssthen		;;
679a3167c07Ssthen	orion105)
680a3167c07Ssthen		cpu=clipper
681a3167c07Ssthen		vendor=highlevel
682a3167c07Ssthen		;;
683a3167c07Ssthen	mac | mpw | mac-mpw)
684a3167c07Ssthen		cpu=m68k
685a3167c07Ssthen		vendor=apple
686a3167c07Ssthen		;;
687a3167c07Ssthen	pmac | pmac-mpw)
688a3167c07Ssthen		cpu=powerpc
689a3167c07Ssthen		vendor=apple
690a3167c07Ssthen		;;
691a3167c07Ssthen
692a3167c07Ssthen	# Recognize the various machine names and aliases which stand
693a3167c07Ssthen	# for a CPU type and a company and sometimes even an OS.
694a3167c07Ssthen	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
695a3167c07Ssthen		cpu=m68000
696a3167c07Ssthen		vendor=att
697a3167c07Ssthen		;;
698a3167c07Ssthen	3b*)
699a3167c07Ssthen		cpu=we32k
700a3167c07Ssthen		vendor=att
701a3167c07Ssthen		;;
702a3167c07Ssthen	bluegene*)
703a3167c07Ssthen		cpu=powerpc
704a3167c07Ssthen		vendor=ibm
705a3167c07Ssthen		basic_os=cnk
706a3167c07Ssthen		;;
707a3167c07Ssthen	decsystem10* | dec10*)
708a3167c07Ssthen		cpu=pdp10
709a3167c07Ssthen		vendor=dec
710a3167c07Ssthen		basic_os=tops10
711a3167c07Ssthen		;;
712a3167c07Ssthen	decsystem20* | dec20*)
713a3167c07Ssthen		cpu=pdp10
714a3167c07Ssthen		vendor=dec
715a3167c07Ssthen		basic_os=tops20
716a3167c07Ssthen		;;
717a3167c07Ssthen	delta | 3300 | motorola-3300 | motorola-delta \
718a3167c07Ssthen	      | 3300-motorola | delta-motorola)
719a3167c07Ssthen		cpu=m68k
720a3167c07Ssthen		vendor=motorola
721a3167c07Ssthen		;;
722a3167c07Ssthen	dpx2*)
723a3167c07Ssthen		cpu=m68k
724a3167c07Ssthen		vendor=bull
725a3167c07Ssthen		basic_os=sysv3
726a3167c07Ssthen		;;
727a3167c07Ssthen	encore | umax | mmax)
728a3167c07Ssthen		cpu=ns32k
729a3167c07Ssthen		vendor=encore
730a3167c07Ssthen		;;
731a3167c07Ssthen	elxsi)
732a3167c07Ssthen		cpu=elxsi
733a3167c07Ssthen		vendor=elxsi
734a3167c07Ssthen		basic_os=${basic_os:-bsd}
735a3167c07Ssthen		;;
736a3167c07Ssthen	fx2800)
737a3167c07Ssthen		cpu=i860
738a3167c07Ssthen		vendor=alliant
739a3167c07Ssthen		;;
740a3167c07Ssthen	genix)
741a3167c07Ssthen		cpu=ns32k
742a3167c07Ssthen		vendor=ns
743a3167c07Ssthen		;;
744a3167c07Ssthen	h3050r* | hiux*)
745a3167c07Ssthen		cpu=hppa1.1
746a3167c07Ssthen		vendor=hitachi
747a3167c07Ssthen		basic_os=hiuxwe2
748a3167c07Ssthen		;;
749a3167c07Ssthen	hp3k9[0-9][0-9] | hp9[0-9][0-9])
750a3167c07Ssthen		cpu=hppa1.0
751a3167c07Ssthen		vendor=hp
752a3167c07Ssthen		;;
753a3167c07Ssthen	hp9k2[0-9][0-9] | hp9k31[0-9])
754a3167c07Ssthen		cpu=m68000
755a3167c07Ssthen		vendor=hp
756a3167c07Ssthen		;;
757a3167c07Ssthen	hp9k3[2-9][0-9])
758a3167c07Ssthen		cpu=m68k
759a3167c07Ssthen		vendor=hp
760a3167c07Ssthen		;;
761a3167c07Ssthen	hp9k6[0-9][0-9] | hp6[0-9][0-9])
762a3167c07Ssthen		cpu=hppa1.0
763a3167c07Ssthen		vendor=hp
764a3167c07Ssthen		;;
765a3167c07Ssthen	hp9k7[0-79][0-9] | hp7[0-79][0-9])
766a3167c07Ssthen		cpu=hppa1.1
767a3167c07Ssthen		vendor=hp
768a3167c07Ssthen		;;
769a3167c07Ssthen	hp9k78[0-9] | hp78[0-9])
770a3167c07Ssthen		# FIXME: really hppa2.0-hp
771a3167c07Ssthen		cpu=hppa1.1
772a3167c07Ssthen		vendor=hp
773a3167c07Ssthen		;;
774a3167c07Ssthen	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
775a3167c07Ssthen		# FIXME: really hppa2.0-hp
776a3167c07Ssthen		cpu=hppa1.1
777a3167c07Ssthen		vendor=hp
778a3167c07Ssthen		;;
779a3167c07Ssthen	hp9k8[0-9][13679] | hp8[0-9][13679])
780a3167c07Ssthen		cpu=hppa1.1
781a3167c07Ssthen		vendor=hp
782a3167c07Ssthen		;;
783a3167c07Ssthen	hp9k8[0-9][0-9] | hp8[0-9][0-9])
784a3167c07Ssthen		cpu=hppa1.0
785a3167c07Ssthen		vendor=hp
786a3167c07Ssthen		;;
787a3167c07Ssthen	i*86v32)
788191f22c6Ssthen		cpu=`echo "$1" | sed -e 's/86.*/86/'`
789a3167c07Ssthen		vendor=pc
790a3167c07Ssthen		basic_os=sysv32
791a3167c07Ssthen		;;
792a3167c07Ssthen	i*86v4*)
793191f22c6Ssthen		cpu=`echo "$1" | sed -e 's/86.*/86/'`
794a3167c07Ssthen		vendor=pc
795a3167c07Ssthen		basic_os=sysv4
796a3167c07Ssthen		;;
797a3167c07Ssthen	i*86v)
798191f22c6Ssthen		cpu=`echo "$1" | sed -e 's/86.*/86/'`
799a3167c07Ssthen		vendor=pc
800a3167c07Ssthen		basic_os=sysv
801a3167c07Ssthen		;;
802a3167c07Ssthen	i*86sol2)
803191f22c6Ssthen		cpu=`echo "$1" | sed -e 's/86.*/86/'`
804a3167c07Ssthen		vendor=pc
805a3167c07Ssthen		basic_os=solaris2
806a3167c07Ssthen		;;
807a3167c07Ssthen	j90 | j90-cray)
808a3167c07Ssthen		cpu=j90
809a3167c07Ssthen		vendor=cray
810a3167c07Ssthen		basic_os=${basic_os:-unicos}
811a3167c07Ssthen		;;
812a3167c07Ssthen	iris | iris4d)
813a3167c07Ssthen		cpu=mips
814a3167c07Ssthen		vendor=sgi
815a3167c07Ssthen		case $basic_os in
816a3167c07Ssthen		    irix*)
817a3167c07Ssthen			;;
818a3167c07Ssthen		    *)
819a3167c07Ssthen			basic_os=irix4
820a3167c07Ssthen			;;
821a3167c07Ssthen		esac
822a3167c07Ssthen		;;
823a3167c07Ssthen	miniframe)
824a3167c07Ssthen		cpu=m68000
825a3167c07Ssthen		vendor=convergent
826a3167c07Ssthen		;;
827a3167c07Ssthen	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
828a3167c07Ssthen		cpu=m68k
829a3167c07Ssthen		vendor=atari
830a3167c07Ssthen		basic_os=mint
831a3167c07Ssthen		;;
832a3167c07Ssthen	news-3600 | risc-news)
833a3167c07Ssthen		cpu=mips
834a3167c07Ssthen		vendor=sony
835a3167c07Ssthen		basic_os=newsos
836a3167c07Ssthen		;;
837a3167c07Ssthen	next | m*-next)
838a3167c07Ssthen		cpu=m68k
839a3167c07Ssthen		vendor=next
840a3167c07Ssthen		case $basic_os in
841a3167c07Ssthen		    openstep*)
842a3167c07Ssthen		        ;;
843a3167c07Ssthen		    nextstep*)
844a3167c07Ssthen			;;
845a3167c07Ssthen		    ns2*)
846a3167c07Ssthen		      basic_os=nextstep2
847a3167c07Ssthen			;;
848a3167c07Ssthen		    *)
849a3167c07Ssthen		      basic_os=nextstep3
850a3167c07Ssthen			;;
851a3167c07Ssthen		esac
852a3167c07Ssthen		;;
853a3167c07Ssthen	np1)
854a3167c07Ssthen		cpu=np1
855a3167c07Ssthen		vendor=gould
856a3167c07Ssthen		;;
857a3167c07Ssthen	op50n-* | op60c-*)
858a3167c07Ssthen		cpu=hppa1.1
859a3167c07Ssthen		vendor=oki
860a3167c07Ssthen		basic_os=proelf
861a3167c07Ssthen		;;
862a3167c07Ssthen	pa-hitachi)
863a3167c07Ssthen		cpu=hppa1.1
864a3167c07Ssthen		vendor=hitachi
865a3167c07Ssthen		basic_os=hiuxwe2
866a3167c07Ssthen		;;
867a3167c07Ssthen	pbd)
868a3167c07Ssthen		cpu=sparc
869a3167c07Ssthen		vendor=tti
870a3167c07Ssthen		;;
871a3167c07Ssthen	pbb)
872a3167c07Ssthen		cpu=m68k
873a3167c07Ssthen		vendor=tti
874a3167c07Ssthen		;;
875a3167c07Ssthen	pc532)
876a3167c07Ssthen		cpu=ns32k
877a3167c07Ssthen		vendor=pc532
878a3167c07Ssthen		;;
879a3167c07Ssthen	pn)
880a3167c07Ssthen		cpu=pn
881a3167c07Ssthen		vendor=gould
882a3167c07Ssthen		;;
883a3167c07Ssthen	power)
884a3167c07Ssthen		cpu=power
885a3167c07Ssthen		vendor=ibm
886a3167c07Ssthen		;;
887a3167c07Ssthen	ps2)
888a3167c07Ssthen		cpu=i386
889a3167c07Ssthen		vendor=ibm
890a3167c07Ssthen		;;
891a3167c07Ssthen	rm[46]00)
892a3167c07Ssthen		cpu=mips
893a3167c07Ssthen		vendor=siemens
894a3167c07Ssthen		;;
895a3167c07Ssthen	rtpc | rtpc-*)
896a3167c07Ssthen		cpu=romp
897a3167c07Ssthen		vendor=ibm
898a3167c07Ssthen		;;
899a3167c07Ssthen	sde)
900a3167c07Ssthen		cpu=mipsisa32
901a3167c07Ssthen		vendor=sde
902a3167c07Ssthen		basic_os=${basic_os:-elf}
903a3167c07Ssthen		;;
904a3167c07Ssthen	simso-wrs)
905a3167c07Ssthen		cpu=sparclite
906a3167c07Ssthen		vendor=wrs
907a3167c07Ssthen		basic_os=vxworks
908a3167c07Ssthen		;;
909a3167c07Ssthen	tower | tower-32)
910a3167c07Ssthen		cpu=m68k
911a3167c07Ssthen		vendor=ncr
912a3167c07Ssthen		;;
913a3167c07Ssthen	vpp*|vx|vx-*)
914a3167c07Ssthen		cpu=f301
915a3167c07Ssthen		vendor=fujitsu
916a3167c07Ssthen		;;
917a3167c07Ssthen	w65)
918a3167c07Ssthen		cpu=w65
919a3167c07Ssthen		vendor=wdc
920a3167c07Ssthen		;;
921a3167c07Ssthen	w89k-*)
922a3167c07Ssthen		cpu=hppa1.1
923a3167c07Ssthen		vendor=winbond
924a3167c07Ssthen		basic_os=proelf
925a3167c07Ssthen		;;
926a3167c07Ssthen	none)
927a3167c07Ssthen		cpu=none
928a3167c07Ssthen		vendor=none
929a3167c07Ssthen		;;
930a3167c07Ssthen	leon|leon[3-9])
931a3167c07Ssthen		cpu=sparc
932a3167c07Ssthen		vendor=$basic_machine
933a3167c07Ssthen		;;
934a3167c07Ssthen	leon-*|leon[3-9]-*)
935a3167c07Ssthen		cpu=sparc
936191f22c6Ssthen		vendor=`echo "$basic_machine" | sed 's/-.*//'`
937a3167c07Ssthen		;;
938a3167c07Ssthen
939a3167c07Ssthen	*-*)
940a3167c07Ssthen		# shellcheck disable=SC2162
941e21c60efSsthen		saved_IFS=$IFS
942a3167c07Ssthen		IFS="-" read cpu vendor <<EOF
943a3167c07Ssthen$basic_machine
944a3167c07SsthenEOF
945e21c60efSsthen		IFS=$saved_IFS
946a3167c07Ssthen		;;
9478b7325afSsthen	# We use 'pc' rather than 'unknown'
948a3167c07Ssthen	# because (1) that's what they normally are, and
949a3167c07Ssthen	# (2) the word "unknown" tends to confuse beginning users.
950a3167c07Ssthen	i*86 | x86_64)
951a3167c07Ssthen		cpu=$basic_machine
952a3167c07Ssthen		vendor=pc
953a3167c07Ssthen		;;
954a3167c07Ssthen	# These rules are duplicated from below for sake of the special case above;
955a3167c07Ssthen	# i.e. things that normalized to x86 arches should also default to "pc"
956a3167c07Ssthen	pc98)
957a3167c07Ssthen		cpu=i386
958a3167c07Ssthen		vendor=pc
959a3167c07Ssthen		;;
960a3167c07Ssthen	x64 | amd64)
961a3167c07Ssthen		cpu=x86_64
962a3167c07Ssthen		vendor=pc
963a3167c07Ssthen		;;
964933707f3Ssthen	# Recognize the basic CPU types without company name.
965a3167c07Ssthen	*)
966a3167c07Ssthen		cpu=$basic_machine
967a3167c07Ssthen		vendor=unknown
968a3167c07Ssthen		;;
969a3167c07Ssthenesac
970a3167c07Ssthen
971a3167c07Ssthenunset -v basic_machine
972a3167c07Ssthen
973a3167c07Ssthen# Decode basic machines in the full and proper CPU-Company form.
974a3167c07Ssthencase $cpu-$vendor in
975a3167c07Ssthen	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
976a3167c07Ssthen	# some cases the only manufacturer, in others, it is the most popular.
977a3167c07Ssthen	craynv-unknown)
978a3167c07Ssthen		vendor=cray
979a3167c07Ssthen		basic_os=${basic_os:-unicosmp}
980a3167c07Ssthen		;;
981a3167c07Ssthen	c90-unknown | c90-cray)
982a3167c07Ssthen		vendor=cray
983a3167c07Ssthen		basic_os=${Basic_os:-unicos}
984a3167c07Ssthen		;;
985a3167c07Ssthen	fx80-unknown)
986a3167c07Ssthen		vendor=alliant
987a3167c07Ssthen		;;
988a3167c07Ssthen	romp-unknown)
989a3167c07Ssthen		vendor=ibm
990a3167c07Ssthen		;;
991a3167c07Ssthen	mmix-unknown)
992a3167c07Ssthen		vendor=knuth
993a3167c07Ssthen		;;
994a3167c07Ssthen	microblaze-unknown | microblazeel-unknown)
995a3167c07Ssthen		vendor=xilinx
996a3167c07Ssthen		;;
997a3167c07Ssthen	rs6000-unknown)
998a3167c07Ssthen		vendor=ibm
999a3167c07Ssthen		;;
1000a3167c07Ssthen	vax-unknown)
1001a3167c07Ssthen		vendor=dec
1002a3167c07Ssthen		;;
1003a3167c07Ssthen	pdp11-unknown)
1004a3167c07Ssthen		vendor=dec
1005a3167c07Ssthen		;;
1006a3167c07Ssthen	we32k-unknown)
1007a3167c07Ssthen		vendor=att
1008a3167c07Ssthen		;;
1009a3167c07Ssthen	cydra-unknown)
1010a3167c07Ssthen		vendor=cydrome
1011a3167c07Ssthen		;;
1012a3167c07Ssthen	i370-ibm*)
1013a3167c07Ssthen		vendor=ibm
1014a3167c07Ssthen		;;
1015a3167c07Ssthen	orion-unknown)
1016a3167c07Ssthen		vendor=highlevel
1017a3167c07Ssthen		;;
1018a3167c07Ssthen	xps-unknown | xps100-unknown)
1019a3167c07Ssthen		cpu=xps100
1020a3167c07Ssthen		vendor=honeywell
1021a3167c07Ssthen		;;
1022a3167c07Ssthen
1023a3167c07Ssthen	# Here we normalize CPU types with a missing or matching vendor
1024e21c60efSsthen	armh-unknown | armh-alt)
1025e21c60efSsthen		cpu=armv7l
1026e21c60efSsthen		vendor=alt
1027e21c60efSsthen		basic_os=${basic_os:-linux-gnueabihf}
1028e21c60efSsthen		;;
1029a3167c07Ssthen	dpx20-unknown | dpx20-bull)
1030a3167c07Ssthen		cpu=rs6000
1031a3167c07Ssthen		vendor=bull
1032a3167c07Ssthen		basic_os=${basic_os:-bosx}
1033a3167c07Ssthen		;;
1034a3167c07Ssthen
1035a3167c07Ssthen	# Here we normalize CPU types irrespective of the vendor
1036a3167c07Ssthen	amd64-*)
1037a3167c07Ssthen		cpu=x86_64
1038a3167c07Ssthen		;;
1039a3167c07Ssthen	blackfin-*)
1040a3167c07Ssthen		cpu=bfin
1041a3167c07Ssthen		basic_os=linux
1042a3167c07Ssthen		;;
1043a3167c07Ssthen	c54x-*)
1044a3167c07Ssthen		cpu=tic54x
1045a3167c07Ssthen		;;
1046a3167c07Ssthen	c55x-*)
1047a3167c07Ssthen		cpu=tic55x
1048a3167c07Ssthen		;;
1049a3167c07Ssthen	c6x-*)
1050a3167c07Ssthen		cpu=tic6x
1051a3167c07Ssthen		;;
1052a3167c07Ssthen	e500v[12]-*)
1053a3167c07Ssthen		cpu=powerpc
1054a3167c07Ssthen		basic_os=${basic_os}"spe"
1055a3167c07Ssthen		;;
1056a3167c07Ssthen	mips3*-*)
1057a3167c07Ssthen		cpu=mips64
1058a3167c07Ssthen		;;
1059a3167c07Ssthen	ms1-*)
1060a3167c07Ssthen		cpu=mt
1061a3167c07Ssthen		;;
1062a3167c07Ssthen	m68knommu-*)
1063a3167c07Ssthen		cpu=m68k
1064a3167c07Ssthen		basic_os=linux
1065a3167c07Ssthen		;;
1066a3167c07Ssthen	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
1067a3167c07Ssthen		cpu=s12z
1068a3167c07Ssthen		;;
1069a3167c07Ssthen	openrisc-*)
1070a3167c07Ssthen		cpu=or32
1071a3167c07Ssthen		;;
1072a3167c07Ssthen	parisc-*)
1073a3167c07Ssthen		cpu=hppa
1074a3167c07Ssthen		basic_os=linux
1075a3167c07Ssthen		;;
1076a3167c07Ssthen	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1077a3167c07Ssthen		cpu=i586
1078a3167c07Ssthen		;;
10798b7325afSsthen	pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
1080a3167c07Ssthen		cpu=i686
1081a3167c07Ssthen		;;
1082a3167c07Ssthen	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1083a3167c07Ssthen		cpu=i686
1084a3167c07Ssthen		;;
1085a3167c07Ssthen	pentium4-*)
1086a3167c07Ssthen		cpu=i786
1087a3167c07Ssthen		;;
1088a3167c07Ssthen	pc98-*)
1089a3167c07Ssthen		cpu=i386
1090a3167c07Ssthen		;;
1091a3167c07Ssthen	ppc-* | ppcbe-*)
1092a3167c07Ssthen		cpu=powerpc
1093a3167c07Ssthen		;;
1094a3167c07Ssthen	ppcle-* | powerpclittle-*)
1095a3167c07Ssthen		cpu=powerpcle
1096a3167c07Ssthen		;;
1097a3167c07Ssthen	ppc64-*)
1098a3167c07Ssthen		cpu=powerpc64
1099a3167c07Ssthen		;;
1100a3167c07Ssthen	ppc64le-* | powerpc64little-*)
1101a3167c07Ssthen		cpu=powerpc64le
1102a3167c07Ssthen		;;
1103a3167c07Ssthen	sb1-*)
1104a3167c07Ssthen		cpu=mipsisa64sb1
1105a3167c07Ssthen		;;
1106a3167c07Ssthen	sb1el-*)
1107a3167c07Ssthen		cpu=mipsisa64sb1el
1108a3167c07Ssthen		;;
1109a3167c07Ssthen	sh5e[lb]-*)
1110191f22c6Ssthen		cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'`
1111a3167c07Ssthen		;;
1112a3167c07Ssthen	spur-*)
1113a3167c07Ssthen		cpu=spur
1114a3167c07Ssthen		;;
1115a3167c07Ssthen	strongarm-* | thumb-*)
1116a3167c07Ssthen		cpu=arm
1117a3167c07Ssthen		;;
1118a3167c07Ssthen	tx39-*)
1119a3167c07Ssthen		cpu=mipstx39
1120a3167c07Ssthen		;;
1121a3167c07Ssthen	tx39el-*)
1122a3167c07Ssthen		cpu=mipstx39el
1123a3167c07Ssthen		;;
1124a3167c07Ssthen	x64-*)
1125a3167c07Ssthen		cpu=x86_64
1126a3167c07Ssthen		;;
1127a3167c07Ssthen	xscale-* | xscalee[bl]-*)
1128191f22c6Ssthen		cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
1129a3167c07Ssthen		;;
1130e21c60efSsthen	arm64-* | aarch64le-*)
1131a3167c07Ssthen		cpu=aarch64
1132a3167c07Ssthen		;;
1133a3167c07Ssthen
1134a3167c07Ssthen	# Recognize the canonical CPU Types that limit and/or modify the
1135a3167c07Ssthen	# company names they are paired with.
1136a3167c07Ssthen	cr16-*)
1137a3167c07Ssthen		basic_os=${basic_os:-elf}
1138a3167c07Ssthen		;;
1139a3167c07Ssthen	crisv32-* | etraxfs*-*)
1140a3167c07Ssthen		cpu=crisv32
1141a3167c07Ssthen		vendor=axis
1142a3167c07Ssthen		;;
1143a3167c07Ssthen	cris-* | etrax*-*)
1144a3167c07Ssthen		cpu=cris
1145a3167c07Ssthen		vendor=axis
1146a3167c07Ssthen		;;
1147a3167c07Ssthen	crx-*)
1148a3167c07Ssthen		basic_os=${basic_os:-elf}
1149a3167c07Ssthen		;;
1150a3167c07Ssthen	neo-tandem)
1151a3167c07Ssthen		cpu=neo
1152a3167c07Ssthen		vendor=tandem
1153a3167c07Ssthen		;;
1154a3167c07Ssthen	nse-tandem)
1155a3167c07Ssthen		cpu=nse
1156a3167c07Ssthen		vendor=tandem
1157a3167c07Ssthen		;;
1158a3167c07Ssthen	nsr-tandem)
1159a3167c07Ssthen		cpu=nsr
1160a3167c07Ssthen		vendor=tandem
1161a3167c07Ssthen		;;
1162a3167c07Ssthen	nsv-tandem)
1163a3167c07Ssthen		cpu=nsv
1164a3167c07Ssthen		vendor=tandem
1165a3167c07Ssthen		;;
1166a3167c07Ssthen	nsx-tandem)
1167a3167c07Ssthen		cpu=nsx
1168a3167c07Ssthen		vendor=tandem
1169a3167c07Ssthen		;;
1170a3167c07Ssthen	mipsallegrexel-sony)
1171a3167c07Ssthen		cpu=mipsallegrexel
1172a3167c07Ssthen		vendor=sony
1173a3167c07Ssthen		;;
1174a3167c07Ssthen	tile*-*)
1175a3167c07Ssthen		basic_os=${basic_os:-linux-gnu}
1176a3167c07Ssthen		;;
1177a3167c07Ssthen
1178a3167c07Ssthen	*)
1179a3167c07Ssthen		# Recognize the canonical CPU types that are allowed with any
1180a3167c07Ssthen		# company name.
1181a3167c07Ssthen		case $cpu in
1182933707f3Ssthen			1750a | 580 \
1183933707f3Ssthen			| a29k \
1184*d896b962Ssthen			| aarch64 | aarch64_be | aarch64c | arm64ec \
1185a3167c07Ssthen			| abacus \
1186a3167c07Ssthen			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1187a3167c07Ssthen			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1188a3167c07Ssthen			| alphapca5[67] | alpha64pca5[67] \
1189933707f3Ssthen			| am33_2.0 \
1190a3167c07Ssthen			| amdgcn \
1191191f22c6Ssthen			| arc | arceb | arc32 | arc64 \
1192a3167c07Ssthen			| arm | arm[lb]e | arme[lb] | armv* \
119398f3ca02Sbrad			| avr | avr32 \
1194a3167c07Ssthen			| asmjs \
11950990ddf5Ssthen			| ba \
1196229e174cSsthen			| be32 | be64 \
1197a3167c07Ssthen			| bfin | bpf | bs2000 \
1198a3167c07Ssthen			| c[123]* | c30 | [cjt]90 | c4x \
1199a3167c07Ssthen			| c8051 | clipper | craynv | csky | cydra \
1200933707f3Ssthen			| d10v | d30v | dlx | dsp16xx \
1201a3167c07Ssthen			| e2k | elxsi | epiphany \
1202a3167c07Ssthen			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1203*d896b962Ssthen			| javascript \
1204a3167c07Ssthen			| h8300 | h8500 \
1205a3167c07Ssthen			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1206229e174cSsthen			| hexagon \
1207a3167c07Ssthen			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
1208933707f3Ssthen			| ip2k | iq2000 \
12090990ddf5Ssthen			| k1om \
12108b7325afSsthen			| kvx \
1211229e174cSsthen			| le32 | le64 \
1212933707f3Ssthen			| lm32 \
12137dd170e2Ssthen			| loongarch32 | loongarch64 \
1214a3167c07Ssthen			| m32c | m32r | m32rle \
1215a3167c07Ssthen			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1216a3167c07Ssthen			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1217a3167c07Ssthen			| m88110 | m88k | maxq | mb | mcore | mep | metag \
1218a3167c07Ssthen			| microblaze | microblazeel \
12198b7325afSsthen			| mips* \
1220a3167c07Ssthen			| mmix \
1221933707f3Ssthen			| mn10200 | mn10300 \
1222933707f3Ssthen			| moxie \
1223933707f3Ssthen			| mt \
1224933707f3Ssthen			| msp430 \
1225*d896b962Ssthen			| nanomips* \
1226229e174cSsthen			| nds32 | nds32le | nds32be \
1227a3167c07Ssthen			| nfp \
122898f3ca02Sbrad			| nios | nios2 | nios2eb | nios2el \
1229a3167c07Ssthen			| none | np1 | ns16k | ns32k | nvptx \
1230a3167c07Ssthen			| open8 \
1231a3167c07Ssthen			| or1k* \
1232a3167c07Ssthen			| or32 \
1233a3167c07Ssthen			| orion \
1234a3167c07Ssthen			| picochip \
1235a3167c07Ssthen			| pdp10 | pdp11 | pj | pjl | pn | power \
1236a3167c07Ssthen			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1237a3167c07Ssthen			| pru \
1238933707f3Ssthen			| pyramid \
12399982a05dSsthen			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
1240a3167c07Ssthen			| rl78 | romp | rs6000 | rx \
1241a3167c07Ssthen			| s390 | s390x \
1242933707f3Ssthen			| score \
1243a3167c07Ssthen			| sh | shl \
1244a3167c07Ssthen			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1245a3167c07Ssthen			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1246a3167c07Ssthen			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1247a3167c07Ssthen			| sparclite \
1248a3167c07Ssthen			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
1249229e174cSsthen			| spu \
1250a3167c07Ssthen			| tahoe \
1251eba819a2Ssthen			| thumbv7* \
1252a3167c07Ssthen			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1253a3167c07Ssthen			| tron \
1254933707f3Ssthen			| ubicom32 \
1255a3167c07Ssthen			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1256a3167c07Ssthen			| vax \
1257*d896b962Ssthen			| vc4 \
12580990ddf5Ssthen			| visium \
1259a3167c07Ssthen			| w65 \
1260a3167c07Ssthen			| wasm32 | wasm64 \
1261eaf2578eSsthen			| we32k \
1262a3167c07Ssthen			| x86 | x86_64 | xc16x | xgate | xps100 \
1263a3167c07Ssthen			| xstormy16 | xtensa* \
1264a3167c07Ssthen			| ymp \
1265933707f3Ssthen			| z8k | z80)
1266933707f3Ssthen				;;
1267933707f3Ssthen
1268a3167c07Ssthen			*)
12698b7325afSsthen				echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
1270933707f3Ssthen				exit 1
1271933707f3Ssthen				;;
1272933707f3Ssthen		esac
1273933707f3Ssthen		;;
1274933707f3Ssthenesac
1275933707f3Ssthen
1276933707f3Ssthen# Here we canonicalize certain aliases for manufacturers.
1277a3167c07Ssthencase $vendor in
1278a3167c07Ssthen	digital*)
1279a3167c07Ssthen		vendor=dec
1280933707f3Ssthen		;;
1281a3167c07Ssthen	commodore*)
1282a3167c07Ssthen		vendor=cbm
1283933707f3Ssthen		;;
1284933707f3Ssthen	*)
1285933707f3Ssthen		;;
1286933707f3Ssthenesac
1287933707f3Ssthen
1288933707f3Ssthen# Decode manufacturer-specific aliases for certain operating systems.
1289933707f3Ssthen
1290*d896b962Ssthenif test x"$basic_os" != x
1291933707f3Ssthenthen
1292a3167c07Ssthen
1293e21c60efSsthen# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
1294a3167c07Ssthen# set os.
1295*d896b962Ssthenobj=
1296a3167c07Ssthencase $basic_os in
1297a3167c07Ssthen	gnu/linux*)
1298a3167c07Ssthen		kernel=linux
1299191f22c6Ssthen		os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
1300eba819a2Ssthen		;;
1301eba819a2Ssthen	os2-emx)
1302eba819a2Ssthen		kernel=os2
1303191f22c6Ssthen		os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
1304933707f3Ssthen		;;
1305a3167c07Ssthen	nto-qnx*)
1306a3167c07Ssthen		kernel=nto
1307191f22c6Ssthen		os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
1308a3167c07Ssthen		;;
1309a3167c07Ssthen	*-*)
1310a3167c07Ssthen		# shellcheck disable=SC2162
1311e21c60efSsthen		saved_IFS=$IFS
1312a3167c07Ssthen		IFS="-" read kernel os <<EOF
1313a3167c07Ssthen$basic_os
1314a3167c07SsthenEOF
1315e21c60efSsthen		IFS=$saved_IFS
1316a3167c07Ssthen		;;
1317a3167c07Ssthen	# Default OS when just kernel was specified
1318a3167c07Ssthen	nto*)
1319a3167c07Ssthen		kernel=nto
1320191f22c6Ssthen		os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
1321a3167c07Ssthen		;;
1322a3167c07Ssthen	linux*)
1323a3167c07Ssthen		kernel=linux
1324191f22c6Ssthen		os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
1325a3167c07Ssthen		;;
132645872187Ssthen	managarm*)
132745872187Ssthen		kernel=managarm
132845872187Ssthen		os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
132945872187Ssthen		;;
1330a3167c07Ssthen	*)
1331a3167c07Ssthen		kernel=
1332a3167c07Ssthen		os=$basic_os
1333a3167c07Ssthen		;;
1334a3167c07Ssthenesac
1335a3167c07Ssthen
1336a3167c07Ssthen# Now, normalize the OS (knowing we just have one component, it's not a kernel,
1337a3167c07Ssthen# etc.)
1338a3167c07Ssthencase $os in
1339a3167c07Ssthen	# First match some system type aliases that might get confused
1340a3167c07Ssthen	# with valid system types.
1341a3167c07Ssthen	# solaris* is a basic system type, with this one exception.
1342a3167c07Ssthen	auroraux)
1343a3167c07Ssthen		os=auroraux
1344a3167c07Ssthen		;;
1345a3167c07Ssthen	bluegene*)
1346a3167c07Ssthen		os=cnk
1347a3167c07Ssthen		;;
1348a3167c07Ssthen	solaris1 | solaris1.*)
1349191f22c6Ssthen		os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
1350933707f3Ssthen		;;
1351a3167c07Ssthen	solaris)
1352a3167c07Ssthen		os=solaris2
1353933707f3Ssthen		;;
1354a3167c07Ssthen	unixware*)
1355a3167c07Ssthen		os=sysv4.2uw
1356eaf2578eSsthen		;;
1357a3167c07Ssthen	# es1800 is here to avoid being matched by es* (a different OS)
1358a3167c07Ssthen	es1800*)
1359a3167c07Ssthen		os=ose
1360933707f3Ssthen		;;
1361a3167c07Ssthen	# Some version numbers need modification
1362a3167c07Ssthen	chorusos*)
1363a3167c07Ssthen		os=chorusos
1364933707f3Ssthen		;;
1365a3167c07Ssthen	isc)
1366a3167c07Ssthen		os=isc2.2
1367933707f3Ssthen		;;
1368a3167c07Ssthen	sco6)
1369a3167c07Ssthen		os=sco5v6
1370a3167c07Ssthen		;;
1371a3167c07Ssthen	sco5)
1372a3167c07Ssthen		os=sco3.2v5
1373a3167c07Ssthen		;;
1374a3167c07Ssthen	sco4)
1375a3167c07Ssthen		os=sco3.2v4
1376a3167c07Ssthen		;;
1377a3167c07Ssthen	sco3.2.[4-9]*)
1378191f22c6Ssthen		os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
1379a3167c07Ssthen		;;
1380a3167c07Ssthen	sco*v* | scout)
1381a3167c07Ssthen		# Don't match below
1382a3167c07Ssthen		;;
1383a3167c07Ssthen	sco*)
1384a3167c07Ssthen		os=sco3.2v2
1385a3167c07Ssthen		;;
1386a3167c07Ssthen	psos*)
1387a3167c07Ssthen		os=psos
1388a3167c07Ssthen		;;
1389a3167c07Ssthen	qnx*)
13902c144df0Ssthen		os=qnx
1391933707f3Ssthen		;;
1392a3167c07Ssthen	hiux*)
1393a3167c07Ssthen		os=hiuxwe2
1394933707f3Ssthen		;;
1395a3167c07Ssthen	lynx*178)
1396a3167c07Ssthen		os=lynxos178
1397933707f3Ssthen		;;
1398a3167c07Ssthen	lynx*5)
1399a3167c07Ssthen		os=lynxos5
1400933707f3Ssthen		;;
1401a3167c07Ssthen	lynxos*)
1402a3167c07Ssthen		# don't get caught up in next wildcard
1403933707f3Ssthen		;;
1404a3167c07Ssthen	lynx*)
1405a3167c07Ssthen		os=lynxos
1406933707f3Ssthen		;;
1407a3167c07Ssthen	mac[0-9]*)
1408191f22c6Ssthen		os=`echo "$os" | sed -e 's|mac|macos|'`
1409933707f3Ssthen		;;
1410a3167c07Ssthen	opened*)
1411a3167c07Ssthen		os=openedition
1412933707f3Ssthen		;;
1413a3167c07Ssthen	os400*)
1414a3167c07Ssthen		os=os400
1415933707f3Ssthen		;;
1416a3167c07Ssthen	sunos5*)
1417191f22c6Ssthen		os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
1418933707f3Ssthen		;;
1419a3167c07Ssthen	sunos6*)
1420191f22c6Ssthen		os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
1421933707f3Ssthen		;;
1422a3167c07Ssthen	wince*)
1423a3167c07Ssthen		os=wince
1424933707f3Ssthen		;;
1425a3167c07Ssthen	utek*)
1426a3167c07Ssthen		os=bsd
1427eaf2578eSsthen		;;
1428a3167c07Ssthen	dynix*)
1429a3167c07Ssthen		os=bsd
1430eaf2578eSsthen		;;
1431a3167c07Ssthen	acis*)
1432a3167c07Ssthen		os=aos
1433933707f3Ssthen		;;
1434a3167c07Ssthen	atheos*)
1435a3167c07Ssthen		os=atheos
1436933707f3Ssthen		;;
1437a3167c07Ssthen	syllable*)
1438a3167c07Ssthen		os=syllable
1439933707f3Ssthen		;;
1440a3167c07Ssthen	386bsd)
1441a3167c07Ssthen		os=bsd
1442933707f3Ssthen		;;
1443a3167c07Ssthen	ctix* | uts*)
1444a3167c07Ssthen		os=sysv
1445933707f3Ssthen		;;
1446a3167c07Ssthen	nova*)
1447a3167c07Ssthen		os=rtmk-nova
1448933707f3Ssthen		;;
1449a3167c07Ssthen	ns2)
1450a3167c07Ssthen		os=nextstep2
1451933707f3Ssthen		;;
1452933707f3Ssthen	# Preserve the version number of sinix5.
1453a3167c07Ssthen	sinix5.*)
1454191f22c6Ssthen		os=`echo "$os" | sed -e 's|sinix|sysv|'`
1455933707f3Ssthen		;;
1456a3167c07Ssthen	sinix*)
1457a3167c07Ssthen		os=sysv4
1458933707f3Ssthen		;;
1459a3167c07Ssthen	tpf*)
1460a3167c07Ssthen		os=tpf
1461933707f3Ssthen		;;
1462a3167c07Ssthen	triton*)
1463a3167c07Ssthen		os=sysv3
1464933707f3Ssthen		;;
1465a3167c07Ssthen	oss*)
1466a3167c07Ssthen		os=sysv3
1467933707f3Ssthen		;;
1468a3167c07Ssthen	svr4*)
1469a3167c07Ssthen		os=sysv4
1470933707f3Ssthen		;;
1471a3167c07Ssthen	svr3)
1472a3167c07Ssthen		os=sysv3
1473933707f3Ssthen		;;
1474a3167c07Ssthen	sysvr4)
1475a3167c07Ssthen		os=sysv4
1476933707f3Ssthen		;;
1477a3167c07Ssthen	ose*)
1478a3167c07Ssthen		os=ose
1479933707f3Ssthen		;;
1480a3167c07Ssthen	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1481a3167c07Ssthen		os=mint
1482933707f3Ssthen		;;
1483a3167c07Ssthen	dicos*)
1484a3167c07Ssthen		os=dicos
1485eaf2578eSsthen		;;
1486a3167c07Ssthen	pikeos*)
1487a3167c07Ssthen		# Until real need of OS specific support for
1488a3167c07Ssthen		# particular features comes up, bare metal
1489a3167c07Ssthen		# configurations are quite functional.
1490a3167c07Ssthen		case $cpu in
1491a3167c07Ssthen		    arm*)
1492a3167c07Ssthen			os=eabi
1493933707f3Ssthen			;;
1494933707f3Ssthen		    *)
1495*d896b962Ssthen			os=
1496*d896b962Ssthen			obj=elf
1497933707f3Ssthen			;;
1498933707f3Ssthen		esac
1499a3167c07Ssthen		;;
1500*d896b962Ssthen	aout* | coff* | elf* | pe*)
1501*d896b962Ssthen		# These are machine code file formats, not OSes
1502*d896b962Ssthen		obj=$os
1503*d896b962Ssthen		os=
1504*d896b962Ssthen		;;
1505a3167c07Ssthen	*)
1506a3167c07Ssthen		# No normalization, but not necessarily accepted, that comes below.
1507a3167c07Ssthen		;;
1508a3167c07Ssthenesac
1509a3167c07Ssthen
1510933707f3Ssthenelse
1511933707f3Ssthen
1512933707f3Ssthen# Here we handle the default operating systems that come with various machines.
1513933707f3Ssthen# The value should be what the vendor currently ships out the door with their
1514933707f3Ssthen# machine or put another way, the most popular os provided with the machine.
1515933707f3Ssthen
1516933707f3Ssthen# Note that if you're going to try to match "-MANUFACTURER" here (say,
1517933707f3Ssthen# "-sun"), then you have to tell the case statement up towards the top
1518933707f3Ssthen# that MANUFACTURER isn't an operating system.  Otherwise, code above
1519933707f3Ssthen# will signal an error saying that MANUFACTURER isn't an operating
1520933707f3Ssthen# system, and we'll never get to this point.
1521933707f3Ssthen
1522a3167c07Ssthenkernel=
1523*d896b962Ssthenobj=
1524a3167c07Ssthencase $cpu-$vendor in
1525933707f3Ssthen	score-*)
1526*d896b962Ssthen		os=
1527*d896b962Ssthen		obj=elf
1528933707f3Ssthen		;;
1529933707f3Ssthen	spu-*)
1530*d896b962Ssthen		os=
1531*d896b962Ssthen		obj=elf
1532933707f3Ssthen		;;
1533933707f3Ssthen	*-acorn)
1534a3167c07Ssthen		os=riscix1.2
1535933707f3Ssthen		;;
1536933707f3Ssthen	arm*-rebel)
1537a3167c07Ssthen		kernel=linux
1538a3167c07Ssthen		os=gnu
1539933707f3Ssthen		;;
1540933707f3Ssthen	arm*-semi)
1541*d896b962Ssthen		os=
1542*d896b962Ssthen		obj=aout
1543933707f3Ssthen		;;
1544933707f3Ssthen	c4x-* | tic4x-*)
1545*d896b962Ssthen		os=
1546*d896b962Ssthen		obj=coff
1547933707f3Ssthen		;;
154898f3ca02Sbrad	c8051-*)
1549*d896b962Ssthen		os=
1550*d896b962Ssthen		obj=elf
1551a3167c07Ssthen		;;
1552a3167c07Ssthen	clipper-intergraph)
1553a3167c07Ssthen		os=clix
155498f3ca02Sbrad		;;
1555229e174cSsthen	hexagon-*)
1556*d896b962Ssthen		os=
1557*d896b962Ssthen		obj=elf
1558229e174cSsthen		;;
1559229e174cSsthen	tic54x-*)
1560*d896b962Ssthen		os=
1561*d896b962Ssthen		obj=coff
1562229e174cSsthen		;;
1563229e174cSsthen	tic55x-*)
1564*d896b962Ssthen		os=
1565*d896b962Ssthen		obj=coff
1566229e174cSsthen		;;
1567229e174cSsthen	tic6x-*)
1568*d896b962Ssthen		os=
1569*d896b962Ssthen		obj=coff
1570229e174cSsthen		;;
1571933707f3Ssthen	# This must come before the *-dec entry.
1572933707f3Ssthen	pdp10-*)
1573a3167c07Ssthen		os=tops20
1574933707f3Ssthen		;;
1575933707f3Ssthen	pdp11-*)
1576a3167c07Ssthen		os=none
1577933707f3Ssthen		;;
1578933707f3Ssthen	*-dec | vax-*)
1579a3167c07Ssthen		os=ultrix4.2
1580933707f3Ssthen		;;
1581933707f3Ssthen	m68*-apollo)
1582a3167c07Ssthen		os=domain
1583933707f3Ssthen		;;
1584933707f3Ssthen	i386-sun)
1585a3167c07Ssthen		os=sunos4.0.2
1586933707f3Ssthen		;;
1587933707f3Ssthen	m68000-sun)
1588a3167c07Ssthen		os=sunos3
1589933707f3Ssthen		;;
1590933707f3Ssthen	m68*-cisco)
1591*d896b962Ssthen		os=
1592*d896b962Ssthen		obj=aout
1593933707f3Ssthen		;;
1594933707f3Ssthen	mep-*)
1595*d896b962Ssthen		os=
1596*d896b962Ssthen		obj=elf
1597933707f3Ssthen		;;
1598933707f3Ssthen	mips*-cisco)
1599*d896b962Ssthen		os=
1600*d896b962Ssthen		obj=elf
1601933707f3Ssthen		;;
1602*d896b962Ssthen	mips*-*|nanomips*-*)
1603*d896b962Ssthen		os=
1604*d896b962Ssthen		obj=elf
1605933707f3Ssthen		;;
1606933707f3Ssthen	or32-*)
1607*d896b962Ssthen		os=
1608*d896b962Ssthen		obj=coff
1609933707f3Ssthen		;;
1610933707f3Ssthen	*-tti)	# must be before sparc entry or we get the wrong os.
1611a3167c07Ssthen		os=sysv3
1612933707f3Ssthen		;;
1613933707f3Ssthen	sparc-* | *-sun)
1614a3167c07Ssthen		os=sunos4.1.1
1615a3167c07Ssthen		;;
1616a3167c07Ssthen	pru-*)
1617*d896b962Ssthen		os=
1618*d896b962Ssthen		obj=elf
1619933707f3Ssthen		;;
1620933707f3Ssthen	*-be)
1621a3167c07Ssthen		os=beos
1622eaf2578eSsthen		;;
1623933707f3Ssthen	*-ibm)
1624a3167c07Ssthen		os=aix
1625933707f3Ssthen		;;
1626933707f3Ssthen	*-knuth)
1627a3167c07Ssthen		os=mmixware
1628933707f3Ssthen		;;
1629933707f3Ssthen	*-wec)
1630a3167c07Ssthen		os=proelf
1631933707f3Ssthen		;;
1632933707f3Ssthen	*-winbond)
1633a3167c07Ssthen		os=proelf
1634933707f3Ssthen		;;
1635933707f3Ssthen	*-oki)
1636a3167c07Ssthen		os=proelf
1637933707f3Ssthen		;;
1638933707f3Ssthen	*-hp)
1639a3167c07Ssthen		os=hpux
1640933707f3Ssthen		;;
1641933707f3Ssthen	*-hitachi)
1642a3167c07Ssthen		os=hiux
1643933707f3Ssthen		;;
1644933707f3Ssthen	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1645a3167c07Ssthen		os=sysv
1646933707f3Ssthen		;;
1647933707f3Ssthen	*-cbm)
1648a3167c07Ssthen		os=amigaos
1649933707f3Ssthen		;;
1650933707f3Ssthen	*-dg)
1651a3167c07Ssthen		os=dgux
1652933707f3Ssthen		;;
1653933707f3Ssthen	*-dolphin)
1654a3167c07Ssthen		os=sysv3
1655933707f3Ssthen		;;
1656933707f3Ssthen	m68k-ccur)
1657a3167c07Ssthen		os=rtu
1658933707f3Ssthen		;;
1659933707f3Ssthen	m88k-omron*)
1660a3167c07Ssthen		os=luna
1661933707f3Ssthen		;;
1662933707f3Ssthen	*-next)
1663a3167c07Ssthen		os=nextstep
1664933707f3Ssthen		;;
1665933707f3Ssthen	*-sequent)
1666a3167c07Ssthen		os=ptx
1667933707f3Ssthen		;;
1668933707f3Ssthen	*-crds)
1669a3167c07Ssthen		os=unos
1670933707f3Ssthen		;;
1671933707f3Ssthen	*-ns)
1672a3167c07Ssthen		os=genix
1673933707f3Ssthen		;;
1674933707f3Ssthen	i370-*)
1675a3167c07Ssthen		os=mvs
1676eaf2578eSsthen		;;
1677933707f3Ssthen	*-gould)
1678a3167c07Ssthen		os=sysv
1679933707f3Ssthen		;;
1680933707f3Ssthen	*-highlevel)
1681a3167c07Ssthen		os=bsd
1682933707f3Ssthen		;;
1683933707f3Ssthen	*-encore)
1684a3167c07Ssthen		os=bsd
1685933707f3Ssthen		;;
1686933707f3Ssthen	*-sgi)
1687a3167c07Ssthen		os=irix
1688933707f3Ssthen		;;
1689933707f3Ssthen	*-siemens)
1690a3167c07Ssthen		os=sysv4
1691933707f3Ssthen		;;
1692933707f3Ssthen	*-masscomp)
1693a3167c07Ssthen		os=rtu
1694933707f3Ssthen		;;
1695933707f3Ssthen	f30[01]-fujitsu | f700-fujitsu)
1696a3167c07Ssthen		os=uxpv
1697933707f3Ssthen		;;
1698933707f3Ssthen	*-rom68k)
1699*d896b962Ssthen		os=
1700*d896b962Ssthen		obj=coff
1701933707f3Ssthen		;;
1702933707f3Ssthen	*-*bug)
1703*d896b962Ssthen		os=
1704*d896b962Ssthen		obj=coff
1705933707f3Ssthen		;;
1706933707f3Ssthen	*-apple)
1707a3167c07Ssthen		os=macos
1708933707f3Ssthen		;;
1709933707f3Ssthen	*-atari*)
1710a3167c07Ssthen		os=mint
1711a3167c07Ssthen		;;
1712a3167c07Ssthen	*-wrs)
1713a3167c07Ssthen		os=vxworks
1714933707f3Ssthen		;;
1715933707f3Ssthen	*)
1716a3167c07Ssthen		os=none
1717933707f3Ssthen		;;
1718933707f3Ssthenesac
1719a3167c07Ssthen
1720933707f3Ssthenfi
1721933707f3Ssthen
1722*d896b962Ssthen# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
1723*d896b962Ssthen
1724a3167c07Ssthencase $os in
17259982a05dSsthen	# Sometimes we do "kernel-libc", so those need to count as OSes.
1726*d896b962Ssthen	llvm* | musl* | newlib* | relibc* | uclibc*)
1727a3167c07Ssthen		;;
17289982a05dSsthen	# Likewise for "kernel-abi"
17299982a05dSsthen	eabi* | gnueabi*)
17309982a05dSsthen		;;
17319982a05dSsthen	# VxWorks passes extra cpu info in the 4th filed.
17329982a05dSsthen	simlinux | simwindows | spe)
1733a3167c07Ssthen		;;
1734*d896b962Ssthen	# See `case $cpu-$os` validation below
1735*d896b962Ssthen	ghcjs)
1736*d896b962Ssthen		;;
1737a3167c07Ssthen	# Now accept the basic system types.
1738a3167c07Ssthen	# The portable systems comes first.
1739a3167c07Ssthen	# Each alternative MUST end in a * to match a version number.
1740a3167c07Ssthen	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1741a3167c07Ssthen	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
1742a3167c07Ssthen	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1743a3167c07Ssthen	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
1744a3167c07Ssthen	     | hiux* | abug | nacl* | netware* | windows* \
17458b7325afSsthen	     | os9* | macos* | osx* | ios* | tvos* | watchos* \
1746a3167c07Ssthen	     | mpw* | magic* | mmixware* | mon960* | lnews* \
1747a3167c07Ssthen	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1748a3167c07Ssthen	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
1749a3167c07Ssthen	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1750a3167c07Ssthen	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1751a3167c07Ssthen	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1752191f22c6Ssthen	     | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
1753a3167c07Ssthen	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1754*d896b962Ssthen	     | bosx* | nextstep* | cxux* | oabi* \
1755*d896b962Ssthen	     | ptx* | ecoff* | winnt* | domain* | vsta* \
1756a3167c07Ssthen	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
1757191f22c6Ssthen	     | chorusrdb* | cegcc* | glidix* | serenity* \
1758*d896b962Ssthen	     | cygwin* | msys* | moss* | proelf* | rtems* \
1759a3167c07Ssthen	     | midipix* | mingw32* | mingw64* | mint* \
1760a3167c07Ssthen	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1761a3167c07Ssthen	     | interix* | uwin* | mks* | rhapsody* | darwin* \
1762a3167c07Ssthen	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
1763a3167c07Ssthen	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
1764a3167c07Ssthen	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
1765a3167c07Ssthen	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
1766a3167c07Ssthen	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1767a3167c07Ssthen	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1768a3167c07Ssthen	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1769a3167c07Ssthen	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1770e21c60efSsthen	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
1771*d896b962Ssthen	     | fiwix* | mlibc* | cos* | mbr* | ironclad* )
1772a3167c07Ssthen		;;
1773a3167c07Ssthen	# This one is extra strict with allowed versions
1774a3167c07Ssthen	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
1775a3167c07Ssthen		# Don't forget version if it is 3.2v4 or newer.
1776a3167c07Ssthen		;;
1777*d896b962Ssthen	# This refers to builds using the UEFI calling convention
1778*d896b962Ssthen	# (which depends on the architecture) and PE file format.
1779*d896b962Ssthen	# Note that this is both a different calling convention and
1780*d896b962Ssthen	# different file format than that of GNU-EFI
1781*d896b962Ssthen	# (x86_64-w64-mingw32).
1782*d896b962Ssthen	uefi)
1783*d896b962Ssthen		;;
1784a3167c07Ssthen	none)
1785a3167c07Ssthen		;;
17868b7325afSsthen	kernel* | msvc* )
178745872187Ssthen		# Restricted further below
178845872187Ssthen		;;
1789*d896b962Ssthen	'')
1790*d896b962Ssthen		if test x"$obj" = x
1791*d896b962Ssthen		then
1792*d896b962Ssthen			echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
1793*d896b962Ssthen		fi
1794*d896b962Ssthen		;;
1795a3167c07Ssthen	*)
17968b7325afSsthen		echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
1797a3167c07Ssthen		exit 1
1798a3167c07Ssthen		;;
1799a3167c07Ssthenesac
1800a3167c07Ssthen
1801*d896b962Ssthencase $obj in
1802*d896b962Ssthen	aout* | coff* | elf* | pe*)
1803*d896b962Ssthen		;;
1804*d896b962Ssthen	'')
1805*d896b962Ssthen		# empty is fine
1806*d896b962Ssthen		;;
1807*d896b962Ssthen	*)
1808*d896b962Ssthen		echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
1809*d896b962Ssthen		exit 1
1810*d896b962Ssthen		;;
1811*d896b962Ssthenesac
1812*d896b962Ssthen
1813*d896b962Ssthen# Here we handle the constraint that a (synthetic) cpu and os are
1814*d896b962Ssthen# valid only in combination with each other and nowhere else.
1815*d896b962Ssthencase $cpu-$os in
1816*d896b962Ssthen	# The "javascript-unknown-ghcjs" triple is used by GHC; we
1817*d896b962Ssthen	# accept it here in order to tolerate that, but reject any
1818*d896b962Ssthen	# variations.
1819*d896b962Ssthen	javascript-ghcjs)
1820*d896b962Ssthen		;;
1821*d896b962Ssthen	javascript-* | *-ghcjs)
1822*d896b962Ssthen		echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
1823*d896b962Ssthen		exit 1
1824*d896b962Ssthen		;;
1825*d896b962Ssthenesac
1826*d896b962Ssthen
1827a3167c07Ssthen# As a final step for OS-related things, validate the OS-kernel combination
1828a3167c07Ssthen# (given a valid OS), if there is a kernel.
1829*d896b962Ssthencase $kernel-$os-$obj in
1830*d896b962Ssthen	linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
1831*d896b962Ssthen		    | linux-mlibc*- | linux-musl*- | linux-newlib*- \
1832*d896b962Ssthen		    | linux-relibc*- | linux-uclibc*- )
1833a3167c07Ssthen		;;
1834*d896b962Ssthen	uclinux-uclibc*- )
18352c144df0Ssthen		;;
1836*d896b962Ssthen	managarm-mlibc*- | managarm-kernel*- )
183745872187Ssthen		;;
1838*d896b962Ssthen	windows*-msvc*-)
18398b7325afSsthen		;;
1840*d896b962Ssthen	-dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \
1841*d896b962Ssthen		    | -uclibc*- )
1842a3167c07Ssthen		# These are just libc implementations, not actual OSes, and thus
1843a3167c07Ssthen		# require a kernel.
18448b7325afSsthen		echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
1845a3167c07Ssthen		exit 1
1846a3167c07Ssthen		;;
1847*d896b962Ssthen	-kernel*- )
18488b7325afSsthen		echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
184945872187Ssthen		exit 1
185045872187Ssthen		;;
1851*d896b962Ssthen	*-kernel*- )
18528b7325afSsthen		echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
18538b7325afSsthen		exit 1
18548b7325afSsthen		;;
1855*d896b962Ssthen	*-msvc*- )
18568b7325afSsthen		echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
185745872187Ssthen		exit 1
185845872187Ssthen		;;
1859*d896b962Ssthen	kfreebsd*-gnu*- | kopensolaris*-gnu*-)
1860a3167c07Ssthen		;;
1861*d896b962Ssthen	vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
18629982a05dSsthen		;;
1863*d896b962Ssthen	nto-qnx*-)
1864a3167c07Ssthen		;;
1865*d896b962Ssthen	os2-emx-)
1866eba819a2Ssthen		;;
1867*d896b962Ssthen	*-eabi*- | *-gnueabi*-)
1868a3167c07Ssthen		;;
1869*d896b962Ssthen	none--*)
18708b7325afSsthen		# None (no kernel, i.e. freestanding / bare metal),
1871*d896b962Ssthen		# can be paired with an machine code file format
18728b7325afSsthen		;;
1873*d896b962Ssthen	-*-)
1874a3167c07Ssthen		# Blank kernel with real OS is always fine.
1875a3167c07Ssthen		;;
1876*d896b962Ssthen	--*)
1877*d896b962Ssthen		# Blank kernel and OS with real machine code file format is always fine.
1878*d896b962Ssthen		;;
1879*d896b962Ssthen	*-*-*)
18808b7325afSsthen		echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
1881a3167c07Ssthen		exit 1
1882a3167c07Ssthen		;;
1883a3167c07Ssthenesac
1884a3167c07Ssthen
1885933707f3Ssthen# Here we handle the case where we know the os, and the CPU type, but not the
1886933707f3Ssthen# manufacturer.  We pick the logical manufacturer.
1887a3167c07Ssthencase $vendor in
1888a3167c07Ssthen	unknown)
1889a3167c07Ssthen		case $cpu-$os in
1890a3167c07Ssthen			*-riscix*)
1891933707f3Ssthen				vendor=acorn
1892933707f3Ssthen				;;
1893a3167c07Ssthen			*-sunos*)
1894933707f3Ssthen				vendor=sun
1895933707f3Ssthen				;;
1896a3167c07Ssthen			*-cnk* | *-aix*)
1897933707f3Ssthen				vendor=ibm
1898933707f3Ssthen				;;
1899a3167c07Ssthen			*-beos*)
1900933707f3Ssthen				vendor=be
1901933707f3Ssthen				;;
1902a3167c07Ssthen			*-hpux*)
1903933707f3Ssthen				vendor=hp
1904933707f3Ssthen				;;
1905a3167c07Ssthen			*-mpeix*)
1906933707f3Ssthen				vendor=hp
1907933707f3Ssthen				;;
1908a3167c07Ssthen			*-hiux*)
1909933707f3Ssthen				vendor=hitachi
1910933707f3Ssthen				;;
1911a3167c07Ssthen			*-unos*)
1912933707f3Ssthen				vendor=crds
1913933707f3Ssthen				;;
1914a3167c07Ssthen			*-dgux*)
1915933707f3Ssthen				vendor=dg
1916933707f3Ssthen				;;
1917a3167c07Ssthen			*-luna*)
1918933707f3Ssthen				vendor=omron
1919933707f3Ssthen				;;
1920a3167c07Ssthen			*-genix*)
1921933707f3Ssthen				vendor=ns
1922933707f3Ssthen				;;
1923a3167c07Ssthen			*-clix*)
1924a3167c07Ssthen				vendor=intergraph
1925a3167c07Ssthen				;;
1926a3167c07Ssthen			*-mvs* | *-opened*)
1927933707f3Ssthen				vendor=ibm
1928933707f3Ssthen				;;
1929a3167c07Ssthen			*-os400*)
1930933707f3Ssthen				vendor=ibm
1931933707f3Ssthen				;;
1932a3167c07Ssthen			s390-* | s390x-*)
1933a3167c07Ssthen				vendor=ibm
1934a3167c07Ssthen				;;
1935a3167c07Ssthen			*-ptx*)
1936933707f3Ssthen				vendor=sequent
1937933707f3Ssthen				;;
1938a3167c07Ssthen			*-tpf*)
1939933707f3Ssthen				vendor=ibm
1940933707f3Ssthen				;;
1941a3167c07Ssthen			*-vxsim* | *-vxworks* | *-windiss*)
1942933707f3Ssthen				vendor=wrs
1943933707f3Ssthen				;;
1944a3167c07Ssthen			*-aux*)
1945933707f3Ssthen				vendor=apple
1946933707f3Ssthen				;;
1947a3167c07Ssthen			*-hms*)
1948933707f3Ssthen				vendor=hitachi
1949933707f3Ssthen				;;
1950a3167c07Ssthen			*-mpw* | *-macos*)
1951933707f3Ssthen				vendor=apple
1952933707f3Ssthen				;;
1953a3167c07Ssthen			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
1954933707f3Ssthen				vendor=atari
1955933707f3Ssthen				;;
1956a3167c07Ssthen			*-vos*)
1957933707f3Ssthen				vendor=stratus
1958933707f3Ssthen				;;
1959933707f3Ssthen		esac
1960933707f3Ssthen		;;
1961933707f3Ssthenesac
1962933707f3Ssthen
1963*d896b962Ssthenecho "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
1964933707f3Ssthenexit
1965933707f3Ssthen
1966933707f3Ssthen# Local variables:
1967a3167c07Ssthen# eval: (add-hook 'before-save-hook 'time-stamp)
1968933707f3Ssthen# time-stamp-start: "timestamp='"
1969933707f3Ssthen# time-stamp-format: "%:y-%02m-%02d"
1970933707f3Ssthen# time-stamp-end: "'"
1971933707f3Ssthen# End:
1972