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