config.guess revision 2ec8c4b4
109885543Smrg#! /bin/sh
209885543Smrg# Attempt to guess a canonical system name.
309885543Smrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
47104f784Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
57104f784Smrg#   Free Software Foundation, Inc.
609885543Smrg
72ec8c4b4Smrgtimestamp='2008-11-15'
809885543Smrg
909885543Smrg# This file is free software; you can redistribute it and/or modify it
1009885543Smrg# under the terms of the GNU General Public License as published by
1109885543Smrg# the Free Software Foundation; either version 2 of the License, or
1209885543Smrg# (at your option) any later version.
1309885543Smrg#
1409885543Smrg# This program is distributed in the hope that it will be useful, but
1509885543Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1609885543Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1709885543Smrg# General Public License for more details.
1809885543Smrg#
1909885543Smrg# You should have received a copy of the GNU General Public License
2009885543Smrg# along with this program; if not, write to the Free Software
2109885543Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
2209885543Smrg# 02110-1301, USA.
2309885543Smrg#
2409885543Smrg# As a special exception to the GNU General Public License, if you
2509885543Smrg# distribute this file as part of a program that contains a
2609885543Smrg# configuration script generated by Autoconf, you may include it under
2709885543Smrg# the same distribution terms that you use for the rest of that program.
2809885543Smrg
2909885543Smrg
3009885543Smrg# Originally written by Per Bothner <per@bothner.com>.
3109885543Smrg# Please send patches to <config-patches@gnu.org>.  Submit a context
3209885543Smrg# diff and a properly formatted ChangeLog entry.
3309885543Smrg#
3409885543Smrg# This script attempts to guess a canonical system name similar to
3509885543Smrg# config.sub.  If it succeeds, it prints the system name on stdout, and
3609885543Smrg# exits with 0.  Otherwise, it exits with 1.
3709885543Smrg#
3809885543Smrg# The plan is that this can be called by configure scripts if you
3909885543Smrg# don't specify an explicit build system type.
4009885543Smrg
4109885543Smrgme=`echo "$0" | sed -e 's,.*/,,'`
4209885543Smrg
4309885543Smrgusage="\
4409885543SmrgUsage: $0 [OPTION]
4509885543Smrg
4609885543SmrgOutput the configuration name of the system \`$me' is run on.
4709885543Smrg
4809885543SmrgOperation modes:
4909885543Smrg  -h, --help         print this help, then exit
5009885543Smrg  -t, --time-stamp   print date of last modification, then exit
5109885543Smrg  -v, --version      print version number, then exit
5209885543Smrg
5309885543SmrgReport bugs and patches to <config-patches@gnu.org>."
5409885543Smrg
5509885543Smrgversion="\
5609885543SmrgGNU config.guess ($timestamp)
5709885543Smrg
5809885543SmrgOriginally written by Per Bothner.
597104f784SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
607104f784Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
6109885543Smrg
6209885543SmrgThis is free software; see the source for copying conditions.  There is NO
6309885543Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6409885543Smrg
6509885543Smrghelp="
6609885543SmrgTry \`$me --help' for more information."
6709885543Smrg
6809885543Smrg# Parse command line
6909885543Smrgwhile test $# -gt 0 ; do
7009885543Smrg  case $1 in
7109885543Smrg    --time-stamp | --time* | -t )
7209885543Smrg       echo "$timestamp" ; exit ;;
7309885543Smrg    --version | -v )
7409885543Smrg       echo "$version" ; exit ;;
7509885543Smrg    --help | --h* | -h )
7609885543Smrg       echo "$usage"; exit ;;
7709885543Smrg    -- )     # Stop option processing
7809885543Smrg       shift; break ;;
7909885543Smrg    - )	# Use stdin as input.
8009885543Smrg       break ;;
8109885543Smrg    -* )
8209885543Smrg       echo "$me: invalid option $1$help" >&2
8309885543Smrg       exit 1 ;;
8409885543Smrg    * )
8509885543Smrg       break ;;
8609885543Smrg  esac
8709885543Smrgdone
8809885543Smrg
8909885543Smrgif test $# != 0; then
9009885543Smrg  echo "$me: too many arguments$help" >&2
9109885543Smrg  exit 1
9209885543Smrgfi
9309885543Smrg
9409885543Smrgtrap 'exit 1' 1 2 15
9509885543Smrg
9609885543Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9709885543Smrg# compiler to aid in system detection is discouraged as it requires
9809885543Smrg# temporary files to be created and, as you can see below, it is a
9909885543Smrg# headache to deal with in a portable fashion.
10009885543Smrg
10109885543Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
10209885543Smrg# use `HOST_CC' if defined, but it is deprecated.
10309885543Smrg
10409885543Smrg# Portable tmp directory creation inspired by the Autoconf team.
10509885543Smrg
10609885543Smrgset_cc_for_build='
10709885543Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10809885543Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10909885543Smrg: ${TMPDIR=/tmp} ;
11009885543Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
11109885543Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
11209885543Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
11309885543Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
11409885543Smrgdummy=$tmp/dummy ;
11509885543Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
11609885543Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11709885543Smrg ,,)    echo "int x;" > $dummy.c ;
11809885543Smrg	for c in cc gcc c89 c99 ; do
11909885543Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
12009885543Smrg	     CC_FOR_BUILD="$c"; break ;
12109885543Smrg	  fi ;
12209885543Smrg	done ;
12309885543Smrg	if test x"$CC_FOR_BUILD" = x ; then
12409885543Smrg	  CC_FOR_BUILD=no_compiler_found ;
12509885543Smrg	fi
12609885543Smrg	;;
12709885543Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12809885543Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12909885543Smrgesac ; set_cc_for_build= ;'
13009885543Smrg
13109885543Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
13209885543Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
13309885543Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13409885543Smrg	PATH=$PATH:/.attbin ; export PATH
13509885543Smrgfi
13609885543Smrg
13709885543SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13809885543SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13909885543SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
14009885543SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
14109885543Smrg
14209885543Smrg# Note: order is significant - the case branches are not exclusive.
14309885543Smrg
14409885543Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14509885543Smrg    *:NetBSD:*:*)
14609885543Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
14709885543Smrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14809885543Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
14909885543Smrg	# switched to ELF, *-*-netbsd* would select the old
15009885543Smrg	# object file format.  This provides both forward
15109885543Smrg	# compatibility and a consistent mechanism for selecting the
15209885543Smrg	# object file format.
15309885543Smrg	#
15409885543Smrg	# Note: NetBSD doesn't particularly care about the vendor
15509885543Smrg	# portion of the name.  We always set it to "unknown".
15609885543Smrg	sysctl="sysctl -n hw.machine_arch"
15709885543Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
15809885543Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
15909885543Smrg	case "${UNAME_MACHINE_ARCH}" in
16009885543Smrg	    armeb) machine=armeb-unknown ;;
16109885543Smrg	    arm*) machine=arm-unknown ;;
16209885543Smrg	    sh3el) machine=shl-unknown ;;
16309885543Smrg	    sh3eb) machine=sh-unknown ;;
1647104f784Smrg	    sh5el) machine=sh5le-unknown ;;
16509885543Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16609885543Smrg	esac
16709885543Smrg	# The Operating System including object format, if it has switched
16809885543Smrg	# to ELF recently, or will in the future.
16909885543Smrg	case "${UNAME_MACHINE_ARCH}" in
17009885543Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
17109885543Smrg		eval $set_cc_for_build
17209885543Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
17309885543Smrg			| grep __ELF__ >/dev/null
17409885543Smrg		then
17509885543Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17609885543Smrg		    # Return netbsd for either.  FIX?
17709885543Smrg		    os=netbsd
17809885543Smrg		else
17909885543Smrg		    os=netbsdelf
18009885543Smrg		fi
18109885543Smrg		;;
18209885543Smrg	    *)
18309885543Smrg	        os=netbsd
18409885543Smrg		;;
18509885543Smrg	esac
18609885543Smrg	# The OS release
18709885543Smrg	# Debian GNU/NetBSD machines have a different userland, and
18809885543Smrg	# thus, need a distinct triplet. However, they do not need
18909885543Smrg	# kernel version information, so it can be replaced with a
19009885543Smrg	# suitable tag, in the style of linux-gnu.
19109885543Smrg	case "${UNAME_VERSION}" in
19209885543Smrg	    Debian*)
19309885543Smrg		release='-gnu'
19409885543Smrg		;;
19509885543Smrg	    *)
19609885543Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19709885543Smrg		;;
19809885543Smrg	esac
19909885543Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
20009885543Smrg	# contains redundant information, the shorter form:
20109885543Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
20209885543Smrg	echo "${machine}-${os}${release}"
20309885543Smrg	exit ;;
20409885543Smrg    *:OpenBSD:*:*)
20509885543Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
20609885543Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
20709885543Smrg	exit ;;
20809885543Smrg    *:ekkoBSD:*:*)
20909885543Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
21009885543Smrg	exit ;;
21109885543Smrg    *:SolidBSD:*:*)
21209885543Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
21309885543Smrg	exit ;;
21409885543Smrg    macppc:MirBSD:*:*)
21509885543Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
21609885543Smrg	exit ;;
21709885543Smrg    *:MirBSD:*:*)
21809885543Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
21909885543Smrg	exit ;;
22009885543Smrg    alpha:OSF1:*:*)
22109885543Smrg	case $UNAME_RELEASE in
22209885543Smrg	*4.0)
22309885543Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
22409885543Smrg		;;
22509885543Smrg	*5.*)
22609885543Smrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
22709885543Smrg		;;
22809885543Smrg	esac
22909885543Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
23009885543Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
23109885543Smrg	# covers most systems running today.  This code pipes the CPU
23209885543Smrg	# types through head -n 1, so we only detect the type of CPU 0.
23309885543Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
23409885543Smrg	case "$ALPHA_CPU_TYPE" in
23509885543Smrg	    "EV4 (21064)")
23609885543Smrg		UNAME_MACHINE="alpha" ;;
23709885543Smrg	    "EV4.5 (21064)")
23809885543Smrg		UNAME_MACHINE="alpha" ;;
23909885543Smrg	    "LCA4 (21066/21068)")
24009885543Smrg		UNAME_MACHINE="alpha" ;;
24109885543Smrg	    "EV5 (21164)")
24209885543Smrg		UNAME_MACHINE="alphaev5" ;;
24309885543Smrg	    "EV5.6 (21164A)")
24409885543Smrg		UNAME_MACHINE="alphaev56" ;;
24509885543Smrg	    "EV5.6 (21164PC)")
24609885543Smrg		UNAME_MACHINE="alphapca56" ;;
24709885543Smrg	    "EV5.7 (21164PC)")
24809885543Smrg		UNAME_MACHINE="alphapca57" ;;
24909885543Smrg	    "EV6 (21264)")
25009885543Smrg		UNAME_MACHINE="alphaev6" ;;
25109885543Smrg	    "EV6.7 (21264A)")
25209885543Smrg		UNAME_MACHINE="alphaev67" ;;
25309885543Smrg	    "EV6.8CB (21264C)")
25409885543Smrg		UNAME_MACHINE="alphaev68" ;;
25509885543Smrg	    "EV6.8AL (21264B)")
25609885543Smrg		UNAME_MACHINE="alphaev68" ;;
25709885543Smrg	    "EV6.8CX (21264D)")
25809885543Smrg		UNAME_MACHINE="alphaev68" ;;
25909885543Smrg	    "EV6.9A (21264/EV69A)")
26009885543Smrg		UNAME_MACHINE="alphaev69" ;;
26109885543Smrg	    "EV7 (21364)")
26209885543Smrg		UNAME_MACHINE="alphaev7" ;;
26309885543Smrg	    "EV7.9 (21364A)")
26409885543Smrg		UNAME_MACHINE="alphaev79" ;;
26509885543Smrg	esac
26609885543Smrg	# A Pn.n version is a patched version.
26709885543Smrg	# A Vn.n version is a released version.
26809885543Smrg	# A Tn.n version is a released field test version.
26909885543Smrg	# A Xn.n version is an unreleased experimental baselevel.
27009885543Smrg	# 1.2 uses "1.2" for uname -r.
27109885543Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
27209885543Smrg	exit ;;
27309885543Smrg    Alpha\ *:Windows_NT*:*)
27409885543Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
27509885543Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
27609885543Smrg	# of the specific Alpha model?
27709885543Smrg	echo alpha-pc-interix
27809885543Smrg	exit ;;
27909885543Smrg    21064:Windows_NT:50:3)
28009885543Smrg	echo alpha-dec-winnt3.5
28109885543Smrg	exit ;;
28209885543Smrg    Amiga*:UNIX_System_V:4.0:*)
28309885543Smrg	echo m68k-unknown-sysv4
28409885543Smrg	exit ;;
28509885543Smrg    *:[Aa]miga[Oo][Ss]:*:*)
28609885543Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
28709885543Smrg	exit ;;
28809885543Smrg    *:[Mm]orph[Oo][Ss]:*:*)
28909885543Smrg	echo ${UNAME_MACHINE}-unknown-morphos
29009885543Smrg	exit ;;
29109885543Smrg    *:OS/390:*:*)
29209885543Smrg	echo i370-ibm-openedition
29309885543Smrg	exit ;;
29409885543Smrg    *:z/VM:*:*)
29509885543Smrg	echo s390-ibm-zvmoe
29609885543Smrg	exit ;;
29709885543Smrg    *:OS400:*:*)
29809885543Smrg        echo powerpc-ibm-os400
29909885543Smrg	exit ;;
30009885543Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
30109885543Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
30209885543Smrg	exit ;;
30309885543Smrg    arm:riscos:*:*|arm:RISCOS:*:*)
30409885543Smrg	echo arm-unknown-riscos
30509885543Smrg	exit ;;
30609885543Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
30709885543Smrg	echo hppa1.1-hitachi-hiuxmpp
30809885543Smrg	exit ;;
30909885543Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
31009885543Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
31109885543Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
31209885543Smrg		echo pyramid-pyramid-sysv3
31309885543Smrg	else
31409885543Smrg		echo pyramid-pyramid-bsd
31509885543Smrg	fi
31609885543Smrg	exit ;;
31709885543Smrg    NILE*:*:*:dcosx)
31809885543Smrg	echo pyramid-pyramid-svr4
31909885543Smrg	exit ;;
32009885543Smrg    DRS?6000:unix:4.0:6*)
32109885543Smrg	echo sparc-icl-nx6
32209885543Smrg	exit ;;
32309885543Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
32409885543Smrg	case `/usr/bin/uname -p` in
32509885543Smrg	    sparc) echo sparc-icl-nx7; exit ;;
32609885543Smrg	esac ;;
32709885543Smrg    sun4H:SunOS:5.*:*)
32809885543Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
32909885543Smrg	exit ;;
33009885543Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
33109885543Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
33209885543Smrg	exit ;;
3337104f784Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
3342ec8c4b4Smrg	eval $set_cc_for_build
3352ec8c4b4Smrg	SUN_ARCH="i386"
3362ec8c4b4Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
3372ec8c4b4Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
3382ec8c4b4Smrg	# This test works for both compilers.
3392ec8c4b4Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
3402ec8c4b4Smrg	    if echo '\n#ifdef __amd64\nIS_64BIT_ARCH\n#endif' | \
3412ec8c4b4Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
3422ec8c4b4Smrg		grep IS_64BIT_ARCH >/dev/null
3432ec8c4b4Smrg	    then
3442ec8c4b4Smrg		SUN_ARCH="x86_64"
3452ec8c4b4Smrg	    fi
3462ec8c4b4Smrg	fi
3472ec8c4b4Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
34809885543Smrg	exit ;;
34909885543Smrg    sun4*:SunOS:6*:*)
35009885543Smrg	# According to config.sub, this is the proper way to canonicalize
35109885543Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
35209885543Smrg	# it's likely to be more like Solaris than SunOS4.
35309885543Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35409885543Smrg	exit ;;
35509885543Smrg    sun4*:SunOS:*:*)
35609885543Smrg	case "`/usr/bin/arch -k`" in
35709885543Smrg	    Series*|S4*)
35809885543Smrg		UNAME_RELEASE=`uname -v`
35909885543Smrg		;;
36009885543Smrg	esac
36109885543Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
36209885543Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
36309885543Smrg	exit ;;
36409885543Smrg    sun3*:SunOS:*:*)
36509885543Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
36609885543Smrg	exit ;;
36709885543Smrg    sun*:*:4.2BSD:*)
36809885543Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
36909885543Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
37009885543Smrg	case "`/bin/arch`" in
37109885543Smrg	    sun3)
37209885543Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
37309885543Smrg		;;
37409885543Smrg	    sun4)
37509885543Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
37609885543Smrg		;;
37709885543Smrg	esac
37809885543Smrg	exit ;;
37909885543Smrg    aushp:SunOS:*:*)
38009885543Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
38109885543Smrg	exit ;;
38209885543Smrg    # The situation for MiNT is a little confusing.  The machine name
38309885543Smrg    # can be virtually everything (everything which is not
38409885543Smrg    # "atarist" or "atariste" at least should have a processor
38509885543Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
38609885543Smrg    # to the lowercase version "mint" (or "freemint").  Finally
38709885543Smrg    # the system name "TOS" denotes a system which is actually not
38809885543Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
38909885543Smrg    # be no problem.
39009885543Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
39109885543Smrg        echo m68k-atari-mint${UNAME_RELEASE}
39209885543Smrg	exit ;;
39309885543Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
39409885543Smrg	echo m68k-atari-mint${UNAME_RELEASE}
39509885543Smrg        exit ;;
39609885543Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
39709885543Smrg        echo m68k-atari-mint${UNAME_RELEASE}
39809885543Smrg	exit ;;
39909885543Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
40009885543Smrg        echo m68k-milan-mint${UNAME_RELEASE}
40109885543Smrg        exit ;;
40209885543Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
40309885543Smrg        echo m68k-hades-mint${UNAME_RELEASE}
40409885543Smrg        exit ;;
40509885543Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
40609885543Smrg        echo m68k-unknown-mint${UNAME_RELEASE}
40709885543Smrg        exit ;;
40809885543Smrg    m68k:machten:*:*)
40909885543Smrg	echo m68k-apple-machten${UNAME_RELEASE}
41009885543Smrg	exit ;;
41109885543Smrg    powerpc:machten:*:*)
41209885543Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
41309885543Smrg	exit ;;
41409885543Smrg    RISC*:Mach:*:*)
41509885543Smrg	echo mips-dec-mach_bsd4.3
41609885543Smrg	exit ;;
41709885543Smrg    RISC*:ULTRIX:*:*)
41809885543Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
41909885543Smrg	exit ;;
42009885543Smrg    VAX*:ULTRIX*:*:*)
42109885543Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
42209885543Smrg	exit ;;
42309885543Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
42409885543Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
42509885543Smrg	exit ;;
42609885543Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
42709885543Smrg	eval $set_cc_for_build
42809885543Smrg	sed 's/^	//' << EOF >$dummy.c
42909885543Smrg#ifdef __cplusplus
43009885543Smrg#include <stdio.h>  /* for printf() prototype */
43109885543Smrg	int main (int argc, char *argv[]) {
43209885543Smrg#else
43309885543Smrg	int main (argc, argv) int argc; char *argv[]; {
43409885543Smrg#endif
43509885543Smrg	#if defined (host_mips) && defined (MIPSEB)
43609885543Smrg	#if defined (SYSTYPE_SYSV)
43709885543Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
43809885543Smrg	#endif
43909885543Smrg	#if defined (SYSTYPE_SVR4)
44009885543Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
44109885543Smrg	#endif
44209885543Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
44309885543Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
44409885543Smrg	#endif
44509885543Smrg	#endif
44609885543Smrg	  exit (-1);
44709885543Smrg	}
44809885543SmrgEOF
44909885543Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
45009885543Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
45109885543Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
45209885543Smrg	    { echo "$SYSTEM_NAME"; exit; }
45309885543Smrg	echo mips-mips-riscos${UNAME_RELEASE}
45409885543Smrg	exit ;;
45509885543Smrg    Motorola:PowerMAX_OS:*:*)
45609885543Smrg	echo powerpc-motorola-powermax
45709885543Smrg	exit ;;
45809885543Smrg    Motorola:*:4.3:PL8-*)
45909885543Smrg	echo powerpc-harris-powermax
46009885543Smrg	exit ;;
46109885543Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
46209885543Smrg	echo powerpc-harris-powermax
46309885543Smrg	exit ;;
46409885543Smrg    Night_Hawk:Power_UNIX:*:*)
46509885543Smrg	echo powerpc-harris-powerunix
46609885543Smrg	exit ;;
46709885543Smrg    m88k:CX/UX:7*:*)
46809885543Smrg	echo m88k-harris-cxux7
46909885543Smrg	exit ;;
47009885543Smrg    m88k:*:4*:R4*)
47109885543Smrg	echo m88k-motorola-sysv4
47209885543Smrg	exit ;;
47309885543Smrg    m88k:*:3*:R3*)
47409885543Smrg	echo m88k-motorola-sysv3
47509885543Smrg	exit ;;
47609885543Smrg    AViiON:dgux:*:*)
47709885543Smrg        # DG/UX returns AViiON for all architectures
47809885543Smrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
47909885543Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
48009885543Smrg	then
48109885543Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
48209885543Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
48309885543Smrg	    then
48409885543Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
48509885543Smrg	    else
48609885543Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
48709885543Smrg	    fi
48809885543Smrg	else
48909885543Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
49009885543Smrg	fi
49109885543Smrg 	exit ;;
49209885543Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
49309885543Smrg	echo m88k-dolphin-sysv3
49409885543Smrg	exit ;;
49509885543Smrg    M88*:*:R3*:*)
49609885543Smrg	# Delta 88k system running SVR3
49709885543Smrg	echo m88k-motorola-sysv3
49809885543Smrg	exit ;;
49909885543Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
50009885543Smrg	echo m88k-tektronix-sysv3
50109885543Smrg	exit ;;
50209885543Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
50309885543Smrg	echo m68k-tektronix-bsd
50409885543Smrg	exit ;;
50509885543Smrg    *:IRIX*:*:*)
50609885543Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
50709885543Smrg	exit ;;
50809885543Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
50909885543Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
51009885543Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
51109885543Smrg    i*86:AIX:*:*)
51209885543Smrg	echo i386-ibm-aix
51309885543Smrg	exit ;;
51409885543Smrg    ia64:AIX:*:*)
51509885543Smrg	if [ -x /usr/bin/oslevel ] ; then
51609885543Smrg		IBM_REV=`/usr/bin/oslevel`
51709885543Smrg	else
51809885543Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
51909885543Smrg	fi
52009885543Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
52109885543Smrg	exit ;;
52209885543Smrg    *:AIX:2:3)
52309885543Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
52409885543Smrg		eval $set_cc_for_build
52509885543Smrg		sed 's/^		//' << EOF >$dummy.c
52609885543Smrg		#include <sys/systemcfg.h>
52709885543Smrg
52809885543Smrg		main()
52909885543Smrg			{
53009885543Smrg			if (!__power_pc())
53109885543Smrg				exit(1);
53209885543Smrg			puts("powerpc-ibm-aix3.2.5");
53309885543Smrg			exit(0);
53409885543Smrg			}
53509885543SmrgEOF
53609885543Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
53709885543Smrg		then
53809885543Smrg			echo "$SYSTEM_NAME"
53909885543Smrg		else
54009885543Smrg			echo rs6000-ibm-aix3.2.5
54109885543Smrg		fi
54209885543Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
54309885543Smrg		echo rs6000-ibm-aix3.2.4
54409885543Smrg	else
54509885543Smrg		echo rs6000-ibm-aix3.2
54609885543Smrg	fi
54709885543Smrg	exit ;;
5487104f784Smrg    *:AIX:*:[456])
54909885543Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
55009885543Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
55109885543Smrg		IBM_ARCH=rs6000
55209885543Smrg	else
55309885543Smrg		IBM_ARCH=powerpc
55409885543Smrg	fi
55509885543Smrg	if [ -x /usr/bin/oslevel ] ; then
55609885543Smrg		IBM_REV=`/usr/bin/oslevel`
55709885543Smrg	else
55809885543Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
55909885543Smrg	fi
56009885543Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
56109885543Smrg	exit ;;
56209885543Smrg    *:AIX:*:*)
56309885543Smrg	echo rs6000-ibm-aix
56409885543Smrg	exit ;;
56509885543Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
56609885543Smrg	echo romp-ibm-bsd4.4
56709885543Smrg	exit ;;
56809885543Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
56909885543Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
57009885543Smrg	exit ;;                             # report: romp-ibm BSD 4.3
57109885543Smrg    *:BOSX:*:*)
57209885543Smrg	echo rs6000-bull-bosx
57309885543Smrg	exit ;;
57409885543Smrg    DPX/2?00:B.O.S.:*:*)
57509885543Smrg	echo m68k-bull-sysv3
57609885543Smrg	exit ;;
57709885543Smrg    9000/[34]??:4.3bsd:1.*:*)
57809885543Smrg	echo m68k-hp-bsd
57909885543Smrg	exit ;;
58009885543Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
58109885543Smrg	echo m68k-hp-bsd4.4
58209885543Smrg	exit ;;
58309885543Smrg    9000/[34678]??:HP-UX:*:*)
58409885543Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
58509885543Smrg	case "${UNAME_MACHINE}" in
58609885543Smrg	    9000/31? )            HP_ARCH=m68000 ;;
58709885543Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
58809885543Smrg	    9000/[678][0-9][0-9])
58909885543Smrg		if [ -x /usr/bin/getconf ]; then
59009885543Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
59109885543Smrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
59209885543Smrg                    case "${sc_cpu_version}" in
59309885543Smrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
59409885543Smrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
59509885543Smrg                      532)                      # CPU_PA_RISC2_0
59609885543Smrg                        case "${sc_kernel_bits}" in
59709885543Smrg                          32) HP_ARCH="hppa2.0n" ;;
59809885543Smrg                          64) HP_ARCH="hppa2.0w" ;;
59909885543Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
60009885543Smrg                        esac ;;
60109885543Smrg                    esac
60209885543Smrg		fi
60309885543Smrg		if [ "${HP_ARCH}" = "" ]; then
60409885543Smrg		    eval $set_cc_for_build
60509885543Smrg		    sed 's/^              //' << EOF >$dummy.c
60609885543Smrg
60709885543Smrg              #define _HPUX_SOURCE
60809885543Smrg              #include <stdlib.h>
60909885543Smrg              #include <unistd.h>
61009885543Smrg
61109885543Smrg              int main ()
61209885543Smrg              {
61309885543Smrg              #if defined(_SC_KERNEL_BITS)
61409885543Smrg                  long bits = sysconf(_SC_KERNEL_BITS);
61509885543Smrg              #endif
61609885543Smrg                  long cpu  = sysconf (_SC_CPU_VERSION);
61709885543Smrg
61809885543Smrg                  switch (cpu)
61909885543Smrg              	{
62009885543Smrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
62109885543Smrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
62209885543Smrg              	case CPU_PA_RISC2_0:
62309885543Smrg              #if defined(_SC_KERNEL_BITS)
62409885543Smrg              	    switch (bits)
62509885543Smrg              		{
62609885543Smrg              		case 64: puts ("hppa2.0w"); break;
62709885543Smrg              		case 32: puts ("hppa2.0n"); break;
62809885543Smrg              		default: puts ("hppa2.0"); break;
62909885543Smrg              		} break;
63009885543Smrg              #else  /* !defined(_SC_KERNEL_BITS) */
63109885543Smrg              	    puts ("hppa2.0"); break;
63209885543Smrg              #endif
63309885543Smrg              	default: puts ("hppa1.0"); break;
63409885543Smrg              	}
63509885543Smrg                  exit (0);
63609885543Smrg              }
63709885543SmrgEOF
63809885543Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
63909885543Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
64009885543Smrg		fi ;;
64109885543Smrg	esac
64209885543Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
64309885543Smrg	then
64409885543Smrg	    eval $set_cc_for_build
64509885543Smrg
64609885543Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
64709885543Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
64809885543Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
64909885543Smrg	    #
65009885543Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
65109885543Smrg	    # => hppa2.0w-hp-hpux11.23
65209885543Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
65309885543Smrg	    # => hppa64-hp-hpux11.23
65409885543Smrg
65509885543Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
65609885543Smrg		grep __LP64__ >/dev/null
65709885543Smrg	    then
65809885543Smrg		HP_ARCH="hppa2.0w"
65909885543Smrg	    else
66009885543Smrg		HP_ARCH="hppa64"
66109885543Smrg	    fi
66209885543Smrg	fi
66309885543Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
66409885543Smrg	exit ;;
66509885543Smrg    ia64:HP-UX:*:*)
66609885543Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
66709885543Smrg	echo ia64-hp-hpux${HPUX_REV}
66809885543Smrg	exit ;;
66909885543Smrg    3050*:HI-UX:*:*)
67009885543Smrg	eval $set_cc_for_build
67109885543Smrg	sed 's/^	//' << EOF >$dummy.c
67209885543Smrg	#include <unistd.h>
67309885543Smrg	int
67409885543Smrg	main ()
67509885543Smrg	{
67609885543Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
67709885543Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
67809885543Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
67909885543Smrg	     results, however.  */
68009885543Smrg	  if (CPU_IS_PA_RISC (cpu))
68109885543Smrg	    {
68209885543Smrg	      switch (cpu)
68309885543Smrg		{
68409885543Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
68509885543Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
68609885543Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
68709885543Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
68809885543Smrg		}
68909885543Smrg	    }
69009885543Smrg	  else if (CPU_IS_HP_MC68K (cpu))
69109885543Smrg	    puts ("m68k-hitachi-hiuxwe2");
69209885543Smrg	  else puts ("unknown-hitachi-hiuxwe2");
69309885543Smrg	  exit (0);
69409885543Smrg	}
69509885543SmrgEOF
69609885543Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
69709885543Smrg		{ echo "$SYSTEM_NAME"; exit; }
69809885543Smrg	echo unknown-hitachi-hiuxwe2
69909885543Smrg	exit ;;
70009885543Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
70109885543Smrg	echo hppa1.1-hp-bsd
70209885543Smrg	exit ;;
70309885543Smrg    9000/8??:4.3bsd:*:*)
70409885543Smrg	echo hppa1.0-hp-bsd
70509885543Smrg	exit ;;
70609885543Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
70709885543Smrg	echo hppa1.0-hp-mpeix
70809885543Smrg	exit ;;
70909885543Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
71009885543Smrg	echo hppa1.1-hp-osf
71109885543Smrg	exit ;;
71209885543Smrg    hp8??:OSF1:*:*)
71309885543Smrg	echo hppa1.0-hp-osf
71409885543Smrg	exit ;;
71509885543Smrg    i*86:OSF1:*:*)
71609885543Smrg	if [ -x /usr/sbin/sysversion ] ; then
71709885543Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
71809885543Smrg	else
71909885543Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
72009885543Smrg	fi
72109885543Smrg	exit ;;
72209885543Smrg    parisc*:Lites*:*:*)
72309885543Smrg	echo hppa1.1-hp-lites
72409885543Smrg	exit ;;
72509885543Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
72609885543Smrg	echo c1-convex-bsd
72709885543Smrg        exit ;;
72809885543Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
72909885543Smrg	if getsysinfo -f scalar_acc
73009885543Smrg	then echo c32-convex-bsd
73109885543Smrg	else echo c2-convex-bsd
73209885543Smrg	fi
73309885543Smrg        exit ;;
73409885543Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
73509885543Smrg	echo c34-convex-bsd
73609885543Smrg        exit ;;
73709885543Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
73809885543Smrg	echo c38-convex-bsd
73909885543Smrg        exit ;;
74009885543Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
74109885543Smrg	echo c4-convex-bsd
74209885543Smrg        exit ;;
74309885543Smrg    CRAY*Y-MP:*:*:*)
74409885543Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
74509885543Smrg	exit ;;
74609885543Smrg    CRAY*[A-Z]90:*:*:*)
74709885543Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
74809885543Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
74909885543Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
75009885543Smrg	      -e 's/\.[^.]*$/.X/'
75109885543Smrg	exit ;;
75209885543Smrg    CRAY*TS:*:*:*)
75309885543Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
75409885543Smrg	exit ;;
75509885543Smrg    CRAY*T3E:*:*:*)
75609885543Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
75709885543Smrg	exit ;;
75809885543Smrg    CRAY*SV1:*:*:*)
75909885543Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76009885543Smrg	exit ;;
76109885543Smrg    *:UNICOS/mp:*:*)
76209885543Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
76309885543Smrg	exit ;;
76409885543Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
76509885543Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
76609885543Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
76709885543Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
76809885543Smrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
76909885543Smrg        exit ;;
77009885543Smrg    5000:UNIX_System_V:4.*:*)
77109885543Smrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
77209885543Smrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
77309885543Smrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
77409885543Smrg	exit ;;
77509885543Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
77609885543Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
77709885543Smrg	exit ;;
77809885543Smrg    sparc*:BSD/OS:*:*)
77909885543Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
78009885543Smrg	exit ;;
78109885543Smrg    *:BSD/OS:*:*)
78209885543Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
78309885543Smrg	exit ;;
78409885543Smrg    *:FreeBSD:*:*)
78509885543Smrg	case ${UNAME_MACHINE} in
78609885543Smrg	    pc98)
78709885543Smrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
78809885543Smrg	    amd64)
78909885543Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
79009885543Smrg	    *)
79109885543Smrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
79209885543Smrg	esac
79309885543Smrg	exit ;;
79409885543Smrg    i*:CYGWIN*:*)
79509885543Smrg	echo ${UNAME_MACHINE}-pc-cygwin
79609885543Smrg	exit ;;
7977104f784Smrg    *:MINGW*:*)
79809885543Smrg	echo ${UNAME_MACHINE}-pc-mingw32
79909885543Smrg	exit ;;
80009885543Smrg    i*:windows32*:*)
80109885543Smrg    	# uname -m includes "-pc" on this system.
80209885543Smrg    	echo ${UNAME_MACHINE}-mingw32
80309885543Smrg	exit ;;
80409885543Smrg    i*:PW*:*)
80509885543Smrg	echo ${UNAME_MACHINE}-pc-pw32
80609885543Smrg	exit ;;
8077104f784Smrg    *:Interix*:[3456]*)
8087104f784Smrg    	case ${UNAME_MACHINE} in
8097104f784Smrg	    x86)
8107104f784Smrg		echo i586-pc-interix${UNAME_RELEASE}
8117104f784Smrg		exit ;;
8122ec8c4b4Smrg	    EM64T | authenticamd | genuineintel)
8137104f784Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
8147104f784Smrg		exit ;;
8157104f784Smrg	    IA64)
8167104f784Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
8177104f784Smrg		exit ;;
8187104f784Smrg	esac ;;
81909885543Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
82009885543Smrg	echo i${UNAME_MACHINE}-pc-mks
82109885543Smrg	exit ;;
82209885543Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
82309885543Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
82409885543Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
82509885543Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
82609885543Smrg	echo i586-pc-interix
82709885543Smrg	exit ;;
82809885543Smrg    i*:UWIN*:*)
82909885543Smrg	echo ${UNAME_MACHINE}-pc-uwin
83009885543Smrg	exit ;;
83109885543Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
83209885543Smrg	echo x86_64-unknown-cygwin
83309885543Smrg	exit ;;
83409885543Smrg    p*:CYGWIN*:*)
83509885543Smrg	echo powerpcle-unknown-cygwin
83609885543Smrg	exit ;;
83709885543Smrg    prep*:SunOS:5.*:*)
83809885543Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
83909885543Smrg	exit ;;
84009885543Smrg    *:GNU:*:*)
84109885543Smrg	# the GNU system
84209885543Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
84309885543Smrg	exit ;;
84409885543Smrg    *:GNU/*:*:*)
84509885543Smrg	# other systems with GNU libc and userland
84609885543Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
84709885543Smrg	exit ;;
84809885543Smrg    i*86:Minix:*:*)
84909885543Smrg	echo ${UNAME_MACHINE}-pc-minix
85009885543Smrg	exit ;;
85109885543Smrg    arm*:Linux:*:*)
8527104f784Smrg	eval $set_cc_for_build
8537104f784Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
8547104f784Smrg	    | grep -q __ARM_EABI__
8557104f784Smrg	then
8562ec8c4b4Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
8577104f784Smrg	else
8582ec8c4b4Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
8597104f784Smrg	fi
86009885543Smrg	exit ;;
86109885543Smrg    avr32*:Linux:*:*)
8622ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
86309885543Smrg	exit ;;
86409885543Smrg    cris:Linux:*:*)
8652ec8c4b4Smrg	echo cris-axis-linux-gnu
86609885543Smrg	exit ;;
86709885543Smrg    crisv32:Linux:*:*)
8682ec8c4b4Smrg	echo crisv32-axis-linux-gnu
86909885543Smrg	exit ;;
87009885543Smrg    frv:Linux:*:*)
8712ec8c4b4Smrg    	echo frv-unknown-linux-gnu
87209885543Smrg	exit ;;
87309885543Smrg    ia64:Linux:*:*)
8742ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
87509885543Smrg	exit ;;
87609885543Smrg    m32r*:Linux:*:*)
8772ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
87809885543Smrg	exit ;;
87909885543Smrg    m68*:Linux:*:*)
8802ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
88109885543Smrg	exit ;;
88209885543Smrg    mips:Linux:*:*)
88309885543Smrg	eval $set_cc_for_build
88409885543Smrg	sed 's/^	//' << EOF >$dummy.c
88509885543Smrg	#undef CPU
88609885543Smrg	#undef mips
88709885543Smrg	#undef mipsel
88809885543Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
88909885543Smrg	CPU=mipsel
89009885543Smrg	#else
89109885543Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
89209885543Smrg	CPU=mips
89309885543Smrg	#else
89409885543Smrg	CPU=
89509885543Smrg	#endif
89609885543Smrg	#endif
89709885543SmrgEOF
89809885543Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
89909885543Smrg	    /^CPU/{
90009885543Smrg		s: ::g
90109885543Smrg		p
90209885543Smrg	    }'`"
9032ec8c4b4Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
90409885543Smrg	;;
90509885543Smrg    mips64:Linux:*:*)
90609885543Smrg	eval $set_cc_for_build
90709885543Smrg	sed 's/^	//' << EOF >$dummy.c
90809885543Smrg	#undef CPU
90909885543Smrg	#undef mips64
91009885543Smrg	#undef mips64el
91109885543Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
91209885543Smrg	CPU=mips64el
91309885543Smrg	#else
91409885543Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
91509885543Smrg	CPU=mips64
91609885543Smrg	#else
91709885543Smrg	CPU=
91809885543Smrg	#endif
91909885543Smrg	#endif
92009885543SmrgEOF
92109885543Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
92209885543Smrg	    /^CPU/{
92309885543Smrg		s: ::g
92409885543Smrg		p
92509885543Smrg	    }'`"
9262ec8c4b4Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
92709885543Smrg	;;
92809885543Smrg    or32:Linux:*:*)
9292ec8c4b4Smrg	echo or32-unknown-linux-gnu
93009885543Smrg	exit ;;
93109885543Smrg    ppc:Linux:*:*)
9322ec8c4b4Smrg	echo powerpc-unknown-linux-gnu
93309885543Smrg	exit ;;
93409885543Smrg    ppc64:Linux:*:*)
9352ec8c4b4Smrg	echo powerpc64-unknown-linux-gnu
93609885543Smrg	exit ;;
93709885543Smrg    alpha:Linux:*:*)
93809885543Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
93909885543Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
94009885543Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
94109885543Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
94209885543Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
94309885543Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
94409885543Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
94509885543Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
94609885543Smrg        esac
94709885543Smrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
9482ec8c4b4Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
9492ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
9502ec8c4b4Smrg	exit ;;
9512ec8c4b4Smrg    padre:Linux:*:*)
9522ec8c4b4Smrg	echo sparc-unknown-linux-gnu
95309885543Smrg	exit ;;
95409885543Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
95509885543Smrg	# Look for CPU level
95609885543Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
9572ec8c4b4Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
9582ec8c4b4Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
9592ec8c4b4Smrg	  *)    echo hppa-unknown-linux-gnu ;;
96009885543Smrg	esac
96109885543Smrg	exit ;;
96209885543Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
9632ec8c4b4Smrg	echo hppa64-unknown-linux-gnu
96409885543Smrg	exit ;;
96509885543Smrg    s390:Linux:*:* | s390x:Linux:*:*)
96609885543Smrg	echo ${UNAME_MACHINE}-ibm-linux
96709885543Smrg	exit ;;
96809885543Smrg    sh64*:Linux:*:*)
9692ec8c4b4Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
97009885543Smrg	exit ;;
97109885543Smrg    sh*:Linux:*:*)
9722ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
97309885543Smrg	exit ;;
97409885543Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
9752ec8c4b4Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
97609885543Smrg	exit ;;
97709885543Smrg    vax:Linux:*:*)
9782ec8c4b4Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
97909885543Smrg	exit ;;
98009885543Smrg    x86_64:Linux:*:*)
9812ec8c4b4Smrg	echo x86_64-unknown-linux-gnu
9827104f784Smrg	exit ;;
9837104f784Smrg    xtensa*:Linux:*:*)
9842ec8c4b4Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
98509885543Smrg	exit ;;
98609885543Smrg    i*86:Linux:*:*)
98709885543Smrg	# The BFD linker knows what the default object file format is, so
98809885543Smrg	# first see if it will tell us. cd to the root directory to prevent
98909885543Smrg	# problems with other programs or directories called `ld' in the path.
99009885543Smrg	# Set LC_ALL=C to ensure ld outputs messages in English.
99109885543Smrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
99209885543Smrg			 | sed -ne '/supported targets:/!d
99309885543Smrg				    s/[ 	][ 	]*/ /g
99409885543Smrg				    s/.*supported targets: *//
99509885543Smrg				    s/ .*//
99609885543Smrg				    p'`
99709885543Smrg        case "$ld_supported_targets" in
99809885543Smrg	  elf32-i386)
9992ec8c4b4Smrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
100009885543Smrg		;;
100109885543Smrg	  a.out-i386-linux)
10022ec8c4b4Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
100309885543Smrg		exit ;;
100409885543Smrg	  "")
100509885543Smrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
100609885543Smrg		# one that does not give us useful --help.
10072ec8c4b4Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
100809885543Smrg		exit ;;
100909885543Smrg	esac
101009885543Smrg	# Determine whether the default compiler is a.out or elf
101109885543Smrg	eval $set_cc_for_build
101209885543Smrg	sed 's/^	//' << EOF >$dummy.c
101309885543Smrg	#include <features.h>
101409885543Smrg	#ifdef __ELF__
101509885543Smrg	# ifdef __GLIBC__
101609885543Smrg	#  if __GLIBC__ >= 2
101709885543Smrg	LIBC=gnu
101809885543Smrg	#  else
101909885543Smrg	LIBC=gnulibc1
102009885543Smrg	#  endif
102109885543Smrg	# else
102209885543Smrg	LIBC=gnulibc1
102309885543Smrg	# endif
102409885543Smrg	#else
102509885543Smrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
102609885543Smrg	LIBC=gnu
102709885543Smrg	#else
102809885543Smrg	LIBC=gnuaout
102909885543Smrg	#endif
103009885543Smrg	#endif
103109885543Smrg	#ifdef __dietlibc__
103209885543Smrg	LIBC=dietlibc
103309885543Smrg	#endif
103409885543SmrgEOF
103509885543Smrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
103609885543Smrg	    /^LIBC/{
103709885543Smrg		s: ::g
103809885543Smrg		p
103909885543Smrg	    }'`"
104009885543Smrg	test x"${LIBC}" != x && {
104109885543Smrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
104209885543Smrg		exit
104309885543Smrg	}
104409885543Smrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
104509885543Smrg	;;
104609885543Smrg    i*86:DYNIX/ptx:4*:*)
104709885543Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
104809885543Smrg	# earlier versions are messed up and put the nodename in both
104909885543Smrg	# sysname and nodename.
105009885543Smrg	echo i386-sequent-sysv4
105109885543Smrg	exit ;;
105209885543Smrg    i*86:UNIX_SV:4.2MP:2.*)
105309885543Smrg        # Unixware is an offshoot of SVR4, but it has its own version
105409885543Smrg        # number series starting with 2...
105509885543Smrg        # I am not positive that other SVR4 systems won't match this,
105609885543Smrg	# I just have to hope.  -- rms.
105709885543Smrg        # Use sysv4.2uw... so that sysv4* matches it.
105809885543Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
105909885543Smrg	exit ;;
106009885543Smrg    i*86:OS/2:*:*)
106109885543Smrg	# If we were able to find `uname', then EMX Unix compatibility
106209885543Smrg	# is probably installed.
106309885543Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
106409885543Smrg	exit ;;
106509885543Smrg    i*86:XTS-300:*:STOP)
106609885543Smrg	echo ${UNAME_MACHINE}-unknown-stop
106709885543Smrg	exit ;;
106809885543Smrg    i*86:atheos:*:*)
106909885543Smrg	echo ${UNAME_MACHINE}-unknown-atheos
107009885543Smrg	exit ;;
107109885543Smrg    i*86:syllable:*:*)
107209885543Smrg	echo ${UNAME_MACHINE}-pc-syllable
107309885543Smrg	exit ;;
107409885543Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
107509885543Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
107609885543Smrg	exit ;;
107709885543Smrg    i*86:*DOS:*:*)
107809885543Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
107909885543Smrg	exit ;;
108009885543Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
108109885543Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
108209885543Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
108309885543Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
108409885543Smrg	else
108509885543Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
108609885543Smrg	fi
108709885543Smrg	exit ;;
108809885543Smrg    i*86:*:5:[678]*)
108909885543Smrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
109009885543Smrg	case `/bin/uname -X | grep "^Machine"` in
109109885543Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
109209885543Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
109309885543Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
109409885543Smrg	esac
109509885543Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
109609885543Smrg	exit ;;
109709885543Smrg    i*86:*:3.2:*)
109809885543Smrg	if test -f /usr/options/cb.name; then
109909885543Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
110009885543Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
110109885543Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
110209885543Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
110309885543Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
110409885543Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
110509885543Smrg			&& UNAME_MACHINE=i586
110609885543Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
110709885543Smrg			&& UNAME_MACHINE=i686
110809885543Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
110909885543Smrg			&& UNAME_MACHINE=i686
111009885543Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
111109885543Smrg	else
111209885543Smrg		echo ${UNAME_MACHINE}-pc-sysv32
111309885543Smrg	fi
111409885543Smrg	exit ;;
111509885543Smrg    pc:*:*:*)
111609885543Smrg	# Left here for compatibility:
111709885543Smrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
111809885543Smrg        # the processor, so we play safe by assuming i386.
111909885543Smrg	echo i386-pc-msdosdjgpp
112009885543Smrg        exit ;;
112109885543Smrg    Intel:Mach:3*:*)
112209885543Smrg	echo i386-pc-mach3
112309885543Smrg	exit ;;
112409885543Smrg    paragon:*:*:*)
112509885543Smrg	echo i860-intel-osf1
112609885543Smrg	exit ;;
112709885543Smrg    i860:*:4.*:*) # i860-SVR4
112809885543Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
112909885543Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
113009885543Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
113109885543Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
113209885543Smrg	fi
113309885543Smrg	exit ;;
113409885543Smrg    mini*:CTIX:SYS*5:*)
113509885543Smrg	# "miniframe"
113609885543Smrg	echo m68010-convergent-sysv
113709885543Smrg	exit ;;
113809885543Smrg    mc68k:UNIX:SYSTEM5:3.51m)
113909885543Smrg	echo m68k-convergent-sysv
114009885543Smrg	exit ;;
114109885543Smrg    M680?0:D-NIX:5.3:*)
114209885543Smrg	echo m68k-diab-dnix
114309885543Smrg	exit ;;
114409885543Smrg    M68*:*:R3V[5678]*:*)
114509885543Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
114609885543Smrg    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)
114709885543Smrg	OS_REL=''
114809885543Smrg	test -r /etc/.relid \
114909885543Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
115009885543Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
115109885543Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
115209885543Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
115309885543Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
115409885543Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
115509885543Smrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
115609885543Smrg          && { echo i486-ncr-sysv4; exit; } ;;
115709885543Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
115809885543Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
115909885543Smrg	exit ;;
116009885543Smrg    mc68030:UNIX_System_V:4.*:*)
116109885543Smrg	echo m68k-atari-sysv4
116209885543Smrg	exit ;;
116309885543Smrg    TSUNAMI:LynxOS:2.*:*)
116409885543Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
116509885543Smrg	exit ;;
116609885543Smrg    rs6000:LynxOS:2.*:*)
116709885543Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
116809885543Smrg	exit ;;
116909885543Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
117009885543Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
117109885543Smrg	exit ;;
117209885543Smrg    SM[BE]S:UNIX_SV:*:*)
117309885543Smrg	echo mips-dde-sysv${UNAME_RELEASE}
117409885543Smrg	exit ;;
117509885543Smrg    RM*:ReliantUNIX-*:*:*)
117609885543Smrg	echo mips-sni-sysv4
117709885543Smrg	exit ;;
117809885543Smrg    RM*:SINIX-*:*:*)
117909885543Smrg	echo mips-sni-sysv4
118009885543Smrg	exit ;;
118109885543Smrg    *:SINIX-*:*:*)
118209885543Smrg	if uname -p 2>/dev/null >/dev/null ; then
118309885543Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
118409885543Smrg		echo ${UNAME_MACHINE}-sni-sysv4
118509885543Smrg	else
118609885543Smrg		echo ns32k-sni-sysv
118709885543Smrg	fi
118809885543Smrg	exit ;;
118909885543Smrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
119009885543Smrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
119109885543Smrg        echo i586-unisys-sysv4
119209885543Smrg        exit ;;
119309885543Smrg    *:UNIX_System_V:4*:FTX*)
119409885543Smrg	# From Gerald Hewes <hewes@openmarket.com>.
119509885543Smrg	# How about differentiating between stratus architectures? -djm
119609885543Smrg	echo hppa1.1-stratus-sysv4
119709885543Smrg	exit ;;
119809885543Smrg    *:*:*:FTX*)
119909885543Smrg	# From seanf@swdc.stratus.com.
120009885543Smrg	echo i860-stratus-sysv4
120109885543Smrg	exit ;;
120209885543Smrg    i*86:VOS:*:*)
120309885543Smrg	# From Paul.Green@stratus.com.
120409885543Smrg	echo ${UNAME_MACHINE}-stratus-vos
120509885543Smrg	exit ;;
120609885543Smrg    *:VOS:*:*)
120709885543Smrg	# From Paul.Green@stratus.com.
120809885543Smrg	echo hppa1.1-stratus-vos
120909885543Smrg	exit ;;
121009885543Smrg    mc68*:A/UX:*:*)
121109885543Smrg	echo m68k-apple-aux${UNAME_RELEASE}
121209885543Smrg	exit ;;
121309885543Smrg    news*:NEWS-OS:6*:*)
121409885543Smrg	echo mips-sony-newsos6
121509885543Smrg	exit ;;
121609885543Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
121709885543Smrg	if [ -d /usr/nec ]; then
121809885543Smrg	        echo mips-nec-sysv${UNAME_RELEASE}
121909885543Smrg	else
122009885543Smrg	        echo mips-unknown-sysv${UNAME_RELEASE}
122109885543Smrg	fi
122209885543Smrg        exit ;;
122309885543Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
122409885543Smrg	echo powerpc-be-beos
122509885543Smrg	exit ;;
122609885543Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
122709885543Smrg	echo powerpc-apple-beos
122809885543Smrg	exit ;;
122909885543Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
123009885543Smrg	echo i586-pc-beos
123109885543Smrg	exit ;;
12322ec8c4b4Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
12332ec8c4b4Smrg	echo i586-pc-haiku
12342ec8c4b4Smrg	exit ;;
123509885543Smrg    SX-4:SUPER-UX:*:*)
123609885543Smrg	echo sx4-nec-superux${UNAME_RELEASE}
123709885543Smrg	exit ;;
123809885543Smrg    SX-5:SUPER-UX:*:*)
123909885543Smrg	echo sx5-nec-superux${UNAME_RELEASE}
124009885543Smrg	exit ;;
124109885543Smrg    SX-6:SUPER-UX:*:*)
124209885543Smrg	echo sx6-nec-superux${UNAME_RELEASE}
124309885543Smrg	exit ;;
12447104f784Smrg    SX-7:SUPER-UX:*:*)
12457104f784Smrg	echo sx7-nec-superux${UNAME_RELEASE}
12467104f784Smrg	exit ;;
12477104f784Smrg    SX-8:SUPER-UX:*:*)
12487104f784Smrg	echo sx8-nec-superux${UNAME_RELEASE}
12497104f784Smrg	exit ;;
12507104f784Smrg    SX-8R:SUPER-UX:*:*)
12517104f784Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
12527104f784Smrg	exit ;;
125309885543Smrg    Power*:Rhapsody:*:*)
125409885543Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
125509885543Smrg	exit ;;
125609885543Smrg    *:Rhapsody:*:*)
125709885543Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
125809885543Smrg	exit ;;
125909885543Smrg    *:Darwin:*:*)
126009885543Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
126109885543Smrg	case $UNAME_PROCESSOR in
126209885543Smrg	    unknown) UNAME_PROCESSOR=powerpc ;;
126309885543Smrg	esac
126409885543Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
126509885543Smrg	exit ;;
126609885543Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
126709885543Smrg	UNAME_PROCESSOR=`uname -p`
126809885543Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
126909885543Smrg		UNAME_PROCESSOR=i386
127009885543Smrg		UNAME_MACHINE=pc
127109885543Smrg	fi
127209885543Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
127309885543Smrg	exit ;;
127409885543Smrg    *:QNX:*:4*)
127509885543Smrg	echo i386-pc-qnx
127609885543Smrg	exit ;;
127709885543Smrg    NSE-?:NONSTOP_KERNEL:*:*)
127809885543Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
127909885543Smrg	exit ;;
128009885543Smrg    NSR-?:NONSTOP_KERNEL:*:*)
128109885543Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
128209885543Smrg	exit ;;
128309885543Smrg    *:NonStop-UX:*:*)
128409885543Smrg	echo mips-compaq-nonstopux
128509885543Smrg	exit ;;
128609885543Smrg    BS2000:POSIX*:*:*)
128709885543Smrg	echo bs2000-siemens-sysv
128809885543Smrg	exit ;;
128909885543Smrg    DS/*:UNIX_System_V:*:*)
129009885543Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
129109885543Smrg	exit ;;
129209885543Smrg    *:Plan9:*:*)
129309885543Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
129409885543Smrg	# is converted to i386 for consistency with other x86
129509885543Smrg	# operating systems.
129609885543Smrg	if test "$cputype" = "386"; then
129709885543Smrg	    UNAME_MACHINE=i386
129809885543Smrg	else
129909885543Smrg	    UNAME_MACHINE="$cputype"
130009885543Smrg	fi
130109885543Smrg	echo ${UNAME_MACHINE}-unknown-plan9
130209885543Smrg	exit ;;
130309885543Smrg    *:TOPS-10:*:*)
130409885543Smrg	echo pdp10-unknown-tops10
130509885543Smrg	exit ;;
130609885543Smrg    *:TENEX:*:*)
130709885543Smrg	echo pdp10-unknown-tenex
130809885543Smrg	exit ;;
130909885543Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
131009885543Smrg	echo pdp10-dec-tops20
131109885543Smrg	exit ;;
131209885543Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
131309885543Smrg	echo pdp10-xkl-tops20
131409885543Smrg	exit ;;
131509885543Smrg    *:TOPS-20:*:*)
131609885543Smrg	echo pdp10-unknown-tops20
131709885543Smrg	exit ;;
131809885543Smrg    *:ITS:*:*)
131909885543Smrg	echo pdp10-unknown-its
132009885543Smrg	exit ;;
132109885543Smrg    SEI:*:*:SEIUX)
132209885543Smrg        echo mips-sei-seiux${UNAME_RELEASE}
132309885543Smrg	exit ;;
132409885543Smrg    *:DragonFly:*:*)
132509885543Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
132609885543Smrg	exit ;;
132709885543Smrg    *:*VMS:*:*)
132809885543Smrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
132909885543Smrg	case "${UNAME_MACHINE}" in
133009885543Smrg	    A*) echo alpha-dec-vms ; exit ;;
133109885543Smrg	    I*) echo ia64-dec-vms ; exit ;;
133209885543Smrg	    V*) echo vax-dec-vms ; exit ;;
133309885543Smrg	esac ;;
133409885543Smrg    *:XENIX:*:SysV)
133509885543Smrg	echo i386-pc-xenix
133609885543Smrg	exit ;;
133709885543Smrg    i*86:skyos:*:*)
133809885543Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
133909885543Smrg	exit ;;
134009885543Smrg    i*86:rdos:*:*)
134109885543Smrg	echo ${UNAME_MACHINE}-pc-rdos
134209885543Smrg	exit ;;
134309885543Smrgesac
134409885543Smrg
134509885543Smrg#echo '(No uname command or uname output not recognized.)' 1>&2
134609885543Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
134709885543Smrg
134809885543Smrgeval $set_cc_for_build
134909885543Smrgcat >$dummy.c <<EOF
135009885543Smrg#ifdef _SEQUENT_
135109885543Smrg# include <sys/types.h>
135209885543Smrg# include <sys/utsname.h>
135309885543Smrg#endif
135409885543Smrgmain ()
135509885543Smrg{
135609885543Smrg#if defined (sony)
135709885543Smrg#if defined (MIPSEB)
135809885543Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
135909885543Smrg     I don't know....  */
136009885543Smrg  printf ("mips-sony-bsd\n"); exit (0);
136109885543Smrg#else
136209885543Smrg#include <sys/param.h>
136309885543Smrg  printf ("m68k-sony-newsos%s\n",
136409885543Smrg#ifdef NEWSOS4
136509885543Smrg          "4"
136609885543Smrg#else
136709885543Smrg	  ""
136809885543Smrg#endif
136909885543Smrg         ); exit (0);
137009885543Smrg#endif
137109885543Smrg#endif
137209885543Smrg
137309885543Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
137409885543Smrg  printf ("arm-acorn-riscix\n"); exit (0);
137509885543Smrg#endif
137609885543Smrg
137709885543Smrg#if defined (hp300) && !defined (hpux)
137809885543Smrg  printf ("m68k-hp-bsd\n"); exit (0);
137909885543Smrg#endif
138009885543Smrg
138109885543Smrg#if defined (NeXT)
138209885543Smrg#if !defined (__ARCHITECTURE__)
138309885543Smrg#define __ARCHITECTURE__ "m68k"
138409885543Smrg#endif
138509885543Smrg  int version;
138609885543Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
138709885543Smrg  if (version < 4)
138809885543Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
138909885543Smrg  else
139009885543Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
139109885543Smrg  exit (0);
139209885543Smrg#endif
139309885543Smrg
139409885543Smrg#if defined (MULTIMAX) || defined (n16)
139509885543Smrg#if defined (UMAXV)
139609885543Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
139709885543Smrg#else
139809885543Smrg#if defined (CMU)
139909885543Smrg  printf ("ns32k-encore-mach\n"); exit (0);
140009885543Smrg#else
140109885543Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
140209885543Smrg#endif
140309885543Smrg#endif
140409885543Smrg#endif
140509885543Smrg
140609885543Smrg#if defined (__386BSD__)
140709885543Smrg  printf ("i386-pc-bsd\n"); exit (0);
140809885543Smrg#endif
140909885543Smrg
141009885543Smrg#if defined (sequent)
141109885543Smrg#if defined (i386)
141209885543Smrg  printf ("i386-sequent-dynix\n"); exit (0);
141309885543Smrg#endif
141409885543Smrg#if defined (ns32000)
141509885543Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
141609885543Smrg#endif
141709885543Smrg#endif
141809885543Smrg
141909885543Smrg#if defined (_SEQUENT_)
142009885543Smrg    struct utsname un;
142109885543Smrg
142209885543Smrg    uname(&un);
142309885543Smrg
142409885543Smrg    if (strncmp(un.version, "V2", 2) == 0) {
142509885543Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
142609885543Smrg    }
142709885543Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
142809885543Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
142909885543Smrg    }
143009885543Smrg    printf ("i386-sequent-ptx\n"); exit (0);
143109885543Smrg
143209885543Smrg#endif
143309885543Smrg
143409885543Smrg#if defined (vax)
143509885543Smrg# if !defined (ultrix)
143609885543Smrg#  include <sys/param.h>
143709885543Smrg#  if defined (BSD)
143809885543Smrg#   if BSD == 43
143909885543Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
144009885543Smrg#   else
144109885543Smrg#    if BSD == 199006
144209885543Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
144309885543Smrg#    else
144409885543Smrg      printf ("vax-dec-bsd\n"); exit (0);
144509885543Smrg#    endif
144609885543Smrg#   endif
144709885543Smrg#  else
144809885543Smrg    printf ("vax-dec-bsd\n"); exit (0);
144909885543Smrg#  endif
145009885543Smrg# else
145109885543Smrg    printf ("vax-dec-ultrix\n"); exit (0);
145209885543Smrg# endif
145309885543Smrg#endif
145409885543Smrg
145509885543Smrg#if defined (alliant) && defined (i860)
145609885543Smrg  printf ("i860-alliant-bsd\n"); exit (0);
145709885543Smrg#endif
145809885543Smrg
145909885543Smrg  exit (1);
146009885543Smrg}
146109885543SmrgEOF
146209885543Smrg
146309885543Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
146409885543Smrg	{ echo "$SYSTEM_NAME"; exit; }
146509885543Smrg
146609885543Smrg# Apollos put the system type in the environment.
146709885543Smrg
146809885543Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
146909885543Smrg
147009885543Smrg# Convex versions that predate uname can use getsysinfo(1)
147109885543Smrg
147209885543Smrgif [ -x /usr/convex/getsysinfo ]
147309885543Smrgthen
147409885543Smrg    case `getsysinfo -f cpu_type` in
147509885543Smrg    c1*)
147609885543Smrg	echo c1-convex-bsd
147709885543Smrg	exit ;;
147809885543Smrg    c2*)
147909885543Smrg	if getsysinfo -f scalar_acc
148009885543Smrg	then echo c32-convex-bsd
148109885543Smrg	else echo c2-convex-bsd
148209885543Smrg	fi
148309885543Smrg	exit ;;
148409885543Smrg    c34*)
148509885543Smrg	echo c34-convex-bsd
148609885543Smrg	exit ;;
148709885543Smrg    c38*)
148809885543Smrg	echo c38-convex-bsd
148909885543Smrg	exit ;;
149009885543Smrg    c4*)
149109885543Smrg	echo c4-convex-bsd
149209885543Smrg	exit ;;
149309885543Smrg    esac
149409885543Smrgfi
149509885543Smrg
149609885543Smrgcat >&2 <<EOF
149709885543Smrg$0: unable to guess system type
149809885543Smrg
149909885543SmrgThis script, last modified $timestamp, has failed to recognize
150009885543Smrgthe operating system you are using. It is advised that you
150109885543Smrgdownload the most up to date version of the config scripts from
150209885543Smrg
15037104f784Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
150409885543Smrgand
15057104f784Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
150609885543Smrg
150709885543SmrgIf the version you run ($0) is already up to date, please
150809885543Smrgsend the following data and any information you think might be
150909885543Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
151009885543Smrginformation to handle your system.
151109885543Smrg
151209885543Smrgconfig.guess timestamp = $timestamp
151309885543Smrg
151409885543Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
151509885543Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
151609885543Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
151709885543Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
151809885543Smrg
151909885543Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
152009885543Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
152109885543Smrg
152209885543Smrghostinfo               = `(hostinfo) 2>/dev/null`
152309885543Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
152409885543Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
152509885543Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
152609885543Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
152709885543Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
152809885543Smrg
152909885543SmrgUNAME_MACHINE = ${UNAME_MACHINE}
153009885543SmrgUNAME_RELEASE = ${UNAME_RELEASE}
153109885543SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
153209885543SmrgUNAME_VERSION = ${UNAME_VERSION}
153309885543SmrgEOF
153409885543Smrg
153509885543Smrgexit 1
153609885543Smrg
153709885543Smrg# Local variables:
153809885543Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
153909885543Smrg# time-stamp-start: "timestamp='"
154009885543Smrg# time-stamp-format: "%:y-%02m-%02d"
154109885543Smrg# time-stamp-end: "'"
154209885543Smrg# End:
1543