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