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