config.guess revision 234949
1234949Sbapt#! /bin/sh
2234949Sbapt# Attempt to guess a canonical system name.
3234949Sbapt#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4234949Sbapt#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5234949Sbapt#   2911 Free Software Foundation, Inc.
6234949Sbapt
7234949Sbapttimestamp='2011-01-01'
8234949Sbapt
9234949Sbapt# This file is free software; you can redistribute it and/or modify it
10234949Sbapt# under the terms of the GNU General Public License as published by
11234949Sbapt# the Free Software Foundation; either version 2 of the License, or
12234949Sbapt# (at your option) any later version.
13234949Sbapt#
14234949Sbapt# This program is distributed in the hope that it will be useful, but
15234949Sbapt# WITHOUT ANY WARRANTY; without even the implied warranty of
16234949Sbapt# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17234949Sbapt# General Public License for more details.
18234949Sbapt#
19234949Sbapt# You should have received a copy of the GNU General Public License
20234949Sbapt# along with this program; if not, write to the Free Software
21234949Sbapt# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22234949Sbapt# 02110-1301, USA.
23234949Sbapt#
24234949Sbapt# As a special exception to the GNU General Public License, if you
25234949Sbapt# distribute this file as part of a program that contains a
26234949Sbapt# configuration script generated by Autoconf, you may include it under
27234949Sbapt# the same distribution terms that you use for the rest of that program.
28234949Sbapt
29234949Sbapt
30234949Sbapt# Originally written by Per Bothner.  Please send patches (context
31234949Sbapt# diff format) to <config-patches@gnu.org> and include a ChangeLog
32234949Sbapt# entry.
33234949Sbapt#
34234949Sbapt# This script attempts to guess a canonical system name similar to
35234949Sbapt# config.sub.  If it succeeds, it prints the system name on stdout, and
36234949Sbapt# exits with 0.  Otherwise, it exits with 1.
37234949Sbapt#
38234949Sbapt# You can get the latest version of this script from:
39234949Sbapt# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40234949Sbapt
41234949Sbaptme=`echo "$0" | sed -e 's,.*/,,'`
42234949Sbapt
43234949Sbaptusage="\
44234949SbaptUsage: $0 [OPTION]
45234949Sbapt
46234949SbaptOutput the configuration name of the system \`$me' is run on.
47234949Sbapt
48234949SbaptOperation modes:
49234949Sbapt  -h, --help         print this help, then exit
50234949Sbapt  -t, --time-stamp   print date of last modification, then exit
51234949Sbapt  -v, --version      print version number, then exit
52234949Sbapt
53234949SbaptReport bugs and patches to <config-patches@gnu.org>."
54234949Sbapt
55234949Sbaptversion="\
56234949SbaptGNU config.guess ($timestamp)
57234949Sbapt
58234949SbaptOriginally written by Per Bothner.
59234949SbaptCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60234949Sbapt2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
61234949SbaptFree Software Foundation, Inc.
62234949Sbapt
63234949SbaptThis is free software; see the source for copying conditions.  There is NO
64234949Sbaptwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
65234949Sbapt
66234949Sbapthelp="
67234949SbaptTry \`$me --help' for more information."
68234949Sbapt
69234949Sbapt# Parse command line
70234949Sbaptwhile test $# -gt 0 ; do
71234949Sbapt  case $1 in
72234949Sbapt    --time-stamp | --time* | -t )
73234949Sbapt       echo "$timestamp" ; exit ;;
74234949Sbapt    --version | -v )
75234949Sbapt       echo "$version" ; exit ;;
76234949Sbapt    --help | --h* | -h )
77234949Sbapt       echo "$usage"; exit ;;
78234949Sbapt    -- )     # Stop option processing
79234949Sbapt       shift; break ;;
80234949Sbapt    - )	# Use stdin as input.
81234949Sbapt       break ;;
82234949Sbapt    -* )
83234949Sbapt       echo "$me: invalid option $1$help" >&2
84234949Sbapt       exit 1 ;;
85234949Sbapt    * )
86234949Sbapt       break ;;
87234949Sbapt  esac
88234949Sbaptdone
89234949Sbapt
90234949Sbaptif test $# != 0; then
91234949Sbapt  echo "$me: too many arguments$help" >&2
92234949Sbapt  exit 1
93234949Sbaptfi
94234949Sbapt
95234949Sbapttrap 'exit 1' 1 2 15
96234949Sbapt
97234949Sbapt# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
98234949Sbapt# compiler to aid in system detection is discouraged as it requires
99234949Sbapt# temporary files to be created and, as you can see below, it is a
100234949Sbapt# headache to deal with in a portable fashion.
101234949Sbapt
102234949Sbapt# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
103234949Sbapt# use `HOST_CC' if defined, but it is deprecated.
104234949Sbapt
105234949Sbapt# Portable tmp directory creation inspired by the Autoconf team.
106234949Sbapt
107234949Sbaptset_cc_for_build='
108234949Sbapttrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109234949Sbapttrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110234949Sbapt: ${TMPDIR=/tmp} ;
111234949Sbapt { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112234949Sbapt { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113234949Sbapt { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114234949Sbapt { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
115234949Sbaptdummy=$tmp/dummy ;
116234949Sbapttmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
117234949Sbaptcase $CC_FOR_BUILD,$HOST_CC,$CC in
118234949Sbapt ,,)    echo "int x;" > $dummy.c ;
119234949Sbapt	for c in cc gcc c89 c99 ; do
120234949Sbapt	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
121234949Sbapt	     CC_FOR_BUILD="$c"; break ;
122234949Sbapt	  fi ;
123234949Sbapt	done ;
124234949Sbapt	if test x"$CC_FOR_BUILD" = x ; then
125234949Sbapt	  CC_FOR_BUILD=no_compiler_found ;
126234949Sbapt	fi
127234949Sbapt	;;
128234949Sbapt ,,*)   CC_FOR_BUILD=$CC ;;
129234949Sbapt ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
130234949Sbaptesac ; set_cc_for_build= ;'
131234949Sbapt
132234949Sbapt# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
133234949Sbapt# (ghazi@noc.rutgers.edu 1994-08-24)
134234949Sbaptif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
135234949Sbapt	PATH=$PATH:/.attbin ; export PATH
136234949Sbaptfi
137234949Sbapt
138234949SbaptUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
139234949SbaptUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140234949SbaptUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
141234949SbaptUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142234949Sbapt
143234949Sbapt# Note: order is significant - the case branches are not exclusive.
144234949Sbapt
145234949Sbaptcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146234949Sbapt    *:NetBSD:*:*)
147234949Sbapt	# NetBSD (nbsd) targets should (where applicable) match one or
148234949Sbapt	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
149234949Sbapt	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
150234949Sbapt	# switched to ELF, *-*-netbsd* would select the old
151234949Sbapt	# object file format.  This provides both forward
152234949Sbapt	# compatibility and a consistent mechanism for selecting the
153234949Sbapt	# object file format.
154234949Sbapt	#
155234949Sbapt	# Note: NetBSD doesn't particularly care about the vendor
156234949Sbapt	# portion of the name.  We always set it to "unknown".
157234949Sbapt	sysctl="sysctl -n hw.machine_arch"
158234949Sbapt	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
159234949Sbapt	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
160234949Sbapt	case "${UNAME_MACHINE_ARCH}" in
161234949Sbapt	    armeb) machine=armeb-unknown ;;
162234949Sbapt	    arm*) machine=arm-unknown ;;
163234949Sbapt	    sh3el) machine=shl-unknown ;;
164234949Sbapt	    sh3eb) machine=sh-unknown ;;
165234949Sbapt	    sh5el) machine=sh5le-unknown ;;
166234949Sbapt	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167234949Sbapt	esac
168234949Sbapt	# The Operating System including object format, if it has switched
169234949Sbapt	# to ELF recently, or will in the future.
170234949Sbapt	case "${UNAME_MACHINE_ARCH}" in
171234949Sbapt	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172234949Sbapt		eval $set_cc_for_build
173234949Sbapt		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174234949Sbapt			| grep -q __ELF__
175234949Sbapt		then
176234949Sbapt		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177234949Sbapt		    # Return netbsd for either.  FIX?
178234949Sbapt		    os=netbsd
179234949Sbapt		else
180234949Sbapt		    os=netbsdelf
181234949Sbapt		fi
182234949Sbapt		;;
183234949Sbapt	    *)
184234949Sbapt		os=netbsd
185234949Sbapt		;;
186234949Sbapt	esac
187234949Sbapt	# The OS release
188234949Sbapt	# Debian GNU/NetBSD machines have a different userland, and
189234949Sbapt	# thus, need a distinct triplet. However, they do not need
190234949Sbapt	# kernel version information, so it can be replaced with a
191234949Sbapt	# suitable tag, in the style of linux-gnu.
192234949Sbapt	case "${UNAME_VERSION}" in
193234949Sbapt	    Debian*)
194234949Sbapt		release='-gnu'
195234949Sbapt		;;
196234949Sbapt	    *)
197234949Sbapt		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
198234949Sbapt		;;
199234949Sbapt	esac
200234949Sbapt	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201234949Sbapt	# contains redundant information, the shorter form:
202234949Sbapt	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203234949Sbapt	echo "${machine}-${os}${release}"
204234949Sbapt	exit ;;
205234949Sbapt    *:OpenBSD:*:*)
206234949Sbapt	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
207234949Sbapt	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
208234949Sbapt	exit ;;
209234949Sbapt    *:ekkoBSD:*:*)
210234949Sbapt	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
211234949Sbapt	exit ;;
212234949Sbapt    *:SolidBSD:*:*)
213234949Sbapt	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
214234949Sbapt	exit ;;
215234949Sbapt    macppc:MirBSD:*:*)
216234949Sbapt	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
217234949Sbapt	exit ;;
218234949Sbapt    *:MirBSD:*:*)
219234949Sbapt	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
220234949Sbapt	exit ;;
221234949Sbapt    alpha:OSF1:*:*)
222234949Sbapt	case $UNAME_RELEASE in
223234949Sbapt	    *4.0)
224234949Sbapt		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
225234949Sbapt		;;
226234949Sbapt	    *5.*)
227234949Sbapt		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
228234949Sbapt		;;
229234949Sbapt	esac
230234949Sbapt	# According to Compaq, /usr/sbin/psrinfo has been available on
231234949Sbapt	# OSF/1 and Tru64 systems produced since 1995.  I hope that
232234949Sbapt	# covers most systems running today.  This code pipes the CPU
233234949Sbapt	# types through head -n 1, so we only detect the type of CPU 0.
234234949Sbapt	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
235234949Sbapt	case "$ALPHA_CPU_TYPE" in
236234949Sbapt	    "EV4 (21064)")
237234949Sbapt		UNAME_MACHINE="alpha" ;;
238234949Sbapt	    "EV4.5 (21064)")
239234949Sbapt		UNAME_MACHINE="alpha" ;;
240234949Sbapt	    "LCA4 (21066/21068)")
241234949Sbapt		UNAME_MACHINE="alpha" ;;
242234949Sbapt	    "EV5 (21164)")
243234949Sbapt		UNAME_MACHINE="alphaev5" ;;
244234949Sbapt	    "EV5.6 (21164A)")
245234949Sbapt		UNAME_MACHINE="alphaev56" ;;
246234949Sbapt	    "EV5.6 (21164PC)")
247234949Sbapt		UNAME_MACHINE="alphapca56" ;;
248234949Sbapt	    "EV5.7 (21164PC)")
249234949Sbapt		UNAME_MACHINE="alphapca57" ;;
250234949Sbapt	    "EV6 (21264)")
251234949Sbapt		UNAME_MACHINE="alphaev6" ;;
252234949Sbapt	    "EV6.7 (21264A)")
253234949Sbapt		UNAME_MACHINE="alphaev67" ;;
254234949Sbapt	    "EV6.8CB (21264C)")
255234949Sbapt		UNAME_MACHINE="alphaev68" ;;
256234949Sbapt	    "EV6.8AL (21264B)")
257234949Sbapt		UNAME_MACHINE="alphaev68" ;;
258234949Sbapt	    "EV6.8CX (21264D)")
259234949Sbapt		UNAME_MACHINE="alphaev68" ;;
260234949Sbapt	    "EV6.9A (21264/EV69A)")
261234949Sbapt		UNAME_MACHINE="alphaev69" ;;
262234949Sbapt	    "EV7 (21364)")
263234949Sbapt		UNAME_MACHINE="alphaev7" ;;
264234949Sbapt	    "EV7.9 (21364A)")
265234949Sbapt		UNAME_MACHINE="alphaev79" ;;
266234949Sbapt	esac
267234949Sbapt	# A Pn.n version is a patched version.
268234949Sbapt	# A Vn.n version is a released version.
269234949Sbapt	# A Tn.n version is a released field test version.
270234949Sbapt	# A Xn.n version is an unreleased experimental baselevel.
271234949Sbapt	# 1.2 uses "1.2" for uname -r.
272234949Sbapt	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273234949Sbapt	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
274234949Sbapt	exitcode=$?
275234949Sbapt	trap '' 0
276234949Sbapt	exit $exitcode ;;
277234949Sbapt    Alpha\ *:Windows_NT*:*)
278234949Sbapt	# How do we know it's Interix rather than the generic POSIX subsystem?
279234949Sbapt	# Should we change UNAME_MACHINE based on the output of uname instead
280234949Sbapt	# of the specific Alpha model?
281234949Sbapt	echo alpha-pc-interix
282234949Sbapt	exit ;;
283234949Sbapt    21064:Windows_NT:50:3)
284234949Sbapt	echo alpha-dec-winnt3.5
285234949Sbapt	exit ;;
286234949Sbapt    Amiga*:UNIX_System_V:4.0:*)
287234949Sbapt	echo m68k-unknown-sysv4
288234949Sbapt	exit ;;
289234949Sbapt    *:[Aa]miga[Oo][Ss]:*:*)
290234949Sbapt	echo ${UNAME_MACHINE}-unknown-amigaos
291234949Sbapt	exit ;;
292234949Sbapt    *:[Mm]orph[Oo][Ss]:*:*)
293234949Sbapt	echo ${UNAME_MACHINE}-unknown-morphos
294234949Sbapt	exit ;;
295234949Sbapt    *:OS/390:*:*)
296234949Sbapt	echo i370-ibm-openedition
297234949Sbapt	exit ;;
298234949Sbapt    *:z/VM:*:*)
299234949Sbapt	echo s390-ibm-zvmoe
300234949Sbapt	exit ;;
301234949Sbapt    *:OS400:*:*)
302234949Sbapt	echo powerpc-ibm-os400
303234949Sbapt	exit ;;
304234949Sbapt    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
305234949Sbapt	echo arm-acorn-riscix${UNAME_RELEASE}
306234949Sbapt	exit ;;
307234949Sbapt    arm:riscos:*:*|arm:RISCOS:*:*)
308234949Sbapt	echo arm-unknown-riscos
309234949Sbapt	exit ;;
310234949Sbapt    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
311234949Sbapt	echo hppa1.1-hitachi-hiuxmpp
312234949Sbapt	exit ;;
313234949Sbapt    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
314234949Sbapt	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
315234949Sbapt	if test "`(/bin/universe) 2>/dev/null`" = att ; then
316234949Sbapt		echo pyramid-pyramid-sysv3
317234949Sbapt	else
318234949Sbapt		echo pyramid-pyramid-bsd
319234949Sbapt	fi
320234949Sbapt	exit ;;
321234949Sbapt    NILE*:*:*:dcosx)
322234949Sbapt	echo pyramid-pyramid-svr4
323234949Sbapt	exit ;;
324234949Sbapt    DRS?6000:unix:4.0:6*)
325234949Sbapt	echo sparc-icl-nx6
326234949Sbapt	exit ;;
327234949Sbapt    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
328234949Sbapt	case `/usr/bin/uname -p` in
329234949Sbapt	    sparc) echo sparc-icl-nx7; exit ;;
330234949Sbapt	esac ;;
331234949Sbapt    s390x:SunOS:*:*)
332234949Sbapt	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333234949Sbapt	exit ;;
334234949Sbapt    sun4H:SunOS:5.*:*)
335234949Sbapt	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336234949Sbapt	exit ;;
337234949Sbapt    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
338234949Sbapt	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
339234949Sbapt	exit ;;
340234949Sbapt    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
341234949Sbapt	echo i386-pc-auroraux${UNAME_RELEASE}
342234949Sbapt	exit ;;
343234949Sbapt    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
344234949Sbapt	eval $set_cc_for_build
345234949Sbapt	SUN_ARCH="i386"
346234949Sbapt	# If there is a compiler, see if it is configured for 64-bit objects.
347234949Sbapt	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
348234949Sbapt	# This test works for both compilers.
349234949Sbapt	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
350234949Sbapt	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
351234949Sbapt		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
352234949Sbapt		grep IS_64BIT_ARCH >/dev/null
353234949Sbapt	    then
354234949Sbapt		SUN_ARCH="x86_64"
355234949Sbapt	    fi
356234949Sbapt	fi
357234949Sbapt	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
358234949Sbapt	exit ;;
359234949Sbapt    sun4*:SunOS:6*:*)
360234949Sbapt	# According to config.sub, this is the proper way to canonicalize
361234949Sbapt	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
362234949Sbapt	# it's likely to be more like Solaris than SunOS4.
363234949Sbapt	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
364234949Sbapt	exit ;;
365234949Sbapt    sun4*:SunOS:*:*)
366234949Sbapt	case "`/usr/bin/arch -k`" in
367234949Sbapt	    Series*|S4*)
368234949Sbapt		UNAME_RELEASE=`uname -v`
369234949Sbapt		;;
370234949Sbapt	esac
371234949Sbapt	# Japanese Language versions have a version number like `4.1.3-JL'.
372234949Sbapt	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
373234949Sbapt	exit ;;
374234949Sbapt    sun3*:SunOS:*:*)
375234949Sbapt	echo m68k-sun-sunos${UNAME_RELEASE}
376234949Sbapt	exit ;;
377234949Sbapt    sun*:*:4.2BSD:*)
378234949Sbapt	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
379234949Sbapt	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
380234949Sbapt	case "`/bin/arch`" in
381234949Sbapt	    sun3)
382234949Sbapt		echo m68k-sun-sunos${UNAME_RELEASE}
383234949Sbapt		;;
384234949Sbapt	    sun4)
385234949Sbapt		echo sparc-sun-sunos${UNAME_RELEASE}
386234949Sbapt		;;
387234949Sbapt	esac
388234949Sbapt	exit ;;
389234949Sbapt    aushp:SunOS:*:*)
390234949Sbapt	echo sparc-auspex-sunos${UNAME_RELEASE}
391234949Sbapt	exit ;;
392234949Sbapt    # The situation for MiNT is a little confusing.  The machine name
393234949Sbapt    # can be virtually everything (everything which is not
394234949Sbapt    # "atarist" or "atariste" at least should have a processor
395234949Sbapt    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
396234949Sbapt    # to the lowercase version "mint" (or "freemint").  Finally
397234949Sbapt    # the system name "TOS" denotes a system which is actually not
398234949Sbapt    # MiNT.  But MiNT is downward compatible to TOS, so this should
399234949Sbapt    # be no problem.
400234949Sbapt    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
401234949Sbapt	echo m68k-atari-mint${UNAME_RELEASE}
402234949Sbapt	exit ;;
403234949Sbapt    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
404234949Sbapt	echo m68k-atari-mint${UNAME_RELEASE}
405234949Sbapt	exit ;;
406234949Sbapt    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
407234949Sbapt	echo m68k-atari-mint${UNAME_RELEASE}
408234949Sbapt	exit ;;
409234949Sbapt    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
410234949Sbapt	echo m68k-milan-mint${UNAME_RELEASE}
411234949Sbapt	exit ;;
412234949Sbapt    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
413234949Sbapt	echo m68k-hades-mint${UNAME_RELEASE}
414234949Sbapt	exit ;;
415234949Sbapt    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
416234949Sbapt	echo m68k-unknown-mint${UNAME_RELEASE}
417234949Sbapt	exit ;;
418234949Sbapt    m68k:machten:*:*)
419234949Sbapt	echo m68k-apple-machten${UNAME_RELEASE}
420234949Sbapt	exit ;;
421234949Sbapt    powerpc:machten:*:*)
422234949Sbapt	echo powerpc-apple-machten${UNAME_RELEASE}
423234949Sbapt	exit ;;
424234949Sbapt    RISC*:Mach:*:*)
425234949Sbapt	echo mips-dec-mach_bsd4.3
426234949Sbapt	exit ;;
427234949Sbapt    RISC*:ULTRIX:*:*)
428234949Sbapt	echo mips-dec-ultrix${UNAME_RELEASE}
429234949Sbapt	exit ;;
430234949Sbapt    VAX*:ULTRIX*:*:*)
431234949Sbapt	echo vax-dec-ultrix${UNAME_RELEASE}
432234949Sbapt	exit ;;
433234949Sbapt    2020:CLIX:*:* | 2430:CLIX:*:*)
434234949Sbapt	echo clipper-intergraph-clix${UNAME_RELEASE}
435234949Sbapt	exit ;;
436234949Sbapt    mips:*:*:UMIPS | mips:*:*:RISCos)
437234949Sbapt	eval $set_cc_for_build
438234949Sbapt	sed 's/^	//' << EOF >$dummy.c
439234949Sbapt#ifdef __cplusplus
440234949Sbapt#include <stdio.h>  /* for printf() prototype */
441234949Sbapt	int main (int argc, char *argv[]) {
442234949Sbapt#else
443234949Sbapt	int main (argc, argv) int argc; char *argv[]; {
444234949Sbapt#endif
445234949Sbapt	#if defined (host_mips) && defined (MIPSEB)
446234949Sbapt	#if defined (SYSTYPE_SYSV)
447234949Sbapt	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
448234949Sbapt	#endif
449234949Sbapt	#if defined (SYSTYPE_SVR4)
450234949Sbapt	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
451234949Sbapt	#endif
452234949Sbapt	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
453234949Sbapt	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
454234949Sbapt	#endif
455234949Sbapt	#endif
456234949Sbapt	  exit (-1);
457234949Sbapt	}
458234949SbaptEOF
459234949Sbapt	$CC_FOR_BUILD -o $dummy $dummy.c &&
460234949Sbapt	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
461234949Sbapt	  SYSTEM_NAME=`$dummy $dummyarg` &&
462234949Sbapt	    { echo "$SYSTEM_NAME"; exit; }
463234949Sbapt	echo mips-mips-riscos${UNAME_RELEASE}
464234949Sbapt	exit ;;
465234949Sbapt    Motorola:PowerMAX_OS:*:*)
466234949Sbapt	echo powerpc-motorola-powermax
467234949Sbapt	exit ;;
468234949Sbapt    Motorola:*:4.3:PL8-*)
469234949Sbapt	echo powerpc-harris-powermax
470234949Sbapt	exit ;;
471234949Sbapt    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
472234949Sbapt	echo powerpc-harris-powermax
473234949Sbapt	exit ;;
474234949Sbapt    Night_Hawk:Power_UNIX:*:*)
475234949Sbapt	echo powerpc-harris-powerunix
476234949Sbapt	exit ;;
477234949Sbapt    m88k:CX/UX:7*:*)
478234949Sbapt	echo m88k-harris-cxux7
479234949Sbapt	exit ;;
480234949Sbapt    m88k:*:4*:R4*)
481234949Sbapt	echo m88k-motorola-sysv4
482234949Sbapt	exit ;;
483234949Sbapt    m88k:*:3*:R3*)
484234949Sbapt	echo m88k-motorola-sysv3
485234949Sbapt	exit ;;
486234949Sbapt    AViiON:dgux:*:*)
487234949Sbapt	# DG/UX returns AViiON for all architectures
488234949Sbapt	UNAME_PROCESSOR=`/usr/bin/uname -p`
489234949Sbapt	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
490234949Sbapt	then
491234949Sbapt	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
492234949Sbapt	       [ ${TARGET_BINARY_INTERFACE}x = x ]
493234949Sbapt	    then
494234949Sbapt		echo m88k-dg-dgux${UNAME_RELEASE}
495234949Sbapt	    else
496234949Sbapt		echo m88k-dg-dguxbcs${UNAME_RELEASE}
497234949Sbapt	    fi
498234949Sbapt	else
499234949Sbapt	    echo i586-dg-dgux${UNAME_RELEASE}
500234949Sbapt	fi
501234949Sbapt	exit ;;
502234949Sbapt    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
503234949Sbapt	echo m88k-dolphin-sysv3
504234949Sbapt	exit ;;
505234949Sbapt    M88*:*:R3*:*)
506234949Sbapt	# Delta 88k system running SVR3
507234949Sbapt	echo m88k-motorola-sysv3
508234949Sbapt	exit ;;
509234949Sbapt    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
510234949Sbapt	echo m88k-tektronix-sysv3
511234949Sbapt	exit ;;
512234949Sbapt    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
513234949Sbapt	echo m68k-tektronix-bsd
514234949Sbapt	exit ;;
515234949Sbapt    *:IRIX*:*:*)
516234949Sbapt	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
517234949Sbapt	exit ;;
518234949Sbapt    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
519234949Sbapt	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
520234949Sbapt	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
521234949Sbapt    i*86:AIX:*:*)
522234949Sbapt	echo i386-ibm-aix
523234949Sbapt	exit ;;
524234949Sbapt    ia64:AIX:*:*)
525234949Sbapt	if [ -x /usr/bin/oslevel ] ; then
526234949Sbapt		IBM_REV=`/usr/bin/oslevel`
527234949Sbapt	else
528234949Sbapt		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
529234949Sbapt	fi
530234949Sbapt	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
531234949Sbapt	exit ;;
532234949Sbapt    *:AIX:2:3)
533234949Sbapt	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
534234949Sbapt		eval $set_cc_for_build
535234949Sbapt		sed 's/^		//' << EOF >$dummy.c
536234949Sbapt		#include <sys/systemcfg.h>
537234949Sbapt
538234949Sbapt		main()
539234949Sbapt			{
540234949Sbapt			if (!__power_pc())
541234949Sbapt				exit(1);
542234949Sbapt			puts("powerpc-ibm-aix3.2.5");
543234949Sbapt			exit(0);
544234949Sbapt			}
545234949SbaptEOF
546234949Sbapt		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
547234949Sbapt		then
548234949Sbapt			echo "$SYSTEM_NAME"
549234949Sbapt		else
550234949Sbapt			echo rs6000-ibm-aix3.2.5
551234949Sbapt		fi
552234949Sbapt	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
553234949Sbapt		echo rs6000-ibm-aix3.2.4
554234949Sbapt	else
555234949Sbapt		echo rs6000-ibm-aix3.2
556234949Sbapt	fi
557234949Sbapt	exit ;;
558234949Sbapt    *:AIX:*:[4567])
559234949Sbapt	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
560234949Sbapt	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
561234949Sbapt		IBM_ARCH=rs6000
562234949Sbapt	else
563234949Sbapt		IBM_ARCH=powerpc
564234949Sbapt	fi
565234949Sbapt	if [ -x /usr/bin/oslevel ] ; then
566234949Sbapt		IBM_REV=`/usr/bin/oslevel`
567234949Sbapt	else
568234949Sbapt		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
569234949Sbapt	fi
570234949Sbapt	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
571234949Sbapt	exit ;;
572234949Sbapt    *:AIX:*:*)
573234949Sbapt	echo rs6000-ibm-aix
574234949Sbapt	exit ;;
575234949Sbapt    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
576234949Sbapt	echo romp-ibm-bsd4.4
577234949Sbapt	exit ;;
578234949Sbapt    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
579234949Sbapt	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
580234949Sbapt	exit ;;                             # report: romp-ibm BSD 4.3
581234949Sbapt    *:BOSX:*:*)
582234949Sbapt	echo rs6000-bull-bosx
583234949Sbapt	exit ;;
584234949Sbapt    DPX/2?00:B.O.S.:*:*)
585234949Sbapt	echo m68k-bull-sysv3
586234949Sbapt	exit ;;
587234949Sbapt    9000/[34]??:4.3bsd:1.*:*)
588234949Sbapt	echo m68k-hp-bsd
589234949Sbapt	exit ;;
590234949Sbapt    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
591234949Sbapt	echo m68k-hp-bsd4.4
592234949Sbapt	exit ;;
593234949Sbapt    9000/[34678]??:HP-UX:*:*)
594234949Sbapt	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
595234949Sbapt	case "${UNAME_MACHINE}" in
596234949Sbapt	    9000/31? )            HP_ARCH=m68000 ;;
597234949Sbapt	    9000/[34]?? )         HP_ARCH=m68k ;;
598234949Sbapt	    9000/[678][0-9][0-9])
599234949Sbapt		if [ -x /usr/bin/getconf ]; then
600234949Sbapt		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
601234949Sbapt		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
602234949Sbapt		    case "${sc_cpu_version}" in
603234949Sbapt                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
604234949Sbapt                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
605234949Sbapt                      532)                      # CPU_PA_RISC2_0
606234949Sbapt                        case "${sc_kernel_bits}" in
607234949Sbapt                          32) HP_ARCH="hppa2.0n" ;;
608234949Sbapt                          64) HP_ARCH="hppa2.0w" ;;
609234949Sbapt			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
610234949Sbapt                        esac ;;
611234949Sbapt                    esac
612234949Sbapt		fi
613234949Sbapt		if [ "${HP_ARCH}" = "" ]; then
614234949Sbapt		    eval $set_cc_for_build
615234949Sbapt		    sed 's/^              //' << EOF >$dummy.c
616234949Sbapt
617234949Sbapt              #define _HPUX_SOURCE
618234949Sbapt              #include <stdlib.h>
619234949Sbapt              #include <unistd.h>
620234949Sbapt
621234949Sbapt              int main ()
622234949Sbapt              {
623234949Sbapt              #if defined(_SC_KERNEL_BITS)
624234949Sbapt                  long bits = sysconf(_SC_KERNEL_BITS);
625234949Sbapt              #endif
626234949Sbapt                  long cpu  = sysconf (_SC_CPU_VERSION);
627234949Sbapt
628234949Sbapt                  switch (cpu)
629234949Sbapt              	{
630234949Sbapt              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
631234949Sbapt              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
632234949Sbapt              	case CPU_PA_RISC2_0:
633234949Sbapt              #if defined(_SC_KERNEL_BITS)
634234949Sbapt              	    switch (bits)
635234949Sbapt              		{
636234949Sbapt              		case 64: puts ("hppa2.0w"); break;
637234949Sbapt              		case 32: puts ("hppa2.0n"); break;
638234949Sbapt              		default: puts ("hppa2.0"); break;
639234949Sbapt              		} break;
640234949Sbapt              #else  /* !defined(_SC_KERNEL_BITS) */
641234949Sbapt              	    puts ("hppa2.0"); break;
642234949Sbapt              #endif
643234949Sbapt              	default: puts ("hppa1.0"); break;
644234949Sbapt              	}
645234949Sbapt                  exit (0);
646234949Sbapt              }
647234949SbaptEOF
648234949Sbapt		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
649234949Sbapt		    test -z "$HP_ARCH" && HP_ARCH=hppa
650234949Sbapt		fi ;;
651234949Sbapt	esac
652234949Sbapt	if [ ${HP_ARCH} = "hppa2.0w" ]
653234949Sbapt	then
654234949Sbapt	    eval $set_cc_for_build
655234949Sbapt
656234949Sbapt	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
657234949Sbapt	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
658234949Sbapt	    # generating 64-bit code.  GNU and HP use different nomenclature:
659234949Sbapt	    #
660234949Sbapt	    # $ CC_FOR_BUILD=cc ./config.guess
661234949Sbapt	    # => hppa2.0w-hp-hpux11.23
662234949Sbapt	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
663234949Sbapt	    # => hppa64-hp-hpux11.23
664234949Sbapt
665234949Sbapt	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
666234949Sbapt		grep -q __LP64__
667234949Sbapt	    then
668234949Sbapt		HP_ARCH="hppa2.0w"
669234949Sbapt	    else
670234949Sbapt		HP_ARCH="hppa64"
671234949Sbapt	    fi
672234949Sbapt	fi
673234949Sbapt	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
674234949Sbapt	exit ;;
675234949Sbapt    ia64:HP-UX:*:*)
676234949Sbapt	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
677234949Sbapt	echo ia64-hp-hpux${HPUX_REV}
678234949Sbapt	exit ;;
679234949Sbapt    3050*:HI-UX:*:*)
680234949Sbapt	eval $set_cc_for_build
681234949Sbapt	sed 's/^	//' << EOF >$dummy.c
682234949Sbapt	#include <unistd.h>
683234949Sbapt	int
684234949Sbapt	main ()
685234949Sbapt	{
686234949Sbapt	  long cpu = sysconf (_SC_CPU_VERSION);
687234949Sbapt	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
688234949Sbapt	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
689234949Sbapt	     results, however.  */
690234949Sbapt	  if (CPU_IS_PA_RISC (cpu))
691234949Sbapt	    {
692234949Sbapt	      switch (cpu)
693234949Sbapt		{
694234949Sbapt		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
695234949Sbapt		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
696234949Sbapt		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
697234949Sbapt		  default: puts ("hppa-hitachi-hiuxwe2"); break;
698234949Sbapt		}
699234949Sbapt	    }
700234949Sbapt	  else if (CPU_IS_HP_MC68K (cpu))
701234949Sbapt	    puts ("m68k-hitachi-hiuxwe2");
702234949Sbapt	  else puts ("unknown-hitachi-hiuxwe2");
703234949Sbapt	  exit (0);
704234949Sbapt	}
705234949SbaptEOF
706234949Sbapt	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
707234949Sbapt		{ echo "$SYSTEM_NAME"; exit; }
708234949Sbapt	echo unknown-hitachi-hiuxwe2
709234949Sbapt	exit ;;
710234949Sbapt    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
711234949Sbapt	echo hppa1.1-hp-bsd
712234949Sbapt	exit ;;
713234949Sbapt    9000/8??:4.3bsd:*:*)
714234949Sbapt	echo hppa1.0-hp-bsd
715234949Sbapt	exit ;;
716234949Sbapt    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
717234949Sbapt	echo hppa1.0-hp-mpeix
718234949Sbapt	exit ;;
719234949Sbapt    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
720234949Sbapt	echo hppa1.1-hp-osf
721234949Sbapt	exit ;;
722234949Sbapt    hp8??:OSF1:*:*)
723234949Sbapt	echo hppa1.0-hp-osf
724234949Sbapt	exit ;;
725234949Sbapt    i*86:OSF1:*:*)
726234949Sbapt	if [ -x /usr/sbin/sysversion ] ; then
727234949Sbapt	    echo ${UNAME_MACHINE}-unknown-osf1mk
728234949Sbapt	else
729234949Sbapt	    echo ${UNAME_MACHINE}-unknown-osf1
730234949Sbapt	fi
731234949Sbapt	exit ;;
732234949Sbapt    parisc*:Lites*:*:*)
733234949Sbapt	echo hppa1.1-hp-lites
734234949Sbapt	exit ;;
735234949Sbapt    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
736234949Sbapt	echo c1-convex-bsd
737234949Sbapt	exit ;;
738234949Sbapt    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
739234949Sbapt	if getsysinfo -f scalar_acc
740234949Sbapt	then echo c32-convex-bsd
741234949Sbapt	else echo c2-convex-bsd
742234949Sbapt	fi
743234949Sbapt	exit ;;
744234949Sbapt    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
745234949Sbapt	echo c34-convex-bsd
746234949Sbapt	exit ;;
747234949Sbapt    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
748234949Sbapt	echo c38-convex-bsd
749234949Sbapt	exit ;;
750234949Sbapt    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
751234949Sbapt	echo c4-convex-bsd
752234949Sbapt	exit ;;
753234949Sbapt    CRAY*Y-MP:*:*:*)
754234949Sbapt	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
755234949Sbapt	exit ;;
756234949Sbapt    CRAY*[A-Z]90:*:*:*)
757234949Sbapt	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
758234949Sbapt	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
759234949Sbapt	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
760234949Sbapt	      -e 's/\.[^.]*$/.X/'
761234949Sbapt	exit ;;
762234949Sbapt    CRAY*TS:*:*:*)
763234949Sbapt	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
764234949Sbapt	exit ;;
765234949Sbapt    CRAY*T3E:*:*:*)
766234949Sbapt	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
767234949Sbapt	exit ;;
768234949Sbapt    CRAY*SV1:*:*:*)
769234949Sbapt	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
770234949Sbapt	exit ;;
771234949Sbapt    *:UNICOS/mp:*:*)
772234949Sbapt	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
773234949Sbapt	exit ;;
774234949Sbapt    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
775234949Sbapt	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
776234949Sbapt	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
777234949Sbapt	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
778234949Sbapt	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
779234949Sbapt	exit ;;
780234949Sbapt    5000:UNIX_System_V:4.*:*)
781234949Sbapt	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
782234949Sbapt	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
783234949Sbapt	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
784234949Sbapt	exit ;;
785234949Sbapt    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
786234949Sbapt	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
787234949Sbapt	exit ;;
788234949Sbapt    sparc*:BSD/OS:*:*)
789234949Sbapt	echo sparc-unknown-bsdi${UNAME_RELEASE}
790234949Sbapt	exit ;;
791234949Sbapt    *:BSD/OS:*:*)
792234949Sbapt	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
793234949Sbapt	exit ;;
794234949Sbapt    *:FreeBSD:*:*)
795234949Sbapt	case ${UNAME_MACHINE} in
796234949Sbapt	    pc98)
797234949Sbapt		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
798234949Sbapt	    amd64)
799234949Sbapt		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
800234949Sbapt	    *)
801234949Sbapt		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
802234949Sbapt	esac
803234949Sbapt	exit ;;
804234949Sbapt    i*:CYGWIN*:*)
805234949Sbapt	echo ${UNAME_MACHINE}-pc-cygwin
806234949Sbapt	exit ;;
807234949Sbapt    *:MINGW*:*)
808234949Sbapt	echo ${UNAME_MACHINE}-pc-mingw32
809234949Sbapt	exit ;;
810234949Sbapt    i*:windows32*:*)
811234949Sbapt	# uname -m includes "-pc" on this system.
812234949Sbapt	echo ${UNAME_MACHINE}-mingw32
813234949Sbapt	exit ;;
814234949Sbapt    i*:PW*:*)
815234949Sbapt	echo ${UNAME_MACHINE}-pc-pw32
816234949Sbapt	exit ;;
817234949Sbapt    *:Interix*:*)
818234949Sbapt	case ${UNAME_MACHINE} in
819234949Sbapt	    x86)
820234949Sbapt		echo i586-pc-interix${UNAME_RELEASE}
821234949Sbapt		exit ;;
822234949Sbapt	    authenticamd | genuineintel | EM64T)
823234949Sbapt		echo x86_64-unknown-interix${UNAME_RELEASE}
824234949Sbapt		exit ;;
825234949Sbapt	    IA64)
826234949Sbapt		echo ia64-unknown-interix${UNAME_RELEASE}
827234949Sbapt		exit ;;
828234949Sbapt	esac ;;
829234949Sbapt    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
830234949Sbapt	echo i${UNAME_MACHINE}-pc-mks
831234949Sbapt	exit ;;
832234949Sbapt    8664:Windows_NT:*)
833234949Sbapt	echo x86_64-pc-mks
834234949Sbapt	exit ;;
835234949Sbapt    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
836234949Sbapt	# How do we know it's Interix rather than the generic POSIX subsystem?
837234949Sbapt	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
838234949Sbapt	# UNAME_MACHINE based on the output of uname instead of i386?
839234949Sbapt	echo i586-pc-interix
840234949Sbapt	exit ;;
841234949Sbapt    i*:UWIN*:*)
842234949Sbapt	echo ${UNAME_MACHINE}-pc-uwin
843234949Sbapt	exit ;;
844234949Sbapt    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
845234949Sbapt	echo x86_64-unknown-cygwin
846234949Sbapt	exit ;;
847234949Sbapt    p*:CYGWIN*:*)
848234949Sbapt	echo powerpcle-unknown-cygwin
849234949Sbapt	exit ;;
850234949Sbapt    prep*:SunOS:5.*:*)
851234949Sbapt	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
852234949Sbapt	exit ;;
853234949Sbapt    *:GNU:*:*)
854234949Sbapt	# the GNU system
855234949Sbapt	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
856234949Sbapt	exit ;;
857234949Sbapt    *:GNU/*:*:*)
858234949Sbapt	# other systems with GNU libc and userland
859234949Sbapt	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
860234949Sbapt	exit ;;
861234949Sbapt    i*86:Minix:*:*)
862234949Sbapt	echo ${UNAME_MACHINE}-pc-minix
863234949Sbapt	exit ;;
864234949Sbapt    alpha:Linux:*:*)
865234949Sbapt	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
866234949Sbapt	    EV5)   UNAME_MACHINE=alphaev5 ;;
867234949Sbapt	    EV56)  UNAME_MACHINE=alphaev56 ;;
868234949Sbapt	    PCA56) UNAME_MACHINE=alphapca56 ;;
869234949Sbapt	    PCA57) UNAME_MACHINE=alphapca56 ;;
870234949Sbapt	    EV6)   UNAME_MACHINE=alphaev6 ;;
871234949Sbapt	    EV67)  UNAME_MACHINE=alphaev67 ;;
872234949Sbapt	    EV68*) UNAME_MACHINE=alphaev68 ;;
873234949Sbapt	esac
874234949Sbapt	objdump --private-headers /bin/sh | grep -q ld.so.1
875234949Sbapt	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
876234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
877234949Sbapt	exit ;;
878234949Sbapt    arm*:Linux:*:*)
879234949Sbapt	eval $set_cc_for_build
880234949Sbapt	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \
881234949Sbapt	    grep -q __ARM_EABI__
882234949Sbapt	then
883234949Sbapt	    echo ${UNAME_MACHINE}-unknown-linux-gnu
884234949Sbapt	else
885234949Sbapt	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
886234949Sbapt	fi
887234949Sbapt	exit ;;
888234949Sbapt    avr32*:Linux:*:*)
889234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
890234949Sbapt	exit ;;
891234949Sbapt    cris:Linux:*:*)
892234949Sbapt	echo cris-axis-linux-gnu
893234949Sbapt	exit ;;
894234949Sbapt    crisv32:Linux:*:*)
895234949Sbapt	echo crisv32-axis-linux-gnu
896234949Sbapt	exit ;;
897234949Sbapt    frv:Linux:*:*)
898234949Sbapt	echo frv-unknown-linux-gnu
899234949Sbapt	exit ;;
900234949Sbapt    i*86:Linux:*:*)
901234949Sbapt	LIBC=gnu
902234949Sbapt	eval $set_cc_for_build
903234949Sbapt	sed 's/^        //' << EOF >$dummy.c
904234949Sbapt	#ifdef __dietlibc__
905234949Sbapt	LIBC=dietlibc
906234949Sbapt	#endif
907234949SbaptEOF
908234949Sbapt	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
909234949Sbapt	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
910234949Sbapt	exit ;;
911234949Sbapt    ia64:Linux:*:*)
912234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
913234949Sbapt	exit ;;
914234949Sbapt    m32r*:Linux:*:*)
915234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
916234949Sbapt	exit ;;
917234949Sbapt    m68*:Linux:*:*)
918234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
919234949Sbapt	exit ;;
920234949Sbapt    mips:Linux:*:* | mips64:Linux:*:*)
921234949Sbapt	eval $set_cc_for_build
922234949Sbapt	sed 's/^	//' << EOF >$dummy.c
923234949Sbapt	#undef CPU
924234949Sbapt	#undef ${UNAME_MACHINE}
925234949Sbapt	#undef ${UNAME_MACHINE}el
926234949Sbapt	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
927234949Sbapt	CPU=${UNAME_MACHINE}el
928234949Sbapt	#else
929234949Sbapt	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
930234949Sbapt	CPU=${UNAME_MACHINE}
931234949Sbapt	#else
932234949Sbapt	CPU=
933234949Sbapt	#endif
934234949Sbapt	#endif
935234949SbaptEOF
936234949Sbapt	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
937234949Sbapt	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
938234949Sbapt	;;
939234949Sbapt    or32:Linux:*:*)
940234949Sbapt	echo or32-unknown-linux-gnu
941234949Sbapt	exit ;;
942234949Sbapt    padre:Linux:*:*)
943234949Sbapt	echo sparc-unknown-linux-gnu
944234949Sbapt	exit ;;
945234949Sbapt    parisc64:Linux:*:* | hppa64:Linux:*:*)
946234949Sbapt	echo hppa64-unknown-linux-gnu
947234949Sbapt	exit ;;
948234949Sbapt    parisc:Linux:*:* | hppa:Linux:*:*)
949234949Sbapt	# Look for CPU level
950234949Sbapt	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
951234949Sbapt	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
952234949Sbapt	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
953234949Sbapt	  *)    echo hppa-unknown-linux-gnu ;;
954234949Sbapt	esac
955234949Sbapt	exit ;;
956234949Sbapt    ppc64:Linux:*:*)
957234949Sbapt	echo powerpc64-unknown-linux-gnu
958234949Sbapt	exit ;;
959234949Sbapt    ppc:Linux:*:*)
960234949Sbapt	echo powerpc-unknown-linux-gnu
961234949Sbapt	exit ;;
962234949Sbapt    s390:Linux:*:* | s390x:Linux:*:*)
963234949Sbapt	echo ${UNAME_MACHINE}-ibm-linux
964234949Sbapt	exit ;;
965234949Sbapt    sh64*:Linux:*:*)
966234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
967234949Sbapt	exit ;;
968234949Sbapt    sh*:Linux:*:*)
969234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
970234949Sbapt	exit ;;
971234949Sbapt    sparc:Linux:*:* | sparc64:Linux:*:*)
972234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
973234949Sbapt	exit ;;
974234949Sbapt    tile*:Linux:*:*)
975234949Sbapt	echo ${UNAME_MACHINE}-tilera-linux-gnu
976234949Sbapt	exit ;;
977234949Sbapt    vax:Linux:*:*)
978234949Sbapt	echo ${UNAME_MACHINE}-dec-linux-gnu
979234949Sbapt	exit ;;
980234949Sbapt    x86_64:Linux:*:*)
981234949Sbapt	echo x86_64-unknown-linux-gnu
982234949Sbapt	exit ;;
983234949Sbapt    xtensa*:Linux:*:*)
984234949Sbapt	echo ${UNAME_MACHINE}-unknown-linux-gnu
985234949Sbapt	exit ;;
986234949Sbapt    i*86:DYNIX/ptx:4*:*)
987234949Sbapt	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
988234949Sbapt	# earlier versions are messed up and put the nodename in both
989234949Sbapt	# sysname and nodename.
990234949Sbapt	echo i386-sequent-sysv4
991234949Sbapt	exit ;;
992234949Sbapt    i*86:UNIX_SV:4.2MP:2.*)
993234949Sbapt	# Unixware is an offshoot of SVR4, but it has its own version
994234949Sbapt	# number series starting with 2...
995234949Sbapt	# I am not positive that other SVR4 systems won't match this,
996234949Sbapt	# I just have to hope.  -- rms.
997234949Sbapt	# Use sysv4.2uw... so that sysv4* matches it.
998234949Sbapt	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
999234949Sbapt	exit ;;
1000234949Sbapt    i*86:OS/2:*:*)
1001234949Sbapt	# If we were able to find `uname', then EMX Unix compatibility
1002234949Sbapt	# is probably installed.
1003234949Sbapt	echo ${UNAME_MACHINE}-pc-os2-emx
1004234949Sbapt	exit ;;
1005234949Sbapt    i*86:XTS-300:*:STOP)
1006234949Sbapt	echo ${UNAME_MACHINE}-unknown-stop
1007234949Sbapt	exit ;;
1008234949Sbapt    i*86:atheos:*:*)
1009234949Sbapt	echo ${UNAME_MACHINE}-unknown-atheos
1010234949Sbapt	exit ;;
1011234949Sbapt    i*86:syllable:*:*)
1012234949Sbapt	echo ${UNAME_MACHINE}-pc-syllable
1013234949Sbapt	exit ;;
1014234949Sbapt    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1015234949Sbapt	echo i386-unknown-lynxos${UNAME_RELEASE}
1016234949Sbapt	exit ;;
1017234949Sbapt    i*86:*DOS:*:*)
1018234949Sbapt	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1019234949Sbapt	exit ;;
1020234949Sbapt    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1021234949Sbapt	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1022234949Sbapt	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1023234949Sbapt		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1024234949Sbapt	else
1025234949Sbapt		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1026234949Sbapt	fi
1027234949Sbapt	exit ;;
1028234949Sbapt    i*86:*:5:[678]*)
1029234949Sbapt	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1030234949Sbapt	case `/bin/uname -X | grep "^Machine"` in
1031234949Sbapt	    *486*)	     UNAME_MACHINE=i486 ;;
1032234949Sbapt	    *Pentium)	     UNAME_MACHINE=i586 ;;
1033234949Sbapt	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1034234949Sbapt	esac
1035234949Sbapt	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1036234949Sbapt	exit ;;
1037234949Sbapt    i*86:*:3.2:*)
1038234949Sbapt	if test -f /usr/options/cb.name; then
1039234949Sbapt		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1040234949Sbapt		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1041234949Sbapt	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1042234949Sbapt		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1043234949Sbapt		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1044234949Sbapt		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1045234949Sbapt			&& UNAME_MACHINE=i586
1046234949Sbapt		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1047234949Sbapt			&& UNAME_MACHINE=i686
1048234949Sbapt		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1049234949Sbapt			&& UNAME_MACHINE=i686
1050234949Sbapt		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1051234949Sbapt	else
1052234949Sbapt		echo ${UNAME_MACHINE}-pc-sysv32
1053234949Sbapt	fi
1054234949Sbapt	exit ;;
1055234949Sbapt    pc:*:*:*)
1056234949Sbapt	# Left here for compatibility:
1057234949Sbapt	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1058234949Sbapt	# the processor, so we play safe by assuming i586.
1059234949Sbapt	# Note: whatever this is, it MUST be the same as what config.sub
1060234949Sbapt	# prints for the "djgpp" host, or else GDB configury will decide that
1061234949Sbapt	# this is a cross-build.
1062234949Sbapt	echo i586-pc-msdosdjgpp
1063234949Sbapt	exit ;;
1064234949Sbapt    Intel:Mach:3*:*)
1065234949Sbapt	echo i386-pc-mach3
1066234949Sbapt	exit ;;
1067234949Sbapt    paragon:*:*:*)
1068234949Sbapt	echo i860-intel-osf1
1069234949Sbapt	exit ;;
1070234949Sbapt    i860:*:4.*:*) # i860-SVR4
1071234949Sbapt	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1072234949Sbapt	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1073234949Sbapt	else # Add other i860-SVR4 vendors below as they are discovered.
1074234949Sbapt	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1075234949Sbapt	fi
1076234949Sbapt	exit ;;
1077234949Sbapt    mini*:CTIX:SYS*5:*)
1078234949Sbapt	# "miniframe"
1079234949Sbapt	echo m68010-convergent-sysv
1080234949Sbapt	exit ;;
1081234949Sbapt    mc68k:UNIX:SYSTEM5:3.51m)
1082234949Sbapt	echo m68k-convergent-sysv
1083234949Sbapt	exit ;;
1084234949Sbapt    M680?0:D-NIX:5.3:*)
1085234949Sbapt	echo m68k-diab-dnix
1086234949Sbapt	exit ;;
1087234949Sbapt    M68*:*:R3V[5678]*:*)
1088234949Sbapt	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1089234949Sbapt    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)
1090234949Sbapt	OS_REL=''
1091234949Sbapt	test -r /etc/.relid \
1092234949Sbapt	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1093234949Sbapt	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1094234949Sbapt	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1095234949Sbapt	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1096234949Sbapt	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1097234949Sbapt    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1098234949Sbapt	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1099234949Sbapt	   && { echo i486-ncr-sysv4; exit; } ;;
1100234949Sbapt    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1101234949Sbapt	OS_REL='.3'
1102234949Sbapt	test -r /etc/.relid \
1103234949Sbapt	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1104234949Sbapt	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1105234949Sbapt	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1106234949Sbapt	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1107234949Sbapt	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1108234949Sbapt	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1109234949Sbapt	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1110234949Sbapt    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1111234949Sbapt	echo m68k-unknown-lynxos${UNAME_RELEASE}
1112234949Sbapt	exit ;;
1113234949Sbapt    mc68030:UNIX_System_V:4.*:*)
1114234949Sbapt	echo m68k-atari-sysv4
1115234949Sbapt	exit ;;
1116234949Sbapt    TSUNAMI:LynxOS:2.*:*)
1117234949Sbapt	echo sparc-unknown-lynxos${UNAME_RELEASE}
1118234949Sbapt	exit ;;
1119234949Sbapt    rs6000:LynxOS:2.*:*)
1120234949Sbapt	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1121234949Sbapt	exit ;;
1122234949Sbapt    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1123234949Sbapt	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1124234949Sbapt	exit ;;
1125234949Sbapt    SM[BE]S:UNIX_SV:*:*)
1126234949Sbapt	echo mips-dde-sysv${UNAME_RELEASE}
1127234949Sbapt	exit ;;
1128234949Sbapt    RM*:ReliantUNIX-*:*:*)
1129234949Sbapt	echo mips-sni-sysv4
1130234949Sbapt	exit ;;
1131234949Sbapt    RM*:SINIX-*:*:*)
1132234949Sbapt	echo mips-sni-sysv4
1133234949Sbapt	exit ;;
1134234949Sbapt    *:SINIX-*:*:*)
1135234949Sbapt	if uname -p 2>/dev/null >/dev/null ; then
1136234949Sbapt		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1137234949Sbapt		echo ${UNAME_MACHINE}-sni-sysv4
1138234949Sbapt	else
1139234949Sbapt		echo ns32k-sni-sysv
1140234949Sbapt	fi
1141234949Sbapt	exit ;;
1142234949Sbapt    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1143234949Sbapt	              # says <Richard.M.Bartel@ccMail.Census.GOV>
1144234949Sbapt	echo i586-unisys-sysv4
1145234949Sbapt	exit ;;
1146234949Sbapt    *:UNIX_System_V:4*:FTX*)
1147234949Sbapt	# From Gerald Hewes <hewes@openmarket.com>.
1148234949Sbapt	# How about differentiating between stratus architectures? -djm
1149234949Sbapt	echo hppa1.1-stratus-sysv4
1150234949Sbapt	exit ;;
1151234949Sbapt    *:*:*:FTX*)
1152234949Sbapt	# From seanf@swdc.stratus.com.
1153234949Sbapt	echo i860-stratus-sysv4
1154234949Sbapt	exit ;;
1155234949Sbapt    i*86:VOS:*:*)
1156234949Sbapt	# From Paul.Green@stratus.com.
1157234949Sbapt	echo ${UNAME_MACHINE}-stratus-vos
1158234949Sbapt	exit ;;
1159234949Sbapt    *:VOS:*:*)
1160234949Sbapt	# From Paul.Green@stratus.com.
1161234949Sbapt	echo hppa1.1-stratus-vos
1162234949Sbapt	exit ;;
1163234949Sbapt    mc68*:A/UX:*:*)
1164234949Sbapt	echo m68k-apple-aux${UNAME_RELEASE}
1165234949Sbapt	exit ;;
1166234949Sbapt    news*:NEWS-OS:6*:*)
1167234949Sbapt	echo mips-sony-newsos6
1168234949Sbapt	exit ;;
1169234949Sbapt    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1170234949Sbapt	if [ -d /usr/nec ]; then
1171234949Sbapt	        echo mips-nec-sysv${UNAME_RELEASE}
1172234949Sbapt	else
1173234949Sbapt	        echo mips-unknown-sysv${UNAME_RELEASE}
1174234949Sbapt	fi
1175234949Sbapt	exit ;;
1176234949Sbapt    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1177234949Sbapt	echo powerpc-be-beos
1178234949Sbapt	exit ;;
1179234949Sbapt    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1180234949Sbapt	echo powerpc-apple-beos
1181234949Sbapt	exit ;;
1182234949Sbapt    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1183234949Sbapt	echo i586-pc-beos
1184234949Sbapt	exit ;;
1185234949Sbapt    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1186234949Sbapt	echo i586-pc-haiku
1187234949Sbapt	exit ;;
1188234949Sbapt    SX-4:SUPER-UX:*:*)
1189234949Sbapt	echo sx4-nec-superux${UNAME_RELEASE}
1190234949Sbapt	exit ;;
1191234949Sbapt    SX-5:SUPER-UX:*:*)
1192234949Sbapt	echo sx5-nec-superux${UNAME_RELEASE}
1193234949Sbapt	exit ;;
1194234949Sbapt    SX-6:SUPER-UX:*:*)
1195234949Sbapt	echo sx6-nec-superux${UNAME_RELEASE}
1196234949Sbapt	exit ;;
1197234949Sbapt    SX-7:SUPER-UX:*:*)
1198234949Sbapt	echo sx7-nec-superux${UNAME_RELEASE}
1199234949Sbapt	exit ;;
1200234949Sbapt    SX-8:SUPER-UX:*:*)
1201234949Sbapt	echo sx8-nec-superux${UNAME_RELEASE}
1202234949Sbapt	exit ;;
1203234949Sbapt    SX-8R:SUPER-UX:*:*)
1204234949Sbapt	echo sx8r-nec-superux${UNAME_RELEASE}
1205234949Sbapt	exit ;;
1206234949Sbapt    Power*:Rhapsody:*:*)
1207234949Sbapt	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1208234949Sbapt	exit ;;
1209234949Sbapt    *:Rhapsody:*:*)
1210234949Sbapt	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1211234949Sbapt	exit ;;
1212234949Sbapt    *:Darwin:*:*)
1213234949Sbapt	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1214234949Sbapt	case $UNAME_PROCESSOR in
1215234949Sbapt	    i386)
1216234949Sbapt		eval $set_cc_for_build
1217234949Sbapt		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1218234949Sbapt		    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1219234949Sbapt			(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1220234949Sbapt			grep IS_64BIT_ARCH >/dev/null
1221234949Sbapt		    then
1222234949Sbapt			UNAME_PROCESSOR="x86_64"
1223234949Sbapt		    fi
1224234949Sbapt		fi ;;
1225234949Sbapt	    unknown) UNAME_PROCESSOR=powerpc ;;
1226234949Sbapt	esac
1227234949Sbapt	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1228234949Sbapt	exit ;;
1229234949Sbapt    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1230234949Sbapt	UNAME_PROCESSOR=`uname -p`
1231234949Sbapt	if test "$UNAME_PROCESSOR" = "x86"; then
1232234949Sbapt	    UNAME_PROCESSOR=i386
1233234949Sbapt	    UNAME_MACHINE=pc
1234234949Sbapt	fi
1235234949Sbapt	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1236234949Sbapt	exit ;;
1237234949Sbapt    *:QNX:*:4*)
1238234949Sbapt	echo i386-pc-qnx
1239234949Sbapt	exit ;;
1240234949Sbapt    NEO-?:NONSTOP_KERNEL:*:*)
1241234949Sbapt	echo neo-tandem-nsk${UNAME_RELEASE}
1242234949Sbapt	exit ;;
1243234949Sbapt    NSE-?:NONSTOP_KERNEL:*:*)
1244234949Sbapt	echo nse-tandem-nsk${UNAME_RELEASE}
1245234949Sbapt	exit ;;
1246234949Sbapt    NSR-?:NONSTOP_KERNEL:*:*)
1247234949Sbapt	echo nsr-tandem-nsk${UNAME_RELEASE}
1248234949Sbapt	exit ;;
1249234949Sbapt    *:NonStop-UX:*:*)
1250234949Sbapt	echo mips-compaq-nonstopux
1251234949Sbapt	exit ;;
1252234949Sbapt    BS2000:POSIX*:*:*)
1253234949Sbapt	echo bs2000-siemens-sysv
1254234949Sbapt	exit ;;
1255234949Sbapt    DS/*:UNIX_System_V:*:*)
1256234949Sbapt	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1257234949Sbapt	exit ;;
1258234949Sbapt    *:Plan9:*:*)
1259234949Sbapt	# "uname -m" is not consistent, so use $cputype instead. 386
1260234949Sbapt	# is converted to i386 for consistency with other x86
1261234949Sbapt	# operating systems.
1262234949Sbapt	if test "$cputype" = "386"; then
1263234949Sbapt	    UNAME_MACHINE=i386
1264234949Sbapt	else
1265234949Sbapt	    UNAME_MACHINE="$cputype"
1266234949Sbapt	fi
1267234949Sbapt	echo ${UNAME_MACHINE}-unknown-plan9
1268234949Sbapt	exit ;;
1269234949Sbapt    *:TOPS-10:*:*)
1270234949Sbapt	echo pdp10-unknown-tops10
1271234949Sbapt	exit ;;
1272234949Sbapt    *:TENEX:*:*)
1273234949Sbapt	echo pdp10-unknown-tenex
1274234949Sbapt	exit ;;
1275234949Sbapt    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1276234949Sbapt	echo pdp10-dec-tops20
1277234949Sbapt	exit ;;
1278234949Sbapt    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1279234949Sbapt	echo pdp10-xkl-tops20
1280234949Sbapt	exit ;;
1281234949Sbapt    *:TOPS-20:*:*)
1282234949Sbapt	echo pdp10-unknown-tops20
1283234949Sbapt	exit ;;
1284234949Sbapt    *:ITS:*:*)
1285234949Sbapt	echo pdp10-unknown-its
1286234949Sbapt	exit ;;
1287234949Sbapt    SEI:*:*:SEIUX)
1288234949Sbapt	echo mips-sei-seiux${UNAME_RELEASE}
1289234949Sbapt	exit ;;
1290234949Sbapt    *:DragonFly:*:*)
1291234949Sbapt	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1292234949Sbapt	exit ;;
1293234949Sbapt    *:*VMS:*:*)
1294234949Sbapt	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1295234949Sbapt	case "${UNAME_MACHINE}" in
1296234949Sbapt	    A*) echo alpha-dec-vms ; exit ;;
1297234949Sbapt	    I*) echo ia64-dec-vms ; exit ;;
1298234949Sbapt	    V*) echo vax-dec-vms ; exit ;;
1299234949Sbapt	esac ;;
1300234949Sbapt    *:XENIX:*:SysV)
1301234949Sbapt	echo i386-pc-xenix
1302234949Sbapt	exit ;;
1303234949Sbapt    i*86:skyos:*:*)
1304234949Sbapt	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1305234949Sbapt	exit ;;
1306234949Sbapt    i*86:rdos:*:*)
1307234949Sbapt	echo ${UNAME_MACHINE}-pc-rdos
1308234949Sbapt	exit ;;
1309234949Sbapt    i*86:AROS:*:*)
1310234949Sbapt	echo ${UNAME_MACHINE}-pc-aros
1311234949Sbapt	exit ;;
1312234949Sbaptesac
1313234949Sbapt
1314234949Sbapt#echo '(No uname command or uname output not recognized.)' 1>&2
1315234949Sbapt#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1316234949Sbapt
1317234949Sbapteval $set_cc_for_build
1318234949Sbaptcat >$dummy.c <<EOF
1319234949Sbapt#ifdef _SEQUENT_
1320234949Sbapt# include <sys/types.h>
1321234949Sbapt# include <sys/utsname.h>
1322234949Sbapt#endif
1323234949Sbaptmain ()
1324234949Sbapt{
1325234949Sbapt#if defined (sony)
1326234949Sbapt#if defined (MIPSEB)
1327234949Sbapt  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1328234949Sbapt     I don't know....  */
1329234949Sbapt  printf ("mips-sony-bsd\n"); exit (0);
1330234949Sbapt#else
1331234949Sbapt#include <sys/param.h>
1332234949Sbapt  printf ("m68k-sony-newsos%s\n",
1333234949Sbapt#ifdef NEWSOS4
1334234949Sbapt          "4"
1335234949Sbapt#else
1336234949Sbapt	  ""
1337234949Sbapt#endif
1338234949Sbapt         ); exit (0);
1339234949Sbapt#endif
1340234949Sbapt#endif
1341234949Sbapt
1342234949Sbapt#if defined (__arm) && defined (__acorn) && defined (__unix)
1343234949Sbapt  printf ("arm-acorn-riscix\n"); exit (0);
1344234949Sbapt#endif
1345234949Sbapt
1346234949Sbapt#if defined (hp300) && !defined (hpux)
1347234949Sbapt  printf ("m68k-hp-bsd\n"); exit (0);
1348234949Sbapt#endif
1349234949Sbapt
1350234949Sbapt#if defined (NeXT)
1351234949Sbapt#if !defined (__ARCHITECTURE__)
1352234949Sbapt#define __ARCHITECTURE__ "m68k"
1353234949Sbapt#endif
1354234949Sbapt  int version;
1355234949Sbapt  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1356234949Sbapt  if (version < 4)
1357234949Sbapt    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1358234949Sbapt  else
1359234949Sbapt    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1360234949Sbapt  exit (0);
1361234949Sbapt#endif
1362234949Sbapt
1363234949Sbapt#if defined (MULTIMAX) || defined (n16)
1364234949Sbapt#if defined (UMAXV)
1365234949Sbapt  printf ("ns32k-encore-sysv\n"); exit (0);
1366234949Sbapt#else
1367234949Sbapt#if defined (CMU)
1368234949Sbapt  printf ("ns32k-encore-mach\n"); exit (0);
1369234949Sbapt#else
1370234949Sbapt  printf ("ns32k-encore-bsd\n"); exit (0);
1371234949Sbapt#endif
1372234949Sbapt#endif
1373234949Sbapt#endif
1374234949Sbapt
1375234949Sbapt#if defined (__386BSD__)
1376234949Sbapt  printf ("i386-pc-bsd\n"); exit (0);
1377234949Sbapt#endif
1378234949Sbapt
1379234949Sbapt#if defined (sequent)
1380234949Sbapt#if defined (i386)
1381234949Sbapt  printf ("i386-sequent-dynix\n"); exit (0);
1382234949Sbapt#endif
1383234949Sbapt#if defined (ns32000)
1384234949Sbapt  printf ("ns32k-sequent-dynix\n"); exit (0);
1385234949Sbapt#endif
1386234949Sbapt#endif
1387234949Sbapt
1388234949Sbapt#if defined (_SEQUENT_)
1389234949Sbapt    struct utsname un;
1390234949Sbapt
1391234949Sbapt    uname(&un);
1392234949Sbapt
1393234949Sbapt    if (strncmp(un.version, "V2", 2) == 0) {
1394234949Sbapt	printf ("i386-sequent-ptx2\n"); exit (0);
1395234949Sbapt    }
1396234949Sbapt    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1397234949Sbapt	printf ("i386-sequent-ptx1\n"); exit (0);
1398234949Sbapt    }
1399234949Sbapt    printf ("i386-sequent-ptx\n"); exit (0);
1400234949Sbapt
1401234949Sbapt#endif
1402234949Sbapt
1403234949Sbapt#if defined (vax)
1404234949Sbapt# if !defined (ultrix)
1405234949Sbapt#  include <sys/param.h>
1406234949Sbapt#  if defined (BSD)
1407234949Sbapt#   if BSD == 43
1408234949Sbapt      printf ("vax-dec-bsd4.3\n"); exit (0);
1409234949Sbapt#   else
1410234949Sbapt#    if BSD == 199006
1411234949Sbapt      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1412234949Sbapt#    else
1413234949Sbapt      printf ("vax-dec-bsd\n"); exit (0);
1414234949Sbapt#    endif
1415234949Sbapt#   endif
1416234949Sbapt#  else
1417234949Sbapt    printf ("vax-dec-bsd\n"); exit (0);
1418234949Sbapt#  endif
1419234949Sbapt# else
1420234949Sbapt    printf ("vax-dec-ultrix\n"); exit (0);
1421234949Sbapt# endif
1422234949Sbapt#endif
1423234949Sbapt
1424234949Sbapt#if defined (alliant) && defined (i860)
1425234949Sbapt  printf ("i860-alliant-bsd\n"); exit (0);
1426234949Sbapt#endif
1427234949Sbapt
1428234949Sbapt  exit (1);
1429234949Sbapt}
1430234949SbaptEOF
1431234949Sbapt
1432234949Sbapt$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1433234949Sbapt	{ echo "$SYSTEM_NAME"; exit; }
1434234949Sbapt
1435234949Sbapt# Apollos put the system type in the environment.
1436234949Sbapt
1437234949Sbapttest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1438234949Sbapt
1439234949Sbapt# Convex versions that predate uname can use getsysinfo(1)
1440234949Sbapt
1441234949Sbaptif [ -x /usr/convex/getsysinfo ]
1442234949Sbaptthen
1443234949Sbapt    case `getsysinfo -f cpu_type` in
1444234949Sbapt    c1*)
1445234949Sbapt	echo c1-convex-bsd
1446234949Sbapt	exit ;;
1447234949Sbapt    c2*)
1448234949Sbapt	if getsysinfo -f scalar_acc
1449234949Sbapt	then echo c32-convex-bsd
1450234949Sbapt	else echo c2-convex-bsd
1451234949Sbapt	fi
1452234949Sbapt	exit ;;
1453234949Sbapt    c34*)
1454234949Sbapt	echo c34-convex-bsd
1455234949Sbapt	exit ;;
1456234949Sbapt    c38*)
1457234949Sbapt	echo c38-convex-bsd
1458234949Sbapt	exit ;;
1459234949Sbapt    c4*)
1460234949Sbapt	echo c4-convex-bsd
1461234949Sbapt	exit ;;
1462234949Sbapt    esac
1463234949Sbaptfi
1464234949Sbapt
1465234949Sbaptcat >&2 <<EOF
1466234949Sbapt$0: unable to guess system type
1467234949Sbapt
1468234949SbaptThis script, last modified $timestamp, has failed to recognize
1469234949Sbaptthe operating system you are using. It is advised that you
1470234949Sbaptdownload the most up to date version of the config scripts from
1471234949Sbapt
1472234949Sbapt  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1473234949Sbaptand
1474234949Sbapt  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1475234949Sbapt
1476234949SbaptIf the version you run ($0) is already up to date, please
1477234949Sbaptsend the following data and any information you think might be
1478234949Sbaptpertinent to <config-patches@gnu.org> in order to provide the needed
1479234949Sbaptinformation to handle your system.
1480234949Sbapt
1481234949Sbaptconfig.guess timestamp = $timestamp
1482234949Sbapt
1483234949Sbaptuname -m = `(uname -m) 2>/dev/null || echo unknown`
1484234949Sbaptuname -r = `(uname -r) 2>/dev/null || echo unknown`
1485234949Sbaptuname -s = `(uname -s) 2>/dev/null || echo unknown`
1486234949Sbaptuname -v = `(uname -v) 2>/dev/null || echo unknown`
1487234949Sbapt
1488234949Sbapt/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1489234949Sbapt/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1490234949Sbapt
1491234949Sbapthostinfo               = `(hostinfo) 2>/dev/null`
1492234949Sbapt/bin/universe          = `(/bin/universe) 2>/dev/null`
1493234949Sbapt/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1494234949Sbapt/bin/arch              = `(/bin/arch) 2>/dev/null`
1495234949Sbapt/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1496234949Sbapt/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1497234949Sbapt
1498234949SbaptUNAME_MACHINE = ${UNAME_MACHINE}
1499234949SbaptUNAME_RELEASE = ${UNAME_RELEASE}
1500234949SbaptUNAME_SYSTEM  = ${UNAME_SYSTEM}
1501234949SbaptUNAME_VERSION = ${UNAME_VERSION}
1502234949SbaptEOF
1503234949Sbapt
1504234949Sbaptexit 1
1505234949Sbapt
1506234949Sbapt# Local variables:
1507234949Sbapt# eval: (add-hook 'write-file-hooks 'time-stamp)
1508234949Sbapt# time-stamp-start: "timestamp='"
1509234949Sbapt# time-stamp-format: "%:y-%02m-%02d"
1510234949Sbapt# time-stamp-end: "'"
1511234949Sbapt# End:
1512