config.guess revision 079e7944
10eb10989Smrg#! /bin/sh
20eb10989Smrg# Attempt to guess a canonical system name.
3079e7944Smrg#   Copyright 1992-2013 Free Software Foundation, Inc.
40eb10989Smrg
5079e7944Smrgtimestamp='2013-06-10'
60eb10989Smrg
70eb10989Smrg# This file is free software; you can redistribute it and/or modify it
80eb10989Smrg# under the terms of the GNU General Public License as published by
9079e7944Smrg# the Free Software Foundation; either version 3 of the License, or
100eb10989Smrg# (at your option) any later version.
110eb10989Smrg#
120eb10989Smrg# This program is distributed in the hope that it will be useful, but
130eb10989Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
140eb10989Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
150eb10989Smrg# General Public License for more details.
160eb10989Smrg#
170eb10989Smrg# You should have received a copy of the GNU General Public License
18079e7944Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
190eb10989Smrg#
200eb10989Smrg# As a special exception to the GNU General Public License, if you
210eb10989Smrg# distribute this file as part of a program that contains a
220eb10989Smrg# configuration script generated by Autoconf, you may include it under
23079e7944Smrg# the same distribution terms that you use for the rest of that
24079e7944Smrg# program.  This Exception is an additional permission under section 7
25079e7944Smrg# of the GNU General Public License, version 3 ("GPLv3").
260eb10989Smrg#
27079e7944Smrg# Originally written by Per Bothner.
280eb10989Smrg#
29e4c0bf4dSmrg# You can get the latest version of this script from:
30e4c0bf4dSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
31079e7944Smrg#
32079e7944Smrg# Please send patches with a ChangeLog entry to config-patches@gnu.org.
33079e7944Smrg
340eb10989Smrg
350eb10989Smrgme=`echo "$0" | sed -e 's,.*/,,'`
360eb10989Smrg
370eb10989Smrgusage="\
380eb10989SmrgUsage: $0 [OPTION]
390eb10989Smrg
400eb10989SmrgOutput the configuration name of the system \`$me' is run on.
410eb10989Smrg
420eb10989SmrgOperation modes:
430eb10989Smrg  -h, --help         print this help, then exit
440eb10989Smrg  -t, --time-stamp   print date of last modification, then exit
450eb10989Smrg  -v, --version      print version number, then exit
460eb10989Smrg
470eb10989SmrgReport bugs and patches to <config-patches@gnu.org>."
480eb10989Smrg
490eb10989Smrgversion="\
500eb10989SmrgGNU config.guess ($timestamp)
510eb10989Smrg
520eb10989SmrgOriginally written by Per Bothner.
53079e7944SmrgCopyright 1992-2013 Free Software Foundation, Inc.
540eb10989Smrg
550eb10989SmrgThis is free software; see the source for copying conditions.  There is NO
560eb10989Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
570eb10989Smrg
580eb10989Smrghelp="
590eb10989SmrgTry \`$me --help' for more information."
600eb10989Smrg
610eb10989Smrg# Parse command line
620eb10989Smrgwhile test $# -gt 0 ; do
630eb10989Smrg  case $1 in
640eb10989Smrg    --time-stamp | --time* | -t )
6563165362Smrg       echo "$timestamp" ; exit ;;
660eb10989Smrg    --version | -v )
6763165362Smrg       echo "$version" ; exit ;;
680eb10989Smrg    --help | --h* | -h )
6963165362Smrg       echo "$usage"; exit ;;
700eb10989Smrg    -- )     # Stop option processing
710eb10989Smrg       shift; break ;;
720eb10989Smrg    - )	# Use stdin as input.
730eb10989Smrg       break ;;
740eb10989Smrg    -* )
750eb10989Smrg       echo "$me: invalid option $1$help" >&2
760eb10989Smrg       exit 1 ;;
770eb10989Smrg    * )
780eb10989Smrg       break ;;
790eb10989Smrg  esac
800eb10989Smrgdone
810eb10989Smrg
820eb10989Smrgif test $# != 0; then
830eb10989Smrg  echo "$me: too many arguments$help" >&2
840eb10989Smrg  exit 1
850eb10989Smrgfi
860eb10989Smrg
87079e7944Smrgtrap 'exit 1' 1 2 15
880eb10989Smrg
890eb10989Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
900eb10989Smrg# compiler to aid in system detection is discouraged as it requires
910eb10989Smrg# temporary files to be created and, as you can see below, it is a
920eb10989Smrg# headache to deal with in a portable fashion.
930eb10989Smrg
940eb10989Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
950eb10989Smrg# use `HOST_CC' if defined, but it is deprecated.
960eb10989Smrg
970eb10989Smrg# Portable tmp directory creation inspired by the Autoconf team.
980eb10989Smrg
990eb10989Smrgset_cc_for_build='
1000eb10989Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101079e7944Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1020eb10989Smrg: ${TMPDIR=/tmp} ;
10363165362Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1040eb10989Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1050eb10989Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1060eb10989Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1070eb10989Smrgdummy=$tmp/dummy ;
1080eb10989Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1090eb10989Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
1100eb10989Smrg ,,)    echo "int x;" > $dummy.c ;
1110eb10989Smrg	for c in cc gcc c89 c99 ; do
1120eb10989Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
1130eb10989Smrg	     CC_FOR_BUILD="$c"; break ;
1140eb10989Smrg	  fi ;
1150eb10989Smrg	done ;
1160eb10989Smrg	if test x"$CC_FOR_BUILD" = x ; then
1170eb10989Smrg	  CC_FOR_BUILD=no_compiler_found ;
1180eb10989Smrg	fi
1190eb10989Smrg	;;
1200eb10989Smrg ,,*)   CC_FOR_BUILD=$CC ;;
1210eb10989Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12263165362Smrgesac ; set_cc_for_build= ;'
1230eb10989Smrg
1240eb10989Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1250eb10989Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
1260eb10989Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1270eb10989Smrg	PATH=$PATH:/.attbin ; export PATH
1280eb10989Smrgfi
1290eb10989Smrg
1300eb10989SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1310eb10989SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1320eb10989SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1330eb10989SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1340eb10989Smrg
135079e7944Smrgcase "${UNAME_SYSTEM}" in
136079e7944SmrgLinux|GNU|GNU/*)
137079e7944Smrg	# If the system lacks a compiler, then just pick glibc.
138079e7944Smrg	# We could probably try harder.
139079e7944Smrg	LIBC=gnu
140079e7944Smrg
141079e7944Smrg	eval $set_cc_for_build
142079e7944Smrg	cat <<-EOF > $dummy.c
143079e7944Smrg	#include <features.h>
144079e7944Smrg	#if defined(__UCLIBC__)
145079e7944Smrg	LIBC=uclibc
146079e7944Smrg	#elif defined(__dietlibc__)
147079e7944Smrg	LIBC=dietlibc
148079e7944Smrg	#else
149079e7944Smrg	LIBC=gnu
150079e7944Smrg	#endif
151079e7944Smrg	EOF
152079e7944Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
153079e7944Smrg	;;
154079e7944Smrgesac
155079e7944Smrg
1560eb10989Smrg# Note: order is significant - the case branches are not exclusive.
1570eb10989Smrg
1580eb10989Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
1590eb10989Smrg    *:NetBSD:*:*)
1600eb10989Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
161079e7944Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1620eb10989Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1630eb10989Smrg	# switched to ELF, *-*-netbsd* would select the old
1640eb10989Smrg	# object file format.  This provides both forward
1650eb10989Smrg	# compatibility and a consistent mechanism for selecting the
1660eb10989Smrg	# object file format.
1670eb10989Smrg	#
1680eb10989Smrg	# Note: NetBSD doesn't particularly care about the vendor
1690eb10989Smrg	# portion of the name.  We always set it to "unknown".
1700eb10989Smrg	sysctl="sysctl -n hw.machine_arch"
1710eb10989Smrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
1720eb10989Smrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
1730eb10989Smrg	case "${UNAME_MACHINE_ARCH}" in
1740eb10989Smrg	    armeb) machine=armeb-unknown ;;
1750eb10989Smrg	    arm*) machine=arm-unknown ;;
1760eb10989Smrg	    sh3el) machine=shl-unknown ;;
1770eb10989Smrg	    sh3eb) machine=sh-unknown ;;
1780eb10989Smrg	    sh5el) machine=sh5le-unknown ;;
1790eb10989Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
1800eb10989Smrg	esac
1810eb10989Smrg	# The Operating System including object format, if it has switched
1820eb10989Smrg	# to ELF recently, or will in the future.
1830eb10989Smrg	case "${UNAME_MACHINE_ARCH}" in
1840eb10989Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
1850eb10989Smrg		eval $set_cc_for_build
1860eb10989Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
187e4c0bf4dSmrg			| grep -q __ELF__
1880eb10989Smrg		then
1890eb10989Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
1900eb10989Smrg		    # Return netbsd for either.  FIX?
1910eb10989Smrg		    os=netbsd
1920eb10989Smrg		else
1930eb10989Smrg		    os=netbsdelf
1940eb10989Smrg		fi
1950eb10989Smrg		;;
1960eb10989Smrg	    *)
197079e7944Smrg		os=netbsd
1980eb10989Smrg		;;
1990eb10989Smrg	esac
2000eb10989Smrg	# The OS release
2010eb10989Smrg	# Debian GNU/NetBSD machines have a different userland, and
2020eb10989Smrg	# thus, need a distinct triplet. However, they do not need
2030eb10989Smrg	# kernel version information, so it can be replaced with a
2040eb10989Smrg	# suitable tag, in the style of linux-gnu.
2050eb10989Smrg	case "${UNAME_VERSION}" in
2060eb10989Smrg	    Debian*)
2070eb10989Smrg		release='-gnu'
2080eb10989Smrg		;;
2090eb10989Smrg	    *)
2100eb10989Smrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
2110eb10989Smrg		;;
2120eb10989Smrg	esac
2130eb10989Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2140eb10989Smrg	# contains redundant information, the shorter form:
2150eb10989Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
2160eb10989Smrg	echo "${machine}-${os}${release}"
21763165362Smrg	exit ;;
218079e7944Smrg    *:Bitrig:*:*)
219079e7944Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
220079e7944Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
221079e7944Smrg	exit ;;
2220eb10989Smrg    *:OpenBSD:*:*)
22363165362Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
22463165362Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
22563165362Smrg	exit ;;
2260eb10989Smrg    *:ekkoBSD:*:*)
2270eb10989Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
22863165362Smrg	exit ;;
22963165362Smrg    *:SolidBSD:*:*)
23063165362Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
23163165362Smrg	exit ;;
2320eb10989Smrg    macppc:MirBSD:*:*)
23363165362Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
23463165362Smrg	exit ;;
2350eb10989Smrg    *:MirBSD:*:*)
2360eb10989Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
23763165362Smrg	exit ;;
2380eb10989Smrg    alpha:OSF1:*:*)
2390eb10989Smrg	case $UNAME_RELEASE in
2400eb10989Smrg	*4.0)
2410eb10989Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2420eb10989Smrg		;;
2430eb10989Smrg	*5.*)
244079e7944Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2450eb10989Smrg		;;
2460eb10989Smrg	esac
2470eb10989Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2480eb10989Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2490eb10989Smrg	# covers most systems running today.  This code pipes the CPU
2500eb10989Smrg	# types through head -n 1, so we only detect the type of CPU 0.
2510eb10989Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2520eb10989Smrg	case "$ALPHA_CPU_TYPE" in
2530eb10989Smrg	    "EV4 (21064)")
2540eb10989Smrg		UNAME_MACHINE="alpha" ;;
2550eb10989Smrg	    "EV4.5 (21064)")
2560eb10989Smrg		UNAME_MACHINE="alpha" ;;
2570eb10989Smrg	    "LCA4 (21066/21068)")
2580eb10989Smrg		UNAME_MACHINE="alpha" ;;
2590eb10989Smrg	    "EV5 (21164)")
2600eb10989Smrg		UNAME_MACHINE="alphaev5" ;;
2610eb10989Smrg	    "EV5.6 (21164A)")
2620eb10989Smrg		UNAME_MACHINE="alphaev56" ;;
2630eb10989Smrg	    "EV5.6 (21164PC)")
2640eb10989Smrg		UNAME_MACHINE="alphapca56" ;;
2650eb10989Smrg	    "EV5.7 (21164PC)")
2660eb10989Smrg		UNAME_MACHINE="alphapca57" ;;
2670eb10989Smrg	    "EV6 (21264)")
2680eb10989Smrg		UNAME_MACHINE="alphaev6" ;;
2690eb10989Smrg	    "EV6.7 (21264A)")
2700eb10989Smrg		UNAME_MACHINE="alphaev67" ;;
2710eb10989Smrg	    "EV6.8CB (21264C)")
2720eb10989Smrg		UNAME_MACHINE="alphaev68" ;;
2730eb10989Smrg	    "EV6.8AL (21264B)")
2740eb10989Smrg		UNAME_MACHINE="alphaev68" ;;
2750eb10989Smrg	    "EV6.8CX (21264D)")
2760eb10989Smrg		UNAME_MACHINE="alphaev68" ;;
2770eb10989Smrg	    "EV6.9A (21264/EV69A)")
2780eb10989Smrg		UNAME_MACHINE="alphaev69" ;;
2790eb10989Smrg	    "EV7 (21364)")
2800eb10989Smrg		UNAME_MACHINE="alphaev7" ;;
2810eb10989Smrg	    "EV7.9 (21364A)")
2820eb10989Smrg		UNAME_MACHINE="alphaev79" ;;
2830eb10989Smrg	esac
2840eb10989Smrg	# A Pn.n version is a patched version.
2850eb10989Smrg	# A Vn.n version is a released version.
2860eb10989Smrg	# A Tn.n version is a released field test version.
2870eb10989Smrg	# A Xn.n version is an unreleased experimental baselevel.
2880eb10989Smrg	# 1.2 uses "1.2" for uname -r.
2890eb10989Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
290079e7944Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
291079e7944Smrg	exitcode=$?
292079e7944Smrg	trap '' 0
293079e7944Smrg	exit $exitcode ;;
2940eb10989Smrg    Alpha\ *:Windows_NT*:*)
2950eb10989Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
2960eb10989Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
2970eb10989Smrg	# of the specific Alpha model?
2980eb10989Smrg	echo alpha-pc-interix
29963165362Smrg	exit ;;
3000eb10989Smrg    21064:Windows_NT:50:3)
3010eb10989Smrg	echo alpha-dec-winnt3.5
30263165362Smrg	exit ;;
3030eb10989Smrg    Amiga*:UNIX_System_V:4.0:*)
3040eb10989Smrg	echo m68k-unknown-sysv4
30563165362Smrg	exit ;;
3060eb10989Smrg    *:[Aa]miga[Oo][Ss]:*:*)
3070eb10989Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
30863165362Smrg	exit ;;
3090eb10989Smrg    *:[Mm]orph[Oo][Ss]:*:*)
3100eb10989Smrg	echo ${UNAME_MACHINE}-unknown-morphos
31163165362Smrg	exit ;;
3120eb10989Smrg    *:OS/390:*:*)
3130eb10989Smrg	echo i370-ibm-openedition
31463165362Smrg	exit ;;
31563165362Smrg    *:z/VM:*:*)
31663165362Smrg	echo s390-ibm-zvmoe
31763165362Smrg	exit ;;
3180eb10989Smrg    *:OS400:*:*)
319079e7944Smrg	echo powerpc-ibm-os400
32063165362Smrg	exit ;;
3210eb10989Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
3220eb10989Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
32363165362Smrg	exit ;;
324079e7944Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
32563165362Smrg	echo arm-unknown-riscos
32663165362Smrg	exit ;;
3270eb10989Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3280eb10989Smrg	echo hppa1.1-hitachi-hiuxmpp
32963165362Smrg	exit ;;
3300eb10989Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3310eb10989Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3320eb10989Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3330eb10989Smrg		echo pyramid-pyramid-sysv3
3340eb10989Smrg	else
3350eb10989Smrg		echo pyramid-pyramid-bsd
3360eb10989Smrg	fi
33763165362Smrg	exit ;;
3380eb10989Smrg    NILE*:*:*:dcosx)
3390eb10989Smrg	echo pyramid-pyramid-svr4
34063165362Smrg	exit ;;
3410eb10989Smrg    DRS?6000:unix:4.0:6*)
3420eb10989Smrg	echo sparc-icl-nx6
34363165362Smrg	exit ;;
34463165362Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3450eb10989Smrg	case `/usr/bin/uname -p` in
34663165362Smrg	    sparc) echo sparc-icl-nx7; exit ;;
3470eb10989Smrg	esac ;;
34863165362Smrg    s390x:SunOS:*:*)
34963165362Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35063165362Smrg	exit ;;
3510eb10989Smrg    sun4H:SunOS:5.*:*)
3520eb10989Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35363165362Smrg	exit ;;
3540eb10989Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
3550eb10989Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
35663165362Smrg	exit ;;
357e4c0bf4dSmrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
358e4c0bf4dSmrg	echo i386-pc-auroraux${UNAME_RELEASE}
359e4c0bf4dSmrg	exit ;;
36063165362Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
36163165362Smrg	eval $set_cc_for_build
36263165362Smrg	SUN_ARCH="i386"
36363165362Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
36463165362Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
36563165362Smrg	# This test works for both compilers.
36663165362Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
36763165362Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
36863165362Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
36963165362Smrg		grep IS_64BIT_ARCH >/dev/null
37063165362Smrg	    then
37163165362Smrg		SUN_ARCH="x86_64"
37263165362Smrg	    fi
37363165362Smrg	fi
37463165362Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
37563165362Smrg	exit ;;
3760eb10989Smrg    sun4*:SunOS:6*:*)
3770eb10989Smrg	# According to config.sub, this is the proper way to canonicalize
3780eb10989Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
3790eb10989Smrg	# it's likely to be more like Solaris than SunOS4.
3800eb10989Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
38163165362Smrg	exit ;;
3820eb10989Smrg    sun4*:SunOS:*:*)
3830eb10989Smrg	case "`/usr/bin/arch -k`" in
3840eb10989Smrg	    Series*|S4*)
3850eb10989Smrg		UNAME_RELEASE=`uname -v`
3860eb10989Smrg		;;
3870eb10989Smrg	esac
3880eb10989Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
3890eb10989Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
39063165362Smrg	exit ;;
3910eb10989Smrg    sun3*:SunOS:*:*)
3920eb10989Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
39363165362Smrg	exit ;;
3940eb10989Smrg    sun*:*:4.2BSD:*)
3950eb10989Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
3960eb10989Smrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
3970eb10989Smrg	case "`/bin/arch`" in
3980eb10989Smrg	    sun3)
3990eb10989Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
4000eb10989Smrg		;;
4010eb10989Smrg	    sun4)
4020eb10989Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
4030eb10989Smrg		;;
4040eb10989Smrg	esac
40563165362Smrg	exit ;;
4060eb10989Smrg    aushp:SunOS:*:*)
4070eb10989Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
40863165362Smrg	exit ;;
4090eb10989Smrg    # The situation for MiNT is a little confusing.  The machine name
4100eb10989Smrg    # can be virtually everything (everything which is not
4110eb10989Smrg    # "atarist" or "atariste" at least should have a processor
4120eb10989Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4130eb10989Smrg    # to the lowercase version "mint" (or "freemint").  Finally
4140eb10989Smrg    # the system name "TOS" denotes a system which is actually not
4150eb10989Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4160eb10989Smrg    # be no problem.
4170eb10989Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
418079e7944Smrg	echo m68k-atari-mint${UNAME_RELEASE}
41963165362Smrg	exit ;;
4200eb10989Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
4210eb10989Smrg	echo m68k-atari-mint${UNAME_RELEASE}
422079e7944Smrg	exit ;;
4230eb10989Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
424079e7944Smrg	echo m68k-atari-mint${UNAME_RELEASE}
42563165362Smrg	exit ;;
4260eb10989Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
427079e7944Smrg	echo m68k-milan-mint${UNAME_RELEASE}
428079e7944Smrg	exit ;;
4290eb10989Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
430079e7944Smrg	echo m68k-hades-mint${UNAME_RELEASE}
431079e7944Smrg	exit ;;
4320eb10989Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
433079e7944Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
434079e7944Smrg	exit ;;
4350eb10989Smrg    m68k:machten:*:*)
4360eb10989Smrg	echo m68k-apple-machten${UNAME_RELEASE}
43763165362Smrg	exit ;;
4380eb10989Smrg    powerpc:machten:*:*)
4390eb10989Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
44063165362Smrg	exit ;;
4410eb10989Smrg    RISC*:Mach:*:*)
4420eb10989Smrg	echo mips-dec-mach_bsd4.3
44363165362Smrg	exit ;;
4440eb10989Smrg    RISC*:ULTRIX:*:*)
4450eb10989Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
44663165362Smrg	exit ;;
4470eb10989Smrg    VAX*:ULTRIX*:*:*)
4480eb10989Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
44963165362Smrg	exit ;;
4500eb10989Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
4510eb10989Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
45263165362Smrg	exit ;;
4530eb10989Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
4540eb10989Smrg	eval $set_cc_for_build
4550eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
4560eb10989Smrg#ifdef __cplusplus
4570eb10989Smrg#include <stdio.h>  /* for printf() prototype */
4580eb10989Smrg	int main (int argc, char *argv[]) {
4590eb10989Smrg#else
4600eb10989Smrg	int main (argc, argv) int argc; char *argv[]; {
4610eb10989Smrg#endif
4620eb10989Smrg	#if defined (host_mips) && defined (MIPSEB)
4630eb10989Smrg	#if defined (SYSTYPE_SYSV)
4640eb10989Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
4650eb10989Smrg	#endif
4660eb10989Smrg	#if defined (SYSTYPE_SVR4)
4670eb10989Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
4680eb10989Smrg	#endif
4690eb10989Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
4700eb10989Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
4710eb10989Smrg	#endif
4720eb10989Smrg	#endif
4730eb10989Smrg	  exit (-1);
4740eb10989Smrg	}
4750eb10989SmrgEOF
47663165362Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
47763165362Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
47863165362Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
47963165362Smrg	    { echo "$SYSTEM_NAME"; exit; }
4800eb10989Smrg	echo mips-mips-riscos${UNAME_RELEASE}
48163165362Smrg	exit ;;
4820eb10989Smrg    Motorola:PowerMAX_OS:*:*)
4830eb10989Smrg	echo powerpc-motorola-powermax
48463165362Smrg	exit ;;
4850eb10989Smrg    Motorola:*:4.3:PL8-*)
4860eb10989Smrg	echo powerpc-harris-powermax
48763165362Smrg	exit ;;
4880eb10989Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
4890eb10989Smrg	echo powerpc-harris-powermax
49063165362Smrg	exit ;;
4910eb10989Smrg    Night_Hawk:Power_UNIX:*:*)
4920eb10989Smrg	echo powerpc-harris-powerunix
49363165362Smrg	exit ;;
4940eb10989Smrg    m88k:CX/UX:7*:*)
4950eb10989Smrg	echo m88k-harris-cxux7
49663165362Smrg	exit ;;
4970eb10989Smrg    m88k:*:4*:R4*)
4980eb10989Smrg	echo m88k-motorola-sysv4
49963165362Smrg	exit ;;
5000eb10989Smrg    m88k:*:3*:R3*)
5010eb10989Smrg	echo m88k-motorola-sysv3
50263165362Smrg	exit ;;
5030eb10989Smrg    AViiON:dgux:*:*)
504079e7944Smrg	# DG/UX returns AViiON for all architectures
505079e7944Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
5060eb10989Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
5070eb10989Smrg	then
5080eb10989Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
5090eb10989Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
5100eb10989Smrg	    then
5110eb10989Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
5120eb10989Smrg	    else
5130eb10989Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
5140eb10989Smrg	    fi
5150eb10989Smrg	else
5160eb10989Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
5170eb10989Smrg	fi
518079e7944Smrg	exit ;;
5190eb10989Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5200eb10989Smrg	echo m88k-dolphin-sysv3
52163165362Smrg	exit ;;
5220eb10989Smrg    M88*:*:R3*:*)
5230eb10989Smrg	# Delta 88k system running SVR3
5240eb10989Smrg	echo m88k-motorola-sysv3
52563165362Smrg	exit ;;
5260eb10989Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5270eb10989Smrg	echo m88k-tektronix-sysv3
52863165362Smrg	exit ;;
5290eb10989Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5300eb10989Smrg	echo m68k-tektronix-bsd
53163165362Smrg	exit ;;
5320eb10989Smrg    *:IRIX*:*:*)
5330eb10989Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
53463165362Smrg	exit ;;
5350eb10989Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
53663165362Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
53763165362Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5380eb10989Smrg    i*86:AIX:*:*)
5390eb10989Smrg	echo i386-ibm-aix
54063165362Smrg	exit ;;
5410eb10989Smrg    ia64:AIX:*:*)
5420eb10989Smrg	if [ -x /usr/bin/oslevel ] ; then
5430eb10989Smrg		IBM_REV=`/usr/bin/oslevel`
5440eb10989Smrg	else
5450eb10989Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5460eb10989Smrg	fi
5470eb10989Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
54863165362Smrg	exit ;;
5490eb10989Smrg    *:AIX:2:3)
5500eb10989Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
5510eb10989Smrg		eval $set_cc_for_build
5520eb10989Smrg		sed 's/^		//' << EOF >$dummy.c
5530eb10989Smrg		#include <sys/systemcfg.h>
5540eb10989Smrg
5550eb10989Smrg		main()
5560eb10989Smrg			{
5570eb10989Smrg			if (!__power_pc())
5580eb10989Smrg				exit(1);
5590eb10989Smrg			puts("powerpc-ibm-aix3.2.5");
5600eb10989Smrg			exit(0);
5610eb10989Smrg			}
5620eb10989SmrgEOF
56363165362Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
56463165362Smrg		then
56563165362Smrg			echo "$SYSTEM_NAME"
56663165362Smrg		else
56763165362Smrg			echo rs6000-ibm-aix3.2.5
56863165362Smrg		fi
5690eb10989Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
5700eb10989Smrg		echo rs6000-ibm-aix3.2.4
5710eb10989Smrg	else
5720eb10989Smrg		echo rs6000-ibm-aix3.2
5730eb10989Smrg	fi
57463165362Smrg	exit ;;
575d43532a6Smrg    *:AIX:*:[4567])
5760eb10989Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
5770eb10989Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
5780eb10989Smrg		IBM_ARCH=rs6000
5790eb10989Smrg	else
5800eb10989Smrg		IBM_ARCH=powerpc
5810eb10989Smrg	fi
5820eb10989Smrg	if [ -x /usr/bin/oslevel ] ; then
5830eb10989Smrg		IBM_REV=`/usr/bin/oslevel`
5840eb10989Smrg	else
5850eb10989Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
5860eb10989Smrg	fi
5870eb10989Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
58863165362Smrg	exit ;;
5890eb10989Smrg    *:AIX:*:*)
5900eb10989Smrg	echo rs6000-ibm-aix
59163165362Smrg	exit ;;
5920eb10989Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
5930eb10989Smrg	echo romp-ibm-bsd4.4
59463165362Smrg	exit ;;
5950eb10989Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
5960eb10989Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
59763165362Smrg	exit ;;                             # report: romp-ibm BSD 4.3
5980eb10989Smrg    *:BOSX:*:*)
5990eb10989Smrg	echo rs6000-bull-bosx
60063165362Smrg	exit ;;
6010eb10989Smrg    DPX/2?00:B.O.S.:*:*)
6020eb10989Smrg	echo m68k-bull-sysv3
60363165362Smrg	exit ;;
6040eb10989Smrg    9000/[34]??:4.3bsd:1.*:*)
6050eb10989Smrg	echo m68k-hp-bsd
60663165362Smrg	exit ;;
6070eb10989Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6080eb10989Smrg	echo m68k-hp-bsd4.4
60963165362Smrg	exit ;;
6100eb10989Smrg    9000/[34678]??:HP-UX:*:*)
6110eb10989Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6120eb10989Smrg	case "${UNAME_MACHINE}" in
6130eb10989Smrg	    9000/31? )            HP_ARCH=m68000 ;;
6140eb10989Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
6150eb10989Smrg	    9000/[678][0-9][0-9])
6160eb10989Smrg		if [ -x /usr/bin/getconf ]; then
6170eb10989Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
618079e7944Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
619079e7944Smrg		    case "${sc_cpu_version}" in
620079e7944Smrg		      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
621079e7944Smrg		      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
622079e7944Smrg		      532)                      # CPU_PA_RISC2_0
623079e7944Smrg			case "${sc_kernel_bits}" in
624079e7944Smrg			  32) HP_ARCH="hppa2.0n" ;;
625079e7944Smrg			  64) HP_ARCH="hppa2.0w" ;;
6260eb10989Smrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
627079e7944Smrg			esac ;;
628079e7944Smrg		    esac
6290eb10989Smrg		fi
6300eb10989Smrg		if [ "${HP_ARCH}" = "" ]; then
6310eb10989Smrg		    eval $set_cc_for_build
632079e7944Smrg		    sed 's/^		//' << EOF >$dummy.c
6330eb10989Smrg
634079e7944Smrg		#define _HPUX_SOURCE
635079e7944Smrg		#include <stdlib.h>
636079e7944Smrg		#include <unistd.h>
6370eb10989Smrg
638079e7944Smrg		int main ()
639079e7944Smrg		{
640079e7944Smrg		#if defined(_SC_KERNEL_BITS)
641079e7944Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
642079e7944Smrg		#endif
643079e7944Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
6440eb10989Smrg
645079e7944Smrg		    switch (cpu)
646079e7944Smrg			{
647079e7944Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
648079e7944Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
649079e7944Smrg			case CPU_PA_RISC2_0:
650079e7944Smrg		#if defined(_SC_KERNEL_BITS)
651079e7944Smrg			    switch (bits)
652079e7944Smrg				{
653079e7944Smrg				case 64: puts ("hppa2.0w"); break;
654079e7944Smrg				case 32: puts ("hppa2.0n"); break;
655079e7944Smrg				default: puts ("hppa2.0"); break;
656079e7944Smrg				} break;
657079e7944Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
658079e7944Smrg			    puts ("hppa2.0"); break;
659079e7944Smrg		#endif
660079e7944Smrg			default: puts ("hppa1.0"); break;
661079e7944Smrg			}
662079e7944Smrg		    exit (0);
663079e7944Smrg		}
6640eb10989SmrgEOF
6650eb10989Smrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
6660eb10989Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6670eb10989Smrg		fi ;;
6680eb10989Smrg	esac
6690eb10989Smrg	if [ ${HP_ARCH} = "hppa2.0w" ]
6700eb10989Smrg	then
67163165362Smrg	    eval $set_cc_for_build
67263165362Smrg
67363165362Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
67463165362Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
67563165362Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
67663165362Smrg	    #
67763165362Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
67863165362Smrg	    # => hppa2.0w-hp-hpux11.23
67963165362Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
68063165362Smrg	    # => hppa64-hp-hpux11.23
68163165362Smrg
68263165362Smrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
683e4c0bf4dSmrg		grep -q __LP64__
6840eb10989Smrg	    then
6850eb10989Smrg		HP_ARCH="hppa2.0w"
6860eb10989Smrg	    else
6870eb10989Smrg		HP_ARCH="hppa64"
6880eb10989Smrg	    fi
6890eb10989Smrg	fi
6900eb10989Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
69163165362Smrg	exit ;;
6920eb10989Smrg    ia64:HP-UX:*:*)
6930eb10989Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
6940eb10989Smrg	echo ia64-hp-hpux${HPUX_REV}
69563165362Smrg	exit ;;
6960eb10989Smrg    3050*:HI-UX:*:*)
6970eb10989Smrg	eval $set_cc_for_build
6980eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
6990eb10989Smrg	#include <unistd.h>
7000eb10989Smrg	int
7010eb10989Smrg	main ()
7020eb10989Smrg	{
7030eb10989Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
7040eb10989Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7050eb10989Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7060eb10989Smrg	     results, however.  */
7070eb10989Smrg	  if (CPU_IS_PA_RISC (cpu))
7080eb10989Smrg	    {
7090eb10989Smrg	      switch (cpu)
7100eb10989Smrg		{
7110eb10989Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7120eb10989Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7130eb10989Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7140eb10989Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7150eb10989Smrg		}
7160eb10989Smrg	    }
7170eb10989Smrg	  else if (CPU_IS_HP_MC68K (cpu))
7180eb10989Smrg	    puts ("m68k-hitachi-hiuxwe2");
7190eb10989Smrg	  else puts ("unknown-hitachi-hiuxwe2");
7200eb10989Smrg	  exit (0);
7210eb10989Smrg	}
7220eb10989SmrgEOF
72363165362Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
72463165362Smrg		{ echo "$SYSTEM_NAME"; exit; }
7250eb10989Smrg	echo unknown-hitachi-hiuxwe2
72663165362Smrg	exit ;;
7270eb10989Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
7280eb10989Smrg	echo hppa1.1-hp-bsd
72963165362Smrg	exit ;;
7300eb10989Smrg    9000/8??:4.3bsd:*:*)
7310eb10989Smrg	echo hppa1.0-hp-bsd
73263165362Smrg	exit ;;
7330eb10989Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7340eb10989Smrg	echo hppa1.0-hp-mpeix
73563165362Smrg	exit ;;
7360eb10989Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
7370eb10989Smrg	echo hppa1.1-hp-osf
73863165362Smrg	exit ;;
7390eb10989Smrg    hp8??:OSF1:*:*)
7400eb10989Smrg	echo hppa1.0-hp-osf
74163165362Smrg	exit ;;
7420eb10989Smrg    i*86:OSF1:*:*)
7430eb10989Smrg	if [ -x /usr/sbin/sysversion ] ; then
7440eb10989Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
7450eb10989Smrg	else
7460eb10989Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
7470eb10989Smrg	fi
74863165362Smrg	exit ;;
7490eb10989Smrg    parisc*:Lites*:*:*)
7500eb10989Smrg	echo hppa1.1-hp-lites
75163165362Smrg	exit ;;
7520eb10989Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7530eb10989Smrg	echo c1-convex-bsd
754079e7944Smrg	exit ;;
7550eb10989Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7560eb10989Smrg	if getsysinfo -f scalar_acc
7570eb10989Smrg	then echo c32-convex-bsd
7580eb10989Smrg	else echo c2-convex-bsd
7590eb10989Smrg	fi
760079e7944Smrg	exit ;;
7610eb10989Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7620eb10989Smrg	echo c34-convex-bsd
763079e7944Smrg	exit ;;
7640eb10989Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7650eb10989Smrg	echo c38-convex-bsd
766079e7944Smrg	exit ;;
7670eb10989Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
7680eb10989Smrg	echo c4-convex-bsd
769079e7944Smrg	exit ;;
7700eb10989Smrg    CRAY*Y-MP:*:*:*)
7710eb10989Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
77263165362Smrg	exit ;;
7730eb10989Smrg    CRAY*[A-Z]90:*:*:*)
7740eb10989Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
7750eb10989Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
7760eb10989Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
7770eb10989Smrg	      -e 's/\.[^.]*$/.X/'
77863165362Smrg	exit ;;
7790eb10989Smrg    CRAY*TS:*:*:*)
7800eb10989Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
78163165362Smrg	exit ;;
7820eb10989Smrg    CRAY*T3E:*:*:*)
7830eb10989Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
78463165362Smrg	exit ;;
7850eb10989Smrg    CRAY*SV1:*:*:*)
7860eb10989Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
78763165362Smrg	exit ;;
7880eb10989Smrg    *:UNICOS/mp:*:*)
78963165362Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
79063165362Smrg	exit ;;
7910eb10989Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
7920eb10989Smrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
793079e7944Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
794079e7944Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
795079e7944Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
796079e7944Smrg	exit ;;
7970eb10989Smrg    5000:UNIX_System_V:4.*:*)
798079e7944Smrg	FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
799079e7944Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
800079e7944Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
80163165362Smrg	exit ;;
8020eb10989Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
8030eb10989Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
80463165362Smrg	exit ;;
8050eb10989Smrg    sparc*:BSD/OS:*:*)
8060eb10989Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
80763165362Smrg	exit ;;
8080eb10989Smrg    *:BSD/OS:*:*)
8090eb10989Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
81063165362Smrg	exit ;;
8110eb10989Smrg    *:FreeBSD:*:*)
812079e7944Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
813079e7944Smrg	case ${UNAME_PROCESSOR} in
81463165362Smrg	    amd64)
81563165362Smrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
81663165362Smrg	    *)
817079e7944Smrg		echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
81863165362Smrg	esac
81963165362Smrg	exit ;;
8200eb10989Smrg    i*:CYGWIN*:*)
8210eb10989Smrg	echo ${UNAME_MACHINE}-pc-cygwin
82263165362Smrg	exit ;;
823079e7944Smrg    *:MINGW64*:*)
824079e7944Smrg	echo ${UNAME_MACHINE}-pc-mingw64
825079e7944Smrg	exit ;;
82663165362Smrg    *:MINGW*:*)
8270eb10989Smrg	echo ${UNAME_MACHINE}-pc-mingw32
82863165362Smrg	exit ;;
829079e7944Smrg    i*:MSYS*:*)
830079e7944Smrg	echo ${UNAME_MACHINE}-pc-msys
831079e7944Smrg	exit ;;
83263165362Smrg    i*:windows32*:*)
833079e7944Smrg	# uname -m includes "-pc" on this system.
834079e7944Smrg	echo ${UNAME_MACHINE}-mingw32
83563165362Smrg	exit ;;
8360eb10989Smrg    i*:PW*:*)
8370eb10989Smrg	echo ${UNAME_MACHINE}-pc-pw32
83863165362Smrg	exit ;;
839e4c0bf4dSmrg    *:Interix*:*)
840079e7944Smrg	case ${UNAME_MACHINE} in
84163165362Smrg	    x86)
84263165362Smrg		echo i586-pc-interix${UNAME_RELEASE}
84363165362Smrg		exit ;;
844e4c0bf4dSmrg	    authenticamd | genuineintel | EM64T)
84563165362Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
84663165362Smrg		exit ;;
84763165362Smrg	    IA64)
84863165362Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
84963165362Smrg		exit ;;
85063165362Smrg	esac ;;
8510eb10989Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
8520eb10989Smrg	echo i${UNAME_MACHINE}-pc-mks
85363165362Smrg	exit ;;
854e4c0bf4dSmrg    8664:Windows_NT:*)
855e4c0bf4dSmrg	echo x86_64-pc-mks
856e4c0bf4dSmrg	exit ;;
8570eb10989Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
8580eb10989Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
8590eb10989Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
8600eb10989Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
8610eb10989Smrg	echo i586-pc-interix
86263165362Smrg	exit ;;
8630eb10989Smrg    i*:UWIN*:*)
8640eb10989Smrg	echo ${UNAME_MACHINE}-pc-uwin
86563165362Smrg	exit ;;
86663165362Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
86763165362Smrg	echo x86_64-unknown-cygwin
86863165362Smrg	exit ;;
8690eb10989Smrg    p*:CYGWIN*:*)
8700eb10989Smrg	echo powerpcle-unknown-cygwin
87163165362Smrg	exit ;;
8720eb10989Smrg    prep*:SunOS:5.*:*)
8730eb10989Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
87463165362Smrg	exit ;;
8750eb10989Smrg    *:GNU:*:*)
8760eb10989Smrg	# the GNU system
877079e7944Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
87863165362Smrg	exit ;;
8790eb10989Smrg    *:GNU/*:*:*)
8800eb10989Smrg	# other systems with GNU libc and userland
881079e7944Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
88263165362Smrg	exit ;;
8830eb10989Smrg    i*86:Minix:*:*)
8840eb10989Smrg	echo ${UNAME_MACHINE}-pc-minix
88563165362Smrg	exit ;;
886079e7944Smrg    aarch64:Linux:*:*)
887079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
888079e7944Smrg	exit ;;
889079e7944Smrg    aarch64_be:Linux:*:*)
890079e7944Smrg	UNAME_MACHINE=aarch64_be
891079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
892079e7944Smrg	exit ;;
893e4c0bf4dSmrg    alpha:Linux:*:*)
894e4c0bf4dSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
895e4c0bf4dSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
896e4c0bf4dSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
897e4c0bf4dSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
898e4c0bf4dSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
899e4c0bf4dSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
900e4c0bf4dSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
901e4c0bf4dSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
902079e7944Smrg	esac
903e4c0bf4dSmrg	objdump --private-headers /bin/sh | grep -q ld.so.1
904079e7944Smrg	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
905079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
906079e7944Smrg	exit ;;
907079e7944Smrg    arc:Linux:*:* | arceb:Linux:*:*)
908079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
909e4c0bf4dSmrg	exit ;;
9100eb10989Smrg    arm*:Linux:*:*)
91163165362Smrg	eval $set_cc_for_build
91263165362Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
91363165362Smrg	    | grep -q __ARM_EABI__
91463165362Smrg	then
915079e7944Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
91663165362Smrg	else
917079e7944Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
918079e7944Smrg		| grep -q __ARM_PCS_VFP
919079e7944Smrg	    then
920079e7944Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
921079e7944Smrg	    else
922079e7944Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
923079e7944Smrg	    fi
92463165362Smrg	fi
92563165362Smrg	exit ;;
92663165362Smrg    avr32*:Linux:*:*)
927079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
92863165362Smrg	exit ;;
9290eb10989Smrg    cris:Linux:*:*)
930079e7944Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
93163165362Smrg	exit ;;
93263165362Smrg    crisv32:Linux:*:*)
933079e7944Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
93463165362Smrg	exit ;;
93563165362Smrg    frv:Linux:*:*)
936079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
937079e7944Smrg	exit ;;
938079e7944Smrg    hexagon:Linux:*:*)
939079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
94063165362Smrg	exit ;;
941e4c0bf4dSmrg    i*86:Linux:*:*)
942079e7944Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
943e4c0bf4dSmrg	exit ;;
9440eb10989Smrg    ia64:Linux:*:*)
945079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
94663165362Smrg	exit ;;
9470eb10989Smrg    m32r*:Linux:*:*)
948079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
94963165362Smrg	exit ;;
9500eb10989Smrg    m68*:Linux:*:*)
951079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
95263165362Smrg	exit ;;
953e4c0bf4dSmrg    mips:Linux:*:* | mips64:Linux:*:*)
9540eb10989Smrg	eval $set_cc_for_build
9550eb10989Smrg	sed 's/^	//' << EOF >$dummy.c
9560eb10989Smrg	#undef CPU
957e4c0bf4dSmrg	#undef ${UNAME_MACHINE}
958e4c0bf4dSmrg	#undef ${UNAME_MACHINE}el
9590eb10989Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
960e4c0bf4dSmrg	CPU=${UNAME_MACHINE}el
9610eb10989Smrg	#else
9620eb10989Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
963e4c0bf4dSmrg	CPU=${UNAME_MACHINE}
9640eb10989Smrg	#else
9650eb10989Smrg	CPU=
9660eb10989Smrg	#endif
9670eb10989Smrg	#endif
9680eb10989SmrgEOF
969e4c0bf4dSmrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
970079e7944Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
9710eb10989Smrg	;;
972079e7944Smrg    or1k:Linux:*:*)
973079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
974079e7944Smrg	exit ;;
97563165362Smrg    or32:Linux:*:*)
976079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
97763165362Smrg	exit ;;
97863165362Smrg    padre:Linux:*:*)
979079e7944Smrg	echo sparc-unknown-linux-${LIBC}
98063165362Smrg	exit ;;
981e4c0bf4dSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
982079e7944Smrg	echo hppa64-unknown-linux-${LIBC}
983e4c0bf4dSmrg	exit ;;
9840eb10989Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
9850eb10989Smrg	# Look for CPU level
9860eb10989Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
987079e7944Smrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
988079e7944Smrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
989079e7944Smrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
9900eb10989Smrg	esac
99163165362Smrg	exit ;;
992e4c0bf4dSmrg    ppc64:Linux:*:*)
993079e7944Smrg	echo powerpc64-unknown-linux-${LIBC}
994e4c0bf4dSmrg	exit ;;
995e4c0bf4dSmrg    ppc:Linux:*:*)
996079e7944Smrg	echo powerpc-unknown-linux-${LIBC}
997079e7944Smrg	exit ;;
998079e7944Smrg    ppc64le:Linux:*:*)
999079e7944Smrg	echo powerpc64le-unknown-linux-${LIBC}
1000079e7944Smrg	exit ;;
1001079e7944Smrg    ppcle:Linux:*:*)
1002079e7944Smrg	echo powerpcle-unknown-linux-${LIBC}
100363165362Smrg	exit ;;
10040eb10989Smrg    s390:Linux:*:* | s390x:Linux:*:*)
1005079e7944Smrg	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
100663165362Smrg	exit ;;
10070eb10989Smrg    sh64*:Linux:*:*)
1008079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
100963165362Smrg	exit ;;
10100eb10989Smrg    sh*:Linux:*:*)
1011079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
101263165362Smrg	exit ;;
10130eb10989Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1014079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
101563165362Smrg	exit ;;
1016d43532a6Smrg    tile*:Linux:*:*)
1017079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
1018d43532a6Smrg	exit ;;
101963165362Smrg    vax:Linux:*:*)
1020079e7944Smrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
102163165362Smrg	exit ;;
10220eb10989Smrg    x86_64:Linux:*:*)
1023079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
102463165362Smrg	exit ;;
102563165362Smrg    xtensa*:Linux:*:*)
1026079e7944Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
102763165362Smrg	exit ;;
10280eb10989Smrg    i*86:DYNIX/ptx:4*:*)
10290eb10989Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10300eb10989Smrg	# earlier versions are messed up and put the nodename in both
10310eb10989Smrg	# sysname and nodename.
10320eb10989Smrg	echo i386-sequent-sysv4
103363165362Smrg	exit ;;
10340eb10989Smrg    i*86:UNIX_SV:4.2MP:2.*)
1035079e7944Smrg	# Unixware is an offshoot of SVR4, but it has its own version
1036079e7944Smrg	# number series starting with 2...
1037079e7944Smrg	# I am not positive that other SVR4 systems won't match this,
10380eb10989Smrg	# I just have to hope.  -- rms.
1039079e7944Smrg	# Use sysv4.2uw... so that sysv4* matches it.
10400eb10989Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
104163165362Smrg	exit ;;
10420eb10989Smrg    i*86:OS/2:*:*)
10430eb10989Smrg	# If we were able to find `uname', then EMX Unix compatibility
10440eb10989Smrg	# is probably installed.
10450eb10989Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
104663165362Smrg	exit ;;
10470eb10989Smrg    i*86:XTS-300:*:STOP)
10480eb10989Smrg	echo ${UNAME_MACHINE}-unknown-stop
104963165362Smrg	exit ;;
10500eb10989Smrg    i*86:atheos:*:*)
10510eb10989Smrg	echo ${UNAME_MACHINE}-unknown-atheos
105263165362Smrg	exit ;;
105363165362Smrg    i*86:syllable:*:*)
10540eb10989Smrg	echo ${UNAME_MACHINE}-pc-syllable
105563165362Smrg	exit ;;
1056e4c0bf4dSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
10570eb10989Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
105863165362Smrg	exit ;;
10590eb10989Smrg    i*86:*DOS:*:*)
10600eb10989Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
106163165362Smrg	exit ;;
10620eb10989Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
10630eb10989Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
10640eb10989Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
10650eb10989Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
10660eb10989Smrg	else
10670eb10989Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
10680eb10989Smrg	fi
106963165362Smrg	exit ;;
107063165362Smrg    i*86:*:5:[678]*)
1071079e7944Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10720eb10989Smrg	case `/bin/uname -X | grep "^Machine"` in
10730eb10989Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
10740eb10989Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
10750eb10989Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
10760eb10989Smrg	esac
10770eb10989Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
107863165362Smrg	exit ;;
10790eb10989Smrg    i*86:*:3.2:*)
10800eb10989Smrg	if test -f /usr/options/cb.name; then
10810eb10989Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
10820eb10989Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
10830eb10989Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
10840eb10989Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
10850eb10989Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
10860eb10989Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
10870eb10989Smrg			&& UNAME_MACHINE=i586
10880eb10989Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
10890eb10989Smrg			&& UNAME_MACHINE=i686
10900eb10989Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
10910eb10989Smrg			&& UNAME_MACHINE=i686
10920eb10989Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
10930eb10989Smrg	else
10940eb10989Smrg		echo ${UNAME_MACHINE}-pc-sysv32
10950eb10989Smrg	fi
109663165362Smrg	exit ;;
10970eb10989Smrg    pc:*:*:*)
10980eb10989Smrg	# Left here for compatibility:
1099079e7944Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1100079e7944Smrg	# the processor, so we play safe by assuming i586.
110163165362Smrg	# Note: whatever this is, it MUST be the same as what config.sub
110263165362Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
110363165362Smrg	# this is a cross-build.
110463165362Smrg	echo i586-pc-msdosdjgpp
1105079e7944Smrg	exit ;;
11060eb10989Smrg    Intel:Mach:3*:*)
11070eb10989Smrg	echo i386-pc-mach3
110863165362Smrg	exit ;;
11090eb10989Smrg    paragon:*:*:*)
11100eb10989Smrg	echo i860-intel-osf1
111163165362Smrg	exit ;;
11120eb10989Smrg    i860:*:4.*:*) # i860-SVR4
11130eb10989Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
11140eb10989Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
11150eb10989Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
11160eb10989Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
11170eb10989Smrg	fi
111863165362Smrg	exit ;;
11190eb10989Smrg    mini*:CTIX:SYS*5:*)
11200eb10989Smrg	# "miniframe"
11210eb10989Smrg	echo m68010-convergent-sysv
112263165362Smrg	exit ;;
11230eb10989Smrg    mc68k:UNIX:SYSTEM5:3.51m)
11240eb10989Smrg	echo m68k-convergent-sysv
112563165362Smrg	exit ;;
11260eb10989Smrg    M680?0:D-NIX:5.3:*)
11270eb10989Smrg	echo m68k-diab-dnix
112863165362Smrg	exit ;;
11290eb10989Smrg    M68*:*:R3V[5678]*:*)
113063165362Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
113163165362Smrg    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)
11320eb10989Smrg	OS_REL=''
11330eb10989Smrg	test -r /etc/.relid \
11340eb10989Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11350eb10989Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
113663165362Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
11370eb10989Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
113863165362Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11390eb10989Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1140079e7944Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1141079e7944Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
114263165362Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
114363165362Smrg	OS_REL='.3'
114463165362Smrg	test -r /etc/.relid \
114563165362Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
114663165362Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
114763165362Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
114863165362Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
114963165362Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
115063165362Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
115163165362Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
11520eb10989Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
11530eb10989Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
115463165362Smrg	exit ;;
11550eb10989Smrg    mc68030:UNIX_System_V:4.*:*)
11560eb10989Smrg	echo m68k-atari-sysv4
115763165362Smrg	exit ;;
11580eb10989Smrg    TSUNAMI:LynxOS:2.*:*)
11590eb10989Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
116063165362Smrg	exit ;;
11610eb10989Smrg    rs6000:LynxOS:2.*:*)
11620eb10989Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
116363165362Smrg	exit ;;
1164e4c0bf4dSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
11650eb10989Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
116663165362Smrg	exit ;;
11670eb10989Smrg    SM[BE]S:UNIX_SV:*:*)
11680eb10989Smrg	echo mips-dde-sysv${UNAME_RELEASE}
116963165362Smrg	exit ;;
11700eb10989Smrg    RM*:ReliantUNIX-*:*:*)
11710eb10989Smrg	echo mips-sni-sysv4
117263165362Smrg	exit ;;
11730eb10989Smrg    RM*:SINIX-*:*:*)
11740eb10989Smrg	echo mips-sni-sysv4
117563165362Smrg	exit ;;
11760eb10989Smrg    *:SINIX-*:*:*)
11770eb10989Smrg	if uname -p 2>/dev/null >/dev/null ; then
11780eb10989Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
11790eb10989Smrg		echo ${UNAME_MACHINE}-sni-sysv4
11800eb10989Smrg	else
11810eb10989Smrg		echo ns32k-sni-sysv
11820eb10989Smrg	fi
118363165362Smrg	exit ;;
1184079e7944Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1185079e7944Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1186079e7944Smrg	echo i586-unisys-sysv4
1187079e7944Smrg	exit ;;
11880eb10989Smrg    *:UNIX_System_V:4*:FTX*)
11890eb10989Smrg	# From Gerald Hewes <hewes@openmarket.com>.
11900eb10989Smrg	# How about differentiating between stratus architectures? -djm
11910eb10989Smrg	echo hppa1.1-stratus-sysv4
119263165362Smrg	exit ;;
11930eb10989Smrg    *:*:*:FTX*)
11940eb10989Smrg	# From seanf@swdc.stratus.com.
11950eb10989Smrg	echo i860-stratus-sysv4
119663165362Smrg	exit ;;
119763165362Smrg    i*86:VOS:*:*)
119863165362Smrg	# From Paul.Green@stratus.com.
119963165362Smrg	echo ${UNAME_MACHINE}-stratus-vos
120063165362Smrg	exit ;;
12010eb10989Smrg    *:VOS:*:*)
12020eb10989Smrg	# From Paul.Green@stratus.com.
12030eb10989Smrg	echo hppa1.1-stratus-vos
120463165362Smrg	exit ;;
12050eb10989Smrg    mc68*:A/UX:*:*)
12060eb10989Smrg	echo m68k-apple-aux${UNAME_RELEASE}
120763165362Smrg	exit ;;
12080eb10989Smrg    news*:NEWS-OS:6*:*)
12090eb10989Smrg	echo mips-sony-newsos6
121063165362Smrg	exit ;;
12110eb10989Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12120eb10989Smrg	if [ -d /usr/nec ]; then
1213079e7944Smrg		echo mips-nec-sysv${UNAME_RELEASE}
12140eb10989Smrg	else
1215079e7944Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
12160eb10989Smrg	fi
1217079e7944Smrg	exit ;;
12180eb10989Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12190eb10989Smrg	echo powerpc-be-beos
122063165362Smrg	exit ;;
12210eb10989Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12220eb10989Smrg	echo powerpc-apple-beos
122363165362Smrg	exit ;;
12240eb10989Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12250eb10989Smrg	echo i586-pc-beos
122663165362Smrg	exit ;;
122763165362Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
122863165362Smrg	echo i586-pc-haiku
122963165362Smrg	exit ;;
1230079e7944Smrg    x86_64:Haiku:*:*)
1231079e7944Smrg	echo x86_64-unknown-haiku
1232079e7944Smrg	exit ;;
12330eb10989Smrg    SX-4:SUPER-UX:*:*)
12340eb10989Smrg	echo sx4-nec-superux${UNAME_RELEASE}
123563165362Smrg	exit ;;
12360eb10989Smrg    SX-5:SUPER-UX:*:*)
12370eb10989Smrg	echo sx5-nec-superux${UNAME_RELEASE}
123863165362Smrg	exit ;;
12390eb10989Smrg    SX-6:SUPER-UX:*:*)
12400eb10989Smrg	echo sx6-nec-superux${UNAME_RELEASE}
124163165362Smrg	exit ;;
124263165362Smrg    SX-7:SUPER-UX:*:*)
124363165362Smrg	echo sx7-nec-superux${UNAME_RELEASE}
124463165362Smrg	exit ;;
124563165362Smrg    SX-8:SUPER-UX:*:*)
124663165362Smrg	echo sx8-nec-superux${UNAME_RELEASE}
124763165362Smrg	exit ;;
124863165362Smrg    SX-8R:SUPER-UX:*:*)
124963165362Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
125063165362Smrg	exit ;;
12510eb10989Smrg    Power*:Rhapsody:*:*)
12520eb10989Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
125363165362Smrg	exit ;;
12540eb10989Smrg    *:Rhapsody:*:*)
12550eb10989Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
125663165362Smrg	exit ;;
12570eb10989Smrg    *:Darwin:*:*)
125863165362Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1259079e7944Smrg	eval $set_cc_for_build
1260079e7944Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
1261079e7944Smrg	    UNAME_PROCESSOR=powerpc
1262079e7944Smrg	fi
1263079e7944Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1264079e7944Smrg	    if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1265079e7944Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1266079e7944Smrg		grep IS_64BIT_ARCH >/dev/null
1267079e7944Smrg	    then
1268079e7944Smrg		case $UNAME_PROCESSOR in
1269079e7944Smrg		    i386) UNAME_PROCESSOR=x86_64 ;;
1270079e7944Smrg		    powerpc) UNAME_PROCESSOR=powerpc64 ;;
1271079e7944Smrg		esac
1272079e7944Smrg	    fi
1273079e7944Smrg	fi
12740eb10989Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
127563165362Smrg	exit ;;
12760eb10989Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
12770eb10989Smrg	UNAME_PROCESSOR=`uname -p`
12780eb10989Smrg	if test "$UNAME_PROCESSOR" = "x86"; then
12790eb10989Smrg		UNAME_PROCESSOR=i386
12800eb10989Smrg		UNAME_MACHINE=pc
12810eb10989Smrg	fi
12820eb10989Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
128363165362Smrg	exit ;;
12840eb10989Smrg    *:QNX:*:4*)
12850eb10989Smrg	echo i386-pc-qnx
128663165362Smrg	exit ;;
1287079e7944Smrg    NEO-?:NONSTOP_KERNEL:*:*)
1288079e7944Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
1289079e7944Smrg	exit ;;
1290079e7944Smrg    NSE-*:NONSTOP_KERNEL:*:*)
129163165362Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
129263165362Smrg	exit ;;
12930eb10989Smrg    NSR-?:NONSTOP_KERNEL:*:*)
12940eb10989Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
129563165362Smrg	exit ;;
12960eb10989Smrg    *:NonStop-UX:*:*)
12970eb10989Smrg	echo mips-compaq-nonstopux
129863165362Smrg	exit ;;
12990eb10989Smrg    BS2000:POSIX*:*:*)
13000eb10989Smrg	echo bs2000-siemens-sysv
130163165362Smrg	exit ;;
13020eb10989Smrg    DS/*:UNIX_System_V:*:*)
13030eb10989Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
130463165362Smrg	exit ;;
13050eb10989Smrg    *:Plan9:*:*)
13060eb10989Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
13070eb10989Smrg	# is converted to i386 for consistency with other x86
13080eb10989Smrg	# operating systems.
13090eb10989Smrg	if test "$cputype" = "386"; then
13100eb10989Smrg	    UNAME_MACHINE=i386
13110eb10989Smrg	else
13120eb10989Smrg	    UNAME_MACHINE="$cputype"
13130eb10989Smrg	fi
13140eb10989Smrg	echo ${UNAME_MACHINE}-unknown-plan9
131563165362Smrg	exit ;;
13160eb10989Smrg    *:TOPS-10:*:*)
13170eb10989Smrg	echo pdp10-unknown-tops10
131863165362Smrg	exit ;;
13190eb10989Smrg    *:TENEX:*:*)
13200eb10989Smrg	echo pdp10-unknown-tenex
132163165362Smrg	exit ;;
13220eb10989Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13230eb10989Smrg	echo pdp10-dec-tops20
132463165362Smrg	exit ;;
13250eb10989Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13260eb10989Smrg	echo pdp10-xkl-tops20
132763165362Smrg	exit ;;
13280eb10989Smrg    *:TOPS-20:*:*)
13290eb10989Smrg	echo pdp10-unknown-tops20
133063165362Smrg	exit ;;
13310eb10989Smrg    *:ITS:*:*)
13320eb10989Smrg	echo pdp10-unknown-its
133363165362Smrg	exit ;;
13340eb10989Smrg    SEI:*:*:SEIUX)
1335079e7944Smrg	echo mips-sei-seiux${UNAME_RELEASE}
133663165362Smrg	exit ;;
13370eb10989Smrg    *:DragonFly:*:*)
13380eb10989Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
133963165362Smrg	exit ;;
134063165362Smrg    *:*VMS:*:*)
1341079e7944Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
134263165362Smrg	case "${UNAME_MACHINE}" in
134363165362Smrg	    A*) echo alpha-dec-vms ; exit ;;
134463165362Smrg	    I*) echo ia64-dec-vms ; exit ;;
134563165362Smrg	    V*) echo vax-dec-vms ; exit ;;
134663165362Smrg	esac ;;
134763165362Smrg    *:XENIX:*:SysV)
134863165362Smrg	echo i386-pc-xenix
134963165362Smrg	exit ;;
135063165362Smrg    i*86:skyos:*:*)
135163165362Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
135263165362Smrg	exit ;;
135363165362Smrg    i*86:rdos:*:*)
135463165362Smrg	echo ${UNAME_MACHINE}-pc-rdos
135563165362Smrg	exit ;;
135663165362Smrg    i*86:AROS:*:*)
135763165362Smrg	echo ${UNAME_MACHINE}-pc-aros
135863165362Smrg	exit ;;
1359079e7944Smrg    x86_64:VMkernel:*:*)
1360079e7944Smrg	echo ${UNAME_MACHINE}-unknown-esx
1361079e7944Smrg	exit ;;
13620eb10989Smrgesac
13630eb10989Smrg
13640eb10989Smrgeval $set_cc_for_build
13650eb10989Smrgcat >$dummy.c <<EOF
13660eb10989Smrg#ifdef _SEQUENT_
13670eb10989Smrg# include <sys/types.h>
13680eb10989Smrg# include <sys/utsname.h>
13690eb10989Smrg#endif
13700eb10989Smrgmain ()
13710eb10989Smrg{
13720eb10989Smrg#if defined (sony)
13730eb10989Smrg#if defined (MIPSEB)
13740eb10989Smrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
13750eb10989Smrg     I don't know....  */
13760eb10989Smrg  printf ("mips-sony-bsd\n"); exit (0);
13770eb10989Smrg#else
13780eb10989Smrg#include <sys/param.h>
13790eb10989Smrg  printf ("m68k-sony-newsos%s\n",
13800eb10989Smrg#ifdef NEWSOS4
1381079e7944Smrg	"4"
13820eb10989Smrg#else
1383079e7944Smrg	""
13840eb10989Smrg#endif
1385079e7944Smrg	); exit (0);
13860eb10989Smrg#endif
13870eb10989Smrg#endif
13880eb10989Smrg
13890eb10989Smrg#if defined (__arm) && defined (__acorn) && defined (__unix)
139063165362Smrg  printf ("arm-acorn-riscix\n"); exit (0);
13910eb10989Smrg#endif
13920eb10989Smrg
13930eb10989Smrg#if defined (hp300) && !defined (hpux)
13940eb10989Smrg  printf ("m68k-hp-bsd\n"); exit (0);
13950eb10989Smrg#endif
13960eb10989Smrg
13970eb10989Smrg#if defined (NeXT)
13980eb10989Smrg#if !defined (__ARCHITECTURE__)
13990eb10989Smrg#define __ARCHITECTURE__ "m68k"
14000eb10989Smrg#endif
14010eb10989Smrg  int version;
14020eb10989Smrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
14030eb10989Smrg  if (version < 4)
14040eb10989Smrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
14050eb10989Smrg  else
14060eb10989Smrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
14070eb10989Smrg  exit (0);
14080eb10989Smrg#endif
14090eb10989Smrg
14100eb10989Smrg#if defined (MULTIMAX) || defined (n16)
14110eb10989Smrg#if defined (UMAXV)
14120eb10989Smrg  printf ("ns32k-encore-sysv\n"); exit (0);
14130eb10989Smrg#else
14140eb10989Smrg#if defined (CMU)
14150eb10989Smrg  printf ("ns32k-encore-mach\n"); exit (0);
14160eb10989Smrg#else
14170eb10989Smrg  printf ("ns32k-encore-bsd\n"); exit (0);
14180eb10989Smrg#endif
14190eb10989Smrg#endif
14200eb10989Smrg#endif
14210eb10989Smrg
14220eb10989Smrg#if defined (__386BSD__)
14230eb10989Smrg  printf ("i386-pc-bsd\n"); exit (0);
14240eb10989Smrg#endif
14250eb10989Smrg
14260eb10989Smrg#if defined (sequent)
14270eb10989Smrg#if defined (i386)
14280eb10989Smrg  printf ("i386-sequent-dynix\n"); exit (0);
14290eb10989Smrg#endif
14300eb10989Smrg#if defined (ns32000)
14310eb10989Smrg  printf ("ns32k-sequent-dynix\n"); exit (0);
14320eb10989Smrg#endif
14330eb10989Smrg#endif
14340eb10989Smrg
14350eb10989Smrg#if defined (_SEQUENT_)
14360eb10989Smrg    struct utsname un;
14370eb10989Smrg
14380eb10989Smrg    uname(&un);
14390eb10989Smrg
14400eb10989Smrg    if (strncmp(un.version, "V2", 2) == 0) {
14410eb10989Smrg	printf ("i386-sequent-ptx2\n"); exit (0);
14420eb10989Smrg    }
14430eb10989Smrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
14440eb10989Smrg	printf ("i386-sequent-ptx1\n"); exit (0);
14450eb10989Smrg    }
14460eb10989Smrg    printf ("i386-sequent-ptx\n"); exit (0);
14470eb10989Smrg
14480eb10989Smrg#endif
14490eb10989Smrg
14500eb10989Smrg#if defined (vax)
14510eb10989Smrg# if !defined (ultrix)
14520eb10989Smrg#  include <sys/param.h>
14530eb10989Smrg#  if defined (BSD)
14540eb10989Smrg#   if BSD == 43
14550eb10989Smrg      printf ("vax-dec-bsd4.3\n"); exit (0);
14560eb10989Smrg#   else
14570eb10989Smrg#    if BSD == 199006
14580eb10989Smrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
14590eb10989Smrg#    else
14600eb10989Smrg      printf ("vax-dec-bsd\n"); exit (0);
14610eb10989Smrg#    endif
14620eb10989Smrg#   endif
14630eb10989Smrg#  else
14640eb10989Smrg    printf ("vax-dec-bsd\n"); exit (0);
14650eb10989Smrg#  endif
14660eb10989Smrg# else
14670eb10989Smrg    printf ("vax-dec-ultrix\n"); exit (0);
14680eb10989Smrg# endif
14690eb10989Smrg#endif
14700eb10989Smrg
14710eb10989Smrg#if defined (alliant) && defined (i860)
14720eb10989Smrg  printf ("i860-alliant-bsd\n"); exit (0);
14730eb10989Smrg#endif
14740eb10989Smrg
14750eb10989Smrg  exit (1);
14760eb10989Smrg}
14770eb10989SmrgEOF
14780eb10989Smrg
147963165362Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
148063165362Smrg	{ echo "$SYSTEM_NAME"; exit; }
14810eb10989Smrg
14820eb10989Smrg# Apollos put the system type in the environment.
14830eb10989Smrg
148463165362Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
14850eb10989Smrg
14860eb10989Smrg# Convex versions that predate uname can use getsysinfo(1)
14870eb10989Smrg
14880eb10989Smrgif [ -x /usr/convex/getsysinfo ]
14890eb10989Smrgthen
14900eb10989Smrg    case `getsysinfo -f cpu_type` in
14910eb10989Smrg    c1*)
14920eb10989Smrg	echo c1-convex-bsd
149363165362Smrg	exit ;;
14940eb10989Smrg    c2*)
14950eb10989Smrg	if getsysinfo -f scalar_acc
14960eb10989Smrg	then echo c32-convex-bsd
14970eb10989Smrg	else echo c2-convex-bsd
14980eb10989Smrg	fi
149963165362Smrg	exit ;;
15000eb10989Smrg    c34*)
15010eb10989Smrg	echo c34-convex-bsd
150263165362Smrg	exit ;;
15030eb10989Smrg    c38*)
15040eb10989Smrg	echo c38-convex-bsd
150563165362Smrg	exit ;;
15060eb10989Smrg    c4*)
15070eb10989Smrg	echo c4-convex-bsd
150863165362Smrg	exit ;;
15090eb10989Smrg    esac
15100eb10989Smrgfi
15110eb10989Smrg
15120eb10989Smrgcat >&2 <<EOF
15130eb10989Smrg$0: unable to guess system type
15140eb10989Smrg
15150eb10989SmrgThis script, last modified $timestamp, has failed to recognize
15160eb10989Smrgthe operating system you are using. It is advised that you
15170eb10989Smrgdownload the most up to date version of the config scripts from
15180eb10989Smrg
151963165362Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
152063165362Smrgand
152163165362Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
15220eb10989Smrg
15230eb10989SmrgIf the version you run ($0) is already up to date, please
15240eb10989Smrgsend the following data and any information you think might be
15250eb10989Smrgpertinent to <config-patches@gnu.org> in order to provide the needed
15260eb10989Smrginformation to handle your system.
15270eb10989Smrg
15280eb10989Smrgconfig.guess timestamp = $timestamp
15290eb10989Smrg
15300eb10989Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
15310eb10989Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
15320eb10989Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
15330eb10989Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
15340eb10989Smrg
15350eb10989Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
15360eb10989Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
15370eb10989Smrg
15380eb10989Smrghostinfo               = `(hostinfo) 2>/dev/null`
15390eb10989Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
15400eb10989Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
15410eb10989Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
15420eb10989Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
15430eb10989Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
15440eb10989Smrg
15450eb10989SmrgUNAME_MACHINE = ${UNAME_MACHINE}
15460eb10989SmrgUNAME_RELEASE = ${UNAME_RELEASE}
15470eb10989SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
15480eb10989SmrgUNAME_VERSION = ${UNAME_VERSION}
15490eb10989SmrgEOF
15500eb10989Smrg
15510eb10989Smrgexit 1
15520eb10989Smrg
15530eb10989Smrg# Local variables:
15540eb10989Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
15550eb10989Smrg# time-stamp-start: "timestamp='"
15560eb10989Smrg# time-stamp-format: "%:y-%02m-%02d"
15570eb10989Smrg# time-stamp-end: "'"
15580eb10989Smrg# End:
1559