xref: /freebsd/contrib/jemalloc/build-aux/config.sub (revision 4ba91e076ee84101112d8296785098ae31dac35e)
1<<<<<<< HEAD
2#! /bin/sh
3# Configuration validation subroutine script.
4#   Copyright 1992-2021 Free Software Foundation, Inc.
5
6timestamp='2021-01-07'
7
8# This file is free software; you can redistribute it and/or modify it
9# under the terms of the GNU General Public License as published by
10# the Free Software Foundation; either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful, but
14# WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16# General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program; if not, see <https://www.gnu.org/licenses/>.
20#
21# As a special exception to the GNU General Public License, if you
22# distribute this file as part of a program that contains a
23# configuration script generated by Autoconf, you may include it under
24# the same distribution terms that you use for the rest of that
25# program.  This Exception is an additional permission under section 7
26# of the GNU General Public License, version 3 ("GPLv3").
27
28
29# Please send patches to <config-patches@gnu.org>.
30#
31# Configuration subroutine to validate and canonicalize a configuration type.
32# Supply the specified configuration type as an argument.
33# If it is invalid, we print an error message on stderr and exit with code 1.
34# Otherwise, we print the canonical config type on stdout and succeed.
35
36# You can get the latest version of this script from:
37# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
38
39# This file is supposed to be the same for all GNU packages
40# and recognize all the CPU types, system types and aliases
41# that are meaningful with *any* GNU software.
42# Each package is responsible for reporting which valid configurations
43# it does not support.  The user should be able to distinguish
44# a failure to support a valid configuration from a meaningless
45# configuration.
46
47# The goal of this file is to map all the various variations of a given
48# machine specification into a single specification in the form:
49#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
50# or in some cases, the newer four-part form:
51#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
52# It is wrong to echo any other type of specification.
53
54me=$(echo "$0" | sed -e 's,.*/,,')
55
56usage="\
57Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
58
59Canonicalize a configuration name.
60
61Options:
62  -h, --help         print this help, then exit
63  -t, --time-stamp   print date of last modification, then exit
64  -v, --version      print version number, then exit
65
66Report bugs and patches to <config-patches@gnu.org>."
67
68version="\
69GNU config.sub ($timestamp)
70
71Copyright 1992-2021 Free Software Foundation, Inc.
72
73This is free software; see the source for copying conditions.  There is NO
74warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
75
76help="
77Try \`$me --help' for more information."
78
79# Parse command line
80while test $# -gt 0 ; do
81  case $1 in
82    --time-stamp | --time* | -t )
83       echo "$timestamp" ; exit ;;
84    --version | -v )
85       echo "$version" ; exit ;;
86    --help | --h* | -h )
87       echo "$usage"; exit ;;
88    -- )     # Stop option processing
89       shift; break ;;
90    - )	# Use stdin as input.
91       break ;;
92    -* )
93       echo "$me: invalid option $1$help" >&2
94       exit 1 ;;
95
96    *local*)
97       # First pass through any local machine types.
98       echo "$1"
99       exit ;;
100
101    * )
102       break ;;
103  esac
104done
105
106case $# in
107 0) echo "$me: missing argument$help" >&2
108    exit 1;;
109 1) ;;
110 *) echo "$me: too many arguments$help" >&2
111    exit 1;;
112esac
113
114# Split fields of configuration type
115# shellcheck disable=SC2162
116IFS="-" read field1 field2 field3 field4 <<EOF
117$1
118EOF
119
120# Separate into logical components for further validation
121case $1 in
122	*-*-*-*-*)
123		echo Invalid configuration \`"$1"\': more than four components >&2
124		exit 1
125		;;
126	*-*-*-*)
127		basic_machine=$field1-$field2
128		basic_os=$field3-$field4
129		;;
130	*-*-*)
131		# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
132		# parts
133		maybe_os=$field2-$field3
134		case $maybe_os in
135			nto-qnx* | linux-* | uclinux-uclibc* \
136			| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
137			| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
138			| storm-chaos* | os2-emx* | rtmk-nova*)
139				basic_machine=$field1
140				basic_os=$maybe_os
141				;;
142			android-linux)
143				basic_machine=$field1-unknown
144				basic_os=linux-android
145				;;
146			*)
147				basic_machine=$field1-$field2
148				basic_os=$field3
149				;;
150		esac
151		;;
152	*-*)
153		# A lone config we happen to match not fitting any pattern
154		case $field1-$field2 in
155			decstation-3100)
156				basic_machine=mips-dec
157				basic_os=
158				;;
159			*-*)
160				# Second component is usually, but not always the OS
161				case $field2 in
162					# Prevent following clause from handling this valid os
163					sun*os*)
164						basic_machine=$field1
165						basic_os=$field2
166						;;
167					# Manufacturers
168					dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
169					| att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
170					| unicom* | ibm* | next | hp | isi* | apollo | altos* \
171					| convergent* | ncr* | news | 32* | 3600* | 3100* \
172					| hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
173					| ultra | tti* | harris | dolphin | highlevel | gould \
174					| cbm | ns | masscomp | apple | axis | knuth | cray \
175					| microblaze* | sim | cisco \
176					| oki | wec | wrs | winbond)
177						basic_machine=$field1-$field2
178						basic_os=
179						;;
180					*)
181						basic_machine=$field1
182						basic_os=$field2
183						;;
184				esac
185			;;
186		esac
187		;;
188	*)
189		# Convert single-component short-hands not valid as part of
190		# multi-component configurations.
191		case $field1 in
192			386bsd)
193				basic_machine=i386-pc
194				basic_os=bsd
195				;;
196			a29khif)
197				basic_machine=a29k-amd
198				basic_os=udi
199				;;
200			adobe68k)
201				basic_machine=m68010-adobe
202				basic_os=scout
203				;;
204			alliant)
205				basic_machine=fx80-alliant
206				basic_os=
207				;;
208			altos | altos3068)
209				basic_machine=m68k-altos
210				basic_os=
211				;;
212			am29k)
213				basic_machine=a29k-none
214				basic_os=bsd
215				;;
216			amdahl)
217				basic_machine=580-amdahl
218				basic_os=sysv
219				;;
220			amiga)
221				basic_machine=m68k-unknown
222				basic_os=
223				;;
224			amigaos | amigados)
225				basic_machine=m68k-unknown
226				basic_os=amigaos
227				;;
228			amigaunix | amix)
229				basic_machine=m68k-unknown
230				basic_os=sysv4
231				;;
232			apollo68)
233				basic_machine=m68k-apollo
234				basic_os=sysv
235				;;
236			apollo68bsd)
237				basic_machine=m68k-apollo
238				basic_os=bsd
239				;;
240			aros)
241				basic_machine=i386-pc
242				basic_os=aros
243				;;
244			aux)
245				basic_machine=m68k-apple
246				basic_os=aux
247				;;
248			balance)
249				basic_machine=ns32k-sequent
250				basic_os=dynix
251				;;
252			blackfin)
253				basic_machine=bfin-unknown
254				basic_os=linux
255				;;
256			cegcc)
257				basic_machine=arm-unknown
258				basic_os=cegcc
259				;;
260			convex-c1)
261				basic_machine=c1-convex
262				basic_os=bsd
263				;;
264			convex-c2)
265				basic_machine=c2-convex
266				basic_os=bsd
267				;;
268			convex-c32)
269				basic_machine=c32-convex
270				basic_os=bsd
271				;;
272			convex-c34)
273				basic_machine=c34-convex
274				basic_os=bsd
275				;;
276			convex-c38)
277				basic_machine=c38-convex
278				basic_os=bsd
279				;;
280			cray)
281				basic_machine=j90-cray
282				basic_os=unicos
283				;;
284			crds | unos)
285				basic_machine=m68k-crds
286				basic_os=
287				;;
288			da30)
289				basic_machine=m68k-da30
290				basic_os=
291				;;
292			decstation | pmax | pmin | dec3100 | decstatn)
293				basic_machine=mips-dec
294				basic_os=
295				;;
296			delta88)
297				basic_machine=m88k-motorola
298				basic_os=sysv3
299				;;
300			dicos)
301				basic_machine=i686-pc
302				basic_os=dicos
303				;;
304			djgpp)
305				basic_machine=i586-pc
306				basic_os=msdosdjgpp
307				;;
308			ebmon29k)
309				basic_machine=a29k-amd
310				basic_os=ebmon
311				;;
312			es1800 | OSE68k | ose68k | ose | OSE)
313				basic_machine=m68k-ericsson
314				basic_os=ose
315				;;
316			gmicro)
317				basic_machine=tron-gmicro
318				basic_os=sysv
319				;;
320			go32)
321				basic_machine=i386-pc
322				basic_os=go32
323				;;
324			h8300hms)
325				basic_machine=h8300-hitachi
326				basic_os=hms
327				;;
328			h8300xray)
329				basic_machine=h8300-hitachi
330				basic_os=xray
331				;;
332			h8500hms)
333				basic_machine=h8500-hitachi
334				basic_os=hms
335				;;
336			harris)
337				basic_machine=m88k-harris
338				basic_os=sysv3
339				;;
340			hp300 | hp300hpux)
341				basic_machine=m68k-hp
342				basic_os=hpux
343				;;
344			hp300bsd)
345				basic_machine=m68k-hp
346				basic_os=bsd
347				;;
348			hppaosf)
349				basic_machine=hppa1.1-hp
350				basic_os=osf
351				;;
352			hppro)
353				basic_machine=hppa1.1-hp
354				basic_os=proelf
355				;;
356			i386mach)
357				basic_machine=i386-mach
358				basic_os=mach
359				;;
360			isi68 | isi)
361				basic_machine=m68k-isi
362				basic_os=sysv
363				;;
364			m68knommu)
365				basic_machine=m68k-unknown
366				basic_os=linux
367				;;
368			magnum | m3230)
369				basic_machine=mips-mips
370				basic_os=sysv
371				;;
372			merlin)
373				basic_machine=ns32k-utek
374				basic_os=sysv
375				;;
376			mingw64)
377				basic_machine=x86_64-pc
378				basic_os=mingw64
379				;;
380			mingw32)
381				basic_machine=i686-pc
382				basic_os=mingw32
383				;;
384			mingw32ce)
385				basic_machine=arm-unknown
386				basic_os=mingw32ce
387				;;
388			monitor)
389				basic_machine=m68k-rom68k
390				basic_os=coff
391				;;
392			morphos)
393				basic_machine=powerpc-unknown
394				basic_os=morphos
395				;;
396			moxiebox)
397				basic_machine=moxie-unknown
398				basic_os=moxiebox
399				;;
400			msdos)
401				basic_machine=i386-pc
402				basic_os=msdos
403				;;
404			msys)
405				basic_machine=i686-pc
406				basic_os=msys
407				;;
408			mvs)
409				basic_machine=i370-ibm
410				basic_os=mvs
411				;;
412			nacl)
413				basic_machine=le32-unknown
414				basic_os=nacl
415				;;
416			ncr3000)
417				basic_machine=i486-ncr
418				basic_os=sysv4
419				;;
420			netbsd386)
421				basic_machine=i386-pc
422				basic_os=netbsd
423				;;
424			netwinder)
425				basic_machine=armv4l-rebel
426				basic_os=linux
427				;;
428			news | news700 | news800 | news900)
429				basic_machine=m68k-sony
430				basic_os=newsos
431				;;
432			news1000)
433				basic_machine=m68030-sony
434				basic_os=newsos
435				;;
436			necv70)
437				basic_machine=v70-nec
438				basic_os=sysv
439				;;
440			nh3000)
441				basic_machine=m68k-harris
442				basic_os=cxux
443				;;
444			nh[45]000)
445				basic_machine=m88k-harris
446				basic_os=cxux
447				;;
448			nindy960)
449				basic_machine=i960-intel
450				basic_os=nindy
451				;;
452			mon960)
453				basic_machine=i960-intel
454				basic_os=mon960
455				;;
456			nonstopux)
457				basic_machine=mips-compaq
458				basic_os=nonstopux
459				;;
460			os400)
461				basic_machine=powerpc-ibm
462				basic_os=os400
463				;;
464			OSE68000 | ose68000)
465				basic_machine=m68000-ericsson
466				basic_os=ose
467				;;
468			os68k)
469				basic_machine=m68k-none
470				basic_os=os68k
471				;;
472			paragon)
473				basic_machine=i860-intel
474				basic_os=osf
475				;;
476			parisc)
477				basic_machine=hppa-unknown
478				basic_os=linux
479				;;
480			psp)
481				basic_machine=mipsallegrexel-sony
482				basic_os=psp
483				;;
484			pw32)
485				basic_machine=i586-unknown
486				basic_os=pw32
487				;;
488			rdos | rdos64)
489				basic_machine=x86_64-pc
490				basic_os=rdos
491				;;
492			rdos32)
493				basic_machine=i386-pc
494				basic_os=rdos
495				;;
496			rom68k)
497				basic_machine=m68k-rom68k
498				basic_os=coff
499				;;
500			sa29200)
501				basic_machine=a29k-amd
502				basic_os=udi
503				;;
504			sei)
505				basic_machine=mips-sei
506				basic_os=seiux
507				;;
508			sequent)
509				basic_machine=i386-sequent
510				basic_os=
511				;;
512			sps7)
513				basic_machine=m68k-bull
514				basic_os=sysv2
515				;;
516			st2000)
517				basic_machine=m68k-tandem
518				basic_os=
519				;;
520			stratus)
521				basic_machine=i860-stratus
522				basic_os=sysv4
523				;;
524			sun2)
525				basic_machine=m68000-sun
526				basic_os=
527				;;
528			sun2os3)
529				basic_machine=m68000-sun
530				basic_os=sunos3
531				;;
532			sun2os4)
533				basic_machine=m68000-sun
534				basic_os=sunos4
535				;;
536			sun3)
537				basic_machine=m68k-sun
538				basic_os=
539				;;
540			sun3os3)
541				basic_machine=m68k-sun
542				basic_os=sunos3
543				;;
544			sun3os4)
545				basic_machine=m68k-sun
546				basic_os=sunos4
547				;;
548			sun4)
549				basic_machine=sparc-sun
550				basic_os=
551				;;
552			sun4os3)
553				basic_machine=sparc-sun
554				basic_os=sunos3
555				;;
556			sun4os4)
557				basic_machine=sparc-sun
558				basic_os=sunos4
559				;;
560			sun4sol2)
561				basic_machine=sparc-sun
562				basic_os=solaris2
563				;;
564			sun386 | sun386i | roadrunner)
565				basic_machine=i386-sun
566				basic_os=
567				;;
568			sv1)
569				basic_machine=sv1-cray
570				basic_os=unicos
571				;;
572			symmetry)
573				basic_machine=i386-sequent
574				basic_os=dynix
575				;;
576			t3e)
577				basic_machine=alphaev5-cray
578				basic_os=unicos
579				;;
580			t90)
581				basic_machine=t90-cray
582				basic_os=unicos
583				;;
584			toad1)
585				basic_machine=pdp10-xkl
586				basic_os=tops20
587				;;
588			tpf)
589				basic_machine=s390x-ibm
590				basic_os=tpf
591				;;
592			udi29k)
593				basic_machine=a29k-amd
594				basic_os=udi
595				;;
596			ultra3)
597				basic_machine=a29k-nyu
598				basic_os=sym1
599				;;
600			v810 | necv810)
601				basic_machine=v810-nec
602				basic_os=none
603				;;
604			vaxv)
605				basic_machine=vax-dec
606				basic_os=sysv
607				;;
608			vms)
609				basic_machine=vax-dec
610				basic_os=vms
611				;;
612			vsta)
613				basic_machine=i386-pc
614				basic_os=vsta
615				;;
616			vxworks960)
617				basic_machine=i960-wrs
618				basic_os=vxworks
619				;;
620			vxworks68)
621				basic_machine=m68k-wrs
622				basic_os=vxworks
623				;;
624			vxworks29k)
625				basic_machine=a29k-wrs
626				basic_os=vxworks
627				;;
628			xbox)
629				basic_machine=i686-pc
630				basic_os=mingw32
631				;;
632			ymp)
633				basic_machine=ymp-cray
634				basic_os=unicos
635				;;
636			*)
637				basic_machine=$1
638				basic_os=
639				;;
640		esac
641		;;
642esac
643
644# Decode 1-component or ad-hoc basic machines
645case $basic_machine in
646	# Here we handle the default manufacturer of certain CPU types.  It is in
647	# some cases the only manufacturer, in others, it is the most popular.
648	w89k)
649		cpu=hppa1.1
650		vendor=winbond
651		;;
652	op50n)
653		cpu=hppa1.1
654		vendor=oki
655		;;
656	op60c)
657		cpu=hppa1.1
658		vendor=oki
659		;;
660	ibm*)
661		cpu=i370
662		vendor=ibm
663		;;
664	orion105)
665		cpu=clipper
666		vendor=highlevel
667		;;
668	mac | mpw | mac-mpw)
669		cpu=m68k
670		vendor=apple
671		;;
672	pmac | pmac-mpw)
673		cpu=powerpc
674		vendor=apple
675		;;
676
677	# Recognize the various machine names and aliases which stand
678	# for a CPU type and a company and sometimes even an OS.
679	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
680		cpu=m68000
681		vendor=att
682		;;
683	3b*)
684		cpu=we32k
685		vendor=att
686		;;
687	bluegene*)
688		cpu=powerpc
689		vendor=ibm
690		basic_os=cnk
691		;;
692	decsystem10* | dec10*)
693		cpu=pdp10
694		vendor=dec
695		basic_os=tops10
696		;;
697	decsystem20* | dec20*)
698		cpu=pdp10
699		vendor=dec
700		basic_os=tops20
701		;;
702	delta | 3300 | motorola-3300 | motorola-delta \
703	      | 3300-motorola | delta-motorola)
704		cpu=m68k
705		vendor=motorola
706		;;
707	dpx2*)
708		cpu=m68k
709		vendor=bull
710		basic_os=sysv3
711		;;
712	encore | umax | mmax)
713		cpu=ns32k
714		vendor=encore
715		;;
716	elxsi)
717		cpu=elxsi
718		vendor=elxsi
719		basic_os=${basic_os:-bsd}
720		;;
721	fx2800)
722		cpu=i860
723		vendor=alliant
724		;;
725	genix)
726		cpu=ns32k
727		vendor=ns
728		;;
729	h3050r* | hiux*)
730		cpu=hppa1.1
731		vendor=hitachi
732		basic_os=hiuxwe2
733		;;
734	hp3k9[0-9][0-9] | hp9[0-9][0-9])
735		cpu=hppa1.0
736		vendor=hp
737		;;
738	hp9k2[0-9][0-9] | hp9k31[0-9])
739		cpu=m68000
740		vendor=hp
741		;;
742	hp9k3[2-9][0-9])
743		cpu=m68k
744		vendor=hp
745		;;
746	hp9k6[0-9][0-9] | hp6[0-9][0-9])
747		cpu=hppa1.0
748		vendor=hp
749		;;
750	hp9k7[0-79][0-9] | hp7[0-79][0-9])
751		cpu=hppa1.1
752		vendor=hp
753		;;
754	hp9k78[0-9] | hp78[0-9])
755		# FIXME: really hppa2.0-hp
756		cpu=hppa1.1
757		vendor=hp
758		;;
759	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
760		# FIXME: really hppa2.0-hp
761		cpu=hppa1.1
762		vendor=hp
763		;;
764	hp9k8[0-9][13679] | hp8[0-9][13679])
765		cpu=hppa1.1
766		vendor=hp
767		;;
768	hp9k8[0-9][0-9] | hp8[0-9][0-9])
769		cpu=hppa1.0
770		vendor=hp
771		;;
772	i*86v32)
773		cpu=$(echo "$1" | sed -e 's/86.*/86/')
774		vendor=pc
775		basic_os=sysv32
776		;;
777	i*86v4*)
778		cpu=$(echo "$1" | sed -e 's/86.*/86/')
779		vendor=pc
780		basic_os=sysv4
781		;;
782	i*86v)
783		cpu=$(echo "$1" | sed -e 's/86.*/86/')
784		vendor=pc
785		basic_os=sysv
786		;;
787	i*86sol2)
788		cpu=$(echo "$1" | sed -e 's/86.*/86/')
789		vendor=pc
790		basic_os=solaris2
791		;;
792	j90 | j90-cray)
793		cpu=j90
794		vendor=cray
795		basic_os=${basic_os:-unicos}
796		;;
797	iris | iris4d)
798		cpu=mips
799		vendor=sgi
800		case $basic_os in
801		    irix*)
802			;;
803		    *)
804			basic_os=irix4
805			;;
806		esac
807		;;
808	miniframe)
809		cpu=m68000
810		vendor=convergent
811		;;
812	*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
813		cpu=m68k
814		vendor=atari
815		basic_os=mint
816		;;
817	news-3600 | risc-news)
818		cpu=mips
819		vendor=sony
820		basic_os=newsos
821		;;
822	next | m*-next)
823		cpu=m68k
824		vendor=next
825		case $basic_os in
826		    openstep*)
827		        ;;
828		    nextstep*)
829			;;
830		    ns2*)
831		      basic_os=nextstep2
832			;;
833		    *)
834		      basic_os=nextstep3
835			;;
836		esac
837		;;
838	np1)
839		cpu=np1
840		vendor=gould
841		;;
842	op50n-* | op60c-*)
843		cpu=hppa1.1
844		vendor=oki
845		basic_os=proelf
846		;;
847	pa-hitachi)
848		cpu=hppa1.1
849		vendor=hitachi
850		basic_os=hiuxwe2
851		;;
852	pbd)
853		cpu=sparc
854		vendor=tti
855		;;
856	pbb)
857		cpu=m68k
858		vendor=tti
859		;;
860	pc532)
861		cpu=ns32k
862		vendor=pc532
863		;;
864	pn)
865		cpu=pn
866		vendor=gould
867		;;
868	power)
869		cpu=power
870		vendor=ibm
871		;;
872	ps2)
873		cpu=i386
874		vendor=ibm
875		;;
876	rm[46]00)
877		cpu=mips
878		vendor=siemens
879		;;
880	rtpc | rtpc-*)
881		cpu=romp
882		vendor=ibm
883		;;
884	sde)
885		cpu=mipsisa32
886		vendor=sde
887		basic_os=${basic_os:-elf}
888		;;
889	simso-wrs)
890		cpu=sparclite
891		vendor=wrs
892		basic_os=vxworks
893		;;
894	tower | tower-32)
895		cpu=m68k
896		vendor=ncr
897		;;
898	vpp*|vx|vx-*)
899		cpu=f301
900		vendor=fujitsu
901		;;
902	w65)
903		cpu=w65
904		vendor=wdc
905		;;
906	w89k-*)
907		cpu=hppa1.1
908		vendor=winbond
909		basic_os=proelf
910		;;
911	none)
912		cpu=none
913		vendor=none
914		;;
915	leon|leon[3-9])
916		cpu=sparc
917		vendor=$basic_machine
918		;;
919	leon-*|leon[3-9]-*)
920		cpu=sparc
921		vendor=$(echo "$basic_machine" | sed 's/-.*//')
922		;;
923
924	*-*)
925		# shellcheck disable=SC2162
926		IFS="-" read cpu vendor <<EOF
927$basic_machine
928EOF
929		;;
930	# We use `pc' rather than `unknown'
931	# because (1) that's what they normally are, and
932	# (2) the word "unknown" tends to confuse beginning users.
933	i*86 | x86_64)
934		cpu=$basic_machine
935		vendor=pc
936		;;
937	# These rules are duplicated from below for sake of the special case above;
938	# i.e. things that normalized to x86 arches should also default to "pc"
939	pc98)
940		cpu=i386
941		vendor=pc
942		;;
943	x64 | amd64)
944		cpu=x86_64
945		vendor=pc
946		;;
947	# Recognize the basic CPU types without company name.
948	*)
949		cpu=$basic_machine
950		vendor=unknown
951		;;
952esac
953
954unset -v basic_machine
955
956# Decode basic machines in the full and proper CPU-Company form.
957case $cpu-$vendor in
958	# Here we handle the default manufacturer of certain CPU types in canonical form. It is in
959	# some cases the only manufacturer, in others, it is the most popular.
960	craynv-unknown)
961		vendor=cray
962		basic_os=${basic_os:-unicosmp}
963		;;
964	c90-unknown | c90-cray)
965		vendor=cray
966		basic_os=${Basic_os:-unicos}
967		;;
968	fx80-unknown)
969		vendor=alliant
970		;;
971	romp-unknown)
972		vendor=ibm
973		;;
974	mmix-unknown)
975		vendor=knuth
976		;;
977	microblaze-unknown | microblazeel-unknown)
978		vendor=xilinx
979		;;
980	rs6000-unknown)
981		vendor=ibm
982		;;
983	vax-unknown)
984		vendor=dec
985		;;
986	pdp11-unknown)
987		vendor=dec
988		;;
989	we32k-unknown)
990		vendor=att
991		;;
992	cydra-unknown)
993		vendor=cydrome
994		;;
995	i370-ibm*)
996		vendor=ibm
997		;;
998	orion-unknown)
999		vendor=highlevel
1000		;;
1001	xps-unknown | xps100-unknown)
1002		cpu=xps100
1003		vendor=honeywell
1004		;;
1005
1006	# Here we normalize CPU types with a missing or matching vendor
1007	dpx20-unknown | dpx20-bull)
1008		cpu=rs6000
1009		vendor=bull
1010		basic_os=${basic_os:-bosx}
1011		;;
1012
1013	# Here we normalize CPU types irrespective of the vendor
1014	amd64-*)
1015		cpu=x86_64
1016		;;
1017	blackfin-*)
1018		cpu=bfin
1019		basic_os=linux
1020		;;
1021	c54x-*)
1022		cpu=tic54x
1023		;;
1024	c55x-*)
1025		cpu=tic55x
1026		;;
1027	c6x-*)
1028		cpu=tic6x
1029		;;
1030	e500v[12]-*)
1031		cpu=powerpc
1032		basic_os=${basic_os}"spe"
1033		;;
1034	mips3*-*)
1035		cpu=mips64
1036		;;
1037	ms1-*)
1038		cpu=mt
1039		;;
1040	m68knommu-*)
1041		cpu=m68k
1042		basic_os=linux
1043		;;
1044	m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
1045		cpu=s12z
1046		;;
1047	openrisc-*)
1048		cpu=or32
1049		;;
1050	parisc-*)
1051		cpu=hppa
1052		basic_os=linux
1053		;;
1054	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
1055		cpu=i586
1056		;;
1057	pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
1058		cpu=i686
1059		;;
1060	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
1061		cpu=i686
1062		;;
1063	pentium4-*)
1064		cpu=i786
1065		;;
1066	pc98-*)
1067		cpu=i386
1068		;;
1069	ppc-* | ppcbe-*)
1070		cpu=powerpc
1071		;;
1072	ppcle-* | powerpclittle-*)
1073		cpu=powerpcle
1074		;;
1075	ppc64-*)
1076		cpu=powerpc64
1077		;;
1078	ppc64le-* | powerpc64little-*)
1079		cpu=powerpc64le
1080		;;
1081	sb1-*)
1082		cpu=mipsisa64sb1
1083		;;
1084	sb1el-*)
1085		cpu=mipsisa64sb1el
1086		;;
1087	sh5e[lb]-*)
1088		cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/')
1089		;;
1090	spur-*)
1091		cpu=spur
1092		;;
1093	strongarm-* | thumb-*)
1094		cpu=arm
1095		;;
1096	tx39-*)
1097		cpu=mipstx39
1098		;;
1099	tx39el-*)
1100		cpu=mipstx39el
1101		;;
1102	x64-*)
1103		cpu=x86_64
1104		;;
1105	xscale-* | xscalee[bl]-*)
1106		cpu=$(echo "$cpu" | sed 's/^xscale/arm/')
1107		;;
1108	arm64-*)
1109		cpu=aarch64
1110		;;
1111
1112	# Recognize the canonical CPU Types that limit and/or modify the
1113	# company names they are paired with.
1114	cr16-*)
1115		basic_os=${basic_os:-elf}
1116		;;
1117	crisv32-* | etraxfs*-*)
1118		cpu=crisv32
1119		vendor=axis
1120		;;
1121	cris-* | etrax*-*)
1122		cpu=cris
1123		vendor=axis
1124		;;
1125	crx-*)
1126		basic_os=${basic_os:-elf}
1127		;;
1128	neo-tandem)
1129		cpu=neo
1130		vendor=tandem
1131		;;
1132	nse-tandem)
1133		cpu=nse
1134		vendor=tandem
1135		;;
1136	nsr-tandem)
1137		cpu=nsr
1138		vendor=tandem
1139		;;
1140	nsv-tandem)
1141		cpu=nsv
1142		vendor=tandem
1143		;;
1144	nsx-tandem)
1145		cpu=nsx
1146		vendor=tandem
1147		;;
1148	mipsallegrexel-sony)
1149		cpu=mipsallegrexel
1150		vendor=sony
1151		;;
1152	tile*-*)
1153		basic_os=${basic_os:-linux-gnu}
1154		;;
1155
1156	*)
1157		# Recognize the canonical CPU types that are allowed with any
1158		# company name.
1159		case $cpu in
1160			1750a | 580 \
1161			| a29k \
1162			| aarch64 | aarch64_be \
1163			| abacus \
1164			| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
1165			| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
1166			| alphapca5[67] | alpha64pca5[67] \
1167			| am33_2.0 \
1168			| amdgcn \
1169			| arc | arceb \
1170			| arm | arm[lb]e | arme[lb] | armv* \
1171			| avr | avr32 \
1172			| asmjs \
1173			| ba \
1174			| be32 | be64 \
1175			| bfin | bpf | bs2000 \
1176			| c[123]* | c30 | [cjt]90 | c4x \
1177			| c8051 | clipper | craynv | csky | cydra \
1178			| d10v | d30v | dlx | dsp16xx \
1179			| e2k | elxsi | epiphany \
1180			| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
1181			| h8300 | h8500 \
1182			| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
1183			| hexagon \
1184			| i370 | i*86 | i860 | i960 | ia16 | ia64 \
1185			| ip2k | iq2000 \
1186			| k1om \
1187			| le32 | le64 \
1188			| lm32 \
1189			| loongarch32 | loongarch64 | loongarchx32 \
1190			| m32c | m32r | m32rle \
1191			| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
1192			| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
1193			| m88110 | m88k | maxq | mb | mcore | mep | metag \
1194			| microblaze | microblazeel \
1195			| mips | mipsbe | mipseb | mipsel | mipsle \
1196			| mips16 \
1197			| mips64 | mips64eb | mips64el \
1198			| mips64octeon | mips64octeonel \
1199			| mips64orion | mips64orionel \
1200			| mips64r5900 | mips64r5900el \
1201			| mips64vr | mips64vrel \
1202			| mips64vr4100 | mips64vr4100el \
1203			| mips64vr4300 | mips64vr4300el \
1204			| mips64vr5000 | mips64vr5000el \
1205			| mips64vr5900 | mips64vr5900el \
1206			| mipsisa32 | mipsisa32el \
1207			| mipsisa32r2 | mipsisa32r2el \
1208			| mipsisa32r6 | mipsisa32r6el \
1209			| mipsisa64 | mipsisa64el \
1210			| mipsisa64r2 | mipsisa64r2el \
1211			| mipsisa64r6 | mipsisa64r6el \
1212			| mipsisa64sb1 | mipsisa64sb1el \
1213			| mipsisa64sr71k | mipsisa64sr71kel \
1214			| mipsr5900 | mipsr5900el \
1215			| mipstx39 | mipstx39el \
1216			| mmix \
1217			| mn10200 | mn10300 \
1218			| moxie \
1219			| mt \
1220			| msp430 \
1221			| nds32 | nds32le | nds32be \
1222			| nfp \
1223			| nios | nios2 | nios2eb | nios2el \
1224			| none | np1 | ns16k | ns32k | nvptx \
1225			| open8 \
1226			| or1k* \
1227			| or32 \
1228			| orion \
1229			| picochip \
1230			| pdp10 | pdp11 | pj | pjl | pn | power \
1231			| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
1232			| pru \
1233			| pyramid \
1234			| riscv | riscv32 | riscv32be | riscv64 | riscv64be \
1235			| rl78 | romp | rs6000 | rx \
1236			| s390 | s390x \
1237			| score \
1238			| sh | shl \
1239			| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
1240			| sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
1241			| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
1242			| sparclite \
1243			| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
1244			| spu \
1245			| tahoe \
1246			| thumbv7* \
1247			| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
1248			| tron \
1249			| ubicom32 \
1250			| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
1251			| vax \
1252			| visium \
1253			| w65 \
1254			| wasm32 | wasm64 \
1255			| we32k \
1256			| x86 | x86_64 | xc16x | xgate | xps100 \
1257			| xstormy16 | xtensa* \
1258			| ymp \
1259			| z8k | z80)
1260				;;
1261
1262			*)
1263				echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
1264				exit 1
1265				;;
1266		esac
1267		;;
1268esac
1269
1270# Here we canonicalize certain aliases for manufacturers.
1271case $vendor in
1272	digital*)
1273		vendor=dec
1274		;;
1275	commodore*)
1276		vendor=cbm
1277		;;
1278	*)
1279		;;
1280esac
1281
1282# Decode manufacturer-specific aliases for certain operating systems.
1283
1284if test x$basic_os != x
1285then
1286
1287# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
1288# set os.
1289case $basic_os in
1290	gnu/linux*)
1291		kernel=linux
1292		os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
1293		;;
1294	os2-emx)
1295		kernel=os2
1296		os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
1297		;;
1298	nto-qnx*)
1299		kernel=nto
1300		os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
1301		;;
1302	*-*)
1303		# shellcheck disable=SC2162
1304		IFS="-" read kernel os <<EOF
1305$basic_os
1306EOF
1307		;;
1308	# Default OS when just kernel was specified
1309	nto*)
1310		kernel=nto
1311		os=$(echo $basic_os | sed -e 's|nto|qnx|')
1312		;;
1313	linux*)
1314		kernel=linux
1315		os=$(echo $basic_os | sed -e 's|linux|gnu|')
1316		;;
1317	*)
1318		kernel=
1319		os=$basic_os
1320		;;
1321esac
1322
1323# Now, normalize the OS (knowing we just have one component, it's not a kernel,
1324# etc.)
1325case $os in
1326	# First match some system type aliases that might get confused
1327	# with valid system types.
1328	# solaris* is a basic system type, with this one exception.
1329	auroraux)
1330		os=auroraux
1331		;;
1332	bluegene*)
1333		os=cnk
1334		;;
1335	solaris1 | solaris1.*)
1336		os=$(echo $os | sed -e 's|solaris1|sunos4|')
1337		;;
1338	solaris)
1339		os=solaris2
1340		;;
1341	unixware*)
1342		os=sysv4.2uw
1343		;;
1344	# es1800 is here to avoid being matched by es* (a different OS)
1345	es1800*)
1346		os=ose
1347		;;
1348	# Some version numbers need modification
1349	chorusos*)
1350		os=chorusos
1351		;;
1352	isc)
1353		os=isc2.2
1354		;;
1355	sco6)
1356		os=sco5v6
1357		;;
1358	sco5)
1359		os=sco3.2v5
1360		;;
1361	sco4)
1362		os=sco3.2v4
1363		;;
1364	sco3.2.[4-9]*)
1365		os=$(echo $os | sed -e 's/sco3.2./sco3.2v/')
1366		;;
1367	sco*v* | scout)
1368		# Don't match below
1369		;;
1370	sco*)
1371		os=sco3.2v2
1372		;;
1373	psos*)
1374		os=psos
1375		;;
1376	qnx*)
1377		os=qnx
1378		;;
1379	hiux*)
1380		os=hiuxwe2
1381		;;
1382	lynx*178)
1383		os=lynxos178
1384		;;
1385	lynx*5)
1386		os=lynxos5
1387		;;
1388	lynxos*)
1389		# don't get caught up in next wildcard
1390		;;
1391	lynx*)
1392		os=lynxos
1393		;;
1394	mac[0-9]*)
1395		os=$(echo "$os" | sed -e 's|mac|macos|')
1396		;;
1397	opened*)
1398		os=openedition
1399		;;
1400	os400*)
1401		os=os400
1402		;;
1403	sunos5*)
1404		os=$(echo "$os" | sed -e 's|sunos5|solaris2|')
1405		;;
1406	sunos6*)
1407		os=$(echo "$os" | sed -e 's|sunos6|solaris3|')
1408		;;
1409	wince*)
1410		os=wince
1411		;;
1412	utek*)
1413		os=bsd
1414		;;
1415	dynix*)
1416		os=bsd
1417		;;
1418	acis*)
1419		os=aos
1420		;;
1421	atheos*)
1422		os=atheos
1423		;;
1424	syllable*)
1425		os=syllable
1426		;;
1427	386bsd)
1428		os=bsd
1429		;;
1430	ctix* | uts*)
1431		os=sysv
1432		;;
1433	nova*)
1434		os=rtmk-nova
1435		;;
1436	ns2)
1437		os=nextstep2
1438		;;
1439	# Preserve the version number of sinix5.
1440	sinix5.*)
1441		os=$(echo $os | sed -e 's|sinix|sysv|')
1442		;;
1443	sinix*)
1444		os=sysv4
1445		;;
1446	tpf*)
1447		os=tpf
1448		;;
1449	triton*)
1450		os=sysv3
1451		;;
1452	oss*)
1453		os=sysv3
1454		;;
1455	svr4*)
1456		os=sysv4
1457		;;
1458	svr3)
1459		os=sysv3
1460		;;
1461	sysvr4)
1462		os=sysv4
1463		;;
1464	ose*)
1465		os=ose
1466		;;
1467	*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
1468		os=mint
1469		;;
1470	dicos*)
1471		os=dicos
1472		;;
1473	pikeos*)
1474		# Until real need of OS specific support for
1475		# particular features comes up, bare metal
1476		# configurations are quite functional.
1477		case $cpu in
1478		    arm*)
1479			os=eabi
1480			;;
1481		    *)
1482			os=elf
1483			;;
1484		esac
1485		;;
1486	*)
1487		# No normalization, but not necessarily accepted, that comes below.
1488		;;
1489esac
1490
1491else
1492
1493# Here we handle the default operating systems that come with various machines.
1494# The value should be what the vendor currently ships out the door with their
1495# machine or put another way, the most popular os provided with the machine.
1496
1497# Note that if you're going to try to match "-MANUFACTURER" here (say,
1498# "-sun"), then you have to tell the case statement up towards the top
1499# that MANUFACTURER isn't an operating system.  Otherwise, code above
1500# will signal an error saying that MANUFACTURER isn't an operating
1501# system, and we'll never get to this point.
1502
1503kernel=
1504case $cpu-$vendor in
1505	score-*)
1506		os=elf
1507		;;
1508	spu-*)
1509		os=elf
1510		;;
1511	*-acorn)
1512		os=riscix1.2
1513		;;
1514	arm*-rebel)
1515		kernel=linux
1516		os=gnu
1517		;;
1518	arm*-semi)
1519		os=aout
1520		;;
1521	c4x-* | tic4x-*)
1522		os=coff
1523		;;
1524	c8051-*)
1525		os=elf
1526		;;
1527	clipper-intergraph)
1528		os=clix
1529		;;
1530	hexagon-*)
1531		os=elf
1532		;;
1533	tic54x-*)
1534		os=coff
1535		;;
1536	tic55x-*)
1537		os=coff
1538		;;
1539	tic6x-*)
1540		os=coff
1541		;;
1542	# This must come before the *-dec entry.
1543	pdp10-*)
1544		os=tops20
1545		;;
1546	pdp11-*)
1547		os=none
1548		;;
1549	*-dec | vax-*)
1550		os=ultrix4.2
1551		;;
1552	m68*-apollo)
1553		os=domain
1554		;;
1555	i386-sun)
1556		os=sunos4.0.2
1557		;;
1558	m68000-sun)
1559		os=sunos3
1560		;;
1561	m68*-cisco)
1562		os=aout
1563		;;
1564	mep-*)
1565		os=elf
1566		;;
1567	mips*-cisco)
1568		os=elf
1569		;;
1570	mips*-*)
1571		os=elf
1572		;;
1573	or32-*)
1574		os=coff
1575		;;
1576	*-tti)	# must be before sparc entry or we get the wrong os.
1577		os=sysv3
1578		;;
1579	sparc-* | *-sun)
1580		os=sunos4.1.1
1581		;;
1582	pru-*)
1583		os=elf
1584		;;
1585	*-be)
1586		os=beos
1587		;;
1588	*-ibm)
1589		os=aix
1590		;;
1591	*-knuth)
1592		os=mmixware
1593		;;
1594	*-wec)
1595		os=proelf
1596		;;
1597	*-winbond)
1598		os=proelf
1599		;;
1600	*-oki)
1601		os=proelf
1602		;;
1603	*-hp)
1604		os=hpux
1605		;;
1606	*-hitachi)
1607		os=hiux
1608		;;
1609	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
1610		os=sysv
1611		;;
1612	*-cbm)
1613		os=amigaos
1614		;;
1615	*-dg)
1616		os=dgux
1617		;;
1618	*-dolphin)
1619		os=sysv3
1620		;;
1621	m68k-ccur)
1622		os=rtu
1623		;;
1624	m88k-omron*)
1625		os=luna
1626		;;
1627	*-next)
1628		os=nextstep
1629		;;
1630	*-sequent)
1631		os=ptx
1632		;;
1633	*-crds)
1634		os=unos
1635		;;
1636	*-ns)
1637		os=genix
1638		;;
1639	i370-*)
1640		os=mvs
1641		;;
1642	*-gould)
1643		os=sysv
1644		;;
1645	*-highlevel)
1646		os=bsd
1647		;;
1648	*-encore)
1649		os=bsd
1650		;;
1651	*-sgi)
1652		os=irix
1653		;;
1654	*-siemens)
1655		os=sysv4
1656		;;
1657	*-masscomp)
1658		os=rtu
1659		;;
1660	f30[01]-fujitsu | f700-fujitsu)
1661		os=uxpv
1662		;;
1663	*-rom68k)
1664		os=coff
1665		;;
1666	*-*bug)
1667		os=coff
1668		;;
1669	*-apple)
1670		os=macos
1671		;;
1672	*-atari*)
1673		os=mint
1674		;;
1675	*-wrs)
1676		os=vxworks
1677		;;
1678	*)
1679		os=none
1680		;;
1681esac
1682
1683fi
1684
1685# Now, validate our (potentially fixed-up) OS.
1686case $os in
1687	# Sometimes we do "kernel-abi", so those need to count as OSes.
1688	musl* | newlib* | uclibc*)
1689		;;
1690	# Likewise for "kernel-libc"
1691	eabi* | gnueabi*)
1692		;;
1693	# Now accept the basic system types.
1694	# The portable systems comes first.
1695	# Each alternative MUST end in a * to match a version number.
1696	gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
1697	     | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
1698	     | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
1699	     | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
1700	     | hiux* | abug | nacl* | netware* | windows* \
1701	     | os9* | macos* | osx* | ios* \
1702	     | mpw* | magic* | mmixware* | mon960* | lnews* \
1703	     | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
1704	     | aos* | aros* | cloudabi* | sortix* | twizzler* \
1705	     | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
1706	     | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
1707	     | mirbsd* | netbsd* | dicos* | openedition* | ose* \
1708	     | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
1709	     | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
1710	     | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
1711	     | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
1712	     | udi* | lites* | ieee* | go32* | aux* | hcos* \
1713	     | chorusrdb* | cegcc* | glidix* \
1714	     | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
1715	     | midipix* | mingw32* | mingw64* | mint* \
1716	     | uxpv* | beos* | mpeix* | udk* | moxiebox* \
1717	     | interix* | uwin* | mks* | rhapsody* | darwin* \
1718	     | openstep* | oskit* | conix* | pw32* | nonstopux* \
1719	     | storm-chaos* | tops10* | tenex* | tops20* | its* \
1720	     | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
1721	     | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
1722	     | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
1723	     | skyos* | haiku* | rdos* | toppers* | drops* | es* \
1724	     | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
1725	     | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
1726	     | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
1727		;;
1728	# This one is extra strict with allowed versions
1729	sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
1730		# Don't forget version if it is 3.2v4 or newer.
1731		;;
1732	none)
1733		;;
1734	*)
1735		echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
1736		exit 1
1737		;;
1738esac
1739
1740# As a final step for OS-related things, validate the OS-kernel combination
1741# (given a valid OS), if there is a kernel.
1742case $kernel-$os in
1743	linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
1744		;;
1745	uclinux-uclibc* )
1746		;;
1747	-dietlibc* | -newlib* | -musl* | -uclibc* )
1748		# These are just libc implementations, not actual OSes, and thus
1749		# require a kernel.
1750		echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
1751		exit 1
1752		;;
1753	kfreebsd*-gnu* | kopensolaris*-gnu*)
1754		;;
1755	nto-qnx*)
1756		;;
1757	os2-emx)
1758		;;
1759	*-eabi* | *-gnueabi*)
1760		;;
1761	-*)
1762		# Blank kernel with real OS is always fine.
1763		;;
1764	*-*)
1765		echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
1766		exit 1
1767		;;
1768esac
1769
1770# Here we handle the case where we know the os, and the CPU type, but not the
1771# manufacturer.  We pick the logical manufacturer.
1772case $vendor in
1773	unknown)
1774		case $cpu-$os in
1775			*-riscix*)
1776				vendor=acorn
1777				;;
1778			*-sunos*)
1779				vendor=sun
1780				;;
1781			*-cnk* | *-aix*)
1782				vendor=ibm
1783				;;
1784			*-beos*)
1785				vendor=be
1786				;;
1787			*-hpux*)
1788				vendor=hp
1789				;;
1790			*-mpeix*)
1791				vendor=hp
1792				;;
1793			*-hiux*)
1794				vendor=hitachi
1795				;;
1796			*-unos*)
1797				vendor=crds
1798				;;
1799			*-dgux*)
1800				vendor=dg
1801				;;
1802			*-luna*)
1803				vendor=omron
1804				;;
1805			*-genix*)
1806				vendor=ns
1807				;;
1808			*-clix*)
1809				vendor=intergraph
1810				;;
1811			*-mvs* | *-opened*)
1812				vendor=ibm
1813				;;
1814			*-os400*)
1815				vendor=ibm
1816				;;
1817			s390-* | s390x-*)
1818				vendor=ibm
1819				;;
1820			*-ptx*)
1821				vendor=sequent
1822				;;
1823			*-tpf*)
1824				vendor=ibm
1825				;;
1826			*-vxsim* | *-vxworks* | *-windiss*)
1827				vendor=wrs
1828				;;
1829			*-aux*)
1830				vendor=apple
1831				;;
1832			*-hms*)
1833				vendor=hitachi
1834				;;
1835			*-mpw* | *-macos*)
1836				vendor=apple
1837				;;
1838			*-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
1839				vendor=atari
1840				;;
1841			*-vos*)
1842				vendor=stratus
1843				;;
1844		esac
1845		;;
1846esac
1847
1848echo "$cpu-$vendor-${kernel:+$kernel-}$os"
1849exit
1850
1851# Local variables:
1852# eval: (add-hook 'before-save-hook 'time-stamp)
1853# time-stamp-start: "timestamp='"
1854# time-stamp-format: "%:y-%02m-%02d"
1855# time-stamp-end: "'"
1856# End:
1857||||||| dec341af7695
1858=======
1859#! /bin/sh
1860# Configuration validation subroutine script.
1861#   Copyright 1992-2016 Free Software Foundation, Inc.
1862
1863timestamp='2016-11-04'
1864
1865# This file is free software; you can redistribute it and/or modify it
1866# under the terms of the GNU General Public License as published by
1867# the Free Software Foundation; either version 3 of the License, or
1868# (at your option) any later version.
1869#
1870# This program is distributed in the hope that it will be useful, but
1871# WITHOUT ANY WARRANTY; without even the implied warranty of
1872# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1873# General Public License for more details.
1874#
1875# You should have received a copy of the GNU General Public License
1876# along with this program; if not, see <http://www.gnu.org/licenses/>.
1877#
1878# As a special exception to the GNU General Public License, if you
1879# distribute this file as part of a program that contains a
1880# configuration script generated by Autoconf, you may include it under
1881# the same distribution terms that you use for the rest of that
1882# program.  This Exception is an additional permission under section 7
1883# of the GNU General Public License, version 3 ("GPLv3").
1884
1885
1886# Please send patches to <config-patches@gnu.org>.
1887#
1888# Configuration subroutine to validate and canonicalize a configuration type.
1889# Supply the specified configuration type as an argument.
1890# If it is invalid, we print an error message on stderr and exit with code 1.
1891# Otherwise, we print the canonical config type on stdout and succeed.
1892
1893# You can get the latest version of this script from:
1894# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1895
1896# This file is supposed to be the same for all GNU packages
1897# and recognize all the CPU types, system types and aliases
1898# that are meaningful with *any* GNU software.
1899# Each package is responsible for reporting which valid configurations
1900# it does not support.  The user should be able to distinguish
1901# a failure to support a valid configuration from a meaningless
1902# configuration.
1903
1904# The goal of this file is to map all the various variations of a given
1905# machine specification into a single specification in the form:
1906#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
1907# or in some cases, the newer four-part form:
1908#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
1909# It is wrong to echo any other type of specification.
1910
1911me=`echo "$0" | sed -e 's,.*/,,'`
1912
1913usage="\
1914Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
1915
1916Canonicalize a configuration name.
1917
1918Operation modes:
1919  -h, --help         print this help, then exit
1920  -t, --time-stamp   print date of last modification, then exit
1921  -v, --version      print version number, then exit
1922
1923Report bugs and patches to <config-patches@gnu.org>."
1924
1925version="\
1926GNU config.sub ($timestamp)
1927
1928Copyright 1992-2016 Free Software Foundation, Inc.
1929
1930This is free software; see the source for copying conditions.  There is NO
1931warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1932
1933help="
1934Try \`$me --help' for more information."
1935
1936# Parse command line
1937while test $# -gt 0 ; do
1938  case $1 in
1939    --time-stamp | --time* | -t )
1940       echo "$timestamp" ; exit ;;
1941    --version | -v )
1942       echo "$version" ; exit ;;
1943    --help | --h* | -h )
1944       echo "$usage"; exit ;;
1945    -- )     # Stop option processing
1946       shift; break ;;
1947    - )	# Use stdin as input.
1948       break ;;
1949    -* )
1950       echo "$me: invalid option $1$help"
1951       exit 1 ;;
1952
1953    *local*)
1954       # First pass through any local machine types.
1955       echo $1
1956       exit ;;
1957
1958    * )
1959       break ;;
1960  esac
1961done
1962
1963case $# in
1964 0) echo "$me: missing argument$help" >&2
1965    exit 1;;
1966 1) ;;
1967 *) echo "$me: too many arguments$help" >&2
1968    exit 1;;
1969esac
1970
1971# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
1972# Here we must recognize all the valid KERNEL-OS combinations.
1973maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
1974case $maybe_os in
1975  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
1976  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
1977  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
1978  kopensolaris*-gnu* | cloudabi*-eabi* | \
1979  storm-chaos* | os2-emx* | rtmk-nova*)
1980    os=-$maybe_os
1981    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
1982    ;;
1983  android-linux)
1984    os=-linux-android
1985    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
1986    ;;
1987  *)
1988    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
1989    if [ $basic_machine != $1 ]
1990    then os=`echo $1 | sed 's/.*-/-/'`
1991    else os=; fi
1992    ;;
1993esac
1994
1995### Let's recognize common machines as not being operating systems so
1996### that things like config.sub decstation-3100 work.  We also
1997### recognize some manufacturers as not being operating systems, so we
1998### can provide default operating systems below.
1999case $os in
2000	-sun*os*)
2001		# Prevent following clause from handling this invalid input.
2002		;;
2003	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
2004	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
2005	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
2006	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
2007	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
2008	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
2009	-apple | -axis | -knuth | -cray | -microblaze*)
2010		os=
2011		basic_machine=$1
2012		;;
2013	-bluegene*)
2014		os=-cnk
2015		;;
2016	-sim | -cisco | -oki | -wec | -winbond)
2017		os=
2018		basic_machine=$1
2019		;;
2020	-scout)
2021		;;
2022	-wrs)
2023		os=-vxworks
2024		basic_machine=$1
2025		;;
2026	-chorusos*)
2027		os=-chorusos
2028		basic_machine=$1
2029		;;
2030	-chorusrdb)
2031		os=-chorusrdb
2032		basic_machine=$1
2033		;;
2034	-hiux*)
2035		os=-hiuxwe2
2036		;;
2037	-sco6)
2038		os=-sco5v6
2039		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2040		;;
2041	-sco5)
2042		os=-sco3.2v5
2043		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2044		;;
2045	-sco4)
2046		os=-sco3.2v4
2047		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2048		;;
2049	-sco3.2.[4-9]*)
2050		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
2051		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2052		;;
2053	-sco3.2v[4-9]*)
2054		# Don't forget version if it is 3.2v4 or newer.
2055		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2056		;;
2057	-sco5v6*)
2058		# Don't forget version if it is 3.2v4 or newer.
2059		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2060		;;
2061	-sco*)
2062		os=-sco3.2v2
2063		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2064		;;
2065	-udk*)
2066		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2067		;;
2068	-isc)
2069		os=-isc2.2
2070		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2071		;;
2072	-clix*)
2073		basic_machine=clipper-intergraph
2074		;;
2075	-isc*)
2076		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
2077		;;
2078	-lynx*178)
2079		os=-lynxos178
2080		;;
2081	-lynx*5)
2082		os=-lynxos5
2083		;;
2084	-lynx*)
2085		os=-lynxos
2086		;;
2087	-ptx*)
2088		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
2089		;;
2090	-windowsnt*)
2091		os=`echo $os | sed -e 's/windowsnt/winnt/'`
2092		;;
2093	-psos*)
2094		os=-psos
2095		;;
2096	-mint | -mint[0-9]*)
2097		basic_machine=m68k-atari
2098		os=-mint
2099		;;
2100esac
2101
2102# Decode aliases for certain CPU-COMPANY combinations.
2103case $basic_machine in
2104	# Recognize the basic CPU types without company name.
2105	# Some are omitted here because they have special meanings below.
2106	1750a | 580 \
2107	| a29k \
2108	| aarch64 | aarch64_be \
2109	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
2110	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
2111	| am33_2.0 \
2112	| arc | arceb \
2113	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
2114	| avr | avr32 \
2115	| ba \
2116	| be32 | be64 \
2117	| bfin \
2118	| c4x | c8051 | clipper \
2119	| d10v | d30v | dlx | dsp16xx \
2120	| e2k | epiphany \
2121	| fido | fr30 | frv | ft32 \
2122	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
2123	| hexagon \
2124	| i370 | i860 | i960 | ia64 \
2125	| ip2k | iq2000 \
2126	| k1om \
2127	| le32 | le64 \
2128	| lm32 \
2129	| m32c | m32r | m32rle | m68000 | m68k | m88k \
2130	| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
2131	| mips | mipsbe | mipseb | mipsel | mipsle \
2132	| mips16 \
2133	| mips64 | mips64el \
2134	| mips64octeon | mips64octeonel \
2135	| mips64orion | mips64orionel \
2136	| mips64r5900 | mips64r5900el \
2137	| mips64vr | mips64vrel \
2138	| mips64vr4100 | mips64vr4100el \
2139	| mips64vr4300 | mips64vr4300el \
2140	| mips64vr5000 | mips64vr5000el \
2141	| mips64vr5900 | mips64vr5900el \
2142	| mipsisa32 | mipsisa32el \
2143	| mipsisa32r2 | mipsisa32r2el \
2144	| mipsisa32r6 | mipsisa32r6el \
2145	| mipsisa64 | mipsisa64el \
2146	| mipsisa64r2 | mipsisa64r2el \
2147	| mipsisa64r6 | mipsisa64r6el \
2148	| mipsisa64sb1 | mipsisa64sb1el \
2149	| mipsisa64sr71k | mipsisa64sr71kel \
2150	| mipsr5900 | mipsr5900el \
2151	| mipstx39 | mipstx39el \
2152	| mn10200 | mn10300 \
2153	| moxie \
2154	| mt \
2155	| msp430 \
2156	| nds32 | nds32le | nds32be \
2157	| nios | nios2 | nios2eb | nios2el \
2158	| ns16k | ns32k \
2159	| open8 | or1k | or1knd | or32 \
2160	| pdp10 | pdp11 | pj | pjl \
2161	| powerpc | powerpc64 | powerpc64le | powerpcle \
2162	| pru \
2163	| pyramid \
2164	| riscv32 | riscv64 \
2165	| rl78 | rx \
2166	| score \
2167	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
2168	| sh64 | sh64le \
2169	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
2170	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
2171	| spu \
2172	| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
2173	| ubicom32 \
2174	| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
2175	| visium \
2176	| we32k \
2177	| x86 | xc16x | xstormy16 | xtensa \
2178	| z8k | z80)
2179		basic_machine=$basic_machine-unknown
2180		;;
2181	c54x)
2182		basic_machine=tic54x-unknown
2183		;;
2184	c55x)
2185		basic_machine=tic55x-unknown
2186		;;
2187	c6x)
2188		basic_machine=tic6x-unknown
2189		;;
2190	leon|leon[3-9])
2191		basic_machine=sparc-$basic_machine
2192		;;
2193	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
2194		basic_machine=$basic_machine-unknown
2195		os=-none
2196		;;
2197	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
2198		;;
2199	ms1)
2200		basic_machine=mt-unknown
2201		;;
2202
2203	strongarm | thumb | xscale)
2204		basic_machine=arm-unknown
2205		;;
2206	xgate)
2207		basic_machine=$basic_machine-unknown
2208		os=-none
2209		;;
2210	xscaleeb)
2211		basic_machine=armeb-unknown
2212		;;
2213
2214	xscaleel)
2215		basic_machine=armel-unknown
2216		;;
2217
2218	# We use `pc' rather than `unknown'
2219	# because (1) that's what they normally are, and
2220	# (2) the word "unknown" tends to confuse beginning users.
2221	i*86 | x86_64)
2222	  basic_machine=$basic_machine-pc
2223	  ;;
2224	# Object if more than one company name word.
2225	*-*-*)
2226		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
2227		exit 1
2228		;;
2229	# Recognize the basic CPU types with company name.
2230	580-* \
2231	| a29k-* \
2232	| aarch64-* | aarch64_be-* \
2233	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
2234	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
2235	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
2236	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
2237	| avr-* | avr32-* \
2238	| ba-* \
2239	| be32-* | be64-* \
2240	| bfin-* | bs2000-* \
2241	| c[123]* | c30-* | [cjt]90-* | c4x-* \
2242	| c8051-* | clipper-* | craynv-* | cydra-* \
2243	| d10v-* | d30v-* | dlx-* \
2244	| e2k-* | elxsi-* \
2245	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
2246	| h8300-* | h8500-* \
2247	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
2248	| hexagon-* \
2249	| i*86-* | i860-* | i960-* | ia64-* \
2250	| ip2k-* | iq2000-* \
2251	| k1om-* \
2252	| le32-* | le64-* \
2253	| lm32-* \
2254	| m32c-* | m32r-* | m32rle-* \
2255	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
2256	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
2257	| microblaze-* | microblazeel-* \
2258	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
2259	| mips16-* \
2260	| mips64-* | mips64el-* \
2261	| mips64octeon-* | mips64octeonel-* \
2262	| mips64orion-* | mips64orionel-* \
2263	| mips64r5900-* | mips64r5900el-* \
2264	| mips64vr-* | mips64vrel-* \
2265	| mips64vr4100-* | mips64vr4100el-* \
2266	| mips64vr4300-* | mips64vr4300el-* \
2267	| mips64vr5000-* | mips64vr5000el-* \
2268	| mips64vr5900-* | mips64vr5900el-* \
2269	| mipsisa32-* | mipsisa32el-* \
2270	| mipsisa32r2-* | mipsisa32r2el-* \
2271	| mipsisa32r6-* | mipsisa32r6el-* \
2272	| mipsisa64-* | mipsisa64el-* \
2273	| mipsisa64r2-* | mipsisa64r2el-* \
2274	| mipsisa64r6-* | mipsisa64r6el-* \
2275	| mipsisa64sb1-* | mipsisa64sb1el-* \
2276	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
2277	| mipsr5900-* | mipsr5900el-* \
2278	| mipstx39-* | mipstx39el-* \
2279	| mmix-* \
2280	| mt-* \
2281	| msp430-* \
2282	| nds32-* | nds32le-* | nds32be-* \
2283	| nios-* | nios2-* | nios2eb-* | nios2el-* \
2284	| none-* | np1-* | ns16k-* | ns32k-* \
2285	| open8-* \
2286	| or1k*-* \
2287	| orion-* \
2288	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
2289	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
2290	| pru-* \
2291	| pyramid-* \
2292	| riscv32-* | riscv64-* \
2293	| rl78-* | romp-* | rs6000-* | rx-* \
2294	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
2295	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
2296	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
2297	| sparclite-* \
2298	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
2299	| tahoe-* \
2300	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
2301	| tile*-* \
2302	| tron-* \
2303	| ubicom32-* \
2304	| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
2305	| vax-* \
2306	| visium-* \
2307	| we32k-* \
2308	| x86-* | x86_64-* | xc16x-* | xps100-* \
2309	| xstormy16-* | xtensa*-* \
2310	| ymp-* \
2311	| z8k-* | z80-*)
2312		;;
2313	# Recognize the basic CPU types without company name, with glob match.
2314	xtensa*)
2315		basic_machine=$basic_machine-unknown
2316		;;
2317	# Recognize the various machine names and aliases which stand
2318	# for a CPU type and a company and sometimes even an OS.
2319	386bsd)
2320		basic_machine=i386-unknown
2321		os=-bsd
2322		;;
2323	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
2324		basic_machine=m68000-att
2325		;;
2326	3b*)
2327		basic_machine=we32k-att
2328		;;
2329	a29khif)
2330		basic_machine=a29k-amd
2331		os=-udi
2332		;;
2333	abacus)
2334		basic_machine=abacus-unknown
2335		;;
2336	adobe68k)
2337		basic_machine=m68010-adobe
2338		os=-scout
2339		;;
2340	alliant | fx80)
2341		basic_machine=fx80-alliant
2342		;;
2343	altos | altos3068)
2344		basic_machine=m68k-altos
2345		;;
2346	am29k)
2347		basic_machine=a29k-none
2348		os=-bsd
2349		;;
2350	amd64)
2351		basic_machine=x86_64-pc
2352		;;
2353	amd64-*)
2354		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
2355		;;
2356	amdahl)
2357		basic_machine=580-amdahl
2358		os=-sysv
2359		;;
2360	amiga | amiga-*)
2361		basic_machine=m68k-unknown
2362		;;
2363	amigaos | amigados)
2364		basic_machine=m68k-unknown
2365		os=-amigaos
2366		;;
2367	amigaunix | amix)
2368		basic_machine=m68k-unknown
2369		os=-sysv4
2370		;;
2371	apollo68)
2372		basic_machine=m68k-apollo
2373		os=-sysv
2374		;;
2375	apollo68bsd)
2376		basic_machine=m68k-apollo
2377		os=-bsd
2378		;;
2379	aros)
2380		basic_machine=i386-pc
2381		os=-aros
2382		;;
2383	asmjs)
2384		basic_machine=asmjs-unknown
2385		;;
2386	aux)
2387		basic_machine=m68k-apple
2388		os=-aux
2389		;;
2390	balance)
2391		basic_machine=ns32k-sequent
2392		os=-dynix
2393		;;
2394	blackfin)
2395		basic_machine=bfin-unknown
2396		os=-linux
2397		;;
2398	blackfin-*)
2399		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
2400		os=-linux
2401		;;
2402	bluegene*)
2403		basic_machine=powerpc-ibm
2404		os=-cnk
2405		;;
2406	c54x-*)
2407		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
2408		;;
2409	c55x-*)
2410		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
2411		;;
2412	c6x-*)
2413		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
2414		;;
2415	c90)
2416		basic_machine=c90-cray
2417		os=-unicos
2418		;;
2419	cegcc)
2420		basic_machine=arm-unknown
2421		os=-cegcc
2422		;;
2423	convex-c1)
2424		basic_machine=c1-convex
2425		os=-bsd
2426		;;
2427	convex-c2)
2428		basic_machine=c2-convex
2429		os=-bsd
2430		;;
2431	convex-c32)
2432		basic_machine=c32-convex
2433		os=-bsd
2434		;;
2435	convex-c34)
2436		basic_machine=c34-convex
2437		os=-bsd
2438		;;
2439	convex-c38)
2440		basic_machine=c38-convex
2441		os=-bsd
2442		;;
2443	cray | j90)
2444		basic_machine=j90-cray
2445		os=-unicos
2446		;;
2447	craynv)
2448		basic_machine=craynv-cray
2449		os=-unicosmp
2450		;;
2451	cr16 | cr16-*)
2452		basic_machine=cr16-unknown
2453		os=-elf
2454		;;
2455	crds | unos)
2456		basic_machine=m68k-crds
2457		;;
2458	crisv32 | crisv32-* | etraxfs*)
2459		basic_machine=crisv32-axis
2460		;;
2461	cris | cris-* | etrax*)
2462		basic_machine=cris-axis
2463		;;
2464	crx)
2465		basic_machine=crx-unknown
2466		os=-elf
2467		;;
2468	da30 | da30-*)
2469		basic_machine=m68k-da30
2470		;;
2471	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
2472		basic_machine=mips-dec
2473		;;
2474	decsystem10* | dec10*)
2475		basic_machine=pdp10-dec
2476		os=-tops10
2477		;;
2478	decsystem20* | dec20*)
2479		basic_machine=pdp10-dec
2480		os=-tops20
2481		;;
2482	delta | 3300 | motorola-3300 | motorola-delta \
2483	      | 3300-motorola | delta-motorola)
2484		basic_machine=m68k-motorola
2485		;;
2486	delta88)
2487		basic_machine=m88k-motorola
2488		os=-sysv3
2489		;;
2490	dicos)
2491		basic_machine=i686-pc
2492		os=-dicos
2493		;;
2494	djgpp)
2495		basic_machine=i586-pc
2496		os=-msdosdjgpp
2497		;;
2498	dpx20 | dpx20-*)
2499		basic_machine=rs6000-bull
2500		os=-bosx
2501		;;
2502	dpx2* | dpx2*-bull)
2503		basic_machine=m68k-bull
2504		os=-sysv3
2505		;;
2506	e500v[12])
2507		basic_machine=powerpc-unknown
2508		os=$os"spe"
2509		;;
2510	e500v[12]-*)
2511		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
2512		os=$os"spe"
2513		;;
2514	ebmon29k)
2515		basic_machine=a29k-amd
2516		os=-ebmon
2517		;;
2518	elxsi)
2519		basic_machine=elxsi-elxsi
2520		os=-bsd
2521		;;
2522	encore | umax | mmax)
2523		basic_machine=ns32k-encore
2524		;;
2525	es1800 | OSE68k | ose68k | ose | OSE)
2526		basic_machine=m68k-ericsson
2527		os=-ose
2528		;;
2529	fx2800)
2530		basic_machine=i860-alliant
2531		;;
2532	genix)
2533		basic_machine=ns32k-ns
2534		;;
2535	gmicro)
2536		basic_machine=tron-gmicro
2537		os=-sysv
2538		;;
2539	go32)
2540		basic_machine=i386-pc
2541		os=-go32
2542		;;
2543	h3050r* | hiux*)
2544		basic_machine=hppa1.1-hitachi
2545		os=-hiuxwe2
2546		;;
2547	h8300hms)
2548		basic_machine=h8300-hitachi
2549		os=-hms
2550		;;
2551	h8300xray)
2552		basic_machine=h8300-hitachi
2553		os=-xray
2554		;;
2555	h8500hms)
2556		basic_machine=h8500-hitachi
2557		os=-hms
2558		;;
2559	harris)
2560		basic_machine=m88k-harris
2561		os=-sysv3
2562		;;
2563	hp300-*)
2564		basic_machine=m68k-hp
2565		;;
2566	hp300bsd)
2567		basic_machine=m68k-hp
2568		os=-bsd
2569		;;
2570	hp300hpux)
2571		basic_machine=m68k-hp
2572		os=-hpux
2573		;;
2574	hp3k9[0-9][0-9] | hp9[0-9][0-9])
2575		basic_machine=hppa1.0-hp
2576		;;
2577	hp9k2[0-9][0-9] | hp9k31[0-9])
2578		basic_machine=m68000-hp
2579		;;
2580	hp9k3[2-9][0-9])
2581		basic_machine=m68k-hp
2582		;;
2583	hp9k6[0-9][0-9] | hp6[0-9][0-9])
2584		basic_machine=hppa1.0-hp
2585		;;
2586	hp9k7[0-79][0-9] | hp7[0-79][0-9])
2587		basic_machine=hppa1.1-hp
2588		;;
2589	hp9k78[0-9] | hp78[0-9])
2590		# FIXME: really hppa2.0-hp
2591		basic_machine=hppa1.1-hp
2592		;;
2593	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
2594		# FIXME: really hppa2.0-hp
2595		basic_machine=hppa1.1-hp
2596		;;
2597	hp9k8[0-9][13679] | hp8[0-9][13679])
2598		basic_machine=hppa1.1-hp
2599		;;
2600	hp9k8[0-9][0-9] | hp8[0-9][0-9])
2601		basic_machine=hppa1.0-hp
2602		;;
2603	hppa-next)
2604		os=-nextstep3
2605		;;
2606	hppaosf)
2607		basic_machine=hppa1.1-hp
2608		os=-osf
2609		;;
2610	hppro)
2611		basic_machine=hppa1.1-hp
2612		os=-proelf
2613		;;
2614	i370-ibm* | ibm*)
2615		basic_machine=i370-ibm
2616		;;
2617	i*86v32)
2618		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2619		os=-sysv32
2620		;;
2621	i*86v4*)
2622		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2623		os=-sysv4
2624		;;
2625	i*86v)
2626		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2627		os=-sysv
2628		;;
2629	i*86sol2)
2630		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
2631		os=-solaris2
2632		;;
2633	i386mach)
2634		basic_machine=i386-mach
2635		os=-mach
2636		;;
2637	i386-vsta | vsta)
2638		basic_machine=i386-unknown
2639		os=-vsta
2640		;;
2641	iris | iris4d)
2642		basic_machine=mips-sgi
2643		case $os in
2644		    -irix*)
2645			;;
2646		    *)
2647			os=-irix4
2648			;;
2649		esac
2650		;;
2651	isi68 | isi)
2652		basic_machine=m68k-isi
2653		os=-sysv
2654		;;
2655	leon-*|leon[3-9]-*)
2656		basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
2657		;;
2658	m68knommu)
2659		basic_machine=m68k-unknown
2660		os=-linux
2661		;;
2662	m68knommu-*)
2663		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
2664		os=-linux
2665		;;
2666	m88k-omron*)
2667		basic_machine=m88k-omron
2668		;;
2669	magnum | m3230)
2670		basic_machine=mips-mips
2671		os=-sysv
2672		;;
2673	merlin)
2674		basic_machine=ns32k-utek
2675		os=-sysv
2676		;;
2677	microblaze*)
2678		basic_machine=microblaze-xilinx
2679		;;
2680	mingw64)
2681		basic_machine=x86_64-pc
2682		os=-mingw64
2683		;;
2684	mingw32)
2685		basic_machine=i686-pc
2686		os=-mingw32
2687		;;
2688	mingw32ce)
2689		basic_machine=arm-unknown
2690		os=-mingw32ce
2691		;;
2692	miniframe)
2693		basic_machine=m68000-convergent
2694		;;
2695	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
2696		basic_machine=m68k-atari
2697		os=-mint
2698		;;
2699	mips3*-*)
2700		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
2701		;;
2702	mips3*)
2703		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
2704		;;
2705	monitor)
2706		basic_machine=m68k-rom68k
2707		os=-coff
2708		;;
2709	morphos)
2710		basic_machine=powerpc-unknown
2711		os=-morphos
2712		;;
2713	moxiebox)
2714		basic_machine=moxie-unknown
2715		os=-moxiebox
2716		;;
2717	msdos)
2718		basic_machine=i386-pc
2719		os=-msdos
2720		;;
2721	ms1-*)
2722		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
2723		;;
2724	msys)
2725		basic_machine=i686-pc
2726		os=-msys
2727		;;
2728	mvs)
2729		basic_machine=i370-ibm
2730		os=-mvs
2731		;;
2732	nacl)
2733		basic_machine=le32-unknown
2734		os=-nacl
2735		;;
2736	ncr3000)
2737		basic_machine=i486-ncr
2738		os=-sysv4
2739		;;
2740	netbsd386)
2741		basic_machine=i386-unknown
2742		os=-netbsd
2743		;;
2744	netwinder)
2745		basic_machine=armv4l-rebel
2746		os=-linux
2747		;;
2748	news | news700 | news800 | news900)
2749		basic_machine=m68k-sony
2750		os=-newsos
2751		;;
2752	news1000)
2753		basic_machine=m68030-sony
2754		os=-newsos
2755		;;
2756	news-3600 | risc-news)
2757		basic_machine=mips-sony
2758		os=-newsos
2759		;;
2760	necv70)
2761		basic_machine=v70-nec
2762		os=-sysv
2763		;;
2764	next | m*-next )
2765		basic_machine=m68k-next
2766		case $os in
2767		    -nextstep* )
2768			;;
2769		    -ns2*)
2770		      os=-nextstep2
2771			;;
2772		    *)
2773		      os=-nextstep3
2774			;;
2775		esac
2776		;;
2777	nh3000)
2778		basic_machine=m68k-harris
2779		os=-cxux
2780		;;
2781	nh[45]000)
2782		basic_machine=m88k-harris
2783		os=-cxux
2784		;;
2785	nindy960)
2786		basic_machine=i960-intel
2787		os=-nindy
2788		;;
2789	mon960)
2790		basic_machine=i960-intel
2791		os=-mon960
2792		;;
2793	nonstopux)
2794		basic_machine=mips-compaq
2795		os=-nonstopux
2796		;;
2797	np1)
2798		basic_machine=np1-gould
2799		;;
2800	neo-tandem)
2801		basic_machine=neo-tandem
2802		;;
2803	nse-tandem)
2804		basic_machine=nse-tandem
2805		;;
2806	nsr-tandem)
2807		basic_machine=nsr-tandem
2808		;;
2809	op50n-* | op60c-*)
2810		basic_machine=hppa1.1-oki
2811		os=-proelf
2812		;;
2813	openrisc | openrisc-*)
2814		basic_machine=or32-unknown
2815		;;
2816	os400)
2817		basic_machine=powerpc-ibm
2818		os=-os400
2819		;;
2820	OSE68000 | ose68000)
2821		basic_machine=m68000-ericsson
2822		os=-ose
2823		;;
2824	os68k)
2825		basic_machine=m68k-none
2826		os=-os68k
2827		;;
2828	pa-hitachi)
2829		basic_machine=hppa1.1-hitachi
2830		os=-hiuxwe2
2831		;;
2832	paragon)
2833		basic_machine=i860-intel
2834		os=-osf
2835		;;
2836	parisc)
2837		basic_machine=hppa-unknown
2838		os=-linux
2839		;;
2840	parisc-*)
2841		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
2842		os=-linux
2843		;;
2844	pbd)
2845		basic_machine=sparc-tti
2846		;;
2847	pbb)
2848		basic_machine=m68k-tti
2849		;;
2850	pc532 | pc532-*)
2851		basic_machine=ns32k-pc532
2852		;;
2853	pc98)
2854		basic_machine=i386-pc
2855		;;
2856	pc98-*)
2857		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
2858		;;
2859	pentium | p5 | k5 | k6 | nexgen | viac3)
2860		basic_machine=i586-pc
2861		;;
2862	pentiumpro | p6 | 6x86 | athlon | athlon_*)
2863		basic_machine=i686-pc
2864		;;
2865	pentiumii | pentium2 | pentiumiii | pentium3)
2866		basic_machine=i686-pc
2867		;;
2868	pentium4)
2869		basic_machine=i786-pc
2870		;;
2871	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
2872		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
2873		;;
2874	pentiumpro-* | p6-* | 6x86-* | athlon-*)
2875		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
2876		;;
2877	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
2878		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
2879		;;
2880	pentium4-*)
2881		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
2882		;;
2883	pn)
2884		basic_machine=pn-gould
2885		;;
2886	power)	basic_machine=power-ibm
2887		;;
2888	ppc | ppcbe)	basic_machine=powerpc-unknown
2889		;;
2890	ppc-* | ppcbe-*)
2891		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
2892		;;
2893	ppcle | powerpclittle)
2894		basic_machine=powerpcle-unknown
2895		;;
2896	ppcle-* | powerpclittle-*)
2897		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
2898		;;
2899	ppc64)	basic_machine=powerpc64-unknown
2900		;;
2901	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
2902		;;
2903	ppc64le | powerpc64little)
2904		basic_machine=powerpc64le-unknown
2905		;;
2906	ppc64le-* | powerpc64little-*)
2907		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
2908		;;
2909	ps2)
2910		basic_machine=i386-ibm
2911		;;
2912	pw32)
2913		basic_machine=i586-unknown
2914		os=-pw32
2915		;;
2916	rdos | rdos64)
2917		basic_machine=x86_64-pc
2918		os=-rdos
2919		;;
2920	rdos32)
2921		basic_machine=i386-pc
2922		os=-rdos
2923		;;
2924	rom68k)
2925		basic_machine=m68k-rom68k
2926		os=-coff
2927		;;
2928	rm[46]00)
2929		basic_machine=mips-siemens
2930		;;
2931	rtpc | rtpc-*)
2932		basic_machine=romp-ibm
2933		;;
2934	s390 | s390-*)
2935		basic_machine=s390-ibm
2936		;;
2937	s390x | s390x-*)
2938		basic_machine=s390x-ibm
2939		;;
2940	sa29200)
2941		basic_machine=a29k-amd
2942		os=-udi
2943		;;
2944	sb1)
2945		basic_machine=mipsisa64sb1-unknown
2946		;;
2947	sb1el)
2948		basic_machine=mipsisa64sb1el-unknown
2949		;;
2950	sde)
2951		basic_machine=mipsisa32-sde
2952		os=-elf
2953		;;
2954	sei)
2955		basic_machine=mips-sei
2956		os=-seiux
2957		;;
2958	sequent)
2959		basic_machine=i386-sequent
2960		;;
2961	sh)
2962		basic_machine=sh-hitachi
2963		os=-hms
2964		;;
2965	sh5el)
2966		basic_machine=sh5le-unknown
2967		;;
2968	sh64)
2969		basic_machine=sh64-unknown
2970		;;
2971	sparclite-wrs | simso-wrs)
2972		basic_machine=sparclite-wrs
2973		os=-vxworks
2974		;;
2975	sps7)
2976		basic_machine=m68k-bull
2977		os=-sysv2
2978		;;
2979	spur)
2980		basic_machine=spur-unknown
2981		;;
2982	st2000)
2983		basic_machine=m68k-tandem
2984		;;
2985	stratus)
2986		basic_machine=i860-stratus
2987		os=-sysv4
2988		;;
2989	strongarm-* | thumb-*)
2990		basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
2991		;;
2992	sun2)
2993		basic_machine=m68000-sun
2994		;;
2995	sun2os3)
2996		basic_machine=m68000-sun
2997		os=-sunos3
2998		;;
2999	sun2os4)
3000		basic_machine=m68000-sun
3001		os=-sunos4
3002		;;
3003	sun3os3)
3004		basic_machine=m68k-sun
3005		os=-sunos3
3006		;;
3007	sun3os4)
3008		basic_machine=m68k-sun
3009		os=-sunos4
3010		;;
3011	sun4os3)
3012		basic_machine=sparc-sun
3013		os=-sunos3
3014		;;
3015	sun4os4)
3016		basic_machine=sparc-sun
3017		os=-sunos4
3018		;;
3019	sun4sol2)
3020		basic_machine=sparc-sun
3021		os=-solaris2
3022		;;
3023	sun3 | sun3-*)
3024		basic_machine=m68k-sun
3025		;;
3026	sun4)
3027		basic_machine=sparc-sun
3028		;;
3029	sun386 | sun386i | roadrunner)
3030		basic_machine=i386-sun
3031		;;
3032	sv1)
3033		basic_machine=sv1-cray
3034		os=-unicos
3035		;;
3036	symmetry)
3037		basic_machine=i386-sequent
3038		os=-dynix
3039		;;
3040	t3e)
3041		basic_machine=alphaev5-cray
3042		os=-unicos
3043		;;
3044	t90)
3045		basic_machine=t90-cray
3046		os=-unicos
3047		;;
3048	tile*)
3049		basic_machine=$basic_machine-unknown
3050		os=-linux-gnu
3051		;;
3052	tx39)
3053		basic_machine=mipstx39-unknown
3054		;;
3055	tx39el)
3056		basic_machine=mipstx39el-unknown
3057		;;
3058	toad1)
3059		basic_machine=pdp10-xkl
3060		os=-tops20
3061		;;
3062	tower | tower-32)
3063		basic_machine=m68k-ncr
3064		;;
3065	tpf)
3066		basic_machine=s390x-ibm
3067		os=-tpf
3068		;;
3069	udi29k)
3070		basic_machine=a29k-amd
3071		os=-udi
3072		;;
3073	ultra3)
3074		basic_machine=a29k-nyu
3075		os=-sym1
3076		;;
3077	v810 | necv810)
3078		basic_machine=v810-nec
3079		os=-none
3080		;;
3081	vaxv)
3082		basic_machine=vax-dec
3083		os=-sysv
3084		;;
3085	vms)
3086		basic_machine=vax-dec
3087		os=-vms
3088		;;
3089	vpp*|vx|vx-*)
3090		basic_machine=f301-fujitsu
3091		;;
3092	vxworks960)
3093		basic_machine=i960-wrs
3094		os=-vxworks
3095		;;
3096	vxworks68)
3097		basic_machine=m68k-wrs
3098		os=-vxworks
3099		;;
3100	vxworks29k)
3101		basic_machine=a29k-wrs
3102		os=-vxworks
3103		;;
3104	w65*)
3105		basic_machine=w65-wdc
3106		os=-none
3107		;;
3108	w89k-*)
3109		basic_machine=hppa1.1-winbond
3110		os=-proelf
3111		;;
3112	xbox)
3113		basic_machine=i686-pc
3114		os=-mingw32
3115		;;
3116	xps | xps100)
3117		basic_machine=xps100-honeywell
3118		;;
3119	xscale-* | xscalee[bl]-*)
3120		basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
3121		;;
3122	ymp)
3123		basic_machine=ymp-cray
3124		os=-unicos
3125		;;
3126	z8k-*-coff)
3127		basic_machine=z8k-unknown
3128		os=-sim
3129		;;
3130	z80-*-coff)
3131		basic_machine=z80-unknown
3132		os=-sim
3133		;;
3134	none)
3135		basic_machine=none-none
3136		os=-none
3137		;;
3138
3139# Here we handle the default manufacturer of certain CPU types.  It is in
3140# some cases the only manufacturer, in others, it is the most popular.
3141	w89k)
3142		basic_machine=hppa1.1-winbond
3143		;;
3144	op50n)
3145		basic_machine=hppa1.1-oki
3146		;;
3147	op60c)
3148		basic_machine=hppa1.1-oki
3149		;;
3150	romp)
3151		basic_machine=romp-ibm
3152		;;
3153	mmix)
3154		basic_machine=mmix-knuth
3155		;;
3156	rs6000)
3157		basic_machine=rs6000-ibm
3158		;;
3159	vax)
3160		basic_machine=vax-dec
3161		;;
3162	pdp10)
3163		# there are many clones, so DEC is not a safe bet
3164		basic_machine=pdp10-unknown
3165		;;
3166	pdp11)
3167		basic_machine=pdp11-dec
3168		;;
3169	we32k)
3170		basic_machine=we32k-att
3171		;;
3172	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
3173		basic_machine=sh-unknown
3174		;;
3175	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
3176		basic_machine=sparc-sun
3177		;;
3178	cydra)
3179		basic_machine=cydra-cydrome
3180		;;
3181	orion)
3182		basic_machine=orion-highlevel
3183		;;
3184	orion105)
3185		basic_machine=clipper-highlevel
3186		;;
3187	mac | mpw | mac-mpw)
3188		basic_machine=m68k-apple
3189		;;
3190	pmac | pmac-mpw)
3191		basic_machine=powerpc-apple
3192		;;
3193	*-unknown)
3194		# Make sure to match an already-canonicalized machine name.
3195		;;
3196	*)
3197		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
3198		exit 1
3199		;;
3200esac
3201
3202# Here we canonicalize certain aliases for manufacturers.
3203case $basic_machine in
3204	*-digital*)
3205		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
3206		;;
3207	*-commodore*)
3208		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
3209		;;
3210	*)
3211		;;
3212esac
3213
3214# Decode manufacturer-specific aliases for certain operating systems.
3215
3216if [ x"$os" != x"" ]
3217then
3218case $os in
3219	# First match some system type aliases
3220	# that might get confused with valid system types.
3221	# -solaris* is a basic system type, with this one exception.
3222	-auroraux)
3223		os=-auroraux
3224		;;
3225	-solaris1 | -solaris1.*)
3226		os=`echo $os | sed -e 's|solaris1|sunos4|'`
3227		;;
3228	-solaris)
3229		os=-solaris2
3230		;;
3231	-svr4*)
3232		os=-sysv4
3233		;;
3234	-unixware*)
3235		os=-sysv4.2uw
3236		;;
3237	-gnu/linux*)
3238		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
3239		;;
3240	# First accept the basic system types.
3241	# The portable systems comes first.
3242	# Each alternative MUST END IN A *, to match a version number.
3243	# -sysv* is not here because it comes later, after sysvr4.
3244	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
3245	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
3246	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
3247	      | -sym* | -kopensolaris* | -plan9* \
3248	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
3249	      | -aos* | -aros* | -cloudabi* | -sortix* \
3250	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
3251	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
3252	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
3253	      | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
3254	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
3255	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
3256	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
3257	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
3258	      | -chorusos* | -chorusrdb* | -cegcc* \
3259	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
3260	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
3261	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
3262	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
3263	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
3264	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
3265	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
3266	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
3267	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
3268	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
3269	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
3270	      | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
3271	# Remember, each alternative MUST END IN *, to match a version number.
3272		;;
3273	-qnx*)
3274		case $basic_machine in
3275		    x86-* | i*86-*)
3276			;;
3277		    *)
3278			os=-nto$os
3279			;;
3280		esac
3281		;;
3282	-nto-qnx*)
3283		;;
3284	-nto*)
3285		os=`echo $os | sed -e 's|nto|nto-qnx|'`
3286		;;
3287	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
3288	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
3289	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
3290		;;
3291	-mac*)
3292		os=`echo $os | sed -e 's|mac|macos|'`
3293		;;
3294	-linux-dietlibc)
3295		os=-linux-dietlibc
3296		;;
3297	-linux*)
3298		os=`echo $os | sed -e 's|linux|linux-gnu|'`
3299		;;
3300	-sunos5*)
3301		os=`echo $os | sed -e 's|sunos5|solaris2|'`
3302		;;
3303	-sunos6*)
3304		os=`echo $os | sed -e 's|sunos6|solaris3|'`
3305		;;
3306	-opened*)
3307		os=-openedition
3308		;;
3309	-os400*)
3310		os=-os400
3311		;;
3312	-wince*)
3313		os=-wince
3314		;;
3315	-osfrose*)
3316		os=-osfrose
3317		;;
3318	-osf*)
3319		os=-osf
3320		;;
3321	-utek*)
3322		os=-bsd
3323		;;
3324	-dynix*)
3325		os=-bsd
3326		;;
3327	-acis*)
3328		os=-aos
3329		;;
3330	-atheos*)
3331		os=-atheos
3332		;;
3333	-syllable*)
3334		os=-syllable
3335		;;
3336	-386bsd)
3337		os=-bsd
3338		;;
3339	-ctix* | -uts*)
3340		os=-sysv
3341		;;
3342	-nova*)
3343		os=-rtmk-nova
3344		;;
3345	-ns2 )
3346		os=-nextstep2
3347		;;
3348	-nsk*)
3349		os=-nsk
3350		;;
3351	# Preserve the version number of sinix5.
3352	-sinix5.*)
3353		os=`echo $os | sed -e 's|sinix|sysv|'`
3354		;;
3355	-sinix*)
3356		os=-sysv4
3357		;;
3358	-tpf*)
3359		os=-tpf
3360		;;
3361	-triton*)
3362		os=-sysv3
3363		;;
3364	-oss*)
3365		os=-sysv3
3366		;;
3367	-svr4)
3368		os=-sysv4
3369		;;
3370	-svr3)
3371		os=-sysv3
3372		;;
3373	-sysvr4)
3374		os=-sysv4
3375		;;
3376	# This must come after -sysvr4.
3377	-sysv*)
3378		;;
3379	-ose*)
3380		os=-ose
3381		;;
3382	-es1800*)
3383		os=-ose
3384		;;
3385	-xenix)
3386		os=-xenix
3387		;;
3388	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
3389		os=-mint
3390		;;
3391	-aros*)
3392		os=-aros
3393		;;
3394	-zvmoe)
3395		os=-zvmoe
3396		;;
3397	-dicos*)
3398		os=-dicos
3399		;;
3400	-nacl*)
3401		;;
3402	-ios)
3403		;;
3404	-none)
3405		;;
3406	*)
3407		# Get rid of the `-' at the beginning of $os.
3408		os=`echo $os | sed 's/[^-]*-//'`
3409		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
3410		exit 1
3411		;;
3412esac
3413else
3414
3415# Here we handle the default operating systems that come with various machines.
3416# The value should be what the vendor currently ships out the door with their
3417# machine or put another way, the most popular os provided with the machine.
3418
3419# Note that if you're going to try to match "-MANUFACTURER" here (say,
3420# "-sun"), then you have to tell the case statement up towards the top
3421# that MANUFACTURER isn't an operating system.  Otherwise, code above
3422# will signal an error saying that MANUFACTURER isn't an operating
3423# system, and we'll never get to this point.
3424
3425case $basic_machine in
3426	score-*)
3427		os=-elf
3428		;;
3429	spu-*)
3430		os=-elf
3431		;;
3432	*-acorn)
3433		os=-riscix1.2
3434		;;
3435	arm*-rebel)
3436		os=-linux
3437		;;
3438	arm*-semi)
3439		os=-aout
3440		;;
3441	c4x-* | tic4x-*)
3442		os=-coff
3443		;;
3444	c8051-*)
3445		os=-elf
3446		;;
3447	hexagon-*)
3448		os=-elf
3449		;;
3450	tic54x-*)
3451		os=-coff
3452		;;
3453	tic55x-*)
3454		os=-coff
3455		;;
3456	tic6x-*)
3457		os=-coff
3458		;;
3459	# This must come before the *-dec entry.
3460	pdp10-*)
3461		os=-tops20
3462		;;
3463	pdp11-*)
3464		os=-none
3465		;;
3466	*-dec | vax-*)
3467		os=-ultrix4.2
3468		;;
3469	m68*-apollo)
3470		os=-domain
3471		;;
3472	i386-sun)
3473		os=-sunos4.0.2
3474		;;
3475	m68000-sun)
3476		os=-sunos3
3477		;;
3478	m68*-cisco)
3479		os=-aout
3480		;;
3481	mep-*)
3482		os=-elf
3483		;;
3484	mips*-cisco)
3485		os=-elf
3486		;;
3487	mips*-*)
3488		os=-elf
3489		;;
3490	or32-*)
3491		os=-coff
3492		;;
3493	*-tti)	# must be before sparc entry or we get the wrong os.
3494		os=-sysv3
3495		;;
3496	sparc-* | *-sun)
3497		os=-sunos4.1.1
3498		;;
3499	*-be)
3500		os=-beos
3501		;;
3502	*-haiku)
3503		os=-haiku
3504		;;
3505	*-ibm)
3506		os=-aix
3507		;;
3508	*-knuth)
3509		os=-mmixware
3510		;;
3511	*-wec)
3512		os=-proelf
3513		;;
3514	*-winbond)
3515		os=-proelf
3516		;;
3517	*-oki)
3518		os=-proelf
3519		;;
3520	*-hp)
3521		os=-hpux
3522		;;
3523	*-hitachi)
3524		os=-hiux
3525		;;
3526	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
3527		os=-sysv
3528		;;
3529	*-cbm)
3530		os=-amigaos
3531		;;
3532	*-dg)
3533		os=-dgux
3534		;;
3535	*-dolphin)
3536		os=-sysv3
3537		;;
3538	m68k-ccur)
3539		os=-rtu
3540		;;
3541	m88k-omron*)
3542		os=-luna
3543		;;
3544	*-next )
3545		os=-nextstep
3546		;;
3547	*-sequent)
3548		os=-ptx
3549		;;
3550	*-crds)
3551		os=-unos
3552		;;
3553	*-ns)
3554		os=-genix
3555		;;
3556	i370-*)
3557		os=-mvs
3558		;;
3559	*-next)
3560		os=-nextstep3
3561		;;
3562	*-gould)
3563		os=-sysv
3564		;;
3565	*-highlevel)
3566		os=-bsd
3567		;;
3568	*-encore)
3569		os=-bsd
3570		;;
3571	*-sgi)
3572		os=-irix
3573		;;
3574	*-siemens)
3575		os=-sysv4
3576		;;
3577	*-masscomp)
3578		os=-rtu
3579		;;
3580	f30[01]-fujitsu | f700-fujitsu)
3581		os=-uxpv
3582		;;
3583	*-rom68k)
3584		os=-coff
3585		;;
3586	*-*bug)
3587		os=-coff
3588		;;
3589	*-apple)
3590		os=-macos
3591		;;
3592	*-atari*)
3593		os=-mint
3594		;;
3595	*)
3596		os=-none
3597		;;
3598esac
3599fi
3600
3601# Here we handle the case where we know the os, and the CPU type, but not the
3602# manufacturer.  We pick the logical manufacturer.
3603vendor=unknown
3604case $basic_machine in
3605	*-unknown)
3606		case $os in
3607			-riscix*)
3608				vendor=acorn
3609				;;
3610			-sunos*)
3611				vendor=sun
3612				;;
3613			-cnk*|-aix*)
3614				vendor=ibm
3615				;;
3616			-beos*)
3617				vendor=be
3618				;;
3619			-hpux*)
3620				vendor=hp
3621				;;
3622			-mpeix*)
3623				vendor=hp
3624				;;
3625			-hiux*)
3626				vendor=hitachi
3627				;;
3628			-unos*)
3629				vendor=crds
3630				;;
3631			-dgux*)
3632				vendor=dg
3633				;;
3634			-luna*)
3635				vendor=omron
3636				;;
3637			-genix*)
3638				vendor=ns
3639				;;
3640			-mvs* | -opened*)
3641				vendor=ibm
3642				;;
3643			-os400*)
3644				vendor=ibm
3645				;;
3646			-ptx*)
3647				vendor=sequent
3648				;;
3649			-tpf*)
3650				vendor=ibm
3651				;;
3652			-vxsim* | -vxworks* | -windiss*)
3653				vendor=wrs
3654				;;
3655			-aux*)
3656				vendor=apple
3657				;;
3658			-hms*)
3659				vendor=hitachi
3660				;;
3661			-mpw* | -macos*)
3662				vendor=apple
3663				;;
3664			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
3665				vendor=atari
3666				;;
3667			-vos*)
3668				vendor=stratus
3669				;;
3670		esac
3671		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
3672		;;
3673esac
3674
3675echo $basic_machine$os
3676exit
3677
3678# Local variables:
3679# eval: (add-hook 'write-file-hooks 'time-stamp)
3680# time-stamp-start: "timestamp='"
3681# time-stamp-format: "%:y-%02m-%02d"
3682# time-stamp-end: "'"
3683# End:
3684>>>>>>> main
3685