155682Smarkm#! /bin/sh
255682Smarkm# Attempt to guess a canonical system name.
3102644Snectar#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4233294Sstas#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5233294Sstas#   Free Software Foundation, Inc.
672445Sassar
7233294Sstastimestamp='2009-11-20'
872445Sassar
955682Smarkm# This file is free software; you can redistribute it and/or modify it
1055682Smarkm# under the terms of the GNU General Public License as published by
1155682Smarkm# the Free Software Foundation; either version 2 of the License, or
1255682Smarkm# (at your option) any later version.
1355682Smarkm#
1455682Smarkm# This program is distributed in the hope that it will be useful, but
1555682Smarkm# WITHOUT ANY WARRANTY; without even the implied warranty of
1655682Smarkm# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1755682Smarkm# General Public License for more details.
1855682Smarkm#
1955682Smarkm# You should have received a copy of the GNU General Public License
2055682Smarkm# along with this program; if not, write to the Free Software
21178825Sdfr# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22178825Sdfr# 02110-1301, USA.
2355682Smarkm#
2455682Smarkm# As a special exception to the GNU General Public License, if you
2555682Smarkm# distribute this file as part of a program that contains a
2655682Smarkm# configuration script generated by Autoconf, you may include it under
2755682Smarkm# the same distribution terms that you use for the rest of that program.
2855682Smarkm
29178825Sdfr
30233294Sstas# Originally written by Per Bothner.  Please send patches (context
31233294Sstas# diff format) to <config-patches@gnu.org> and include a ChangeLog
32233294Sstas# entry.
3355682Smarkm#
3455682Smarkm# This script attempts to guess a canonical system name similar to
3555682Smarkm# config.sub.  If it succeeds, it prints the system name on stdout, and
3655682Smarkm# exits with 0.  Otherwise, it exits with 1.
3755682Smarkm#
38233294Sstas# You can get the latest version of this script from:
39233294Sstas# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
4055682Smarkm
4172445Sassarme=`echo "$0" | sed -e 's,.*/,,'`
4272445Sassar
4372445Sassarusage="\
4472445SassarUsage: $0 [OPTION]
4572445Sassar
4690926SnectarOutput the configuration name of the system \`$me' is run on.
4772445Sassar
4872445SassarOperation modes:
4990926Snectar  -h, --help         print this help, then exit
5090926Snectar  -t, --time-stamp   print date of last modification, then exit
5190926Snectar  -v, --version      print version number, then exit
5272445Sassar
5390926SnectarReport bugs and patches to <config-patches@gnu.org>."
5490926Snectar
5590926Snectarversion="\
5690926SnectarGNU config.guess ($timestamp)
5790926Snectar
5890926SnectarOriginally written by Per Bothner.
59233294SstasCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60233294Sstas2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6190926Snectar
6290926SnectarThis is free software; see the source for copying conditions.  There is NO
6390926Snectarwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6490926Snectar
6572445Sassarhelp="
6672445SassarTry \`$me --help' for more information."
6772445Sassar
6872445Sassar# Parse command line
6972445Sassarwhile test $# -gt 0 ; do
7090926Snectar  case $1 in
7190926Snectar    --time-stamp | --time* | -t )
72178825Sdfr       echo "$timestamp" ; exit ;;
7390926Snectar    --version | -v )
74178825Sdfr       echo "$version" ; exit ;;
7572445Sassar    --help | --h* | -h )
76178825Sdfr       echo "$usage"; exit ;;
7772445Sassar    -- )     # Stop option processing
7872445Sassar       shift; break ;;
7972445Sassar    - )	# Use stdin as input.
8072445Sassar       break ;;
8172445Sassar    -* )
8290926Snectar       echo "$me: invalid option $1$help" >&2
8372445Sassar       exit 1 ;;
8472445Sassar    * )
8572445Sassar       break ;;
8672445Sassar  esac
8772445Sassardone
8872445Sassar
8972445Sassarif test $# != 0; then
9072445Sassar  echo "$me: too many arguments$help" >&2
9172445Sassar  exit 1
9272445Sassarfi
9372445Sassar
94127808Snectartrap 'exit 1' 1 2 15
9572445Sassar
96127808Snectar# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97127808Snectar# compiler to aid in system detection is discouraged as it requires
98127808Snectar# temporary files to be created and, as you can see below, it is a
99127808Snectar# headache to deal with in a portable fashion.
10072445Sassar
10190926Snectar# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
10290926Snectar# use `HOST_CC' if defined, but it is deprecated.
10390926Snectar
104127808Snectar# Portable tmp directory creation inspired by the Autoconf team.
105127808Snectar
106127808Snectarset_cc_for_build='
107127808Snectartrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108127808Snectartrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109127808Snectar: ${TMPDIR=/tmp} ;
110178825Sdfr { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111127808Snectar { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112127808Snectar { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113127808Snectar { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114127808Snectardummy=$tmp/dummy ;
115127808Snectartmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116127808Snectarcase $CC_FOR_BUILD,$HOST_CC,$CC in
117127808Snectar ,,)    echo "int x;" > $dummy.c ;
118102644Snectar	for c in cc gcc c89 c99 ; do
119127808Snectar	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
12090926Snectar	     CC_FOR_BUILD="$c"; break ;
12190926Snectar	  fi ;
12290926Snectar	done ;
12390926Snectar	if test x"$CC_FOR_BUILD" = x ; then
12490926Snectar	  CC_FOR_BUILD=no_compiler_found ;
12590926Snectar	fi
12690926Snectar	;;
12790926Snectar ,,*)   CC_FOR_BUILD=$CC ;;
12890926Snectar ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
129178825Sdfresac ; set_cc_for_build= ;'
13090926Snectar
13155682Smarkm# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
13290926Snectar# (ghazi@noc.rutgers.edu 1994-08-24)
13355682Smarkmif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13455682Smarkm	PATH=$PATH:/.attbin ; export PATH
13555682Smarkmfi
13655682Smarkm
13755682SmarkmUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13855682SmarkmUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139102644SnectarUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
14055682SmarkmUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14155682Smarkm
14255682Smarkm# Note: order is significant - the case branches are not exclusive.
14355682Smarkm
14455682Smarkmcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14572445Sassar    *:NetBSD:*:*)
146102644Snectar	# NetBSD (nbsd) targets should (where applicable) match one or
14772445Sassar	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14872445Sassar	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
14972445Sassar	# switched to ELF, *-*-netbsd* would select the old
15072445Sassar	# object file format.  This provides both forward
15172445Sassar	# compatibility and a consistent mechanism for selecting the
15272445Sassar	# object file format.
153102644Snectar	#
154102644Snectar	# Note: NetBSD doesn't particularly care about the vendor
155102644Snectar	# portion of the name.  We always set it to "unknown".
156102644Snectar	sysctl="sysctl -n hw.machine_arch"
157102644Snectar	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158102644Snectar	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159102644Snectar	case "${UNAME_MACHINE_ARCH}" in
160127808Snectar	    armeb) machine=armeb-unknown ;;
161102644Snectar	    arm*) machine=arm-unknown ;;
162102644Snectar	    sh3el) machine=shl-unknown ;;
163102644Snectar	    sh3eb) machine=sh-unknown ;;
164233294Sstas	    sh5el) machine=sh5le-unknown ;;
165102644Snectar	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16672445Sassar	esac
16790926Snectar	# The Operating System including object format, if it has switched
16890926Snectar	# to ELF recently, or will in the future.
169102644Snectar	case "${UNAME_MACHINE_ARCH}" in
170102644Snectar	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
17190926Snectar		eval $set_cc_for_build
17290926Snectar		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173233294Sstas			| grep -q __ELF__
17490926Snectar		then
17590926Snectar		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17690926Snectar		    # Return netbsd for either.  FIX?
17790926Snectar		    os=netbsd
17890926Snectar		else
17990926Snectar		    os=netbsdelf
18090926Snectar		fi
18190926Snectar		;;
18290926Snectar	    *)
18390926Snectar	        os=netbsd
18490926Snectar		;;
18590926Snectar	esac
18672445Sassar	# The OS release
187127808Snectar	# Debian GNU/NetBSD machines have a different userland, and
188127808Snectar	# thus, need a distinct triplet. However, they do not need
189127808Snectar	# kernel version information, so it can be replaced with a
190127808Snectar	# suitable tag, in the style of linux-gnu.
191127808Snectar	case "${UNAME_VERSION}" in
192127808Snectar	    Debian*)
193127808Snectar		release='-gnu'
194127808Snectar		;;
195127808Snectar	    *)
196127808Snectar		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
197127808Snectar		;;
198127808Snectar	esac
19972445Sassar	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
20072445Sassar	# contains redundant information, the shorter form:
20172445Sassar	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
20272445Sassar	echo "${machine}-${os}${release}"
203178825Sdfr	exit ;;
204102644Snectar    *:OpenBSD:*:*)
205178825Sdfr	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206178825Sdfr	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207178825Sdfr	exit ;;
208142403Snectar    *:ekkoBSD:*:*)
209142403Snectar	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
210178825Sdfr	exit ;;
211178825Sdfr    *:SolidBSD:*:*)
212178825Sdfr	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
213178825Sdfr	exit ;;
214142403Snectar    macppc:MirBSD:*:*)
215178825Sdfr	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
216178825Sdfr	exit ;;
217142403Snectar    *:MirBSD:*:*)
218142403Snectar	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219178825Sdfr	exit ;;
22055682Smarkm    alpha:OSF1:*:*)
221142403Snectar	case $UNAME_RELEASE in
222142403Snectar	*4.0)
22355682Smarkm		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224142403Snectar		;;
225142403Snectar	*5.*)
226142403Snectar	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227142403Snectar		;;
228142403Snectar	esac
229127808Snectar	# According to Compaq, /usr/sbin/psrinfo has been available on
230127808Snectar	# OSF/1 and Tru64 systems produced since 1995.  I hope that
231127808Snectar	# covers most systems running today.  This code pipes the CPU
232127808Snectar	# types through head -n 1, so we only detect the type of CPU 0.
233127808Snectar	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234127808Snectar	case "$ALPHA_CPU_TYPE" in
235127808Snectar	    "EV4 (21064)")
236127808Snectar		UNAME_MACHINE="alpha" ;;
237127808Snectar	    "EV4.5 (21064)")
238127808Snectar		UNAME_MACHINE="alpha" ;;
239127808Snectar	    "LCA4 (21066/21068)")
240127808Snectar		UNAME_MACHINE="alpha" ;;
241127808Snectar	    "EV5 (21164)")
242127808Snectar		UNAME_MACHINE="alphaev5" ;;
243127808Snectar	    "EV5.6 (21164A)")
244127808Snectar		UNAME_MACHINE="alphaev56" ;;
245127808Snectar	    "EV5.6 (21164PC)")
246127808Snectar		UNAME_MACHINE="alphapca56" ;;
247127808Snectar	    "EV5.7 (21164PC)")
248127808Snectar		UNAME_MACHINE="alphapca57" ;;
249127808Snectar	    "EV6 (21264)")
250127808Snectar		UNAME_MACHINE="alphaev6" ;;
251127808Snectar	    "EV6.7 (21264A)")
252127808Snectar		UNAME_MACHINE="alphaev67" ;;
253127808Snectar	    "EV6.8CB (21264C)")
254127808Snectar		UNAME_MACHINE="alphaev68" ;;
255127808Snectar	    "EV6.8AL (21264B)")
256127808Snectar		UNAME_MACHINE="alphaev68" ;;
257127808Snectar	    "EV6.8CX (21264D)")
258127808Snectar		UNAME_MACHINE="alphaev68" ;;
259127808Snectar	    "EV6.9A (21264/EV69A)")
260127808Snectar		UNAME_MACHINE="alphaev69" ;;
261127808Snectar	    "EV7 (21364)")
262127808Snectar		UNAME_MACHINE="alphaev7" ;;
263127808Snectar	    "EV7.9 (21364A)")
264127808Snectar		UNAME_MACHINE="alphaev79" ;;
265127808Snectar	esac
266142403Snectar	# A Pn.n version is a patched version.
26755682Smarkm	# A Vn.n version is a released version.
26855682Smarkm	# A Tn.n version is a released field test version.
26955682Smarkm	# A Xn.n version is an unreleased experimental baselevel.
27055682Smarkm	# 1.2 uses "1.2" for uname -r.
271142403Snectar	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272178825Sdfr	exit ;;
27372445Sassar    Alpha\ *:Windows_NT*:*)
27472445Sassar	# How do we know it's Interix rather than the generic POSIX subsystem?
27572445Sassar	# Should we change UNAME_MACHINE based on the output of uname instead
27672445Sassar	# of the specific Alpha model?
27772445Sassar	echo alpha-pc-interix
278178825Sdfr	exit ;;
27955682Smarkm    21064:Windows_NT:50:3)
28055682Smarkm	echo alpha-dec-winnt3.5
281178825Sdfr	exit ;;
28255682Smarkm    Amiga*:UNIX_System_V:4.0:*)
28372445Sassar	echo m68k-unknown-sysv4
284178825Sdfr	exit ;;
28555682Smarkm    *:[Aa]miga[Oo][Ss]:*:*)
28655682Smarkm	echo ${UNAME_MACHINE}-unknown-amigaos
287178825Sdfr	exit ;;
288102644Snectar    *:[Mm]orph[Oo][Ss]:*:*)
289102644Snectar	echo ${UNAME_MACHINE}-unknown-morphos
290178825Sdfr	exit ;;
29172445Sassar    *:OS/390:*:*)
29272445Sassar	echo i370-ibm-openedition
293178825Sdfr	exit ;;
294178825Sdfr    *:z/VM:*:*)
295178825Sdfr	echo s390-ibm-zvmoe
296178825Sdfr	exit ;;
297142403Snectar    *:OS400:*:*)
298142403Snectar        echo powerpc-ibm-os400
299178825Sdfr	exit ;;
30055682Smarkm    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
30155682Smarkm	echo arm-acorn-riscix${UNAME_RELEASE}
302178825Sdfr	exit ;;
303178825Sdfr    arm:riscos:*:*|arm:RISCOS:*:*)
304178825Sdfr	echo arm-unknown-riscos
305178825Sdfr	exit ;;
30690926Snectar    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30755682Smarkm	echo hppa1.1-hitachi-hiuxmpp
308178825Sdfr	exit ;;
30972445Sassar    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
31055682Smarkm	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
31155682Smarkm	if test "`(/bin/universe) 2>/dev/null`" = att ; then
31255682Smarkm		echo pyramid-pyramid-sysv3
31355682Smarkm	else
31455682Smarkm		echo pyramid-pyramid-bsd
31555682Smarkm	fi
316178825Sdfr	exit ;;
31772445Sassar    NILE*:*:*:dcosx)
31855682Smarkm	echo pyramid-pyramid-svr4
319178825Sdfr	exit ;;
320127808Snectar    DRS?6000:unix:4.0:6*)
321127808Snectar	echo sparc-icl-nx6
322178825Sdfr	exit ;;
323178825Sdfr    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
324127808Snectar	case `/usr/bin/uname -p` in
325178825Sdfr	    sparc) echo sparc-icl-nx7; exit ;;
326127808Snectar	esac ;;
327233294Sstas    s390x:SunOS:*:*)
328233294Sstas	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
329233294Sstas	exit ;;
33055682Smarkm    sun4H:SunOS:5.*:*)
33155682Smarkm	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332178825Sdfr	exit ;;
33355682Smarkm    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
33455682Smarkm	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335178825Sdfr	exit ;;
336233294Sstas    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
337233294Sstas	echo i386-pc-auroraux${UNAME_RELEASE}
338178825Sdfr	exit ;;
339233294Sstas    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
340233294Sstas	eval $set_cc_for_build
341233294Sstas	SUN_ARCH="i386"
342233294Sstas	# If there is a compiler, see if it is configured for 64-bit objects.
343233294Sstas	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
344233294Sstas	# This test works for both compilers.
345233294Sstas	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
346233294Sstas	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
347233294Sstas		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
348233294Sstas		grep IS_64BIT_ARCH >/dev/null
349233294Sstas	    then
350233294Sstas		SUN_ARCH="x86_64"
351233294Sstas	    fi
352233294Sstas	fi
353233294Sstas	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
354233294Sstas	exit ;;
35555682Smarkm    sun4*:SunOS:6*:*)
35655682Smarkm	# According to config.sub, this is the proper way to canonicalize
35755682Smarkm	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
35855682Smarkm	# it's likely to be more like Solaris than SunOS4.
35955682Smarkm	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
360178825Sdfr	exit ;;
36155682Smarkm    sun4*:SunOS:*:*)
36255682Smarkm	case "`/usr/bin/arch -k`" in
36355682Smarkm	    Series*|S4*)
36455682Smarkm		UNAME_RELEASE=`uname -v`
36555682Smarkm		;;
36655682Smarkm	esac
36755682Smarkm	# Japanese Language versions have a version number like `4.1.3-JL'.
36855682Smarkm	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
369178825Sdfr	exit ;;
37055682Smarkm    sun3*:SunOS:*:*)
37155682Smarkm	echo m68k-sun-sunos${UNAME_RELEASE}
372178825Sdfr	exit ;;
37355682Smarkm    sun*:*:4.2BSD:*)
374102644Snectar	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
37555682Smarkm	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
37655682Smarkm	case "`/bin/arch`" in
37755682Smarkm	    sun3)
37855682Smarkm		echo m68k-sun-sunos${UNAME_RELEASE}
37955682Smarkm		;;
38055682Smarkm	    sun4)
38155682Smarkm		echo sparc-sun-sunos${UNAME_RELEASE}
38255682Smarkm		;;
38355682Smarkm	esac
384178825Sdfr	exit ;;
38555682Smarkm    aushp:SunOS:*:*)
38655682Smarkm	echo sparc-auspex-sunos${UNAME_RELEASE}
387178825Sdfr	exit ;;
38872445Sassar    # The situation for MiNT is a little confusing.  The machine name
38972445Sassar    # can be virtually everything (everything which is not
390102644Snectar    # "atarist" or "atariste" at least should have a processor
39172445Sassar    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
39272445Sassar    # to the lowercase version "mint" (or "freemint").  Finally
39372445Sassar    # the system name "TOS" denotes a system which is actually not
39472445Sassar    # MiNT.  But MiNT is downward compatible to TOS, so this should
39572445Sassar    # be no problem.
39672445Sassar    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39772445Sassar        echo m68k-atari-mint${UNAME_RELEASE}
398178825Sdfr	exit ;;
39972445Sassar    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
40072445Sassar	echo m68k-atari-mint${UNAME_RELEASE}
401178825Sdfr        exit ;;
40272445Sassar    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
40372445Sassar        echo m68k-atari-mint${UNAME_RELEASE}
404178825Sdfr	exit ;;
40572445Sassar    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40672445Sassar        echo m68k-milan-mint${UNAME_RELEASE}
407178825Sdfr        exit ;;
40872445Sassar    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
40972445Sassar        echo m68k-hades-mint${UNAME_RELEASE}
410178825Sdfr        exit ;;
41172445Sassar    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
41272445Sassar        echo m68k-unknown-mint${UNAME_RELEASE}
413178825Sdfr        exit ;;
414142403Snectar    m68k:machten:*:*)
415142403Snectar	echo m68k-apple-machten${UNAME_RELEASE}
416178825Sdfr	exit ;;
41755682Smarkm    powerpc:machten:*:*)
41855682Smarkm	echo powerpc-apple-machten${UNAME_RELEASE}
419178825Sdfr	exit ;;
42055682Smarkm    RISC*:Mach:*:*)
42155682Smarkm	echo mips-dec-mach_bsd4.3
422178825Sdfr	exit ;;
42355682Smarkm    RISC*:ULTRIX:*:*)
42455682Smarkm	echo mips-dec-ultrix${UNAME_RELEASE}
425178825Sdfr	exit ;;
42655682Smarkm    VAX*:ULTRIX*:*:*)
42755682Smarkm	echo vax-dec-ultrix${UNAME_RELEASE}
428178825Sdfr	exit ;;
42972445Sassar    2020:CLIX:*:* | 2430:CLIX:*:*)
43055682Smarkm	echo clipper-intergraph-clix${UNAME_RELEASE}
431178825Sdfr	exit ;;
43255682Smarkm    mips:*:*:UMIPS | mips:*:*:RISCos)
43390926Snectar	eval $set_cc_for_build
43455682Smarkm	sed 's/^	//' << EOF >$dummy.c
43572445Sassar#ifdef __cplusplus
43672445Sassar#include <stdio.h>  /* for printf() prototype */
43772445Sassar	int main (int argc, char *argv[]) {
43872445Sassar#else
43972445Sassar	int main (argc, argv) int argc; char *argv[]; {
44072445Sassar#endif
44155682Smarkm	#if defined (host_mips) && defined (MIPSEB)
44255682Smarkm	#if defined (SYSTYPE_SYSV)
44355682Smarkm	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
44455682Smarkm	#endif
44555682Smarkm	#if defined (SYSTYPE_SVR4)
44655682Smarkm	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
44755682Smarkm	#endif
44855682Smarkm	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
44955682Smarkm	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
45055682Smarkm	#endif
45155682Smarkm	#endif
45255682Smarkm	  exit (-1);
45355682Smarkm	}
45455682SmarkmEOF
455178825Sdfr	$CC_FOR_BUILD -o $dummy $dummy.c &&
456178825Sdfr	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
457178825Sdfr	  SYSTEM_NAME=`$dummy $dummyarg` &&
458178825Sdfr	    { echo "$SYSTEM_NAME"; exit; }
45955682Smarkm	echo mips-mips-riscos${UNAME_RELEASE}
460178825Sdfr	exit ;;
46190926Snectar    Motorola:PowerMAX_OS:*:*)
46290926Snectar	echo powerpc-motorola-powermax
463178825Sdfr	exit ;;
464127808Snectar    Motorola:*:4.3:PL8-*)
465127808Snectar	echo powerpc-harris-powermax
466178825Sdfr	exit ;;
467127808Snectar    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
468127808Snectar	echo powerpc-harris-powermax
469178825Sdfr	exit ;;
47055682Smarkm    Night_Hawk:Power_UNIX:*:*)
47155682Smarkm	echo powerpc-harris-powerunix
472178825Sdfr	exit ;;
47355682Smarkm    m88k:CX/UX:7*:*)
47455682Smarkm	echo m88k-harris-cxux7
475178825Sdfr	exit ;;
47655682Smarkm    m88k:*:4*:R4*)
47755682Smarkm	echo m88k-motorola-sysv4
478178825Sdfr	exit ;;
47955682Smarkm    m88k:*:3*:R3*)
48055682Smarkm	echo m88k-motorola-sysv3
481178825Sdfr	exit ;;
48255682Smarkm    AViiON:dgux:*:*)
48355682Smarkm        # DG/UX returns AViiON for all architectures
48455682Smarkm        UNAME_PROCESSOR=`/usr/bin/uname -p`
485102644Snectar	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
48672445Sassar	then
48772445Sassar	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
48872445Sassar	       [ ${TARGET_BINARY_INTERFACE}x = x ]
48972445Sassar	    then
49055682Smarkm		echo m88k-dg-dgux${UNAME_RELEASE}
49172445Sassar	    else
49272445Sassar		echo m88k-dg-dguxbcs${UNAME_RELEASE}
49372445Sassar	    fi
49455682Smarkm	else
49572445Sassar	    echo i586-dg-dgux${UNAME_RELEASE}
49655682Smarkm	fi
497178825Sdfr 	exit ;;
49855682Smarkm    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
49955682Smarkm	echo m88k-dolphin-sysv3
500178825Sdfr	exit ;;
50155682Smarkm    M88*:*:R3*:*)
50255682Smarkm	# Delta 88k system running SVR3
50355682Smarkm	echo m88k-motorola-sysv3
504178825Sdfr	exit ;;
50555682Smarkm    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
50655682Smarkm	echo m88k-tektronix-sysv3
507178825Sdfr	exit ;;
50855682Smarkm    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
50955682Smarkm	echo m68k-tektronix-bsd
510178825Sdfr	exit ;;
51155682Smarkm    *:IRIX*:*:*)
51255682Smarkm	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
513178825Sdfr	exit ;;
51455682Smarkm    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
515178825Sdfr	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
516178825Sdfr	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
51790926Snectar    i*86:AIX:*:*)
51855682Smarkm	echo i386-ibm-aix
519178825Sdfr	exit ;;
52090926Snectar    ia64:AIX:*:*)
52190926Snectar	if [ -x /usr/bin/oslevel ] ; then
52290926Snectar		IBM_REV=`/usr/bin/oslevel`
52390926Snectar	else
52490926Snectar		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
52590926Snectar	fi
52690926Snectar	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
527178825Sdfr	exit ;;
52855682Smarkm    *:AIX:2:3)
52955682Smarkm	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
53090926Snectar		eval $set_cc_for_build
53155682Smarkm		sed 's/^		//' << EOF >$dummy.c
53255682Smarkm		#include <sys/systemcfg.h>
53355682Smarkm
53455682Smarkm		main()
53555682Smarkm			{
53655682Smarkm			if (!__power_pc())
53755682Smarkm				exit(1);
53855682Smarkm			puts("powerpc-ibm-aix3.2.5");
53955682Smarkm			exit(0);
54055682Smarkm			}
54155682SmarkmEOF
542178825Sdfr		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
543178825Sdfr		then
544178825Sdfr			echo "$SYSTEM_NAME"
545178825Sdfr		else
546178825Sdfr			echo rs6000-ibm-aix3.2.5
547178825Sdfr		fi
54855682Smarkm	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
54955682Smarkm		echo rs6000-ibm-aix3.2.4
55055682Smarkm	else
55155682Smarkm		echo rs6000-ibm-aix3.2
55255682Smarkm	fi
553178825Sdfr	exit ;;
554233294Sstas    *:AIX:*:[456])
555102644Snectar	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
55690926Snectar	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
55755682Smarkm		IBM_ARCH=rs6000
55855682Smarkm	else
55955682Smarkm		IBM_ARCH=powerpc
56055682Smarkm	fi
56155682Smarkm	if [ -x /usr/bin/oslevel ] ; then
56255682Smarkm		IBM_REV=`/usr/bin/oslevel`
56355682Smarkm	else
56490926Snectar		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
56555682Smarkm	fi
56655682Smarkm	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
567178825Sdfr	exit ;;
56855682Smarkm    *:AIX:*:*)
56955682Smarkm	echo rs6000-ibm-aix
570178825Sdfr	exit ;;
57155682Smarkm    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
57255682Smarkm	echo romp-ibm-bsd4.4
573178825Sdfr	exit ;;
57472445Sassar    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
57555682Smarkm	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
576178825Sdfr	exit ;;                             # report: romp-ibm BSD 4.3
57755682Smarkm    *:BOSX:*:*)
57855682Smarkm	echo rs6000-bull-bosx
579178825Sdfr	exit ;;
58055682Smarkm    DPX/2?00:B.O.S.:*:*)
58155682Smarkm	echo m68k-bull-sysv3
582178825Sdfr	exit ;;
58355682Smarkm    9000/[34]??:4.3bsd:1.*:*)
58455682Smarkm	echo m68k-hp-bsd
585178825Sdfr	exit ;;
58655682Smarkm    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
58755682Smarkm	echo m68k-hp-bsd4.4
588178825Sdfr	exit ;;
58955682Smarkm    9000/[34678]??:HP-UX:*:*)
59090926Snectar	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
59155682Smarkm	case "${UNAME_MACHINE}" in
59255682Smarkm	    9000/31? )            HP_ARCH=m68000 ;;
59355682Smarkm	    9000/[34]?? )         HP_ARCH=m68k ;;
59472445Sassar	    9000/[678][0-9][0-9])
595102644Snectar		if [ -x /usr/bin/getconf ]; then
596102644Snectar		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
59790926Snectar                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
59890926Snectar                    case "${sc_cpu_version}" in
59990926Snectar                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
60090926Snectar                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
60190926Snectar                      532)                      # CPU_PA_RISC2_0
60290926Snectar                        case "${sc_kernel_bits}" in
60390926Snectar                          32) HP_ARCH="hppa2.0n" ;;
60490926Snectar                          64) HP_ARCH="hppa2.0w" ;;
605102644Snectar			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
60690926Snectar                        esac ;;
60790926Snectar                    esac
608102644Snectar		fi
609102644Snectar		if [ "${HP_ARCH}" = "" ]; then
610102644Snectar		    eval $set_cc_for_build
611102644Snectar		    sed 's/^              //' << EOF >$dummy.c
61272445Sassar
61372445Sassar              #define _HPUX_SOURCE
61455682Smarkm              #include <stdlib.h>
61555682Smarkm              #include <unistd.h>
61672445Sassar
61755682Smarkm              int main ()
61855682Smarkm              {
61955682Smarkm              #if defined(_SC_KERNEL_BITS)
62055682Smarkm                  long bits = sysconf(_SC_KERNEL_BITS);
62172445Sassar              #endif
62255682Smarkm                  long cpu  = sysconf (_SC_CPU_VERSION);
62372445Sassar
62472445Sassar                  switch (cpu)
62555682Smarkm              	{
62655682Smarkm              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62755682Smarkm              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62872445Sassar              	case CPU_PA_RISC2_0:
62955682Smarkm              #if defined(_SC_KERNEL_BITS)
63072445Sassar              	    switch (bits)
63155682Smarkm              		{
63255682Smarkm              		case 64: puts ("hppa2.0w"); break;
63355682Smarkm              		case 32: puts ("hppa2.0n"); break;
63455682Smarkm              		default: puts ("hppa2.0"); break;
63555682Smarkm              		} break;
63655682Smarkm              #else  /* !defined(_SC_KERNEL_BITS) */
63755682Smarkm              	    puts ("hppa2.0"); break;
63872445Sassar              #endif
63955682Smarkm              	default: puts ("hppa1.0"); break;
64055682Smarkm              	}
64155682Smarkm                  exit (0);
64255682Smarkm              }
64355682SmarkmEOF
644127808Snectar		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
645127808Snectar		    test -z "$HP_ARCH" && HP_ARCH=hppa
646102644Snectar		fi ;;
64755682Smarkm	esac
648127808Snectar	if [ ${HP_ARCH} = "hppa2.0w" ]
649127808Snectar	then
650178825Sdfr	    eval $set_cc_for_build
651178825Sdfr
652178825Sdfr	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
653178825Sdfr	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
654178825Sdfr	    # generating 64-bit code.  GNU and HP use different nomenclature:
655178825Sdfr	    #
656178825Sdfr	    # $ CC_FOR_BUILD=cc ./config.guess
657178825Sdfr	    # => hppa2.0w-hp-hpux11.23
658178825Sdfr	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
659178825Sdfr	    # => hppa64-hp-hpux11.23
660178825Sdfr
661178825Sdfr	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
662233294Sstas		grep -q __LP64__
663127808Snectar	    then
664127808Snectar		HP_ARCH="hppa2.0w"
665127808Snectar	    else
666127808Snectar		HP_ARCH="hppa64"
667127808Snectar	    fi
668127808Snectar	fi
66955682Smarkm	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
670178825Sdfr	exit ;;
67190926Snectar    ia64:HP-UX:*:*)
67290926Snectar	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
67390926Snectar	echo ia64-hp-hpux${HPUX_REV}
674178825Sdfr	exit ;;
67555682Smarkm    3050*:HI-UX:*:*)
67690926Snectar	eval $set_cc_for_build
67755682Smarkm	sed 's/^	//' << EOF >$dummy.c
67855682Smarkm	#include <unistd.h>
67955682Smarkm	int
68055682Smarkm	main ()
68155682Smarkm	{
68255682Smarkm	  long cpu = sysconf (_SC_CPU_VERSION);
68355682Smarkm	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
68455682Smarkm	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
68555682Smarkm	     results, however.  */
68655682Smarkm	  if (CPU_IS_PA_RISC (cpu))
68755682Smarkm	    {
68855682Smarkm	      switch (cpu)
68955682Smarkm		{
69055682Smarkm		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
69155682Smarkm		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
69255682Smarkm		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
69355682Smarkm		  default: puts ("hppa-hitachi-hiuxwe2"); break;
69455682Smarkm		}
69555682Smarkm	    }
69655682Smarkm	  else if (CPU_IS_HP_MC68K (cpu))
69755682Smarkm	    puts ("m68k-hitachi-hiuxwe2");
69855682Smarkm	  else puts ("unknown-hitachi-hiuxwe2");
69955682Smarkm	  exit (0);
70055682Smarkm	}
70155682SmarkmEOF
702178825Sdfr	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
703178825Sdfr		{ echo "$SYSTEM_NAME"; exit; }
70455682Smarkm	echo unknown-hitachi-hiuxwe2
705178825Sdfr	exit ;;
70655682Smarkm    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
70755682Smarkm	echo hppa1.1-hp-bsd
708178825Sdfr	exit ;;
70955682Smarkm    9000/8??:4.3bsd:*:*)
71055682Smarkm	echo hppa1.0-hp-bsd
711178825Sdfr	exit ;;
71290926Snectar    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
71372445Sassar	echo hppa1.0-hp-mpeix
714178825Sdfr	exit ;;
71555682Smarkm    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
71655682Smarkm	echo hppa1.1-hp-osf
717178825Sdfr	exit ;;
71855682Smarkm    hp8??:OSF1:*:*)
71955682Smarkm	echo hppa1.0-hp-osf
720178825Sdfr	exit ;;
72190926Snectar    i*86:OSF1:*:*)
72255682Smarkm	if [ -x /usr/sbin/sysversion ] ; then
72355682Smarkm	    echo ${UNAME_MACHINE}-unknown-osf1mk
72455682Smarkm	else
72555682Smarkm	    echo ${UNAME_MACHINE}-unknown-osf1
72655682Smarkm	fi
727178825Sdfr	exit ;;
72855682Smarkm    parisc*:Lites*:*:*)
72955682Smarkm	echo hppa1.1-hp-lites
730178825Sdfr	exit ;;
73155682Smarkm    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
73255682Smarkm	echo c1-convex-bsd
733178825Sdfr        exit ;;
73455682Smarkm    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
73555682Smarkm	if getsysinfo -f scalar_acc
73655682Smarkm	then echo c32-convex-bsd
73755682Smarkm	else echo c2-convex-bsd
73855682Smarkm	fi
739178825Sdfr        exit ;;
74055682Smarkm    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
74155682Smarkm	echo c34-convex-bsd
742178825Sdfr        exit ;;
74355682Smarkm    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
74455682Smarkm	echo c38-convex-bsd
745178825Sdfr        exit ;;
74655682Smarkm    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
74755682Smarkm	echo c4-convex-bsd
748178825Sdfr        exit ;;
74955682Smarkm    CRAY*Y-MP:*:*:*)
75090926Snectar	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
751178825Sdfr	exit ;;
75255682Smarkm    CRAY*[A-Z]90:*:*:*)
75355682Smarkm	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
75455682Smarkm	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
75590926Snectar	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
75690926Snectar	      -e 's/\.[^.]*$/.X/'
757178825Sdfr	exit ;;
75855682Smarkm    CRAY*TS:*:*:*)
75972445Sassar	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
760178825Sdfr	exit ;;
76190926Snectar    CRAY*T3E:*:*:*)
76290926Snectar	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
763178825Sdfr	exit ;;
76472445Sassar    CRAY*SV1:*:*:*)
765102644Snectar	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
766178825Sdfr	exit ;;
767127808Snectar    *:UNICOS/mp:*:*)
768178825Sdfr	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
769178825Sdfr	exit ;;
77090926Snectar    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
77190926Snectar	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
77272445Sassar        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77355682Smarkm        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
77490926Snectar        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
775178825Sdfr        exit ;;
776142403Snectar    5000:UNIX_System_V:4.*:*)
777142403Snectar        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
778142403Snectar        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
779142403Snectar        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
780178825Sdfr	exit ;;
78190926Snectar    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
78272445Sassar	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
783178825Sdfr	exit ;;
78455682Smarkm    sparc*:BSD/OS:*:*)
78555682Smarkm	echo sparc-unknown-bsdi${UNAME_RELEASE}
786178825Sdfr	exit ;;
78755682Smarkm    *:BSD/OS:*:*)
78855682Smarkm	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
789178825Sdfr	exit ;;
790142403Snectar    *:FreeBSD:*:*)
791178825Sdfr	case ${UNAME_MACHINE} in
792178825Sdfr	    pc98)
793178825Sdfr		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
794178825Sdfr	    amd64)
795178825Sdfr		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
796178825Sdfr	    *)
797178825Sdfr		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
798178825Sdfr	esac
799178825Sdfr	exit ;;
80055682Smarkm    i*:CYGWIN*:*)
80155682Smarkm	echo ${UNAME_MACHINE}-pc-cygwin
802178825Sdfr	exit ;;
803233294Sstas    *:MINGW*:*)
80455682Smarkm	echo ${UNAME_MACHINE}-pc-mingw32
805178825Sdfr	exit ;;
806178825Sdfr    i*:windows32*:*)
807178825Sdfr    	# uname -m includes "-pc" on this system.
808178825Sdfr    	echo ${UNAME_MACHINE}-mingw32
809178825Sdfr	exit ;;
81072445Sassar    i*:PW*:*)
81172445Sassar	echo ${UNAME_MACHINE}-pc-pw32
812178825Sdfr	exit ;;
813233294Sstas    *:Interix*:*)
814233294Sstas    	case ${UNAME_MACHINE} in
815233294Sstas	    x86)
816233294Sstas		echo i586-pc-interix${UNAME_RELEASE}
817233294Sstas		exit ;;
818233294Sstas	    authenticamd | genuineintel | EM64T)
819233294Sstas		echo x86_64-unknown-interix${UNAME_RELEASE}
820233294Sstas		exit ;;
821233294Sstas	    IA64)
822233294Sstas		echo ia64-unknown-interix${UNAME_RELEASE}
823233294Sstas		exit ;;
824233294Sstas	esac ;;
825127808Snectar    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
826127808Snectar	echo i${UNAME_MACHINE}-pc-mks
827178825Sdfr	exit ;;
828233294Sstas    8664:Windows_NT:*)
829233294Sstas	echo x86_64-pc-mks
830233294Sstas	exit ;;
83172445Sassar    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
83272445Sassar	# How do we know it's Interix rather than the generic POSIX subsystem?
83372445Sassar	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
83472445Sassar	# UNAME_MACHINE based on the output of uname instead of i386?
835127808Snectar	echo i586-pc-interix
836178825Sdfr	exit ;;
83772445Sassar    i*:UWIN*:*)
83872445Sassar	echo ${UNAME_MACHINE}-pc-uwin
839178825Sdfr	exit ;;
840178825Sdfr    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
841178825Sdfr	echo x86_64-unknown-cygwin
842178825Sdfr	exit ;;
84355682Smarkm    p*:CYGWIN*:*)
84455682Smarkm	echo powerpcle-unknown-cygwin
845178825Sdfr	exit ;;
84655682Smarkm    prep*:SunOS:5.*:*)
84755682Smarkm	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
848178825Sdfr	exit ;;
84955682Smarkm    *:GNU:*:*)
850142403Snectar	# the GNU system
85155682Smarkm	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
852178825Sdfr	exit ;;
853142403Snectar    *:GNU/*:*:*)
854142403Snectar	# other systems with GNU libc and userland
855142403Snectar	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
856178825Sdfr	exit ;;
85772445Sassar    i*86:Minix:*:*)
85872445Sassar	echo ${UNAME_MACHINE}-pc-minix
859178825Sdfr	exit ;;
860233294Sstas    alpha:Linux:*:*)
861233294Sstas	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
862233294Sstas	  EV5)   UNAME_MACHINE=alphaev5 ;;
863233294Sstas	  EV56)  UNAME_MACHINE=alphaev56 ;;
864233294Sstas	  PCA56) UNAME_MACHINE=alphapca56 ;;
865233294Sstas	  PCA57) UNAME_MACHINE=alphapca56 ;;
866233294Sstas	  EV6)   UNAME_MACHINE=alphaev6 ;;
867233294Sstas	  EV67)  UNAME_MACHINE=alphaev67 ;;
868233294Sstas	  EV68*) UNAME_MACHINE=alphaev68 ;;
869233294Sstas        esac
870233294Sstas	objdump --private-headers /bin/sh | grep -q ld.so.1
871233294Sstas	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
872233294Sstas	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
873233294Sstas	exit ;;
87490926Snectar    arm*:Linux:*:*)
875233294Sstas	eval $set_cc_for_build
876233294Sstas	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
877233294Sstas	    | grep -q __ARM_EABI__
878233294Sstas	then
879233294Sstas	    echo ${UNAME_MACHINE}-unknown-linux-gnu
880233294Sstas	else
881233294Sstas	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
882233294Sstas	fi
883178825Sdfr	exit ;;
884178825Sdfr    avr32*:Linux:*:*)
885178825Sdfr	echo ${UNAME_MACHINE}-unknown-linux-gnu
886178825Sdfr	exit ;;
887127808Snectar    cris:Linux:*:*)
888127808Snectar	echo cris-axis-linux-gnu
889178825Sdfr	exit ;;
890178825Sdfr    crisv32:Linux:*:*)
891178825Sdfr	echo crisv32-axis-linux-gnu
892178825Sdfr	exit ;;
893178825Sdfr    frv:Linux:*:*)
894178825Sdfr    	echo frv-unknown-linux-gnu
895178825Sdfr	exit ;;
896233294Sstas    i*86:Linux:*:*)
897233294Sstas	LIBC=gnu
898233294Sstas	eval $set_cc_for_build
899233294Sstas	sed 's/^	//' << EOF >$dummy.c
900233294Sstas	#ifdef __dietlibc__
901233294Sstas	LIBC=dietlibc
902233294Sstas	#endif
903233294SstasEOF
904233294Sstas	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
905233294Sstas	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
906233294Sstas	exit ;;
90790926Snectar    ia64:Linux:*:*)
908102644Snectar	echo ${UNAME_MACHINE}-unknown-linux-gnu
909178825Sdfr	exit ;;
910178825Sdfr    m32r*:Linux:*:*)
911178825Sdfr	echo ${UNAME_MACHINE}-unknown-linux-gnu
912178825Sdfr	exit ;;
91390926Snectar    m68*:Linux:*:*)
91490926Snectar	echo ${UNAME_MACHINE}-unknown-linux-gnu
915178825Sdfr	exit ;;
916233294Sstas    mips:Linux:*:* | mips64:Linux:*:*)
917102644Snectar	eval $set_cc_for_build
918102644Snectar	sed 's/^	//' << EOF >$dummy.c
919102644Snectar	#undef CPU
920233294Sstas	#undef ${UNAME_MACHINE}
921233294Sstas	#undef ${UNAME_MACHINE}el
922102644Snectar	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
923233294Sstas	CPU=${UNAME_MACHINE}el
924102644Snectar	#else
925102644Snectar	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
926233294Sstas	CPU=${UNAME_MACHINE}
927102644Snectar	#else
928102644Snectar	CPU=
929102644Snectar	#endif
930102644Snectar	#endif
931102644SnectarEOF
932233294Sstas	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
933178825Sdfr	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
93490926Snectar	;;
935178825Sdfr    or32:Linux:*:*)
936178825Sdfr	echo or32-unknown-linux-gnu
937178825Sdfr	exit ;;
938233294Sstas    padre:Linux:*:*)
939233294Sstas	echo sparc-unknown-linux-gnu
940178825Sdfr	exit ;;
941233294Sstas    parisc64:Linux:*:* | hppa64:Linux:*:*)
942233294Sstas	echo hppa64-unknown-linux-gnu
943178825Sdfr	exit ;;
94490926Snectar    parisc:Linux:*:* | hppa:Linux:*:*)
94590926Snectar	# Look for CPU level
94690926Snectar	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
94790926Snectar	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
94890926Snectar	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
94990926Snectar	  *)    echo hppa-unknown-linux-gnu ;;
95090926Snectar	esac
951178825Sdfr	exit ;;
952233294Sstas    ppc64:Linux:*:*)
953233294Sstas	echo powerpc64-unknown-linux-gnu
954178825Sdfr	exit ;;
955233294Sstas    ppc:Linux:*:*)
956233294Sstas	echo powerpc-unknown-linux-gnu
957233294Sstas	exit ;;
95890926Snectar    s390:Linux:*:* | s390x:Linux:*:*)
95990926Snectar	echo ${UNAME_MACHINE}-ibm-linux
960178825Sdfr	exit ;;
961127808Snectar    sh64*:Linux:*:*)
962127808Snectar    	echo ${UNAME_MACHINE}-unknown-linux-gnu
963178825Sdfr	exit ;;
96490926Snectar    sh*:Linux:*:*)
96590926Snectar	echo ${UNAME_MACHINE}-unknown-linux-gnu
966178825Sdfr	exit ;;
96790926Snectar    sparc:Linux:*:* | sparc64:Linux:*:*)
96890926Snectar	echo ${UNAME_MACHINE}-unknown-linux-gnu
969178825Sdfr	exit ;;
970178825Sdfr    vax:Linux:*:*)
971178825Sdfr	echo ${UNAME_MACHINE}-dec-linux-gnu
972178825Sdfr	exit ;;
97390926Snectar    x86_64:Linux:*:*)
97490926Snectar	echo x86_64-unknown-linux-gnu
975178825Sdfr	exit ;;
976233294Sstas    xtensa*:Linux:*:*)
977233294Sstas    	echo ${UNAME_MACHINE}-unknown-linux-gnu
978233294Sstas	exit ;;
97990926Snectar    i*86:DYNIX/ptx:4*:*)
98090926Snectar	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
98190926Snectar	# earlier versions are messed up and put the nodename in both
98290926Snectar	# sysname and nodename.
98355682Smarkm	echo i386-sequent-sysv4
984178825Sdfr	exit ;;
98590926Snectar    i*86:UNIX_SV:4.2MP:2.*)
98655682Smarkm        # Unixware is an offshoot of SVR4, but it has its own version
98755682Smarkm        # number series starting with 2...
98855682Smarkm        # I am not positive that other SVR4 systems won't match this,
98955682Smarkm	# I just have to hope.  -- rms.
99055682Smarkm        # Use sysv4.2uw... so that sysv4* matches it.
99155682Smarkm	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
992178825Sdfr	exit ;;
993127808Snectar    i*86:OS/2:*:*)
994127808Snectar	# If we were able to find `uname', then EMX Unix compatibility
995127808Snectar	# is probably installed.
996127808Snectar	echo ${UNAME_MACHINE}-pc-os2-emx
997178825Sdfr	exit ;;
998127808Snectar    i*86:XTS-300:*:STOP)
999127808Snectar	echo ${UNAME_MACHINE}-unknown-stop
1000178825Sdfr	exit ;;
1001127808Snectar    i*86:atheos:*:*)
1002127808Snectar	echo ${UNAME_MACHINE}-unknown-atheos
1003178825Sdfr	exit ;;
1004178825Sdfr    i*86:syllable:*:*)
1005142403Snectar	echo ${UNAME_MACHINE}-pc-syllable
1006178825Sdfr	exit ;;
1007233294Sstas    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1008127808Snectar	echo i386-unknown-lynxos${UNAME_RELEASE}
1009178825Sdfr	exit ;;
1010127808Snectar    i*86:*DOS:*:*)
1011127808Snectar	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1012178825Sdfr	exit ;;
101390926Snectar    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
101472445Sassar	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
101555682Smarkm	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
101672445Sassar		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
101755682Smarkm	else
101872445Sassar		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
101955682Smarkm	fi
1020178825Sdfr	exit ;;
1021178825Sdfr    i*86:*:5:[678]*)
1022178825Sdfr    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
102390926Snectar	case `/bin/uname -X | grep "^Machine"` in
102490926Snectar	    *486*)	     UNAME_MACHINE=i486 ;;
102590926Snectar	    *Pentium)	     UNAME_MACHINE=i586 ;;
102690926Snectar	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
102790926Snectar	esac
102890926Snectar	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1029178825Sdfr	exit ;;
103090926Snectar    i*86:*:3.2:*)
103155682Smarkm	if test -f /usr/options/cb.name; then
103255682Smarkm		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
103355682Smarkm		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
103455682Smarkm	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1035127808Snectar		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1036127808Snectar		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1037127808Snectar		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
103855682Smarkm			&& UNAME_MACHINE=i586
1039127808Snectar		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
104072445Sassar			&& UNAME_MACHINE=i686
1041127808Snectar		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
104272445Sassar			&& UNAME_MACHINE=i686
104355682Smarkm		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
104455682Smarkm	else
104555682Smarkm		echo ${UNAME_MACHINE}-pc-sysv32
104655682Smarkm	fi
1047178825Sdfr	exit ;;
104855682Smarkm    pc:*:*:*)
104972445Sassar	# Left here for compatibility:
105055682Smarkm        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1051233294Sstas        # the processor, so we play safe by assuming i586.
1052233294Sstas	# Note: whatever this is, it MUST be the same as what config.sub
1053233294Sstas	# prints for the "djgpp" host, or else GDB configury will decide that
1054233294Sstas	# this is a cross-build.
1055233294Sstas	echo i586-pc-msdosdjgpp
1056178825Sdfr        exit ;;
105755682Smarkm    Intel:Mach:3*:*)
105855682Smarkm	echo i386-pc-mach3
1059178825Sdfr	exit ;;
106055682Smarkm    paragon:*:*:*)
106155682Smarkm	echo i860-intel-osf1
1062178825Sdfr	exit ;;
106355682Smarkm    i860:*:4.*:*) # i860-SVR4
106455682Smarkm	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
106555682Smarkm	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
106655682Smarkm	else # Add other i860-SVR4 vendors below as they are discovered.
106755682Smarkm	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
106855682Smarkm	fi
1069178825Sdfr	exit ;;
107055682Smarkm    mini*:CTIX:SYS*5:*)
107155682Smarkm	# "miniframe"
107255682Smarkm	echo m68010-convergent-sysv
1073178825Sdfr	exit ;;
1074127808Snectar    mc68k:UNIX:SYSTEM5:3.51m)
1075127808Snectar	echo m68k-convergent-sysv
1076178825Sdfr	exit ;;
1077127808Snectar    M680?0:D-NIX:5.3:*)
1078127808Snectar	echo m68k-diab-dnix
1079178825Sdfr	exit ;;
1080178825Sdfr    M68*:*:R3V[5678]*:*)
1081178825Sdfr	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1082178825Sdfr    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)
108355682Smarkm	OS_REL=''
108455682Smarkm	test -r /etc/.relid \
108555682Smarkm	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
108655682Smarkm	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1087178825Sdfr	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
108855682Smarkm	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1089178825Sdfr	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
109055682Smarkm    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
109155682Smarkm        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1092178825Sdfr          && { echo i486-ncr-sysv4; exit; } ;;
1093233294Sstas    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1094233294Sstas	OS_REL='.3'
1095233294Sstas	test -r /etc/.relid \
1096233294Sstas	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1097233294Sstas	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1098233294Sstas	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1099233294Sstas	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1100233294Sstas	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
1101233294Sstas	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1102233294Sstas	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
110390926Snectar    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
110455682Smarkm	echo m68k-unknown-lynxos${UNAME_RELEASE}
1105178825Sdfr	exit ;;
110655682Smarkm    mc68030:UNIX_System_V:4.*:*)
110755682Smarkm	echo m68k-atari-sysv4
1108178825Sdfr	exit ;;
110955682Smarkm    TSUNAMI:LynxOS:2.*:*)
111055682Smarkm	echo sparc-unknown-lynxos${UNAME_RELEASE}
1111178825Sdfr	exit ;;
111290926Snectar    rs6000:LynxOS:2.*:*)
111355682Smarkm	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1114178825Sdfr	exit ;;
1115233294Sstas    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
111690926Snectar	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1117178825Sdfr	exit ;;
111855682Smarkm    SM[BE]S:UNIX_SV:*:*)
111955682Smarkm	echo mips-dde-sysv${UNAME_RELEASE}
1120178825Sdfr	exit ;;
112172445Sassar    RM*:ReliantUNIX-*:*:*)
112272445Sassar	echo mips-sni-sysv4
1123178825Sdfr	exit ;;
112455682Smarkm    RM*:SINIX-*:*:*)
112555682Smarkm	echo mips-sni-sysv4
1126178825Sdfr	exit ;;
112755682Smarkm    *:SINIX-*:*:*)
112855682Smarkm	if uname -p 2>/dev/null >/dev/null ; then
112955682Smarkm		UNAME_MACHINE=`(uname -p) 2>/dev/null`
113055682Smarkm		echo ${UNAME_MACHINE}-sni-sysv4
113155682Smarkm	else
113255682Smarkm		echo ns32k-sni-sysv
113355682Smarkm	fi
1134178825Sdfr	exit ;;
113590926Snectar    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
113690926Snectar                      # says <Richard.M.Bartel@ccMail.Census.GOV>
113755682Smarkm        echo i586-unisys-sysv4
1138178825Sdfr        exit ;;
113955682Smarkm    *:UNIX_System_V:4*:FTX*)
114055682Smarkm	# From Gerald Hewes <hewes@openmarket.com>.
114155682Smarkm	# How about differentiating between stratus architectures? -djm
114255682Smarkm	echo hppa1.1-stratus-sysv4
1143178825Sdfr	exit ;;
114455682Smarkm    *:*:*:FTX*)
114555682Smarkm	# From seanf@swdc.stratus.com.
114655682Smarkm	echo i860-stratus-sysv4
1147178825Sdfr	exit ;;
1148178825Sdfr    i*86:VOS:*:*)
1149178825Sdfr	# From Paul.Green@stratus.com.
1150178825Sdfr	echo ${UNAME_MACHINE}-stratus-vos
1151178825Sdfr	exit ;;
115290926Snectar    *:VOS:*:*)
115390926Snectar	# From Paul.Green@stratus.com.
115490926Snectar	echo hppa1.1-stratus-vos
1155178825Sdfr	exit ;;
115655682Smarkm    mc68*:A/UX:*:*)
115755682Smarkm	echo m68k-apple-aux${UNAME_RELEASE}
1158178825Sdfr	exit ;;
115972445Sassar    news*:NEWS-OS:6*:*)
116055682Smarkm	echo mips-sony-newsos6
1161178825Sdfr	exit ;;
116272445Sassar    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
116355682Smarkm	if [ -d /usr/nec ]; then
116455682Smarkm	        echo mips-nec-sysv${UNAME_RELEASE}
116555682Smarkm	else
116655682Smarkm	        echo mips-unknown-sysv${UNAME_RELEASE}
116755682Smarkm	fi
1168178825Sdfr        exit ;;
116955682Smarkm    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
117055682Smarkm	echo powerpc-be-beos
1171178825Sdfr	exit ;;
117255682Smarkm    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
117355682Smarkm	echo powerpc-apple-beos
1174178825Sdfr	exit ;;
117555682Smarkm    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
117655682Smarkm	echo i586-pc-beos
1177178825Sdfr	exit ;;
1178233294Sstas    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1179233294Sstas	echo i586-pc-haiku
1180233294Sstas	exit ;;
118155682Smarkm    SX-4:SUPER-UX:*:*)
118255682Smarkm	echo sx4-nec-superux${UNAME_RELEASE}
1183178825Sdfr	exit ;;
118455682Smarkm    SX-5:SUPER-UX:*:*)
118555682Smarkm	echo sx5-nec-superux${UNAME_RELEASE}
1186178825Sdfr	exit ;;
1187127808Snectar    SX-6:SUPER-UX:*:*)
1188127808Snectar	echo sx6-nec-superux${UNAME_RELEASE}
1189178825Sdfr	exit ;;
1190233294Sstas    SX-7:SUPER-UX:*:*)
1191233294Sstas	echo sx7-nec-superux${UNAME_RELEASE}
1192233294Sstas	exit ;;
1193233294Sstas    SX-8:SUPER-UX:*:*)
1194233294Sstas	echo sx8-nec-superux${UNAME_RELEASE}
1195233294Sstas	exit ;;
1196233294Sstas    SX-8R:SUPER-UX:*:*)
1197233294Sstas	echo sx8r-nec-superux${UNAME_RELEASE}
1198233294Sstas	exit ;;
119955682Smarkm    Power*:Rhapsody:*:*)
120055682Smarkm	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1201178825Sdfr	exit ;;
120255682Smarkm    *:Rhapsody:*:*)
120355682Smarkm	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1204178825Sdfr	exit ;;
120572445Sassar    *:Darwin:*:*)
1206178825Sdfr	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1207178825Sdfr	case $UNAME_PROCESSOR in
1208233294Sstas	    i386)
1209233294Sstas		eval $set_cc_for_build
1210233294Sstas		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1211233294Sstas		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1212233294Sstas		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1213233294Sstas		      grep IS_64BIT_ARCH >/dev/null
1214233294Sstas		  then
1215233294Sstas		      UNAME_PROCESSOR="x86_64"
1216233294Sstas		  fi
1217233294Sstas		fi ;;
1218178825Sdfr	    unknown) UNAME_PROCESSOR=powerpc ;;
1219127808Snectar	esac
1220127808Snectar	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1221178825Sdfr	exit ;;
122272445Sassar    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1223102644Snectar	UNAME_PROCESSOR=`uname -p`
1224102644Snectar	if test "$UNAME_PROCESSOR" = "x86"; then
1225102644Snectar		UNAME_PROCESSOR=i386
122672445Sassar		UNAME_MACHINE=pc
122772445Sassar	fi
1228102644Snectar	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1229178825Sdfr	exit ;;
123072445Sassar    *:QNX:*:4*)
123172445Sassar	echo i386-pc-qnx
1232178825Sdfr	exit ;;
1233178825Sdfr    NSE-?:NONSTOP_KERNEL:*:*)
1234178825Sdfr	echo nse-tandem-nsk${UNAME_RELEASE}
1235178825Sdfr	exit ;;
1236142403Snectar    NSR-?:NONSTOP_KERNEL:*:*)
123772445Sassar	echo nsr-tandem-nsk${UNAME_RELEASE}
1238178825Sdfr	exit ;;
123990926Snectar    *:NonStop-UX:*:*)
124090926Snectar	echo mips-compaq-nonstopux
1241178825Sdfr	exit ;;
124272445Sassar    BS2000:POSIX*:*:*)
124372445Sassar	echo bs2000-siemens-sysv
1244178825Sdfr	exit ;;
124572445Sassar    DS/*:UNIX_System_V:*:*)
124672445Sassar	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1247178825Sdfr	exit ;;
124872445Sassar    *:Plan9:*:*)
124972445Sassar	# "uname -m" is not consistent, so use $cputype instead. 386
125072445Sassar	# is converted to i386 for consistency with other x86
125172445Sassar	# operating systems.
125272445Sassar	if test "$cputype" = "386"; then
125372445Sassar	    UNAME_MACHINE=i386
125472445Sassar	else
125572445Sassar	    UNAME_MACHINE="$cputype"
125672445Sassar	fi
125772445Sassar	echo ${UNAME_MACHINE}-unknown-plan9
1258178825Sdfr	exit ;;
125990926Snectar    *:TOPS-10:*:*)
126090926Snectar	echo pdp10-unknown-tops10
1261178825Sdfr	exit ;;
126290926Snectar    *:TENEX:*:*)
126390926Snectar	echo pdp10-unknown-tenex
1264178825Sdfr	exit ;;
126590926Snectar    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
126690926Snectar	echo pdp10-dec-tops20
1267178825Sdfr	exit ;;
126890926Snectar    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
126990926Snectar	echo pdp10-xkl-tops20
1270178825Sdfr	exit ;;
127190926Snectar    *:TOPS-20:*:*)
127290926Snectar	echo pdp10-unknown-tops20
1273178825Sdfr	exit ;;
127490926Snectar    *:ITS:*:*)
127590926Snectar	echo pdp10-unknown-its
1276178825Sdfr	exit ;;
1277127808Snectar    SEI:*:*:SEIUX)
1278127808Snectar        echo mips-sei-seiux${UNAME_RELEASE}
1279178825Sdfr	exit ;;
1280142403Snectar    *:DragonFly:*:*)
1281142403Snectar	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1282178825Sdfr	exit ;;
1283178825Sdfr    *:*VMS:*:*)
1284178825Sdfr    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1285178825Sdfr	case "${UNAME_MACHINE}" in
1286178825Sdfr	    A*) echo alpha-dec-vms ; exit ;;
1287178825Sdfr	    I*) echo ia64-dec-vms ; exit ;;
1288178825Sdfr	    V*) echo vax-dec-vms ; exit ;;
1289178825Sdfr	esac ;;
1290178825Sdfr    *:XENIX:*:SysV)
1291178825Sdfr	echo i386-pc-xenix
1292178825Sdfr	exit ;;
1293178825Sdfr    i*86:skyos:*:*)
1294178825Sdfr	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1295178825Sdfr	exit ;;
1296178825Sdfr    i*86:rdos:*:*)
1297178825Sdfr	echo ${UNAME_MACHINE}-pc-rdos
1298178825Sdfr	exit ;;
1299233294Sstas    i*86:AROS:*:*)
1300233294Sstas	echo ${UNAME_MACHINE}-pc-aros
1301233294Sstas	exit ;;
130255682Smarkmesac
130355682Smarkm
130455682Smarkm#echo '(No uname command or uname output not recognized.)' 1>&2
130555682Smarkm#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
130655682Smarkm
130790926Snectareval $set_cc_for_build
130855682Smarkmcat >$dummy.c <<EOF
130955682Smarkm#ifdef _SEQUENT_
131055682Smarkm# include <sys/types.h>
131155682Smarkm# include <sys/utsname.h>
131255682Smarkm#endif
131355682Smarkmmain ()
131455682Smarkm{
131555682Smarkm#if defined (sony)
131655682Smarkm#if defined (MIPSEB)
131755682Smarkm  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
131855682Smarkm     I don't know....  */
131955682Smarkm  printf ("mips-sony-bsd\n"); exit (0);
132055682Smarkm#else
132155682Smarkm#include <sys/param.h>
132255682Smarkm  printf ("m68k-sony-newsos%s\n",
132355682Smarkm#ifdef NEWSOS4
132455682Smarkm          "4"
132555682Smarkm#else
132655682Smarkm	  ""
132755682Smarkm#endif
132855682Smarkm         ); exit (0);
132955682Smarkm#endif
133055682Smarkm#endif
133155682Smarkm
133255682Smarkm#if defined (__arm) && defined (__acorn) && defined (__unix)
1333178825Sdfr  printf ("arm-acorn-riscix\n"); exit (0);
133455682Smarkm#endif
133555682Smarkm
133655682Smarkm#if defined (hp300) && !defined (hpux)
133755682Smarkm  printf ("m68k-hp-bsd\n"); exit (0);
133855682Smarkm#endif
133955682Smarkm
134055682Smarkm#if defined (NeXT)
134155682Smarkm#if !defined (__ARCHITECTURE__)
134255682Smarkm#define __ARCHITECTURE__ "m68k"
134355682Smarkm#endif
134455682Smarkm  int version;
134555682Smarkm  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
134655682Smarkm  if (version < 4)
134755682Smarkm    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
134855682Smarkm  else
134955682Smarkm    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
135055682Smarkm  exit (0);
135155682Smarkm#endif
135255682Smarkm
135355682Smarkm#if defined (MULTIMAX) || defined (n16)
135455682Smarkm#if defined (UMAXV)
135555682Smarkm  printf ("ns32k-encore-sysv\n"); exit (0);
135655682Smarkm#else
135755682Smarkm#if defined (CMU)
135855682Smarkm  printf ("ns32k-encore-mach\n"); exit (0);
135955682Smarkm#else
136055682Smarkm  printf ("ns32k-encore-bsd\n"); exit (0);
136155682Smarkm#endif
136255682Smarkm#endif
136355682Smarkm#endif
136455682Smarkm
136555682Smarkm#if defined (__386BSD__)
136655682Smarkm  printf ("i386-pc-bsd\n"); exit (0);
136755682Smarkm#endif
136855682Smarkm
136955682Smarkm#if defined (sequent)
137055682Smarkm#if defined (i386)
137155682Smarkm  printf ("i386-sequent-dynix\n"); exit (0);
137255682Smarkm#endif
137355682Smarkm#if defined (ns32000)
137455682Smarkm  printf ("ns32k-sequent-dynix\n"); exit (0);
137555682Smarkm#endif
137655682Smarkm#endif
137755682Smarkm
137855682Smarkm#if defined (_SEQUENT_)
137955682Smarkm    struct utsname un;
138055682Smarkm
138155682Smarkm    uname(&un);
138255682Smarkm
138355682Smarkm    if (strncmp(un.version, "V2", 2) == 0) {
138455682Smarkm	printf ("i386-sequent-ptx2\n"); exit (0);
138555682Smarkm    }
138655682Smarkm    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
138755682Smarkm	printf ("i386-sequent-ptx1\n"); exit (0);
138855682Smarkm    }
138955682Smarkm    printf ("i386-sequent-ptx\n"); exit (0);
139055682Smarkm
139155682Smarkm#endif
139255682Smarkm
139355682Smarkm#if defined (vax)
139490926Snectar# if !defined (ultrix)
139590926Snectar#  include <sys/param.h>
139690926Snectar#  if defined (BSD)
139790926Snectar#   if BSD == 43
139890926Snectar      printf ("vax-dec-bsd4.3\n"); exit (0);
139990926Snectar#   else
140090926Snectar#    if BSD == 199006
140190926Snectar      printf ("vax-dec-bsd4.3reno\n"); exit (0);
140290926Snectar#    else
140390926Snectar      printf ("vax-dec-bsd\n"); exit (0);
140490926Snectar#    endif
140590926Snectar#   endif
140690926Snectar#  else
140790926Snectar    printf ("vax-dec-bsd\n"); exit (0);
140890926Snectar#  endif
140990926Snectar# else
141090926Snectar    printf ("vax-dec-ultrix\n"); exit (0);
141190926Snectar# endif
141255682Smarkm#endif
141355682Smarkm
141455682Smarkm#if defined (alliant) && defined (i860)
141555682Smarkm  printf ("i860-alliant-bsd\n"); exit (0);
141655682Smarkm#endif
141755682Smarkm
141855682Smarkm  exit (1);
141955682Smarkm}
142055682SmarkmEOF
142155682Smarkm
1422178825Sdfr$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1423178825Sdfr	{ echo "$SYSTEM_NAME"; exit; }
142455682Smarkm
142555682Smarkm# Apollos put the system type in the environment.
142655682Smarkm
1427178825Sdfrtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
142855682Smarkm
142955682Smarkm# Convex versions that predate uname can use getsysinfo(1)
143055682Smarkm
143155682Smarkmif [ -x /usr/convex/getsysinfo ]
143255682Smarkmthen
143355682Smarkm    case `getsysinfo -f cpu_type` in
143455682Smarkm    c1*)
143555682Smarkm	echo c1-convex-bsd
1436178825Sdfr	exit ;;
143755682Smarkm    c2*)
143855682Smarkm	if getsysinfo -f scalar_acc
143955682Smarkm	then echo c32-convex-bsd
144055682Smarkm	else echo c2-convex-bsd
144155682Smarkm	fi
1442178825Sdfr	exit ;;
144355682Smarkm    c34*)
144455682Smarkm	echo c34-convex-bsd
1445178825Sdfr	exit ;;
144655682Smarkm    c38*)
144755682Smarkm	echo c38-convex-bsd
1448178825Sdfr	exit ;;
144955682Smarkm    c4*)
145055682Smarkm	echo c4-convex-bsd
1451178825Sdfr	exit ;;
145255682Smarkm    esac
145355682Smarkmfi
145455682Smarkm
145572445Sassarcat >&2 <<EOF
145672445Sassar$0: unable to guess system type
145755682Smarkm
145890926SnectarThis script, last modified $timestamp, has failed to recognize
145990926Snectarthe operating system you are using. It is advised that you
146090926Snectardownload the most up to date version of the config scripts from
146172445Sassar
1462233294Sstas  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1463178825Sdfrand
1464233294Sstas  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
146572445Sassar
146672445SassarIf the version you run ($0) is already up to date, please
146772445Sassarsend the following data and any information you think might be
146872445Sassarpertinent to <config-patches@gnu.org> in order to provide the needed
146972445Sassarinformation to handle your system.
147072445Sassar
147190926Snectarconfig.guess timestamp = $timestamp
147272445Sassar
147372445Sassaruname -m = `(uname -m) 2>/dev/null || echo unknown`
147472445Sassaruname -r = `(uname -r) 2>/dev/null || echo unknown`
147572445Sassaruname -s = `(uname -s) 2>/dev/null || echo unknown`
147672445Sassaruname -v = `(uname -v) 2>/dev/null || echo unknown`
147772445Sassar
147872445Sassar/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
147972445Sassar/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
148072445Sassar
148172445Sassarhostinfo               = `(hostinfo) 2>/dev/null`
148272445Sassar/bin/universe          = `(/bin/universe) 2>/dev/null`
148372445Sassar/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
148472445Sassar/bin/arch              = `(/bin/arch) 2>/dev/null`
148572445Sassar/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
148672445Sassar/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
148772445Sassar
148872445SassarUNAME_MACHINE = ${UNAME_MACHINE}
148972445SassarUNAME_RELEASE = ${UNAME_RELEASE}
149072445SassarUNAME_SYSTEM  = ${UNAME_SYSTEM}
149172445SassarUNAME_VERSION = ${UNAME_VERSION}
149272445SassarEOF
149372445Sassar
149455682Smarkmexit 1
149572445Sassar
149672445Sassar# Local variables:
149772445Sassar# eval: (add-hook 'write-file-hooks 'time-stamp)
149890926Snectar# time-stamp-start: "timestamp='"
149972445Sassar# time-stamp-format: "%:y-%02m-%02d"
150072445Sassar# time-stamp-end: "'"
150172445Sassar# End:
1502