1238106Sdes#! /bin/sh
2238106Sdes# Attempt to guess a canonical system name.
3238106Sdes#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4249141Sdes#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5249141Sdes#   2011, 2012 Free Software Foundation, Inc.
6238106Sdes
7249141Sdestimestamp='2012-06-10'
8238106Sdes
9238106Sdes# This file is free software; you can redistribute it and/or modify it
10238106Sdes# under the terms of the GNU General Public License as published by
11238106Sdes# the Free Software Foundation; either version 2 of the License, or
12238106Sdes# (at your option) any later version.
13238106Sdes#
14238106Sdes# This program is distributed in the hope that it will be useful, but
15238106Sdes# WITHOUT ANY WARRANTY; without even the implied warranty of
16238106Sdes# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17238106Sdes# General Public License for more details.
18238106Sdes#
19238106Sdes# You should have received a copy of the GNU General Public License
20249141Sdes# along with this program; if not, see <http://www.gnu.org/licenses/>.
21238106Sdes#
22238106Sdes# As a special exception to the GNU General Public License, if you
23238106Sdes# distribute this file as part of a program that contains a
24238106Sdes# configuration script generated by Autoconf, you may include it under
25238106Sdes# the same distribution terms that you use for the rest of that program.
26238106Sdes
27238106Sdes
28238106Sdes# Originally written by Per Bothner.  Please send patches (context
29238106Sdes# diff format) to <config-patches@gnu.org> and include a ChangeLog
30238106Sdes# entry.
31238106Sdes#
32238106Sdes# This script attempts to guess a canonical system name similar to
33238106Sdes# config.sub.  If it succeeds, it prints the system name on stdout, and
34238106Sdes# exits with 0.  Otherwise, it exits with 1.
35238106Sdes#
36238106Sdes# You can get the latest version of this script from:
37238106Sdes# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
38238106Sdes
39238106Sdesme=`echo "$0" | sed -e 's,.*/,,'`
40238106Sdes
41238106Sdesusage="\
42238106SdesUsage: $0 [OPTION]
43238106Sdes
44238106SdesOutput the configuration name of the system \`$me' is run on.
45238106Sdes
46238106SdesOperation modes:
47238106Sdes  -h, --help         print this help, then exit
48238106Sdes  -t, --time-stamp   print date of last modification, then exit
49238106Sdes  -v, --version      print version number, then exit
50238106Sdes
51238106SdesReport bugs and patches to <config-patches@gnu.org>."
52238106Sdes
53238106Sdesversion="\
54238106SdesGNU config.guess ($timestamp)
55238106Sdes
56238106SdesOriginally written by Per Bothner.
57249141SdesCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
58249141Sdes2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
59249141SdesFree Software Foundation, Inc.
60238106Sdes
61238106SdesThis is free software; see the source for copying conditions.  There is NO
62238106Sdeswarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
63238106Sdes
64238106Sdeshelp="
65238106SdesTry \`$me --help' for more information."
66238106Sdes
67238106Sdes# Parse command line
68238106Sdeswhile test $# -gt 0 ; do
69238106Sdes  case $1 in
70238106Sdes    --time-stamp | --time* | -t )
71238106Sdes       echo "$timestamp" ; exit ;;
72238106Sdes    --version | -v )
73238106Sdes       echo "$version" ; exit ;;
74238106Sdes    --help | --h* | -h )
75238106Sdes       echo "$usage"; exit ;;
76238106Sdes    -- )     # Stop option processing
77238106Sdes       shift; break ;;
78238106Sdes    - )	# Use stdin as input.
79238106Sdes       break ;;
80238106Sdes    -* )
81238106Sdes       echo "$me: invalid option $1$help" >&2
82238106Sdes       exit 1 ;;
83238106Sdes    * )
84238106Sdes       break ;;
85238106Sdes  esac
86238106Sdesdone
87238106Sdes
88238106Sdesif test $# != 0; then
89238106Sdes  echo "$me: too many arguments$help" >&2
90238106Sdes  exit 1
91238106Sdesfi
92238106Sdes
93238106Sdestrap 'exit 1' 1 2 15
94238106Sdes
95238106Sdes# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96238106Sdes# compiler to aid in system detection is discouraged as it requires
97238106Sdes# temporary files to be created and, as you can see below, it is a
98238106Sdes# headache to deal with in a portable fashion.
99238106Sdes
100238106Sdes# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
101238106Sdes# use `HOST_CC' if defined, but it is deprecated.
102238106Sdes
103238106Sdes# Portable tmp directory creation inspired by the Autoconf team.
104238106Sdes
105238106Sdesset_cc_for_build='
106238106Sdestrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107238106Sdestrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108238106Sdes: ${TMPDIR=/tmp} ;
109238106Sdes { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110238106Sdes { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111238106Sdes { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112238106Sdes { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
113238106Sdesdummy=$tmp/dummy ;
114238106Sdestmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115238106Sdescase $CC_FOR_BUILD,$HOST_CC,$CC in
116238106Sdes ,,)    echo "int x;" > $dummy.c ;
117238106Sdes	for c in cc gcc c89 c99 ; do
118238106Sdes	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
119238106Sdes	     CC_FOR_BUILD="$c"; break ;
120238106Sdes	  fi ;
121238106Sdes	done ;
122238106Sdes	if test x"$CC_FOR_BUILD" = x ; then
123238106Sdes	  CC_FOR_BUILD=no_compiler_found ;
124238106Sdes	fi
125238106Sdes	;;
126238106Sdes ,,*)   CC_FOR_BUILD=$CC ;;
127238106Sdes ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
128238106Sdesesac ; set_cc_for_build= ;'
129238106Sdes
130238106Sdes# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131238106Sdes# (ghazi@noc.rutgers.edu 1994-08-24)
132238106Sdesif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
133238106Sdes	PATH=$PATH:/.attbin ; export PATH
134238106Sdesfi
135238106Sdes
136238106SdesUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
137238106SdesUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
138238106SdesUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
139238106SdesUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
140238106Sdes
141238106Sdes# Note: order is significant - the case branches are not exclusive.
142238106Sdes
143238106Sdescase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
144238106Sdes    *:NetBSD:*:*)
145238106Sdes	# NetBSD (nbsd) targets should (where applicable) match one or
146249141Sdes	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
147238106Sdes	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
148238106Sdes	# switched to ELF, *-*-netbsd* would select the old
149238106Sdes	# object file format.  This provides both forward
150238106Sdes	# compatibility and a consistent mechanism for selecting the
151238106Sdes	# object file format.
152238106Sdes	#
153238106Sdes	# Note: NetBSD doesn't particularly care about the vendor
154238106Sdes	# portion of the name.  We always set it to "unknown".
155238106Sdes	sysctl="sysctl -n hw.machine_arch"
156238106Sdes	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157238106Sdes	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158238106Sdes	case "${UNAME_MACHINE_ARCH}" in
159238106Sdes	    armeb) machine=armeb-unknown ;;
160238106Sdes	    arm*) machine=arm-unknown ;;
161238106Sdes	    sh3el) machine=shl-unknown ;;
162238106Sdes	    sh3eb) machine=sh-unknown ;;
163238106Sdes	    sh5el) machine=sh5le-unknown ;;
164238106Sdes	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
165238106Sdes	esac
166238106Sdes	# The Operating System including object format, if it has switched
167238106Sdes	# to ELF recently, or will in the future.
168238106Sdes	case "${UNAME_MACHINE_ARCH}" in
169238106Sdes	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
170238106Sdes		eval $set_cc_for_build
171238106Sdes		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
172238106Sdes			| grep -q __ELF__
173238106Sdes		then
174238106Sdes		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
175238106Sdes		    # Return netbsd for either.  FIX?
176238106Sdes		    os=netbsd
177238106Sdes		else
178238106Sdes		    os=netbsdelf
179238106Sdes		fi
180238106Sdes		;;
181238106Sdes	    *)
182249141Sdes		os=netbsd
183238106Sdes		;;
184238106Sdes	esac
185238106Sdes	# The OS release
186238106Sdes	# Debian GNU/NetBSD machines have a different userland, and
187238106Sdes	# thus, need a distinct triplet. However, they do not need
188238106Sdes	# kernel version information, so it can be replaced with a
189238106Sdes	# suitable tag, in the style of linux-gnu.
190238106Sdes	case "${UNAME_VERSION}" in
191238106Sdes	    Debian*)
192238106Sdes		release='-gnu'
193238106Sdes		;;
194238106Sdes	    *)
195238106Sdes		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
196238106Sdes		;;
197238106Sdes	esac
198238106Sdes	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
199238106Sdes	# contains redundant information, the shorter form:
200238106Sdes	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
201238106Sdes	echo "${machine}-${os}${release}"
202238106Sdes	exit ;;
203238106Sdes    *:OpenBSD:*:*)
204238106Sdes	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
205238106Sdes	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
206238106Sdes	exit ;;
207238106Sdes    *:ekkoBSD:*:*)
208238106Sdes	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
209238106Sdes	exit ;;
210238106Sdes    *:SolidBSD:*:*)
211238106Sdes	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
212238106Sdes	exit ;;
213238106Sdes    macppc:MirBSD:*:*)
214238106Sdes	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
215238106Sdes	exit ;;
216238106Sdes    *:MirBSD:*:*)
217238106Sdes	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
218238106Sdes	exit ;;
219238106Sdes    alpha:OSF1:*:*)
220238106Sdes	case $UNAME_RELEASE in
221238106Sdes	*4.0)
222238106Sdes		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223238106Sdes		;;
224238106Sdes	*5.*)
225249141Sdes		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
226238106Sdes		;;
227238106Sdes	esac
228238106Sdes	# According to Compaq, /usr/sbin/psrinfo has been available on
229238106Sdes	# OSF/1 and Tru64 systems produced since 1995.  I hope that
230238106Sdes	# covers most systems running today.  This code pipes the CPU
231238106Sdes	# types through head -n 1, so we only detect the type of CPU 0.
232238106Sdes	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
233238106Sdes	case "$ALPHA_CPU_TYPE" in
234238106Sdes	    "EV4 (21064)")
235238106Sdes		UNAME_MACHINE="alpha" ;;
236238106Sdes	    "EV4.5 (21064)")
237238106Sdes		UNAME_MACHINE="alpha" ;;
238238106Sdes	    "LCA4 (21066/21068)")
239238106Sdes		UNAME_MACHINE="alpha" ;;
240238106Sdes	    "EV5 (21164)")
241238106Sdes		UNAME_MACHINE="alphaev5" ;;
242238106Sdes	    "EV5.6 (21164A)")
243238106Sdes		UNAME_MACHINE="alphaev56" ;;
244238106Sdes	    "EV5.6 (21164PC)")
245238106Sdes		UNAME_MACHINE="alphapca56" ;;
246238106Sdes	    "EV5.7 (21164PC)")
247238106Sdes		UNAME_MACHINE="alphapca57" ;;
248238106Sdes	    "EV6 (21264)")
249238106Sdes		UNAME_MACHINE="alphaev6" ;;
250238106Sdes	    "EV6.7 (21264A)")
251238106Sdes		UNAME_MACHINE="alphaev67" ;;
252238106Sdes	    "EV6.8CB (21264C)")
253238106Sdes		UNAME_MACHINE="alphaev68" ;;
254238106Sdes	    "EV6.8AL (21264B)")
255238106Sdes		UNAME_MACHINE="alphaev68" ;;
256238106Sdes	    "EV6.8CX (21264D)")
257238106Sdes		UNAME_MACHINE="alphaev68" ;;
258238106Sdes	    "EV6.9A (21264/EV69A)")
259238106Sdes		UNAME_MACHINE="alphaev69" ;;
260238106Sdes	    "EV7 (21364)")
261238106Sdes		UNAME_MACHINE="alphaev7" ;;
262238106Sdes	    "EV7.9 (21364A)")
263238106Sdes		UNAME_MACHINE="alphaev79" ;;
264238106Sdes	esac
265238106Sdes	# A Pn.n version is a patched version.
266238106Sdes	# A Vn.n version is a released version.
267238106Sdes	# A Tn.n version is a released field test version.
268238106Sdes	# A Xn.n version is an unreleased experimental baselevel.
269238106Sdes	# 1.2 uses "1.2" for uname -r.
270238106Sdes	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
271249141Sdes	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
272249141Sdes	exitcode=$?
273249141Sdes	trap '' 0
274249141Sdes	exit $exitcode ;;
275238106Sdes    Alpha\ *:Windows_NT*:*)
276238106Sdes	# How do we know it's Interix rather than the generic POSIX subsystem?
277238106Sdes	# Should we change UNAME_MACHINE based on the output of uname instead
278238106Sdes	# of the specific Alpha model?
279238106Sdes	echo alpha-pc-interix
280238106Sdes	exit ;;
281238106Sdes    21064:Windows_NT:50:3)
282238106Sdes	echo alpha-dec-winnt3.5
283238106Sdes	exit ;;
284238106Sdes    Amiga*:UNIX_System_V:4.0:*)
285238106Sdes	echo m68k-unknown-sysv4
286238106Sdes	exit ;;
287238106Sdes    *:[Aa]miga[Oo][Ss]:*:*)
288238106Sdes	echo ${UNAME_MACHINE}-unknown-amigaos
289238106Sdes	exit ;;
290238106Sdes    *:[Mm]orph[Oo][Ss]:*:*)
291238106Sdes	echo ${UNAME_MACHINE}-unknown-morphos
292238106Sdes	exit ;;
293238106Sdes    *:OS/390:*:*)
294238106Sdes	echo i370-ibm-openedition
295238106Sdes	exit ;;
296238106Sdes    *:z/VM:*:*)
297238106Sdes	echo s390-ibm-zvmoe
298238106Sdes	exit ;;
299238106Sdes    *:OS400:*:*)
300249141Sdes	echo powerpc-ibm-os400
301238106Sdes	exit ;;
302238106Sdes    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
303238106Sdes	echo arm-acorn-riscix${UNAME_RELEASE}
304238106Sdes	exit ;;
305238106Sdes    arm:riscos:*:*|arm:RISCOS:*:*)
306238106Sdes	echo arm-unknown-riscos
307238106Sdes	exit ;;
308238106Sdes    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
309238106Sdes	echo hppa1.1-hitachi-hiuxmpp
310238106Sdes	exit ;;
311238106Sdes    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
312238106Sdes	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
313238106Sdes	if test "`(/bin/universe) 2>/dev/null`" = att ; then
314238106Sdes		echo pyramid-pyramid-sysv3
315238106Sdes	else
316238106Sdes		echo pyramid-pyramid-bsd
317238106Sdes	fi
318238106Sdes	exit ;;
319238106Sdes    NILE*:*:*:dcosx)
320238106Sdes	echo pyramid-pyramid-svr4
321238106Sdes	exit ;;
322238106Sdes    DRS?6000:unix:4.0:6*)
323238106Sdes	echo sparc-icl-nx6
324238106Sdes	exit ;;
325238106Sdes    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
326238106Sdes	case `/usr/bin/uname -p` in
327238106Sdes	    sparc) echo sparc-icl-nx7; exit ;;
328238106Sdes	esac ;;
329238106Sdes    s390x:SunOS:*:*)
330238106Sdes	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
331238106Sdes	exit ;;
332238106Sdes    sun4H:SunOS:5.*:*)
333238106Sdes	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
334238106Sdes	exit ;;
335238106Sdes    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
336238106Sdes	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
337238106Sdes	exit ;;
338238106Sdes    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
339238106Sdes	echo i386-pc-auroraux${UNAME_RELEASE}
340238106Sdes	exit ;;
341238106Sdes    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
342238106Sdes	eval $set_cc_for_build
343238106Sdes	SUN_ARCH="i386"
344238106Sdes	# If there is a compiler, see if it is configured for 64-bit objects.
345238106Sdes	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
346238106Sdes	# This test works for both compilers.
347238106Sdes	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
348238106Sdes	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
349238106Sdes		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
350238106Sdes		grep IS_64BIT_ARCH >/dev/null
351238106Sdes	    then
352238106Sdes		SUN_ARCH="x86_64"
353238106Sdes	    fi
354238106Sdes	fi
355238106Sdes	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
356238106Sdes	exit ;;
357238106Sdes    sun4*:SunOS:6*:*)
358238106Sdes	# According to config.sub, this is the proper way to canonicalize
359238106Sdes	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
360238106Sdes	# it's likely to be more like Solaris than SunOS4.
361238106Sdes	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
362238106Sdes	exit ;;
363238106Sdes    sun4*:SunOS:*:*)
364238106Sdes	case "`/usr/bin/arch -k`" in
365238106Sdes	    Series*|S4*)
366238106Sdes		UNAME_RELEASE=`uname -v`
367238106Sdes		;;
368238106Sdes	esac
369238106Sdes	# Japanese Language versions have a version number like `4.1.3-JL'.
370238106Sdes	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
371238106Sdes	exit ;;
372238106Sdes    sun3*:SunOS:*:*)
373238106Sdes	echo m68k-sun-sunos${UNAME_RELEASE}
374238106Sdes	exit ;;
375238106Sdes    sun*:*:4.2BSD:*)
376238106Sdes	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
377238106Sdes	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
378238106Sdes	case "`/bin/arch`" in
379238106Sdes	    sun3)
380238106Sdes		echo m68k-sun-sunos${UNAME_RELEASE}
381238106Sdes		;;
382238106Sdes	    sun4)
383238106Sdes		echo sparc-sun-sunos${UNAME_RELEASE}
384238106Sdes		;;
385238106Sdes	esac
386238106Sdes	exit ;;
387238106Sdes    aushp:SunOS:*:*)
388238106Sdes	echo sparc-auspex-sunos${UNAME_RELEASE}
389238106Sdes	exit ;;
390238106Sdes    # The situation for MiNT is a little confusing.  The machine name
391238106Sdes    # can be virtually everything (everything which is not
392238106Sdes    # "atarist" or "atariste" at least should have a processor
393238106Sdes    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
394238106Sdes    # to the lowercase version "mint" (or "freemint").  Finally
395238106Sdes    # the system name "TOS" denotes a system which is actually not
396238106Sdes    # MiNT.  But MiNT is downward compatible to TOS, so this should
397238106Sdes    # be no problem.
398238106Sdes    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
399249141Sdes	echo m68k-atari-mint${UNAME_RELEASE}
400238106Sdes	exit ;;
401238106Sdes    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
402238106Sdes	echo m68k-atari-mint${UNAME_RELEASE}
403249141Sdes	exit ;;
404238106Sdes    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
405249141Sdes	echo m68k-atari-mint${UNAME_RELEASE}
406238106Sdes	exit ;;
407238106Sdes    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
408249141Sdes	echo m68k-milan-mint${UNAME_RELEASE}
409249141Sdes	exit ;;
410238106Sdes    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
411249141Sdes	echo m68k-hades-mint${UNAME_RELEASE}
412249141Sdes	exit ;;
413238106Sdes    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
414249141Sdes	echo m68k-unknown-mint${UNAME_RELEASE}
415249141Sdes	exit ;;
416238106Sdes    m68k:machten:*:*)
417238106Sdes	echo m68k-apple-machten${UNAME_RELEASE}
418238106Sdes	exit ;;
419238106Sdes    powerpc:machten:*:*)
420238106Sdes	echo powerpc-apple-machten${UNAME_RELEASE}
421238106Sdes	exit ;;
422238106Sdes    RISC*:Mach:*:*)
423238106Sdes	echo mips-dec-mach_bsd4.3
424238106Sdes	exit ;;
425238106Sdes    RISC*:ULTRIX:*:*)
426238106Sdes	echo mips-dec-ultrix${UNAME_RELEASE}
427238106Sdes	exit ;;
428238106Sdes    VAX*:ULTRIX*:*:*)
429238106Sdes	echo vax-dec-ultrix${UNAME_RELEASE}
430238106Sdes	exit ;;
431238106Sdes    2020:CLIX:*:* | 2430:CLIX:*:*)
432238106Sdes	echo clipper-intergraph-clix${UNAME_RELEASE}
433238106Sdes	exit ;;
434238106Sdes    mips:*:*:UMIPS | mips:*:*:RISCos)
435238106Sdes	eval $set_cc_for_build
436238106Sdes	sed 's/^	//' << EOF >$dummy.c
437238106Sdes#ifdef __cplusplus
438238106Sdes#include <stdio.h>  /* for printf() prototype */
439238106Sdes	int main (int argc, char *argv[]) {
440238106Sdes#else
441238106Sdes	int main (argc, argv) int argc; char *argv[]; {
442238106Sdes#endif
443238106Sdes	#if defined (host_mips) && defined (MIPSEB)
444238106Sdes	#if defined (SYSTYPE_SYSV)
445238106Sdes	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
446238106Sdes	#endif
447238106Sdes	#if defined (SYSTYPE_SVR4)
448238106Sdes	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
449238106Sdes	#endif
450238106Sdes	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
451238106Sdes	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
452238106Sdes	#endif
453238106Sdes	#endif
454238106Sdes	  exit (-1);
455238106Sdes	}
456238106SdesEOF
457238106Sdes	$CC_FOR_BUILD -o $dummy $dummy.c &&
458238106Sdes	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
459238106Sdes	  SYSTEM_NAME=`$dummy $dummyarg` &&
460238106Sdes	    { echo "$SYSTEM_NAME"; exit; }
461238106Sdes	echo mips-mips-riscos${UNAME_RELEASE}
462238106Sdes	exit ;;
463238106Sdes    Motorola:PowerMAX_OS:*:*)
464238106Sdes	echo powerpc-motorola-powermax
465238106Sdes	exit ;;
466238106Sdes    Motorola:*:4.3:PL8-*)
467238106Sdes	echo powerpc-harris-powermax
468238106Sdes	exit ;;
469238106Sdes    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
470238106Sdes	echo powerpc-harris-powermax
471238106Sdes	exit ;;
472238106Sdes    Night_Hawk:Power_UNIX:*:*)
473238106Sdes	echo powerpc-harris-powerunix
474238106Sdes	exit ;;
475238106Sdes    m88k:CX/UX:7*:*)
476238106Sdes	echo m88k-harris-cxux7
477238106Sdes	exit ;;
478238106Sdes    m88k:*:4*:R4*)
479238106Sdes	echo m88k-motorola-sysv4
480238106Sdes	exit ;;
481238106Sdes    m88k:*:3*:R3*)
482238106Sdes	echo m88k-motorola-sysv3
483238106Sdes	exit ;;
484238106Sdes    AViiON:dgux:*:*)
485249141Sdes	# DG/UX returns AViiON for all architectures
486249141Sdes	UNAME_PROCESSOR=`/usr/bin/uname -p`
487238106Sdes	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
488238106Sdes	then
489238106Sdes	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
490238106Sdes	       [ ${TARGET_BINARY_INTERFACE}x = x ]
491238106Sdes	    then
492238106Sdes		echo m88k-dg-dgux${UNAME_RELEASE}
493238106Sdes	    else
494238106Sdes		echo m88k-dg-dguxbcs${UNAME_RELEASE}
495238106Sdes	    fi
496238106Sdes	else
497238106Sdes	    echo i586-dg-dgux${UNAME_RELEASE}
498238106Sdes	fi
499249141Sdes	exit ;;
500238106Sdes    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
501238106Sdes	echo m88k-dolphin-sysv3
502238106Sdes	exit ;;
503238106Sdes    M88*:*:R3*:*)
504238106Sdes	# Delta 88k system running SVR3
505238106Sdes	echo m88k-motorola-sysv3
506238106Sdes	exit ;;
507238106Sdes    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
508238106Sdes	echo m88k-tektronix-sysv3
509238106Sdes	exit ;;
510238106Sdes    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
511238106Sdes	echo m68k-tektronix-bsd
512238106Sdes	exit ;;
513238106Sdes    *:IRIX*:*:*)
514238106Sdes	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
515238106Sdes	exit ;;
516238106Sdes    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
517238106Sdes	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
518238106Sdes	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
519238106Sdes    i*86:AIX:*:*)
520238106Sdes	echo i386-ibm-aix
521238106Sdes	exit ;;
522238106Sdes    ia64:AIX:*:*)
523238106Sdes	if [ -x /usr/bin/oslevel ] ; then
524238106Sdes		IBM_REV=`/usr/bin/oslevel`
525238106Sdes	else
526238106Sdes		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
527238106Sdes	fi
528238106Sdes	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
529238106Sdes	exit ;;
530238106Sdes    *:AIX:2:3)
531238106Sdes	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
532238106Sdes		eval $set_cc_for_build
533238106Sdes		sed 's/^		//' << EOF >$dummy.c
534238106Sdes		#include <sys/systemcfg.h>
535238106Sdes
536238106Sdes		main()
537238106Sdes			{
538238106Sdes			if (!__power_pc())
539238106Sdes				exit(1);
540238106Sdes			puts("powerpc-ibm-aix3.2.5");
541238106Sdes			exit(0);
542238106Sdes			}
543238106SdesEOF
544238106Sdes		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
545238106Sdes		then
546238106Sdes			echo "$SYSTEM_NAME"
547238106Sdes		else
548238106Sdes			echo rs6000-ibm-aix3.2.5
549238106Sdes		fi
550238106Sdes	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
551238106Sdes		echo rs6000-ibm-aix3.2.4
552238106Sdes	else
553238106Sdes		echo rs6000-ibm-aix3.2
554238106Sdes	fi
555238106Sdes	exit ;;
556249141Sdes    *:AIX:*:[4567])
557238106Sdes	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
558238106Sdes	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
559238106Sdes		IBM_ARCH=rs6000
560238106Sdes	else
561238106Sdes		IBM_ARCH=powerpc
562238106Sdes	fi
563238106Sdes	if [ -x /usr/bin/oslevel ] ; then
564238106Sdes		IBM_REV=`/usr/bin/oslevel`
565238106Sdes	else
566238106Sdes		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
567238106Sdes	fi
568238106Sdes	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
569238106Sdes	exit ;;
570238106Sdes    *:AIX:*:*)
571238106Sdes	echo rs6000-ibm-aix
572238106Sdes	exit ;;
573238106Sdes    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
574238106Sdes	echo romp-ibm-bsd4.4
575238106Sdes	exit ;;
576238106Sdes    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
577238106Sdes	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
578238106Sdes	exit ;;                             # report: romp-ibm BSD 4.3
579238106Sdes    *:BOSX:*:*)
580238106Sdes	echo rs6000-bull-bosx
581238106Sdes	exit ;;
582238106Sdes    DPX/2?00:B.O.S.:*:*)
583238106Sdes	echo m68k-bull-sysv3
584238106Sdes	exit ;;
585238106Sdes    9000/[34]??:4.3bsd:1.*:*)
586238106Sdes	echo m68k-hp-bsd
587238106Sdes	exit ;;
588238106Sdes    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
589238106Sdes	echo m68k-hp-bsd4.4
590238106Sdes	exit ;;
591238106Sdes    9000/[34678]??:HP-UX:*:*)
592238106Sdes	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
593238106Sdes	case "${UNAME_MACHINE}" in
594238106Sdes	    9000/31? )            HP_ARCH=m68000 ;;
595238106Sdes	    9000/[34]?? )         HP_ARCH=m68k ;;
596238106Sdes	    9000/[678][0-9][0-9])
597238106Sdes		if [ -x /usr/bin/getconf ]; then
598238106Sdes		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
599249141Sdes		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
600249141Sdes		    case "${sc_cpu_version}" in
601249141Sdes		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
602249141Sdes		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
603249141Sdes		      532)                      # CPU_PA_RISC2_0
604249141Sdes			case "${sc_kernel_bits}" in
605249141Sdes			  32) HP_ARCH="hppa2.0n" ;;
606249141Sdes			  64) HP_ARCH="hppa2.0w" ;;
607238106Sdes			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
608249141Sdes			esac ;;
609249141Sdes		    esac
610238106Sdes		fi
611238106Sdes		if [ "${HP_ARCH}" = "" ]; then
612238106Sdes		    eval $set_cc_for_build
613249141Sdes		    sed 's/^		//' << EOF >$dummy.c
614238106Sdes
615249141Sdes		#define _HPUX_SOURCE
616249141Sdes		#include <stdlib.h>
617249141Sdes		#include <unistd.h>
618238106Sdes
619249141Sdes		int main ()
620249141Sdes		{
621249141Sdes		#if defined(_SC_KERNEL_BITS)
622249141Sdes		    long bits = sysconf(_SC_KERNEL_BITS);
623249141Sdes		#endif
624249141Sdes		    long cpu  = sysconf (_SC_CPU_VERSION);
625238106Sdes
626249141Sdes		    switch (cpu)
627249141Sdes			{
628249141Sdes			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
629249141Sdes			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
630249141Sdes			case CPU_PA_RISC2_0:
631249141Sdes		#if defined(_SC_KERNEL_BITS)
632249141Sdes			    switch (bits)
633249141Sdes				{
634249141Sdes				case 64: puts ("hppa2.0w"); break;
635249141Sdes				case 32: puts ("hppa2.0n"); break;
636249141Sdes				default: puts ("hppa2.0"); break;
637249141Sdes				} break;
638249141Sdes		#else  /* !defined(_SC_KERNEL_BITS) */
639249141Sdes			    puts ("hppa2.0"); break;
640249141Sdes		#endif
641249141Sdes			default: puts ("hppa1.0"); break;
642249141Sdes			}
643249141Sdes		    exit (0);
644249141Sdes		}
645238106SdesEOF
646238106Sdes		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
647238106Sdes		    test -z "$HP_ARCH" && HP_ARCH=hppa
648238106Sdes		fi ;;
649238106Sdes	esac
650238106Sdes	if [ ${HP_ARCH} = "hppa2.0w" ]
651238106Sdes	then
652238106Sdes	    eval $set_cc_for_build
653238106Sdes
654238106Sdes	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
655238106Sdes	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
656238106Sdes	    # generating 64-bit code.  GNU and HP use different nomenclature:
657238106Sdes	    #
658238106Sdes	    # $ CC_FOR_BUILD=cc ./config.guess
659238106Sdes	    # => hppa2.0w-hp-hpux11.23
660238106Sdes	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
661238106Sdes	    # => hppa64-hp-hpux11.23
662238106Sdes
663238106Sdes	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
664238106Sdes		grep -q __LP64__
665238106Sdes	    then
666238106Sdes		HP_ARCH="hppa2.0w"
667238106Sdes	    else
668238106Sdes		HP_ARCH="hppa64"
669238106Sdes	    fi
670238106Sdes	fi
671238106Sdes	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
672238106Sdes	exit ;;
673238106Sdes    ia64:HP-UX:*:*)
674238106Sdes	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
675238106Sdes	echo ia64-hp-hpux${HPUX_REV}
676238106Sdes	exit ;;
677238106Sdes    3050*:HI-UX:*:*)
678238106Sdes	eval $set_cc_for_build
679238106Sdes	sed 's/^	//' << EOF >$dummy.c
680238106Sdes	#include <unistd.h>
681238106Sdes	int
682238106Sdes	main ()
683238106Sdes	{
684238106Sdes	  long cpu = sysconf (_SC_CPU_VERSION);
685238106Sdes	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
686238106Sdes	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
687238106Sdes	     results, however.  */
688238106Sdes	  if (CPU_IS_PA_RISC (cpu))
689238106Sdes	    {
690238106Sdes	      switch (cpu)
691238106Sdes		{
692238106Sdes		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
693238106Sdes		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
694238106Sdes		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
695238106Sdes		  default: puts ("hppa-hitachi-hiuxwe2"); break;
696238106Sdes		}
697238106Sdes	    }
698238106Sdes	  else if (CPU_IS_HP_MC68K (cpu))
699238106Sdes	    puts ("m68k-hitachi-hiuxwe2");
700238106Sdes	  else puts ("unknown-hitachi-hiuxwe2");
701238106Sdes	  exit (0);
702238106Sdes	}
703238106SdesEOF
704238106Sdes	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
705238106Sdes		{ echo "$SYSTEM_NAME"; exit; }
706238106Sdes	echo unknown-hitachi-hiuxwe2
707238106Sdes	exit ;;
708238106Sdes    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
709238106Sdes	echo hppa1.1-hp-bsd
710238106Sdes	exit ;;
711238106Sdes    9000/8??:4.3bsd:*:*)
712238106Sdes	echo hppa1.0-hp-bsd
713238106Sdes	exit ;;
714238106Sdes    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
715238106Sdes	echo hppa1.0-hp-mpeix
716238106Sdes	exit ;;
717238106Sdes    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
718238106Sdes	echo hppa1.1-hp-osf
719238106Sdes	exit ;;
720238106Sdes    hp8??:OSF1:*:*)
721238106Sdes	echo hppa1.0-hp-osf
722238106Sdes	exit ;;
723238106Sdes    i*86:OSF1:*:*)
724238106Sdes	if [ -x /usr/sbin/sysversion ] ; then
725238106Sdes	    echo ${UNAME_MACHINE}-unknown-osf1mk
726238106Sdes	else
727238106Sdes	    echo ${UNAME_MACHINE}-unknown-osf1
728238106Sdes	fi
729238106Sdes	exit ;;
730238106Sdes    parisc*:Lites*:*:*)
731238106Sdes	echo hppa1.1-hp-lites
732238106Sdes	exit ;;
733238106Sdes    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
734238106Sdes	echo c1-convex-bsd
735249141Sdes	exit ;;
736238106Sdes    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
737238106Sdes	if getsysinfo -f scalar_acc
738238106Sdes	then echo c32-convex-bsd
739238106Sdes	else echo c2-convex-bsd
740238106Sdes	fi
741249141Sdes	exit ;;
742238106Sdes    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
743238106Sdes	echo c34-convex-bsd
744249141Sdes	exit ;;
745238106Sdes    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
746238106Sdes	echo c38-convex-bsd
747249141Sdes	exit ;;
748238106Sdes    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
749238106Sdes	echo c4-convex-bsd
750249141Sdes	exit ;;
751238106Sdes    CRAY*Y-MP:*:*:*)
752238106Sdes	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
753238106Sdes	exit ;;
754238106Sdes    CRAY*[A-Z]90:*:*:*)
755238106Sdes	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
756238106Sdes	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
757238106Sdes	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
758238106Sdes	      -e 's/\.[^.]*$/.X/'
759238106Sdes	exit ;;
760238106Sdes    CRAY*TS:*:*:*)
761238106Sdes	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
762238106Sdes	exit ;;
763238106Sdes    CRAY*T3E:*:*:*)
764238106Sdes	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
765238106Sdes	exit ;;
766238106Sdes    CRAY*SV1:*:*:*)
767238106Sdes	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
768238106Sdes	exit ;;
769238106Sdes    *:UNICOS/mp:*:*)
770238106Sdes	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
771238106Sdes	exit ;;
772238106Sdes    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
773238106Sdes	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
774249141Sdes	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
775249141Sdes	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
776249141Sdes	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
777249141Sdes	exit ;;
778238106Sdes    5000:UNIX_System_V:4.*:*)
779249141Sdes	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
780249141Sdes	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
781249141Sdes	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
782238106Sdes	exit ;;
783238106Sdes    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
784238106Sdes	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
785238106Sdes	exit ;;
786238106Sdes    sparc*:BSD/OS:*:*)
787238106Sdes	echo sparc-unknown-bsdi${UNAME_RELEASE}
788238106Sdes	exit ;;
789238106Sdes    *:BSD/OS:*:*)
790238106Sdes	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
791238106Sdes	exit ;;
792238106Sdes    *:FreeBSD:*:*)
793249141Sdes	UNAME_PROCESSOR=`/usr/bin/uname -p`
794249141Sdes	case ${UNAME_PROCESSOR} in
795238106Sdes	    amd64)
796238106Sdes		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
797238106Sdes	    *)
798249141Sdes		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
799238106Sdes	esac
800238106Sdes	exit ;;
801238106Sdes    i*:CYGWIN*:*)
802238106Sdes	echo ${UNAME_MACHINE}-pc-cygwin
803238106Sdes	exit ;;
804238106Sdes    *:MINGW*:*)
805238106Sdes	echo ${UNAME_MACHINE}-pc-mingw32
806238106Sdes	exit ;;
807249141Sdes    i*:MSYS*:*)
808249141Sdes	echo ${UNAME_MACHINE}-pc-msys
809249141Sdes	exit ;;
810238106Sdes    i*:windows32*:*)
811249141Sdes	# uname -m includes "-pc" on this system.
812249141Sdes	echo ${UNAME_MACHINE}-mingw32
813238106Sdes	exit ;;
814238106Sdes    i*:PW*:*)
815238106Sdes	echo ${UNAME_MACHINE}-pc-pw32
816238106Sdes	exit ;;
817238106Sdes    *:Interix*:*)
818249141Sdes	case ${UNAME_MACHINE} in
819238106Sdes	    x86)
820238106Sdes		echo i586-pc-interix${UNAME_RELEASE}
821238106Sdes		exit ;;
822238106Sdes	    authenticamd | genuineintel | EM64T)
823238106Sdes		echo x86_64-unknown-interix${UNAME_RELEASE}
824238106Sdes		exit ;;
825238106Sdes	    IA64)
826238106Sdes		echo ia64-unknown-interix${UNAME_RELEASE}
827238106Sdes		exit ;;
828238106Sdes	esac ;;
829238106Sdes    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
830238106Sdes	echo i${UNAME_MACHINE}-pc-mks
831238106Sdes	exit ;;
832238106Sdes    8664:Windows_NT:*)
833238106Sdes	echo x86_64-pc-mks
834238106Sdes	exit ;;
835238106Sdes    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
836238106Sdes	# How do we know it's Interix rather than the generic POSIX subsystem?
837238106Sdes	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
838238106Sdes	# UNAME_MACHINE based on the output of uname instead of i386?
839238106Sdes	echo i586-pc-interix
840238106Sdes	exit ;;
841238106Sdes    i*:UWIN*:*)
842238106Sdes	echo ${UNAME_MACHINE}-pc-uwin
843238106Sdes	exit ;;
844238106Sdes    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
845238106Sdes	echo x86_64-unknown-cygwin
846238106Sdes	exit ;;
847238106Sdes    p*:CYGWIN*:*)
848238106Sdes	echo powerpcle-unknown-cygwin
849238106Sdes	exit ;;
850238106Sdes    prep*:SunOS:5.*:*)
851238106Sdes	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
852238106Sdes	exit ;;
853238106Sdes    *:GNU:*:*)
854238106Sdes	# the GNU system
855238106Sdes	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
856238106Sdes	exit ;;
857238106Sdes    *:GNU/*:*:*)
858238106Sdes	# other systems with GNU libc and userland
859238106Sdes	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
860238106Sdes	exit ;;
861238106Sdes    i*86:Minix:*:*)
862238106Sdes	echo ${UNAME_MACHINE}-pc-minix
863238106Sdes	exit ;;
864249141Sdes    aarch64:Linux:*:*)
865249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
866249141Sdes	exit ;;
867249141Sdes    aarch64_be:Linux:*:*)
868249141Sdes	UNAME_MACHINE=aarch64_be
869249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
870249141Sdes	exit ;;
871238106Sdes    alpha:Linux:*:*)
872238106Sdes	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
873238106Sdes	  EV5)   UNAME_MACHINE=alphaev5 ;;
874238106Sdes	  EV56)  UNAME_MACHINE=alphaev56 ;;
875238106Sdes	  PCA56) UNAME_MACHINE=alphapca56 ;;
876238106Sdes	  PCA57) UNAME_MACHINE=alphapca56 ;;
877238106Sdes	  EV6)   UNAME_MACHINE=alphaev6 ;;
878238106Sdes	  EV67)  UNAME_MACHINE=alphaev67 ;;
879238106Sdes	  EV68*) UNAME_MACHINE=alphaev68 ;;
880249141Sdes	esac
881238106Sdes	objdump --private-headers /bin/sh | grep -q ld.so.1
882238106Sdes	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
883238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
884238106Sdes	exit ;;
885238106Sdes    arm*:Linux:*:*)
886238106Sdes	eval $set_cc_for_build
887238106Sdes	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
888238106Sdes	    | grep -q __ARM_EABI__
889238106Sdes	then
890238106Sdes	    echo ${UNAME_MACHINE}-unknown-linux-gnu
891238106Sdes	else
892249141Sdes	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
893249141Sdes		| grep -q __ARM_PCS_VFP
894249141Sdes	    then
895249141Sdes		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
896249141Sdes	    else
897249141Sdes		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
898249141Sdes	    fi
899238106Sdes	fi
900238106Sdes	exit ;;
901238106Sdes    avr32*:Linux:*:*)
902238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
903238106Sdes	exit ;;
904238106Sdes    cris:Linux:*:*)
905249141Sdes	echo ${UNAME_MACHINE}-axis-linux-gnu
906238106Sdes	exit ;;
907238106Sdes    crisv32:Linux:*:*)
908249141Sdes	echo ${UNAME_MACHINE}-axis-linux-gnu
909238106Sdes	exit ;;
910238106Sdes    frv:Linux:*:*)
911249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
912238106Sdes	exit ;;
913249141Sdes    hexagon:Linux:*:*)
914249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
915249141Sdes	exit ;;
916238106Sdes    i*86:Linux:*:*)
917238106Sdes	LIBC=gnu
918238106Sdes	eval $set_cc_for_build
919238106Sdes	sed 's/^	//' << EOF >$dummy.c
920238106Sdes	#ifdef __dietlibc__
921238106Sdes	LIBC=dietlibc
922238106Sdes	#endif
923238106SdesEOF
924238106Sdes	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
925238106Sdes	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
926238106Sdes	exit ;;
927238106Sdes    ia64:Linux:*:*)
928238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
929238106Sdes	exit ;;
930238106Sdes    m32r*:Linux:*:*)
931238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
932238106Sdes	exit ;;
933238106Sdes    m68*:Linux:*:*)
934238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
935238106Sdes	exit ;;
936238106Sdes    mips:Linux:*:* | mips64:Linux:*:*)
937238106Sdes	eval $set_cc_for_build
938238106Sdes	sed 's/^	//' << EOF >$dummy.c
939238106Sdes	#undef CPU
940238106Sdes	#undef ${UNAME_MACHINE}
941238106Sdes	#undef ${UNAME_MACHINE}el
942238106Sdes	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
943238106Sdes	CPU=${UNAME_MACHINE}el
944238106Sdes	#else
945238106Sdes	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
946238106Sdes	CPU=${UNAME_MACHINE}
947238106Sdes	#else
948238106Sdes	CPU=
949238106Sdes	#endif
950238106Sdes	#endif
951238106SdesEOF
952238106Sdes	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
953238106Sdes	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
954238106Sdes	;;
955238106Sdes    or32:Linux:*:*)
956249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
957238106Sdes	exit ;;
958238106Sdes    padre:Linux:*:*)
959238106Sdes	echo sparc-unknown-linux-gnu
960238106Sdes	exit ;;
961238106Sdes    parisc64:Linux:*:* | hppa64:Linux:*:*)
962238106Sdes	echo hppa64-unknown-linux-gnu
963238106Sdes	exit ;;
964238106Sdes    parisc:Linux:*:* | hppa:Linux:*:*)
965238106Sdes	# Look for CPU level
966238106Sdes	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
967238106Sdes	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
968238106Sdes	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
969238106Sdes	  *)    echo hppa-unknown-linux-gnu ;;
970238106Sdes	esac
971238106Sdes	exit ;;
972238106Sdes    ppc64:Linux:*:*)
973238106Sdes	echo powerpc64-unknown-linux-gnu
974238106Sdes	exit ;;
975238106Sdes    ppc:Linux:*:*)
976238106Sdes	echo powerpc-unknown-linux-gnu
977238106Sdes	exit ;;
978238106Sdes    s390:Linux:*:* | s390x:Linux:*:*)
979238106Sdes	echo ${UNAME_MACHINE}-ibm-linux
980238106Sdes	exit ;;
981238106Sdes    sh64*:Linux:*:*)
982249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
983238106Sdes	exit ;;
984238106Sdes    sh*:Linux:*:*)
985238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
986238106Sdes	exit ;;
987238106Sdes    sparc:Linux:*:* | sparc64:Linux:*:*)
988238106Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
989238106Sdes	exit ;;
990249141Sdes    tile*:Linux:*:*)
991249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
992249141Sdes	exit ;;
993238106Sdes    vax:Linux:*:*)
994238106Sdes	echo ${UNAME_MACHINE}-dec-linux-gnu
995238106Sdes	exit ;;
996238106Sdes    x86_64:Linux:*:*)
997249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
998238106Sdes	exit ;;
999238106Sdes    xtensa*:Linux:*:*)
1000249141Sdes	echo ${UNAME_MACHINE}-unknown-linux-gnu
1001238106Sdes	exit ;;
1002238106Sdes    i*86:DYNIX/ptx:4*:*)
1003238106Sdes	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1004238106Sdes	# earlier versions are messed up and put the nodename in both
1005238106Sdes	# sysname and nodename.
1006238106Sdes	echo i386-sequent-sysv4
1007238106Sdes	exit ;;
1008238106Sdes    i*86:UNIX_SV:4.2MP:2.*)
1009249141Sdes	# Unixware is an offshoot of SVR4, but it has its own version
1010249141Sdes	# number series starting with 2...
1011249141Sdes	# I am not positive that other SVR4 systems won't match this,
1012238106Sdes	# I just have to hope.  -- rms.
1013249141Sdes	# Use sysv4.2uw... so that sysv4* matches it.
1014238106Sdes	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1015238106Sdes	exit ;;
1016238106Sdes    i*86:OS/2:*:*)
1017238106Sdes	# If we were able to find `uname', then EMX Unix compatibility
1018238106Sdes	# is probably installed.
1019238106Sdes	echo ${UNAME_MACHINE}-pc-os2-emx
1020238106Sdes	exit ;;
1021238106Sdes    i*86:XTS-300:*:STOP)
1022238106Sdes	echo ${UNAME_MACHINE}-unknown-stop
1023238106Sdes	exit ;;
1024238106Sdes    i*86:atheos:*:*)
1025238106Sdes	echo ${UNAME_MACHINE}-unknown-atheos
1026238106Sdes	exit ;;
1027238106Sdes    i*86:syllable:*:*)
1028238106Sdes	echo ${UNAME_MACHINE}-pc-syllable
1029238106Sdes	exit ;;
1030238106Sdes    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1031238106Sdes	echo i386-unknown-lynxos${UNAME_RELEASE}
1032238106Sdes	exit ;;
1033238106Sdes    i*86:*DOS:*:*)
1034238106Sdes	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1035238106Sdes	exit ;;
1036238106Sdes    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1037238106Sdes	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1038238106Sdes	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1039238106Sdes		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1040238106Sdes	else
1041238106Sdes		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1042238106Sdes	fi
1043238106Sdes	exit ;;
1044238106Sdes    i*86:*:5:[678]*)
1045249141Sdes	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1046238106Sdes	case `/bin/uname -X | grep "^Machine"` in
1047238106Sdes	    *486*)	     UNAME_MACHINE=i486 ;;
1048238106Sdes	    *Pentium)	     UNAME_MACHINE=i586 ;;
1049238106Sdes	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1050238106Sdes	esac
1051238106Sdes	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1052238106Sdes	exit ;;
1053238106Sdes    i*86:*:3.2:*)
1054238106Sdes	if test -f /usr/options/cb.name; then
1055238106Sdes		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1056238106Sdes		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1057238106Sdes	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1058238106Sdes		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1059238106Sdes		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1060238106Sdes		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1061238106Sdes			&& UNAME_MACHINE=i586
1062238106Sdes		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1063238106Sdes			&& UNAME_MACHINE=i686
1064238106Sdes		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1065238106Sdes			&& UNAME_MACHINE=i686
1066238106Sdes		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1067238106Sdes	else
1068238106Sdes		echo ${UNAME_MACHINE}-pc-sysv32
1069238106Sdes	fi
1070238106Sdes	exit ;;
1071238106Sdes    pc:*:*:*)
1072238106Sdes	# Left here for compatibility:
1073249141Sdes	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1074249141Sdes	# the processor, so we play safe by assuming i586.
1075238106Sdes	# Note: whatever this is, it MUST be the same as what config.sub
1076238106Sdes	# prints for the "djgpp" host, or else GDB configury will decide that
1077238106Sdes	# this is a cross-build.
1078238106Sdes	echo i586-pc-msdosdjgpp
1079249141Sdes	exit ;;
1080238106Sdes    Intel:Mach:3*:*)
1081238106Sdes	echo i386-pc-mach3
1082238106Sdes	exit ;;
1083238106Sdes    paragon:*:*:*)
1084238106Sdes	echo i860-intel-osf1
1085238106Sdes	exit ;;
1086238106Sdes    i860:*:4.*:*) # i860-SVR4
1087238106Sdes	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1088238106Sdes	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1089238106Sdes	else # Add other i860-SVR4 vendors below as they are discovered.
1090238106Sdes	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1091238106Sdes	fi
1092238106Sdes	exit ;;
1093238106Sdes    mini*:CTIX:SYS*5:*)
1094238106Sdes	# "miniframe"
1095238106Sdes	echo m68010-convergent-sysv
1096238106Sdes	exit ;;
1097238106Sdes    mc68k:UNIX:SYSTEM5:3.51m)
1098238106Sdes	echo m68k-convergent-sysv
1099238106Sdes	exit ;;
1100238106Sdes    M680?0:D-NIX:5.3:*)
1101238106Sdes	echo m68k-diab-dnix
1102238106Sdes	exit ;;
1103238106Sdes    M68*:*:R3V[5678]*:*)
1104238106Sdes	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1105238106Sdes    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)
1106238106Sdes	OS_REL=''
1107238106Sdes	test -r /etc/.relid \
1108238106Sdes	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1109238106Sdes	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1110238106Sdes	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1111238106Sdes	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1112238106Sdes	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1113238106Sdes    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1114249141Sdes	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1115249141Sdes	  && { echo i486-ncr-sysv4; exit; } ;;
1116238106Sdes    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1117238106Sdes	OS_REL='.3'
1118238106Sdes	test -r /etc/.relid \
1119238106Sdes	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1120238106Sdes	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1121238106Sdes	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1122238106Sdes	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1123238106Sdes	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1124238106Sdes	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1125238106Sdes	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1126238106Sdes    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1127238106Sdes	echo m68k-unknown-lynxos${UNAME_RELEASE}
1128238106Sdes	exit ;;
1129238106Sdes    mc68030:UNIX_System_V:4.*:*)
1130238106Sdes	echo m68k-atari-sysv4
1131238106Sdes	exit ;;
1132238106Sdes    TSUNAMI:LynxOS:2.*:*)
1133238106Sdes	echo sparc-unknown-lynxos${UNAME_RELEASE}
1134238106Sdes	exit ;;
1135238106Sdes    rs6000:LynxOS:2.*:*)
1136238106Sdes	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1137238106Sdes	exit ;;
1138238106Sdes    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1139238106Sdes	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1140238106Sdes	exit ;;
1141238106Sdes    SM[BE]S:UNIX_SV:*:*)
1142238106Sdes	echo mips-dde-sysv${UNAME_RELEASE}
1143238106Sdes	exit ;;
1144238106Sdes    RM*:ReliantUNIX-*:*:*)
1145238106Sdes	echo mips-sni-sysv4
1146238106Sdes	exit ;;
1147238106Sdes    RM*:SINIX-*:*:*)
1148238106Sdes	echo mips-sni-sysv4
1149238106Sdes	exit ;;
1150238106Sdes    *:SINIX-*:*:*)
1151238106Sdes	if uname -p 2>/dev/null >/dev/null ; then
1152238106Sdes		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1153238106Sdes		echo ${UNAME_MACHINE}-sni-sysv4
1154238106Sdes	else
1155238106Sdes		echo ns32k-sni-sysv
1156238106Sdes	fi
1157238106Sdes	exit ;;
1158249141Sdes    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1159249141Sdes			# says <Richard.M.Bartel@ccMail.Census.GOV>
1160249141Sdes	echo i586-unisys-sysv4
1161249141Sdes	exit ;;
1162238106Sdes    *:UNIX_System_V:4*:FTX*)
1163238106Sdes	# From Gerald Hewes <hewes@openmarket.com>.
1164238106Sdes	# How about differentiating between stratus architectures? -djm
1165238106Sdes	echo hppa1.1-stratus-sysv4
1166238106Sdes	exit ;;
1167238106Sdes    *:*:*:FTX*)
1168238106Sdes	# From seanf@swdc.stratus.com.
1169238106Sdes	echo i860-stratus-sysv4
1170238106Sdes	exit ;;
1171238106Sdes    i*86:VOS:*:*)
1172238106Sdes	# From Paul.Green@stratus.com.
1173238106Sdes	echo ${UNAME_MACHINE}-stratus-vos
1174238106Sdes	exit ;;
1175238106Sdes    *:VOS:*:*)
1176238106Sdes	# From Paul.Green@stratus.com.
1177238106Sdes	echo hppa1.1-stratus-vos
1178238106Sdes	exit ;;
1179238106Sdes    mc68*:A/UX:*:*)
1180238106Sdes	echo m68k-apple-aux${UNAME_RELEASE}
1181238106Sdes	exit ;;
1182238106Sdes    news*:NEWS-OS:6*:*)
1183238106Sdes	echo mips-sony-newsos6
1184238106Sdes	exit ;;
1185238106Sdes    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1186238106Sdes	if [ -d /usr/nec ]; then
1187249141Sdes		echo mips-nec-sysv${UNAME_RELEASE}
1188238106Sdes	else
1189249141Sdes		echo mips-unknown-sysv${UNAME_RELEASE}
1190238106Sdes	fi
1191249141Sdes	exit ;;
1192238106Sdes    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1193238106Sdes	echo powerpc-be-beos
1194238106Sdes	exit ;;
1195238106Sdes    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1196238106Sdes	echo powerpc-apple-beos
1197238106Sdes	exit ;;
1198238106Sdes    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1199238106Sdes	echo i586-pc-beos
1200238106Sdes	exit ;;
1201238106Sdes    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1202238106Sdes	echo i586-pc-haiku
1203238106Sdes	exit ;;
1204238106Sdes    SX-4:SUPER-UX:*:*)
1205238106Sdes	echo sx4-nec-superux${UNAME_RELEASE}
1206238106Sdes	exit ;;
1207238106Sdes    SX-5:SUPER-UX:*:*)
1208238106Sdes	echo sx5-nec-superux${UNAME_RELEASE}
1209238106Sdes	exit ;;
1210238106Sdes    SX-6:SUPER-UX:*:*)
1211238106Sdes	echo sx6-nec-superux${UNAME_RELEASE}
1212238106Sdes	exit ;;
1213238106Sdes    SX-7:SUPER-UX:*:*)
1214238106Sdes	echo sx7-nec-superux${UNAME_RELEASE}
1215238106Sdes	exit ;;
1216238106Sdes    SX-8:SUPER-UX:*:*)
1217238106Sdes	echo sx8-nec-superux${UNAME_RELEASE}
1218238106Sdes	exit ;;
1219238106Sdes    SX-8R:SUPER-UX:*:*)
1220238106Sdes	echo sx8r-nec-superux${UNAME_RELEASE}
1221238106Sdes	exit ;;
1222238106Sdes    Power*:Rhapsody:*:*)
1223238106Sdes	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1224238106Sdes	exit ;;
1225238106Sdes    *:Rhapsody:*:*)
1226238106Sdes	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1227238106Sdes	exit ;;
1228238106Sdes    *:Darwin:*:*)
1229238106Sdes	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1230238106Sdes	case $UNAME_PROCESSOR in
1231238106Sdes	    i386)
1232238106Sdes		eval $set_cc_for_build
1233238106Sdes		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1234238106Sdes		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1235238106Sdes		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1236238106Sdes		      grep IS_64BIT_ARCH >/dev/null
1237238106Sdes		  then
1238238106Sdes		      UNAME_PROCESSOR="x86_64"
1239238106Sdes		  fi
1240238106Sdes		fi ;;
1241238106Sdes	    unknown) UNAME_PROCESSOR=powerpc ;;
1242238106Sdes	esac
1243238106Sdes	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1244238106Sdes	exit ;;
1245238106Sdes    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1246238106Sdes	UNAME_PROCESSOR=`uname -p`
1247238106Sdes	if test "$UNAME_PROCESSOR" = "x86"; then
1248238106Sdes		UNAME_PROCESSOR=i386
1249238106Sdes		UNAME_MACHINE=pc
1250238106Sdes	fi
1251238106Sdes	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1252238106Sdes	exit ;;
1253238106Sdes    *:QNX:*:4*)
1254238106Sdes	echo i386-pc-qnx
1255238106Sdes	exit ;;
1256249141Sdes    NEO-?:NONSTOP_KERNEL:*:*)
1257249141Sdes	echo neo-tandem-nsk${UNAME_RELEASE}
1258249141Sdes	exit ;;
1259249141Sdes    NSE-*:NONSTOP_KERNEL:*:*)
1260238106Sdes	echo nse-tandem-nsk${UNAME_RELEASE}
1261238106Sdes	exit ;;
1262238106Sdes    NSR-?:NONSTOP_KERNEL:*:*)
1263238106Sdes	echo nsr-tandem-nsk${UNAME_RELEASE}
1264238106Sdes	exit ;;
1265238106Sdes    *:NonStop-UX:*:*)
1266238106Sdes	echo mips-compaq-nonstopux
1267238106Sdes	exit ;;
1268238106Sdes    BS2000:POSIX*:*:*)
1269238106Sdes	echo bs2000-siemens-sysv
1270238106Sdes	exit ;;
1271238106Sdes    DS/*:UNIX_System_V:*:*)
1272238106Sdes	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1273238106Sdes	exit ;;
1274238106Sdes    *:Plan9:*:*)
1275238106Sdes	# "uname -m" is not consistent, so use $cputype instead. 386
1276238106Sdes	# is converted to i386 for consistency with other x86
1277238106Sdes	# operating systems.
1278238106Sdes	if test "$cputype" = "386"; then
1279238106Sdes	    UNAME_MACHINE=i386
1280238106Sdes	else
1281238106Sdes	    UNAME_MACHINE="$cputype"
1282238106Sdes	fi
1283238106Sdes	echo ${UNAME_MACHINE}-unknown-plan9
1284238106Sdes	exit ;;
1285238106Sdes    *:TOPS-10:*:*)
1286238106Sdes	echo pdp10-unknown-tops10
1287238106Sdes	exit ;;
1288238106Sdes    *:TENEX:*:*)
1289238106Sdes	echo pdp10-unknown-tenex
1290238106Sdes	exit ;;
1291238106Sdes    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1292238106Sdes	echo pdp10-dec-tops20
1293238106Sdes	exit ;;
1294238106Sdes    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1295238106Sdes	echo pdp10-xkl-tops20
1296238106Sdes	exit ;;
1297238106Sdes    *:TOPS-20:*:*)
1298238106Sdes	echo pdp10-unknown-tops20
1299238106Sdes	exit ;;
1300238106Sdes    *:ITS:*:*)
1301238106Sdes	echo pdp10-unknown-its
1302238106Sdes	exit ;;
1303238106Sdes    SEI:*:*:SEIUX)
1304249141Sdes	echo mips-sei-seiux${UNAME_RELEASE}
1305238106Sdes	exit ;;
1306238106Sdes    *:DragonFly:*:*)
1307238106Sdes	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1308238106Sdes	exit ;;
1309238106Sdes    *:*VMS:*:*)
1310249141Sdes	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1311238106Sdes	case "${UNAME_MACHINE}" in
1312238106Sdes	    A*) echo alpha-dec-vms ; exit ;;
1313238106Sdes	    I*) echo ia64-dec-vms ; exit ;;
1314238106Sdes	    V*) echo vax-dec-vms ; exit ;;
1315238106Sdes	esac ;;
1316238106Sdes    *:XENIX:*:SysV)
1317238106Sdes	echo i386-pc-xenix
1318238106Sdes	exit ;;
1319238106Sdes    i*86:skyos:*:*)
1320238106Sdes	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1321238106Sdes	exit ;;
1322238106Sdes    i*86:rdos:*:*)
1323238106Sdes	echo ${UNAME_MACHINE}-pc-rdos
1324238106Sdes	exit ;;
1325238106Sdes    i*86:AROS:*:*)
1326238106Sdes	echo ${UNAME_MACHINE}-pc-aros
1327238106Sdes	exit ;;
1328249141Sdes    x86_64:VMkernel:*:*)
1329249141Sdes	echo ${UNAME_MACHINE}-unknown-esx
1330249141Sdes	exit ;;
1331238106Sdesesac
1332238106Sdes
1333238106Sdes#echo '(No uname command or uname output not recognized.)' 1>&2
1334238106Sdes#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1335238106Sdes
1336238106Sdeseval $set_cc_for_build
1337238106Sdescat >$dummy.c <<EOF
1338238106Sdes#ifdef _SEQUENT_
1339238106Sdes# include <sys/types.h>
1340238106Sdes# include <sys/utsname.h>
1341238106Sdes#endif
1342238106Sdesmain ()
1343238106Sdes{
1344238106Sdes#if defined (sony)
1345238106Sdes#if defined (MIPSEB)
1346238106Sdes  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1347238106Sdes     I don't know....  */
1348238106Sdes  printf ("mips-sony-bsd\n"); exit (0);
1349238106Sdes#else
1350238106Sdes#include <sys/param.h>
1351238106Sdes  printf ("m68k-sony-newsos%s\n",
1352238106Sdes#ifdef NEWSOS4
1353249141Sdes	"4"
1354238106Sdes#else
1355249141Sdes	""
1356238106Sdes#endif
1357249141Sdes	); exit (0);
1358238106Sdes#endif
1359238106Sdes#endif
1360238106Sdes
1361238106Sdes#if defined (__arm) && defined (__acorn) && defined (__unix)
1362238106Sdes  printf ("arm-acorn-riscix\n"); exit (0);
1363238106Sdes#endif
1364238106Sdes
1365238106Sdes#if defined (hp300) && !defined (hpux)
1366238106Sdes  printf ("m68k-hp-bsd\n"); exit (0);
1367238106Sdes#endif
1368238106Sdes
1369238106Sdes#if defined (NeXT)
1370238106Sdes#if !defined (__ARCHITECTURE__)
1371238106Sdes#define __ARCHITECTURE__ "m68k"
1372238106Sdes#endif
1373238106Sdes  int version;
1374238106Sdes  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1375238106Sdes  if (version < 4)
1376238106Sdes    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1377238106Sdes  else
1378238106Sdes    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1379238106Sdes  exit (0);
1380238106Sdes#endif
1381238106Sdes
1382238106Sdes#if defined (MULTIMAX) || defined (n16)
1383238106Sdes#if defined (UMAXV)
1384238106Sdes  printf ("ns32k-encore-sysv\n"); exit (0);
1385238106Sdes#else
1386238106Sdes#if defined (CMU)
1387238106Sdes  printf ("ns32k-encore-mach\n"); exit (0);
1388238106Sdes#else
1389238106Sdes  printf ("ns32k-encore-bsd\n"); exit (0);
1390238106Sdes#endif
1391238106Sdes#endif
1392238106Sdes#endif
1393238106Sdes
1394238106Sdes#if defined (__386BSD__)
1395238106Sdes  printf ("i386-pc-bsd\n"); exit (0);
1396238106Sdes#endif
1397238106Sdes
1398238106Sdes#if defined (sequent)
1399238106Sdes#if defined (i386)
1400238106Sdes  printf ("i386-sequent-dynix\n"); exit (0);
1401238106Sdes#endif
1402238106Sdes#if defined (ns32000)
1403238106Sdes  printf ("ns32k-sequent-dynix\n"); exit (0);
1404238106Sdes#endif
1405238106Sdes#endif
1406238106Sdes
1407238106Sdes#if defined (_SEQUENT_)
1408238106Sdes    struct utsname un;
1409238106Sdes
1410238106Sdes    uname(&un);
1411238106Sdes
1412238106Sdes    if (strncmp(un.version, "V2", 2) == 0) {
1413238106Sdes	printf ("i386-sequent-ptx2\n"); exit (0);
1414238106Sdes    }
1415238106Sdes    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1416238106Sdes	printf ("i386-sequent-ptx1\n"); exit (0);
1417238106Sdes    }
1418238106Sdes    printf ("i386-sequent-ptx\n"); exit (0);
1419238106Sdes
1420238106Sdes#endif
1421238106Sdes
1422238106Sdes#if defined (vax)
1423238106Sdes# if !defined (ultrix)
1424238106Sdes#  include <sys/param.h>
1425238106Sdes#  if defined (BSD)
1426238106Sdes#   if BSD == 43
1427238106Sdes      printf ("vax-dec-bsd4.3\n"); exit (0);
1428238106Sdes#   else
1429238106Sdes#    if BSD == 199006
1430238106Sdes      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1431238106Sdes#    else
1432238106Sdes      printf ("vax-dec-bsd\n"); exit (0);
1433238106Sdes#    endif
1434238106Sdes#   endif
1435238106Sdes#  else
1436238106Sdes    printf ("vax-dec-bsd\n"); exit (0);
1437238106Sdes#  endif
1438238106Sdes# else
1439238106Sdes    printf ("vax-dec-ultrix\n"); exit (0);
1440238106Sdes# endif
1441238106Sdes#endif
1442238106Sdes
1443238106Sdes#if defined (alliant) && defined (i860)
1444238106Sdes  printf ("i860-alliant-bsd\n"); exit (0);
1445238106Sdes#endif
1446238106Sdes
1447238106Sdes  exit (1);
1448238106Sdes}
1449238106SdesEOF
1450238106Sdes
1451238106Sdes$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1452238106Sdes	{ echo "$SYSTEM_NAME"; exit; }
1453238106Sdes
1454238106Sdes# Apollos put the system type in the environment.
1455238106Sdes
1456238106Sdestest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1457238106Sdes
1458238106Sdes# Convex versions that predate uname can use getsysinfo(1)
1459238106Sdes
1460238106Sdesif [ -x /usr/convex/getsysinfo ]
1461238106Sdesthen
1462238106Sdes    case `getsysinfo -f cpu_type` in
1463238106Sdes    c1*)
1464238106Sdes	echo c1-convex-bsd
1465238106Sdes	exit ;;
1466238106Sdes    c2*)
1467238106Sdes	if getsysinfo -f scalar_acc
1468238106Sdes	then echo c32-convex-bsd
1469238106Sdes	else echo c2-convex-bsd
1470238106Sdes	fi
1471238106Sdes	exit ;;
1472238106Sdes    c34*)
1473238106Sdes	echo c34-convex-bsd
1474238106Sdes	exit ;;
1475238106Sdes    c38*)
1476238106Sdes	echo c38-convex-bsd
1477238106Sdes	exit ;;
1478238106Sdes    c4*)
1479238106Sdes	echo c4-convex-bsd
1480238106Sdes	exit ;;
1481238106Sdes    esac
1482238106Sdesfi
1483238106Sdes
1484238106Sdescat >&2 <<EOF
1485238106Sdes$0: unable to guess system type
1486238106Sdes
1487238106SdesThis script, last modified $timestamp, has failed to recognize
1488238106Sdesthe operating system you are using. It is advised that you
1489238106Sdesdownload the most up to date version of the config scripts from
1490238106Sdes
1491238106Sdes  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1492238106Sdesand
1493238106Sdes  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1494238106Sdes
1495238106SdesIf the version you run ($0) is already up to date, please
1496238106Sdessend the following data and any information you think might be
1497238106Sdespertinent to <config-patches@gnu.org> in order to provide the needed
1498238106Sdesinformation to handle your system.
1499238106Sdes
1500238106Sdesconfig.guess timestamp = $timestamp
1501238106Sdes
1502238106Sdesuname -m = `(uname -m) 2>/dev/null || echo unknown`
1503238106Sdesuname -r = `(uname -r) 2>/dev/null || echo unknown`
1504238106Sdesuname -s = `(uname -s) 2>/dev/null || echo unknown`
1505238106Sdesuname -v = `(uname -v) 2>/dev/null || echo unknown`
1506238106Sdes
1507238106Sdes/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1508238106Sdes/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1509238106Sdes
1510238106Sdeshostinfo               = `(hostinfo) 2>/dev/null`
1511238106Sdes/bin/universe          = `(/bin/universe) 2>/dev/null`
1512238106Sdes/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1513238106Sdes/bin/arch              = `(/bin/arch) 2>/dev/null`
1514238106Sdes/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1515238106Sdes/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1516238106Sdes
1517238106SdesUNAME_MACHINE = ${UNAME_MACHINE}
1518238106SdesUNAME_RELEASE = ${UNAME_RELEASE}
1519238106SdesUNAME_SYSTEM  = ${UNAME_SYSTEM}
1520238106SdesUNAME_VERSION = ${UNAME_VERSION}
1521238106SdesEOF
1522238106Sdes
1523238106Sdesexit 1
1524238106Sdes
1525238106Sdes# Local variables:
1526238106Sdes# eval: (add-hook 'write-file-hooks 'time-stamp)
1527238106Sdes# time-stamp-start: "timestamp='"
1528238106Sdes# time-stamp-format: "%:y-%02m-%02d"
1529238106Sdes# time-stamp-end: "'"
1530238106Sdes# End:
1531