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