xref: /freebsd/contrib/jemalloc/build-aux/config.guess (revision 4ba91e076ee84101112d8296785098ae31dac35e)
1<<<<<<< HEAD
2#! /bin/sh
3# Attempt to guess a canonical system name.
4#   Copyright 1992-2021 Free Software Foundation, Inc.
5
6timestamp='2021-01-01'
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# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
29#
30# You can get the latest version of this script from:
31# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
32#
33# Please send patches to <config-patches@gnu.org>.
34
35
36me=$(echo "$0" | sed -e 's,.*/,,')
37
38usage="\
39Usage: $0 [OPTION]
40
41Output the configuration name of the system \`$me' is run on.
42
43Options:
44  -h, --help         print this help, then exit
45  -t, --time-stamp   print date of last modification, then exit
46  -v, --version      print version number, then exit
47
48Report bugs and patches to <config-patches@gnu.org>."
49
50version="\
51GNU config.guess ($timestamp)
52
53Originally written by Per Bothner.
54Copyright 1992-2021 Free Software Foundation, Inc.
55
56This is free software; see the source for copying conditions.  There is NO
57warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
58
59help="
60Try \`$me --help' for more information."
61
62# Parse command line
63while test $# -gt 0 ; do
64  case $1 in
65    --time-stamp | --time* | -t )
66       echo "$timestamp" ; exit ;;
67    --version | -v )
68       echo "$version" ; exit ;;
69    --help | --h* | -h )
70       echo "$usage"; exit ;;
71    -- )     # Stop option processing
72       shift; break ;;
73    - )	# Use stdin as input.
74       break ;;
75    -* )
76       echo "$me: invalid option $1$help" >&2
77       exit 1 ;;
78    * )
79       break ;;
80  esac
81done
82
83if test $# != 0; then
84  echo "$me: too many arguments$help" >&2
85  exit 1
86fi
87
88# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
89# compiler to aid in system detection is discouraged as it requires
90# temporary files to be created and, as you can see below, it is a
91# headache to deal with in a portable fashion.
92
93# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
94# use `HOST_CC' if defined, but it is deprecated.
95
96# Portable tmp directory creation inspired by the Autoconf team.
97
98tmp=
99# shellcheck disable=SC2172
100trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
101
102set_cc_for_build() {
103    # prevent multiple calls if $tmp is already set
104    test "$tmp" && return 0
105    : "${TMPDIR=/tmp}"
106    # shellcheck disable=SC2039
107    { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
108	{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
109	{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
110	{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
111    dummy=$tmp/dummy
112    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
113	,,)    echo "int x;" > "$dummy.c"
114	       for driver in cc gcc c89 c99 ; do
115		   if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
116		       CC_FOR_BUILD="$driver"
117		       break
118		   fi
119	       done
120	       if test x"$CC_FOR_BUILD" = x ; then
121		   CC_FOR_BUILD=no_compiler_found
122	       fi
123	       ;;
124	,,*)   CC_FOR_BUILD=$CC ;;
125	,*,*)  CC_FOR_BUILD=$HOST_CC ;;
126    esac
127}
128
129# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
130# (ghazi@noc.rutgers.edu 1994-08-24)
131if test -f /.attbin/uname ; then
132	PATH=$PATH:/.attbin ; export PATH
133fi
134
135UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
136UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
137UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
138UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
139
140case "$UNAME_SYSTEM" in
141Linux|GNU|GNU/*)
142	LIBC=unknown
143
144	set_cc_for_build
145	cat <<-EOF > "$dummy.c"
146	#include <features.h>
147	#if defined(__UCLIBC__)
148	LIBC=uclibc
149	#elif defined(__dietlibc__)
150	LIBC=dietlibc
151	#elif defined(__GLIBC__)
152	LIBC=gnu
153	#else
154	#include <stdarg.h>
155	/* First heuristic to detect musl libc.  */
156	#ifdef __DEFINED_va_list
157	LIBC=musl
158	#endif
159	#endif
160	EOF
161	eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
162
163	# Second heuristic to detect musl libc.
164	if [ "$LIBC" = unknown ] &&
165	   command -v ldd >/dev/null &&
166	   ldd --version 2>&1 | grep -q ^musl; then
167		LIBC=musl
168	fi
169
170	# If the system lacks a compiler, then just pick glibc.
171	# We could probably try harder.
172	if [ "$LIBC" = unknown ]; then
173		LIBC=gnu
174	fi
175	;;
176esac
177
178# Note: order is significant - the case branches are not exclusive.
179
180case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
181    *:NetBSD:*:*)
182	# NetBSD (nbsd) targets should (where applicable) match one or
183	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
184	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
185	# switched to ELF, *-*-netbsd* would select the old
186	# object file format.  This provides both forward
187	# compatibility and a consistent mechanism for selecting the
188	# object file format.
189	#
190	# Note: NetBSD doesn't particularly care about the vendor
191	# portion of the name.  We always set it to "unknown".
192	sysctl="sysctl -n hw.machine_arch"
193	UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
194	    "/sbin/$sysctl" 2>/dev/null || \
195	    "/usr/sbin/$sysctl" 2>/dev/null || \
196	    echo unknown))
197	case "$UNAME_MACHINE_ARCH" in
198	    aarch64eb) machine=aarch64_be-unknown ;;
199	    armeb) machine=armeb-unknown ;;
200	    arm*) machine=arm-unknown ;;
201	    sh3el) machine=shl-unknown ;;
202	    sh3eb) machine=sh-unknown ;;
203	    sh5el) machine=sh5le-unknown ;;
204	    earmv*)
205		arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
206		endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
207		machine="${arch}${endian}"-unknown
208		;;
209	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
210	esac
211	# The Operating System including object format, if it has switched
212	# to ELF recently (or will in the future) and ABI.
213	case "$UNAME_MACHINE_ARCH" in
214	    earm*)
215		os=netbsdelf
216		;;
217	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
218		set_cc_for_build
219		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
220			| grep -q __ELF__
221		then
222		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
223		    # Return netbsd for either.  FIX?
224		    os=netbsd
225		else
226		    os=netbsdelf
227		fi
228		;;
229	    *)
230		os=netbsd
231		;;
232	esac
233	# Determine ABI tags.
234	case "$UNAME_MACHINE_ARCH" in
235	    earm*)
236		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
237		abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
238		;;
239	esac
240	# The OS release
241	# Debian GNU/NetBSD machines have a different userland, and
242	# thus, need a distinct triplet. However, they do not need
243	# kernel version information, so it can be replaced with a
244	# suitable tag, in the style of linux-gnu.
245	case "$UNAME_VERSION" in
246	    Debian*)
247		release='-gnu'
248		;;
249	    *)
250		release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
251		;;
252	esac
253	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
254	# contains redundant information, the shorter form:
255	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
256	echo "$machine-${os}${release}${abi-}"
257	exit ;;
258    *:Bitrig:*:*)
259	UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
260	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
261	exit ;;
262    *:OpenBSD:*:*)
263	UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
264	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
265	exit ;;
266    *:LibertyBSD:*:*)
267	UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
268	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
269	exit ;;
270    *:MidnightBSD:*:*)
271	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
272	exit ;;
273    *:ekkoBSD:*:*)
274	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
275	exit ;;
276    *:SolidBSD:*:*)
277	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
278	exit ;;
279    *:OS108:*:*)
280	echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
281	exit ;;
282    macppc:MirBSD:*:*)
283	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
284	exit ;;
285    *:MirBSD:*:*)
286	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
287	exit ;;
288    *:Sortix:*:*)
289	echo "$UNAME_MACHINE"-unknown-sortix
290	exit ;;
291    *:Twizzler:*:*)
292	echo "$UNAME_MACHINE"-unknown-twizzler
293	exit ;;
294    *:Redox:*:*)
295	echo "$UNAME_MACHINE"-unknown-redox
296	exit ;;
297    mips:OSF1:*.*)
298	echo mips-dec-osf1
299	exit ;;
300    alpha:OSF1:*:*)
301	case $UNAME_RELEASE in
302	*4.0)
303		UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
304		;;
305	*5.*)
306		UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
307		;;
308	esac
309	# According to Compaq, /usr/sbin/psrinfo has been available on
310	# OSF/1 and Tru64 systems produced since 1995.  I hope that
311	# covers most systems running today.  This code pipes the CPU
312	# types through head -n 1, so we only detect the type of CPU 0.
313	ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1)
314	case "$ALPHA_CPU_TYPE" in
315	    "EV4 (21064)")
316		UNAME_MACHINE=alpha ;;
317	    "EV4.5 (21064)")
318		UNAME_MACHINE=alpha ;;
319	    "LCA4 (21066/21068)")
320		UNAME_MACHINE=alpha ;;
321	    "EV5 (21164)")
322		UNAME_MACHINE=alphaev5 ;;
323	    "EV5.6 (21164A)")
324		UNAME_MACHINE=alphaev56 ;;
325	    "EV5.6 (21164PC)")
326		UNAME_MACHINE=alphapca56 ;;
327	    "EV5.7 (21164PC)")
328		UNAME_MACHINE=alphapca57 ;;
329	    "EV6 (21264)")
330		UNAME_MACHINE=alphaev6 ;;
331	    "EV6.7 (21264A)")
332		UNAME_MACHINE=alphaev67 ;;
333	    "EV6.8CB (21264C)")
334		UNAME_MACHINE=alphaev68 ;;
335	    "EV6.8AL (21264B)")
336		UNAME_MACHINE=alphaev68 ;;
337	    "EV6.8CX (21264D)")
338		UNAME_MACHINE=alphaev68 ;;
339	    "EV6.9A (21264/EV69A)")
340		UNAME_MACHINE=alphaev69 ;;
341	    "EV7 (21364)")
342		UNAME_MACHINE=alphaev7 ;;
343	    "EV7.9 (21364A)")
344		UNAME_MACHINE=alphaev79 ;;
345	esac
346	# A Pn.n version is a patched version.
347	# A Vn.n version is a released version.
348	# A Tn.n version is a released field test version.
349	# A Xn.n version is an unreleased experimental baselevel.
350	# 1.2 uses "1.2" for uname -r.
351	echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
352	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
353	exitcode=$?
354	trap '' 0
355	exit $exitcode ;;
356    Amiga*:UNIX_System_V:4.0:*)
357	echo m68k-unknown-sysv4
358	exit ;;
359    *:[Aa]miga[Oo][Ss]:*:*)
360	echo "$UNAME_MACHINE"-unknown-amigaos
361	exit ;;
362    *:[Mm]orph[Oo][Ss]:*:*)
363	echo "$UNAME_MACHINE"-unknown-morphos
364	exit ;;
365    *:OS/390:*:*)
366	echo i370-ibm-openedition
367	exit ;;
368    *:z/VM:*:*)
369	echo s390-ibm-zvmoe
370	exit ;;
371    *:OS400:*:*)
372	echo powerpc-ibm-os400
373	exit ;;
374    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
375	echo arm-acorn-riscix"$UNAME_RELEASE"
376	exit ;;
377    arm*:riscos:*:*|arm*:RISCOS:*:*)
378	echo arm-unknown-riscos
379	exit ;;
380    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
381	echo hppa1.1-hitachi-hiuxmpp
382	exit ;;
383    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
384	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
385	if test "$( (/bin/universe) 2>/dev/null)" = att ; then
386		echo pyramid-pyramid-sysv3
387	else
388		echo pyramid-pyramid-bsd
389	fi
390	exit ;;
391    NILE*:*:*:dcosx)
392	echo pyramid-pyramid-svr4
393	exit ;;
394    DRS?6000:unix:4.0:6*)
395	echo sparc-icl-nx6
396	exit ;;
397    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
398	case $(/usr/bin/uname -p) in
399	    sparc) echo sparc-icl-nx7; exit ;;
400	esac ;;
401    s390x:SunOS:*:*)
402	echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
403	exit ;;
404    sun4H:SunOS:5.*:*)
405	echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
406	exit ;;
407    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
408	echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
409	exit ;;
410    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
411	echo i386-pc-auroraux"$UNAME_RELEASE"
412	exit ;;
413    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
414	set_cc_for_build
415	SUN_ARCH=i386
416	# If there is a compiler, see if it is configured for 64-bit objects.
417	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
418	# This test works for both compilers.
419	if test "$CC_FOR_BUILD" != no_compiler_found; then
420	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
421		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
422		grep IS_64BIT_ARCH >/dev/null
423	    then
424		SUN_ARCH=x86_64
425	    fi
426	fi
427	echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
428	exit ;;
429    sun4*:SunOS:6*:*)
430	# According to config.sub, this is the proper way to canonicalize
431	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
432	# it's likely to be more like Solaris than SunOS4.
433	echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
434	exit ;;
435    sun4*:SunOS:*:*)
436	case "$(/usr/bin/arch -k)" in
437	    Series*|S4*)
438		UNAME_RELEASE=$(uname -v)
439		;;
440	esac
441	# Japanese Language versions have a version number like `4.1.3-JL'.
442	echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
443	exit ;;
444    sun3*:SunOS:*:*)
445	echo m68k-sun-sunos"$UNAME_RELEASE"
446	exit ;;
447    sun*:*:4.2BSD:*)
448	UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
449	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
450	case "$(/bin/arch)" in
451	    sun3)
452		echo m68k-sun-sunos"$UNAME_RELEASE"
453		;;
454	    sun4)
455		echo sparc-sun-sunos"$UNAME_RELEASE"
456		;;
457	esac
458	exit ;;
459    aushp:SunOS:*:*)
460	echo sparc-auspex-sunos"$UNAME_RELEASE"
461	exit ;;
462    # The situation for MiNT is a little confusing.  The machine name
463    # can be virtually everything (everything which is not
464    # "atarist" or "atariste" at least should have a processor
465    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
466    # to the lowercase version "mint" (or "freemint").  Finally
467    # the system name "TOS" denotes a system which is actually not
468    # MiNT.  But MiNT is downward compatible to TOS, so this should
469    # be no problem.
470    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
471	echo m68k-atari-mint"$UNAME_RELEASE"
472	exit ;;
473    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
474	echo m68k-atari-mint"$UNAME_RELEASE"
475	exit ;;
476    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
477	echo m68k-atari-mint"$UNAME_RELEASE"
478	exit ;;
479    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
480	echo m68k-milan-mint"$UNAME_RELEASE"
481	exit ;;
482    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
483	echo m68k-hades-mint"$UNAME_RELEASE"
484	exit ;;
485    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
486	echo m68k-unknown-mint"$UNAME_RELEASE"
487	exit ;;
488    m68k:machten:*:*)
489	echo m68k-apple-machten"$UNAME_RELEASE"
490	exit ;;
491    powerpc:machten:*:*)
492	echo powerpc-apple-machten"$UNAME_RELEASE"
493	exit ;;
494    RISC*:Mach:*:*)
495	echo mips-dec-mach_bsd4.3
496	exit ;;
497    RISC*:ULTRIX:*:*)
498	echo mips-dec-ultrix"$UNAME_RELEASE"
499	exit ;;
500    VAX*:ULTRIX*:*:*)
501	echo vax-dec-ultrix"$UNAME_RELEASE"
502	exit ;;
503    2020:CLIX:*:* | 2430:CLIX:*:*)
504	echo clipper-intergraph-clix"$UNAME_RELEASE"
505	exit ;;
506    mips:*:*:UMIPS | mips:*:*:RISCos)
507	set_cc_for_build
508	sed 's/^	//' << EOF > "$dummy.c"
509#ifdef __cplusplus
510#include <stdio.h>  /* for printf() prototype */
511	int main (int argc, char *argv[]) {
512#else
513	int main (argc, argv) int argc; char *argv[]; {
514#endif
515	#if defined (host_mips) && defined (MIPSEB)
516	#if defined (SYSTYPE_SYSV)
517	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
518	#endif
519	#if defined (SYSTYPE_SVR4)
520	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
521	#endif
522	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
523	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
524	#endif
525	#endif
526	  exit (-1);
527	}
528EOF
529	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
530	  dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
531	  SYSTEM_NAME=$("$dummy" "$dummyarg") &&
532	    { echo "$SYSTEM_NAME"; exit; }
533	echo mips-mips-riscos"$UNAME_RELEASE"
534	exit ;;
535    Motorola:PowerMAX_OS:*:*)
536	echo powerpc-motorola-powermax
537	exit ;;
538    Motorola:*:4.3:PL8-*)
539	echo powerpc-harris-powermax
540	exit ;;
541    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
542	echo powerpc-harris-powermax
543	exit ;;
544    Night_Hawk:Power_UNIX:*:*)
545	echo powerpc-harris-powerunix
546	exit ;;
547    m88k:CX/UX:7*:*)
548	echo m88k-harris-cxux7
549	exit ;;
550    m88k:*:4*:R4*)
551	echo m88k-motorola-sysv4
552	exit ;;
553    m88k:*:3*:R3*)
554	echo m88k-motorola-sysv3
555	exit ;;
556    AViiON:dgux:*:*)
557	# DG/UX returns AViiON for all architectures
558	UNAME_PROCESSOR=$(/usr/bin/uname -p)
559	if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
560	then
561	    if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
562	       test "$TARGET_BINARY_INTERFACE"x = x
563	    then
564		echo m88k-dg-dgux"$UNAME_RELEASE"
565	    else
566		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
567	    fi
568	else
569	    echo i586-dg-dgux"$UNAME_RELEASE"
570	fi
571	exit ;;
572    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
573	echo m88k-dolphin-sysv3
574	exit ;;
575    M88*:*:R3*:*)
576	# Delta 88k system running SVR3
577	echo m88k-motorola-sysv3
578	exit ;;
579    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
580	echo m88k-tektronix-sysv3
581	exit ;;
582    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
583	echo m68k-tektronix-bsd
584	exit ;;
585    *:IRIX*:*:*)
586	echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
587	exit ;;
588    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
589	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
590	exit ;;               # Note that: echo "'$(uname -s)'" gives 'AIX '
591    i*86:AIX:*:*)
592	echo i386-ibm-aix
593	exit ;;
594    ia64:AIX:*:*)
595	if test -x /usr/bin/oslevel ; then
596		IBM_REV=$(/usr/bin/oslevel)
597	else
598		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
599	fi
600	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
601	exit ;;
602    *:AIX:2:3)
603	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
604		set_cc_for_build
605		sed 's/^		//' << EOF > "$dummy.c"
606		#include <sys/systemcfg.h>
607
608		main()
609			{
610			if (!__power_pc())
611				exit(1);
612			puts("powerpc-ibm-aix3.2.5");
613			exit(0);
614			}
615EOF
616		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
617		then
618			echo "$SYSTEM_NAME"
619		else
620			echo rs6000-ibm-aix3.2.5
621		fi
622	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
623		echo rs6000-ibm-aix3.2.4
624	else
625		echo rs6000-ibm-aix3.2
626	fi
627	exit ;;
628    *:AIX:*:[4567])
629	IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
630	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
631		IBM_ARCH=rs6000
632	else
633		IBM_ARCH=powerpc
634	fi
635	if test -x /usr/bin/lslpp ; then
636		IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
637			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
638	else
639		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
640	fi
641	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
642	exit ;;
643    *:AIX:*:*)
644	echo rs6000-ibm-aix
645	exit ;;
646    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
647	echo romp-ibm-bsd4.4
648	exit ;;
649    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
650	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
651	exit ;;                             # report: romp-ibm BSD 4.3
652    *:BOSX:*:*)
653	echo rs6000-bull-bosx
654	exit ;;
655    DPX/2?00:B.O.S.:*:*)
656	echo m68k-bull-sysv3
657	exit ;;
658    9000/[34]??:4.3bsd:1.*:*)
659	echo m68k-hp-bsd
660	exit ;;
661    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
662	echo m68k-hp-bsd4.4
663	exit ;;
664    9000/[34678]??:HP-UX:*:*)
665	HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
666	case "$UNAME_MACHINE" in
667	    9000/31?)            HP_ARCH=m68000 ;;
668	    9000/[34]??)         HP_ARCH=m68k ;;
669	    9000/[678][0-9][0-9])
670		if test -x /usr/bin/getconf; then
671		    sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
672		    sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
673		    case "$sc_cpu_version" in
674		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
675		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
676		      532)                      # CPU_PA_RISC2_0
677			case "$sc_kernel_bits" in
678			  32) HP_ARCH=hppa2.0n ;;
679			  64) HP_ARCH=hppa2.0w ;;
680			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
681			esac ;;
682		    esac
683		fi
684		if test "$HP_ARCH" = ""; then
685		    set_cc_for_build
686		    sed 's/^		//' << EOF > "$dummy.c"
687
688		#define _HPUX_SOURCE
689		#include <stdlib.h>
690		#include <unistd.h>
691
692		int main ()
693		{
694		#if defined(_SC_KERNEL_BITS)
695		    long bits = sysconf(_SC_KERNEL_BITS);
696		#endif
697		    long cpu  = sysconf (_SC_CPU_VERSION);
698
699		    switch (cpu)
700			{
701			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
702			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
703			case CPU_PA_RISC2_0:
704		#if defined(_SC_KERNEL_BITS)
705			    switch (bits)
706				{
707				case 64: puts ("hppa2.0w"); break;
708				case 32: puts ("hppa2.0n"); break;
709				default: puts ("hppa2.0"); break;
710				} break;
711		#else  /* !defined(_SC_KERNEL_BITS) */
712			    puts ("hppa2.0"); break;
713		#endif
714			default: puts ("hppa1.0"); break;
715			}
716		    exit (0);
717		}
718EOF
719		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
720		    test -z "$HP_ARCH" && HP_ARCH=hppa
721		fi ;;
722	esac
723	if test "$HP_ARCH" = hppa2.0w
724	then
725	    set_cc_for_build
726
727	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
728	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
729	    # generating 64-bit code.  GNU and HP use different nomenclature:
730	    #
731	    # $ CC_FOR_BUILD=cc ./config.guess
732	    # => hppa2.0w-hp-hpux11.23
733	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
734	    # => hppa64-hp-hpux11.23
735
736	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
737		grep -q __LP64__
738	    then
739		HP_ARCH=hppa2.0w
740	    else
741		HP_ARCH=hppa64
742	    fi
743	fi
744	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
745	exit ;;
746    ia64:HP-UX:*:*)
747	HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
748	echo ia64-hp-hpux"$HPUX_REV"
749	exit ;;
750    3050*:HI-UX:*:*)
751	set_cc_for_build
752	sed 's/^	//' << EOF > "$dummy.c"
753	#include <unistd.h>
754	int
755	main ()
756	{
757	  long cpu = sysconf (_SC_CPU_VERSION);
758	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
759	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
760	     results, however.  */
761	  if (CPU_IS_PA_RISC (cpu))
762	    {
763	      switch (cpu)
764		{
765		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
766		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
767		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
768		  default: puts ("hppa-hitachi-hiuxwe2"); break;
769		}
770	    }
771	  else if (CPU_IS_HP_MC68K (cpu))
772	    puts ("m68k-hitachi-hiuxwe2");
773	  else puts ("unknown-hitachi-hiuxwe2");
774	  exit (0);
775	}
776EOF
777	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
778		{ echo "$SYSTEM_NAME"; exit; }
779	echo unknown-hitachi-hiuxwe2
780	exit ;;
781    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
782	echo hppa1.1-hp-bsd
783	exit ;;
784    9000/8??:4.3bsd:*:*)
785	echo hppa1.0-hp-bsd
786	exit ;;
787    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
788	echo hppa1.0-hp-mpeix
789	exit ;;
790    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
791	echo hppa1.1-hp-osf
792	exit ;;
793    hp8??:OSF1:*:*)
794	echo hppa1.0-hp-osf
795	exit ;;
796    i*86:OSF1:*:*)
797	if test -x /usr/sbin/sysversion ; then
798	    echo "$UNAME_MACHINE"-unknown-osf1mk
799	else
800	    echo "$UNAME_MACHINE"-unknown-osf1
801	fi
802	exit ;;
803    parisc*:Lites*:*:*)
804	echo hppa1.1-hp-lites
805	exit ;;
806    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
807	echo c1-convex-bsd
808	exit ;;
809    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
810	if getsysinfo -f scalar_acc
811	then echo c32-convex-bsd
812	else echo c2-convex-bsd
813	fi
814	exit ;;
815    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
816	echo c34-convex-bsd
817	exit ;;
818    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
819	echo c38-convex-bsd
820	exit ;;
821    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
822	echo c4-convex-bsd
823	exit ;;
824    CRAY*Y-MP:*:*:*)
825	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
826	exit ;;
827    CRAY*[A-Z]90:*:*:*)
828	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
829	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
830	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
831	      -e 's/\.[^.]*$/.X/'
832	exit ;;
833    CRAY*TS:*:*:*)
834	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
835	exit ;;
836    CRAY*T3E:*:*:*)
837	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
838	exit ;;
839    CRAY*SV1:*:*:*)
840	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
841	exit ;;
842    *:UNICOS/mp:*:*)
843	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
844	exit ;;
845    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
846	FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
847	FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
848	FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
849	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
850	exit ;;
851    5000:UNIX_System_V:4.*:*)
852	FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
853	FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
854	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
855	exit ;;
856    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
857	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
858	exit ;;
859    sparc*:BSD/OS:*:*)
860	echo sparc-unknown-bsdi"$UNAME_RELEASE"
861	exit ;;
862    *:BSD/OS:*:*)
863	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
864	exit ;;
865    arm:FreeBSD:*:*)
866	UNAME_PROCESSOR=$(uname -p)
867	set_cc_for_build
868	if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
869	    | grep -q __ARM_PCS_VFP
870	then
871	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
872	else
873	    echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
874	fi
875	exit ;;
876    *:FreeBSD:*:*)
877	UNAME_PROCESSOR=$(/usr/bin/uname -p)
878	case "$UNAME_PROCESSOR" in
879	    amd64)
880		UNAME_PROCESSOR=x86_64 ;;
881	    i386)
882		UNAME_PROCESSOR=i586 ;;
883	esac
884	echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
885	exit ;;
886    i*:CYGWIN*:*)
887	echo "$UNAME_MACHINE"-pc-cygwin
888	exit ;;
889    *:MINGW64*:*)
890	echo "$UNAME_MACHINE"-pc-mingw64
891	exit ;;
892    *:MINGW*:*)
893	echo "$UNAME_MACHINE"-pc-mingw32
894	exit ;;
895    *:MSYS*:*)
896	echo "$UNAME_MACHINE"-pc-msys
897	exit ;;
898    i*:PW*:*)
899	echo "$UNAME_MACHINE"-pc-pw32
900	exit ;;
901    *:Interix*:*)
902	case "$UNAME_MACHINE" in
903	    x86)
904		echo i586-pc-interix"$UNAME_RELEASE"
905		exit ;;
906	    authenticamd | genuineintel | EM64T)
907		echo x86_64-unknown-interix"$UNAME_RELEASE"
908		exit ;;
909	    IA64)
910		echo ia64-unknown-interix"$UNAME_RELEASE"
911		exit ;;
912	esac ;;
913    i*:UWIN*:*)
914	echo "$UNAME_MACHINE"-pc-uwin
915	exit ;;
916    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
917	echo x86_64-pc-cygwin
918	exit ;;
919    prep*:SunOS:5.*:*)
920	echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
921	exit ;;
922    *:GNU:*:*)
923	# the GNU system
924	echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
925	exit ;;
926    *:GNU/*:*:*)
927	# other systems with GNU libc and userland
928	echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
929	exit ;;
930    *:Minix:*:*)
931	echo "$UNAME_MACHINE"-unknown-minix
932	exit ;;
933    aarch64:Linux:*:*)
934	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
935	exit ;;
936    aarch64_be:Linux:*:*)
937	UNAME_MACHINE=aarch64_be
938	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
939	exit ;;
940    alpha:Linux:*:*)
941	case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
942	  EV5)   UNAME_MACHINE=alphaev5 ;;
943	  EV56)  UNAME_MACHINE=alphaev56 ;;
944	  PCA56) UNAME_MACHINE=alphapca56 ;;
945	  PCA57) UNAME_MACHINE=alphapca56 ;;
946	  EV6)   UNAME_MACHINE=alphaev6 ;;
947	  EV67)  UNAME_MACHINE=alphaev67 ;;
948	  EV68*) UNAME_MACHINE=alphaev68 ;;
949	esac
950	objdump --private-headers /bin/sh | grep -q ld.so.1
951	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
952	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
953	exit ;;
954    arc:Linux:*:* | arceb:Linux:*:*)
955	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
956	exit ;;
957    arm*:Linux:*:*)
958	set_cc_for_build
959	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
960	    | grep -q __ARM_EABI__
961	then
962	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963	else
964	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
965		| grep -q __ARM_PCS_VFP
966	    then
967		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
968	    else
969		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
970	    fi
971	fi
972	exit ;;
973    avr32*:Linux:*:*)
974	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
975	exit ;;
976    cris:Linux:*:*)
977	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
978	exit ;;
979    crisv32:Linux:*:*)
980	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
981	exit ;;
982    e2k:Linux:*:*)
983	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
984	exit ;;
985    frv:Linux:*:*)
986	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
987	exit ;;
988    hexagon:Linux:*:*)
989	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
990	exit ;;
991    i*86:Linux:*:*)
992	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
993	exit ;;
994    ia64:Linux:*:*)
995	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
996	exit ;;
997    k1om:Linux:*:*)
998	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
999	exit ;;
1000    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
1001	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1002	exit ;;
1003    m32r*:Linux:*:*)
1004	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1005	exit ;;
1006    m68*:Linux:*:*)
1007	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1008	exit ;;
1009    mips:Linux:*:* | mips64:Linux:*:*)
1010	set_cc_for_build
1011	IS_GLIBC=0
1012	test x"${LIBC}" = xgnu && IS_GLIBC=1
1013	sed 's/^	//' << EOF > "$dummy.c"
1014	#undef CPU
1015	#undef mips
1016	#undef mipsel
1017	#undef mips64
1018	#undef mips64el
1019	#if ${IS_GLIBC} && defined(_ABI64)
1020	LIBCABI=gnuabi64
1021	#else
1022	#if ${IS_GLIBC} && defined(_ABIN32)
1023	LIBCABI=gnuabin32
1024	#else
1025	LIBCABI=${LIBC}
1026	#endif
1027	#endif
1028
1029	#if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1030	CPU=mipsisa64r6
1031	#else
1032	#if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
1033	CPU=mipsisa32r6
1034	#else
1035	#if defined(__mips64)
1036	CPU=mips64
1037	#else
1038	CPU=mips
1039	#endif
1040	#endif
1041	#endif
1042
1043	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
1044	MIPS_ENDIAN=el
1045	#else
1046	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
1047	MIPS_ENDIAN=
1048	#else
1049	MIPS_ENDIAN=
1050	#endif
1051	#endif
1052EOF
1053	eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
1054	test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
1055	;;
1056    mips64el:Linux:*:*)
1057	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1058	exit ;;
1059    openrisc*:Linux:*:*)
1060	echo or1k-unknown-linux-"$LIBC"
1061	exit ;;
1062    or32:Linux:*:* | or1k*:Linux:*:*)
1063	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1064	exit ;;
1065    padre:Linux:*:*)
1066	echo sparc-unknown-linux-"$LIBC"
1067	exit ;;
1068    parisc64:Linux:*:* | hppa64:Linux:*:*)
1069	echo hppa64-unknown-linux-"$LIBC"
1070	exit ;;
1071    parisc:Linux:*:* | hppa:Linux:*:*)
1072	# Look for CPU level
1073	case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
1074	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1075	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1076	  *)    echo hppa-unknown-linux-"$LIBC" ;;
1077	esac
1078	exit ;;
1079    ppc64:Linux:*:*)
1080	echo powerpc64-unknown-linux-"$LIBC"
1081	exit ;;
1082    ppc:Linux:*:*)
1083	echo powerpc-unknown-linux-"$LIBC"
1084	exit ;;
1085    ppc64le:Linux:*:*)
1086	echo powerpc64le-unknown-linux-"$LIBC"
1087	exit ;;
1088    ppcle:Linux:*:*)
1089	echo powerpcle-unknown-linux-"$LIBC"
1090	exit ;;
1091    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
1092	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1093	exit ;;
1094    s390:Linux:*:* | s390x:Linux:*:*)
1095	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
1096	exit ;;
1097    sh64*:Linux:*:*)
1098	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1099	exit ;;
1100    sh*:Linux:*:*)
1101	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1102	exit ;;
1103    sparc:Linux:*:* | sparc64:Linux:*:*)
1104	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1105	exit ;;
1106    tile*:Linux:*:*)
1107	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1108	exit ;;
1109    vax:Linux:*:*)
1110	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
1111	exit ;;
1112    x86_64:Linux:*:*)
1113	set_cc_for_build
1114	LIBCABI=$LIBC
1115	if test "$CC_FOR_BUILD" != no_compiler_found; then
1116	    if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
1117		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1118		grep IS_X32 >/dev/null
1119	    then
1120		LIBCABI="$LIBC"x32
1121	    fi
1122	fi
1123	echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
1124	exit ;;
1125    xtensa*:Linux:*:*)
1126	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1127	exit ;;
1128    i*86:DYNIX/ptx:4*:*)
1129	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1130	# earlier versions are messed up and put the nodename in both
1131	# sysname and nodename.
1132	echo i386-sequent-sysv4
1133	exit ;;
1134    i*86:UNIX_SV:4.2MP:2.*)
1135	# Unixware is an offshoot of SVR4, but it has its own version
1136	# number series starting with 2...
1137	# I am not positive that other SVR4 systems won't match this,
1138	# I just have to hope.  -- rms.
1139	# Use sysv4.2uw... so that sysv4* matches it.
1140	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
1141	exit ;;
1142    i*86:OS/2:*:*)
1143	# If we were able to find `uname', then EMX Unix compatibility
1144	# is probably installed.
1145	echo "$UNAME_MACHINE"-pc-os2-emx
1146	exit ;;
1147    i*86:XTS-300:*:STOP)
1148	echo "$UNAME_MACHINE"-unknown-stop
1149	exit ;;
1150    i*86:atheos:*:*)
1151	echo "$UNAME_MACHINE"-unknown-atheos
1152	exit ;;
1153    i*86:syllable:*:*)
1154	echo "$UNAME_MACHINE"-pc-syllable
1155	exit ;;
1156    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1157	echo i386-unknown-lynxos"$UNAME_RELEASE"
1158	exit ;;
1159    i*86:*DOS:*:*)
1160	echo "$UNAME_MACHINE"-pc-msdosdjgpp
1161	exit ;;
1162    i*86:*:4.*:*)
1163	UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
1164	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1165		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1166	else
1167		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1168	fi
1169	exit ;;
1170    i*86:*:5:[678]*)
1171	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1172	case $(/bin/uname -X | grep "^Machine") in
1173	    *486*)	     UNAME_MACHINE=i486 ;;
1174	    *Pentium)	     UNAME_MACHINE=i586 ;;
1175	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1176	esac
1177	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
1178	exit ;;
1179    i*86:*:3.2:*)
1180	if test -f /usr/options/cb.name; then
1181		UNAME_REL=$(sed -n 's/.*Version //p' </usr/options/cb.name)
1182		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1183	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1184		UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
1185		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1186		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1187			&& UNAME_MACHINE=i586
1188		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1189			&& UNAME_MACHINE=i686
1190		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1191			&& UNAME_MACHINE=i686
1192		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1193	else
1194		echo "$UNAME_MACHINE"-pc-sysv32
1195	fi
1196	exit ;;
1197    pc:*:*:*)
1198	# Left here for compatibility:
1199	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1200	# the processor, so we play safe by assuming i586.
1201	# Note: whatever this is, it MUST be the same as what config.sub
1202	# prints for the "djgpp" host, or else GDB configure will decide that
1203	# this is a cross-build.
1204	echo i586-pc-msdosdjgpp
1205	exit ;;
1206    Intel:Mach:3*:*)
1207	echo i386-pc-mach3
1208	exit ;;
1209    paragon:*:*:*)
1210	echo i860-intel-osf1
1211	exit ;;
1212    i860:*:4.*:*) # i860-SVR4
1213	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1214	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1215	else # Add other i860-SVR4 vendors below as they are discovered.
1216	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
1217	fi
1218	exit ;;
1219    mini*:CTIX:SYS*5:*)
1220	# "miniframe"
1221	echo m68010-convergent-sysv
1222	exit ;;
1223    mc68k:UNIX:SYSTEM5:3.51m)
1224	echo m68k-convergent-sysv
1225	exit ;;
1226    M680?0:D-NIX:5.3:*)
1227	echo m68k-diab-dnix
1228	exit ;;
1229    M68*:*:R3V[5678]*:*)
1230	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1231    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)
1232	OS_REL=''
1233	test -r /etc/.relid \
1234	&& OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
1235	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1236	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1237	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1238	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1239    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1240	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1241	  && { echo i486-ncr-sysv4; exit; } ;;
1242    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1243	OS_REL='.3'
1244	test -r /etc/.relid \
1245	    && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
1246	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1247	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1248	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1249	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1250	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1251	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1252    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1253	echo m68k-unknown-lynxos"$UNAME_RELEASE"
1254	exit ;;
1255    mc68030:UNIX_System_V:4.*:*)
1256	echo m68k-atari-sysv4
1257	exit ;;
1258    TSUNAMI:LynxOS:2.*:*)
1259	echo sparc-unknown-lynxos"$UNAME_RELEASE"
1260	exit ;;
1261    rs6000:LynxOS:2.*:*)
1262	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1263	exit ;;
1264    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1265	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1266	exit ;;
1267    SM[BE]S:UNIX_SV:*:*)
1268	echo mips-dde-sysv"$UNAME_RELEASE"
1269	exit ;;
1270    RM*:ReliantUNIX-*:*:*)
1271	echo mips-sni-sysv4
1272	exit ;;
1273    RM*:SINIX-*:*:*)
1274	echo mips-sni-sysv4
1275	exit ;;
1276    *:SINIX-*:*:*)
1277	if uname -p 2>/dev/null >/dev/null ; then
1278		UNAME_MACHINE=$( (uname -p) 2>/dev/null)
1279		echo "$UNAME_MACHINE"-sni-sysv4
1280	else
1281		echo ns32k-sni-sysv
1282	fi
1283	exit ;;
1284    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1285			# says <Richard.M.Bartel@ccMail.Census.GOV>
1286	echo i586-unisys-sysv4
1287	exit ;;
1288    *:UNIX_System_V:4*:FTX*)
1289	# From Gerald Hewes <hewes@openmarket.com>.
1290	# How about differentiating between stratus architectures? -djm
1291	echo hppa1.1-stratus-sysv4
1292	exit ;;
1293    *:*:*:FTX*)
1294	# From seanf@swdc.stratus.com.
1295	echo i860-stratus-sysv4
1296	exit ;;
1297    i*86:VOS:*:*)
1298	# From Paul.Green@stratus.com.
1299	echo "$UNAME_MACHINE"-stratus-vos
1300	exit ;;
1301    *:VOS:*:*)
1302	# From Paul.Green@stratus.com.
1303	echo hppa1.1-stratus-vos
1304	exit ;;
1305    mc68*:A/UX:*:*)
1306	echo m68k-apple-aux"$UNAME_RELEASE"
1307	exit ;;
1308    news*:NEWS-OS:6*:*)
1309	echo mips-sony-newsos6
1310	exit ;;
1311    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1312	if test -d /usr/nec; then
1313		echo mips-nec-sysv"$UNAME_RELEASE"
1314	else
1315		echo mips-unknown-sysv"$UNAME_RELEASE"
1316	fi
1317	exit ;;
1318    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1319	echo powerpc-be-beos
1320	exit ;;
1321    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1322	echo powerpc-apple-beos
1323	exit ;;
1324    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1325	echo i586-pc-beos
1326	exit ;;
1327    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1328	echo i586-pc-haiku
1329	exit ;;
1330    x86_64:Haiku:*:*)
1331	echo x86_64-unknown-haiku
1332	exit ;;
1333    SX-4:SUPER-UX:*:*)
1334	echo sx4-nec-superux"$UNAME_RELEASE"
1335	exit ;;
1336    SX-5:SUPER-UX:*:*)
1337	echo sx5-nec-superux"$UNAME_RELEASE"
1338	exit ;;
1339    SX-6:SUPER-UX:*:*)
1340	echo sx6-nec-superux"$UNAME_RELEASE"
1341	exit ;;
1342    SX-7:SUPER-UX:*:*)
1343	echo sx7-nec-superux"$UNAME_RELEASE"
1344	exit ;;
1345    SX-8:SUPER-UX:*:*)
1346	echo sx8-nec-superux"$UNAME_RELEASE"
1347	exit ;;
1348    SX-8R:SUPER-UX:*:*)
1349	echo sx8r-nec-superux"$UNAME_RELEASE"
1350	exit ;;
1351    SX-ACE:SUPER-UX:*:*)
1352	echo sxace-nec-superux"$UNAME_RELEASE"
1353	exit ;;
1354    Power*:Rhapsody:*:*)
1355	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1356	exit ;;
1357    *:Rhapsody:*:*)
1358	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1359	exit ;;
1360    arm64:Darwin:*:*)
1361	echo aarch64-apple-darwin"$UNAME_RELEASE"
1362	exit ;;
1363    *:Darwin:*:*)
1364	UNAME_PROCESSOR=$(uname -p)
1365	case $UNAME_PROCESSOR in
1366	    unknown) UNAME_PROCESSOR=powerpc ;;
1367	esac
1368	if command -v xcode-select > /dev/null 2> /dev/null && \
1369		! xcode-select --print-path > /dev/null 2> /dev/null ; then
1370	    # Avoid executing cc if there is no toolchain installed as
1371	    # cc will be a stub that puts up a graphical alert
1372	    # prompting the user to install developer tools.
1373	    CC_FOR_BUILD=no_compiler_found
1374	else
1375	    set_cc_for_build
1376	fi
1377	if test "$CC_FOR_BUILD" != no_compiler_found; then
1378	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1379		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1380		   grep IS_64BIT_ARCH >/dev/null
1381	    then
1382		case $UNAME_PROCESSOR in
1383		    i386) UNAME_PROCESSOR=x86_64 ;;
1384		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1385		esac
1386	    fi
1387	    # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1388	    if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1389		   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1390		   grep IS_PPC >/dev/null
1391	    then
1392		UNAME_PROCESSOR=powerpc
1393	    fi
1394	elif test "$UNAME_PROCESSOR" = i386 ; then
1395	    # uname -m returns i386 or x86_64
1396	    UNAME_PROCESSOR=$UNAME_MACHINE
1397	fi
1398	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1399	exit ;;
1400    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1401	UNAME_PROCESSOR=$(uname -p)
1402	if test "$UNAME_PROCESSOR" = x86; then
1403		UNAME_PROCESSOR=i386
1404		UNAME_MACHINE=pc
1405	fi
1406	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1407	exit ;;
1408    *:QNX:*:4*)
1409	echo i386-pc-qnx
1410	exit ;;
1411    NEO-*:NONSTOP_KERNEL:*:*)
1412	echo neo-tandem-nsk"$UNAME_RELEASE"
1413	exit ;;
1414    NSE-*:NONSTOP_KERNEL:*:*)
1415	echo nse-tandem-nsk"$UNAME_RELEASE"
1416	exit ;;
1417    NSR-*:NONSTOP_KERNEL:*:*)
1418	echo nsr-tandem-nsk"$UNAME_RELEASE"
1419	exit ;;
1420    NSV-*:NONSTOP_KERNEL:*:*)
1421	echo nsv-tandem-nsk"$UNAME_RELEASE"
1422	exit ;;
1423    NSX-*:NONSTOP_KERNEL:*:*)
1424	echo nsx-tandem-nsk"$UNAME_RELEASE"
1425	exit ;;
1426    *:NonStop-UX:*:*)
1427	echo mips-compaq-nonstopux
1428	exit ;;
1429    BS2000:POSIX*:*:*)
1430	echo bs2000-siemens-sysv
1431	exit ;;
1432    DS/*:UNIX_System_V:*:*)
1433	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1434	exit ;;
1435    *:Plan9:*:*)
1436	# "uname -m" is not consistent, so use $cputype instead. 386
1437	# is converted to i386 for consistency with other x86
1438	# operating systems.
1439	# shellcheck disable=SC2154
1440	if test "$cputype" = 386; then
1441	    UNAME_MACHINE=i386
1442	else
1443	    UNAME_MACHINE="$cputype"
1444	fi
1445	echo "$UNAME_MACHINE"-unknown-plan9
1446	exit ;;
1447    *:TOPS-10:*:*)
1448	echo pdp10-unknown-tops10
1449	exit ;;
1450    *:TENEX:*:*)
1451	echo pdp10-unknown-tenex
1452	exit ;;
1453    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1454	echo pdp10-dec-tops20
1455	exit ;;
1456    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1457	echo pdp10-xkl-tops20
1458	exit ;;
1459    *:TOPS-20:*:*)
1460	echo pdp10-unknown-tops20
1461	exit ;;
1462    *:ITS:*:*)
1463	echo pdp10-unknown-its
1464	exit ;;
1465    SEI:*:*:SEIUX)
1466	echo mips-sei-seiux"$UNAME_RELEASE"
1467	exit ;;
1468    *:DragonFly:*:*)
1469	echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
1470	exit ;;
1471    *:*VMS:*:*)
1472	UNAME_MACHINE=$( (uname -p) 2>/dev/null)
1473	case "$UNAME_MACHINE" in
1474	    A*) echo alpha-dec-vms ; exit ;;
1475	    I*) echo ia64-dec-vms ; exit ;;
1476	    V*) echo vax-dec-vms ; exit ;;
1477	esac ;;
1478    *:XENIX:*:SysV)
1479	echo i386-pc-xenix
1480	exit ;;
1481    i*86:skyos:*:*)
1482	echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
1483	exit ;;
1484    i*86:rdos:*:*)
1485	echo "$UNAME_MACHINE"-pc-rdos
1486	exit ;;
1487    i*86:AROS:*:*)
1488	echo "$UNAME_MACHINE"-pc-aros
1489	exit ;;
1490    x86_64:VMkernel:*:*)
1491	echo "$UNAME_MACHINE"-unknown-esx
1492	exit ;;
1493    amd64:Isilon\ OneFS:*:*)
1494	echo x86_64-unknown-onefs
1495	exit ;;
1496    *:Unleashed:*:*)
1497	echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
1498	exit ;;
1499esac
1500
1501# No uname command or uname output not recognized.
1502set_cc_for_build
1503cat > "$dummy.c" <<EOF
1504#ifdef _SEQUENT_
1505#include <sys/types.h>
1506#include <sys/utsname.h>
1507#endif
1508#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1509#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1510#include <signal.h>
1511#if defined(_SIZE_T_) || defined(SIGLOST)
1512#include <sys/utsname.h>
1513#endif
1514#endif
1515#endif
1516main ()
1517{
1518#if defined (sony)
1519#if defined (MIPSEB)
1520  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1521     I don't know....  */
1522  printf ("mips-sony-bsd\n"); exit (0);
1523#else
1524#include <sys/param.h>
1525  printf ("m68k-sony-newsos%s\n",
1526#ifdef NEWSOS4
1527  "4"
1528#else
1529  ""
1530#endif
1531  ); exit (0);
1532#endif
1533#endif
1534
1535#if defined (NeXT)
1536#if !defined (__ARCHITECTURE__)
1537#define __ARCHITECTURE__ "m68k"
1538#endif
1539  int version;
1540  version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
1541  if (version < 4)
1542    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1543  else
1544    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1545  exit (0);
1546#endif
1547
1548#if defined (MULTIMAX) || defined (n16)
1549#if defined (UMAXV)
1550  printf ("ns32k-encore-sysv\n"); exit (0);
1551#else
1552#if defined (CMU)
1553  printf ("ns32k-encore-mach\n"); exit (0);
1554#else
1555  printf ("ns32k-encore-bsd\n"); exit (0);
1556#endif
1557#endif
1558#endif
1559
1560#if defined (__386BSD__)
1561  printf ("i386-pc-bsd\n"); exit (0);
1562#endif
1563
1564#if defined (sequent)
1565#if defined (i386)
1566  printf ("i386-sequent-dynix\n"); exit (0);
1567#endif
1568#if defined (ns32000)
1569  printf ("ns32k-sequent-dynix\n"); exit (0);
1570#endif
1571#endif
1572
1573#if defined (_SEQUENT_)
1574  struct utsname un;
1575
1576  uname(&un);
1577  if (strncmp(un.version, "V2", 2) == 0) {
1578    printf ("i386-sequent-ptx2\n"); exit (0);
1579  }
1580  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1581    printf ("i386-sequent-ptx1\n"); exit (0);
1582  }
1583  printf ("i386-sequent-ptx\n"); exit (0);
1584#endif
1585
1586#if defined (vax)
1587#if !defined (ultrix)
1588#include <sys/param.h>
1589#if defined (BSD)
1590#if BSD == 43
1591  printf ("vax-dec-bsd4.3\n"); exit (0);
1592#else
1593#if BSD == 199006
1594  printf ("vax-dec-bsd4.3reno\n"); exit (0);
1595#else
1596  printf ("vax-dec-bsd\n"); exit (0);
1597#endif
1598#endif
1599#else
1600  printf ("vax-dec-bsd\n"); exit (0);
1601#endif
1602#else
1603#if defined(_SIZE_T_) || defined(SIGLOST)
1604  struct utsname un;
1605  uname (&un);
1606  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
1607#else
1608  printf ("vax-dec-ultrix\n"); exit (0);
1609#endif
1610#endif
1611#endif
1612#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
1613#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
1614#if defined(_SIZE_T_) || defined(SIGLOST)
1615  struct utsname *un;
1616  uname (&un);
1617  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
1618#else
1619  printf ("mips-dec-ultrix\n"); exit (0);
1620#endif
1621#endif
1622#endif
1623
1624#if defined (alliant) && defined (i860)
1625  printf ("i860-alliant-bsd\n"); exit (0);
1626#endif
1627
1628  exit (1);
1629}
1630EOF
1631
1632$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
1633	{ echo "$SYSTEM_NAME"; exit; }
1634
1635# Apollos put the system type in the environment.
1636test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
1637
1638echo "$0: unable to guess system type" >&2
1639
1640case "$UNAME_MACHINE:$UNAME_SYSTEM" in
1641    mips:Linux | mips64:Linux)
1642	# If we got here on MIPS GNU/Linux, output extra information.
1643	cat >&2 <<EOF
1644
1645NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1646the system type. Please install a C compiler and try again.
1647EOF
1648	;;
1649esac
1650
1651cat >&2 <<EOF
1652
1653This script (version $timestamp), has failed to recognize the
1654operating system you are using. If your script is old, overwrite *all*
1655copies of config.guess and config.sub with the latest versions from:
1656
1657  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
1658and
1659  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
1660EOF
1661
1662year=$(echo $timestamp | sed 's,-.*,,')
1663# shellcheck disable=SC2003
1664if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
1665   cat >&2 <<EOF
1666
1667If $0 has already been updated, send the following data and any
1668information you think might be pertinent to config-patches@gnu.org to
1669provide the necessary information to handle your system.
1670
1671config.guess timestamp = $timestamp
1672
1673uname -m = $( (uname -m) 2>/dev/null || echo unknown)
1674uname -r = $( (uname -r) 2>/dev/null || echo unknown)
1675uname -s = $( (uname -s) 2>/dev/null || echo unknown)
1676uname -v = $( (uname -v) 2>/dev/null || echo unknown)
1677
1678/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
1679/bin/uname -X     = $( (/bin/uname -X) 2>/dev/null)
1680
1681hostinfo               = $( (hostinfo) 2>/dev/null)
1682/bin/universe          = $( (/bin/universe) 2>/dev/null)
1683/usr/bin/arch -k       = $( (/usr/bin/arch -k) 2>/dev/null)
1684/bin/arch              = $( (/bin/arch) 2>/dev/null)
1685/usr/bin/oslevel       = $( (/usr/bin/oslevel) 2>/dev/null)
1686/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
1687
1688UNAME_MACHINE = "$UNAME_MACHINE"
1689UNAME_RELEASE = "$UNAME_RELEASE"
1690UNAME_SYSTEM  = "$UNAME_SYSTEM"
1691UNAME_VERSION = "$UNAME_VERSION"
1692EOF
1693fi
1694
1695exit 1
1696
1697# Local variables:
1698# eval: (add-hook 'before-save-hook 'time-stamp)
1699# time-stamp-start: "timestamp='"
1700# time-stamp-format: "%:y-%02m-%02d"
1701# time-stamp-end: "'"
1702# End:
1703||||||| dec341af7695
1704=======
1705#! /bin/sh
1706# Attempt to guess a canonical system name.
1707#   Copyright 1992-2016 Free Software Foundation, Inc.
1708
1709timestamp='2016-10-02'
1710
1711# This file is free software; you can redistribute it and/or modify it
1712# under the terms of the GNU General Public License as published by
1713# the Free Software Foundation; either version 3 of the License, or
1714# (at your option) any later version.
1715#
1716# This program is distributed in the hope that it will be useful, but
1717# WITHOUT ANY WARRANTY; without even the implied warranty of
1718# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1719# General Public License for more details.
1720#
1721# You should have received a copy of the GNU General Public License
1722# along with this program; if not, see <http://www.gnu.org/licenses/>.
1723#
1724# As a special exception to the GNU General Public License, if you
1725# distribute this file as part of a program that contains a
1726# configuration script generated by Autoconf, you may include it under
1727# the same distribution terms that you use for the rest of that
1728# program.  This Exception is an additional permission under section 7
1729# of the GNU General Public License, version 3 ("GPLv3").
1730#
1731# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
1732#
1733# You can get the latest version of this script from:
1734# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1735#
1736# Please send patches to <config-patches@gnu.org>.
1737
1738
1739me=`echo "$0" | sed -e 's,.*/,,'`
1740
1741usage="\
1742Usage: $0 [OPTION]
1743
1744Output the configuration name of the system \`$me' is run on.
1745
1746Operation modes:
1747  -h, --help         print this help, then exit
1748  -t, --time-stamp   print date of last modification, then exit
1749  -v, --version      print version number, then exit
1750
1751Report bugs and patches to <config-patches@gnu.org>."
1752
1753version="\
1754GNU config.guess ($timestamp)
1755
1756Originally written by Per Bothner.
1757Copyright 1992-2016 Free Software Foundation, Inc.
1758
1759This is free software; see the source for copying conditions.  There is NO
1760warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
1761
1762help="
1763Try \`$me --help' for more information."
1764
1765# Parse command line
1766while test $# -gt 0 ; do
1767  case $1 in
1768    --time-stamp | --time* | -t )
1769       echo "$timestamp" ; exit ;;
1770    --version | -v )
1771       echo "$version" ; exit ;;
1772    --help | --h* | -h )
1773       echo "$usage"; exit ;;
1774    -- )     # Stop option processing
1775       shift; break ;;
1776    - )	# Use stdin as input.
1777       break ;;
1778    -* )
1779       echo "$me: invalid option $1$help" >&2
1780       exit 1 ;;
1781    * )
1782       break ;;
1783  esac
1784done
1785
1786if test $# != 0; then
1787  echo "$me: too many arguments$help" >&2
1788  exit 1
1789fi
1790
1791trap 'exit 1' 1 2 15
1792
1793# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
1794# compiler to aid in system detection is discouraged as it requires
1795# temporary files to be created and, as you can see below, it is a
1796# headache to deal with in a portable fashion.
1797
1798# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
1799# use `HOST_CC' if defined, but it is deprecated.
1800
1801# Portable tmp directory creation inspired by the Autoconf team.
1802
1803set_cc_for_build='
1804trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
1805trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1806: ${TMPDIR=/tmp} ;
1807 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1808 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1809 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1810 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1811dummy=$tmp/dummy ;
1812tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1813case $CC_FOR_BUILD,$HOST_CC,$CC in
1814 ,,)    echo "int x;" > $dummy.c ;
1815	for c in cc gcc c89 c99 ; do
1816	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1817	     CC_FOR_BUILD="$c"; break ;
1818	  fi ;
1819	done ;
1820	if test x"$CC_FOR_BUILD" = x ; then
1821	  CC_FOR_BUILD=no_compiler_found ;
1822	fi
1823	;;
1824 ,,*)   CC_FOR_BUILD=$CC ;;
1825 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1826esac ; set_cc_for_build= ;'
1827
1828# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1829# (ghazi@noc.rutgers.edu 1994-08-24)
1830if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1831	PATH=$PATH:/.attbin ; export PATH
1832fi
1833
1834UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1835UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1836UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1837UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1838
1839case "${UNAME_SYSTEM}" in
1840Linux|GNU|GNU/*)
1841	# If the system lacks a compiler, then just pick glibc.
1842	# We could probably try harder.
1843	LIBC=gnu
1844
1845	eval $set_cc_for_build
1846	cat <<-EOF > $dummy.c
1847	#include <features.h>
1848	#if defined(__UCLIBC__)
1849	LIBC=uclibc
1850	#elif defined(__dietlibc__)
1851	LIBC=dietlibc
1852	#else
1853	LIBC=gnu
1854	#endif
1855	EOF
1856	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
1857	;;
1858esac
1859
1860# Note: order is significant - the case branches are not exclusive.
1861
1862case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1863    *:NetBSD:*:*)
1864	# NetBSD (nbsd) targets should (where applicable) match one or
1865	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1866	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1867	# switched to ELF, *-*-netbsd* would select the old
1868	# object file format.  This provides both forward
1869	# compatibility and a consistent mechanism for selecting the
1870	# object file format.
1871	#
1872	# Note: NetBSD doesn't particularly care about the vendor
1873	# portion of the name.  We always set it to "unknown".
1874	sysctl="sysctl -n hw.machine_arch"
1875	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
1876	    /sbin/$sysctl 2>/dev/null || \
1877	    /usr/sbin/$sysctl 2>/dev/null || \
1878	    echo unknown)`
1879	case "${UNAME_MACHINE_ARCH}" in
1880	    armeb) machine=armeb-unknown ;;
1881	    arm*) machine=arm-unknown ;;
1882	    sh3el) machine=shl-unknown ;;
1883	    sh3eb) machine=sh-unknown ;;
1884	    sh5el) machine=sh5le-unknown ;;
1885	    earmv*)
1886		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
1887		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
1888		machine=${arch}${endian}-unknown
1889		;;
1890	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1891	esac
1892	# The Operating System including object format, if it has switched
1893	# to ELF recently (or will in the future) and ABI.
1894	case "${UNAME_MACHINE_ARCH}" in
1895	    earm*)
1896		os=netbsdelf
1897		;;
1898	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1899		eval $set_cc_for_build
1900		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
1901			| grep -q __ELF__
1902		then
1903		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1904		    # Return netbsd for either.  FIX?
1905		    os=netbsd
1906		else
1907		    os=netbsdelf
1908		fi
1909		;;
1910	    *)
1911		os=netbsd
1912		;;
1913	esac
1914	# Determine ABI tags.
1915	case "${UNAME_MACHINE_ARCH}" in
1916	    earm*)
1917		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
1918		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
1919		;;
1920	esac
1921	# The OS release
1922	# Debian GNU/NetBSD machines have a different userland, and
1923	# thus, need a distinct triplet. However, they do not need
1924	# kernel version information, so it can be replaced with a
1925	# suitable tag, in the style of linux-gnu.
1926	case "${UNAME_VERSION}" in
1927	    Debian*)
1928		release='-gnu'
1929		;;
1930	    *)
1931		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
1932		;;
1933	esac
1934	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
1935	# contains redundant information, the shorter form:
1936	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
1937	echo "${machine}-${os}${release}${abi}"
1938	exit ;;
1939    *:Bitrig:*:*)
1940	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
1941	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
1942	exit ;;
1943    *:OpenBSD:*:*)
1944	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
1945	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
1946	exit ;;
1947    *:LibertyBSD:*:*)
1948	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
1949	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
1950	exit ;;
1951    *:ekkoBSD:*:*)
1952	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
1953	exit ;;
1954    *:SolidBSD:*:*)
1955	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
1956	exit ;;
1957    macppc:MirBSD:*:*)
1958	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
1959	exit ;;
1960    *:MirBSD:*:*)
1961	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
1962	exit ;;
1963    *:Sortix:*:*)
1964	echo ${UNAME_MACHINE}-unknown-sortix
1965	exit ;;
1966    alpha:OSF1:*:*)
1967	case $UNAME_RELEASE in
1968	*4.0)
1969		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
1970		;;
1971	*5.*)
1972		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
1973		;;
1974	esac
1975	# According to Compaq, /usr/sbin/psrinfo has been available on
1976	# OSF/1 and Tru64 systems produced since 1995.  I hope that
1977	# covers most systems running today.  This code pipes the CPU
1978	# types through head -n 1, so we only detect the type of CPU 0.
1979	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
1980	case "$ALPHA_CPU_TYPE" in
1981	    "EV4 (21064)")
1982		UNAME_MACHINE=alpha ;;
1983	    "EV4.5 (21064)")
1984		UNAME_MACHINE=alpha ;;
1985	    "LCA4 (21066/21068)")
1986		UNAME_MACHINE=alpha ;;
1987	    "EV5 (21164)")
1988		UNAME_MACHINE=alphaev5 ;;
1989	    "EV5.6 (21164A)")
1990		UNAME_MACHINE=alphaev56 ;;
1991	    "EV5.6 (21164PC)")
1992		UNAME_MACHINE=alphapca56 ;;
1993	    "EV5.7 (21164PC)")
1994		UNAME_MACHINE=alphapca57 ;;
1995	    "EV6 (21264)")
1996		UNAME_MACHINE=alphaev6 ;;
1997	    "EV6.7 (21264A)")
1998		UNAME_MACHINE=alphaev67 ;;
1999	    "EV6.8CB (21264C)")
2000		UNAME_MACHINE=alphaev68 ;;
2001	    "EV6.8AL (21264B)")
2002		UNAME_MACHINE=alphaev68 ;;
2003	    "EV6.8CX (21264D)")
2004		UNAME_MACHINE=alphaev68 ;;
2005	    "EV6.9A (21264/EV69A)")
2006		UNAME_MACHINE=alphaev69 ;;
2007	    "EV7 (21364)")
2008		UNAME_MACHINE=alphaev7 ;;
2009	    "EV7.9 (21364A)")
2010		UNAME_MACHINE=alphaev79 ;;
2011	esac
2012	# A Pn.n version is a patched version.
2013	# A Vn.n version is a released version.
2014	# A Tn.n version is a released field test version.
2015	# A Xn.n version is an unreleased experimental baselevel.
2016	# 1.2 uses "1.2" for uname -r.
2017	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
2018	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
2019	exitcode=$?
2020	trap '' 0
2021	exit $exitcode ;;
2022    Alpha\ *:Windows_NT*:*)
2023	# How do we know it's Interix rather than the generic POSIX subsystem?
2024	# Should we change UNAME_MACHINE based on the output of uname instead
2025	# of the specific Alpha model?
2026	echo alpha-pc-interix
2027	exit ;;
2028    21064:Windows_NT:50:3)
2029	echo alpha-dec-winnt3.5
2030	exit ;;
2031    Amiga*:UNIX_System_V:4.0:*)
2032	echo m68k-unknown-sysv4
2033	exit ;;
2034    *:[Aa]miga[Oo][Ss]:*:*)
2035	echo ${UNAME_MACHINE}-unknown-amigaos
2036	exit ;;
2037    *:[Mm]orph[Oo][Ss]:*:*)
2038	echo ${UNAME_MACHINE}-unknown-morphos
2039	exit ;;
2040    *:OS/390:*:*)
2041	echo i370-ibm-openedition
2042	exit ;;
2043    *:z/VM:*:*)
2044	echo s390-ibm-zvmoe
2045	exit ;;
2046    *:OS400:*:*)
2047	echo powerpc-ibm-os400
2048	exit ;;
2049    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
2050	echo arm-acorn-riscix${UNAME_RELEASE}
2051	exit ;;
2052    arm*:riscos:*:*|arm*:RISCOS:*:*)
2053	echo arm-unknown-riscos
2054	exit ;;
2055    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
2056	echo hppa1.1-hitachi-hiuxmpp
2057	exit ;;
2058    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
2059	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
2060	if test "`(/bin/universe) 2>/dev/null`" = att ; then
2061		echo pyramid-pyramid-sysv3
2062	else
2063		echo pyramid-pyramid-bsd
2064	fi
2065	exit ;;
2066    NILE*:*:*:dcosx)
2067	echo pyramid-pyramid-svr4
2068	exit ;;
2069    DRS?6000:unix:4.0:6*)
2070	echo sparc-icl-nx6
2071	exit ;;
2072    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
2073	case `/usr/bin/uname -p` in
2074	    sparc) echo sparc-icl-nx7; exit ;;
2075	esac ;;
2076    s390x:SunOS:*:*)
2077	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2078	exit ;;
2079    sun4H:SunOS:5.*:*)
2080	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2081	exit ;;
2082    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
2083	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2084	exit ;;
2085    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
2086	echo i386-pc-auroraux${UNAME_RELEASE}
2087	exit ;;
2088    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
2089	eval $set_cc_for_build
2090	SUN_ARCH=i386
2091	# If there is a compiler, see if it is configured for 64-bit objects.
2092	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
2093	# This test works for both compilers.
2094	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
2095	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
2096		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
2097		grep IS_64BIT_ARCH >/dev/null
2098	    then
2099		SUN_ARCH=x86_64
2100	    fi
2101	fi
2102	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2103	exit ;;
2104    sun4*:SunOS:6*:*)
2105	# According to config.sub, this is the proper way to canonicalize
2106	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
2107	# it's likely to be more like Solaris than SunOS4.
2108	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2109	exit ;;
2110    sun4*:SunOS:*:*)
2111	case "`/usr/bin/arch -k`" in
2112	    Series*|S4*)
2113		UNAME_RELEASE=`uname -v`
2114		;;
2115	esac
2116	# Japanese Language versions have a version number like `4.1.3-JL'.
2117	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
2118	exit ;;
2119    sun3*:SunOS:*:*)
2120	echo m68k-sun-sunos${UNAME_RELEASE}
2121	exit ;;
2122    sun*:*:4.2BSD:*)
2123	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
2124	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
2125	case "`/bin/arch`" in
2126	    sun3)
2127		echo m68k-sun-sunos${UNAME_RELEASE}
2128		;;
2129	    sun4)
2130		echo sparc-sun-sunos${UNAME_RELEASE}
2131		;;
2132	esac
2133	exit ;;
2134    aushp:SunOS:*:*)
2135	echo sparc-auspex-sunos${UNAME_RELEASE}
2136	exit ;;
2137    # The situation for MiNT is a little confusing.  The machine name
2138    # can be virtually everything (everything which is not
2139    # "atarist" or "atariste" at least should have a processor
2140    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
2141    # to the lowercase version "mint" (or "freemint").  Finally
2142    # the system name "TOS" denotes a system which is actually not
2143    # MiNT.  But MiNT is downward compatible to TOS, so this should
2144    # be no problem.
2145    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
2146	echo m68k-atari-mint${UNAME_RELEASE}
2147	exit ;;
2148    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
2149	echo m68k-atari-mint${UNAME_RELEASE}
2150	exit ;;
2151    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
2152	echo m68k-atari-mint${UNAME_RELEASE}
2153	exit ;;
2154    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
2155	echo m68k-milan-mint${UNAME_RELEASE}
2156	exit ;;
2157    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
2158	echo m68k-hades-mint${UNAME_RELEASE}
2159	exit ;;
2160    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
2161	echo m68k-unknown-mint${UNAME_RELEASE}
2162	exit ;;
2163    m68k:machten:*:*)
2164	echo m68k-apple-machten${UNAME_RELEASE}
2165	exit ;;
2166    powerpc:machten:*:*)
2167	echo powerpc-apple-machten${UNAME_RELEASE}
2168	exit ;;
2169    RISC*:Mach:*:*)
2170	echo mips-dec-mach_bsd4.3
2171	exit ;;
2172    RISC*:ULTRIX:*:*)
2173	echo mips-dec-ultrix${UNAME_RELEASE}
2174	exit ;;
2175    VAX*:ULTRIX*:*:*)
2176	echo vax-dec-ultrix${UNAME_RELEASE}
2177	exit ;;
2178    2020:CLIX:*:* | 2430:CLIX:*:*)
2179	echo clipper-intergraph-clix${UNAME_RELEASE}
2180	exit ;;
2181    mips:*:*:UMIPS | mips:*:*:RISCos)
2182	eval $set_cc_for_build
2183	sed 's/^	//' << EOF >$dummy.c
2184#ifdef __cplusplus
2185#include <stdio.h>  /* for printf() prototype */
2186	int main (int argc, char *argv[]) {
2187#else
2188	int main (argc, argv) int argc; char *argv[]; {
2189#endif
2190	#if defined (host_mips) && defined (MIPSEB)
2191	#if defined (SYSTYPE_SYSV)
2192	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
2193	#endif
2194	#if defined (SYSTYPE_SVR4)
2195	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
2196	#endif
2197	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
2198	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
2199	#endif
2200	#endif
2201	  exit (-1);
2202	}
2203EOF
2204	$CC_FOR_BUILD -o $dummy $dummy.c &&
2205	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
2206	  SYSTEM_NAME=`$dummy $dummyarg` &&
2207	    { echo "$SYSTEM_NAME"; exit; }
2208	echo mips-mips-riscos${UNAME_RELEASE}
2209	exit ;;
2210    Motorola:PowerMAX_OS:*:*)
2211	echo powerpc-motorola-powermax
2212	exit ;;
2213    Motorola:*:4.3:PL8-*)
2214	echo powerpc-harris-powermax
2215	exit ;;
2216    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
2217	echo powerpc-harris-powermax
2218	exit ;;
2219    Night_Hawk:Power_UNIX:*:*)
2220	echo powerpc-harris-powerunix
2221	exit ;;
2222    m88k:CX/UX:7*:*)
2223	echo m88k-harris-cxux7
2224	exit ;;
2225    m88k:*:4*:R4*)
2226	echo m88k-motorola-sysv4
2227	exit ;;
2228    m88k:*:3*:R3*)
2229	echo m88k-motorola-sysv3
2230	exit ;;
2231    AViiON:dgux:*:*)
2232	# DG/UX returns AViiON for all architectures
2233	UNAME_PROCESSOR=`/usr/bin/uname -p`
2234	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
2235	then
2236	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
2237	       [ ${TARGET_BINARY_INTERFACE}x = x ]
2238	    then
2239		echo m88k-dg-dgux${UNAME_RELEASE}
2240	    else
2241		echo m88k-dg-dguxbcs${UNAME_RELEASE}
2242	    fi
2243	else
2244	    echo i586-dg-dgux${UNAME_RELEASE}
2245	fi
2246	exit ;;
2247    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
2248	echo m88k-dolphin-sysv3
2249	exit ;;
2250    M88*:*:R3*:*)
2251	# Delta 88k system running SVR3
2252	echo m88k-motorola-sysv3
2253	exit ;;
2254    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
2255	echo m88k-tektronix-sysv3
2256	exit ;;
2257    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
2258	echo m68k-tektronix-bsd
2259	exit ;;
2260    *:IRIX*:*:*)
2261	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
2262	exit ;;
2263    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
2264	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
2265	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
2266    i*86:AIX:*:*)
2267	echo i386-ibm-aix
2268	exit ;;
2269    ia64:AIX:*:*)
2270	if [ -x /usr/bin/oslevel ] ; then
2271		IBM_REV=`/usr/bin/oslevel`
2272	else
2273		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
2274	fi
2275	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
2276	exit ;;
2277    *:AIX:2:3)
2278	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
2279		eval $set_cc_for_build
2280		sed 's/^		//' << EOF >$dummy.c
2281		#include <sys/systemcfg.h>
2282
2283		main()
2284			{
2285			if (!__power_pc())
2286				exit(1);
2287			puts("powerpc-ibm-aix3.2.5");
2288			exit(0);
2289			}
2290EOF
2291		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
2292		then
2293			echo "$SYSTEM_NAME"
2294		else
2295			echo rs6000-ibm-aix3.2.5
2296		fi
2297	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
2298		echo rs6000-ibm-aix3.2.4
2299	else
2300		echo rs6000-ibm-aix3.2
2301	fi
2302	exit ;;
2303    *:AIX:*:[4567])
2304	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
2305	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
2306		IBM_ARCH=rs6000
2307	else
2308		IBM_ARCH=powerpc
2309	fi
2310	if [ -x /usr/bin/lslpp ] ; then
2311		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
2312			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
2313	else
2314		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
2315	fi
2316	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
2317	exit ;;
2318    *:AIX:*:*)
2319	echo rs6000-ibm-aix
2320	exit ;;
2321    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
2322	echo romp-ibm-bsd4.4
2323	exit ;;
2324    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
2325	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
2326	exit ;;                             # report: romp-ibm BSD 4.3
2327    *:BOSX:*:*)
2328	echo rs6000-bull-bosx
2329	exit ;;
2330    DPX/2?00:B.O.S.:*:*)
2331	echo m68k-bull-sysv3
2332	exit ;;
2333    9000/[34]??:4.3bsd:1.*:*)
2334	echo m68k-hp-bsd
2335	exit ;;
2336    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
2337	echo m68k-hp-bsd4.4
2338	exit ;;
2339    9000/[34678]??:HP-UX:*:*)
2340	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
2341	case "${UNAME_MACHINE}" in
2342	    9000/31? )            HP_ARCH=m68000 ;;
2343	    9000/[34]?? )         HP_ARCH=m68k ;;
2344	    9000/[678][0-9][0-9])
2345		if [ -x /usr/bin/getconf ]; then
2346		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
2347		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
2348		    case "${sc_cpu_version}" in
2349		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
2350		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
2351		      532)                      # CPU_PA_RISC2_0
2352			case "${sc_kernel_bits}" in
2353			  32) HP_ARCH=hppa2.0n ;;
2354			  64) HP_ARCH=hppa2.0w ;;
2355			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
2356			esac ;;
2357		    esac
2358		fi
2359		if [ "${HP_ARCH}" = "" ]; then
2360		    eval $set_cc_for_build
2361		    sed 's/^		//' << EOF >$dummy.c
2362
2363		#define _HPUX_SOURCE
2364		#include <stdlib.h>
2365		#include <unistd.h>
2366
2367		int main ()
2368		{
2369		#if defined(_SC_KERNEL_BITS)
2370		    long bits = sysconf(_SC_KERNEL_BITS);
2371		#endif
2372		    long cpu  = sysconf (_SC_CPU_VERSION);
2373
2374		    switch (cpu)
2375			{
2376			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
2377			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
2378			case CPU_PA_RISC2_0:
2379		#if defined(_SC_KERNEL_BITS)
2380			    switch (bits)
2381				{
2382				case 64: puts ("hppa2.0w"); break;
2383				case 32: puts ("hppa2.0n"); break;
2384				default: puts ("hppa2.0"); break;
2385				} break;
2386		#else  /* !defined(_SC_KERNEL_BITS) */
2387			    puts ("hppa2.0"); break;
2388		#endif
2389			default: puts ("hppa1.0"); break;
2390			}
2391		    exit (0);
2392		}
2393EOF
2394		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
2395		    test -z "$HP_ARCH" && HP_ARCH=hppa
2396		fi ;;
2397	esac
2398	if [ ${HP_ARCH} = hppa2.0w ]
2399	then
2400	    eval $set_cc_for_build
2401
2402	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
2403	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
2404	    # generating 64-bit code.  GNU and HP use different nomenclature:
2405	    #
2406	    # $ CC_FOR_BUILD=cc ./config.guess
2407	    # => hppa2.0w-hp-hpux11.23
2408	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
2409	    # => hppa64-hp-hpux11.23
2410
2411	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
2412		grep -q __LP64__
2413	    then
2414		HP_ARCH=hppa2.0w
2415	    else
2416		HP_ARCH=hppa64
2417	    fi
2418	fi
2419	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
2420	exit ;;
2421    ia64:HP-UX:*:*)
2422	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
2423	echo ia64-hp-hpux${HPUX_REV}
2424	exit ;;
2425    3050*:HI-UX:*:*)
2426	eval $set_cc_for_build
2427	sed 's/^	//' << EOF >$dummy.c
2428	#include <unistd.h>
2429	int
2430	main ()
2431	{
2432	  long cpu = sysconf (_SC_CPU_VERSION);
2433	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
2434	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
2435	     results, however.  */
2436	  if (CPU_IS_PA_RISC (cpu))
2437	    {
2438	      switch (cpu)
2439		{
2440		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
2441		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
2442		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
2443		  default: puts ("hppa-hitachi-hiuxwe2"); break;
2444		}
2445	    }
2446	  else if (CPU_IS_HP_MC68K (cpu))
2447	    puts ("m68k-hitachi-hiuxwe2");
2448	  else puts ("unknown-hitachi-hiuxwe2");
2449	  exit (0);
2450	}
2451EOF
2452	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
2453		{ echo "$SYSTEM_NAME"; exit; }
2454	echo unknown-hitachi-hiuxwe2
2455	exit ;;
2456    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
2457	echo hppa1.1-hp-bsd
2458	exit ;;
2459    9000/8??:4.3bsd:*:*)
2460	echo hppa1.0-hp-bsd
2461	exit ;;
2462    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
2463	echo hppa1.0-hp-mpeix
2464	exit ;;
2465    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
2466	echo hppa1.1-hp-osf
2467	exit ;;
2468    hp8??:OSF1:*:*)
2469	echo hppa1.0-hp-osf
2470	exit ;;
2471    i*86:OSF1:*:*)
2472	if [ -x /usr/sbin/sysversion ] ; then
2473	    echo ${UNAME_MACHINE}-unknown-osf1mk
2474	else
2475	    echo ${UNAME_MACHINE}-unknown-osf1
2476	fi
2477	exit ;;
2478    parisc*:Lites*:*:*)
2479	echo hppa1.1-hp-lites
2480	exit ;;
2481    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
2482	echo c1-convex-bsd
2483	exit ;;
2484    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
2485	if getsysinfo -f scalar_acc
2486	then echo c32-convex-bsd
2487	else echo c2-convex-bsd
2488	fi
2489	exit ;;
2490    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
2491	echo c34-convex-bsd
2492	exit ;;
2493    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
2494	echo c38-convex-bsd
2495	exit ;;
2496    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
2497	echo c4-convex-bsd
2498	exit ;;
2499    CRAY*Y-MP:*:*:*)
2500	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2501	exit ;;
2502    CRAY*[A-Z]90:*:*:*)
2503	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
2504	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
2505	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
2506	      -e 's/\.[^.]*$/.X/'
2507	exit ;;
2508    CRAY*TS:*:*:*)
2509	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2510	exit ;;
2511    CRAY*T3E:*:*:*)
2512	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2513	exit ;;
2514    CRAY*SV1:*:*:*)
2515	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2516	exit ;;
2517    *:UNICOS/mp:*:*)
2518	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
2519	exit ;;
2520    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
2521	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
2522	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
2523	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
2524	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
2525	exit ;;
2526    5000:UNIX_System_V:4.*:*)
2527	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
2528	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
2529	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
2530	exit ;;
2531    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
2532	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
2533	exit ;;
2534    sparc*:BSD/OS:*:*)
2535	echo sparc-unknown-bsdi${UNAME_RELEASE}
2536	exit ;;
2537    *:BSD/OS:*:*)
2538	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
2539	exit ;;
2540    *:FreeBSD:*:*)
2541	UNAME_PROCESSOR=`/usr/bin/uname -p`
2542	case ${UNAME_PROCESSOR} in
2543	    amd64)
2544		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
2545	    *)
2546		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
2547	esac
2548	exit ;;
2549    i*:CYGWIN*:*)
2550	echo ${UNAME_MACHINE}-pc-cygwin
2551	exit ;;
2552    *:MINGW64*:*)
2553	echo ${UNAME_MACHINE}-pc-mingw64
2554	exit ;;
2555    *:MINGW*:*)
2556	echo ${UNAME_MACHINE}-pc-mingw32
2557	exit ;;
2558    *:MSYS*:*)
2559	echo ${UNAME_MACHINE}-pc-msys
2560	exit ;;
2561    i*:windows32*:*)
2562	# uname -m includes "-pc" on this system.
2563	echo ${UNAME_MACHINE}-mingw32
2564	exit ;;
2565    i*:PW*:*)
2566	echo ${UNAME_MACHINE}-pc-pw32
2567	exit ;;
2568    *:Interix*:*)
2569	case ${UNAME_MACHINE} in
2570	    x86)
2571		echo i586-pc-interix${UNAME_RELEASE}
2572		exit ;;
2573	    authenticamd | genuineintel | EM64T)
2574		echo x86_64-unknown-interix${UNAME_RELEASE}
2575		exit ;;
2576	    IA64)
2577		echo ia64-unknown-interix${UNAME_RELEASE}
2578		exit ;;
2579	esac ;;
2580    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
2581	echo i${UNAME_MACHINE}-pc-mks
2582	exit ;;
2583    8664:Windows_NT:*)
2584	echo x86_64-pc-mks
2585	exit ;;
2586    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
2587	# How do we know it's Interix rather than the generic POSIX subsystem?
2588	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
2589	# UNAME_MACHINE based on the output of uname instead of i386?
2590	echo i586-pc-interix
2591	exit ;;
2592    i*:UWIN*:*)
2593	echo ${UNAME_MACHINE}-pc-uwin
2594	exit ;;
2595    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
2596	echo x86_64-unknown-cygwin
2597	exit ;;
2598    p*:CYGWIN*:*)
2599	echo powerpcle-unknown-cygwin
2600	exit ;;
2601    prep*:SunOS:5.*:*)
2602	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
2603	exit ;;
2604    *:GNU:*:*)
2605	# the GNU system
2606	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
2607	exit ;;
2608    *:GNU/*:*:*)
2609	# other systems with GNU libc and userland
2610	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
2611	exit ;;
2612    i*86:Minix:*:*)
2613	echo ${UNAME_MACHINE}-pc-minix
2614	exit ;;
2615    aarch64:Linux:*:*)
2616	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2617	exit ;;
2618    aarch64_be:Linux:*:*)
2619	UNAME_MACHINE=aarch64_be
2620	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2621	exit ;;
2622    alpha:Linux:*:*)
2623	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
2624	  EV5)   UNAME_MACHINE=alphaev5 ;;
2625	  EV56)  UNAME_MACHINE=alphaev56 ;;
2626	  PCA56) UNAME_MACHINE=alphapca56 ;;
2627	  PCA57) UNAME_MACHINE=alphapca56 ;;
2628	  EV6)   UNAME_MACHINE=alphaev6 ;;
2629	  EV67)  UNAME_MACHINE=alphaev67 ;;
2630	  EV68*) UNAME_MACHINE=alphaev68 ;;
2631	esac
2632	objdump --private-headers /bin/sh | grep -q ld.so.1
2633	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
2634	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2635	exit ;;
2636    arc:Linux:*:* | arceb:Linux:*:*)
2637	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2638	exit ;;
2639    arm*:Linux:*:*)
2640	eval $set_cc_for_build
2641	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
2642	    | grep -q __ARM_EABI__
2643	then
2644	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2645	else
2646	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
2647		| grep -q __ARM_PCS_VFP
2648	    then
2649		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
2650	    else
2651		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
2652	    fi
2653	fi
2654	exit ;;
2655    avr32*:Linux:*:*)
2656	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2657	exit ;;
2658    cris:Linux:*:*)
2659	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
2660	exit ;;
2661    crisv32:Linux:*:*)
2662	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
2663	exit ;;
2664    e2k:Linux:*:*)
2665	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2666	exit ;;
2667    frv:Linux:*:*)
2668	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2669	exit ;;
2670    hexagon:Linux:*:*)
2671	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2672	exit ;;
2673    i*86:Linux:*:*)
2674	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
2675	exit ;;
2676    ia64:Linux:*:*)
2677	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2678	exit ;;
2679    k1om:Linux:*:*)
2680	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2681	exit ;;
2682    m32r*:Linux:*:*)
2683	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2684	exit ;;
2685    m68*:Linux:*:*)
2686	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2687	exit ;;
2688    mips:Linux:*:* | mips64:Linux:*:*)
2689	eval $set_cc_for_build
2690	sed 's/^	//' << EOF >$dummy.c
2691	#undef CPU
2692	#undef ${UNAME_MACHINE}
2693	#undef ${UNAME_MACHINE}el
2694	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
2695	CPU=${UNAME_MACHINE}el
2696	#else
2697	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
2698	CPU=${UNAME_MACHINE}
2699	#else
2700	CPU=
2701	#endif
2702	#endif
2703EOF
2704	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
2705	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
2706	;;
2707    mips64el:Linux:*:*)
2708	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2709	exit ;;
2710    openrisc*:Linux:*:*)
2711	echo or1k-unknown-linux-${LIBC}
2712	exit ;;
2713    or32:Linux:*:* | or1k*:Linux:*:*)
2714	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2715	exit ;;
2716    padre:Linux:*:*)
2717	echo sparc-unknown-linux-${LIBC}
2718	exit ;;
2719    parisc64:Linux:*:* | hppa64:Linux:*:*)
2720	echo hppa64-unknown-linux-${LIBC}
2721	exit ;;
2722    parisc:Linux:*:* | hppa:Linux:*:*)
2723	# Look for CPU level
2724	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
2725	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
2726	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
2727	  *)    echo hppa-unknown-linux-${LIBC} ;;
2728	esac
2729	exit ;;
2730    ppc64:Linux:*:*)
2731	echo powerpc64-unknown-linux-${LIBC}
2732	exit ;;
2733    ppc:Linux:*:*)
2734	echo powerpc-unknown-linux-${LIBC}
2735	exit ;;
2736    ppc64le:Linux:*:*)
2737	echo powerpc64le-unknown-linux-${LIBC}
2738	exit ;;
2739    ppcle:Linux:*:*)
2740	echo powerpcle-unknown-linux-${LIBC}
2741	exit ;;
2742    riscv32:Linux:*:* | riscv64:Linux:*:*)
2743	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2744	exit ;;
2745    s390:Linux:*:* | s390x:Linux:*:*)
2746	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
2747	exit ;;
2748    sh64*:Linux:*:*)
2749	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2750	exit ;;
2751    sh*:Linux:*:*)
2752	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2753	exit ;;
2754    sparc:Linux:*:* | sparc64:Linux:*:*)
2755	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2756	exit ;;
2757    tile*:Linux:*:*)
2758	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2759	exit ;;
2760    vax:Linux:*:*)
2761	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
2762	exit ;;
2763    x86_64:Linux:*:*)
2764	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
2765	exit ;;
2766    xtensa*:Linux:*:*)
2767	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
2768	exit ;;
2769    i*86:DYNIX/ptx:4*:*)
2770	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
2771	# earlier versions are messed up and put the nodename in both
2772	# sysname and nodename.
2773	echo i386-sequent-sysv4
2774	exit ;;
2775    i*86:UNIX_SV:4.2MP:2.*)
2776	# Unixware is an offshoot of SVR4, but it has its own version
2777	# number series starting with 2...
2778	# I am not positive that other SVR4 systems won't match this,
2779	# I just have to hope.  -- rms.
2780	# Use sysv4.2uw... so that sysv4* matches it.
2781	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
2782	exit ;;
2783    i*86:OS/2:*:*)
2784	# If we were able to find `uname', then EMX Unix compatibility
2785	# is probably installed.
2786	echo ${UNAME_MACHINE}-pc-os2-emx
2787	exit ;;
2788    i*86:XTS-300:*:STOP)
2789	echo ${UNAME_MACHINE}-unknown-stop
2790	exit ;;
2791    i*86:atheos:*:*)
2792	echo ${UNAME_MACHINE}-unknown-atheos
2793	exit ;;
2794    i*86:syllable:*:*)
2795	echo ${UNAME_MACHINE}-pc-syllable
2796	exit ;;
2797    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
2798	echo i386-unknown-lynxos${UNAME_RELEASE}
2799	exit ;;
2800    i*86:*DOS:*:*)
2801	echo ${UNAME_MACHINE}-pc-msdosdjgpp
2802	exit ;;
2803    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
2804	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
2805	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
2806		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
2807	else
2808		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
2809	fi
2810	exit ;;
2811    i*86:*:5:[678]*)
2812	# UnixWare 7.x, OpenUNIX and OpenServer 6.
2813	case `/bin/uname -X | grep "^Machine"` in
2814	    *486*)	     UNAME_MACHINE=i486 ;;
2815	    *Pentium)	     UNAME_MACHINE=i586 ;;
2816	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
2817	esac
2818	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
2819	exit ;;
2820    i*86:*:3.2:*)
2821	if test -f /usr/options/cb.name; then
2822		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
2823		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
2824	elif /bin/uname -X 2>/dev/null >/dev/null ; then
2825		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
2826		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
2827		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
2828			&& UNAME_MACHINE=i586
2829		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
2830			&& UNAME_MACHINE=i686
2831		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
2832			&& UNAME_MACHINE=i686
2833		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
2834	else
2835		echo ${UNAME_MACHINE}-pc-sysv32
2836	fi
2837	exit ;;
2838    pc:*:*:*)
2839	# Left here for compatibility:
2840	# uname -m prints for DJGPP always 'pc', but it prints nothing about
2841	# the processor, so we play safe by assuming i586.
2842	# Note: whatever this is, it MUST be the same as what config.sub
2843	# prints for the "djgpp" host, or else GDB configure will decide that
2844	# this is a cross-build.
2845	echo i586-pc-msdosdjgpp
2846	exit ;;
2847    Intel:Mach:3*:*)
2848	echo i386-pc-mach3
2849	exit ;;
2850    paragon:*:*:*)
2851	echo i860-intel-osf1
2852	exit ;;
2853    i860:*:4.*:*) # i860-SVR4
2854	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
2855	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
2856	else # Add other i860-SVR4 vendors below as they are discovered.
2857	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
2858	fi
2859	exit ;;
2860    mini*:CTIX:SYS*5:*)
2861	# "miniframe"
2862	echo m68010-convergent-sysv
2863	exit ;;
2864    mc68k:UNIX:SYSTEM5:3.51m)
2865	echo m68k-convergent-sysv
2866	exit ;;
2867    M680?0:D-NIX:5.3:*)
2868	echo m68k-diab-dnix
2869	exit ;;
2870    M68*:*:R3V[5678]*:*)
2871	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
2872    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)
2873	OS_REL=''
2874	test -r /etc/.relid \
2875	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
2876	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
2877	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
2878	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
2879	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
2880    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
2881	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
2882	  && { echo i486-ncr-sysv4; exit; } ;;
2883    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
2884	OS_REL='.3'
2885	test -r /etc/.relid \
2886	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
2887	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
2888	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
2889	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
2890	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
2891	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
2892	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
2893    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
2894	echo m68k-unknown-lynxos${UNAME_RELEASE}
2895	exit ;;
2896    mc68030:UNIX_System_V:4.*:*)
2897	echo m68k-atari-sysv4
2898	exit ;;
2899    TSUNAMI:LynxOS:2.*:*)
2900	echo sparc-unknown-lynxos${UNAME_RELEASE}
2901	exit ;;
2902    rs6000:LynxOS:2.*:*)
2903	echo rs6000-unknown-lynxos${UNAME_RELEASE}
2904	exit ;;
2905    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
2906	echo powerpc-unknown-lynxos${UNAME_RELEASE}
2907	exit ;;
2908    SM[BE]S:UNIX_SV:*:*)
2909	echo mips-dde-sysv${UNAME_RELEASE}
2910	exit ;;
2911    RM*:ReliantUNIX-*:*:*)
2912	echo mips-sni-sysv4
2913	exit ;;
2914    RM*:SINIX-*:*:*)
2915	echo mips-sni-sysv4
2916	exit ;;
2917    *:SINIX-*:*:*)
2918	if uname -p 2>/dev/null >/dev/null ; then
2919		UNAME_MACHINE=`(uname -p) 2>/dev/null`
2920		echo ${UNAME_MACHINE}-sni-sysv4
2921	else
2922		echo ns32k-sni-sysv
2923	fi
2924	exit ;;
2925    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
2926			# says <Richard.M.Bartel@ccMail.Census.GOV>
2927	echo i586-unisys-sysv4
2928	exit ;;
2929    *:UNIX_System_V:4*:FTX*)
2930	# From Gerald Hewes <hewes@openmarket.com>.
2931	# How about differentiating between stratus architectures? -djm
2932	echo hppa1.1-stratus-sysv4
2933	exit ;;
2934    *:*:*:FTX*)
2935	# From seanf@swdc.stratus.com.
2936	echo i860-stratus-sysv4
2937	exit ;;
2938    i*86:VOS:*:*)
2939	# From Paul.Green@stratus.com.
2940	echo ${UNAME_MACHINE}-stratus-vos
2941	exit ;;
2942    *:VOS:*:*)
2943	# From Paul.Green@stratus.com.
2944	echo hppa1.1-stratus-vos
2945	exit ;;
2946    mc68*:A/UX:*:*)
2947	echo m68k-apple-aux${UNAME_RELEASE}
2948	exit ;;
2949    news*:NEWS-OS:6*:*)
2950	echo mips-sony-newsos6
2951	exit ;;
2952    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
2953	if [ -d /usr/nec ]; then
2954		echo mips-nec-sysv${UNAME_RELEASE}
2955	else
2956		echo mips-unknown-sysv${UNAME_RELEASE}
2957	fi
2958	exit ;;
2959    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
2960	echo powerpc-be-beos
2961	exit ;;
2962    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
2963	echo powerpc-apple-beos
2964	exit ;;
2965    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
2966	echo i586-pc-beos
2967	exit ;;
2968    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
2969	echo i586-pc-haiku
2970	exit ;;
2971    x86_64:Haiku:*:*)
2972	echo x86_64-unknown-haiku
2973	exit ;;
2974    SX-4:SUPER-UX:*:*)
2975	echo sx4-nec-superux${UNAME_RELEASE}
2976	exit ;;
2977    SX-5:SUPER-UX:*:*)
2978	echo sx5-nec-superux${UNAME_RELEASE}
2979	exit ;;
2980    SX-6:SUPER-UX:*:*)
2981	echo sx6-nec-superux${UNAME_RELEASE}
2982	exit ;;
2983    SX-7:SUPER-UX:*:*)
2984	echo sx7-nec-superux${UNAME_RELEASE}
2985	exit ;;
2986    SX-8:SUPER-UX:*:*)
2987	echo sx8-nec-superux${UNAME_RELEASE}
2988	exit ;;
2989    SX-8R:SUPER-UX:*:*)
2990	echo sx8r-nec-superux${UNAME_RELEASE}
2991	exit ;;
2992    SX-ACE:SUPER-UX:*:*)
2993	echo sxace-nec-superux${UNAME_RELEASE}
2994	exit ;;
2995    Power*:Rhapsody:*:*)
2996	echo powerpc-apple-rhapsody${UNAME_RELEASE}
2997	exit ;;
2998    *:Rhapsody:*:*)
2999	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
3000	exit ;;
3001    *:Darwin:*:*)
3002	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
3003	eval $set_cc_for_build
3004	if test "$UNAME_PROCESSOR" = unknown ; then
3005	    UNAME_PROCESSOR=powerpc
3006	fi
3007	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
3008	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
3009		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
3010		    (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
3011		    grep IS_64BIT_ARCH >/dev/null
3012		then
3013		    case $UNAME_PROCESSOR in
3014			i386) UNAME_PROCESSOR=x86_64 ;;
3015			powerpc) UNAME_PROCESSOR=powerpc64 ;;
3016		    esac
3017		fi
3018	    fi
3019	elif test "$UNAME_PROCESSOR" = i386 ; then
3020	    # Avoid executing cc on OS X 10.9, as it ships with a stub
3021	    # that puts up a graphical alert prompting to install
3022	    # developer tools.  Any system running Mac OS X 10.7 or
3023	    # later (Darwin 11 and later) is required to have a 64-bit
3024	    # processor. This is not true of the ARM version of Darwin
3025	    # that Apple uses in portable devices.
3026	    UNAME_PROCESSOR=x86_64
3027	fi
3028	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
3029	exit ;;
3030    *:procnto*:*:* | *:QNX:[0123456789]*:*)
3031	UNAME_PROCESSOR=`uname -p`
3032	if test "$UNAME_PROCESSOR" = x86; then
3033		UNAME_PROCESSOR=i386
3034		UNAME_MACHINE=pc
3035	fi
3036	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
3037	exit ;;
3038    *:QNX:*:4*)
3039	echo i386-pc-qnx
3040	exit ;;
3041    NEO-?:NONSTOP_KERNEL:*:*)
3042	echo neo-tandem-nsk${UNAME_RELEASE}
3043	exit ;;
3044    NSE-*:NONSTOP_KERNEL:*:*)
3045	echo nse-tandem-nsk${UNAME_RELEASE}
3046	exit ;;
3047    NSR-?:NONSTOP_KERNEL:*:*)
3048	echo nsr-tandem-nsk${UNAME_RELEASE}
3049	exit ;;
3050    *:NonStop-UX:*:*)
3051	echo mips-compaq-nonstopux
3052	exit ;;
3053    BS2000:POSIX*:*:*)
3054	echo bs2000-siemens-sysv
3055	exit ;;
3056    DS/*:UNIX_System_V:*:*)
3057	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
3058	exit ;;
3059    *:Plan9:*:*)
3060	# "uname -m" is not consistent, so use $cputype instead. 386
3061	# is converted to i386 for consistency with other x86
3062	# operating systems.
3063	if test "$cputype" = 386; then
3064	    UNAME_MACHINE=i386
3065	else
3066	    UNAME_MACHINE="$cputype"
3067	fi
3068	echo ${UNAME_MACHINE}-unknown-plan9
3069	exit ;;
3070    *:TOPS-10:*:*)
3071	echo pdp10-unknown-tops10
3072	exit ;;
3073    *:TENEX:*:*)
3074	echo pdp10-unknown-tenex
3075	exit ;;
3076    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
3077	echo pdp10-dec-tops20
3078	exit ;;
3079    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
3080	echo pdp10-xkl-tops20
3081	exit ;;
3082    *:TOPS-20:*:*)
3083	echo pdp10-unknown-tops20
3084	exit ;;
3085    *:ITS:*:*)
3086	echo pdp10-unknown-its
3087	exit ;;
3088    SEI:*:*:SEIUX)
3089	echo mips-sei-seiux${UNAME_RELEASE}
3090	exit ;;
3091    *:DragonFly:*:*)
3092	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
3093	exit ;;
3094    *:*VMS:*:*)
3095	UNAME_MACHINE=`(uname -p) 2>/dev/null`
3096	case "${UNAME_MACHINE}" in
3097	    A*) echo alpha-dec-vms ; exit ;;
3098	    I*) echo ia64-dec-vms ; exit ;;
3099	    V*) echo vax-dec-vms ; exit ;;
3100	esac ;;
3101    *:XENIX:*:SysV)
3102	echo i386-pc-xenix
3103	exit ;;
3104    i*86:skyos:*:*)
3105	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
3106	exit ;;
3107    i*86:rdos:*:*)
3108	echo ${UNAME_MACHINE}-pc-rdos
3109	exit ;;
3110    i*86:AROS:*:*)
3111	echo ${UNAME_MACHINE}-pc-aros
3112	exit ;;
3113    x86_64:VMkernel:*:*)
3114	echo ${UNAME_MACHINE}-unknown-esx
3115	exit ;;
3116    amd64:Isilon\ OneFS:*:*)
3117	echo x86_64-unknown-onefs
3118	exit ;;
3119esac
3120
3121cat >&2 <<EOF
3122$0: unable to guess system type
3123
3124This script (version $timestamp), has failed to recognize the
3125operating system you are using. If your script is old, overwrite
3126config.guess and config.sub with the latest versions from:
3127
3128  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3129and
3130  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
3131
3132If $0 has already been updated, send the following data and any
3133information you think might be pertinent to config-patches@gnu.org to
3134provide the necessary information to handle your system.
3135
3136config.guess timestamp = $timestamp
3137
3138uname -m = `(uname -m) 2>/dev/null || echo unknown`
3139uname -r = `(uname -r) 2>/dev/null || echo unknown`
3140uname -s = `(uname -s) 2>/dev/null || echo unknown`
3141uname -v = `(uname -v) 2>/dev/null || echo unknown`
3142
3143/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
3144/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
3145
3146hostinfo               = `(hostinfo) 2>/dev/null`
3147/bin/universe          = `(/bin/universe) 2>/dev/null`
3148/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
3149/bin/arch              = `(/bin/arch) 2>/dev/null`
3150/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
3151/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
3152
3153UNAME_MACHINE = ${UNAME_MACHINE}
3154UNAME_RELEASE = ${UNAME_RELEASE}
3155UNAME_SYSTEM  = ${UNAME_SYSTEM}
3156UNAME_VERSION = ${UNAME_VERSION}
3157EOF
3158
3159exit 1
3160
3161# Local variables:
3162# eval: (add-hook 'write-file-hooks 'time-stamp)
3163# time-stamp-start: "timestamp='"
3164# time-stamp-format: "%:y-%02m-%02d"
3165# time-stamp-end: "'"
3166# End:
3167>>>>>>> main
3168