config.guess revision 213fdd94
1301ea0f4Smrg#! /bin/sh
2301ea0f4Smrg# Attempt to guess a canonical system name.
3301ea0f4Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4213fdd94Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
5213fdd94Smrg#   2011, 2012 Free Software Foundation, Inc.
6301ea0f4Smrg
7213fdd94Smrgtimestamp='2012-01-01'
8301ea0f4Smrg
9301ea0f4Smrg# This file is free software; you can redistribute it and/or modify it
10301ea0f4Smrg# under the terms of the GNU General Public License as published by
11301ea0f4Smrg# the Free Software Foundation; either version 2 of the License, or
12301ea0f4Smrg# (at your option) any later version.
13301ea0f4Smrg#
14301ea0f4Smrg# This program is distributed in the hope that it will be useful, but
15301ea0f4Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16301ea0f4Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17301ea0f4Smrg# General Public License for more details.
18301ea0f4Smrg#
19301ea0f4Smrg# You should have received a copy of the GNU General Public License
20301ea0f4Smrg# along with this program; if not, write to the Free Software
210cc67336Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
220cc67336Smrg# 02110-1301, USA.
23301ea0f4Smrg#
24301ea0f4Smrg# As a special exception to the GNU General Public License, if you
25301ea0f4Smrg# distribute this file as part of a program that contains a
26301ea0f4Smrg# configuration script generated by Autoconf, you may include it under
27301ea0f4Smrg# the same distribution terms that you use for the rest of that program.
28301ea0f4Smrg
290cc67336Smrg
30213fdd94Smrg# Originally written by Per Bothner.  Please send patches (context
31213fdd94Smrg# diff format) to <config-patches@gnu.org> and include a ChangeLog
32213fdd94Smrg# entry.
33301ea0f4Smrg#
34301ea0f4Smrg# This script attempts to guess a canonical system name similar to
35301ea0f4Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
36301ea0f4Smrg# exits with 0.  Otherwise, it exits with 1.
37301ea0f4Smrg#
38213fdd94Smrg# You can get the latest version of this script from:
39213fdd94Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
40301ea0f4Smrg
41301ea0f4Smrgme=`echo "$0" | sed -e 's,.*/,,'`
42301ea0f4Smrg
43301ea0f4Smrgusage="\
44301ea0f4SmrgUsage: $0 [OPTION]
45301ea0f4Smrg
46301ea0f4SmrgOutput the configuration name of the system \`$me' is run on.
47301ea0f4Smrg
48301ea0f4SmrgOperation modes:
49301ea0f4Smrg  -h, --help         print this help, then exit
50301ea0f4Smrg  -t, --time-stamp   print date of last modification, then exit
51301ea0f4Smrg  -v, --version      print version number, then exit
52301ea0f4Smrg
53301ea0f4SmrgReport bugs and patches to <config-patches@gnu.org>."
54301ea0f4Smrg
55301ea0f4Smrgversion="\
56301ea0f4SmrgGNU config.guess ($timestamp)
57301ea0f4Smrg
58301ea0f4SmrgOriginally written by Per Bothner.
59213fdd94SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
60213fdd94Smrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
61213fdd94SmrgFree Software Foundation, Inc.
62301ea0f4Smrg
63301ea0f4SmrgThis is free software; see the source for copying conditions.  There is NO
64301ea0f4Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
65301ea0f4Smrg
66301ea0f4Smrghelp="
67301ea0f4SmrgTry \`$me --help' for more information."
68301ea0f4Smrg
69301ea0f4Smrg# Parse command line
70301ea0f4Smrgwhile test $# -gt 0 ; do
71301ea0f4Smrg  case $1 in
72301ea0f4Smrg    --time-stamp | --time* | -t )
730cc67336Smrg       echo "$timestamp" ; exit ;;
74301ea0f4Smrg    --version | -v )
750cc67336Smrg       echo "$version" ; exit ;;
76301ea0f4Smrg    --help | --h* | -h )
770cc67336Smrg       echo "$usage"; exit ;;
78301ea0f4Smrg    -- )     # Stop option processing
79301ea0f4Smrg       shift; break ;;
80301ea0f4Smrg    - )	# Use stdin as input.
81301ea0f4Smrg       break ;;
82301ea0f4Smrg    -* )
83301ea0f4Smrg       echo "$me: invalid option $1$help" >&2
84301ea0f4Smrg       exit 1 ;;
85301ea0f4Smrg    * )
86301ea0f4Smrg       break ;;
87301ea0f4Smrg  esac
88301ea0f4Smrgdone
89301ea0f4Smrg
90301ea0f4Smrgif test $# != 0; then
91301ea0f4Smrg  echo "$me: too many arguments$help" >&2
92301ea0f4Smrg  exit 1
93301ea0f4Smrgfi
94301ea0f4Smrg
95301ea0f4Smrgtrap 'exit 1' 1 2 15
96301ea0f4Smrg
97301ea0f4Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
98301ea0f4Smrg# compiler to aid in system detection is discouraged as it requires
99301ea0f4Smrg# temporary files to be created and, as you can see below, it is a
100301ea0f4Smrg# headache to deal with in a portable fashion.
101301ea0f4Smrg
102301ea0f4Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
103301ea0f4Smrg# use `HOST_CC' if defined, but it is deprecated.
104301ea0f4Smrg
105301ea0f4Smrg# Portable tmp directory creation inspired by the Autoconf team.
106301ea0f4Smrg
107301ea0f4Smrgset_cc_for_build='
108301ea0f4Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
109301ea0f4Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
110301ea0f4Smrg: ${TMPDIR=/tmp} ;
1110cc67336Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
112301ea0f4Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
113301ea0f4Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
114301ea0f4Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
115301ea0f4Smrgdummy=$tmp/dummy ;
116301ea0f4Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
117301ea0f4Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
118301ea0f4Smrg ,,)    echo "int x;" > $dummy.c ;
119301ea0f4Smrg	for c in cc gcc c89 c99 ; do
120301ea0f4Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
121301ea0f4Smrg	     CC_FOR_BUILD="$c"; break ;
122301ea0f4Smrg	  fi ;
123301ea0f4Smrg	done ;
124301ea0f4Smrg	if test x"$CC_FOR_BUILD" = x ; then
125301ea0f4Smrg	  CC_FOR_BUILD=no_compiler_found ;
126301ea0f4Smrg	fi
127301ea0f4Smrg	;;
128301ea0f4Smrg ,,*)   CC_FOR_BUILD=$CC ;;
129301ea0f4Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1300cc67336Smrgesac ; set_cc_for_build= ;'
131301ea0f4Smrg
132301ea0f4Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
133301ea0f4Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
134301ea0f4Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
135301ea0f4Smrg	PATH=$PATH:/.attbin ; export PATH
136301ea0f4Smrgfi
137301ea0f4Smrg
138301ea0f4SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
139301ea0f4SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
140301ea0f4SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
141301ea0f4SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
142301ea0f4Smrg
143301ea0f4Smrg# Note: order is significant - the case branches are not exclusive.
144301ea0f4Smrg
145301ea0f4Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
146301ea0f4Smrg    *:NetBSD:*:*)
147301ea0f4Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
148213fdd94Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
149301ea0f4Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
150301ea0f4Smrg	# switched to ELF, *-*-netbsd* would select the old
151301ea0f4Smrg	# object file format.  This provides both forward
152301ea0f4Smrg	# compatibility and a consistent mechanism for selecting the
153301ea0f4Smrg	# object file format.
154301ea0f4Smrg	#
155301ea0f4Smrg	# Note: NetBSD doesn't particularly care about the vendor
156301ea0f4Smrg	# portion of the name.  We always set it to "unknown".
157301ea0f4Smrg	sysctl="sysctl -n hw.machine_arch"
158301ea0f4Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
159301ea0f4Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
160301ea0f4Smrg	case "${UNAME_MACHINE_ARCH}" in
161301ea0f4Smrg	    armeb) machine=armeb-unknown ;;
162301ea0f4Smrg	    arm*) machine=arm-unknown ;;
163301ea0f4Smrg	    sh3el) machine=shl-unknown ;;
164301ea0f4Smrg	    sh3eb) machine=sh-unknown ;;
1650cc67336Smrg	    sh5el) machine=sh5le-unknown ;;
166301ea0f4Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
167301ea0f4Smrg	esac
168301ea0f4Smrg	# The Operating System including object format, if it has switched
169301ea0f4Smrg	# to ELF recently, or will in the future.
170301ea0f4Smrg	case "${UNAME_MACHINE_ARCH}" in
171301ea0f4Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
172301ea0f4Smrg		eval $set_cc_for_build
173301ea0f4Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
174213fdd94Smrg			| grep -q __ELF__
175301ea0f4Smrg		then
176301ea0f4Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
177301ea0f4Smrg		    # Return netbsd for either.  FIX?
178301ea0f4Smrg		    os=netbsd
179301ea0f4Smrg		else
180301ea0f4Smrg		    os=netbsdelf
181301ea0f4Smrg		fi
182301ea0f4Smrg		;;
183301ea0f4Smrg	    *)
184213fdd94Smrg		os=netbsd
185301ea0f4Smrg		;;
186301ea0f4Smrg	esac
187301ea0f4Smrg	# The OS release
188301ea0f4Smrg	# Debian GNU/NetBSD machines have a different userland, and
189301ea0f4Smrg	# thus, need a distinct triplet. However, they do not need
190301ea0f4Smrg	# kernel version information, so it can be replaced with a
191301ea0f4Smrg	# suitable tag, in the style of linux-gnu.
192301ea0f4Smrg	case "${UNAME_VERSION}" in
193301ea0f4Smrg	    Debian*)
194301ea0f4Smrg		release='-gnu'
195301ea0f4Smrg		;;
196301ea0f4Smrg	    *)
197301ea0f4Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
198301ea0f4Smrg		;;
199301ea0f4Smrg	esac
200301ea0f4Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
201301ea0f4Smrg	# contains redundant information, the shorter form:
202301ea0f4Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
203301ea0f4Smrg	echo "${machine}-${os}${release}"
2040cc67336Smrg	exit ;;
205301ea0f4Smrg    *:OpenBSD:*:*)
2060cc67336Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
2070cc67336Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
2080cc67336Smrg	exit ;;
2090cc67336Smrg    *:ekkoBSD:*:*)
2100cc67336Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
2110cc67336Smrg	exit ;;
2120cc67336Smrg    *:SolidBSD:*:*)
2130cc67336Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
2140cc67336Smrg	exit ;;
2150cc67336Smrg    macppc:MirBSD:*:*)
2160cc67336Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
2170cc67336Smrg	exit ;;
2180cc67336Smrg    *:MirBSD:*:*)
2190cc67336Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
2200cc67336Smrg	exit ;;
221301ea0f4Smrg    alpha:OSF1:*:*)
2220cc67336Smrg	case $UNAME_RELEASE in
2230cc67336Smrg	*4.0)
224301ea0f4Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2250cc67336Smrg		;;
2260cc67336Smrg	*5.*)
227213fdd94Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2280cc67336Smrg		;;
2290cc67336Smrg	esac
230301ea0f4Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
231301ea0f4Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
232301ea0f4Smrg	# covers most systems running today.  This code pipes the CPU
233301ea0f4Smrg	# types through head -n 1, so we only detect the type of CPU 0.
234301ea0f4Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
235301ea0f4Smrg	case "$ALPHA_CPU_TYPE" in
236301ea0f4Smrg	    "EV4 (21064)")
237301ea0f4Smrg		UNAME_MACHINE="alpha" ;;
238301ea0f4Smrg	    "EV4.5 (21064)")
239301ea0f4Smrg		UNAME_MACHINE="alpha" ;;
240301ea0f4Smrg	    "LCA4 (21066/21068)")
241301ea0f4Smrg		UNAME_MACHINE="alpha" ;;
242301ea0f4Smrg	    "EV5 (21164)")
243301ea0f4Smrg		UNAME_MACHINE="alphaev5" ;;
244301ea0f4Smrg	    "EV5.6 (21164A)")
245301ea0f4Smrg		UNAME_MACHINE="alphaev56" ;;
246301ea0f4Smrg	    "EV5.6 (21164PC)")
247301ea0f4Smrg		UNAME_MACHINE="alphapca56" ;;
248301ea0f4Smrg	    "EV5.7 (21164PC)")
249301ea0f4Smrg		UNAME_MACHINE="alphapca57" ;;
250301ea0f4Smrg	    "EV6 (21264)")
251301ea0f4Smrg		UNAME_MACHINE="alphaev6" ;;
252301ea0f4Smrg	    "EV6.7 (21264A)")
253301ea0f4Smrg		UNAME_MACHINE="alphaev67" ;;
254301ea0f4Smrg	    "EV6.8CB (21264C)")
255301ea0f4Smrg		UNAME_MACHINE="alphaev68" ;;
256301ea0f4Smrg	    "EV6.8AL (21264B)")
257301ea0f4Smrg		UNAME_MACHINE="alphaev68" ;;
258301ea0f4Smrg	    "EV6.8CX (21264D)")
259301ea0f4Smrg		UNAME_MACHINE="alphaev68" ;;
260301ea0f4Smrg	    "EV6.9A (21264/EV69A)")
261301ea0f4Smrg		UNAME_MACHINE="alphaev69" ;;
262301ea0f4Smrg	    "EV7 (21364)")
263301ea0f4Smrg		UNAME_MACHINE="alphaev7" ;;
264301ea0f4Smrg	    "EV7.9 (21364A)")
265301ea0f4Smrg		UNAME_MACHINE="alphaev79" ;;
266301ea0f4Smrg	esac
2670cc67336Smrg	# A Pn.n version is a patched version.
268301ea0f4Smrg	# A Vn.n version is a released version.
269301ea0f4Smrg	# A Tn.n version is a released field test version.
270301ea0f4Smrg	# A Xn.n version is an unreleased experimental baselevel.
271301ea0f4Smrg	# 1.2 uses "1.2" for uname -r.
2720cc67336Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
273213fdd94Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
274213fdd94Smrg	exitcode=$?
275213fdd94Smrg	trap '' 0
276213fdd94Smrg	exit $exitcode ;;
277301ea0f4Smrg    Alpha\ *:Windows_NT*:*)
278301ea0f4Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
279301ea0f4Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
280301ea0f4Smrg	# of the specific Alpha model?
281301ea0f4Smrg	echo alpha-pc-interix
2820cc67336Smrg	exit ;;
283301ea0f4Smrg    21064:Windows_NT:50:3)
284301ea0f4Smrg	echo alpha-dec-winnt3.5
2850cc67336Smrg	exit ;;
286301ea0f4Smrg    Amiga*:UNIX_System_V:4.0:*)
287301ea0f4Smrg	echo m68k-unknown-sysv4
2880cc67336Smrg	exit ;;
289301ea0f4Smrg    *:[Aa]miga[Oo][Ss]:*:*)
290301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
2910cc67336Smrg	exit ;;
292301ea0f4Smrg    *:[Mm]orph[Oo][Ss]:*:*)
293301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-morphos
2940cc67336Smrg	exit ;;
295301ea0f4Smrg    *:OS/390:*:*)
296301ea0f4Smrg	echo i370-ibm-openedition
2970cc67336Smrg	exit ;;
2980cc67336Smrg    *:z/VM:*:*)
2990cc67336Smrg	echo s390-ibm-zvmoe
3000cc67336Smrg	exit ;;
3010cc67336Smrg    *:OS400:*:*)
302213fdd94Smrg	echo powerpc-ibm-os400
3030cc67336Smrg	exit ;;
304301ea0f4Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
305301ea0f4Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
3060cc67336Smrg	exit ;;
3070cc67336Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
3080cc67336Smrg	echo arm-unknown-riscos
3090cc67336Smrg	exit ;;
310301ea0f4Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
311301ea0f4Smrg	echo hppa1.1-hitachi-hiuxmpp
3120cc67336Smrg	exit ;;
313301ea0f4Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
314301ea0f4Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
315301ea0f4Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
316301ea0f4Smrg		echo pyramid-pyramid-sysv3
317301ea0f4Smrg	else
318301ea0f4Smrg		echo pyramid-pyramid-bsd
319301ea0f4Smrg	fi
3200cc67336Smrg	exit ;;
321301ea0f4Smrg    NILE*:*:*:dcosx)
322301ea0f4Smrg	echo pyramid-pyramid-svr4
3230cc67336Smrg	exit ;;
324301ea0f4Smrg    DRS?6000:unix:4.0:6*)
325301ea0f4Smrg	echo sparc-icl-nx6
3260cc67336Smrg	exit ;;
3270cc67336Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
328301ea0f4Smrg	case `/usr/bin/uname -p` in
3290cc67336Smrg	    sparc) echo sparc-icl-nx7; exit ;;
330301ea0f4Smrg	esac ;;
331213fdd94Smrg    s390x:SunOS:*:*)
332213fdd94Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
333213fdd94Smrg	exit ;;
334301ea0f4Smrg    sun4H:SunOS:5.*:*)
335301ea0f4Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3360cc67336Smrg	exit ;;
337301ea0f4Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
338301ea0f4Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3390cc67336Smrg	exit ;;
340213fdd94Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
341213fdd94Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
342213fdd94Smrg	exit ;;
3430cc67336Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
344213fdd94Smrg	eval $set_cc_for_build
345213fdd94Smrg	SUN_ARCH="i386"
346213fdd94Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
347213fdd94Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
348213fdd94Smrg	# This test works for both compilers.
349213fdd94Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
350213fdd94Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
351213fdd94Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
352213fdd94Smrg		grep IS_64BIT_ARCH >/dev/null
353213fdd94Smrg	    then
354213fdd94Smrg		SUN_ARCH="x86_64"
355213fdd94Smrg	    fi
356213fdd94Smrg	fi
357213fdd94Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3580cc67336Smrg	exit ;;
359301ea0f4Smrg    sun4*:SunOS:6*:*)
360301ea0f4Smrg	# According to config.sub, this is the proper way to canonicalize
361301ea0f4Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
362301ea0f4Smrg	# it's likely to be more like Solaris than SunOS4.
363301ea0f4Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
3640cc67336Smrg	exit ;;
365301ea0f4Smrg    sun4*:SunOS:*:*)
366301ea0f4Smrg	case "`/usr/bin/arch -k`" in
367301ea0f4Smrg	    Series*|S4*)
368301ea0f4Smrg		UNAME_RELEASE=`uname -v`
369301ea0f4Smrg		;;
370301ea0f4Smrg	esac
371301ea0f4Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
372301ea0f4Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
3730cc67336Smrg	exit ;;
374301ea0f4Smrg    sun3*:SunOS:*:*)
375301ea0f4Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
3760cc67336Smrg	exit ;;
377301ea0f4Smrg    sun*:*:4.2BSD:*)
378301ea0f4Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
379301ea0f4Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
380301ea0f4Smrg	case "`/bin/arch`" in
381301ea0f4Smrg	    sun3)
382301ea0f4Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
383301ea0f4Smrg		;;
384301ea0f4Smrg	    sun4)
385301ea0f4Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
386301ea0f4Smrg		;;
387301ea0f4Smrg	esac
3880cc67336Smrg	exit ;;
389301ea0f4Smrg    aushp:SunOS:*:*)
390301ea0f4Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
3910cc67336Smrg	exit ;;
392301ea0f4Smrg    # The situation for MiNT is a little confusing.  The machine name
393301ea0f4Smrg    # can be virtually everything (everything which is not
394301ea0f4Smrg    # "atarist" or "atariste" at least should have a processor
395301ea0f4Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
396301ea0f4Smrg    # to the lowercase version "mint" (or "freemint").  Finally
397301ea0f4Smrg    # the system name "TOS" denotes a system which is actually not
398301ea0f4Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
399301ea0f4Smrg    # be no problem.
400301ea0f4Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
401213fdd94Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4020cc67336Smrg	exit ;;
403301ea0f4Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
404301ea0f4Smrg	echo m68k-atari-mint${UNAME_RELEASE}
405213fdd94Smrg	exit ;;
406301ea0f4Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
407213fdd94Smrg	echo m68k-atari-mint${UNAME_RELEASE}
4080cc67336Smrg	exit ;;
409301ea0f4Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
410213fdd94Smrg	echo m68k-milan-mint${UNAME_RELEASE}
411213fdd94Smrg	exit ;;
412301ea0f4Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
413213fdd94Smrg	echo m68k-hades-mint${UNAME_RELEASE}
414213fdd94Smrg	exit ;;
415301ea0f4Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
416213fdd94Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
417213fdd94Smrg	exit ;;
4180cc67336Smrg    m68k:machten:*:*)
4190cc67336Smrg	echo m68k-apple-machten${UNAME_RELEASE}
4200cc67336Smrg	exit ;;
421301ea0f4Smrg    powerpc:machten:*:*)
422301ea0f4Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
4230cc67336Smrg	exit ;;
424301ea0f4Smrg    RISC*:Mach:*:*)
425301ea0f4Smrg	echo mips-dec-mach_bsd4.3
4260cc67336Smrg	exit ;;
427301ea0f4Smrg    RISC*:ULTRIX:*:*)
428301ea0f4Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
4290cc67336Smrg	exit ;;
430301ea0f4Smrg    VAX*:ULTRIX*:*:*)
431301ea0f4Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
4320cc67336Smrg	exit ;;
433301ea0f4Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
434301ea0f4Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
4350cc67336Smrg	exit ;;
436301ea0f4Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
437301ea0f4Smrg	eval $set_cc_for_build
438301ea0f4Smrg	sed 's/^	//' << EOF >$dummy.c
439301ea0f4Smrg#ifdef __cplusplus
440301ea0f4Smrg#include <stdio.h>  /* for printf() prototype */
441301ea0f4Smrg	int main (int argc, char *argv[]) {
442301ea0f4Smrg#else
443301ea0f4Smrg	int main (argc, argv) int argc; char *argv[]; {
444301ea0f4Smrg#endif
445301ea0f4Smrg	#if defined (host_mips) && defined (MIPSEB)
446301ea0f4Smrg	#if defined (SYSTYPE_SYSV)
447301ea0f4Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
448301ea0f4Smrg	#endif
449301ea0f4Smrg	#if defined (SYSTYPE_SVR4)
450301ea0f4Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
451301ea0f4Smrg	#endif
452301ea0f4Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
453301ea0f4Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
454301ea0f4Smrg	#endif
455301ea0f4Smrg	#endif
456301ea0f4Smrg	  exit (-1);
457301ea0f4Smrg	}
458301ea0f4SmrgEOF
4590cc67336Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
4600cc67336Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
4610cc67336Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
4620cc67336Smrg	    { echo "$SYSTEM_NAME"; exit; }
463301ea0f4Smrg	echo mips-mips-riscos${UNAME_RELEASE}
4640cc67336Smrg	exit ;;
465301ea0f4Smrg    Motorola:PowerMAX_OS:*:*)
466301ea0f4Smrg	echo powerpc-motorola-powermax
4670cc67336Smrg	exit ;;
468301ea0f4Smrg    Motorola:*:4.3:PL8-*)
469301ea0f4Smrg	echo powerpc-harris-powermax
4700cc67336Smrg	exit ;;
471301ea0f4Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
472301ea0f4Smrg	echo powerpc-harris-powermax
4730cc67336Smrg	exit ;;
474301ea0f4Smrg    Night_Hawk:Power_UNIX:*:*)
475301ea0f4Smrg	echo powerpc-harris-powerunix
4760cc67336Smrg	exit ;;
477301ea0f4Smrg    m88k:CX/UX:7*:*)
478301ea0f4Smrg	echo m88k-harris-cxux7
4790cc67336Smrg	exit ;;
480301ea0f4Smrg    m88k:*:4*:R4*)
481301ea0f4Smrg	echo m88k-motorola-sysv4
4820cc67336Smrg	exit ;;
483301ea0f4Smrg    m88k:*:3*:R3*)
484301ea0f4Smrg	echo m88k-motorola-sysv3
4850cc67336Smrg	exit ;;
486301ea0f4Smrg    AViiON:dgux:*:*)
487213fdd94Smrg	# DG/UX returns AViiON for all architectures
488213fdd94Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
489301ea0f4Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
490301ea0f4Smrg	then
491301ea0f4Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
492301ea0f4Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
493301ea0f4Smrg	    then
494301ea0f4Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
495301ea0f4Smrg	    else
496301ea0f4Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
497301ea0f4Smrg	    fi
498301ea0f4Smrg	else
499301ea0f4Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
500301ea0f4Smrg	fi
501213fdd94Smrg	exit ;;
502301ea0f4Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
503301ea0f4Smrg	echo m88k-dolphin-sysv3
5040cc67336Smrg	exit ;;
505301ea0f4Smrg    M88*:*:R3*:*)
506301ea0f4Smrg	# Delta 88k system running SVR3
507301ea0f4Smrg	echo m88k-motorola-sysv3
5080cc67336Smrg	exit ;;
509301ea0f4Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
510301ea0f4Smrg	echo m88k-tektronix-sysv3
5110cc67336Smrg	exit ;;
512301ea0f4Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
513301ea0f4Smrg	echo m68k-tektronix-bsd
5140cc67336Smrg	exit ;;
515301ea0f4Smrg    *:IRIX*:*:*)
516301ea0f4Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
5170cc67336Smrg	exit ;;
518301ea0f4Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5190cc67336Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5200cc67336Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
521301ea0f4Smrg    i*86:AIX:*:*)
522301ea0f4Smrg	echo i386-ibm-aix
5230cc67336Smrg	exit ;;
524301ea0f4Smrg    ia64:AIX:*:*)
525301ea0f4Smrg	if [ -x /usr/bin/oslevel ] ; then
526301ea0f4Smrg		IBM_REV=`/usr/bin/oslevel`
527301ea0f4Smrg	else
528301ea0f4Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
529301ea0f4Smrg	fi
530301ea0f4Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
5310cc67336Smrg	exit ;;
532301ea0f4Smrg    *:AIX:2:3)
533301ea0f4Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
534301ea0f4Smrg		eval $set_cc_for_build
535301ea0f4Smrg		sed 's/^		//' << EOF >$dummy.c
536301ea0f4Smrg		#include <sys/systemcfg.h>
537301ea0f4Smrg
538301ea0f4Smrg		main()
539301ea0f4Smrg			{
540301ea0f4Smrg			if (!__power_pc())
541301ea0f4Smrg				exit(1);
542301ea0f4Smrg			puts("powerpc-ibm-aix3.2.5");
543301ea0f4Smrg			exit(0);
544301ea0f4Smrg			}
545301ea0f4SmrgEOF
5460cc67336Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
5470cc67336Smrg		then
5480cc67336Smrg			echo "$SYSTEM_NAME"
5490cc67336Smrg		else
5500cc67336Smrg			echo rs6000-ibm-aix3.2.5
5510cc67336Smrg		fi
552301ea0f4Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
553301ea0f4Smrg		echo rs6000-ibm-aix3.2.4
554301ea0f4Smrg	else
555301ea0f4Smrg		echo rs6000-ibm-aix3.2
556301ea0f4Smrg	fi
5570cc67336Smrg	exit ;;
558213fdd94Smrg    *:AIX:*:[4567])
559301ea0f4Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
560301ea0f4Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
561301ea0f4Smrg		IBM_ARCH=rs6000
562301ea0f4Smrg	else
563301ea0f4Smrg		IBM_ARCH=powerpc
564301ea0f4Smrg	fi
565301ea0f4Smrg	if [ -x /usr/bin/oslevel ] ; then
566301ea0f4Smrg		IBM_REV=`/usr/bin/oslevel`
567301ea0f4Smrg	else
568301ea0f4Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
569301ea0f4Smrg	fi
570301ea0f4Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
5710cc67336Smrg	exit ;;
572301ea0f4Smrg    *:AIX:*:*)
573301ea0f4Smrg	echo rs6000-ibm-aix
5740cc67336Smrg	exit ;;
575301ea0f4Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
576301ea0f4Smrg	echo romp-ibm-bsd4.4
5770cc67336Smrg	exit ;;
578301ea0f4Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
579301ea0f4Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
5800cc67336Smrg	exit ;;                             # report: romp-ibm BSD 4.3
581301ea0f4Smrg    *:BOSX:*:*)
582301ea0f4Smrg	echo rs6000-bull-bosx
5830cc67336Smrg	exit ;;
584301ea0f4Smrg    DPX/2?00:B.O.S.:*:*)
585301ea0f4Smrg	echo m68k-bull-sysv3
5860cc67336Smrg	exit ;;
587301ea0f4Smrg    9000/[34]??:4.3bsd:1.*:*)
588301ea0f4Smrg	echo m68k-hp-bsd
5890cc67336Smrg	exit ;;
590301ea0f4Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
591301ea0f4Smrg	echo m68k-hp-bsd4.4
5920cc67336Smrg	exit ;;
593301ea0f4Smrg    9000/[34678]??:HP-UX:*:*)
594301ea0f4Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
595301ea0f4Smrg	case "${UNAME_MACHINE}" in
596301ea0f4Smrg	    9000/31? )            HP_ARCH=m68000 ;;
597301ea0f4Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
598301ea0f4Smrg	    9000/[678][0-9][0-9])
599301ea0f4Smrg		if [ -x /usr/bin/getconf ]; then
600301ea0f4Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
601213fdd94Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
602213fdd94Smrg		    case "${sc_cpu_version}" in
603213fdd94Smrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
604213fdd94Smrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
605213fdd94Smrg		      532)                      # CPU_PA_RISC2_0
606213fdd94Smrg			case "${sc_kernel_bits}" in
607213fdd94Smrg			  32) HP_ARCH="hppa2.0n" ;;
608213fdd94Smrg			  64) HP_ARCH="hppa2.0w" ;;
609301ea0f4Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
610213fdd94Smrg			esac ;;
611213fdd94Smrg		    esac
612301ea0f4Smrg		fi
613301ea0f4Smrg		if [ "${HP_ARCH}" = "" ]; then
614301ea0f4Smrg		    eval $set_cc_for_build
615213fdd94Smrg		    sed 's/^		//' << EOF >$dummy.c
616301ea0f4Smrg
617213fdd94Smrg		#define _HPUX_SOURCE
618213fdd94Smrg		#include <stdlib.h>
619213fdd94Smrg		#include <unistd.h>
620301ea0f4Smrg
621213fdd94Smrg		int main ()
622213fdd94Smrg		{
623213fdd94Smrg		#if defined(_SC_KERNEL_BITS)
624213fdd94Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
625213fdd94Smrg		#endif
626213fdd94Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
627301ea0f4Smrg
628213fdd94Smrg		    switch (cpu)
629213fdd94Smrg			{
630213fdd94Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
631213fdd94Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
632213fdd94Smrg			case CPU_PA_RISC2_0:
633213fdd94Smrg		#if defined(_SC_KERNEL_BITS)
634213fdd94Smrg			    switch (bits)
635213fdd94Smrg				{
636213fdd94Smrg				case 64: puts ("hppa2.0w"); break;
637213fdd94Smrg				case 32: puts ("hppa2.0n"); break;
638213fdd94Smrg				default: puts ("hppa2.0"); break;
639213fdd94Smrg				} break;
640213fdd94Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
641213fdd94Smrg			    puts ("hppa2.0"); break;
642213fdd94Smrg		#endif
643213fdd94Smrg			default: puts ("hppa1.0"); break;
644213fdd94Smrg			}
645213fdd94Smrg		    exit (0);
646213fdd94Smrg		}
647301ea0f4SmrgEOF
648301ea0f4Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
649301ea0f4Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
650301ea0f4Smrg		fi ;;
651301ea0f4Smrg	esac
652301ea0f4Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
653301ea0f4Smrg	then
6540cc67336Smrg	    eval $set_cc_for_build
6550cc67336Smrg
6560cc67336Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
6570cc67336Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
6580cc67336Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
6590cc67336Smrg	    #
6600cc67336Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
6610cc67336Smrg	    # => hppa2.0w-hp-hpux11.23
6620cc67336Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
6630cc67336Smrg	    # => hppa64-hp-hpux11.23
6640cc67336Smrg
6650cc67336Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
666213fdd94Smrg		grep -q __LP64__
667301ea0f4Smrg	    then
668301ea0f4Smrg		HP_ARCH="hppa2.0w"
669301ea0f4Smrg	    else
670301ea0f4Smrg		HP_ARCH="hppa64"
671301ea0f4Smrg	    fi
672301ea0f4Smrg	fi
673301ea0f4Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
6740cc67336Smrg	exit ;;
675301ea0f4Smrg    ia64:HP-UX:*:*)
676301ea0f4Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
677301ea0f4Smrg	echo ia64-hp-hpux${HPUX_REV}
6780cc67336Smrg	exit ;;
679301ea0f4Smrg    3050*:HI-UX:*:*)
680301ea0f4Smrg	eval $set_cc_for_build
681301ea0f4Smrg	sed 's/^	//' << EOF >$dummy.c
682301ea0f4Smrg	#include <unistd.h>
683301ea0f4Smrg	int
684301ea0f4Smrg	main ()
685301ea0f4Smrg	{
686301ea0f4Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
687301ea0f4Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
688301ea0f4Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
689301ea0f4Smrg	     results, however.  */
690301ea0f4Smrg	  if (CPU_IS_PA_RISC (cpu))
691301ea0f4Smrg	    {
692301ea0f4Smrg	      switch (cpu)
693301ea0f4Smrg		{
694301ea0f4Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
695301ea0f4Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
696301ea0f4Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
697301ea0f4Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
698301ea0f4Smrg		}
699301ea0f4Smrg	    }
700301ea0f4Smrg	  else if (CPU_IS_HP_MC68K (cpu))
701301ea0f4Smrg	    puts ("m68k-hitachi-hiuxwe2");
702301ea0f4Smrg	  else puts ("unknown-hitachi-hiuxwe2");
703301ea0f4Smrg	  exit (0);
704301ea0f4Smrg	}
705301ea0f4SmrgEOF
7060cc67336Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
7070cc67336Smrg		{ echo "$SYSTEM_NAME"; exit; }
708301ea0f4Smrg	echo unknown-hitachi-hiuxwe2
7090cc67336Smrg	exit ;;
710301ea0f4Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
711301ea0f4Smrg	echo hppa1.1-hp-bsd
7120cc67336Smrg	exit ;;
713301ea0f4Smrg    9000/8??:4.3bsd:*:*)
714301ea0f4Smrg	echo hppa1.0-hp-bsd
7150cc67336Smrg	exit ;;
716301ea0f4Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
717301ea0f4Smrg	echo hppa1.0-hp-mpeix
7180cc67336Smrg	exit ;;
719301ea0f4Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
720301ea0f4Smrg	echo hppa1.1-hp-osf
7210cc67336Smrg	exit ;;
722301ea0f4Smrg    hp8??:OSF1:*:*)
723301ea0f4Smrg	echo hppa1.0-hp-osf
7240cc67336Smrg	exit ;;
725301ea0f4Smrg    i*86:OSF1:*:*)
726301ea0f4Smrg	if [ -x /usr/sbin/sysversion ] ; then
727301ea0f4Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
728301ea0f4Smrg	else
729301ea0f4Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
730301ea0f4Smrg	fi
7310cc67336Smrg	exit ;;
732301ea0f4Smrg    parisc*:Lites*:*:*)
733301ea0f4Smrg	echo hppa1.1-hp-lites
7340cc67336Smrg	exit ;;
735301ea0f4Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
736301ea0f4Smrg	echo c1-convex-bsd
737213fdd94Smrg	exit ;;
738301ea0f4Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
739301ea0f4Smrg	if getsysinfo -f scalar_acc
740301ea0f4Smrg	then echo c32-convex-bsd
741301ea0f4Smrg	else echo c2-convex-bsd
742301ea0f4Smrg	fi
743213fdd94Smrg	exit ;;
744301ea0f4Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
745301ea0f4Smrg	echo c34-convex-bsd
746213fdd94Smrg	exit ;;
747301ea0f4Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
748301ea0f4Smrg	echo c38-convex-bsd
749213fdd94Smrg	exit ;;
750301ea0f4Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
751301ea0f4Smrg	echo c4-convex-bsd
752213fdd94Smrg	exit ;;
753301ea0f4Smrg    CRAY*Y-MP:*:*:*)
754301ea0f4Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7550cc67336Smrg	exit ;;
756301ea0f4Smrg    CRAY*[A-Z]90:*:*:*)
757301ea0f4Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
758301ea0f4Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
759301ea0f4Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
760301ea0f4Smrg	      -e 's/\.[^.]*$/.X/'
7610cc67336Smrg	exit ;;
762301ea0f4Smrg    CRAY*TS:*:*:*)
763301ea0f4Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7640cc67336Smrg	exit ;;
765301ea0f4Smrg    CRAY*T3E:*:*:*)
766301ea0f4Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7670cc67336Smrg	exit ;;
768301ea0f4Smrg    CRAY*SV1:*:*:*)
769301ea0f4Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7700cc67336Smrg	exit ;;
771301ea0f4Smrg    *:UNICOS/mp:*:*)
7720cc67336Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
7730cc67336Smrg	exit ;;
774301ea0f4Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
775301ea0f4Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
776213fdd94Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
777213fdd94Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
778213fdd94Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
779213fdd94Smrg	exit ;;
7800cc67336Smrg    5000:UNIX_System_V:4.*:*)
781213fdd94Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
782213fdd94Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
783213fdd94Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
7840cc67336Smrg	exit ;;
785301ea0f4Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
786301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
7870cc67336Smrg	exit ;;
788301ea0f4Smrg    sparc*:BSD/OS:*:*)
789301ea0f4Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
7900cc67336Smrg	exit ;;
791301ea0f4Smrg    *:BSD/OS:*:*)
792301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
7930cc67336Smrg	exit ;;
7940cc67336Smrg    *:FreeBSD:*:*)
795213fdd94Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
796213fdd94Smrg	case ${UNAME_PROCESSOR} in
7970cc67336Smrg	    amd64)
7980cc67336Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
7990cc67336Smrg	    *)
800213fdd94Smrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
8010cc67336Smrg	esac
8020cc67336Smrg	exit ;;
803301ea0f4Smrg    i*:CYGWIN*:*)
804301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-cygwin
8050cc67336Smrg	exit ;;
8060cc67336Smrg    *:MINGW*:*)
807301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-mingw32
8080cc67336Smrg	exit ;;
809213fdd94Smrg    i*:MSYS*:*)
810213fdd94Smrg	echo ${UNAME_MACHINE}-pc-msys
811213fdd94Smrg	exit ;;
8120cc67336Smrg    i*:windows32*:*)
813213fdd94Smrg	# uname -m includes "-pc" on this system.
814213fdd94Smrg	echo ${UNAME_MACHINE}-mingw32
8150cc67336Smrg	exit ;;
816301ea0f4Smrg    i*:PW*:*)
817301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-pw32
8180cc67336Smrg	exit ;;
819213fdd94Smrg    *:Interix*:*)
820213fdd94Smrg	case ${UNAME_MACHINE} in
8210cc67336Smrg	    x86)
8220cc67336Smrg		echo i586-pc-interix${UNAME_RELEASE}
8230cc67336Smrg		exit ;;
824213fdd94Smrg	    authenticamd | genuineintel | EM64T)
8250cc67336Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8260cc67336Smrg		exit ;;
8270cc67336Smrg	    IA64)
8280cc67336Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8290cc67336Smrg		exit ;;
8300cc67336Smrg	esac ;;
831301ea0f4Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
832301ea0f4Smrg	echo i${UNAME_MACHINE}-pc-mks
8330cc67336Smrg	exit ;;
834213fdd94Smrg    8664:Windows_NT:*)
835213fdd94Smrg	echo x86_64-pc-mks
836213fdd94Smrg	exit ;;
837301ea0f4Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
838301ea0f4Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
839301ea0f4Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
840301ea0f4Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
841301ea0f4Smrg	echo i586-pc-interix
8420cc67336Smrg	exit ;;
843301ea0f4Smrg    i*:UWIN*:*)
844301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-uwin
8450cc67336Smrg	exit ;;
8460cc67336Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8470cc67336Smrg	echo x86_64-unknown-cygwin
8480cc67336Smrg	exit ;;
849301ea0f4Smrg    p*:CYGWIN*:*)
850301ea0f4Smrg	echo powerpcle-unknown-cygwin
8510cc67336Smrg	exit ;;
852301ea0f4Smrg    prep*:SunOS:5.*:*)
853301ea0f4Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
8540cc67336Smrg	exit ;;
855301ea0f4Smrg    *:GNU:*:*)
8560cc67336Smrg	# the GNU system
857301ea0f4Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
8580cc67336Smrg	exit ;;
8590cc67336Smrg    *:GNU/*:*:*)
8600cc67336Smrg	# other systems with GNU libc and userland
8610cc67336Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
8620cc67336Smrg	exit ;;
863301ea0f4Smrg    i*86:Minix:*:*)
864301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-minix
8650cc67336Smrg	exit ;;
866213fdd94Smrg    alpha:Linux:*:*)
867213fdd94Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
868213fdd94Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
869213fdd94Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
870213fdd94Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
871213fdd94Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
872213fdd94Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
873213fdd94Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
874213fdd94Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
875213fdd94Smrg	esac
876213fdd94Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
877213fdd94Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
878213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
879213fdd94Smrg	exit ;;
880301ea0f4Smrg    arm*:Linux:*:*)
8810cc67336Smrg	eval $set_cc_for_build
8820cc67336Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
8830cc67336Smrg	    | grep -q __ARM_EABI__
8840cc67336Smrg	then
8850cc67336Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
8860cc67336Smrg	else
887213fdd94Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
888213fdd94Smrg		| grep -q __ARM_PCS_VFP
889213fdd94Smrg	    then
890213fdd94Smrg		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
891213fdd94Smrg	    else
892213fdd94Smrg		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
893213fdd94Smrg	    fi
8940cc67336Smrg	fi
8950cc67336Smrg	exit ;;
8960cc67336Smrg    avr32*:Linux:*:*)
897301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
8980cc67336Smrg	exit ;;
899301ea0f4Smrg    cris:Linux:*:*)
900213fdd94Smrg	echo ${UNAME_MACHINE}-axis-linux-gnu
9010cc67336Smrg	exit ;;
9020cc67336Smrg    crisv32:Linux:*:*)
903213fdd94Smrg	echo ${UNAME_MACHINE}-axis-linux-gnu
9040cc67336Smrg	exit ;;
9050cc67336Smrg    frv:Linux:*:*)
906213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
907213fdd94Smrg	exit ;;
908213fdd94Smrg    hexagon:Linux:*:*)
909213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
910213fdd94Smrg	exit ;;
911213fdd94Smrg    i*86:Linux:*:*)
912213fdd94Smrg	LIBC=gnu
913213fdd94Smrg	eval $set_cc_for_build
914213fdd94Smrg	sed 's/^	//' << EOF >$dummy.c
915213fdd94Smrg	#ifdef __dietlibc__
916213fdd94Smrg	LIBC=dietlibc
917213fdd94Smrg	#endif
918213fdd94SmrgEOF
919213fdd94Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
920213fdd94Smrg	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
9210cc67336Smrg	exit ;;
922301ea0f4Smrg    ia64:Linux:*:*)
9230cc67336Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9240cc67336Smrg	exit ;;
9250cc67336Smrg    m32r*:Linux:*:*)
9260cc67336Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9270cc67336Smrg	exit ;;
928301ea0f4Smrg    m68*:Linux:*:*)
929301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9300cc67336Smrg	exit ;;
931213fdd94Smrg    mips:Linux:*:* | mips64:Linux:*:*)
932301ea0f4Smrg	eval $set_cc_for_build
933301ea0f4Smrg	sed 's/^	//' << EOF >$dummy.c
934301ea0f4Smrg	#undef CPU
935213fdd94Smrg	#undef ${UNAME_MACHINE}
936213fdd94Smrg	#undef ${UNAME_MACHINE}el
937301ea0f4Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
938213fdd94Smrg	CPU=${UNAME_MACHINE}el
939301ea0f4Smrg	#else
940301ea0f4Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
941213fdd94Smrg	CPU=${UNAME_MACHINE}
942301ea0f4Smrg	#else
943301ea0f4Smrg	CPU=
944301ea0f4Smrg	#endif
945301ea0f4Smrg	#endif
946301ea0f4SmrgEOF
947213fdd94Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
9480cc67336Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
949301ea0f4Smrg	;;
9500cc67336Smrg    or32:Linux:*:*)
951213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9520cc67336Smrg	exit ;;
953213fdd94Smrg    padre:Linux:*:*)
954213fdd94Smrg	echo sparc-unknown-linux-gnu
9550cc67336Smrg	exit ;;
956213fdd94Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
957213fdd94Smrg	echo hppa64-unknown-linux-gnu
9580cc67336Smrg	exit ;;
959301ea0f4Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
960301ea0f4Smrg	# Look for CPU level
961301ea0f4Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
962301ea0f4Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
963301ea0f4Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
964301ea0f4Smrg	  *)    echo hppa-unknown-linux-gnu ;;
965301ea0f4Smrg	esac
9660cc67336Smrg	exit ;;
967213fdd94Smrg    ppc64:Linux:*:*)
968213fdd94Smrg	echo powerpc64-unknown-linux-gnu
969213fdd94Smrg	exit ;;
970213fdd94Smrg    ppc:Linux:*:*)
971213fdd94Smrg	echo powerpc-unknown-linux-gnu
9720cc67336Smrg	exit ;;
973301ea0f4Smrg    s390:Linux:*:* | s390x:Linux:*:*)
9740cc67336Smrg	echo ${UNAME_MACHINE}-ibm-linux
9750cc67336Smrg	exit ;;
976301ea0f4Smrg    sh64*:Linux:*:*)
977213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9780cc67336Smrg	exit ;;
979301ea0f4Smrg    sh*:Linux:*:*)
980301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9810cc67336Smrg	exit ;;
982301ea0f4Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
983301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9840cc67336Smrg	exit ;;
985213fdd94Smrg    tile*:Linux:*:*)
986213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
987213fdd94Smrg	exit ;;
9880cc67336Smrg    vax:Linux:*:*)
9890cc67336Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
9900cc67336Smrg	exit ;;
991301ea0f4Smrg    x86_64:Linux:*:*)
992213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9930cc67336Smrg	exit ;;
9940cc67336Smrg    xtensa*:Linux:*:*)
995213fdd94Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
9960cc67336Smrg	exit ;;
997301ea0f4Smrg    i*86:DYNIX/ptx:4*:*)
998301ea0f4Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
999301ea0f4Smrg	# earlier versions are messed up and put the nodename in both
1000301ea0f4Smrg	# sysname and nodename.
1001301ea0f4Smrg	echo i386-sequent-sysv4
10020cc67336Smrg	exit ;;
1003301ea0f4Smrg    i*86:UNIX_SV:4.2MP:2.*)
1004213fdd94Smrg	# Unixware is an offshoot of SVR4, but it has its own version
1005213fdd94Smrg	# number series starting with 2...
1006213fdd94Smrg	# I am not positive that other SVR4 systems won't match this,
1007301ea0f4Smrg	# I just have to hope.  -- rms.
1008213fdd94Smrg	# Use sysv4.2uw... so that sysv4* matches it.
1009301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
10100cc67336Smrg	exit ;;
1011301ea0f4Smrg    i*86:OS/2:*:*)
1012301ea0f4Smrg	# If we were able to find `uname', then EMX Unix compatibility
1013301ea0f4Smrg	# is probably installed.
1014301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
10150cc67336Smrg	exit ;;
1016301ea0f4Smrg    i*86:XTS-300:*:STOP)
1017301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-stop
10180cc67336Smrg	exit ;;
1019301ea0f4Smrg    i*86:atheos:*:*)
1020301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-atheos
10210cc67336Smrg	exit ;;
10220cc67336Smrg    i*86:syllable:*:*)
10230cc67336Smrg	echo ${UNAME_MACHINE}-pc-syllable
10240cc67336Smrg	exit ;;
1025213fdd94Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1026301ea0f4Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
10270cc67336Smrg	exit ;;
1028301ea0f4Smrg    i*86:*DOS:*:*)
1029301ea0f4Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
10300cc67336Smrg	exit ;;
1031301ea0f4Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1032301ea0f4Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1033301ea0f4Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1034301ea0f4Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1035301ea0f4Smrg	else
1036301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1037301ea0f4Smrg	fi
10380cc67336Smrg	exit ;;
10390cc67336Smrg    i*86:*:5:[678]*)
1040213fdd94Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1041301ea0f4Smrg	case `/bin/uname -X | grep "^Machine"` in
1042301ea0f4Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
1043301ea0f4Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1044301ea0f4Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1045301ea0f4Smrg	esac
1046301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
10470cc67336Smrg	exit ;;
1048301ea0f4Smrg    i*86:*:3.2:*)
1049301ea0f4Smrg	if test -f /usr/options/cb.name; then
1050301ea0f4Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1051301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1052301ea0f4Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1053301ea0f4Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1054301ea0f4Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1055301ea0f4Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1056301ea0f4Smrg			&& UNAME_MACHINE=i586
1057301ea0f4Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1058301ea0f4Smrg			&& UNAME_MACHINE=i686
1059301ea0f4Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1060301ea0f4Smrg			&& UNAME_MACHINE=i686
1061301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1062301ea0f4Smrg	else
1063301ea0f4Smrg		echo ${UNAME_MACHINE}-pc-sysv32
1064301ea0f4Smrg	fi
10650cc67336Smrg	exit ;;
1066301ea0f4Smrg    pc:*:*:*)
1067301ea0f4Smrg	# Left here for compatibility:
1068213fdd94Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1069213fdd94Smrg	# the processor, so we play safe by assuming i586.
1070213fdd94Smrg	# Note: whatever this is, it MUST be the same as what config.sub
1071213fdd94Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
1072213fdd94Smrg	# this is a cross-build.
1073213fdd94Smrg	echo i586-pc-msdosdjgpp
1074213fdd94Smrg	exit ;;
1075301ea0f4Smrg    Intel:Mach:3*:*)
1076301ea0f4Smrg	echo i386-pc-mach3
10770cc67336Smrg	exit ;;
1078301ea0f4Smrg    paragon:*:*:*)
1079301ea0f4Smrg	echo i860-intel-osf1
10800cc67336Smrg	exit ;;
1081301ea0f4Smrg    i860:*:4.*:*) # i860-SVR4
1082301ea0f4Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1083301ea0f4Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1084301ea0f4Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
1085301ea0f4Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1086301ea0f4Smrg	fi
10870cc67336Smrg	exit ;;
1088301ea0f4Smrg    mini*:CTIX:SYS*5:*)
1089301ea0f4Smrg	# "miniframe"
1090301ea0f4Smrg	echo m68010-convergent-sysv
10910cc67336Smrg	exit ;;
1092301ea0f4Smrg    mc68k:UNIX:SYSTEM5:3.51m)
1093301ea0f4Smrg	echo m68k-convergent-sysv
10940cc67336Smrg	exit ;;
1095301ea0f4Smrg    M680?0:D-NIX:5.3:*)
1096301ea0f4Smrg	echo m68k-diab-dnix
10970cc67336Smrg	exit ;;
10980cc67336Smrg    M68*:*:R3V[5678]*:*)
10990cc67336Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11000cc67336Smrg    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)
1101301ea0f4Smrg	OS_REL=''
1102301ea0f4Smrg	test -r /etc/.relid \
1103301ea0f4Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1104301ea0f4Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
11050cc67336Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1106301ea0f4Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
11070cc67336Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1108301ea0f4Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1109213fdd94Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1110213fdd94Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
1111213fdd94Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1112213fdd94Smrg	OS_REL='.3'
1113213fdd94Smrg	test -r /etc/.relid \
1114213fdd94Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1115213fdd94Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1116213fdd94Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1117213fdd94Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1118213fdd94Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1119213fdd94Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1120213fdd94Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1121301ea0f4Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1122301ea0f4Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
11230cc67336Smrg	exit ;;
1124301ea0f4Smrg    mc68030:UNIX_System_V:4.*:*)
1125301ea0f4Smrg	echo m68k-atari-sysv4
11260cc67336Smrg	exit ;;
1127301ea0f4Smrg    TSUNAMI:LynxOS:2.*:*)
1128301ea0f4Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
11290cc67336Smrg	exit ;;
1130301ea0f4Smrg    rs6000:LynxOS:2.*:*)
1131301ea0f4Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
11320cc67336Smrg	exit ;;
1133213fdd94Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1134301ea0f4Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
11350cc67336Smrg	exit ;;
1136301ea0f4Smrg    SM[BE]S:UNIX_SV:*:*)
1137301ea0f4Smrg	echo mips-dde-sysv${UNAME_RELEASE}
11380cc67336Smrg	exit ;;
1139301ea0f4Smrg    RM*:ReliantUNIX-*:*:*)
1140301ea0f4Smrg	echo mips-sni-sysv4
11410cc67336Smrg	exit ;;
1142301ea0f4Smrg    RM*:SINIX-*:*:*)
1143301ea0f4Smrg	echo mips-sni-sysv4
11440cc67336Smrg	exit ;;
1145301ea0f4Smrg    *:SINIX-*:*:*)
1146301ea0f4Smrg	if uname -p 2>/dev/null >/dev/null ; then
1147301ea0f4Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1148301ea0f4Smrg		echo ${UNAME_MACHINE}-sni-sysv4
1149301ea0f4Smrg	else
1150301ea0f4Smrg		echo ns32k-sni-sysv
1151301ea0f4Smrg	fi
11520cc67336Smrg	exit ;;
1153213fdd94Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1154213fdd94Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1155213fdd94Smrg	echo i586-unisys-sysv4
1156213fdd94Smrg	exit ;;
1157301ea0f4Smrg    *:UNIX_System_V:4*:FTX*)
1158301ea0f4Smrg	# From Gerald Hewes <hewes@openmarket.com>.
1159301ea0f4Smrg	# How about differentiating between stratus architectures? -djm
1160301ea0f4Smrg	echo hppa1.1-stratus-sysv4
11610cc67336Smrg	exit ;;
1162301ea0f4Smrg    *:*:*:FTX*)
1163301ea0f4Smrg	# From seanf@swdc.stratus.com.
1164301ea0f4Smrg	echo i860-stratus-sysv4
11650cc67336Smrg	exit ;;
11660cc67336Smrg    i*86:VOS:*:*)
11670cc67336Smrg	# From Paul.Green@stratus.com.
11680cc67336Smrg	echo ${UNAME_MACHINE}-stratus-vos
11690cc67336Smrg	exit ;;
1170301ea0f4Smrg    *:VOS:*:*)
1171301ea0f4Smrg	# From Paul.Green@stratus.com.
1172301ea0f4Smrg	echo hppa1.1-stratus-vos
11730cc67336Smrg	exit ;;
1174301ea0f4Smrg    mc68*:A/UX:*:*)
1175301ea0f4Smrg	echo m68k-apple-aux${UNAME_RELEASE}
11760cc67336Smrg	exit ;;
1177301ea0f4Smrg    news*:NEWS-OS:6*:*)
1178301ea0f4Smrg	echo mips-sony-newsos6
11790cc67336Smrg	exit ;;
1180301ea0f4Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1181301ea0f4Smrg	if [ -d /usr/nec ]; then
1182213fdd94Smrg		echo mips-nec-sysv${UNAME_RELEASE}
1183301ea0f4Smrg	else
1184213fdd94Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
1185301ea0f4Smrg	fi
1186213fdd94Smrg	exit ;;
1187301ea0f4Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1188301ea0f4Smrg	echo powerpc-be-beos
11890cc67336Smrg	exit ;;
1190301ea0f4Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1191301ea0f4Smrg	echo powerpc-apple-beos
11920cc67336Smrg	exit ;;
1193301ea0f4Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1194301ea0f4Smrg	echo i586-pc-beos
11950cc67336Smrg	exit ;;
1196213fdd94Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1197213fdd94Smrg	echo i586-pc-haiku
1198213fdd94Smrg	exit ;;
1199301ea0f4Smrg    SX-4:SUPER-UX:*:*)
1200301ea0f4Smrg	echo sx4-nec-superux${UNAME_RELEASE}
12010cc67336Smrg	exit ;;
1202301ea0f4Smrg    SX-5:SUPER-UX:*:*)
1203301ea0f4Smrg	echo sx5-nec-superux${UNAME_RELEASE}
12040cc67336Smrg	exit ;;
1205301ea0f4Smrg    SX-6:SUPER-UX:*:*)
1206301ea0f4Smrg	echo sx6-nec-superux${UNAME_RELEASE}
12070cc67336Smrg	exit ;;
12080cc67336Smrg    SX-7:SUPER-UX:*:*)
12090cc67336Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12100cc67336Smrg	exit ;;
12110cc67336Smrg    SX-8:SUPER-UX:*:*)
12120cc67336Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12130cc67336Smrg	exit ;;
12140cc67336Smrg    SX-8R:SUPER-UX:*:*)
12150cc67336Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12160cc67336Smrg	exit ;;
1217301ea0f4Smrg    Power*:Rhapsody:*:*)
1218301ea0f4Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
12190cc67336Smrg	exit ;;
1220301ea0f4Smrg    *:Rhapsody:*:*)
1221301ea0f4Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
12220cc67336Smrg	exit ;;
1223301ea0f4Smrg    *:Darwin:*:*)
12240cc67336Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
12250cc67336Smrg	case $UNAME_PROCESSOR in
1226213fdd94Smrg	    i386)
1227213fdd94Smrg		eval $set_cc_for_build
1228213fdd94Smrg		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1229213fdd94Smrg		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1230213fdd94Smrg		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1231213fdd94Smrg		      grep IS_64BIT_ARCH >/dev/null
1232213fdd94Smrg		  then
1233213fdd94Smrg		      UNAME_PROCESSOR="x86_64"
1234213fdd94Smrg		  fi
1235213fdd94Smrg		fi ;;
12360cc67336Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
1237301ea0f4Smrg	esac
1238301ea0f4Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
12390cc67336Smrg	exit ;;
1240301ea0f4Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1241301ea0f4Smrg	UNAME_PROCESSOR=`uname -p`
1242301ea0f4Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
1243301ea0f4Smrg		UNAME_PROCESSOR=i386
1244301ea0f4Smrg		UNAME_MACHINE=pc
1245301ea0f4Smrg	fi
1246301ea0f4Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
12470cc67336Smrg	exit ;;
1248301ea0f4Smrg    *:QNX:*:4*)
1249301ea0f4Smrg	echo i386-pc-qnx
12500cc67336Smrg	exit ;;
1251213fdd94Smrg    NEO-?:NONSTOP_KERNEL:*:*)
1252213fdd94Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
1253213fdd94Smrg	exit ;;
12540cc67336Smrg    NSE-?:NONSTOP_KERNEL:*:*)
12550cc67336Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
12560cc67336Smrg	exit ;;
12570cc67336Smrg    NSR-?:NONSTOP_KERNEL:*:*)
1258301ea0f4Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
12590cc67336Smrg	exit ;;
1260301ea0f4Smrg    *:NonStop-UX:*:*)
1261301ea0f4Smrg	echo mips-compaq-nonstopux
12620cc67336Smrg	exit ;;
1263301ea0f4Smrg    BS2000:POSIX*:*:*)
1264301ea0f4Smrg	echo bs2000-siemens-sysv
12650cc67336Smrg	exit ;;
1266301ea0f4Smrg    DS/*:UNIX_System_V:*:*)
1267301ea0f4Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
12680cc67336Smrg	exit ;;
1269301ea0f4Smrg    *:Plan9:*:*)
1270301ea0f4Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
1271301ea0f4Smrg	# is converted to i386 for consistency with other x86
1272301ea0f4Smrg	# operating systems.
1273301ea0f4Smrg	if test "$cputype" = "386"; then
1274301ea0f4Smrg	    UNAME_MACHINE=i386
1275301ea0f4Smrg	else
1276301ea0f4Smrg	    UNAME_MACHINE="$cputype"
1277301ea0f4Smrg	fi
1278301ea0f4Smrg	echo ${UNAME_MACHINE}-unknown-plan9
12790cc67336Smrg	exit ;;
1280301ea0f4Smrg    *:TOPS-10:*:*)
1281301ea0f4Smrg	echo pdp10-unknown-tops10
12820cc67336Smrg	exit ;;
1283301ea0f4Smrg    *:TENEX:*:*)
1284301ea0f4Smrg	echo pdp10-unknown-tenex
12850cc67336Smrg	exit ;;
1286301ea0f4Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1287301ea0f4Smrg	echo pdp10-dec-tops20
12880cc67336Smrg	exit ;;
1289301ea0f4Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1290301ea0f4Smrg	echo pdp10-xkl-tops20
12910cc67336Smrg	exit ;;
1292301ea0f4Smrg    *:TOPS-20:*:*)
1293301ea0f4Smrg	echo pdp10-unknown-tops20
12940cc67336Smrg	exit ;;
1295301ea0f4Smrg    *:ITS:*:*)
1296301ea0f4Smrg	echo pdp10-unknown-its
12970cc67336Smrg	exit ;;
1298301ea0f4Smrg    SEI:*:*:SEIUX)
1299213fdd94Smrg	echo mips-sei-seiux${UNAME_RELEASE}
13000cc67336Smrg	exit ;;
13010cc67336Smrg    *:DragonFly:*:*)
13020cc67336Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
13030cc67336Smrg	exit ;;
13040cc67336Smrg    *:*VMS:*:*)
1305213fdd94Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
13060cc67336Smrg	case "${UNAME_MACHINE}" in
13070cc67336Smrg	    A*) echo alpha-dec-vms ; exit ;;
13080cc67336Smrg	    I*) echo ia64-dec-vms ; exit ;;
13090cc67336Smrg	    V*) echo vax-dec-vms ; exit ;;
13100cc67336Smrg	esac ;;
13110cc67336Smrg    *:XENIX:*:SysV)
13120cc67336Smrg	echo i386-pc-xenix
13130cc67336Smrg	exit ;;
13140cc67336Smrg    i*86:skyos:*:*)
13150cc67336Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
13160cc67336Smrg	exit ;;
13170cc67336Smrg    i*86:rdos:*:*)
13180cc67336Smrg	echo ${UNAME_MACHINE}-pc-rdos
13190cc67336Smrg	exit ;;
1320213fdd94Smrg    i*86:AROS:*:*)
1321213fdd94Smrg	echo ${UNAME_MACHINE}-pc-aros
1322213fdd94Smrg	exit ;;
1323301ea0f4Smrgesac
1324301ea0f4Smrg
1325301ea0f4Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
1326301ea0f4Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1327301ea0f4Smrg
1328301ea0f4Smrgeval $set_cc_for_build
1329301ea0f4Smrgcat >$dummy.c <<EOF
1330301ea0f4Smrg#ifdef _SEQUENT_
1331301ea0f4Smrg# include <sys/types.h>
1332301ea0f4Smrg# include <sys/utsname.h>
1333301ea0f4Smrg#endif
1334301ea0f4Smrgmain ()
1335301ea0f4Smrg{
1336301ea0f4Smrg#if defined (sony)
1337301ea0f4Smrg#if defined (MIPSEB)
1338301ea0f4Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1339301ea0f4Smrg     I don't know....  */
1340301ea0f4Smrg  printf ("mips-sony-bsd\n"); exit (0);
1341301ea0f4Smrg#else
1342301ea0f4Smrg#include <sys/param.h>
1343301ea0f4Smrg  printf ("m68k-sony-newsos%s\n",
1344301ea0f4Smrg#ifdef NEWSOS4
1345213fdd94Smrg	"4"
1346301ea0f4Smrg#else
1347213fdd94Smrg	""
1348301ea0f4Smrg#endif
1349213fdd94Smrg	); exit (0);
1350301ea0f4Smrg#endif
1351301ea0f4Smrg#endif
1352301ea0f4Smrg
1353301ea0f4Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
13540cc67336Smrg  printf ("arm-acorn-riscix\n"); exit (0);
1355301ea0f4Smrg#endif
1356301ea0f4Smrg
1357301ea0f4Smrg#if defined (hp300) && !defined (hpux)
1358301ea0f4Smrg  printf ("m68k-hp-bsd\n"); exit (0);
1359301ea0f4Smrg#endif
1360301ea0f4Smrg
1361301ea0f4Smrg#if defined (NeXT)
1362301ea0f4Smrg#if !defined (__ARCHITECTURE__)
1363301ea0f4Smrg#define __ARCHITECTURE__ "m68k"
1364301ea0f4Smrg#endif
1365301ea0f4Smrg  int version;
1366301ea0f4Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1367301ea0f4Smrg  if (version < 4)
1368301ea0f4Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1369301ea0f4Smrg  else
1370301ea0f4Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1371301ea0f4Smrg  exit (0);
1372301ea0f4Smrg#endif
1373301ea0f4Smrg
1374301ea0f4Smrg#if defined (MULTIMAX) || defined (n16)
1375301ea0f4Smrg#if defined (UMAXV)
1376301ea0f4Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
1377301ea0f4Smrg#else
1378301ea0f4Smrg#if defined (CMU)
1379301ea0f4Smrg  printf ("ns32k-encore-mach\n"); exit (0);
1380301ea0f4Smrg#else
1381301ea0f4Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
1382301ea0f4Smrg#endif
1383301ea0f4Smrg#endif
1384301ea0f4Smrg#endif
1385301ea0f4Smrg
1386301ea0f4Smrg#if defined (__386BSD__)
1387301ea0f4Smrg  printf ("i386-pc-bsd\n"); exit (0);
1388301ea0f4Smrg#endif
1389301ea0f4Smrg
1390301ea0f4Smrg#if defined (sequent)
1391301ea0f4Smrg#if defined (i386)
1392301ea0f4Smrg  printf ("i386-sequent-dynix\n"); exit (0);
1393301ea0f4Smrg#endif
1394301ea0f4Smrg#if defined (ns32000)
1395301ea0f4Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
1396301ea0f4Smrg#endif
1397301ea0f4Smrg#endif
1398301ea0f4Smrg
1399301ea0f4Smrg#if defined (_SEQUENT_)
1400301ea0f4Smrg    struct utsname un;
1401301ea0f4Smrg
1402301ea0f4Smrg    uname(&un);
1403301ea0f4Smrg
1404301ea0f4Smrg    if (strncmp(un.version, "V2", 2) == 0) {
1405301ea0f4Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
1406301ea0f4Smrg    }
1407301ea0f4Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1408301ea0f4Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
1409301ea0f4Smrg    }
1410301ea0f4Smrg    printf ("i386-sequent-ptx\n"); exit (0);
1411301ea0f4Smrg
1412301ea0f4Smrg#endif
1413301ea0f4Smrg
1414301ea0f4Smrg#if defined (vax)
1415301ea0f4Smrg# if !defined (ultrix)
1416301ea0f4Smrg#  include <sys/param.h>
1417301ea0f4Smrg#  if defined (BSD)
1418301ea0f4Smrg#   if BSD == 43
1419301ea0f4Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
1420301ea0f4Smrg#   else
1421301ea0f4Smrg#    if BSD == 199006
1422301ea0f4Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1423301ea0f4Smrg#    else
1424301ea0f4Smrg      printf ("vax-dec-bsd\n"); exit (0);
1425301ea0f4Smrg#    endif
1426301ea0f4Smrg#   endif
1427301ea0f4Smrg#  else
1428301ea0f4Smrg    printf ("vax-dec-bsd\n"); exit (0);
1429301ea0f4Smrg#  endif
1430301ea0f4Smrg# else
1431301ea0f4Smrg    printf ("vax-dec-ultrix\n"); exit (0);
1432301ea0f4Smrg# endif
1433301ea0f4Smrg#endif
1434301ea0f4Smrg
1435301ea0f4Smrg#if defined (alliant) && defined (i860)
1436301ea0f4Smrg  printf ("i860-alliant-bsd\n"); exit (0);
1437301ea0f4Smrg#endif
1438301ea0f4Smrg
1439301ea0f4Smrg  exit (1);
1440301ea0f4Smrg}
1441301ea0f4SmrgEOF
1442301ea0f4Smrg
14430cc67336Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
14440cc67336Smrg	{ echo "$SYSTEM_NAME"; exit; }
1445301ea0f4Smrg
1446301ea0f4Smrg# Apollos put the system type in the environment.
1447301ea0f4Smrg
14480cc67336Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1449301ea0f4Smrg
1450301ea0f4Smrg# Convex versions that predate uname can use getsysinfo(1)
1451301ea0f4Smrg
1452301ea0f4Smrgif [ -x /usr/convex/getsysinfo ]
1453301ea0f4Smrgthen
1454301ea0f4Smrg    case `getsysinfo -f cpu_type` in
1455301ea0f4Smrg    c1*)
1456301ea0f4Smrg	echo c1-convex-bsd
14570cc67336Smrg	exit ;;
1458301ea0f4Smrg    c2*)
1459301ea0f4Smrg	if getsysinfo -f scalar_acc
1460301ea0f4Smrg	then echo c32-convex-bsd
1461301ea0f4Smrg	else echo c2-convex-bsd
1462301ea0f4Smrg	fi
14630cc67336Smrg	exit ;;
1464301ea0f4Smrg    c34*)
1465301ea0f4Smrg	echo c34-convex-bsd
14660cc67336Smrg	exit ;;
1467301ea0f4Smrg    c38*)
1468301ea0f4Smrg	echo c38-convex-bsd
14690cc67336Smrg	exit ;;
1470301ea0f4Smrg    c4*)
1471301ea0f4Smrg	echo c4-convex-bsd
14720cc67336Smrg	exit ;;
1473301ea0f4Smrg    esac
1474301ea0f4Smrgfi
1475301ea0f4Smrg
1476301ea0f4Smrgcat >&2 <<EOF
1477301ea0f4Smrg$0: unable to guess system type
1478301ea0f4Smrg
1479301ea0f4SmrgThis script, last modified $timestamp, has failed to recognize
1480301ea0f4Smrgthe operating system you are using. It is advised that you
1481301ea0f4Smrgdownload the most up to date version of the config scripts from
1482301ea0f4Smrg
14830cc67336Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
14840cc67336Smrgand
14850cc67336Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1486301ea0f4Smrg
1487301ea0f4SmrgIf the version you run ($0) is already up to date, please
1488301ea0f4Smrgsend the following data and any information you think might be
1489301ea0f4Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
1490301ea0f4Smrginformation to handle your system.
1491301ea0f4Smrg
1492301ea0f4Smrgconfig.guess timestamp = $timestamp
1493301ea0f4Smrg
1494301ea0f4Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1495301ea0f4Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1496301ea0f4Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1497301ea0f4Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1498301ea0f4Smrg
1499301ea0f4Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1500301ea0f4Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1501301ea0f4Smrg
1502301ea0f4Smrghostinfo               = `(hostinfo) 2>/dev/null`
1503301ea0f4Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1504301ea0f4Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1505301ea0f4Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1506301ea0f4Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1507301ea0f4Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1508301ea0f4Smrg
1509301ea0f4SmrgUNAME_MACHINE = ${UNAME_MACHINE}
1510301ea0f4SmrgUNAME_RELEASE = ${UNAME_RELEASE}
1511301ea0f4SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
1512301ea0f4SmrgUNAME_VERSION = ${UNAME_VERSION}
1513301ea0f4SmrgEOF
1514301ea0f4Smrg
1515301ea0f4Smrgexit 1
1516301ea0f4Smrg
1517301ea0f4Smrg# Local variables:
1518301ea0f4Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1519301ea0f4Smrg# time-stamp-start: "timestamp='"
1520301ea0f4Smrg# time-stamp-format: "%:y-%02m-%02d"
1521301ea0f4Smrg# time-stamp-end: "'"
1522301ea0f4Smrg# End:
1523