• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2# Attempt to guess a canonical system name.
3#   Copyright 1992-2024 Free Software Foundation, Inc.
4
5# shellcheck disable=SC2006,SC2268 # see below for rationale
6
7timestamp='2024-01-01'
8
9# This file is free software; you can redistribute it and/or modify it
10# under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful, but
15# WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with this program; if not, see <https://www.gnu.org/licenses/>.
21#
22# As a special exception to the GNU General Public License, if you
23# distribute this file as part of a program that contains a
24# configuration script generated by Autoconf, you may include it under
25# the same distribution terms that you use for the rest of that
26# program.  This Exception is an additional permission under section 7
27# of the GNU General Public License, version 3 ("GPLv3").
28#
29# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
30#
31# You can get the latest version of this script from:
32# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
33#
34# Please send patches to <config-patches@gnu.org>.
35
36
37# The "shellcheck disable" line above the timestamp inhibits complaints
38# about features and limitations of the classic Bourne shell that were
39# superseded or lifted in POSIX.  However, this script identifies a wide
40# variety of pre-POSIX systems that do not have POSIX shells at all, and
41# even some reasonably current systems (Solaris 10 as case-in-point) still
42# have a pre-POSIX /bin/sh.
43
44
45me=`echo "$0" | sed -e 's,.*/,,'`
46
47usage="\
48Usage: $0 [OPTION]
49
50Output the configuration name of the system '$me' is run on.
51
52Options:
53  -h, --help         print this help, then exit
54  -t, --time-stamp   print date of last modification, then exit
55  -v, --version      print version number, then exit
56
57Report bugs and patches to <config-patches@gnu.org>."
58
59version="\
60GNU config.guess ($timestamp)
61
62Originally written by Per Bothner.
63Copyright 1992-2024 Free Software Foundation, Inc.
64
65This is free software; see the source for copying conditions.  There is NO
66warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
67
68help="
69Try '$me --help' for more information."
70
71# Parse command line
72while test $# -gt 0 ; do
73  case $1 in
74    --time-stamp | --time* | -t )
75       echo "$timestamp" ; exit ;;
76    --version | -v )
77       echo "$version" ; exit ;;
78    --help | --h* | -h )
79       echo "$usage"; exit ;;
80    -- )     # Stop option processing
81       shift; break ;;
82    - )	# Use stdin as input.
83       break ;;
84    -* )
85       echo "$me: invalid option $1$help" >&2
86       exit 1 ;;
87    * )
88       break ;;
89  esac
90done
91
92if test $# != 0; then
93  echo "$me: too many arguments$help" >&2
94  exit 1
95fi
96
97# Just in case it came from the environment.
98GUESS=
99
100# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
101# compiler to aid in system detection is discouraged as it requires
102# temporary files to be created and, as you can see below, it is a
103# headache to deal with in a portable fashion.
104
105# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
106# use 'HOST_CC' if defined, but it is deprecated.
107
108# Portable tmp directory creation inspired by the Autoconf team.
109
110tmp=
111# shellcheck disable=SC2172
112trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
113
114set_cc_for_build() {
115    # prevent multiple calls if $tmp is already set
116    test "$tmp" && return 0
117    : "${TMPDIR=/tmp}"
118    # shellcheck disable=SC2039,SC3028
119    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
120	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
121	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
122	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
123    dummy=$tmp/dummy
124    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
125	,,)    echo "int x;" > "$dummy.c"
126	       for driver in cc gcc c89 c99 ; do
127		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
128		       CC_FOR_BUILD=$driver
129		       break
130		   fi
131	       done
132	       if test x"$CC_FOR_BUILD" = x ; then
133		   CC_FOR_BUILD=no_compiler_found
134	       fi
135	       ;;
136	,,*)   CC_FOR_BUILD=$CC ;;
137	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
138    esac
139}
140
141# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
142# (ghazi@noc.rutgers.edu 1994-08-24)
143if test -f /.attbin/uname ; then
144	PATH=$PATH:/.attbin ; export PATH
145fi
146
147UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
148UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
149UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
150UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
151
152case $UNAME_SYSTEM in
153Linux|GNU|GNU/*)
154	LIBC=unknown
155
156	set_cc_for_build
157	cat <<-EOF > "$dummy.c"
158	#if defined(__ANDROID__)
159	LIBC=android
160	#else
161	#include <features.h>
162	#if defined(__UCLIBC__)
163	LIBC=uclibc
164	#elif defined(__dietlibc__)
165	LIBC=dietlibc
166	#elif defined(__GLIBC__)
167	LIBC=gnu
168	#elif defined(__LLVM_LIBC__)
169	LIBC=llvm
170	#else
171	#include <stdarg.h>
172	/* First heuristic to detect musl libc.  */
173	#ifdef __DEFINED_va_list
174	LIBC=musl
175	#endif
176	#endif
177	#endif
178	EOF
179	cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
180	eval "$cc_set_libc"
181
182	# Second heuristic to detect musl libc.
183	if [ "$LIBC" = unknown ] &&
184	   command -v ldd >/dev/null &&
185	   ldd --version 2>&1 | grep -q ^musl; then
186		LIBC=musl
187	fi
188
189	# If the system lacks a compiler, then just pick glibc.
190	# We could probably try harder.
191	if [ "$LIBC" = unknown ]; then
192		LIBC=gnu
193	fi
194	;;
195esac
196
197case "${UNAME_MACHINE}" in
198  i?86)
199     test -z "$VENDOR" && VENDOR=pc
200     ;;
201  *)
202     test -z "$VENDOR" && VENDOR=unknown
203     ;;
204esac
205test -f /etc/SuSE-release -o -f /.buildenv && VENDOR=suse
206test -f /etc/os-release && grep -q suse /etc/os-release && VENDOR=suse
207
208# Note: order is significant - the case branches are not exclusive.
209
210case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
211    *:NetBSD:*:*)
212	# NetBSD (nbsd) targets should (where applicable) match one or
213	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
214	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
215	# switched to ELF, *-*-netbsd* would select the old
216	# object file format.  This provides both forward
217	# compatibility and a consistent mechanism for selecting the
218	# object file format.
219	#
220	# Note: NetBSD doesn't particularly care about the vendor
221	# portion of the name.  We always set it to "unknown".
222	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
223	    /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
224	    /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
225	    echo unknown)`
226	case $UNAME_MACHINE_ARCH in
227	    aarch64eb) machine=aarch64_be-unknown ;;
228	    armeb) machine=armeb-unknown ;;
229	    arm*) machine=arm-unknown ;;
230	    sh3el) machine=shl-unknown ;;
231	    sh3eb) machine=sh-unknown ;;
232	    sh5el) machine=sh5le-unknown ;;
233	    earmv*)
234		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
235		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
236		machine=${arch}${endian}-unknown
237		;;
238	    *) machine=$UNAME_MACHINE_ARCH-unknown ;;
239	esac
240	# The Operating System including object format, if it has switched
241	# to ELF recently (or will in the future) and ABI.
242	case $UNAME_MACHINE_ARCH in
243	    earm*)
244		os=netbsdelf
245		;;
246	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
247		set_cc_for_build
248		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
249			| grep -q __ELF__
250		then
251		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
252		    # Return netbsd for either.  FIX?
253		    os=netbsd
254		else
255		    os=netbsdelf
256		fi
257		;;
258	    *)
259		os=netbsd
260		;;
261	esac
262	# Determine ABI tags.
263	case $UNAME_MACHINE_ARCH in
264	    earm*)
265		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
266		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
267		;;
268	esac
269	# The OS release
270	# Debian GNU/NetBSD machines have a different userland, and
271	# thus, need a distinct triplet. However, they do not need
272	# kernel version information, so it can be replaced with a
273	# suitable tag, in the style of linux-gnu.
274	case $UNAME_VERSION in
275	    Debian*)
276		release='-gnu'
277		;;
278	    *)
279		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
280		;;
281	esac
282	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
283	# contains redundant information, the shorter form:
284	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
285	GUESS=$machine-${os}${release}${abi-}
286	;;
287    *:Bitrig:*:*)
288	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
289	GUESS=$UNAME_MACHINE_ARCH-${VENDOR}-bitrig$UNAME_RELEASE
290	;;
291    *:OpenBSD:*:*)
292	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
293	GUESS=$UNAME_MACHINE_ARCH-${VENDOR}-openbsd$UNAME_RELEASE
294	;;
295    *:SecBSD:*:*)
296	UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
297	GUESS=$UNAME_MACHINE_ARCH-${VENDOR}-secbsd$UNAME_RELEASE
298	;;
299    *:LibertyBSD:*:*)
300	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
301	GUESS=$UNAME_MACHINE_ARCH-${VENDOR}-libertybsd$UNAME_RELEASE
302	;;
303    *:MidnightBSD:*:*)
304	GUESS=$UNAME_MACHINE-${VENDOR}-midnightbsd$UNAME_RELEASE
305	;;
306    *:ekkoBSD:*:*)
307	GUESS=$UNAME_MACHINE-${VENDOR}-ekkobsd$UNAME_RELEASE
308	;;
309    *:SolidBSD:*:*)
310	GUESS=$UNAME_MACHINE-${VENDOR}-solidbsd$UNAME_RELEASE
311	;;
312    *:OS108:*:*)
313	GUESS=$UNAME_MACHINE-${VENDOR}-os108_$UNAME_RELEASE
314	;;
315    macppc:MirBSD:*:*)
316	GUESS=powerpc-${VENDOR}-mirbsd$UNAME_RELEASE
317	;;
318    *:MirBSD:*:*)
319	GUESS=$UNAME_MACHINE-${VENDOR}-mirbsd$UNAME_RELEASE
320	;;
321    *:Sortix:*:*)
322	GUESS=$UNAME_MACHINE-${VENDOR}-sortix
323	;;
324    *:Twizzler:*:*)
325	GUESS=$UNAME_MACHINE-${VENDOR}-twizzler
326	;;
327    *:Redox:*:*)
328	GUESS=$UNAME_MACHINE-${VENDOR}-redox
329	;;
330    mips:OSF1:*.*)
331	GUESS=mips-dec-osf1
332	;;
333    alpha:OSF1:*:*)
334	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
335	trap '' 0
336	case $UNAME_RELEASE in
337	*4.0)
338		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
339		;;
340	*5.*)
341		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
342		;;
343	esac
344	# According to Compaq, /usr/sbin/psrinfo has been available on
345	# OSF/1 and Tru64 systems produced since 1995.  I hope that
346	# covers most systems running today.  This code pipes the CPU
347	# types through head -n 1, so we only detect the type of CPU 0.
348	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
349	case $ALPHA_CPU_TYPE in
350	    "EV4 (21064)")
351		UNAME_MACHINE=alpha ;;
352	    "EV4.5 (21064)")
353		UNAME_MACHINE=alpha ;;
354	    "LCA4 (21066/21068)")
355		UNAME_MACHINE=alpha ;;
356	    "EV5 (21164)")
357		UNAME_MACHINE=alphaev5 ;;
358	    "EV5.6 (21164A)")
359		UNAME_MACHINE=alphaev56 ;;
360	    "EV5.6 (21164PC)")
361		UNAME_MACHINE=alphapca56 ;;
362	    "EV5.7 (21164PC)")
363		UNAME_MACHINE=alphapca57 ;;
364	    "EV6 (21264)")
365		UNAME_MACHINE=alphaev6 ;;
366	    "EV6.7 (21264A)")
367		UNAME_MACHINE=alphaev67 ;;
368	    "EV6.8CB (21264C)")
369		UNAME_MACHINE=alphaev68 ;;
370	    "EV6.8AL (21264B)")
371		UNAME_MACHINE=alphaev68 ;;
372	    "EV6.8CX (21264D)")
373		UNAME_MACHINE=alphaev68 ;;
374	    "EV6.9A (21264/EV69A)")
375		UNAME_MACHINE=alphaev69 ;;
376	    "EV7 (21364)")
377		UNAME_MACHINE=alphaev7 ;;
378	    "EV7.9 (21364A)")
379		UNAME_MACHINE=alphaev79 ;;
380	esac
381	# A Pn.n version is a patched version.
382	# A Vn.n version is a released version.
383	# A Tn.n version is a released field test version.
384	# A Xn.n version is an unreleased experimental baselevel.
385	# 1.2 uses "1.2" for uname -r.
386	OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
387	GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
388	;;
389    Amiga*:UNIX_System_V:4.0:*)
390	GUESS=m68k-${VENDOR}-sysv4
391	;;
392    *:[Aa]miga[Oo][Ss]:*:*)
393	GUESS=$UNAME_MACHINE-${VENDOR}-amigaos
394	;;
395    *:[Mm]orph[Oo][Ss]:*:*)
396	GUESS=$UNAME_MACHINE-${VENDOR}-morphos
397	;;
398    *:OS/390:*:*)
399	GUESS=i370-ibm-openedition
400	;;
401    *:z/VM:*:*)
402	GUESS=s390-ibm-zvmoe
403	;;
404    *:OS400:*:*)
405	GUESS=powerpc-ibm-os400
406	;;
407    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
408	GUESS=arm-acorn-riscix$UNAME_RELEASE
409	;;
410    arm*:riscos:*:*|arm*:RISCOS:*:*)
411	GUESS=arm-${VENDOR}-riscos
412	;;
413    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
414	GUESS=hppa1.1-hitachi-hiuxmpp
415	;;
416    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
417	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
418	case `(/bin/universe) 2>/dev/null` in
419	    att) GUESS=pyramid-pyramid-sysv3 ;;
420	    *)   GUESS=pyramid-pyramid-bsd   ;;
421	esac
422	;;
423    NILE*:*:*:dcosx)
424	GUESS=pyramid-pyramid-svr4
425	;;
426    DRS?6000:unix:4.0:6*)
427	GUESS=sparc-icl-nx6
428	;;
429    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
430	case `/usr/bin/uname -p` in
431	    sparc) GUESS=sparc-icl-nx7 ;;
432	esac
433	;;
434    s390x:SunOS:*:*)
435	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
436	GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
437	;;
438    sun4H:SunOS:5.*:*)
439	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
440	GUESS=sparc-hal-solaris2$SUN_REL
441	;;
442    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
443	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
444	GUESS=sparc-sun-solaris2$SUN_REL
445	;;
446    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
447	GUESS=i386-pc-auroraux$UNAME_RELEASE
448	;;
449    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
450	set_cc_for_build
451	SUN_ARCH=i386
452	# If there is a compiler, see if it is configured for 64-bit objects.
453	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
454	# This test works for both compilers.
455	if test "$CC_FOR_BUILD" != no_compiler_found; then
456	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
457		(CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
458		grep IS_64BIT_ARCH >/dev/null
459	    then
460		SUN_ARCH=x86_64
461	    fi
462	fi
463	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
464	GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
465	;;
466    sun4*:SunOS:6*:*)
467	# According to config.sub, this is the proper way to canonicalize
468	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
469	# it's likely to be more like Solaris than SunOS4.
470	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
471	GUESS=sparc-sun-solaris3$SUN_REL
472	;;
473    sun4*:SunOS:*:*)
474	case `/usr/bin/arch -k` in
475	    Series*|S4*)
476		UNAME_RELEASE=`uname -v`
477		;;
478	esac
479	# Japanese Language versions have a version number like '4.1.3-JL'.
480	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
481	GUESS=sparc-sun-sunos$SUN_REL
482	;;
483    sun3*:SunOS:*:*)
484	GUESS=m68k-sun-sunos$UNAME_RELEASE
485	;;
486    sun*:*:4.2BSD:*)
487	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
488	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
489	case `/bin/arch` in
490	    sun3)
491		GUESS=m68k-sun-sunos$UNAME_RELEASE
492		;;
493	    sun4)
494		GUESS=sparc-sun-sunos$UNAME_RELEASE
495		;;
496	esac
497	;;
498    aushp:SunOS:*:*)
499	GUESS=sparc-auspex-sunos$UNAME_RELEASE
500	;;
501    # The situation for MiNT is a little confusing.  The machine name
502    # can be virtually everything (everything which is not
503    # "atarist" or "atariste" at least should have a processor
504    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
505    # to the lowercase version "mint" (or "freemint").  Finally
506    # the system name "TOS" denotes a system which is actually not
507    # MiNT.  But MiNT is downward compatible to TOS, so this should
508    # be no problem.
509    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
510	GUESS=m68k-atari-mint$UNAME_RELEASE
511	;;
512    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
513	GUESS=m68k-atari-mint$UNAME_RELEASE
514	;;
515    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
516	GUESS=m68k-atari-mint$UNAME_RELEASE
517	;;
518    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
519	GUESS=m68k-milan-mint$UNAME_RELEASE
520	;;
521    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
522	GUESS=m68k-hades-mint$UNAME_RELEASE
523	;;
524    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
525	GUESS=m68k-${VENDOR}-mint$UNAME_RELEASE
526	;;
527    m68k:machten:*:*)
528	GUESS=m68k-apple-machten$UNAME_RELEASE
529	;;
530    powerpc:machten:*:*)
531	GUESS=powerpc-apple-machten$UNAME_RELEASE
532	;;
533    RISC*:Mach:*:*)
534	GUESS=mips-dec-mach_bsd4.3
535	;;
536    RISC*:ULTRIX:*:*)
537	GUESS=mips-dec-ultrix$UNAME_RELEASE
538	;;
539    VAX*:ULTRIX*:*:*)
540	GUESS=vax-dec-ultrix$UNAME_RELEASE
541	;;
542    2020:CLIX:*:* | 2430:CLIX:*:*)
543	GUESS=clipper-intergraph-clix$UNAME_RELEASE
544	;;
545    mips:*:*:UMIPS | mips:*:*:RISCos)
546	set_cc_for_build
547	sed 's/^	//' << EOF > "$dummy.c"
548#ifdef __cplusplus
549#include <stdio.h>  /* for printf() prototype */
550	int main (int argc, char *argv[]) {
551#else
552	int main (argc, argv) int argc; char *argv[]; {
553#endif
554	#if defined (host_mips) && defined (MIPSEB)
555	#if defined (SYSTYPE_SYSV)
556	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
557	#endif
558	#if defined (SYSTYPE_SVR4)
559	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
560	#endif
561	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
562	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
563	#endif
564	#endif
565	  exit (-1);
566	}
567EOF
568	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
569	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
570	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
571	    { echo "$SYSTEM_NAME"; exit; }
572	GUESS=mips-mips-riscos$UNAME_RELEASE
573	;;
574    Motorola:PowerMAX_OS:*:*)
575	GUESS=powerpc-motorola-powermax
576	;;
577    Motorola:*:4.3:PL8-*)
578	GUESS=powerpc-harris-powermax
579	;;
580    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
581	GUESS=powerpc-harris-powermax
582	;;
583    Night_Hawk:Power_UNIX:*:*)
584	GUESS=powerpc-harris-powerunix
585	;;
586    m88k:CX/UX:7*:*)
587	GUESS=m88k-harris-cxux7
588	;;
589    m88k:*:4*:R4*)
590	GUESS=m88k-motorola-sysv4
591	;;
592    m88k:*:3*:R3*)
593	GUESS=m88k-motorola-sysv3
594	;;
595    AViiON:dgux:*:*)
596	# DG/UX returns AViiON for all architectures
597	UNAME_PROCESSOR=`/usr/bin/uname -p`
598	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
599	then
600	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
601	       test "$TARGET_BINARY_INTERFACE"x = x
602	    then
603		GUESS=m88k-dg-dgux$UNAME_RELEASE
604	    else
605		GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
606	    fi
607	else
608	    GUESS=i586-dg-dgux$UNAME_RELEASE
609	fi
610	;;
611    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
612	GUESS=m88k-dolphin-sysv3
613	;;
614    M88*:*:R3*:*)
615	# Delta 88k system running SVR3
616	GUESS=m88k-motorola-sysv3
617	;;
618    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
619	GUESS=m88k-tektronix-sysv3
620	;;
621    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
622	GUESS=m68k-tektronix-bsd
623	;;
624    *:IRIX*:*:*)
625	IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
626	GUESS=mips-sgi-irix$IRIX_REL
627	;;
628    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
629	GUESS=romp-ibm-aix    # uname -m gives an 8 hex-code CPU id
630	;;                    # Note that: echo "'`uname -s`'" gives 'AIX '
631    i*86:AIX:*:*)
632	GUESS=i386-ibm-aix
633	;;
634    ia64:AIX:*:*)
635	if test -x /usr/bin/oslevel ; then
636		IBM_REV=`/usr/bin/oslevel`
637	else
638		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
639	fi
640	GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
641	;;
642    *:AIX:2:3)
643	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
644		set_cc_for_build
645		sed 's/^		//' << EOF > "$dummy.c"
646		#include <sys/systemcfg.h>
647
648		main()
649			{
650			if (!__power_pc())
651				exit(1);
652			puts("powerpc-ibm-aix3.2.5");
653			exit(0);
654			}
655EOF
656		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
657		then
658			GUESS=$SYSTEM_NAME
659		else
660			GUESS=rs6000-ibm-aix3.2.5
661		fi
662	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
663		GUESS=rs6000-ibm-aix3.2.4
664	else
665		GUESS=rs6000-ibm-aix3.2
666	fi
667	;;
668    *:AIX:*:[4567])
669	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
670	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
671		IBM_ARCH=rs6000
672	else
673		IBM_ARCH=powerpc
674	fi
675	if test -x /usr/bin/lslpp ; then
676		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
677			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
678	else
679		IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
680	fi
681	GUESS=$IBM_ARCH-ibm-aix$IBM_REV
682	;;
683    *:AIX:*:*)
684	GUESS=rs6000-ibm-aix
685	;;
686    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
687	GUESS=romp-ibm-bsd4.4
688	;;
689    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
690	GUESS=romp-ibm-bsd$UNAME_RELEASE    # 4.3 with uname added to
691	;;                                  # report: romp-ibm BSD 4.3
692    *:BOSX:*:*)
693	GUESS=rs6000-bull-bosx
694	;;
695    DPX/2?00:B.O.S.:*:*)
696	GUESS=m68k-bull-sysv3
697	;;
698    9000/[34]??:4.3bsd:1.*:*)
699	GUESS=m68k-hp-bsd
700	;;
701    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
702	GUESS=m68k-hp-bsd4.4
703	;;
704    9000/[34678]??:HP-UX:*:*)
705	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
706	case $UNAME_MACHINE in
707	    9000/31?)            HP_ARCH=m68000 ;;
708	    9000/[34]??)         HP_ARCH=m68k ;;
709	    9000/[678][0-9][0-9])
710		if test -x /usr/bin/getconf; then
711		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
712		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
713		    case $sc_cpu_version in
714		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
715		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
716		      532)                      # CPU_PA_RISC2_0
717			case $sc_kernel_bits in
718			  32) HP_ARCH=hppa2.0n ;;
719			  64) HP_ARCH=hppa2.0w ;;
720			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
721			esac ;;
722		    esac
723		fi
724		if test "$HP_ARCH" = ""; then
725		    set_cc_for_build
726		    sed 's/^		//' << EOF > "$dummy.c"
727
728		#define _HPUX_SOURCE
729		#include <stdlib.h>
730		#include <unistd.h>
731
732		int main ()
733		{
734		#if defined(_SC_KERNEL_BITS)
735		    long bits = sysconf(_SC_KERNEL_BITS);
736		#endif
737		    long cpu  = sysconf (_SC_CPU_VERSION);
738
739		    switch (cpu)
740			{
741			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
742			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
743			case CPU_PA_RISC2_0:
744		#if defined(_SC_KERNEL_BITS)
745			    switch (bits)
746				{
747				case 64: puts ("hppa2.0w"); break;
748				case 32: puts ("hppa2.0n"); break;
749				default: puts ("hppa2.0"); break;
750				} break;
751		#else  /* !defined(_SC_KERNEL_BITS) */
752			    puts ("hppa2.0"); break;
753		#endif
754			default: puts ("hppa1.0"); break;
755			}
756		    exit (0);
757		}
758EOF
759		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
760		    test -z "$HP_ARCH" && HP_ARCH=hppa
761		fi ;;
762	esac
763	if test "$HP_ARCH" = hppa2.0w
764	then
765	    set_cc_for_build
766
767	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
768	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
769	    # generating 64-bit code.  GNU and HP use different nomenclature:
770	    #
771	    # $ CC_FOR_BUILD=cc ./config.guess
772	    # => hppa2.0w-hp-hpux11.23
773	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
774	    # => hppa64-hp-hpux11.23
775
776	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
777		grep -q __LP64__
778	    then
779		HP_ARCH=hppa2.0w
780	    else
781		HP_ARCH=hppa64
782	    fi
783	fi
784	GUESS=$HP_ARCH-hp-hpux$HPUX_REV
785	;;
786    ia64:HP-UX:*:*)
787	HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
788	GUESS=ia64-hp-hpux$HPUX_REV
789	;;
790    3050*:HI-UX:*:*)
791	set_cc_for_build
792	sed 's/^	//' << EOF > "$dummy.c"
793	#include <unistd.h>
794	int
795	main ()
796	{
797	  long cpu = sysconf (_SC_CPU_VERSION);
798	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
799	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
800	     results, however.  */
801	  if (CPU_IS_PA_RISC (cpu))
802	    {
803	      switch (cpu)
804		{
805		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
806		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
807		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
808		  default: puts ("hppa-hitachi-hiuxwe2"); break;
809		}
810	    }
811	  else if (CPU_IS_HP_MC68K (cpu))
812	    puts ("m68k-hitachi-hiuxwe2");
813	  else puts ("unknown-hitachi-hiuxwe2");
814	  exit (0);
815	}
816EOF
817	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
818		{ echo "$SYSTEM_NAME"; exit; }
819	GUESS=unknown-hitachi-hiuxwe2
820	;;
821    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
822	GUESS=hppa1.1-hp-bsd
823	;;
824    9000/8??:4.3bsd:*:*)
825	GUESS=hppa1.0-hp-bsd
826	;;
827    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
828	GUESS=hppa1.0-hp-mpeix
829	;;
830    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
831	GUESS=hppa1.1-hp-osf
832	;;
833    hp8??:OSF1:*:*)
834	GUESS=hppa1.0-hp-osf
835	;;
836    i*86:OSF1:*:*)
837	if test -x /usr/sbin/sysversion ; then
838	    GUESS=$UNAME_MACHINE-${VENDOR}-osf1mk
839	else
840	    GUESS=$UNAME_MACHINE-${VENDOR}-osf1
841	fi
842	;;
843    parisc*:Lites*:*:*)
844	GUESS=hppa1.1-hp-lites
845	;;
846    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
847	GUESS=c1-convex-bsd
848	;;
849    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
850	if getsysinfo -f scalar_acc
851	then echo c32-convex-bsd
852	else echo c2-convex-bsd
853	fi
854	exit ;;
855    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
856	GUESS=c34-convex-bsd
857	;;
858    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
859	GUESS=c38-convex-bsd
860	;;
861    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
862	GUESS=c4-convex-bsd
863	;;
864    CRAY*Y-MP:*:*:*)
865	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
866	GUESS=ymp-cray-unicos$CRAY_REL
867	;;
868    CRAY*[A-Z]90:*:*:*)
869	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
870	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
871	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
872	      -e 's/\.[^.]*$/.X/'
873	exit ;;
874    CRAY*TS:*:*:*)
875	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
876	GUESS=t90-cray-unicos$CRAY_REL
877	;;
878    CRAY*T3E:*:*:*)
879	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
880	GUESS=alphaev5-cray-unicosmk$CRAY_REL
881	;;
882    CRAY*SV1:*:*:*)
883	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
884	GUESS=sv1-cray-unicos$CRAY_REL
885	;;
886    *:UNICOS/mp:*:*)
887	CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
888	GUESS=craynv-cray-unicosmp$CRAY_REL
889	;;
890    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
891	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
892	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
893	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
894	GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
895	;;
896    5000:UNIX_System_V:4.*:*)
897	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
898	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
899	GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
900	;;
901    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
902	GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
903	;;
904    sparc*:BSD/OS:*:*)
905	GUESS=sparc-${VENDOR}-bsdi$UNAME_RELEASE
906	;;
907    *:BSD/OS:*:*)
908	GUESS=$UNAME_MACHINE-${VENDOR}-bsdi$UNAME_RELEASE
909	;;
910    arm:FreeBSD:*:*)
911	UNAME_PROCESSOR=`uname -p`
912	set_cc_for_build
913	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
914	    | grep -q __ARM_PCS_VFP
915	then
916	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
917	    GUESS=$UNAME_PROCESSOR-${VENDOR}-freebsd$FREEBSD_REL-gnueabi
918	else
919	    FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
920	    GUESS=$UNAME_PROCESSOR-${VENDOR}-freebsd$FREEBSD_REL-gnueabihf
921	fi
922	;;
923    *:FreeBSD:*:*)
924	UNAME_PROCESSOR=`uname -p`
925	case $UNAME_PROCESSOR in
926	    amd64)
927		UNAME_PROCESSOR=x86_64 ;;
928	    i386)
929		UNAME_PROCESSOR=i586 ;;
930	esac
931	FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
932	GUESS=$UNAME_PROCESSOR-${VENDOR}-freebsd$FREEBSD_REL
933	;;
934    i*:CYGWIN*:*)
935	GUESS=$UNAME_MACHINE-pc-cygwin
936	;;
937    *:MINGW64*:*)
938	GUESS=$UNAME_MACHINE-pc-mingw64
939	;;
940    *:MINGW*:*)
941	GUESS=$UNAME_MACHINE-pc-mingw32
942	;;
943    *:MSYS*:*)
944	GUESS=$UNAME_MACHINE-pc-msys
945	;;
946    i*:PW*:*)
947	GUESS=$UNAME_MACHINE-pc-pw32
948	;;
949    *:SerenityOS:*:*)
950        GUESS=$UNAME_MACHINE-pc-serenity
951        ;;
952    *:Interix*:*)
953	case $UNAME_MACHINE in
954	    x86)
955		GUESS=i586-pc-interix$UNAME_RELEASE
956		;;
957	    authenticamd | genuineintel | EM64T)
958		GUESS=x86_64-${VENDOR}-interix$UNAME_RELEASE
959		;;
960	    IA64)
961		GUESS=ia64-${VENDOR}-interix$UNAME_RELEASE
962		;;
963	esac ;;
964    i*:UWIN*:*)
965	GUESS=$UNAME_MACHINE-pc-uwin
966	;;
967    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
968	GUESS=x86_64-pc-cygwin
969	;;
970    prep*:SunOS:5.*:*)
971	SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
972	GUESS=powerpcle-${VENDOR}-solaris2$SUN_REL
973	;;
974    *:GNU:*:*)
975	# the GNU system
976	GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
977	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
978	GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
979	;;
980    *:GNU/*:*:*)
981	# other systems with GNU libc and userland
982	GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
983	GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
984	GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
985	;;
986    x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
987	GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
988	;;
989    *:[Mm]anagarm:*:*)
990	GUESS="$UNAME_MACHINE-${VENDOR}-managarm-mlibc"
991	;;
992    *:Minix:*:*)
993	GUESS=$UNAME_MACHINE-${VENDOR}-minix
994	;;
995    aarch64:Linux:*:*)
996	set_cc_for_build
997	CPU=$UNAME_MACHINE
998	LIBCABI=$LIBC
999	if test "$CC_FOR_BUILD" != no_compiler_found; then
1000	    ABI=64
1001	    sed 's/^	    //' << EOF > "$dummy.c"
1002	    #ifdef __ARM_EABI__
1003	    #ifdef __ARM_PCS_VFP
1004	    ABI=eabihf
1005	    #else
1006	    ABI=eabi
1007	    #endif
1008	    #endif
1009EOF
1010	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1011	    eval "$cc_set_abi"
1012	    case $ABI in
1013		eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
1014	    esac
1015	fi
1016	GUESS=$CPU-${VENDOR}-linux-$LIBCABI
1017	;;
1018    aarch64_be:Linux:*:*)
1019	UNAME_MACHINE=aarch64_be
1020	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1021	;;
1022    alpha:Linux:*:*)
1023	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
1024	  EV5)   UNAME_MACHINE=alphaev5 ;;
1025	  EV56)  UNAME_MACHINE=alphaev56 ;;
1026	  PCA56) UNAME_MACHINE=alphapca56 ;;
1027	  PCA57) UNAME_MACHINE=alphapca56 ;;
1028	  EV6)   UNAME_MACHINE=alphaev6 ;;
1029	  EV67)  UNAME_MACHINE=alphaev67 ;;
1030	  EV68*) UNAME_MACHINE=alphaev68 ;;
1031	esac
1032	objdump --private-headers /bin/sh | grep -q ld.so.1
1033	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
1034	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1035	;;
1036    arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
1037	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1038	;;
1039    arm*:Linux:*:*)
1040	set_cc_for_build
1041	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
1042	    | grep -q __ARM_EABI__
1043	then
1044	    GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1045	else
1046	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
1047		| grep -q __ARM_PCS_VFP
1048	    then
1049		GUESS=$UNAME_MACHINE-${VENDOR}-linux-${LIBC}eabi
1050	    else
1051		GUESS=$UNAME_MACHINE-${VENDOR}-linux-${LIBC}eabihf
1052	    fi
1053	fi
1054	;;
1055    avr32*:Linux:*:*)
1056	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1057	;;
1058    cris:Linux:*:*)
1059	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1060	;;
1061    crisv32:Linux:*:*)
1062	GUESS=$UNAME_MACHINE-axis-linux-$LIBC
1063	;;
1064    e2k:Linux:*:*)
1065	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1066	;;
1067    frv:Linux:*:*)
1068	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1069	;;
1070    hexagon:Linux:*:*)
1071	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1072	;;
1073    i*86:Linux:*:*)
1074	GUESS=$UNAME_MACHINE-pc-linux-$LIBC
1075	;;
1076    ia64:Linux:*:*)
1077	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1078	;;
1079    k1om:Linux:*:*)
1080	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1081	;;
1082    kvx:Linux:*:*)
1083	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1084	;;
1085    kvx:cos:*:*)
1086	GUESS=$UNAME_MACHINE-${VENDOR}-cos
1087	;;
1088    kvx:mbr:*:*)
1089	GUESS=$UNAME_MACHINE-${VENDOR}-mbr
1090	;;
1091    loongarch32:Linux:*:* | loongarch64:Linux:*:*)
1092	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1093	;;
1094    m32r*:Linux:*:*)
1095	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1096	;;
1097    m68*:Linux:*:*)
1098	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1099	;;
1100    mips:Linux:*:* | mips64:Linux:*:*)
1101	set_cc_for_build
1102	IS_GLIBC=0
1103	test x"${LIBC}" = xgnu && IS_GLIBC=1
1104	sed 's/^	//' << EOF > "$dummy.c"
1105	#undef CPU
1106	#undef mips
1107	#undef mipsel
1108	#undef mips64
1109	#undef mips64el
1110	#if ${IS_GLIBC} && defined(_ABI64)
1111	LIBCABI=gnuabi64
1112	#else
1113	#if ${IS_GLIBC} && defined(_ABIN32)
1114	LIBCABI=gnuabin32
1115	#else
1116	LIBCABI=${LIBC}
1117	#endif
1118	#endif
1119
1120	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1121	CPU=mipsisa64r6
1122	#else
1123	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1124	CPU=mipsisa32r6
1125	#else
1126	#if defined(__mips64)
1127	CPU=mips64
1128	#else
1129	CPU=mips
1130	#endif
1131	#endif
1132	#endif
1133
1134	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1135	MIPS_ENDIAN=el
1136	#else
1137	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1138	MIPS_ENDIAN=
1139	#else
1140	MIPS_ENDIAN=
1141	#endif
1142	#endif
1143EOF
1144	cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
1145	eval "$cc_set_vars"
1146	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1147	;;
1148    mips64el:Linux:*:*)
1149	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1150	;;
1151    openrisc*:Linux:*:*)
1152	GUESS=or1k-${VENDOR}-linux-$LIBC
1153	;;
1154    or32:Linux:*:* | or1k*:Linux:*:*)
1155	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1156	;;
1157    padre:Linux:*:*)
1158	GUESS=sparc-${VENDOR}-linux-$LIBC
1159	;;
1160    parisc64:Linux:*:* | hppa64:Linux:*:*)
1161	GUESS=hppa64-${VENDOR}-linux-$LIBC
1162	;;
1163    parisc:Linux:*:* | hppa:Linux:*:*)
1164	# Look for CPU level
1165	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1166	  PA7*) GUESS=hppa1.1-${VENDOR}-linux-$LIBC ;;
1167	  PA8*) GUESS=hppa2.0-${VENDOR}-linux-$LIBC ;;
1168	  *)    GUESS=hppa-${VENDOR}-linux-$LIBC ;;
1169	esac
1170	;;
1171    ppc64:Linux:*:*)
1172	GUESS=powerpc64-${VENDOR}-linux-$LIBC
1173	;;
1174    ppc:Linux:*:*)
1175	GUESS=powerpc-${VENDOR}-linux-$LIBC
1176	;;
1177    ppc64le:Linux:*:*)
1178	GUESS=powerpc64le-${VENDOR}-linux-$LIBC
1179	;;
1180    ppcle:Linux:*:*)
1181	GUESS=powerpcle-${VENDOR}-linux-$LIBC
1182	;;
1183    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1184	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1185	;;
1186    s390:Linux:*:* | s390x:Linux:*:*)
1187	GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
1188	;;
1189    sh64*:Linux:*:*)
1190	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1191	;;
1192    sh*:Linux:*:*)
1193	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1194	;;
1195    sparc:Linux:*:* | sparc64:Linux:*:*)
1196	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1197	;;
1198    tile*:Linux:*:*)
1199	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1200	;;
1201    vax:Linux:*:*)
1202	GUESS=$UNAME_MACHINE-dec-linux-$LIBC
1203	;;
1204    x86_64:Linux:*:*)
1205	set_cc_for_build
1206	CPU=$UNAME_MACHINE
1207	LIBCABI=$LIBC
1208	if test "$CC_FOR_BUILD" != no_compiler_found; then
1209	    ABI=64
1210	    sed 's/^	    //' << EOF > "$dummy.c"
1211	    #ifdef __i386__
1212	    ABI=x86
1213	    #else
1214	    #ifdef __ILP32__
1215	    ABI=x32
1216	    #endif
1217	    #endif
1218EOF
1219	    cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
1220	    eval "$cc_set_abi"
1221	    case $ABI in
1222		x86) CPU=i686 ;;
1223		x32) LIBCABI=${LIBC}x32 ;;
1224	    esac
1225	fi
1226	GUESS=$CPU-pc-linux-$LIBCABI
1227	;;
1228    xtensa*:Linux:*:*)
1229	GUESS=$UNAME_MACHINE-${VENDOR}-linux-$LIBC
1230	;;
1231    i*86:DYNIX/ptx:4*:*)
1232	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1233	# earlier versions are messed up and put the nodename in both
1234	# sysname and nodename.
1235	GUESS=i386-sequent-sysv4
1236	;;
1237    i*86:UNIX_SV:4.2MP:2.*)
1238	# Unixware is an offshoot of SVR4, but it has its own version
1239	# number series starting with 2...
1240	# I am not positive that other SVR4 systems won't match this,
1241	# I just have to hope.  -- rms.
1242	# Use sysv4.2uw... so that sysv4* matches it.
1243	GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
1244	;;
1245    i*86:OS/2:*:*)
1246	# If we were able to find 'uname', then EMX Unix compatibility
1247	# is probably installed.
1248	GUESS=$UNAME_MACHINE-pc-os2-emx
1249	;;
1250    i*86:XTS-300:*:STOP)
1251	GUESS=$UNAME_MACHINE-${VENDOR}-stop
1252	;;
1253    i*86:atheos:*:*)
1254	GUESS=$UNAME_MACHINE-${VENDOR}-atheos
1255	;;
1256    i*86:syllable:*:*)
1257	GUESS=$UNAME_MACHINE-pc-syllable
1258	;;
1259    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1260	GUESS=i386-${VENDOR}-lynxos$UNAME_RELEASE
1261	;;
1262    i*86:*DOS:*:*)
1263	GUESS=$UNAME_MACHINE-pc-msdosdjgpp
1264	;;
1265    i*86:*:4.*:*)
1266	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1267	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1268		GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
1269	else
1270		GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
1271	fi
1272	;;
1273    i*86:*:5:[678]*)
1274	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1275	case `/bin/uname -X | grep "^Machine"` in
1276	    *486*)	     UNAME_MACHINE=i486 ;;
1277	    *Pentium)	     UNAME_MACHINE=i586 ;;
1278	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1279	esac
1280	GUESS=$UNAME_MACHINE-${VENDOR}-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1281	;;
1282    i*86:*:3.2:*)
1283	if test -f /usr/options/cb.name; then
1284		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1285		GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL
1286	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1287		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1288		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1289		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1290			&& UNAME_MACHINE=i586
1291		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1292			&& UNAME_MACHINE=i686
1293		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1294			&& UNAME_MACHINE=i686
1295		GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
1296	else
1297		GUESS=$UNAME_MACHINE-pc-sysv32
1298	fi
1299	;;
1300    pc:*:*:*)
1301	# Left here for compatibility:
1302	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1303	# the processor, so we play safe by assuming i586.
1304	# Note: whatever this is, it MUST be the same as what config.sub
1305	# prints for the "djgpp" host, or else GDB configure will decide that
1306	# this is a cross-build.
1307	GUESS=i586-pc-msdosdjgpp
1308	;;
1309    Intel:Mach:3*:*)
1310	GUESS=i386-pc-mach3
1311	;;
1312    paragon:*:*:*)
1313	GUESS=i860-intel-osf1
1314	;;
1315    i860:*:4.*:*) # i860-SVR4
1316	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1317	  GUESS=i860-stardent-sysv$UNAME_RELEASE    # Stardent Vistra i860-SVR4
1318	else # Add other i860-SVR4 vendors below as they are discovered.
1319	  GUESS=i860-${VENDOR}-sysv$UNAME_RELEASE     # Unknown i860-SVR4
1320	fi
1321	;;
1322    mini*:CTIX:SYS*5:*)
1323	# "miniframe"
1324	GUESS=m68010-convergent-sysv
1325	;;
1326    mc68k:UNIX:SYSTEM5:3.51m)
1327	GUESS=m68k-convergent-sysv
1328	;;
1329    M680?0:D-NIX:5.3:*)
1330	GUESS=m68k-diab-dnix
1331	;;
1332    M68*:*:R3V[5678]*:*)
1333	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1334    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
1335	OS_REL=''
1336	test -r /etc/.relid \
1337	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1338	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1339	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1340	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1341	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1342    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1343	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1344	  && { echo i486-ncr-sysv4; exit; } ;;
1345    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1346	OS_REL='.3'
1347	test -r /etc/.relid \
1348	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1349	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1350	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1351	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1352	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1353	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1354	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1355    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1356	GUESS=m68k-${VENDOR}-lynxos$UNAME_RELEASE
1357	;;
1358    mc68030:UNIX_System_V:4.*:*)
1359	GUESS=m68k-atari-sysv4
1360	;;
1361    TSUNAMI:LynxOS:2.*:*)
1362	GUESS=sparc-${VENDOR}-lynxos$UNAME_RELEASE
1363	;;
1364    rs6000:LynxOS:2.*:*)
1365	GUESS=rs6000-${VENDOR}-lynxos$UNAME_RELEASE
1366	;;
1367    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1368	GUESS=powerpc-${VENDOR}-lynxos$UNAME_RELEASE
1369	;;
1370    SM[BE]S:UNIX_SV:*:*)
1371	GUESS=mips-dde-sysv$UNAME_RELEASE
1372	;;
1373    RM*:ReliantUNIX-*:*:*)
1374	GUESS=mips-sni-sysv4
1375	;;
1376    RM*:SINIX-*:*:*)
1377	GUESS=mips-sni-sysv4
1378	;;
1379    *:SINIX-*:*:*)
1380	if uname -p 2>/dev/null >/dev/null ; then
1381		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1382		GUESS=$UNAME_MACHINE-sni-sysv4
1383	else
1384		GUESS=ns32k-sni-sysv
1385	fi
1386	;;
1387    PENTIUM:*:4.0*:*)	# Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
1388			# says <Richard.M.Bartel@ccMail.Census.GOV>
1389	GUESS=i586-unisys-sysv4
1390	;;
1391    *:UNIX_System_V:4*:FTX*)
1392	# From Gerald Hewes <hewes@openmarket.com>.
1393	# How about differentiating between stratus architectures? -djm
1394	GUESS=hppa1.1-stratus-sysv4
1395	;;
1396    *:*:*:FTX*)
1397	# From seanf@swdc.stratus.com.
1398	GUESS=i860-stratus-sysv4
1399	;;
1400    i*86:VOS:*:*)
1401	# From Paul.Green@stratus.com.
1402	GUESS=$UNAME_MACHINE-stratus-vos
1403	;;
1404    *:VOS:*:*)
1405	# From Paul.Green@stratus.com.
1406	GUESS=hppa1.1-stratus-vos
1407	;;
1408    mc68*:A/UX:*:*)
1409	GUESS=m68k-apple-aux$UNAME_RELEASE
1410	;;
1411    news*:NEWS-OS:6*:*)
1412	GUESS=mips-sony-newsos6
1413	;;
1414    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1415	if test -d /usr/nec; then
1416		GUESS=mips-nec-sysv$UNAME_RELEASE
1417	else
1418		GUESS=mips-${VENDOR}-sysv$UNAME_RELEASE
1419	fi
1420	;;
1421    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1422	GUESS=powerpc-be-beos
1423	;;
1424    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1425	GUESS=powerpc-apple-beos
1426	;;
1427    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1428	GUESS=i586-pc-beos
1429	;;
1430    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1431	GUESS=i586-pc-haiku
1432	;;
1433    ppc:Haiku:*:*)	# Haiku running on Apple PowerPC
1434	GUESS=powerpc-apple-haiku
1435	;;
1436    *:Haiku:*:*)	# Haiku modern gcc (not bound by BeOS compat)
1437	GUESS=$UNAME_MACHINE-${VENDOR}-haiku
1438	;;
1439    SX-4:SUPER-UX:*:*)
1440	GUESS=sx4-nec-superux$UNAME_RELEASE
1441	;;
1442    SX-5:SUPER-UX:*:*)
1443	GUESS=sx5-nec-superux$UNAME_RELEASE
1444	;;
1445    SX-6:SUPER-UX:*:*)
1446	GUESS=sx6-nec-superux$UNAME_RELEASE
1447	;;
1448    SX-7:SUPER-UX:*:*)
1449	GUESS=sx7-nec-superux$UNAME_RELEASE
1450	;;
1451    SX-8:SUPER-UX:*:*)
1452	GUESS=sx8-nec-superux$UNAME_RELEASE
1453	;;
1454    SX-8R:SUPER-UX:*:*)
1455	GUESS=sx8r-nec-superux$UNAME_RELEASE
1456	;;
1457    SX-ACE:SUPER-UX:*:*)
1458	GUESS=sxace-nec-superux$UNAME_RELEASE
1459	;;
1460    Power*:Rhapsody:*:*)
1461	GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
1462	;;
1463    *:Rhapsody:*:*)
1464	GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
1465	;;
1466    arm64:Darwin:*:*)
1467	GUESS=aarch64-apple-darwin$UNAME_RELEASE
1468	;;
1469    *:Darwin:*:*)
1470	UNAME_PROCESSOR=`uname -p`
1471	case $UNAME_PROCESSOR in
1472	    unknown) UNAME_PROCESSOR=powerpc ;;
1473	esac
1474	if command -v xcode-select > /dev/null 2> /dev/null && \
1475		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1476	    # Avoid executing cc if there is no toolchain installed as
1477	    # cc will be a stub that puts up a graphical alert
1478	    # prompting the user to install developer tools.
1479	    CC_FOR_BUILD=no_compiler_found
1480	else
1481	    set_cc_for_build
1482	fi
1483	if test "$CC_FOR_BUILD" != no_compiler_found; then
1484	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1485		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1486		   grep IS_64BIT_ARCH >/dev/null
1487	    then
1488		case $UNAME_PROCESSOR in
1489		    i386) UNAME_PROCESSOR=x86_64 ;;
1490		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1491		esac
1492	    fi
1493	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1494	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1495		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1496		   grep IS_PPC >/dev/null
1497	    then
1498		UNAME_PROCESSOR=powerpc
1499	    fi
1500	elif test "$UNAME_PROCESSOR" = i386 ; then
1501	    # uname -m returns i386 or x86_64
1502	    UNAME_PROCESSOR=$UNAME_MACHINE
1503	fi
1504	GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
1505	;;
1506    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1507	UNAME_PROCESSOR=`uname -p`
1508	if test "$UNAME_PROCESSOR" = x86; then
1509		UNAME_PROCESSOR=i386
1510		UNAME_MACHINE=pc
1511	fi
1512	GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
1513	;;
1514    *:QNX:*:4*)
1515	GUESS=i386-pc-qnx
1516	;;
1517    NEO-*:NONSTOP_KERNEL:*:*)
1518	GUESS=neo-tandem-nsk$UNAME_RELEASE
1519	;;
1520    NSE-*:NONSTOP_KERNEL:*:*)
1521	GUESS=nse-tandem-nsk$UNAME_RELEASE
1522	;;
1523    NSR-*:NONSTOP_KERNEL:*:*)
1524	GUESS=nsr-tandem-nsk$UNAME_RELEASE
1525	;;
1526    NSV-*:NONSTOP_KERNEL:*:*)
1527	GUESS=nsv-tandem-nsk$UNAME_RELEASE
1528	;;
1529    NSX-*:NONSTOP_KERNEL:*:*)
1530	GUESS=nsx-tandem-nsk$UNAME_RELEASE
1531	;;
1532    *:NonStop-UX:*:*)
1533	GUESS=mips-compaq-nonstopux
1534	;;
1535    BS2000:POSIX*:*:*)
1536	GUESS=bs2000-siemens-sysv
1537	;;
1538    DS/*:UNIX_System_V:*:*)
1539	GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
1540	;;
1541    *:Plan9:*:*)
1542	# "uname -m" is not consistent, so use $cputype instead. 386
1543	# is converted to i386 for consistency with other x86
1544	# operating systems.
1545	if test "${cputype-}" = 386; then
1546	    UNAME_MACHINE=i386
1547	elif test "x${cputype-}" != x; then
1548	    UNAME_MACHINE=$cputype
1549	fi
1550	GUESS=$UNAME_MACHINE-${VENDOR}-plan9
1551	;;
1552    *:TOPS-10:*:*)
1553	GUESS=pdp10-${VENDOR}-tops10
1554	;;
1555    *:TENEX:*:*)
1556	GUESS=pdp10-${VENDOR}-tenex
1557	;;
1558    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1559	GUESS=pdp10-dec-tops20
1560	;;
1561    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1562	GUESS=pdp10-xkl-tops20
1563	;;
1564    *:TOPS-20:*:*)
1565	GUESS=pdp10-${VENDOR}-tops20
1566	;;
1567    *:ITS:*:*)
1568	GUESS=pdp10-${VENDOR}-its
1569	;;
1570    SEI:*:*:SEIUX)
1571	GUESS=mips-sei-seiux$UNAME_RELEASE
1572	;;
1573    *:DragonFly:*:*)
1574	DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
1575	GUESS=$UNAME_MACHINE-${VENDOR}-dragonfly$DRAGONFLY_REL
1576	;;
1577    *:*VMS:*:*)
1578	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1579	case $UNAME_MACHINE in
1580	    A*) GUESS=alpha-dec-vms ;;
1581	    I*) GUESS=ia64-dec-vms ;;
1582	    V*) GUESS=vax-dec-vms ;;
1583	esac ;;
1584    *:XENIX:*:SysV)
1585	GUESS=i386-pc-xenix
1586	;;
1587    i*86:skyos:*:*)
1588	SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
1589	GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
1590	;;
1591    i*86:rdos:*:*)
1592	GUESS=$UNAME_MACHINE-pc-rdos
1593	;;
1594    i*86:Fiwix:*:*)
1595	GUESS=$UNAME_MACHINE-pc-fiwix
1596	;;
1597    *:AROS:*:*)
1598	GUESS=$UNAME_MACHINE-${VENDOR}-aros
1599	;;
1600    x86_64:VMkernel:*:*)
1601	GUESS=$UNAME_MACHINE-${VENDOR}-esx
1602	;;
1603    amd64:Isilon\ OneFS:*:*)
1604	GUESS=x86_64-${VENDOR}-onefs
1605	;;
1606    *:Unleashed:*:*)
1607	GUESS=$UNAME_MACHINE-${VENDOR}-unleashed$UNAME_RELEASE
1608	;;
1609    *:Ironclad:*:*)
1610	GUESS=$UNAME_MACHINE-${VENDOR}-ironclad
1611	;;
1612esac
1613
1614# Do we have a guess based on uname results?
1615if test "x$GUESS" != x; then
1616    echo "$GUESS"
1617    exit
1618fi
1619
1620# No uname command or uname output not recognized.
1621set_cc_for_build
1622cat > "$dummy.c" <<EOF
1623#ifdef _SEQUENT_
1624#include <sys/types.h>
1625#include <sys/utsname.h>
1626#endif
1627#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1628#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1629#include <signal.h>
1630#if defined(_SIZE_T_) || defined(SIGLOST)
1631#include <sys/utsname.h>
1632#endif
1633#endif
1634#endif
1635main ()
1636{
1637#if defined (sony)
1638#if defined (MIPSEB)
1639  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1640     I don't know....  */
1641  printf ("mips-sony-bsd\n"); exit (0);
1642#else
1643#include <sys/param.h>
1644  printf ("m68k-sony-newsos%s\n",
1645#ifdef NEWSOS4
1646  "4"
1647#else
1648  ""
1649#endif
1650  ); exit (0);
1651#endif
1652#endif
1653
1654#if defined (NeXT)
1655#if !defined (__ARCHITECTURE__)
1656#define __ARCHITECTURE__ "m68k"
1657#endif
1658  int version;
1659  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1660  if (version < 4)
1661    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1662  else
1663    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1664  exit (0);
1665#endif
1666
1667#if defined (MULTIMAX) || defined (n16)
1668#if defined (UMAXV)
1669  printf ("ns32k-encore-sysv\n"); exit (0);
1670#else
1671#if defined (CMU)
1672  printf ("ns32k-encore-mach\n"); exit (0);
1673#else
1674  printf ("ns32k-encore-bsd\n"); exit (0);
1675#endif
1676#endif
1677#endif
1678
1679#if defined (__386BSD__)
1680  printf ("i386-pc-bsd\n"); exit (0);
1681#endif
1682
1683#if defined (sequent)
1684#if defined (i386)
1685  printf ("i386-sequent-dynix\n"); exit (0);
1686#endif
1687#if defined (ns32000)
1688  printf ("ns32k-sequent-dynix\n"); exit (0);
1689#endif
1690#endif
1691
1692#if defined (_SEQUENT_)
1693  struct utsname un;
1694
1695  uname(&un);
1696  if (strncmp(un.version, "V2", 2) == 0) {
1697    printf ("i386-sequent-ptx2\n"); exit (0);
1698  }
1699  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1700    printf ("i386-sequent-ptx1\n"); exit (0);
1701  }
1702  printf ("i386-sequent-ptx\n"); exit (0);
1703#endif
1704
1705#if defined (vax)
1706#if !defined (ultrix)
1707#include <sys/param.h>
1708#if defined (BSD)
1709#if BSD == 43
1710  printf ("vax-dec-bsd4.3\n"); exit (0);
1711#else
1712#if BSD == 199006
1713  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1714#else
1715  printf ("vax-dec-bsd\n"); exit (0);
1716#endif
1717#endif
1718#else
1719  printf ("vax-dec-bsd\n"); exit (0);
1720#endif
1721#else
1722#if defined(_SIZE_T_) || defined(SIGLOST)
1723  struct utsname un;
1724  uname (&un);
1725  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1726#else
1727  printf ("vax-dec-ultrix\n"); exit (0);
1728#endif
1729#endif
1730#endif
1731#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1732#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1733#if defined(_SIZE_T_) || defined(SIGLOST)
1734  struct utsname *un;
1735  uname (&un);
1736  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1737#else
1738  printf ("mips-dec-ultrix\n"); exit (0);
1739#endif
1740#endif
1741#endif
1742
1743#if defined (alliant) && defined (i860)
1744  printf ("i860-alliant-bsd\n"); exit (0);
1745#endif
1746
1747  exit (1);
1748}
1749EOF
1750
1751$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
1752	{ echo "$SYSTEM_NAME"; exit; }
1753
1754# Apollos put the system type in the environment.
1755test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1756
1757echo "$0: unable to guess system type" >&2
1758
1759case $UNAME_MACHINE:$UNAME_SYSTEM in
1760    mips:Linux | mips64:Linux)
1761	# If we got here on MIPS GNU/Linux, output extra information.
1762	cat >&2 <<EOF
1763
1764NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1765the system type. Please install a C compiler and try again.
1766EOF
1767	;;
1768esac
1769
1770cat >&2 <<EOF
1771
1772This script (version $timestamp), has failed to recognize the
1773operating system you are using. If your script is old, overwrite *all*
1774copies of config.guess and config.sub with the latest versions from:
1775
1776  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1777and
1778  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1779EOF
1780
1781our_year=`echo $timestamp | sed 's,-.*,,'`
1782thisyear=`date +%Y`
1783# shellcheck disable=SC2003
1784script_age=`expr "$thisyear" - "$our_year"`
1785if test "$script_age" -lt 3 ; then
1786   cat >&2 <<EOF
1787
1788If $0 has already been updated, send the following data and any
1789information you think might be pertinent to config-patches@gnu.org to
1790provide the necessary information to handle your system.
1791
1792config.guess timestamp = $timestamp
1793
1794uname -m = `(uname -m) 2>/dev/null || echo unknown`
1795uname -r = `(uname -r) 2>/dev/null || echo unknown`
1796uname -s = `(uname -s) 2>/dev/null || echo unknown`
1797uname -v = `(uname -v) 2>/dev/null || echo unknown`
1798
1799/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1800/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1801
1802hostinfo               = `(hostinfo) 2>/dev/null`
1803/bin/universe          = `(/bin/universe) 2>/dev/null`
1804/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1805/bin/arch              = `(/bin/arch) 2>/dev/null`
1806/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1807/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1808
1809UNAME_MACHINE = "$UNAME_MACHINE"
1810UNAME_RELEASE = "$UNAME_RELEASE"
1811UNAME_SYSTEM  = "$UNAME_SYSTEM"
1812UNAME_VERSION = "$UNAME_VERSION"
1813EOF
1814fi
1815
1816exit 1
1817
1818# Local variables:
1819# eval: (add-hook 'before-save-hook 'time-stamp)
1820# time-stamp-start: "timestamp='"
1821# time-stamp-format: "%:y-%02m-%02d"
1822# time-stamp-end: "'"
1823# End:
1824