config.guess revision 231990
169408Sache#! /bin/sh
269408Sache# Attempt to guess a canonical system name.
3100616Smp#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4231990Smp#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
5195609Smp#   Free Software Foundation, Inc.
6100616Smp
7231990Smptimestamp='2009-12-30'
8100616Smp
969408Sache# This file is free software; you can redistribute it and/or modify it
1069408Sache# under the terms of the GNU General Public License as published by
1169408Sache# the Free Software Foundation; either version 2 of the License, or
1269408Sache# (at your option) any later version.
1369408Sache#
1469408Sache# This program is distributed in the hope that it will be useful, but
1569408Sache# WITHOUT ANY WARRANTY; without even the implied warranty of
1669408Sache# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1769408Sache# General Public License for more details.
1869408Sache#
1969408Sache# You should have received a copy of the GNU General Public License
2069408Sache# along with this program; if not, write to the Free Software
21195609Smp# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22195609Smp# 02110-1301, USA.
2369408Sache#
2469408Sache# As a special exception to the GNU General Public License, if you
2569408Sache# distribute this file as part of a program that contains a
2669408Sache# configuration script generated by Autoconf, you may include it under
2769408Sache# the same distribution terms that you use for the rest of that program.
2869408Sache
29195609Smp
30231990Smp# Originally written by Per Bothner.  Please send patches (context
31231990Smp# diff format) to <config-patches@gnu.org> and include a ChangeLog
32231990Smp# entry.
3369408Sache#
3469408Sache# This script attempts to guess a canonical system name similar to
3569408Sache# config.sub.  If it succeeds, it prints the system name on stdout, and
3669408Sache# exits with 0.  Otherwise, it exits with 1.
3769408Sache#
38231990Smp# You can get the latest version of this script from:
39231990Smp# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
4069408Sache
41100616Smpme=`echo "$0" | sed -e 's,.*/,,'`
42100616Smp
43100616Smpusage="\
44100616SmpUsage: $0 [OPTION]
45100616Smp
46100616SmpOutput the configuration name of the system \`$me' is run on.
47100616Smp
48100616SmpOperation modes:
49100616Smp  -h, --help         print this help, then exit
50100616Smp  -t, --time-stamp   print date of last modification, then exit
51100616Smp  -v, --version      print version number, then exit
52100616Smp
53100616SmpReport bugs and patches to <config-patches@gnu.org>."
54100616Smp
55100616Smpversion="\
56100616SmpGNU config.guess ($timestamp)
57100616Smp
58100616SmpOriginally written by Per Bothner.
59231990SmpCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60231990Smp2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
61231990SmpSoftware Foundation, Inc.
62100616Smp
63100616SmpThis is free software; see the source for copying conditions.  There is NO
64100616Smpwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
65100616Smp
66100616Smphelp="
67100616SmpTry \`$me --help' for more information."
68100616Smp
69100616Smp# Parse command line
70100616Smpwhile test $# -gt 0 ; do
71100616Smp  case $1 in
72100616Smp    --time-stamp | --time* | -t )
73195609Smp       echo "$timestamp" ; exit ;;
74100616Smp    --version | -v )
75195609Smp       echo "$version" ; exit ;;
76100616Smp    --help | --h* | -h )
77195609Smp       echo "$usage"; exit ;;
78100616Smp    -- )     # Stop option processing
79100616Smp       shift; break ;;
80100616Smp    - )	# Use stdin as input.
81100616Smp       break ;;
82100616Smp    -* )
83100616Smp       echo "$me: invalid option $1$help" >&2
84100616Smp       exit 1 ;;
85100616Smp    * )
86100616Smp       break ;;
87100616Smp  esac
88100616Smpdone
89100616Smp
90100616Smpif test $# != 0; then
91100616Smp  echo "$me: too many arguments$help" >&2
92100616Smp  exit 1
9383098Smpfi
9483098Smp
95100616Smptrap 'exit 1' 1 2 15
9683098Smp
97100616Smp# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
98100616Smp# compiler to aid in system detection is discouraged as it requires
99100616Smp# temporary files to be created and, as you can see below, it is a
100100616Smp# headache to deal with in a portable fashion.
101100616Smp
102100616Smp# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
103100616Smp# use `HOST_CC' if defined, but it is deprecated.
104100616Smp
105195609Smp# Portable tmp directory creation inspired by the Autoconf team.
106100616Smp
107195609Smpset_cc_for_build='
108195609Smptrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109195609Smptrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110195609Smp: ${TMPDIR=/tmp} ;
111195609Smp { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112195609Smp { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113195609Smp { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114195609Smp { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
115195609Smpdummy=$tmp/dummy ;
116195609Smptmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
117100616Smpcase $CC_FOR_BUILD,$HOST_CC,$CC in
118100616Smp ,,)    echo "int x;" > $dummy.c ;
119100616Smp	for c in cc gcc c89 c99 ; do
120195609Smp	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
121100616Smp	     CC_FOR_BUILD="$c"; break ;
122100616Smp	  fi ;
123100616Smp	done ;
124100616Smp	if test x"$CC_FOR_BUILD" = x ; then
125100616Smp	  CC_FOR_BUILD=no_compiler_found ;
126100616Smp	fi
127100616Smp	;;
128100616Smp ,,*)   CC_FOR_BUILD=$CC ;;
129100616Smp ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
130195609Smpesac ; set_cc_for_build= ;'
131100616Smp
13269408Sache# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
133100616Smp# (ghazi@noc.rutgers.edu 1994-08-24)
13469408Sacheif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13569408Sache	PATH=$PATH:/.attbin ; export PATH
13669408Sachefi
13769408Sache
13869408SacheUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13969408SacheUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140100616SmpUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
14169408SacheUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14269408Sache
14369408Sache# Note: order is significant - the case branches are not exclusive.
14469408Sache
14569408Sachecase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146100616Smp    *:NetBSD:*:*)
147100616Smp	# NetBSD (nbsd) targets should (where applicable) match one or
148100616Smp	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
149100616Smp	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
150100616Smp	# switched to ELF, *-*-netbsd* would select the old
151100616Smp	# object file format.  This provides both forward
152100616Smp	# compatibility and a consistent mechanism for selecting the
153100616Smp	# object file format.
154100616Smp	#
155100616Smp	# Note: NetBSD doesn't particularly care about the vendor
156100616Smp	# portion of the name.  We always set it to "unknown".
157100616Smp	sysctl="sysctl -n hw.machine_arch"
158100616Smp	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
159100616Smp	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
160100616Smp	case "${UNAME_MACHINE_ARCH}" in
161100616Smp	    armeb) machine=armeb-unknown ;;
162100616Smp	    arm*) machine=arm-unknown ;;
163100616Smp	    sh3el) machine=shl-unknown ;;
164100616Smp	    sh3eb) machine=sh-unknown ;;
165195609Smp	    sh5el) machine=sh5le-unknown ;;
166100616Smp	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167100616Smp	esac
168100616Smp	# The Operating System including object format, if it has switched
169100616Smp	# to ELF recently, or will in the future.
170100616Smp	case "${UNAME_MACHINE_ARCH}" in
171100616Smp	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172100616Smp		eval $set_cc_for_build
173100616Smp		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174195609Smp			| grep -q __ELF__
175100616Smp		then
176100616Smp		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177100616Smp		    # Return netbsd for either.  FIX?
178100616Smp		    os=netbsd
179100616Smp		else
180100616Smp		    os=netbsdelf
181100616Smp		fi
182100616Smp		;;
183100616Smp	    *)
184100616Smp	        os=netbsd
185100616Smp		;;
186100616Smp	esac
187100616Smp	# The OS release
188195609Smp	# Debian GNU/NetBSD machines have a different userland, and
189195609Smp	# thus, need a distinct triplet. However, they do not need
190195609Smp	# kernel version information, so it can be replaced with a
191195609Smp	# suitable tag, in the style of linux-gnu.
192195609Smp	case "${UNAME_VERSION}" in
193195609Smp	    Debian*)
194195609Smp		release='-gnu'
195195609Smp		;;
196195609Smp	    *)
197195609Smp		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
198195609Smp		;;
199195609Smp	esac
200100616Smp	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201100616Smp	# contains redundant information, the shorter form:
202100616Smp	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203100616Smp	echo "${machine}-${os}${release}"
204195609Smp	exit ;;
205100616Smp    *:OpenBSD:*:*)
206195609Smp	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207195609Smp	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208195609Smp	exit ;;
209195609Smp    *:ekkoBSD:*:*)
210195609Smp	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
211195609Smp	exit ;;
212195609Smp    *:SolidBSD:*:*)
213195609Smp	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214195609Smp	exit ;;
215195609Smp    macppc:MirBSD:*:*)
216195609Smp	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
217195609Smp	exit ;;
218195609Smp    *:MirBSD:*:*)
219195609Smp	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
220195609Smp	exit ;;
22169408Sache    alpha:OSF1:*:*)
222195609Smp	case $UNAME_RELEASE in
223195609Smp	*4.0)
22469408Sache		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225195609Smp		;;
226195609Smp	*5.*)
227195609Smp	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228195609Smp		;;
229195609Smp	esac
230195609Smp	# According to Compaq, /usr/sbin/psrinfo has been available on
231195609Smp	# OSF/1 and Tru64 systems produced since 1995.  I hope that
232195609Smp	# covers most systems running today.  This code pipes the CPU
233195609Smp	# types through head -n 1, so we only detect the type of CPU 0.
234195609Smp	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
235195609Smp	case "$ALPHA_CPU_TYPE" in
236195609Smp	    "EV4 (21064)")
237195609Smp		UNAME_MACHINE="alpha" ;;
238195609Smp	    "EV4.5 (21064)")
239195609Smp		UNAME_MACHINE="alpha" ;;
240195609Smp	    "LCA4 (21066/21068)")
241195609Smp		UNAME_MACHINE="alpha" ;;
242195609Smp	    "EV5 (21164)")
243195609Smp		UNAME_MACHINE="alphaev5" ;;
244195609Smp	    "EV5.6 (21164A)")
245195609Smp		UNAME_MACHINE="alphaev56" ;;
246195609Smp	    "EV5.6 (21164PC)")
247195609Smp		UNAME_MACHINE="alphapca56" ;;
248195609Smp	    "EV5.7 (21164PC)")
249195609Smp		UNAME_MACHINE="alphapca57" ;;
250195609Smp	    "EV6 (21264)")
251195609Smp		UNAME_MACHINE="alphaev6" ;;
252195609Smp	    "EV6.7 (21264A)")
253195609Smp		UNAME_MACHINE="alphaev67" ;;
254195609Smp	    "EV6.8CB (21264C)")
255195609Smp		UNAME_MACHINE="alphaev68" ;;
256195609Smp	    "EV6.8AL (21264B)")
257195609Smp		UNAME_MACHINE="alphaev68" ;;
258195609Smp	    "EV6.8CX (21264D)")
259195609Smp		UNAME_MACHINE="alphaev68" ;;
260195609Smp	    "EV6.9A (21264/EV69A)")
261195609Smp		UNAME_MACHINE="alphaev69" ;;
262195609Smp	    "EV7 (21364)")
263195609Smp		UNAME_MACHINE="alphaev7" ;;
264195609Smp	    "EV7.9 (21364A)")
265195609Smp		UNAME_MACHINE="alphaev79" ;;
266195609Smp	esac
267195609Smp	# A Pn.n version is a patched version.
26869408Sache	# A Vn.n version is a released version.
26969408Sache	# A Tn.n version is a released field test version.
27069408Sache	# A Xn.n version is an unreleased experimental baselevel.
27169408Sache	# 1.2 uses "1.2" for uname -r.
272195609Smp	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273195609Smp	exit ;;
27483098Smp    Alpha\ *:Windows_NT*:*)
27583098Smp	# How do we know it's Interix rather than the generic POSIX subsystem?
27683098Smp	# Should we change UNAME_MACHINE based on the output of uname instead
27783098Smp	# of the specific Alpha model?
27883098Smp	echo alpha-pc-interix
279195609Smp	exit ;;
28069408Sache    21064:Windows_NT:50:3)
28169408Sache	echo alpha-dec-winnt3.5
282195609Smp	exit ;;
28369408Sache    Amiga*:UNIX_System_V:4.0:*)
284100616Smp	echo m68k-unknown-sysv4
285195609Smp	exit ;;
28669408Sache    *:[Aa]miga[Oo][Ss]:*:*)
28769408Sache	echo ${UNAME_MACHINE}-unknown-amigaos
288195609Smp	exit ;;
289100616Smp    *:[Mm]orph[Oo][Ss]:*:*)
290100616Smp	echo ${UNAME_MACHINE}-unknown-morphos
291195609Smp	exit ;;
29283098Smp    *:OS/390:*:*)
29383098Smp	echo i370-ibm-openedition
294195609Smp	exit ;;
295195609Smp    *:z/VM:*:*)
296195609Smp	echo s390-ibm-zvmoe
297195609Smp	exit ;;
298195609Smp    *:OS400:*:*)
299195609Smp        echo powerpc-ibm-os400
300195609Smp	exit ;;
30169408Sache    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
30269408Sache	echo arm-acorn-riscix${UNAME_RELEASE}
303195609Smp	exit ;;
304195609Smp    arm:riscos:*:*|arm:RISCOS:*:*)
305195609Smp	echo arm-unknown-riscos
306195609Smp	exit ;;
307100616Smp    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30869408Sache	echo hppa1.1-hitachi-hiuxmpp
309195609Smp	exit ;;
31083098Smp    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
31169408Sache	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
31269408Sache	if test "`(/bin/universe) 2>/dev/null`" = att ; then
31369408Sache		echo pyramid-pyramid-sysv3
31469408Sache	else
31569408Sache		echo pyramid-pyramid-bsd
31669408Sache	fi
317195609Smp	exit ;;
31883098Smp    NILE*:*:*:dcosx)
31969408Sache	echo pyramid-pyramid-svr4
320195609Smp	exit ;;
321195609Smp    DRS?6000:unix:4.0:6*)
322195609Smp	echo sparc-icl-nx6
323195609Smp	exit ;;
324195609Smp    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
325100616Smp	case `/usr/bin/uname -p` in
326195609Smp	    sparc) echo sparc-icl-nx7; exit ;;
327100616Smp	esac ;;
328195609Smp    s390x:SunOS:*:*)
329195609Smp	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
330195609Smp	exit ;;
33169408Sache    sun4H:SunOS:5.*:*)
33269408Sache	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333195609Smp	exit ;;
33469408Sache    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
33569408Sache	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336195609Smp	exit ;;
337231990Smp    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
338231990Smp	echo i386-pc-auroraux${UNAME_RELEASE}
339231990Smp	exit ;;
340195609Smp    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
341195609Smp	eval $set_cc_for_build
342195609Smp	SUN_ARCH="i386"
343195609Smp	# If there is a compiler, see if it is configured for 64-bit objects.
344195609Smp	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
345195609Smp	# This test works for both compilers.
346195609Smp	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
347195609Smp	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
348195609Smp		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
349195609Smp		grep IS_64BIT_ARCH >/dev/null
350195609Smp	    then
351195609Smp		SUN_ARCH="x86_64"
352195609Smp	    fi
353195609Smp	fi
354195609Smp	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
355195609Smp	exit ;;
35669408Sache    sun4*:SunOS:6*:*)
35769408Sache	# According to config.sub, this is the proper way to canonicalize
35869408Sache	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
35969408Sache	# it's likely to be more like Solaris than SunOS4.
36069408Sache	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
361195609Smp	exit ;;
36269408Sache    sun4*:SunOS:*:*)
36369408Sache	case "`/usr/bin/arch -k`" in
36469408Sache	    Series*|S4*)
36569408Sache		UNAME_RELEASE=`uname -v`
36669408Sache		;;
36769408Sache	esac
36869408Sache	# Japanese Language versions have a version number like `4.1.3-JL'.
36969408Sache	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
370195609Smp	exit ;;
37169408Sache    sun3*:SunOS:*:*)
37269408Sache	echo m68k-sun-sunos${UNAME_RELEASE}
373195609Smp	exit ;;
37469408Sache    sun*:*:4.2BSD:*)
375100616Smp	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
37669408Sache	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
37769408Sache	case "`/bin/arch`" in
37869408Sache	    sun3)
37969408Sache		echo m68k-sun-sunos${UNAME_RELEASE}
38069408Sache		;;
38169408Sache	    sun4)
38269408Sache		echo sparc-sun-sunos${UNAME_RELEASE}
38369408Sache		;;
38469408Sache	esac
385195609Smp	exit ;;
38669408Sache    aushp:SunOS:*:*)
38769408Sache	echo sparc-auspex-sunos${UNAME_RELEASE}
388195609Smp	exit ;;
38983098Smp    # The situation for MiNT is a little confusing.  The machine name
39083098Smp    # can be virtually everything (everything which is not
391100616Smp    # "atarist" or "atariste" at least should have a processor
39283098Smp    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
39383098Smp    # to the lowercase version "mint" (or "freemint").  Finally
39483098Smp    # the system name "TOS" denotes a system which is actually not
39583098Smp    # MiNT.  But MiNT is downward compatible to TOS, so this should
39683098Smp    # be no problem.
39783098Smp    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39883098Smp        echo m68k-atari-mint${UNAME_RELEASE}
399195609Smp	exit ;;
40083098Smp    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
40183098Smp	echo m68k-atari-mint${UNAME_RELEASE}
402195609Smp        exit ;;
40383098Smp    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
40483098Smp        echo m68k-atari-mint${UNAME_RELEASE}
405195609Smp	exit ;;
40683098Smp    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40783098Smp        echo m68k-milan-mint${UNAME_RELEASE}
408195609Smp        exit ;;
40983098Smp    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
41083098Smp        echo m68k-hades-mint${UNAME_RELEASE}
411195609Smp        exit ;;
41283098Smp    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
41383098Smp        echo m68k-unknown-mint${UNAME_RELEASE}
414195609Smp        exit ;;
415195609Smp    m68k:machten:*:*)
416195609Smp	echo m68k-apple-machten${UNAME_RELEASE}
417195609Smp	exit ;;
41869408Sache    powerpc:machten:*:*)
41969408Sache	echo powerpc-apple-machten${UNAME_RELEASE}
420195609Smp	exit ;;
42169408Sache    RISC*:Mach:*:*)
42269408Sache	echo mips-dec-mach_bsd4.3
423195609Smp	exit ;;
42469408Sache    RISC*:ULTRIX:*:*)
42569408Sache	echo mips-dec-ultrix${UNAME_RELEASE}
426195609Smp	exit ;;
42769408Sache    VAX*:ULTRIX*:*:*)
42869408Sache	echo vax-dec-ultrix${UNAME_RELEASE}
429195609Smp	exit ;;
43083098Smp    2020:CLIX:*:* | 2430:CLIX:*:*)
43169408Sache	echo clipper-intergraph-clix${UNAME_RELEASE}
432195609Smp	exit ;;
43369408Sache    mips:*:*:UMIPS | mips:*:*:RISCos)
434100616Smp	eval $set_cc_for_build
43583098Smp	sed 's/^	//' << EOF >$dummy.c
43683098Smp#ifdef __cplusplus
437100616Smp#include <stdio.h>  /* for printf() prototype */
43883098Smp	int main (int argc, char *argv[]) {
43983098Smp#else
44083098Smp	int main (argc, argv) int argc; char *argv[]; {
44183098Smp#endif
44269408Sache	#if defined (host_mips) && defined (MIPSEB)
44369408Sache	#if defined (SYSTYPE_SYSV)
44469408Sache	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
44569408Sache	#endif
44669408Sache	#if defined (SYSTYPE_SVR4)
44769408Sache	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
44869408Sache	#endif
44969408Sache	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
45069408Sache	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
45169408Sache	#endif
45269408Sache	#endif
45369408Sache	  exit (-1);
45469408Sache	}
45569408SacheEOF
456195609Smp	$CC_FOR_BUILD -o $dummy $dummy.c &&
457195609Smp	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
458195609Smp	  SYSTEM_NAME=`$dummy $dummyarg` &&
459195609Smp	    { echo "$SYSTEM_NAME"; exit; }
46069408Sache	echo mips-mips-riscos${UNAME_RELEASE}
461195609Smp	exit ;;
462100616Smp    Motorola:PowerMAX_OS:*:*)
463100616Smp	echo powerpc-motorola-powermax
464195609Smp	exit ;;
465195609Smp    Motorola:*:4.3:PL8-*)
466100616Smp	echo powerpc-harris-powermax
467195609Smp	exit ;;
468195609Smp    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
469195609Smp	echo powerpc-harris-powermax
470195609Smp	exit ;;
47169408Sache    Night_Hawk:Power_UNIX:*:*)
47269408Sache	echo powerpc-harris-powerunix
473195609Smp	exit ;;
47469408Sache    m88k:CX/UX:7*:*)
47569408Sache	echo m88k-harris-cxux7
476195609Smp	exit ;;
47769408Sache    m88k:*:4*:R4*)
47869408Sache	echo m88k-motorola-sysv4
479195609Smp	exit ;;
48069408Sache    m88k:*:3*:R3*)
48169408Sache	echo m88k-motorola-sysv3
482195609Smp	exit ;;
48369408Sache    AViiON:dgux:*:*)
48469408Sache        # DG/UX returns AViiON for all architectures
48569408Sache        UNAME_PROCESSOR=`/usr/bin/uname -p`
486100616Smp	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
48783098Smp	then
48883098Smp	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
48983098Smp	       [ ${TARGET_BINARY_INTERFACE}x = x ]
49083098Smp	    then
49169408Sache		echo m88k-dg-dgux${UNAME_RELEASE}
49283098Smp	    else
49383098Smp		echo m88k-dg-dguxbcs${UNAME_RELEASE}
49483098Smp	    fi
49569408Sache	else
49683098Smp	    echo i586-dg-dgux${UNAME_RELEASE}
49769408Sache	fi
498195609Smp 	exit ;;
49969408Sache    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
50069408Sache	echo m88k-dolphin-sysv3
501195609Smp	exit ;;
50269408Sache    M88*:*:R3*:*)
50369408Sache	# Delta 88k system running SVR3
50469408Sache	echo m88k-motorola-sysv3
505195609Smp	exit ;;
50669408Sache    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
50769408Sache	echo m88k-tektronix-sysv3
508195609Smp	exit ;;
50969408Sache    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
51069408Sache	echo m68k-tektronix-bsd
511195609Smp	exit ;;
51269408Sache    *:IRIX*:*:*)
51369408Sache	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
514195609Smp	exit ;;
51569408Sache    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
516195609Smp	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
517195609Smp	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
518100616Smp    i*86:AIX:*:*)
51969408Sache	echo i386-ibm-aix
520195609Smp	exit ;;
521100616Smp    ia64:AIX:*:*)
522100616Smp	if [ -x /usr/bin/oslevel ] ; then
523100616Smp		IBM_REV=`/usr/bin/oslevel`
524100616Smp	else
525100616Smp		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
526100616Smp	fi
527100616Smp	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
528195609Smp	exit ;;
52969408Sache    *:AIX:2:3)
53069408Sache	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
531100616Smp		eval $set_cc_for_build
53283098Smp		sed 's/^		//' << EOF >$dummy.c
53369408Sache		#include <sys/systemcfg.h>
53469408Sache
53569408Sache		main()
53669408Sache			{
53769408Sache			if (!__power_pc())
53869408Sache				exit(1);
53969408Sache			puts("powerpc-ibm-aix3.2.5");
54069408Sache			exit(0);
54169408Sache			}
54269408SacheEOF
543195609Smp		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
544195609Smp		then
545195609Smp			echo "$SYSTEM_NAME"
546195609Smp		else
547195609Smp			echo rs6000-ibm-aix3.2.5
548195609Smp		fi
54969408Sache	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
55069408Sache		echo rs6000-ibm-aix3.2.4
55169408Sache	else
55269408Sache		echo rs6000-ibm-aix3.2
55369408Sache	fi
554195609Smp	exit ;;
555195609Smp    *:AIX:*:[456])
556100616Smp	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
557100616Smp	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
55869408Sache		IBM_ARCH=rs6000
55969408Sache	else
56069408Sache		IBM_ARCH=powerpc
56169408Sache	fi
56269408Sache	if [ -x /usr/bin/oslevel ] ; then
56369408Sache		IBM_REV=`/usr/bin/oslevel`
56469408Sache	else
565100616Smp		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
56669408Sache	fi
56769408Sache	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
568195609Smp	exit ;;
56969408Sache    *:AIX:*:*)
57069408Sache	echo rs6000-ibm-aix
571195609Smp	exit ;;
57269408Sache    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
57369408Sache	echo romp-ibm-bsd4.4
574195609Smp	exit ;;
575100616Smp    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
57669408Sache	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
577195609Smp	exit ;;                             # report: romp-ibm BSD 4.3
57869408Sache    *:BOSX:*:*)
57969408Sache	echo rs6000-bull-bosx
580195609Smp	exit ;;
58169408Sache    DPX/2?00:B.O.S.:*:*)
58269408Sache	echo m68k-bull-sysv3
583195609Smp	exit ;;
58469408Sache    9000/[34]??:4.3bsd:1.*:*)
58569408Sache	echo m68k-hp-bsd
586195609Smp	exit ;;
58769408Sache    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
58869408Sache	echo m68k-hp-bsd4.4
589195609Smp	exit ;;
59069408Sache    9000/[34678]??:HP-UX:*:*)
591100616Smp	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
59269408Sache	case "${UNAME_MACHINE}" in
59369408Sache	    9000/31? )            HP_ARCH=m68000 ;;
59469408Sache	    9000/[34]?? )         HP_ARCH=m68k ;;
59583098Smp	    9000/[678][0-9][0-9])
596100616Smp		if [ -x /usr/bin/getconf ]; then
597100616Smp		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
598100616Smp                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
599100616Smp                    case "${sc_cpu_version}" in
600100616Smp                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
601100616Smp                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
602100616Smp                      532)                      # CPU_PA_RISC2_0
603100616Smp                        case "${sc_kernel_bits}" in
604100616Smp                          32) HP_ARCH="hppa2.0n" ;;
605100616Smp                          64) HP_ARCH="hppa2.0w" ;;
606100616Smp			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
607100616Smp                        esac ;;
608100616Smp                    esac
609100616Smp		fi
610100616Smp		if [ "${HP_ARCH}" = "" ]; then
611100616Smp		    eval $set_cc_for_build
612100616Smp		    sed 's/^              //' << EOF >$dummy.c
613100616Smp
614100616Smp              #define _HPUX_SOURCE
61569408Sache              #include <stdlib.h>
61669408Sache              #include <unistd.h>
61783098Smp
61869408Sache              int main ()
61969408Sache              {
62069408Sache              #if defined(_SC_KERNEL_BITS)
62169408Sache                  long bits = sysconf(_SC_KERNEL_BITS);
62283098Smp              #endif
62369408Sache                  long cpu  = sysconf (_SC_CPU_VERSION);
62483098Smp
62583098Smp                  switch (cpu)
62669408Sache              	{
62769408Sache              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62869408Sache              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62983098Smp              	case CPU_PA_RISC2_0:
63069408Sache              #if defined(_SC_KERNEL_BITS)
63183098Smp              	    switch (bits)
63269408Sache              		{
63369408Sache              		case 64: puts ("hppa2.0w"); break;
63469408Sache              		case 32: puts ("hppa2.0n"); break;
63569408Sache              		default: puts ("hppa2.0"); break;
63669408Sache              		} break;
63769408Sache              #else  /* !defined(_SC_KERNEL_BITS) */
63869408Sache              	    puts ("hppa2.0"); break;
63983098Smp              #endif
64069408Sache              	default: puts ("hppa1.0"); break;
64169408Sache              	}
64269408Sache                  exit (0);
64369408Sache              }
64469408SacheEOF
645195609Smp		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
646195609Smp		    test -z "$HP_ARCH" && HP_ARCH=hppa
647100616Smp		fi ;;
64869408Sache	esac
649195609Smp	if [ ${HP_ARCH} = "hppa2.0w" ]
650195609Smp	then
651195609Smp	    eval $set_cc_for_build
652195609Smp
653195609Smp	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
654195609Smp	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
655195609Smp	    # generating 64-bit code.  GNU and HP use different nomenclature:
656195609Smp	    #
657195609Smp	    # $ CC_FOR_BUILD=cc ./config.guess
658195609Smp	    # => hppa2.0w-hp-hpux11.23
659195609Smp	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
660195609Smp	    # => hppa64-hp-hpux11.23
661195609Smp
662195609Smp	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
663195609Smp		grep -q __LP64__
664195609Smp	    then
665195609Smp		HP_ARCH="hppa2.0w"
666195609Smp	    else
667195609Smp		HP_ARCH="hppa64"
668195609Smp	    fi
669195609Smp	fi
67069408Sache	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
671195609Smp	exit ;;
672100616Smp    ia64:HP-UX:*:*)
673100616Smp	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
674100616Smp	echo ia64-hp-hpux${HPUX_REV}
675195609Smp	exit ;;
67669408Sache    3050*:HI-UX:*:*)
677100616Smp	eval $set_cc_for_build
67883098Smp	sed 's/^	//' << EOF >$dummy.c
67969408Sache	#include <unistd.h>
68069408Sache	int
68169408Sache	main ()
68269408Sache	{
68369408Sache	  long cpu = sysconf (_SC_CPU_VERSION);
68469408Sache	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
68569408Sache	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
68669408Sache	     results, however.  */
68769408Sache	  if (CPU_IS_PA_RISC (cpu))
68869408Sache	    {
68969408Sache	      switch (cpu)
69069408Sache		{
69169408Sache		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
69269408Sache		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
69369408Sache		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
69469408Sache		  default: puts ("hppa-hitachi-hiuxwe2"); break;
69569408Sache		}
69669408Sache	    }
69769408Sache	  else if (CPU_IS_HP_MC68K (cpu))
69869408Sache	    puts ("m68k-hitachi-hiuxwe2");
69969408Sache	  else puts ("unknown-hitachi-hiuxwe2");
70069408Sache	  exit (0);
70169408Sache	}
70269408SacheEOF
703195609Smp	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
704195609Smp		{ echo "$SYSTEM_NAME"; exit; }
70569408Sache	echo unknown-hitachi-hiuxwe2
706195609Smp	exit ;;
70769408Sache    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
70869408Sache	echo hppa1.1-hp-bsd
709195609Smp	exit ;;
71069408Sache    9000/8??:4.3bsd:*:*)
71169408Sache	echo hppa1.0-hp-bsd
712195609Smp	exit ;;
713100616Smp    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
71483098Smp	echo hppa1.0-hp-mpeix
715195609Smp	exit ;;
71669408Sache    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
71769408Sache	echo hppa1.1-hp-osf
718195609Smp	exit ;;
71969408Sache    hp8??:OSF1:*:*)
72069408Sache	echo hppa1.0-hp-osf
721195609Smp	exit ;;
722100616Smp    i*86:OSF1:*:*)
72369408Sache	if [ -x /usr/sbin/sysversion ] ; then
72469408Sache	    echo ${UNAME_MACHINE}-unknown-osf1mk
72569408Sache	else
72669408Sache	    echo ${UNAME_MACHINE}-unknown-osf1
72769408Sache	fi
728195609Smp	exit ;;
72969408Sache    parisc*:Lites*:*:*)
73069408Sache	echo hppa1.1-hp-lites
731195609Smp	exit ;;
73283098Smp    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
73369408Sache	echo c1-convex-bsd
734195609Smp        exit ;;
73583098Smp    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
73683098Smp	if getsysinfo -f scalar_acc
73769408Sache	then echo c32-convex-bsd
73869408Sache	else echo c2-convex-bsd
73969408Sache	fi
740195609Smp        exit ;;
74183098Smp    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
74269408Sache	echo c34-convex-bsd
743195609Smp        exit ;;
74483098Smp    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
74569408Sache	echo c38-convex-bsd
746195609Smp        exit ;;
74783098Smp    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
74869408Sache	echo c4-convex-bsd
749195609Smp        exit ;;
75069408Sache    CRAY*Y-MP:*:*:*)
751100616Smp	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
752195609Smp	exit ;;
75369408Sache    CRAY*[A-Z]90:*:*:*)
75469408Sache	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
75569408Sache	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
756100616Smp	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
757100616Smp	      -e 's/\.[^.]*$/.X/'
758195609Smp	exit ;;
75969408Sache    CRAY*TS:*:*:*)
760100616Smp	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
761195609Smp	exit ;;
76283098Smp    CRAY*T3E:*:*:*)
763100616Smp	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
764195609Smp	exit ;;
765100616Smp    CRAY*SV1:*:*:*)
766100616Smp	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
767195609Smp	exit ;;
768195609Smp    *:UNICOS/mp:*:*)
769195609Smp	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770195609Smp	exit ;;
771100616Smp    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
772100616Smp	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
77383098Smp        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77469408Sache        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
775100616Smp        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
776195609Smp        exit ;;
777195609Smp    5000:UNIX_System_V:4.*:*)
778195609Smp        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
779195609Smp        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
780195609Smp        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
781195609Smp	exit ;;
782100616Smp    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
78383098Smp	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
784195609Smp	exit ;;
78569408Sache    sparc*:BSD/OS:*:*)
78669408Sache	echo sparc-unknown-bsdi${UNAME_RELEASE}
787195609Smp	exit ;;
78883098Smp    *:BSD/OS:*:*)
78983098Smp	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
790195609Smp	exit ;;
79169408Sache    *:FreeBSD:*:*)
792195609Smp	case ${UNAME_MACHINE} in
793195609Smp	    pc98)
794195609Smp		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795195609Smp	    amd64)
796195609Smp		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797195609Smp	    *)
798195609Smp		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799195609Smp	esac
800195609Smp	exit ;;
80169408Sache    i*:CYGWIN*:*)
80269408Sache	echo ${UNAME_MACHINE}-pc-cygwin
803195609Smp	exit ;;
804195609Smp    *:MINGW*:*)
80569408Sache	echo ${UNAME_MACHINE}-pc-mingw32
806195609Smp	exit ;;
807195609Smp    i*:windows32*:*)
808195609Smp    	# uname -m includes "-pc" on this system.
809195609Smp    	echo ${UNAME_MACHINE}-mingw32
810195609Smp	exit ;;
811100616Smp    i*:PW*:*)
812100616Smp	echo ${UNAME_MACHINE}-pc-pw32
813195609Smp	exit ;;
814231990Smp    *:Interix*:*)
815195609Smp    	case ${UNAME_MACHINE} in
816195609Smp	    x86)
817195609Smp		echo i586-pc-interix${UNAME_RELEASE}
818195609Smp		exit ;;
819231990Smp	    authenticamd | genuineintel | EM64T)
820195609Smp		echo x86_64-unknown-interix${UNAME_RELEASE}
821195609Smp		exit ;;
822195609Smp	    IA64)
823195609Smp		echo ia64-unknown-interix${UNAME_RELEASE}
824195609Smp		exit ;;
825195609Smp	esac ;;
826195609Smp    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
827195609Smp	echo i${UNAME_MACHINE}-pc-mks
828195609Smp	exit ;;
829195609Smp    8664:Windows_NT:*)
830195609Smp	echo x86_64-pc-mks
831195609Smp	exit ;;
83283098Smp    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
83383098Smp	# How do we know it's Interix rather than the generic POSIX subsystem?
83483098Smp	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
83583098Smp	# UNAME_MACHINE based on the output of uname instead of i386?
836195609Smp	echo i586-pc-interix
837195609Smp	exit ;;
83883098Smp    i*:UWIN*:*)
83983098Smp	echo ${UNAME_MACHINE}-pc-uwin
840195609Smp	exit ;;
841195609Smp    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
842195609Smp	echo x86_64-unknown-cygwin
843195609Smp	exit ;;
84469408Sache    p*:CYGWIN*:*)
84569408Sache	echo powerpcle-unknown-cygwin
846195609Smp	exit ;;
84769408Sache    prep*:SunOS:5.*:*)
84869408Sache	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
849195609Smp	exit ;;
85069408Sache    *:GNU:*:*)
851195609Smp	# the GNU system
85269408Sache	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
853195609Smp	exit ;;
854195609Smp    *:GNU/*:*:*)
855195609Smp	# other systems with GNU libc and userland
856195609Smp	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
857195609Smp	exit ;;
858100616Smp    i*86:Minix:*:*)
859100616Smp	echo ${UNAME_MACHINE}-pc-minix
860195609Smp	exit ;;
861231990Smp    alpha:Linux:*:*)
862231990Smp	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
863231990Smp	  EV5)   UNAME_MACHINE=alphaev5 ;;
864231990Smp	  EV56)  UNAME_MACHINE=alphaev56 ;;
865231990Smp	  PCA56) UNAME_MACHINE=alphapca56 ;;
866231990Smp	  PCA57) UNAME_MACHINE=alphapca56 ;;
867231990Smp	  EV6)   UNAME_MACHINE=alphaev6 ;;
868231990Smp	  EV67)  UNAME_MACHINE=alphaev67 ;;
869231990Smp	  EV68*) UNAME_MACHINE=alphaev68 ;;
870231990Smp        esac
871231990Smp	objdump --private-headers /bin/sh | grep -q ld.so.1
872231990Smp	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
873231990Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
874231990Smp	exit ;;
875100616Smp    arm*:Linux:*:*)
876195609Smp	eval $set_cc_for_build
877195609Smp	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
878195609Smp	    | grep -q __ARM_EABI__
879195609Smp	then
880195609Smp	    echo ${UNAME_MACHINE}-unknown-linux-gnu
881195609Smp	else
882195609Smp	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
883195609Smp	fi
884195609Smp	exit ;;
885195609Smp    avr32*:Linux:*:*)
886100616Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu
887195609Smp	exit ;;
888195609Smp    cris:Linux:*:*)
889195609Smp	echo cris-axis-linux-gnu
890195609Smp	exit ;;
891195609Smp    crisv32:Linux:*:*)
892195609Smp	echo crisv32-axis-linux-gnu
893195609Smp	exit ;;
894195609Smp    frv:Linux:*:*)
895195609Smp    	echo frv-unknown-linux-gnu
896195609Smp	exit ;;
897231990Smp    i*86:Linux:*:*)
898231990Smp	LIBC=gnu
899231990Smp	eval $set_cc_for_build
900231990Smp	sed 's/^	//' << EOF >$dummy.c
901231990Smp	#ifdef __dietlibc__
902231990Smp	LIBC=dietlibc
903231990Smp	#endif
904231990SmpEOF
905231990Smp	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
906231990Smp	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
907231990Smp	exit ;;
908100616Smp    ia64:Linux:*:*)
909100616Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu
910195609Smp	exit ;;
911195609Smp    m32r*:Linux:*:*)
912195609Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu
913195609Smp	exit ;;
914100616Smp    m68*:Linux:*:*)
915100616Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu
916195609Smp	exit ;;
917195609Smp    mips:Linux:*:* | mips64:Linux:*:*)
918100616Smp	eval $set_cc_for_build
919100616Smp	sed 's/^	//' << EOF >$dummy.c
920100616Smp	#undef CPU
921195609Smp	#undef ${UNAME_MACHINE}
922195609Smp	#undef ${UNAME_MACHINE}el
923100616Smp	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
924195609Smp	CPU=${UNAME_MACHINE}el
925100616Smp	#else
926100616Smp	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
927195609Smp	CPU=${UNAME_MACHINE}
928100616Smp	#else
929100616Smp	CPU=
930100616Smp	#endif
931100616Smp	#endif
932100616SmpEOF
933231990Smp	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
934195609Smp	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
935100616Smp	;;
936195609Smp    or32:Linux:*:*)
937195609Smp	echo or32-unknown-linux-gnu
938195609Smp	exit ;;
939195609Smp    padre:Linux:*:*)
940195609Smp	echo sparc-unknown-linux-gnu
941195609Smp	exit ;;
942231990Smp    parisc64:Linux:*:* | hppa64:Linux:*:*)
943231990Smp	echo hppa64-unknown-linux-gnu
944231990Smp	exit ;;
945100616Smp    parisc:Linux:*:* | hppa:Linux:*:*)
946100616Smp	# Look for CPU level
947100616Smp	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
948100616Smp	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
949100616Smp	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
950100616Smp	  *)    echo hppa-unknown-linux-gnu ;;
951100616Smp	esac
952195609Smp	exit ;;
953231990Smp    ppc64:Linux:*:*)
954231990Smp	echo powerpc64-unknown-linux-gnu
955195609Smp	exit ;;
956231990Smp    ppc:Linux:*:*)
957231990Smp	echo powerpc-unknown-linux-gnu
958231990Smp	exit ;;
959100616Smp    s390:Linux:*:* | s390x:Linux:*:*)
960100616Smp	echo ${UNAME_MACHINE}-ibm-linux
961195609Smp	exit ;;
962195609Smp    sh64*:Linux:*:*)
963195609Smp    	echo ${UNAME_MACHINE}-unknown-linux-gnu
964195609Smp	exit ;;
965100616Smp    sh*:Linux:*:*)
966100616Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu
967195609Smp	exit ;;
968100616Smp    sparc:Linux:*:* | sparc64:Linux:*:*)
969100616Smp	echo ${UNAME_MACHINE}-unknown-linux-gnu
970195609Smp	exit ;;
971195609Smp    vax:Linux:*:*)
972195609Smp	echo ${UNAME_MACHINE}-dec-linux-gnu
973195609Smp	exit ;;
974100616Smp    x86_64:Linux:*:*)
975100616Smp	echo x86_64-unknown-linux-gnu
976195609Smp	exit ;;
977195609Smp    xtensa*:Linux:*:*)
978195609Smp    	echo ${UNAME_MACHINE}-unknown-linux-gnu
979195609Smp	exit ;;
980100616Smp    i*86:DYNIX/ptx:4*:*)
981100616Smp	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
982100616Smp	# earlier versions are messed up and put the nodename in both
983100616Smp	# sysname and nodename.
98469408Sache	echo i386-sequent-sysv4
985195609Smp	exit ;;
986100616Smp    i*86:UNIX_SV:4.2MP:2.*)
98769408Sache        # Unixware is an offshoot of SVR4, but it has its own version
98869408Sache        # number series starting with 2...
98969408Sache        # I am not positive that other SVR4 systems won't match this,
99069408Sache	# I just have to hope.  -- rms.
99169408Sache        # Use sysv4.2uw... so that sysv4* matches it.
99269408Sache	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
993195609Smp	exit ;;
994195609Smp    i*86:OS/2:*:*)
995195609Smp	# If we were able to find `uname', then EMX Unix compatibility
996195609Smp	# is probably installed.
997195609Smp	echo ${UNAME_MACHINE}-pc-os2-emx
998195609Smp	exit ;;
999195609Smp    i*86:XTS-300:*:STOP)
1000195609Smp	echo ${UNAME_MACHINE}-unknown-stop
1001195609Smp	exit ;;
1002195609Smp    i*86:atheos:*:*)
1003195609Smp	echo ${UNAME_MACHINE}-unknown-atheos
1004195609Smp	exit ;;
1005195609Smp    i*86:syllable:*:*)
1006195609Smp	echo ${UNAME_MACHINE}-pc-syllable
1007195609Smp	exit ;;
1008195609Smp    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1009195609Smp	echo i386-unknown-lynxos${UNAME_RELEASE}
1010195609Smp	exit ;;
1011195609Smp    i*86:*DOS:*:*)
1012195609Smp	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1013195609Smp	exit ;;
1014100616Smp    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
101583098Smp	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
101669408Sache	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
101783098Smp		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
101869408Sache	else
101983098Smp		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
102069408Sache	fi
1021195609Smp	exit ;;
1022195609Smp    i*86:*:5:[678]*)
1023195609Smp    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1024100616Smp	case `/bin/uname -X | grep "^Machine"` in
1025100616Smp	    *486*)	     UNAME_MACHINE=i486 ;;
1026100616Smp	    *Pentium)	     UNAME_MACHINE=i586 ;;
1027100616Smp	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1028100616Smp	esac
1029100616Smp	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1030195609Smp	exit ;;
1031100616Smp    i*86:*:3.2:*)
103269408Sache	if test -f /usr/options/cb.name; then
103369408Sache		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
103469408Sache		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
103569408Sache	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1036100616Smp		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1037100616Smp		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1038100616Smp		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
103969408Sache			&& UNAME_MACHINE=i586
1040100616Smp		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
104183098Smp			&& UNAME_MACHINE=i686
1042100616Smp		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
104383098Smp			&& UNAME_MACHINE=i686
104469408Sache		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
104569408Sache	else
104669408Sache		echo ${UNAME_MACHINE}-pc-sysv32
104769408Sache	fi
1048195609Smp	exit ;;
104969408Sache    pc:*:*:*)
1050100616Smp	# Left here for compatibility:
105169408Sache        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1052195609Smp        # the processor, so we play safe by assuming i586.
1053195609Smp	# Note: whatever this is, it MUST be the same as what config.sub
1054195609Smp	# prints for the "djgpp" host, or else GDB configury will decide that
1055195609Smp	# this is a cross-build.
1056195609Smp	echo i586-pc-msdosdjgpp
1057195609Smp        exit ;;
105869408Sache    Intel:Mach:3*:*)
105969408Sache	echo i386-pc-mach3
1060195609Smp	exit ;;
106169408Sache    paragon:*:*:*)
106269408Sache	echo i860-intel-osf1
1063195609Smp	exit ;;
106469408Sache    i860:*:4.*:*) # i860-SVR4
106569408Sache	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
106669408Sache	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
106769408Sache	else # Add other i860-SVR4 vendors below as they are discovered.
106869408Sache	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
106969408Sache	fi
1070195609Smp	exit ;;
107169408Sache    mini*:CTIX:SYS*5:*)
107269408Sache	# "miniframe"
107369408Sache	echo m68010-convergent-sysv
1074195609Smp	exit ;;
1075195609Smp    mc68k:UNIX:SYSTEM5:3.51m)
1076195609Smp	echo m68k-convergent-sysv
1077195609Smp	exit ;;
1078195609Smp    M680?0:D-NIX:5.3:*)
1079195609Smp	echo m68k-diab-dnix
1080195609Smp	exit ;;
1081195609Smp    M68*:*:R3V[5678]*:*)
1082195609Smp	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1083195609Smp    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)
108469408Sache	OS_REL=''
108569408Sache	test -r /etc/.relid \
108669408Sache	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
108769408Sache	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1088195609Smp	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
108969408Sache	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1090195609Smp	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
109169408Sache    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
109269408Sache        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1093195609Smp          && { echo i486-ncr-sysv4; exit; } ;;
1094195609Smp    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1095195609Smp	OS_REL='.3'
1096195609Smp	test -r /etc/.relid \
1097195609Smp	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1098195609Smp	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1099195609Smp	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1100195609Smp	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1101195609Smp	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1102195609Smp	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1103195609Smp	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1104100616Smp    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
110569408Sache	echo m68k-unknown-lynxos${UNAME_RELEASE}
1106195609Smp	exit ;;
110769408Sache    mc68030:UNIX_System_V:4.*:*)
110869408Sache	echo m68k-atari-sysv4
1109195609Smp	exit ;;
111069408Sache    TSUNAMI:LynxOS:2.*:*)
111169408Sache	echo sparc-unknown-lynxos${UNAME_RELEASE}
1112195609Smp	exit ;;
1113100616Smp    rs6000:LynxOS:2.*:*)
111469408Sache	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1115195609Smp	exit ;;
1116195609Smp    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1117100616Smp	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1118195609Smp	exit ;;
111969408Sache    SM[BE]S:UNIX_SV:*:*)
112069408Sache	echo mips-dde-sysv${UNAME_RELEASE}
1121195609Smp	exit ;;
112283098Smp    RM*:ReliantUNIX-*:*:*)
112383098Smp	echo mips-sni-sysv4
1124195609Smp	exit ;;
112569408Sache    RM*:SINIX-*:*:*)
112669408Sache	echo mips-sni-sysv4
1127195609Smp	exit ;;
112869408Sache    *:SINIX-*:*:*)
112969408Sache	if uname -p 2>/dev/null >/dev/null ; then
113069408Sache		UNAME_MACHINE=`(uname -p) 2>/dev/null`
113169408Sache		echo ${UNAME_MACHINE}-sni-sysv4
113269408Sache	else
113369408Sache		echo ns32k-sni-sysv
113469408Sache	fi
1135195609Smp	exit ;;
1136100616Smp    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1137100616Smp                      # says <Richard.M.Bartel@ccMail.Census.GOV>
113869408Sache        echo i586-unisys-sysv4
1139195609Smp        exit ;;
114069408Sache    *:UNIX_System_V:4*:FTX*)
114169408Sache	# From Gerald Hewes <hewes@openmarket.com>.
114269408Sache	# How about differentiating between stratus architectures? -djm
114369408Sache	echo hppa1.1-stratus-sysv4
1144195609Smp	exit ;;
114569408Sache    *:*:*:FTX*)
114669408Sache	# From seanf@swdc.stratus.com.
114769408Sache	echo i860-stratus-sysv4
1148195609Smp	exit ;;
1149195609Smp    i*86:VOS:*:*)
1150195609Smp	# From Paul.Green@stratus.com.
1151195609Smp	echo ${UNAME_MACHINE}-stratus-vos
1152195609Smp	exit ;;
1153100616Smp    *:VOS:*:*)
1154100616Smp	# From Paul.Green@stratus.com.
1155100616Smp	echo hppa1.1-stratus-vos
1156195609Smp	exit ;;
115769408Sache    mc68*:A/UX:*:*)
115869408Sache	echo m68k-apple-aux${UNAME_RELEASE}
1159195609Smp	exit ;;
1160100616Smp    news*:NEWS-OS:6*:*)
116169408Sache	echo mips-sony-newsos6
1162195609Smp	exit ;;
116383098Smp    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
116469408Sache	if [ -d /usr/nec ]; then
116569408Sache	        echo mips-nec-sysv${UNAME_RELEASE}
116669408Sache	else
116769408Sache	        echo mips-unknown-sysv${UNAME_RELEASE}
116869408Sache	fi
1169195609Smp        exit ;;
117069408Sache    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
117169408Sache	echo powerpc-be-beos
1172195609Smp	exit ;;
117369408Sache    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
117469408Sache	echo powerpc-apple-beos
1175195609Smp	exit ;;
117669408Sache    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
117769408Sache	echo i586-pc-beos
1178195609Smp	exit ;;
1179195609Smp    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1180195609Smp	echo i586-pc-haiku
1181195609Smp	exit ;;
118283098Smp    SX-4:SUPER-UX:*:*)
118383098Smp	echo sx4-nec-superux${UNAME_RELEASE}
1184195609Smp	exit ;;
118583098Smp    SX-5:SUPER-UX:*:*)
118683098Smp	echo sx5-nec-superux${UNAME_RELEASE}
1187195609Smp	exit ;;
1188195609Smp    SX-6:SUPER-UX:*:*)
1189195609Smp	echo sx6-nec-superux${UNAME_RELEASE}
1190195609Smp	exit ;;
1191195609Smp    SX-7:SUPER-UX:*:*)
1192195609Smp	echo sx7-nec-superux${UNAME_RELEASE}
1193195609Smp	exit ;;
1194195609Smp    SX-8:SUPER-UX:*:*)
1195195609Smp	echo sx8-nec-superux${UNAME_RELEASE}
1196195609Smp	exit ;;
1197195609Smp    SX-8R:SUPER-UX:*:*)
1198195609Smp	echo sx8r-nec-superux${UNAME_RELEASE}
1199195609Smp	exit ;;
120083098Smp    Power*:Rhapsody:*:*)
120183098Smp	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1202195609Smp	exit ;;
120383098Smp    *:Rhapsody:*:*)
120483098Smp	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1205195609Smp	exit ;;
1206100616Smp    *:Darwin:*:*)
1207195609Smp	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1208195609Smp	case $UNAME_PROCESSOR in
1209231990Smp	    i386)
1210231990Smp		eval $set_cc_for_build
1211231990Smp		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1212231990Smp		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1213231990Smp		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1214231990Smp		      grep IS_64BIT_ARCH >/dev/null
1215231990Smp		  then
1216231990Smp		      UNAME_PROCESSOR="x86_64"
1217231990Smp		  fi
1218231990Smp		fi ;;
1219195609Smp	    unknown) UNAME_PROCESSOR=powerpc ;;
1220195609Smp	esac
1221195609Smp	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1222195609Smp	exit ;;
1223100616Smp    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1224100616Smp	UNAME_PROCESSOR=`uname -p`
1225100616Smp	if test "$UNAME_PROCESSOR" = "x86"; then
1226100616Smp		UNAME_PROCESSOR=i386
1227100616Smp		UNAME_MACHINE=pc
1228100616Smp	fi
1229100616Smp	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1230195609Smp	exit ;;
123183098Smp    *:QNX:*:4*)
1232100616Smp	echo i386-pc-qnx
1233195609Smp	exit ;;
1234195609Smp    NSE-?:NONSTOP_KERNEL:*:*)
1235195609Smp	echo nse-tandem-nsk${UNAME_RELEASE}
1236195609Smp	exit ;;
1237195609Smp    NSR-?:NONSTOP_KERNEL:*:*)
1238100616Smp	echo nsr-tandem-nsk${UNAME_RELEASE}
1239195609Smp	exit ;;
1240100616Smp    *:NonStop-UX:*:*)
1241100616Smp	echo mips-compaq-nonstopux
1242195609Smp	exit ;;
1243100616Smp    BS2000:POSIX*:*:*)
1244100616Smp	echo bs2000-siemens-sysv
1245195609Smp	exit ;;
1246100616Smp    DS/*:UNIX_System_V:*:*)
1247100616Smp	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1248195609Smp	exit ;;
1249100616Smp    *:Plan9:*:*)
1250100616Smp	# "uname -m" is not consistent, so use $cputype instead. 386
1251100616Smp	# is converted to i386 for consistency with other x86
1252100616Smp	# operating systems.
1253100616Smp	if test "$cputype" = "386"; then
1254100616Smp	    UNAME_MACHINE=i386
1255100616Smp	else
1256100616Smp	    UNAME_MACHINE="$cputype"
1257100616Smp	fi
1258100616Smp	echo ${UNAME_MACHINE}-unknown-plan9
1259195609Smp	exit ;;
1260100616Smp    *:TOPS-10:*:*)
1261100616Smp	echo pdp10-unknown-tops10
1262195609Smp	exit ;;
1263100616Smp    *:TENEX:*:*)
1264100616Smp	echo pdp10-unknown-tenex
1265195609Smp	exit ;;
1266100616Smp    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1267100616Smp	echo pdp10-dec-tops20
1268195609Smp	exit ;;
1269100616Smp    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1270100616Smp	echo pdp10-xkl-tops20
1271195609Smp	exit ;;
1272100616Smp    *:TOPS-20:*:*)
1273100616Smp	echo pdp10-unknown-tops20
1274195609Smp	exit ;;
1275100616Smp    *:ITS:*:*)
1276100616Smp	echo pdp10-unknown-its
1277195609Smp	exit ;;
1278195609Smp    SEI:*:*:SEIUX)
1279195609Smp        echo mips-sei-seiux${UNAME_RELEASE}
1280195609Smp	exit ;;
1281195609Smp    *:DragonFly:*:*)
1282195609Smp	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1283195609Smp	exit ;;
1284195609Smp    *:*VMS:*:*)
1285195609Smp    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1286195609Smp	case "${UNAME_MACHINE}" in
1287195609Smp	    A*) echo alpha-dec-vms ; exit ;;
1288195609Smp	    I*) echo ia64-dec-vms ; exit ;;
1289195609Smp	    V*) echo vax-dec-vms ; exit ;;
1290195609Smp	esac ;;
1291195609Smp    *:XENIX:*:SysV)
1292195609Smp	echo i386-pc-xenix
1293195609Smp	exit ;;
1294195609Smp    i*86:skyos:*:*)
1295195609Smp	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1296195609Smp	exit ;;
1297195609Smp    i*86:rdos:*:*)
1298195609Smp	echo ${UNAME_MACHINE}-pc-rdos
1299195609Smp	exit ;;
1300195609Smp    i*86:AROS:*:*)
1301195609Smp	echo ${UNAME_MACHINE}-pc-aros
1302195609Smp	exit ;;
130369408Sacheesac
130469408Sache
130569408Sache#echo '(No uname command or uname output not recognized.)' 1>&2
130669408Sache#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
130769408Sache
1308100616Smpeval $set_cc_for_build
130983098Smpcat >$dummy.c <<EOF
131069408Sache#ifdef _SEQUENT_
131169408Sache# include <sys/types.h>
131269408Sache# include <sys/utsname.h>
131369408Sache#endif
131469408Sachemain ()
131569408Sache{
131669408Sache#if defined (sony)
131769408Sache#if defined (MIPSEB)
131869408Sache  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
131969408Sache     I don't know....  */
132069408Sache  printf ("mips-sony-bsd\n"); exit (0);
132169408Sache#else
132269408Sache#include <sys/param.h>
132369408Sache  printf ("m68k-sony-newsos%s\n",
132469408Sache#ifdef NEWSOS4
132569408Sache          "4"
132669408Sache#else
132769408Sache	  ""
132869408Sache#endif
132969408Sache         ); exit (0);
133069408Sache#endif
133169408Sache#endif
133269408Sache
133369408Sache#if defined (__arm) && defined (__acorn) && defined (__unix)
1334195609Smp  printf ("arm-acorn-riscix\n"); exit (0);
133569408Sache#endif
133669408Sache
133769408Sache#if defined (hp300) && !defined (hpux)
133869408Sache  printf ("m68k-hp-bsd\n"); exit (0);
133969408Sache#endif
134069408Sache
134169408Sache#if defined (NeXT)
134269408Sache#if !defined (__ARCHITECTURE__)
134369408Sache#define __ARCHITECTURE__ "m68k"
134469408Sache#endif
134569408Sache  int version;
134669408Sache  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
134783098Smp  if (version < 4)
134883098Smp    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
134983098Smp  else
135083098Smp    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
135169408Sache  exit (0);
135269408Sache#endif
135369408Sache
135469408Sache#if defined (MULTIMAX) || defined (n16)
135569408Sache#if defined (UMAXV)
135669408Sache  printf ("ns32k-encore-sysv\n"); exit (0);
135769408Sache#else
135869408Sache#if defined (CMU)
135969408Sache  printf ("ns32k-encore-mach\n"); exit (0);
136069408Sache#else
136169408Sache  printf ("ns32k-encore-bsd\n"); exit (0);
136269408Sache#endif
136369408Sache#endif
136469408Sache#endif
136569408Sache
136669408Sache#if defined (__386BSD__)
136769408Sache  printf ("i386-pc-bsd\n"); exit (0);
136869408Sache#endif
136969408Sache
137069408Sache#if defined (sequent)
137169408Sache#if defined (i386)
137269408Sache  printf ("i386-sequent-dynix\n"); exit (0);
137369408Sache#endif
137469408Sache#if defined (ns32000)
137569408Sache  printf ("ns32k-sequent-dynix\n"); exit (0);
137669408Sache#endif
137769408Sache#endif
137869408Sache
137969408Sache#if defined (_SEQUENT_)
138069408Sache    struct utsname un;
138169408Sache
138269408Sache    uname(&un);
138369408Sache
138469408Sache    if (strncmp(un.version, "V2", 2) == 0) {
138569408Sache	printf ("i386-sequent-ptx2\n"); exit (0);
138669408Sache    }
138769408Sache    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
138869408Sache	printf ("i386-sequent-ptx1\n"); exit (0);
138969408Sache    }
139069408Sache    printf ("i386-sequent-ptx\n"); exit (0);
139169408Sache
139269408Sache#endif
139369408Sache
139469408Sache#if defined (vax)
1395100616Smp# if !defined (ultrix)
1396100616Smp#  include <sys/param.h>
1397100616Smp#  if defined (BSD)
1398100616Smp#   if BSD == 43
1399100616Smp      printf ("vax-dec-bsd4.3\n"); exit (0);
1400100616Smp#   else
1401100616Smp#    if BSD == 199006
1402100616Smp      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1403100616Smp#    else
1404100616Smp      printf ("vax-dec-bsd\n"); exit (0);
1405100616Smp#    endif
1406100616Smp#   endif
1407100616Smp#  else
1408100616Smp    printf ("vax-dec-bsd\n"); exit (0);
1409100616Smp#  endif
1410100616Smp# else
1411100616Smp    printf ("vax-dec-ultrix\n"); exit (0);
1412100616Smp# endif
141369408Sache#endif
141469408Sache
141569408Sache#if defined (alliant) && defined (i860)
141669408Sache  printf ("i860-alliant-bsd\n"); exit (0);
141769408Sache#endif
141869408Sache
141969408Sache  exit (1);
142069408Sache}
142169408SacheEOF
142269408Sache
1423195609Smp$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1424195609Smp	{ echo "$SYSTEM_NAME"; exit; }
142569408Sache
142669408Sache# Apollos put the system type in the environment.
142769408Sache
1428195609Smptest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
142969408Sache
143069408Sache# Convex versions that predate uname can use getsysinfo(1)
143169408Sache
143269408Sacheif [ -x /usr/convex/getsysinfo ]
143369408Sachethen
143483098Smp    case `getsysinfo -f cpu_type` in
143569408Sache    c1*)
143669408Sache	echo c1-convex-bsd
1437195609Smp	exit ;;
143869408Sache    c2*)
143983098Smp	if getsysinfo -f scalar_acc
144069408Sache	then echo c32-convex-bsd
144169408Sache	else echo c2-convex-bsd
144269408Sache	fi
1443195609Smp	exit ;;
144469408Sache    c34*)
144569408Sache	echo c34-convex-bsd
1446195609Smp	exit ;;
144769408Sache    c38*)
144869408Sache	echo c38-convex-bsd
1449195609Smp	exit ;;
145069408Sache    c4*)
145169408Sache	echo c4-convex-bsd
1452195609Smp	exit ;;
145369408Sache    esac
145469408Sachefi
145569408Sache
1456100616Smpcat >&2 <<EOF
1457100616Smp$0: unable to guess system type
145869408Sache
1459100616SmpThis script, last modified $timestamp, has failed to recognize
1460100616Smpthe operating system you are using. It is advised that you
1461100616Smpdownload the most up to date version of the config scripts from
1462100616Smp
1463195609Smp  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1464195609Smpand
1465195609Smp  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1466100616Smp
1467100616SmpIf the version you run ($0) is already up to date, please
1468100616Smpsend the following data and any information you think might be
1469100616Smppertinent to <config-patches@gnu.org> in order to provide the needed
1470100616Smpinformation to handle your system.
1471100616Smp
1472100616Smpconfig.guess timestamp = $timestamp
1473100616Smp
1474100616Smpuname -m = `(uname -m) 2>/dev/null || echo unknown`
1475100616Smpuname -r = `(uname -r) 2>/dev/null || echo unknown`
1476100616Smpuname -s = `(uname -s) 2>/dev/null || echo unknown`
1477100616Smpuname -v = `(uname -v) 2>/dev/null || echo unknown`
1478100616Smp
1479100616Smp/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1480100616Smp/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1481100616Smp
1482100616Smphostinfo               = `(hostinfo) 2>/dev/null`
1483100616Smp/bin/universe          = `(/bin/universe) 2>/dev/null`
1484100616Smp/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1485100616Smp/bin/arch              = `(/bin/arch) 2>/dev/null`
1486100616Smp/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1487100616Smp/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1488100616Smp
1489100616SmpUNAME_MACHINE = ${UNAME_MACHINE}
1490100616SmpUNAME_RELEASE = ${UNAME_RELEASE}
1491100616SmpUNAME_SYSTEM  = ${UNAME_SYSTEM}
1492100616SmpUNAME_VERSION = ${UNAME_VERSION}
1493100616SmpEOF
1494100616Smp
149569408Sacheexit 1
1496100616Smp
1497100616Smp# Local variables:
1498100616Smp# eval: (add-hook 'write-file-hooks 'time-stamp)
1499100616Smp# time-stamp-start: "timestamp='"
1500100616Smp# time-stamp-format: "%:y-%02m-%02d"
1501100616Smp# time-stamp-end: "'"
1502100616Smp# End:
1503