1117610Sdes#! /bin/sh
2117610Sdes# Attempt to guess a canonical system name.
3255376Sdes#   Copyright 1992-2013 Free Software Foundation, Inc.
4117610Sdes
5255376Sdestimestamp='2013-05-16'
6117610Sdes
7117610Sdes# This file is free software; you can redistribute it and/or modify it
8117610Sdes# under the terms of the GNU General Public License as published by
9255376Sdes# the Free Software Foundation; either version 3 of the License, or
10117610Sdes# (at your option) any later version.
11117610Sdes#
12117610Sdes# This program is distributed in the hope that it will be useful, but
13117610Sdes# WITHOUT ANY WARRANTY; without even the implied warranty of
14117610Sdes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15117610Sdes# General Public License for more details.
16117610Sdes#
17117610Sdes# You should have received a copy of the GNU General Public License
18255376Sdes# along with this program; if not, see <http://www.gnu.org/licenses/>.
19117610Sdes#
20117610Sdes# As a special exception to the GNU General Public License, if you
21117610Sdes# distribute this file as part of a program that contains a
22117610Sdes# configuration script generated by Autoconf, you may include it under
23255376Sdes# the same distribution terms that you use for the rest of that
24255376Sdes# program.  This Exception is an additional permission under section 7
25255376Sdes# of the GNU General Public License, version 3 ("GPLv3").
26117610Sdes#
27255376Sdes# Originally written by Per Bothner.
28117610Sdes#
29255376Sdes# You can get the latest version of this script from:
30255376Sdes# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31255376Sdes#
32255376Sdes# Please send patches with a ChangeLog entry to config-patches@gnu.org.
33117610Sdes
34255376Sdes
35117610Sdesme=`echo "$0" | sed -e 's,.*/,,'`
36117610Sdes
37117610Sdesusage="\
38117610SdesUsage: $0 [OPTION]
39117610Sdes
40117610SdesOutput the configuration name of the system \`$me' is run on.
41117610Sdes
42117610SdesOperation modes:
43117610Sdes  -h, --help         print this help, then exit
44117610Sdes  -t, --time-stamp   print date of last modification, then exit
45117610Sdes  -v, --version      print version number, then exit
46117610Sdes
47117610SdesReport bugs and patches to <config-patches@gnu.org>."
48117610Sdes
49117610Sdesversion="\
50117610SdesGNU config.guess ($timestamp)
51117610Sdes
52117610SdesOriginally written by Per Bothner.
53255376SdesCopyright 1992-2013 Free Software Foundation, Inc.
54117610Sdes
55117610SdesThis is free software; see the source for copying conditions.  There is NO
56117610Sdeswarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57117610Sdes
58117610Sdeshelp="
59117610SdesTry \`$me --help' for more information."
60117610Sdes
61117610Sdes# Parse command line
62117610Sdeswhile test $# -gt 0 ; do
63117610Sdes  case $1 in
64117610Sdes    --time-stamp | --time* | -t )
65255376Sdes       echo "$timestamp" ; exit ;;
66117610Sdes    --version | -v )
67255376Sdes       echo "$version" ; exit ;;
68117610Sdes    --help | --h* | -h )
69255376Sdes       echo "$usage"; exit ;;
70117610Sdes    -- )     # Stop option processing
71117610Sdes       shift; break ;;
72117610Sdes    - )	# Use stdin as input.
73117610Sdes       break ;;
74117610Sdes    -* )
75117610Sdes       echo "$me: invalid option $1$help" >&2
76117610Sdes       exit 1 ;;
77117610Sdes    * )
78117610Sdes       break ;;
79117610Sdes  esac
80117610Sdesdone
81117610Sdes
82117610Sdesif test $# != 0; then
83117610Sdes  echo "$me: too many arguments$help" >&2
84117610Sdes  exit 1
85117610Sdesfi
86117610Sdes
87117610Sdestrap 'exit 1' 1 2 15
88117610Sdes
89117610Sdes# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
90117610Sdes# compiler to aid in system detection is discouraged as it requires
91117610Sdes# temporary files to be created and, as you can see below, it is a
92117610Sdes# headache to deal with in a portable fashion.
93117610Sdes
94117610Sdes# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
95117610Sdes# use `HOST_CC' if defined, but it is deprecated.
96117610Sdes
97117610Sdes# Portable tmp directory creation inspired by the Autoconf team.
98117610Sdes
99117610Sdesset_cc_for_build='
100117610Sdestrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101117610Sdestrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102117610Sdes: ${TMPDIR=/tmp} ;
103255376Sdes { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104117610Sdes { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105117610Sdes { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106117610Sdes { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107117610Sdesdummy=$tmp/dummy ;
108117610Sdestmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109117610Sdescase $CC_FOR_BUILD,$HOST_CC,$CC in
110117610Sdes ,,)    echo "int x;" > $dummy.c ;
111117610Sdes	for c in cc gcc c89 c99 ; do
112117610Sdes	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113117610Sdes	     CC_FOR_BUILD="$c"; break ;
114117610Sdes	  fi ;
115117610Sdes	done ;
116117610Sdes	if test x"$CC_FOR_BUILD" = x ; then
117117610Sdes	  CC_FOR_BUILD=no_compiler_found ;
118117610Sdes	fi
119117610Sdes	;;
120117610Sdes ,,*)   CC_FOR_BUILD=$CC ;;
121117610Sdes ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
122255376Sdesesac ; set_cc_for_build= ;'
123117610Sdes
124117610Sdes# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
125117610Sdes# (ghazi@noc.rutgers.edu 1994-08-24)
126117610Sdesif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
127117610Sdes	PATH=$PATH:/.attbin ; export PATH
128117610Sdesfi
129117610Sdes
130117610SdesUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
131117610SdesUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
132117610SdesUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
133117610SdesUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
134117610Sdes
135255376Sdescase "${UNAME_SYSTEM}" in
136255376SdesLinux|GNU|GNU/*)
137255376Sdes	# If the system lacks a compiler, then just pick glibc.
138255376Sdes	# We could probably try harder.
139255376Sdes	LIBC=gnu
140255376Sdes
141255376Sdes	eval $set_cc_for_build
142255376Sdes	cat <<-EOF > $dummy.c
143255376Sdes	#include <features.h>
144255376Sdes	#if defined(__UCLIBC__)
145255376Sdes	LIBC=uclibc
146255376Sdes	#elif defined(__dietlibc__)
147255376Sdes	LIBC=dietlibc
148255376Sdes	#else
149255376Sdes	LIBC=gnu
150255376Sdes	#endif
151255376Sdes	EOF
152255376Sdes	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
153255376Sdes	;;
154255376Sdesesac
155255376Sdes
156117610Sdes# Note: order is significant - the case branches are not exclusive.
157117610Sdes
158117610Sdescase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
159117610Sdes    *:NetBSD:*:*)
160117610Sdes	# NetBSD (nbsd) targets should (where applicable) match one or
161255376Sdes	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
162117610Sdes	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
163117610Sdes	# switched to ELF, *-*-netbsd* would select the old
164117610Sdes	# object file format.  This provides both forward
165117610Sdes	# compatibility and a consistent mechanism for selecting the
166117610Sdes	# object file format.
167117610Sdes	#
168117610Sdes	# Note: NetBSD doesn't particularly care about the vendor
169117610Sdes	# portion of the name.  We always set it to "unknown".
170117610Sdes	sysctl="sysctl -n hw.machine_arch"
171117610Sdes	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
172117610Sdes	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
173117610Sdes	case "${UNAME_MACHINE_ARCH}" in
174117610Sdes	    armeb) machine=armeb-unknown ;;
175117610Sdes	    arm*) machine=arm-unknown ;;
176117610Sdes	    sh3el) machine=shl-unknown ;;
177117610Sdes	    sh3eb) machine=sh-unknown ;;
178255376Sdes	    sh5el) machine=sh5le-unknown ;;
179117610Sdes	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
180117610Sdes	esac
181117610Sdes	# The Operating System including object format, if it has switched
182117610Sdes	# to ELF recently, or will in the future.
183117610Sdes	case "${UNAME_MACHINE_ARCH}" in
184117610Sdes	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
185117610Sdes		eval $set_cc_for_build
186117610Sdes		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
187255376Sdes			| grep -q __ELF__
188117610Sdes		then
189117610Sdes		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
190117610Sdes		    # Return netbsd for either.  FIX?
191117610Sdes		    os=netbsd
192117610Sdes		else
193117610Sdes		    os=netbsdelf
194117610Sdes		fi
195117610Sdes		;;
196117610Sdes	    *)
197255376Sdes		os=netbsd
198117610Sdes		;;
199117610Sdes	esac
200117610Sdes	# The OS release
201117610Sdes	# Debian GNU/NetBSD machines have a different userland, and
202117610Sdes	# thus, need a distinct triplet. However, they do not need
203117610Sdes	# kernel version information, so it can be replaced with a
204117610Sdes	# suitable tag, in the style of linux-gnu.
205117610Sdes	case "${UNAME_VERSION}" in
206117610Sdes	    Debian*)
207117610Sdes		release='-gnu'
208117610Sdes		;;
209117610Sdes	    *)
210117610Sdes		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
211117610Sdes		;;
212117610Sdes	esac
213117610Sdes	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
214117610Sdes	# contains redundant information, the shorter form:
215117610Sdes	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
216117610Sdes	echo "${machine}-${os}${release}"
217255376Sdes	exit ;;
218255376Sdes    *:Bitrig:*:*)
219255376Sdes	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
220255376Sdes	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
221255376Sdes	exit ;;
222117610Sdes    *:OpenBSD:*:*)
223255376Sdes	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
224255376Sdes	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
225255376Sdes	exit ;;
226255376Sdes    *:ekkoBSD:*:*)
227255376Sdes	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
228255376Sdes	exit ;;
229255376Sdes    *:SolidBSD:*:*)
230255376Sdes	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
231255376Sdes	exit ;;
232255376Sdes    macppc:MirBSD:*:*)
233255376Sdes	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
234255376Sdes	exit ;;
235255376Sdes    *:MirBSD:*:*)
236255376Sdes	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
237255376Sdes	exit ;;
238117610Sdes    alpha:OSF1:*:*)
239255376Sdes	case $UNAME_RELEASE in
240255376Sdes	*4.0)
241117610Sdes		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
242255376Sdes		;;
243255376Sdes	*5.*)
244255376Sdes		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
245255376Sdes		;;
246255376Sdes	esac
247117610Sdes	# According to Compaq, /usr/sbin/psrinfo has been available on
248117610Sdes	# OSF/1 and Tru64 systems produced since 1995.  I hope that
249117610Sdes	# covers most systems running today.  This code pipes the CPU
250117610Sdes	# types through head -n 1, so we only detect the type of CPU 0.
251117610Sdes	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
252117610Sdes	case "$ALPHA_CPU_TYPE" in
253117610Sdes	    "EV4 (21064)")
254117610Sdes		UNAME_MACHINE="alpha" ;;
255117610Sdes	    "EV4.5 (21064)")
256117610Sdes		UNAME_MACHINE="alpha" ;;
257117610Sdes	    "LCA4 (21066/21068)")
258117610Sdes		UNAME_MACHINE="alpha" ;;
259117610Sdes	    "EV5 (21164)")
260117610Sdes		UNAME_MACHINE="alphaev5" ;;
261117610Sdes	    "EV5.6 (21164A)")
262117610Sdes		UNAME_MACHINE="alphaev56" ;;
263117610Sdes	    "EV5.6 (21164PC)")
264117610Sdes		UNAME_MACHINE="alphapca56" ;;
265117610Sdes	    "EV5.7 (21164PC)")
266117610Sdes		UNAME_MACHINE="alphapca57" ;;
267117610Sdes	    "EV6 (21264)")
268117610Sdes		UNAME_MACHINE="alphaev6" ;;
269117610Sdes	    "EV6.7 (21264A)")
270117610Sdes		UNAME_MACHINE="alphaev67" ;;
271117610Sdes	    "EV6.8CB (21264C)")
272117610Sdes		UNAME_MACHINE="alphaev68" ;;
273117610Sdes	    "EV6.8AL (21264B)")
274117610Sdes		UNAME_MACHINE="alphaev68" ;;
275117610Sdes	    "EV6.8CX (21264D)")
276117610Sdes		UNAME_MACHINE="alphaev68" ;;
277117610Sdes	    "EV6.9A (21264/EV69A)")
278117610Sdes		UNAME_MACHINE="alphaev69" ;;
279117610Sdes	    "EV7 (21364)")
280117610Sdes		UNAME_MACHINE="alphaev7" ;;
281117610Sdes	    "EV7.9 (21364A)")
282117610Sdes		UNAME_MACHINE="alphaev79" ;;
283117610Sdes	esac
284255376Sdes	# A Pn.n version is a patched version.
285117610Sdes	# A Vn.n version is a released version.
286117610Sdes	# A Tn.n version is a released field test version.
287117610Sdes	# A Xn.n version is an unreleased experimental baselevel.
288117610Sdes	# 1.2 uses "1.2" for uname -r.
289255376Sdes	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
290255376Sdes	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
291255376Sdes	exitcode=$?
292255376Sdes	trap '' 0
293255376Sdes	exit $exitcode ;;
294117610Sdes    Alpha\ *:Windows_NT*:*)
295117610Sdes	# How do we know it's Interix rather than the generic POSIX subsystem?
296117610Sdes	# Should we change UNAME_MACHINE based on the output of uname instead
297117610Sdes	# of the specific Alpha model?
298117610Sdes	echo alpha-pc-interix
299255376Sdes	exit ;;
300117610Sdes    21064:Windows_NT:50:3)
301117610Sdes	echo alpha-dec-winnt3.5
302255376Sdes	exit ;;
303117610Sdes    Amiga*:UNIX_System_V:4.0:*)
304117610Sdes	echo m68k-unknown-sysv4
305255376Sdes	exit ;;
306117610Sdes    *:[Aa]miga[Oo][Ss]:*:*)
307117610Sdes	echo ${UNAME_MACHINE}-unknown-amigaos
308255376Sdes	exit ;;
309117610Sdes    *:[Mm]orph[Oo][Ss]:*:*)
310117610Sdes	echo ${UNAME_MACHINE}-unknown-morphos
311255376Sdes	exit ;;
312117610Sdes    *:OS/390:*:*)
313117610Sdes	echo i370-ibm-openedition
314255376Sdes	exit ;;
315255376Sdes    *:z/VM:*:*)
316255376Sdes	echo s390-ibm-zvmoe
317255376Sdes	exit ;;
318255376Sdes    *:OS400:*:*)
319255376Sdes	echo powerpc-ibm-os400
320255376Sdes	exit ;;
321117610Sdes    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
322117610Sdes	echo arm-acorn-riscix${UNAME_RELEASE}
323255376Sdes	exit ;;
324255376Sdes    arm*:riscos:*:*|arm*:RISCOS:*:*)
325255376Sdes	echo arm-unknown-riscos
326255376Sdes	exit ;;
327117610Sdes    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
328117610Sdes	echo hppa1.1-hitachi-hiuxmpp
329255376Sdes	exit ;;
330117610Sdes    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
331117610Sdes	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
332117610Sdes	if test "`(/bin/universe) 2>/dev/null`" = att ; then
333117610Sdes		echo pyramid-pyramid-sysv3
334117610Sdes	else
335117610Sdes		echo pyramid-pyramid-bsd
336117610Sdes	fi
337255376Sdes	exit ;;
338117610Sdes    NILE*:*:*:dcosx)
339117610Sdes	echo pyramid-pyramid-svr4
340255376Sdes	exit ;;
341117610Sdes    DRS?6000:unix:4.0:6*)
342117610Sdes	echo sparc-icl-nx6
343255376Sdes	exit ;;
344255376Sdes    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
345117610Sdes	case `/usr/bin/uname -p` in
346255376Sdes	    sparc) echo sparc-icl-nx7; exit ;;
347117610Sdes	esac ;;
348255376Sdes    s390x:SunOS:*:*)
349255376Sdes	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
350255376Sdes	exit ;;
351117610Sdes    sun4H:SunOS:5.*:*)
352117610Sdes	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
353255376Sdes	exit ;;
354117610Sdes    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
355117610Sdes	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356255376Sdes	exit ;;
357255376Sdes    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
358255376Sdes	echo i386-pc-auroraux${UNAME_RELEASE}
359255376Sdes	exit ;;
360255376Sdes    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
361255376Sdes	eval $set_cc_for_build
362255376Sdes	SUN_ARCH="i386"
363255376Sdes	# If there is a compiler, see if it is configured for 64-bit objects.
364255376Sdes	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
365255376Sdes	# This test works for both compilers.
366255376Sdes	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
367255376Sdes	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
368255376Sdes		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
369255376Sdes		grep IS_64BIT_ARCH >/dev/null
370255376Sdes	    then
371255376Sdes		SUN_ARCH="x86_64"
372255376Sdes	    fi
373255376Sdes	fi
374255376Sdes	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
375255376Sdes	exit ;;
376117610Sdes    sun4*:SunOS:6*:*)
377117610Sdes	# According to config.sub, this is the proper way to canonicalize
378117610Sdes	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
379117610Sdes	# it's likely to be more like Solaris than SunOS4.
380117610Sdes	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
381255376Sdes	exit ;;
382117610Sdes    sun4*:SunOS:*:*)
383117610Sdes	case "`/usr/bin/arch -k`" in
384117610Sdes	    Series*|S4*)
385117610Sdes		UNAME_RELEASE=`uname -v`
386117610Sdes		;;
387117610Sdes	esac
388117610Sdes	# Japanese Language versions have a version number like `4.1.3-JL'.
389117610Sdes	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
390255376Sdes	exit ;;
391117610Sdes    sun3*:SunOS:*:*)
392117610Sdes	echo m68k-sun-sunos${UNAME_RELEASE}
393255376Sdes	exit ;;
394117610Sdes    sun*:*:4.2BSD:*)
395117610Sdes	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
396117610Sdes	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
397117610Sdes	case "`/bin/arch`" in
398117610Sdes	    sun3)
399117610Sdes		echo m68k-sun-sunos${UNAME_RELEASE}
400117610Sdes		;;
401117610Sdes	    sun4)
402117610Sdes		echo sparc-sun-sunos${UNAME_RELEASE}
403117610Sdes		;;
404117610Sdes	esac
405255376Sdes	exit ;;
406117610Sdes    aushp:SunOS:*:*)
407117610Sdes	echo sparc-auspex-sunos${UNAME_RELEASE}
408255376Sdes	exit ;;
409117610Sdes    # The situation for MiNT is a little confusing.  The machine name
410117610Sdes    # can be virtually everything (everything which is not
411117610Sdes    # "atarist" or "atariste" at least should have a processor
412117610Sdes    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
413117610Sdes    # to the lowercase version "mint" (or "freemint").  Finally
414117610Sdes    # the system name "TOS" denotes a system which is actually not
415117610Sdes    # MiNT.  But MiNT is downward compatible to TOS, so this should
416117610Sdes    # be no problem.
417117610Sdes    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
418255376Sdes	echo m68k-atari-mint${UNAME_RELEASE}
419255376Sdes	exit ;;
420117610Sdes    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
421117610Sdes	echo m68k-atari-mint${UNAME_RELEASE}
422255376Sdes	exit ;;
423117610Sdes    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
424255376Sdes	echo m68k-atari-mint${UNAME_RELEASE}
425255376Sdes	exit ;;
426117610Sdes    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
427255376Sdes	echo m68k-milan-mint${UNAME_RELEASE}
428255376Sdes	exit ;;
429117610Sdes    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
430255376Sdes	echo m68k-hades-mint${UNAME_RELEASE}
431255376Sdes	exit ;;
432117610Sdes    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
433255376Sdes	echo m68k-unknown-mint${UNAME_RELEASE}
434255376Sdes	exit ;;
435255376Sdes    m68k:machten:*:*)
436255376Sdes	echo m68k-apple-machten${UNAME_RELEASE}
437255376Sdes	exit ;;
438117610Sdes    powerpc:machten:*:*)
439117610Sdes	echo powerpc-apple-machten${UNAME_RELEASE}
440255376Sdes	exit ;;
441117610Sdes    RISC*:Mach:*:*)
442117610Sdes	echo mips-dec-mach_bsd4.3
443255376Sdes	exit ;;
444117610Sdes    RISC*:ULTRIX:*:*)
445117610Sdes	echo mips-dec-ultrix${UNAME_RELEASE}
446255376Sdes	exit ;;
447117610Sdes    VAX*:ULTRIX*:*:*)
448117610Sdes	echo vax-dec-ultrix${UNAME_RELEASE}
449255376Sdes	exit ;;
450117610Sdes    2020:CLIX:*:* | 2430:CLIX:*:*)
451117610Sdes	echo clipper-intergraph-clix${UNAME_RELEASE}
452255376Sdes	exit ;;
453117610Sdes    mips:*:*:UMIPS | mips:*:*:RISCos)
454117610Sdes	eval $set_cc_for_build
455117610Sdes	sed 's/^	//' << EOF >$dummy.c
456117610Sdes#ifdef __cplusplus
457117610Sdes#include <stdio.h>  /* for printf() prototype */
458117610Sdes	int main (int argc, char *argv[]) {
459117610Sdes#else
460117610Sdes	int main (argc, argv) int argc; char *argv[]; {
461117610Sdes#endif
462117610Sdes	#if defined (host_mips) && defined (MIPSEB)
463117610Sdes	#if defined (SYSTYPE_SYSV)
464117610Sdes	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
465117610Sdes	#endif
466117610Sdes	#if defined (SYSTYPE_SVR4)
467117610Sdes	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
468117610Sdes	#endif
469117610Sdes	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
470117610Sdes	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
471117610Sdes	#endif
472117610Sdes	#endif
473117610Sdes	  exit (-1);
474117610Sdes	}
475117610SdesEOF
476255376Sdes	$CC_FOR_BUILD -o $dummy $dummy.c &&
477255376Sdes	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
478255376Sdes	  SYSTEM_NAME=`$dummy $dummyarg` &&
479255376Sdes	    { echo "$SYSTEM_NAME"; exit; }
480117610Sdes	echo mips-mips-riscos${UNAME_RELEASE}
481255376Sdes	exit ;;
482117610Sdes    Motorola:PowerMAX_OS:*:*)
483117610Sdes	echo powerpc-motorola-powermax
484255376Sdes	exit ;;
485117610Sdes    Motorola:*:4.3:PL8-*)
486117610Sdes	echo powerpc-harris-powermax
487255376Sdes	exit ;;
488117610Sdes    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
489117610Sdes	echo powerpc-harris-powermax
490255376Sdes	exit ;;
491117610Sdes    Night_Hawk:Power_UNIX:*:*)
492117610Sdes	echo powerpc-harris-powerunix
493255376Sdes	exit ;;
494117610Sdes    m88k:CX/UX:7*:*)
495117610Sdes	echo m88k-harris-cxux7
496255376Sdes	exit ;;
497117610Sdes    m88k:*:4*:R4*)
498117610Sdes	echo m88k-motorola-sysv4
499255376Sdes	exit ;;
500117610Sdes    m88k:*:3*:R3*)
501117610Sdes	echo m88k-motorola-sysv3
502255376Sdes	exit ;;
503117610Sdes    AViiON:dgux:*:*)
504255376Sdes	# DG/UX returns AViiON for all architectures
505255376Sdes	UNAME_PROCESSOR=`/usr/bin/uname -p`
506117610Sdes	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
507117610Sdes	then
508117610Sdes	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
509117610Sdes	       [ ${TARGET_BINARY_INTERFACE}x = x ]
510117610Sdes	    then
511117610Sdes		echo m88k-dg-dgux${UNAME_RELEASE}
512117610Sdes	    else
513117610Sdes		echo m88k-dg-dguxbcs${UNAME_RELEASE}
514117610Sdes	    fi
515117610Sdes	else
516117610Sdes	    echo i586-dg-dgux${UNAME_RELEASE}
517117610Sdes	fi
518255376Sdes	exit ;;
519117610Sdes    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
520117610Sdes	echo m88k-dolphin-sysv3
521255376Sdes	exit ;;
522117610Sdes    M88*:*:R3*:*)
523117610Sdes	# Delta 88k system running SVR3
524117610Sdes	echo m88k-motorola-sysv3
525255376Sdes	exit ;;
526117610Sdes    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
527117610Sdes	echo m88k-tektronix-sysv3
528255376Sdes	exit ;;
529117610Sdes    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
530117610Sdes	echo m68k-tektronix-bsd
531255376Sdes	exit ;;
532117610Sdes    *:IRIX*:*:*)
533117610Sdes	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
534255376Sdes	exit ;;
535117610Sdes    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
536255376Sdes	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
537255376Sdes	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
538117610Sdes    i*86:AIX:*:*)
539117610Sdes	echo i386-ibm-aix
540255376Sdes	exit ;;
541117610Sdes    ia64:AIX:*:*)
542117610Sdes	if [ -x /usr/bin/oslevel ] ; then
543117610Sdes		IBM_REV=`/usr/bin/oslevel`
544117610Sdes	else
545117610Sdes		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
546117610Sdes	fi
547117610Sdes	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
548255376Sdes	exit ;;
549117610Sdes    *:AIX:2:3)
550117610Sdes	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
551117610Sdes		eval $set_cc_for_build
552117610Sdes		sed 's/^		//' << EOF >$dummy.c
553117610Sdes		#include <sys/systemcfg.h>
554117610Sdes
555117610Sdes		main()
556117610Sdes			{
557117610Sdes			if (!__power_pc())
558117610Sdes				exit(1);
559117610Sdes			puts("powerpc-ibm-aix3.2.5");
560117610Sdes			exit(0);
561117610Sdes			}
562117610SdesEOF
563255376Sdes		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
564255376Sdes		then
565255376Sdes			echo "$SYSTEM_NAME"
566255376Sdes		else
567255376Sdes			echo rs6000-ibm-aix3.2.5
568255376Sdes		fi
569117610Sdes	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
570117610Sdes		echo rs6000-ibm-aix3.2.4
571117610Sdes	else
572117610Sdes		echo rs6000-ibm-aix3.2
573117610Sdes	fi
574255376Sdes	exit ;;
575255376Sdes    *:AIX:*:[4567])
576117610Sdes	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
577117610Sdes	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
578117610Sdes		IBM_ARCH=rs6000
579117610Sdes	else
580117610Sdes		IBM_ARCH=powerpc
581117610Sdes	fi
582117610Sdes	if [ -x /usr/bin/oslevel ] ; then
583117610Sdes		IBM_REV=`/usr/bin/oslevel`
584117610Sdes	else
585117610Sdes		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
586117610Sdes	fi
587117610Sdes	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
588255376Sdes	exit ;;
589117610Sdes    *:AIX:*:*)
590117610Sdes	echo rs6000-ibm-aix
591255376Sdes	exit ;;
592117610Sdes    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
593117610Sdes	echo romp-ibm-bsd4.4
594255376Sdes	exit ;;
595117610Sdes    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
596117610Sdes	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
597255376Sdes	exit ;;                             # report: romp-ibm BSD 4.3
598117610Sdes    *:BOSX:*:*)
599117610Sdes	echo rs6000-bull-bosx
600255376Sdes	exit ;;
601117610Sdes    DPX/2?00:B.O.S.:*:*)
602117610Sdes	echo m68k-bull-sysv3
603255376Sdes	exit ;;
604117610Sdes    9000/[34]??:4.3bsd:1.*:*)
605117610Sdes	echo m68k-hp-bsd
606255376Sdes	exit ;;
607117610Sdes    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
608117610Sdes	echo m68k-hp-bsd4.4
609255376Sdes	exit ;;
610117610Sdes    9000/[34678]??:HP-UX:*:*)
611117610Sdes	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
612117610Sdes	case "${UNAME_MACHINE}" in
613117610Sdes	    9000/31? )            HP_ARCH=m68000 ;;
614117610Sdes	    9000/[34]?? )         HP_ARCH=m68k ;;
615117610Sdes	    9000/[678][0-9][0-9])
616117610Sdes		if [ -x /usr/bin/getconf ]; then
617117610Sdes		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618255376Sdes		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619255376Sdes		    case "${sc_cpu_version}" in
620255376Sdes		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621255376Sdes		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
622255376Sdes		      532)                      # CPU_PA_RISC2_0
623255376Sdes			case "${sc_kernel_bits}" in
624255376Sdes			  32) HP_ARCH="hppa2.0n" ;;
625255376Sdes			  64) HP_ARCH="hppa2.0w" ;;
626117610Sdes			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
627255376Sdes			esac ;;
628255376Sdes		    esac
629117610Sdes		fi
630117610Sdes		if [ "${HP_ARCH}" = "" ]; then
631117610Sdes		    eval $set_cc_for_build
632255376Sdes		    sed 's/^		//' << EOF >$dummy.c
633117610Sdes
634255376Sdes		#define _HPUX_SOURCE
635255376Sdes		#include <stdlib.h>
636255376Sdes		#include <unistd.h>
637117610Sdes
638255376Sdes		int main ()
639255376Sdes		{
640255376Sdes		#if defined(_SC_KERNEL_BITS)
641255376Sdes		    long bits = sysconf(_SC_KERNEL_BITS);
642255376Sdes		#endif
643255376Sdes		    long cpu  = sysconf (_SC_CPU_VERSION);
644117610Sdes
645255376Sdes		    switch (cpu)
646255376Sdes			{
647255376Sdes			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
648255376Sdes			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
649255376Sdes			case CPU_PA_RISC2_0:
650255376Sdes		#if defined(_SC_KERNEL_BITS)
651255376Sdes			    switch (bits)
652255376Sdes				{
653255376Sdes				case 64: puts ("hppa2.0w"); break;
654255376Sdes				case 32: puts ("hppa2.0n"); break;
655255376Sdes				default: puts ("hppa2.0"); break;
656255376Sdes				} break;
657255376Sdes		#else  /* !defined(_SC_KERNEL_BITS) */
658255376Sdes			    puts ("hppa2.0"); break;
659255376Sdes		#endif
660255376Sdes			default: puts ("hppa1.0"); break;
661255376Sdes			}
662255376Sdes		    exit (0);
663255376Sdes		}
664117610SdesEOF
665117610Sdes		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
666117610Sdes		    test -z "$HP_ARCH" && HP_ARCH=hppa
667117610Sdes		fi ;;
668117610Sdes	esac
669117610Sdes	if [ ${HP_ARCH} = "hppa2.0w" ]
670117610Sdes	then
671255376Sdes	    eval $set_cc_for_build
672255376Sdes
673255376Sdes	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
674255376Sdes	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
675255376Sdes	    # generating 64-bit code.  GNU and HP use different nomenclature:
676255376Sdes	    #
677255376Sdes	    # $ CC_FOR_BUILD=cc ./config.guess
678255376Sdes	    # => hppa2.0w-hp-hpux11.23
679255376Sdes	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
680255376Sdes	    # => hppa64-hp-hpux11.23
681255376Sdes
682255376Sdes	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
683255376Sdes		grep -q __LP64__
684117610Sdes	    then
685117610Sdes		HP_ARCH="hppa2.0w"
686117610Sdes	    else
687117610Sdes		HP_ARCH="hppa64"
688117610Sdes	    fi
689117610Sdes	fi
690117610Sdes	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
691255376Sdes	exit ;;
692117610Sdes    ia64:HP-UX:*:*)
693117610Sdes	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
694117610Sdes	echo ia64-hp-hpux${HPUX_REV}
695255376Sdes	exit ;;
696117610Sdes    3050*:HI-UX:*:*)
697117610Sdes	eval $set_cc_for_build
698117610Sdes	sed 's/^	//' << EOF >$dummy.c
699117610Sdes	#include <unistd.h>
700117610Sdes	int
701117610Sdes	main ()
702117610Sdes	{
703117610Sdes	  long cpu = sysconf (_SC_CPU_VERSION);
704117610Sdes	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
705117610Sdes	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
706117610Sdes	     results, however.  */
707117610Sdes	  if (CPU_IS_PA_RISC (cpu))
708117610Sdes	    {
709117610Sdes	      switch (cpu)
710117610Sdes		{
711117610Sdes		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
712117610Sdes		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
713117610Sdes		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
714117610Sdes		  default: puts ("hppa-hitachi-hiuxwe2"); break;
715117610Sdes		}
716117610Sdes	    }
717117610Sdes	  else if (CPU_IS_HP_MC68K (cpu))
718117610Sdes	    puts ("m68k-hitachi-hiuxwe2");
719117610Sdes	  else puts ("unknown-hitachi-hiuxwe2");
720117610Sdes	  exit (0);
721117610Sdes	}
722117610SdesEOF
723255376Sdes	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
724255376Sdes		{ echo "$SYSTEM_NAME"; exit; }
725117610Sdes	echo unknown-hitachi-hiuxwe2
726255376Sdes	exit ;;
727117610Sdes    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
728117610Sdes	echo hppa1.1-hp-bsd
729255376Sdes	exit ;;
730117610Sdes    9000/8??:4.3bsd:*:*)
731117610Sdes	echo hppa1.0-hp-bsd
732255376Sdes	exit ;;
733117610Sdes    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
734117610Sdes	echo hppa1.0-hp-mpeix
735255376Sdes	exit ;;
736117610Sdes    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
737117610Sdes	echo hppa1.1-hp-osf
738255376Sdes	exit ;;
739117610Sdes    hp8??:OSF1:*:*)
740117610Sdes	echo hppa1.0-hp-osf
741255376Sdes	exit ;;
742117610Sdes    i*86:OSF1:*:*)
743117610Sdes	if [ -x /usr/sbin/sysversion ] ; then
744117610Sdes	    echo ${UNAME_MACHINE}-unknown-osf1mk
745117610Sdes	else
746117610Sdes	    echo ${UNAME_MACHINE}-unknown-osf1
747117610Sdes	fi
748255376Sdes	exit ;;
749117610Sdes    parisc*:Lites*:*:*)
750117610Sdes	echo hppa1.1-hp-lites
751255376Sdes	exit ;;
752117610Sdes    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
753117610Sdes	echo c1-convex-bsd
754255376Sdes	exit ;;
755117610Sdes    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
756117610Sdes	if getsysinfo -f scalar_acc
757117610Sdes	then echo c32-convex-bsd
758117610Sdes	else echo c2-convex-bsd
759117610Sdes	fi
760255376Sdes	exit ;;
761117610Sdes    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
762117610Sdes	echo c34-convex-bsd
763255376Sdes	exit ;;
764117610Sdes    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
765117610Sdes	echo c38-convex-bsd
766255376Sdes	exit ;;
767117610Sdes    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
768117610Sdes	echo c4-convex-bsd
769255376Sdes	exit ;;
770117610Sdes    CRAY*Y-MP:*:*:*)
771117610Sdes	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
772255376Sdes	exit ;;
773117610Sdes    CRAY*[A-Z]90:*:*:*)
774117610Sdes	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
775117610Sdes	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
776117610Sdes	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
777117610Sdes	      -e 's/\.[^.]*$/.X/'
778255376Sdes	exit ;;
779117610Sdes    CRAY*TS:*:*:*)
780117610Sdes	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
781255376Sdes	exit ;;
782117610Sdes    CRAY*T3E:*:*:*)
783117610Sdes	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
784255376Sdes	exit ;;
785117610Sdes    CRAY*SV1:*:*:*)
786117610Sdes	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
787255376Sdes	exit ;;
788117610Sdes    *:UNICOS/mp:*:*)
789255376Sdes	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
790255376Sdes	exit ;;
791117610Sdes    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
792117610Sdes	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793255376Sdes	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794255376Sdes	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
795255376Sdes	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796255376Sdes	exit ;;
797255376Sdes    5000:UNIX_System_V:4.*:*)
798255376Sdes	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799255376Sdes	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
800255376Sdes	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
801255376Sdes	exit ;;
802117610Sdes    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
803117610Sdes	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
804255376Sdes	exit ;;
805117610Sdes    sparc*:BSD/OS:*:*)
806117610Sdes	echo sparc-unknown-bsdi${UNAME_RELEASE}
807255376Sdes	exit ;;
808117610Sdes    *:BSD/OS:*:*)
809117610Sdes	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
810255376Sdes	exit ;;
811255376Sdes    *:FreeBSD:*:*)
812255376Sdes	UNAME_PROCESSOR=`/usr/bin/uname -p`
813255376Sdes	echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
814255376Sdes	exit ;;
815117610Sdes    i*:CYGWIN*:*)
816117610Sdes	echo ${UNAME_MACHINE}-pc-cygwin
817255376Sdes	exit ;;
818255376Sdes    *:MINGW64*:*)
819255376Sdes	echo ${UNAME_MACHINE}-pc-mingw64
820255376Sdes	exit ;;
821255376Sdes    *:MINGW*:*)
822117610Sdes	echo ${UNAME_MACHINE}-pc-mingw32
823255376Sdes	exit ;;
824255376Sdes    i*:MSYS*:*)
825255376Sdes	echo ${UNAME_MACHINE}-pc-msys
826255376Sdes	exit ;;
827255376Sdes    i*:windows32*:*)
828255376Sdes	# uname -m includes "-pc" on this system.
829255376Sdes	echo ${UNAME_MACHINE}-mingw32
830255376Sdes	exit ;;
831117610Sdes    i*:PW*:*)
832117610Sdes	echo ${UNAME_MACHINE}-pc-pw32
833255376Sdes	exit ;;
834255376Sdes    *:Interix*:*)
835255376Sdes	case ${UNAME_MACHINE} in
836255376Sdes	    x86)
837255376Sdes		echo i586-pc-interix${UNAME_RELEASE}
838255376Sdes		exit ;;
839255376Sdes	    authenticamd | genuineintel | EM64T)
840255376Sdes		echo x86_64-unknown-interix${UNAME_RELEASE}
841255376Sdes		exit ;;
842255376Sdes	    IA64)
843255376Sdes		echo ia64-unknown-interix${UNAME_RELEASE}
844255376Sdes		exit ;;
845255376Sdes	esac ;;
846117610Sdes    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
847117610Sdes	echo i${UNAME_MACHINE}-pc-mks
848255376Sdes	exit ;;
849255376Sdes    8664:Windows_NT:*)
850255376Sdes	echo x86_64-pc-mks
851255376Sdes	exit ;;
852117610Sdes    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
853117610Sdes	# How do we know it's Interix rather than the generic POSIX subsystem?
854117610Sdes	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
855117610Sdes	# UNAME_MACHINE based on the output of uname instead of i386?
856117610Sdes	echo i586-pc-interix
857255376Sdes	exit ;;
858117610Sdes    i*:UWIN*:*)
859117610Sdes	echo ${UNAME_MACHINE}-pc-uwin
860255376Sdes	exit ;;
861255376Sdes    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
862255376Sdes	echo x86_64-unknown-cygwin
863255376Sdes	exit ;;
864117610Sdes    p*:CYGWIN*:*)
865117610Sdes	echo powerpcle-unknown-cygwin
866255376Sdes	exit ;;
867117610Sdes    prep*:SunOS:5.*:*)
868117610Sdes	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
869255376Sdes	exit ;;
870117610Sdes    *:GNU:*:*)
871255376Sdes	# the GNU system
872255376Sdes	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
873255376Sdes	exit ;;
874255376Sdes    *:GNU/*:*:*)
875255376Sdes	# other systems with GNU libc and userland
876255376Sdes	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
877255376Sdes	exit ;;
878117610Sdes    i*86:Minix:*:*)
879117610Sdes	echo ${UNAME_MACHINE}-pc-minix
880255376Sdes	exit ;;
881255376Sdes    aarch64:Linux:*:*)
882255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
883255376Sdes	exit ;;
884255376Sdes    aarch64_be:Linux:*:*)
885255376Sdes	UNAME_MACHINE=aarch64_be
886255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
887255376Sdes	exit ;;
888255376Sdes    alpha:Linux:*:*)
889255376Sdes	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
890255376Sdes	  EV5)   UNAME_MACHINE=alphaev5 ;;
891255376Sdes	  EV56)  UNAME_MACHINE=alphaev56 ;;
892255376Sdes	  PCA56) UNAME_MACHINE=alphapca56 ;;
893255376Sdes	  PCA57) UNAME_MACHINE=alphapca56 ;;
894255376Sdes	  EV6)   UNAME_MACHINE=alphaev6 ;;
895255376Sdes	  EV67)  UNAME_MACHINE=alphaev67 ;;
896255376Sdes	  EV68*) UNAME_MACHINE=alphaev68 ;;
897255376Sdes	esac
898255376Sdes	objdump --private-headers /bin/sh | grep -q ld.so.1
899255376Sdes	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
900255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
901255376Sdes	exit ;;
902255376Sdes    arc:Linux:*:* | arceb:Linux:*:*)
903255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
904255376Sdes	exit ;;
905117610Sdes    arm*:Linux:*:*)
906255376Sdes	eval $set_cc_for_build
907255376Sdes	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
908255376Sdes	    | grep -q __ARM_EABI__
909255376Sdes	then
910255376Sdes	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
911255376Sdes	else
912255376Sdes	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
913255376Sdes		| grep -q __ARM_PCS_VFP
914255376Sdes	    then
915255376Sdes		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
916255376Sdes	    else
917255376Sdes		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
918255376Sdes	    fi
919255376Sdes	fi
920255376Sdes	exit ;;
921255376Sdes    avr32*:Linux:*:*)
922255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
923255376Sdes	exit ;;
924117610Sdes    cris:Linux:*:*)
925255376Sdes	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
926255376Sdes	exit ;;
927255376Sdes    crisv32:Linux:*:*)
928255376Sdes	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
929255376Sdes	exit ;;
930255376Sdes    frv:Linux:*:*)
931255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
932255376Sdes	exit ;;
933255376Sdes    hexagon:Linux:*:*)
934255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
935255376Sdes	exit ;;
936255376Sdes    i*86:Linux:*:*)
937255376Sdes	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
938255376Sdes	exit ;;
939117610Sdes    ia64:Linux:*:*)
940255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
941255376Sdes	exit ;;
942255376Sdes    m32r*:Linux:*:*)
943255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
944255376Sdes	exit ;;
945117610Sdes    m68*:Linux:*:*)
946255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
947255376Sdes	exit ;;
948255376Sdes    mips:Linux:*:* | mips64:Linux:*:*)
949117610Sdes	eval $set_cc_for_build
950117610Sdes	sed 's/^	//' << EOF >$dummy.c
951117610Sdes	#undef CPU
952255376Sdes	#undef ${UNAME_MACHINE}
953255376Sdes	#undef ${UNAME_MACHINE}el
954117610Sdes	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
955255376Sdes	CPU=${UNAME_MACHINE}el
956117610Sdes	#else
957117610Sdes	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
958255376Sdes	CPU=${UNAME_MACHINE}
959117610Sdes	#else
960117610Sdes	CPU=
961117610Sdes	#endif
962117610Sdes	#endif
963117610SdesEOF
964255376Sdes	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
965255376Sdes	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
966117610Sdes	;;
967255376Sdes    or1k:Linux:*:*)
968255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
969255376Sdes	exit ;;
970255376Sdes    or32:Linux:*:*)
971255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
972255376Sdes	exit ;;
973255376Sdes    padre:Linux:*:*)
974255376Sdes	echo sparc-unknown-linux-${LIBC}
975255376Sdes	exit ;;
976255376Sdes    parisc64:Linux:*:* | hppa64:Linux:*:*)
977255376Sdes	echo hppa64-unknown-linux-${LIBC}
978255376Sdes	exit ;;
979117610Sdes    parisc:Linux:*:* | hppa:Linux:*:*)
980117610Sdes	# Look for CPU level
981117610Sdes	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
982255376Sdes	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
983255376Sdes	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
984255376Sdes	  *)    echo hppa-unknown-linux-${LIBC} ;;
985117610Sdes	esac
986255376Sdes	exit ;;
987255376Sdes    ppc64:Linux:*:*)
988255376Sdes	echo powerpc64-unknown-linux-${LIBC}
989255376Sdes	exit ;;
990255376Sdes    ppc:Linux:*:*)
991255376Sdes	echo powerpc-unknown-linux-${LIBC}
992255376Sdes	exit ;;
993117610Sdes    s390:Linux:*:* | s390x:Linux:*:*)
994255376Sdes	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
995255376Sdes	exit ;;
996117610Sdes    sh64*:Linux:*:*)
997255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
998255376Sdes	exit ;;
999117610Sdes    sh*:Linux:*:*)
1000255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1001255376Sdes	exit ;;
1002117610Sdes    sparc:Linux:*:* | sparc64:Linux:*:*)
1003255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1004255376Sdes	exit ;;
1005255376Sdes    tile*:Linux:*:*)
1006255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1007255376Sdes	exit ;;
1008255376Sdes    vax:Linux:*:*)
1009255376Sdes	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
1010255376Sdes	exit ;;
1011117610Sdes    x86_64:Linux:*:*)
1012255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1013255376Sdes	exit ;;
1014255376Sdes    xtensa*:Linux:*:*)
1015255376Sdes	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1016255376Sdes	exit ;;
1017117610Sdes    i*86:DYNIX/ptx:4*:*)
1018117610Sdes	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1019117610Sdes	# earlier versions are messed up and put the nodename in both
1020117610Sdes	# sysname and nodename.
1021117610Sdes	echo i386-sequent-sysv4
1022255376Sdes	exit ;;
1023117610Sdes    i*86:UNIX_SV:4.2MP:2.*)
1024255376Sdes	# Unixware is an offshoot of SVR4, but it has its own version
1025255376Sdes	# number series starting with 2...
1026255376Sdes	# I am not positive that other SVR4 systems won't match this,
1027117610Sdes	# I just have to hope.  -- rms.
1028255376Sdes	# Use sysv4.2uw... so that sysv4* matches it.
1029117610Sdes	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1030255376Sdes	exit ;;
1031117610Sdes    i*86:OS/2:*:*)
1032117610Sdes	# If we were able to find `uname', then EMX Unix compatibility
1033117610Sdes	# is probably installed.
1034117610Sdes	echo ${UNAME_MACHINE}-pc-os2-emx
1035255376Sdes	exit ;;
1036117610Sdes    i*86:XTS-300:*:STOP)
1037117610Sdes	echo ${UNAME_MACHINE}-unknown-stop
1038255376Sdes	exit ;;
1039117610Sdes    i*86:atheos:*:*)
1040117610Sdes	echo ${UNAME_MACHINE}-unknown-atheos
1041255376Sdes	exit ;;
1042255376Sdes    i*86:syllable:*:*)
1043255376Sdes	echo ${UNAME_MACHINE}-pc-syllable
1044255376Sdes	exit ;;
1045255376Sdes    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1046117610Sdes	echo i386-unknown-lynxos${UNAME_RELEASE}
1047255376Sdes	exit ;;
1048117610Sdes    i*86:*DOS:*:*)
1049117610Sdes	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1050255376Sdes	exit ;;
1051117610Sdes    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1052117610Sdes	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1053117610Sdes	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1054117610Sdes		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1055117610Sdes	else
1056117610Sdes		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1057117610Sdes	fi
1058255376Sdes	exit ;;
1059255376Sdes    i*86:*:5:[678]*)
1060255376Sdes	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1061117610Sdes	case `/bin/uname -X | grep "^Machine"` in
1062117610Sdes	    *486*)	     UNAME_MACHINE=i486 ;;
1063117610Sdes	    *Pentium)	     UNAME_MACHINE=i586 ;;
1064117610Sdes	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1065117610Sdes	esac
1066117610Sdes	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1067255376Sdes	exit ;;
1068117610Sdes    i*86:*:3.2:*)
1069117610Sdes	if test -f /usr/options/cb.name; then
1070117610Sdes		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1071117610Sdes		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1072117610Sdes	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1073117610Sdes		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1074117610Sdes		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1075117610Sdes		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1076117610Sdes			&& UNAME_MACHINE=i586
1077117610Sdes		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1078117610Sdes			&& UNAME_MACHINE=i686
1079117610Sdes		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1080117610Sdes			&& UNAME_MACHINE=i686
1081117610Sdes		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1082117610Sdes	else
1083117610Sdes		echo ${UNAME_MACHINE}-pc-sysv32
1084117610Sdes	fi
1085255376Sdes	exit ;;
1086117610Sdes    pc:*:*:*)
1087117610Sdes	# Left here for compatibility:
1088255376Sdes	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1089255376Sdes	# the processor, so we play safe by assuming i586.
1090255376Sdes	# Note: whatever this is, it MUST be the same as what config.sub
1091255376Sdes	# prints for the "djgpp" host, or else GDB configury will decide that
1092255376Sdes	# this is a cross-build.
1093255376Sdes	echo i586-pc-msdosdjgpp
1094255376Sdes	exit ;;
1095117610Sdes    Intel:Mach:3*:*)
1096117610Sdes	echo i386-pc-mach3
1097255376Sdes	exit ;;
1098117610Sdes    paragon:*:*:*)
1099117610Sdes	echo i860-intel-osf1
1100255376Sdes	exit ;;
1101117610Sdes    i860:*:4.*:*) # i860-SVR4
1102117610Sdes	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1103117610Sdes	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1104117610Sdes	else # Add other i860-SVR4 vendors below as they are discovered.
1105117610Sdes	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1106117610Sdes	fi
1107255376Sdes	exit ;;
1108117610Sdes    mini*:CTIX:SYS*5:*)
1109117610Sdes	# "miniframe"
1110117610Sdes	echo m68010-convergent-sysv
1111255376Sdes	exit ;;
1112117610Sdes    mc68k:UNIX:SYSTEM5:3.51m)
1113117610Sdes	echo m68k-convergent-sysv
1114255376Sdes	exit ;;
1115117610Sdes    M680?0:D-NIX:5.3:*)
1116117610Sdes	echo m68k-diab-dnix
1117255376Sdes	exit ;;
1118255376Sdes    M68*:*:R3V[5678]*:*)
1119255376Sdes	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1120255376Sdes    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)
1121117610Sdes	OS_REL=''
1122117610Sdes	test -r /etc/.relid \
1123117610Sdes	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1124117610Sdes	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1125255376Sdes	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1126117610Sdes	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1127255376Sdes	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1128117610Sdes    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1129255376Sdes	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1130255376Sdes	  && { echo i486-ncr-sysv4; exit; } ;;
1131255376Sdes    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1132255376Sdes	OS_REL='.3'
1133255376Sdes	test -r /etc/.relid \
1134255376Sdes	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1135255376Sdes	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1136255376Sdes	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1137255376Sdes	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1138255376Sdes	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1139255376Sdes	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1140255376Sdes	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1141117610Sdes    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1142117610Sdes	echo m68k-unknown-lynxos${UNAME_RELEASE}
1143255376Sdes	exit ;;
1144117610Sdes    mc68030:UNIX_System_V:4.*:*)
1145117610Sdes	echo m68k-atari-sysv4
1146255376Sdes	exit ;;
1147117610Sdes    TSUNAMI:LynxOS:2.*:*)
1148117610Sdes	echo sparc-unknown-lynxos${UNAME_RELEASE}
1149255376Sdes	exit ;;
1150117610Sdes    rs6000:LynxOS:2.*:*)
1151117610Sdes	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1152255376Sdes	exit ;;
1153255376Sdes    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1154117610Sdes	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1155255376Sdes	exit ;;
1156117610Sdes    SM[BE]S:UNIX_SV:*:*)
1157117610Sdes	echo mips-dde-sysv${UNAME_RELEASE}
1158255376Sdes	exit ;;
1159117610Sdes    RM*:ReliantUNIX-*:*:*)
1160117610Sdes	echo mips-sni-sysv4
1161255376Sdes	exit ;;
1162117610Sdes    RM*:SINIX-*:*:*)
1163117610Sdes	echo mips-sni-sysv4
1164255376Sdes	exit ;;
1165117610Sdes    *:SINIX-*:*:*)
1166117610Sdes	if uname -p 2>/dev/null >/dev/null ; then
1167117610Sdes		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1168117610Sdes		echo ${UNAME_MACHINE}-sni-sysv4
1169117610Sdes	else
1170117610Sdes		echo ns32k-sni-sysv
1171117610Sdes	fi
1172255376Sdes	exit ;;
1173255376Sdes    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1174255376Sdes			# says <Richard.M.Bartel@ccMail.Census.GOV>
1175255376Sdes	echo i586-unisys-sysv4
1176255376Sdes	exit ;;
1177117610Sdes    *:UNIX_System_V:4*:FTX*)
1178117610Sdes	# From Gerald Hewes <hewes@openmarket.com>.
1179117610Sdes	# How about differentiating between stratus architectures? -djm
1180117610Sdes	echo hppa1.1-stratus-sysv4
1181255376Sdes	exit ;;
1182117610Sdes    *:*:*:FTX*)
1183117610Sdes	# From seanf@swdc.stratus.com.
1184117610Sdes	echo i860-stratus-sysv4
1185255376Sdes	exit ;;
1186255376Sdes    i*86:VOS:*:*)
1187255376Sdes	# From Paul.Green@stratus.com.
1188255376Sdes	echo ${UNAME_MACHINE}-stratus-vos
1189255376Sdes	exit ;;
1190117610Sdes    *:VOS:*:*)
1191117610Sdes	# From Paul.Green@stratus.com.
1192117610Sdes	echo hppa1.1-stratus-vos
1193255376Sdes	exit ;;
1194117610Sdes    mc68*:A/UX:*:*)
1195117610Sdes	echo m68k-apple-aux${UNAME_RELEASE}
1196255376Sdes	exit ;;
1197117610Sdes    news*:NEWS-OS:6*:*)
1198117610Sdes	echo mips-sony-newsos6
1199255376Sdes	exit ;;
1200117610Sdes    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1201117610Sdes	if [ -d /usr/nec ]; then
1202255376Sdes		echo mips-nec-sysv${UNAME_RELEASE}
1203117610Sdes	else
1204255376Sdes		echo mips-unknown-sysv${UNAME_RELEASE}
1205117610Sdes	fi
1206255376Sdes	exit ;;
1207117610Sdes    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1208117610Sdes	echo powerpc-be-beos
1209255376Sdes	exit ;;
1210117610Sdes    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1211117610Sdes	echo powerpc-apple-beos
1212255376Sdes	exit ;;
1213117610Sdes    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1214117610Sdes	echo i586-pc-beos
1215255376Sdes	exit ;;
1216255376Sdes    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1217255376Sdes	echo i586-pc-haiku
1218255376Sdes	exit ;;
1219255376Sdes    x86_64:Haiku:*:*)
1220255376Sdes	echo x86_64-unknown-haiku
1221255376Sdes	exit ;;
1222117610Sdes    SX-4:SUPER-UX:*:*)
1223117610Sdes	echo sx4-nec-superux${UNAME_RELEASE}
1224255376Sdes	exit ;;
1225117610Sdes    SX-5:SUPER-UX:*:*)
1226117610Sdes	echo sx5-nec-superux${UNAME_RELEASE}
1227255376Sdes	exit ;;
1228117610Sdes    SX-6:SUPER-UX:*:*)
1229117610Sdes	echo sx6-nec-superux${UNAME_RELEASE}
1230255376Sdes	exit ;;
1231255376Sdes    SX-7:SUPER-UX:*:*)
1232255376Sdes	echo sx7-nec-superux${UNAME_RELEASE}
1233255376Sdes	exit ;;
1234255376Sdes    SX-8:SUPER-UX:*:*)
1235255376Sdes	echo sx8-nec-superux${UNAME_RELEASE}
1236255376Sdes	exit ;;
1237255376Sdes    SX-8R:SUPER-UX:*:*)
1238255376Sdes	echo sx8r-nec-superux${UNAME_RELEASE}
1239255376Sdes	exit ;;
1240117610Sdes    Power*:Rhapsody:*:*)
1241117610Sdes	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1242255376Sdes	exit ;;
1243117610Sdes    *:Rhapsody:*:*)
1244117610Sdes	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1245255376Sdes	exit ;;
1246117610Sdes    *:Darwin:*:*)
1247255376Sdes	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1248255376Sdes	eval $set_cc_for_build
1249255376Sdes	if test "$UNAME_PROCESSOR" = unknown ; then
1250255376Sdes	    UNAME_PROCESSOR=powerpc
1251255376Sdes	fi
1252255376Sdes	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1253255376Sdes	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1254255376Sdes		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1255255376Sdes		grep IS_64BIT_ARCH >/dev/null
1256255376Sdes	    then
1257255376Sdes		case $UNAME_PROCESSOR in
1258255376Sdes		    i386) UNAME_PROCESSOR=x86_64 ;;
1259255376Sdes		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1260255376Sdes		esac
1261255376Sdes	    fi
1262255376Sdes	fi
1263117610Sdes	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1264255376Sdes	exit ;;
1265117610Sdes    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1266117610Sdes	UNAME_PROCESSOR=`uname -p`
1267117610Sdes	if test "$UNAME_PROCESSOR" = "x86"; then
1268117610Sdes		UNAME_PROCESSOR=i386
1269117610Sdes		UNAME_MACHINE=pc
1270117610Sdes	fi
1271117610Sdes	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1272255376Sdes	exit ;;
1273117610Sdes    *:QNX:*:4*)
1274117610Sdes	echo i386-pc-qnx
1275255376Sdes	exit ;;
1276255376Sdes    NEO-?:NONSTOP_KERNEL:*:*)
1277255376Sdes	echo neo-tandem-nsk${UNAME_RELEASE}
1278255376Sdes	exit ;;
1279255376Sdes    NSE-*:NONSTOP_KERNEL:*:*)
1280255376Sdes	echo nse-tandem-nsk${UNAME_RELEASE}
1281255376Sdes	exit ;;
1282255376Sdes    NSR-?:NONSTOP_KERNEL:*:*)
1283117610Sdes	echo nsr-tandem-nsk${UNAME_RELEASE}
1284255376Sdes	exit ;;
1285117610Sdes    *:NonStop-UX:*:*)
1286117610Sdes	echo mips-compaq-nonstopux
1287255376Sdes	exit ;;
1288117610Sdes    BS2000:POSIX*:*:*)
1289117610Sdes	echo bs2000-siemens-sysv
1290255376Sdes	exit ;;
1291117610Sdes    DS/*:UNIX_System_V:*:*)
1292117610Sdes	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1293255376Sdes	exit ;;
1294117610Sdes    *:Plan9:*:*)
1295117610Sdes	# "uname -m" is not consistent, so use $cputype instead. 386
1296117610Sdes	# is converted to i386 for consistency with other x86
1297117610Sdes	# operating systems.
1298117610Sdes	if test "$cputype" = "386"; then
1299117610Sdes	    UNAME_MACHINE=i386
1300117610Sdes	else
1301117610Sdes	    UNAME_MACHINE="$cputype"
1302117610Sdes	fi
1303117610Sdes	echo ${UNAME_MACHINE}-unknown-plan9
1304255376Sdes	exit ;;
1305117610Sdes    *:TOPS-10:*:*)
1306117610Sdes	echo pdp10-unknown-tops10
1307255376Sdes	exit ;;
1308117610Sdes    *:TENEX:*:*)
1309117610Sdes	echo pdp10-unknown-tenex
1310255376Sdes	exit ;;
1311117610Sdes    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1312117610Sdes	echo pdp10-dec-tops20
1313255376Sdes	exit ;;
1314117610Sdes    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1315117610Sdes	echo pdp10-xkl-tops20
1316255376Sdes	exit ;;
1317117610Sdes    *:TOPS-20:*:*)
1318117610Sdes	echo pdp10-unknown-tops20
1319255376Sdes	exit ;;
1320117610Sdes    *:ITS:*:*)
1321117610Sdes	echo pdp10-unknown-its
1322255376Sdes	exit ;;
1323117610Sdes    SEI:*:*:SEIUX)
1324255376Sdes	echo mips-sei-seiux${UNAME_RELEASE}
1325255376Sdes	exit ;;
1326255376Sdes    *:DragonFly:*:*)
1327255376Sdes	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1328255376Sdes	exit ;;
1329255376Sdes    *:*VMS:*:*)
1330255376Sdes	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1331255376Sdes	case "${UNAME_MACHINE}" in
1332255376Sdes	    A*) echo alpha-dec-vms ; exit ;;
1333255376Sdes	    I*) echo ia64-dec-vms ; exit ;;
1334255376Sdes	    V*) echo vax-dec-vms ; exit ;;
1335255376Sdes	esac ;;
1336255376Sdes    *:XENIX:*:SysV)
1337255376Sdes	echo i386-pc-xenix
1338255376Sdes	exit ;;
1339255376Sdes    i*86:skyos:*:*)
1340255376Sdes	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1341255376Sdes	exit ;;
1342255376Sdes    i*86:rdos:*:*)
1343255376Sdes	echo ${UNAME_MACHINE}-pc-rdos
1344255376Sdes	exit ;;
1345255376Sdes    i*86:AROS:*:*)
1346255376Sdes	echo ${UNAME_MACHINE}-pc-aros
1347255376Sdes	exit ;;
1348255376Sdes    x86_64:VMkernel:*:*)
1349255376Sdes	echo ${UNAME_MACHINE}-unknown-esx
1350255376Sdes	exit ;;
1351117610Sdesesac
1352117610Sdes
1353117610Sdeseval $set_cc_for_build
1354117610Sdescat >$dummy.c <<EOF
1355117610Sdes#ifdef _SEQUENT_
1356117610Sdes# include <sys/types.h>
1357117610Sdes# include <sys/utsname.h>
1358117610Sdes#endif
1359117610Sdesmain ()
1360117610Sdes{
1361117610Sdes#if defined (sony)
1362117610Sdes#if defined (MIPSEB)
1363117610Sdes  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1364117610Sdes     I don't know....  */
1365117610Sdes  printf ("mips-sony-bsd\n"); exit (0);
1366117610Sdes#else
1367117610Sdes#include <sys/param.h>
1368117610Sdes  printf ("m68k-sony-newsos%s\n",
1369117610Sdes#ifdef NEWSOS4
1370255376Sdes	"4"
1371117610Sdes#else
1372255376Sdes	""
1373117610Sdes#endif
1374255376Sdes	); exit (0);
1375117610Sdes#endif
1376117610Sdes#endif
1377117610Sdes
1378117610Sdes#if defined (__arm) && defined (__acorn) && defined (__unix)
1379255376Sdes  printf ("arm-acorn-riscix\n"); exit (0);
1380117610Sdes#endif
1381117610Sdes
1382117610Sdes#if defined (hp300) && !defined (hpux)
1383117610Sdes  printf ("m68k-hp-bsd\n"); exit (0);
1384117610Sdes#endif
1385117610Sdes
1386117610Sdes#if defined (NeXT)
1387117610Sdes#if !defined (__ARCHITECTURE__)
1388117610Sdes#define __ARCHITECTURE__ "m68k"
1389117610Sdes#endif
1390117610Sdes  int version;
1391117610Sdes  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1392117610Sdes  if (version < 4)
1393117610Sdes    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1394117610Sdes  else
1395117610Sdes    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1396117610Sdes  exit (0);
1397117610Sdes#endif
1398117610Sdes
1399117610Sdes#if defined (MULTIMAX) || defined (n16)
1400117610Sdes#if defined (UMAXV)
1401117610Sdes  printf ("ns32k-encore-sysv\n"); exit (0);
1402117610Sdes#else
1403117610Sdes#if defined (CMU)
1404117610Sdes  printf ("ns32k-encore-mach\n"); exit (0);
1405117610Sdes#else
1406117610Sdes  printf ("ns32k-encore-bsd\n"); exit (0);
1407117610Sdes#endif
1408117610Sdes#endif
1409117610Sdes#endif
1410117610Sdes
1411117610Sdes#if defined (__386BSD__)
1412117610Sdes  printf ("i386-pc-bsd\n"); exit (0);
1413117610Sdes#endif
1414117610Sdes
1415117610Sdes#if defined (sequent)
1416117610Sdes#if defined (i386)
1417117610Sdes  printf ("i386-sequent-dynix\n"); exit (0);
1418117610Sdes#endif
1419117610Sdes#if defined (ns32000)
1420117610Sdes  printf ("ns32k-sequent-dynix\n"); exit (0);
1421117610Sdes#endif
1422117610Sdes#endif
1423117610Sdes
1424117610Sdes#if defined (_SEQUENT_)
1425117610Sdes    struct utsname un;
1426117610Sdes
1427117610Sdes    uname(&un);
1428117610Sdes
1429117610Sdes    if (strncmp(un.version, "V2", 2) == 0) {
1430117610Sdes	printf ("i386-sequent-ptx2\n"); exit (0);
1431117610Sdes    }
1432117610Sdes    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1433117610Sdes	printf ("i386-sequent-ptx1\n"); exit (0);
1434117610Sdes    }
1435117610Sdes    printf ("i386-sequent-ptx\n"); exit (0);
1436117610Sdes
1437117610Sdes#endif
1438117610Sdes
1439117610Sdes#if defined (vax)
1440117610Sdes# if !defined (ultrix)
1441117610Sdes#  include <sys/param.h>
1442117610Sdes#  if defined (BSD)
1443117610Sdes#   if BSD == 43
1444117610Sdes      printf ("vax-dec-bsd4.3\n"); exit (0);
1445117610Sdes#   else
1446117610Sdes#    if BSD == 199006
1447117610Sdes      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1448117610Sdes#    else
1449117610Sdes      printf ("vax-dec-bsd\n"); exit (0);
1450117610Sdes#    endif
1451117610Sdes#   endif
1452117610Sdes#  else
1453117610Sdes    printf ("vax-dec-bsd\n"); exit (0);
1454117610Sdes#  endif
1455117610Sdes# else
1456117610Sdes    printf ("vax-dec-ultrix\n"); exit (0);
1457117610Sdes# endif
1458117610Sdes#endif
1459117610Sdes
1460117610Sdes#if defined (alliant) && defined (i860)
1461117610Sdes  printf ("i860-alliant-bsd\n"); exit (0);
1462117610Sdes#endif
1463117610Sdes
1464117610Sdes  exit (1);
1465117610Sdes}
1466117610SdesEOF
1467117610Sdes
1468255376Sdes$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1469255376Sdes	{ echo "$SYSTEM_NAME"; exit; }
1470117610Sdes
1471117610Sdes# Apollos put the system type in the environment.
1472117610Sdes
1473255376Sdestest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1474117610Sdes
1475117610Sdes# Convex versions that predate uname can use getsysinfo(1)
1476117610Sdes
1477117610Sdesif [ -x /usr/convex/getsysinfo ]
1478117610Sdesthen
1479117610Sdes    case `getsysinfo -f cpu_type` in
1480117610Sdes    c1*)
1481117610Sdes	echo c1-convex-bsd
1482255376Sdes	exit ;;
1483117610Sdes    c2*)
1484117610Sdes	if getsysinfo -f scalar_acc
1485117610Sdes	then echo c32-convex-bsd
1486117610Sdes	else echo c2-convex-bsd
1487117610Sdes	fi
1488255376Sdes	exit ;;
1489117610Sdes    c34*)
1490117610Sdes	echo c34-convex-bsd
1491255376Sdes	exit ;;
1492117610Sdes    c38*)
1493117610Sdes	echo c38-convex-bsd
1494255376Sdes	exit ;;
1495117610Sdes    c4*)
1496117610Sdes	echo c4-convex-bsd
1497255376Sdes	exit ;;
1498117610Sdes    esac
1499117610Sdesfi
1500117610Sdes
1501117610Sdescat >&2 <<EOF
1502117610Sdes$0: unable to guess system type
1503117610Sdes
1504117610SdesThis script, last modified $timestamp, has failed to recognize
1505117610Sdesthe operating system you are using. It is advised that you
1506117610Sdesdownload the most up to date version of the config scripts from
1507117610Sdes
1508255376Sdes  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1509255376Sdesand
1510255376Sdes  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1511117610Sdes
1512117610SdesIf the version you run ($0) is already up to date, please
1513117610Sdessend the following data and any information you think might be
1514117610Sdespertinent to <config-patches@gnu.org> in order to provide the needed
1515117610Sdesinformation to handle your system.
1516117610Sdes
1517117610Sdesconfig.guess timestamp = $timestamp
1518117610Sdes
1519117610Sdesuname -m = `(uname -m) 2>/dev/null || echo unknown`
1520117610Sdesuname -r = `(uname -r) 2>/dev/null || echo unknown`
1521117610Sdesuname -s = `(uname -s) 2>/dev/null || echo unknown`
1522117610Sdesuname -v = `(uname -v) 2>/dev/null || echo unknown`
1523117610Sdes
1524117610Sdes/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1525117610Sdes/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1526117610Sdes
1527117610Sdeshostinfo               = `(hostinfo) 2>/dev/null`
1528117610Sdes/bin/universe          = `(/bin/universe) 2>/dev/null`
1529117610Sdes/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1530117610Sdes/bin/arch              = `(/bin/arch) 2>/dev/null`
1531117610Sdes/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1532117610Sdes/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1533117610Sdes
1534117610SdesUNAME_MACHINE = ${UNAME_MACHINE}
1535117610SdesUNAME_RELEASE = ${UNAME_RELEASE}
1536117610SdesUNAME_SYSTEM  = ${UNAME_SYSTEM}
1537117610SdesUNAME_VERSION = ${UNAME_VERSION}
1538117610SdesEOF
1539117610Sdes
1540117610Sdesexit 1
1541117610Sdes
1542117610Sdes# Local variables:
1543117610Sdes# eval: (add-hook 'write-file-hooks 'time-stamp)
1544117610Sdes# time-stamp-start: "timestamp='"
1545117610Sdes# time-stamp-format: "%:y-%02m-%02d"
1546117610Sdes# time-stamp-end: "'"
1547117610Sdes# End:
1548