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