config.guess revision 17ca54c3
117ca54c3Smrg#!/bin/sh
217ca54c3Smrg# Attempt to guess a canonical system name.
317ca54c3Smrg#   Copyright 1992-2017 Free Software Foundation, Inc.
417ca54c3Smrg
517ca54c3Smrgtimestamp='2017-08-08'
617ca54c3Smrg
717ca54c3Smrg# This file is free software; you can redistribute it and/or modify it
817ca54c3Smrg# under the terms of the GNU General Public License as published by
917ca54c3Smrg# the Free Software Foundation; either version 3 of the License, or
1017ca54c3Smrg# (at your option) any later version.
1117ca54c3Smrg#
1217ca54c3Smrg# This program is distributed in the hope that it will be useful, but
1317ca54c3Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1417ca54c3Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1517ca54c3Smrg# General Public License for more details.
1617ca54c3Smrg#
1717ca54c3Smrg# You should have received a copy of the GNU General Public License
1817ca54c3Smrg# along with this program; if not, see <http://www.gnu.org/licenses/>.
1917ca54c3Smrg#
2017ca54c3Smrg# As a special exception to the GNU General Public License, if you
2117ca54c3Smrg# distribute this file as part of a program that contains a
2217ca54c3Smrg# configuration script generated by Autoconf, you may include it under
2317ca54c3Smrg# the same distribution terms that you use for the rest of that
2417ca54c3Smrg# program.  This Exception is an additional permission under section 7
2517ca54c3Smrg# of the GNU General Public License, version 3 ("GPLv3").
2617ca54c3Smrg#
2717ca54c3Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2817ca54c3Smrg#
2917ca54c3Smrg# You can get the latest version of this script from:
3017ca54c3Smrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3117ca54c3Smrg#
3217ca54c3Smrg# Please send patches to <config-patches@gnu.org>.
3317ca54c3Smrg
3417ca54c3Smrg
3517ca54c3Smrgme=`echo "$0" | sed -e 's,.*/,,'`
3617ca54c3Smrg
3717ca54c3Smrgusage="\
3817ca54c3SmrgUsage: $0 [OPTION]
3917ca54c3Smrg
4017ca54c3SmrgOutput the configuration name of the system \`$me' is run on.
4117ca54c3Smrg
4217ca54c3SmrgOperation modes:
4317ca54c3Smrg  -h, --help         print this help, then exit
4417ca54c3Smrg  -t, --time-stamp   print date of last modification, then exit
4517ca54c3Smrg  -v, --version      print version number, then exit
4617ca54c3Smrg
4717ca54c3SmrgReport bugs and patches to <config-patches@gnu.org>."
4817ca54c3Smrg
4917ca54c3Smrgversion="\
5017ca54c3SmrgGNU config.guess ($timestamp)
5117ca54c3Smrg
5217ca54c3SmrgOriginally written by Per Bothner.
5317ca54c3SmrgCopyright 1992-2017 Free Software Foundation, Inc.
5417ca54c3Smrg
5517ca54c3SmrgThis is free software; see the source for copying conditions.  There is NO
5617ca54c3Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
5717ca54c3Smrg
5817ca54c3Smrghelp="
5917ca54c3SmrgTry \`$me --help' for more information."
6017ca54c3Smrg
6117ca54c3Smrg# Parse command line
6217ca54c3Smrgwhile test $# -gt 0 ; do
6317ca54c3Smrg  case $1 in
6417ca54c3Smrg    --time-stamp | --time* | -t )
6517ca54c3Smrg       echo "$timestamp" ; exit ;;
6617ca54c3Smrg    --version | -v )
6717ca54c3Smrg       echo "$version" ; exit ;;
6817ca54c3Smrg    --help | --h* | -h )
6917ca54c3Smrg       echo "$usage"; exit ;;
7017ca54c3Smrg    -- )     # Stop option processing
7117ca54c3Smrg       shift; break ;;
7217ca54c3Smrg    - )	# Use stdin as input.
7317ca54c3Smrg       break ;;
7417ca54c3Smrg    -* )
7517ca54c3Smrg       echo "$me: invalid option $1$help" >&2
7617ca54c3Smrg       exit 1 ;;
7717ca54c3Smrg    * )
7817ca54c3Smrg       break ;;
7917ca54c3Smrg  esac
8017ca54c3Smrgdone
8117ca54c3Smrg
8217ca54c3Smrgif test $# != 0; then
8317ca54c3Smrg  echo "$me: too many arguments$help" >&2
8417ca54c3Smrg  exit 1
8517ca54c3Smrgfi
8617ca54c3Smrg
8717ca54c3Smrgtrap 'exit 1' 1 2 15
8817ca54c3Smrg
8917ca54c3Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9017ca54c3Smrg# compiler to aid in system detection is discouraged as it requires
9117ca54c3Smrg# temporary files to be created and, as you can see below, it is a
9217ca54c3Smrg# headache to deal with in a portable fashion.
9317ca54c3Smrg
9417ca54c3Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
9517ca54c3Smrg# use `HOST_CC' if defined, but it is deprecated.
9617ca54c3Smrg
9717ca54c3Smrg# Portable tmp directory creation inspired by the Autoconf team.
9817ca54c3Smrg
9917ca54c3Smrgset_cc_for_build='
10017ca54c3Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10117ca54c3Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10217ca54c3Smrg: ${TMPDIR=/tmp} ;
10317ca54c3Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
10417ca54c3Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
10517ca54c3Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
10617ca54c3Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
10717ca54c3Smrgdummy=$tmp/dummy ;
10817ca54c3Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
10917ca54c3Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11017ca54c3Smrg ,,)    echo "int x;" > $dummy.c ;
11117ca54c3Smrg	for c in cc gcc c89 c99 ; do
11217ca54c3Smrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
11317ca54c3Smrg	     CC_FOR_BUILD="$c"; break ;
11417ca54c3Smrg	  fi ;
11517ca54c3Smrg	done ;
11617ca54c3Smrg	if test x"$CC_FOR_BUILD" = x ; then
11717ca54c3Smrg	  CC_FOR_BUILD=no_compiler_found ;
11817ca54c3Smrg	fi
11917ca54c3Smrg	;;
12017ca54c3Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12117ca54c3Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12217ca54c3Smrgesac ; set_cc_for_build= ;'
12317ca54c3Smrg
12417ca54c3Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
12517ca54c3Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
12617ca54c3Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
12717ca54c3Smrg	PATH=$PATH:/.attbin ; export PATH
12817ca54c3Smrgfi
12917ca54c3Smrg
13017ca54c3SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13117ca54c3SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13217ca54c3SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
13317ca54c3SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
13417ca54c3Smrg
13517ca54c3Smrgcase "${UNAME_SYSTEM}" in
13617ca54c3SmrgLinux|GNU|GNU/*)
13717ca54c3Smrg	# If the system lacks a compiler, then just pick glibc.
13817ca54c3Smrg	# We could probably try harder.
13917ca54c3Smrg	LIBC=gnu
14017ca54c3Smrg
14117ca54c3Smrg	eval $set_cc_for_build
14217ca54c3Smrg	cat <<-EOF > $dummy.c
14317ca54c3Smrg	#include <features.h>
14417ca54c3Smrg	#if defined(__UCLIBC__)
14517ca54c3Smrg	LIBC=uclibc
14617ca54c3Smrg	#elif defined(__dietlibc__)
14717ca54c3Smrg	LIBC=dietlibc
14817ca54c3Smrg	#else
14917ca54c3Smrg	LIBC=gnu
15017ca54c3Smrg	#endif
15117ca54c3Smrg	EOF
15217ca54c3Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
15317ca54c3Smrg	;;
15417ca54c3Smrgesac
15517ca54c3Smrg
15617ca54c3Smrg# Note: order is significant - the case branches are not exclusive.
15717ca54c3Smrg
15817ca54c3Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
15917ca54c3Smrg    *:NetBSD:*:*)
16017ca54c3Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
16117ca54c3Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
16217ca54c3Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
16317ca54c3Smrg	# switched to ELF, *-*-netbsd* would select the old
16417ca54c3Smrg	# object file format.  This provides both forward
16517ca54c3Smrg	# compatibility and a consistent mechanism for selecting the
16617ca54c3Smrg	# object file format.
16717ca54c3Smrg	#
16817ca54c3Smrg	# Note: NetBSD doesn't particularly care about the vendor
16917ca54c3Smrg	# portion of the name.  We always set it to "unknown".
17017ca54c3Smrg	sysctl="sysctl -n hw.machine_arch"
17117ca54c3Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
17217ca54c3Smrg	    /sbin/$sysctl 2>/dev/null || \
17317ca54c3Smrg	    /usr/sbin/$sysctl 2>/dev/null || \
17417ca54c3Smrg	    echo unknown)`
17517ca54c3Smrg	case "${UNAME_MACHINE_ARCH}" in
17617ca54c3Smrg	    armeb) machine=armeb-unknown ;;
17717ca54c3Smrg	    arm*) machine=arm-unknown ;;
17817ca54c3Smrg	    sh3el) machine=shl-unknown ;;
17917ca54c3Smrg	    sh3eb) machine=sh-unknown ;;
18017ca54c3Smrg	    sh5el) machine=sh5le-unknown ;;
18117ca54c3Smrg	    earmv*)
18217ca54c3Smrg		arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
18317ca54c3Smrg		endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
18417ca54c3Smrg		machine=${arch}${endian}-unknown
18517ca54c3Smrg		;;
18617ca54c3Smrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
18717ca54c3Smrg	esac
18817ca54c3Smrg	# The Operating System including object format, if it has switched
18917ca54c3Smrg	# to ELF recently (or will in the future) and ABI.
19017ca54c3Smrg	case "${UNAME_MACHINE_ARCH}" in
19117ca54c3Smrg	    earm*)
19217ca54c3Smrg		os=netbsdelf
19317ca54c3Smrg		;;
19417ca54c3Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
19517ca54c3Smrg		eval $set_cc_for_build
19617ca54c3Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
19717ca54c3Smrg			| grep -q __ELF__
19817ca54c3Smrg		then
19917ca54c3Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
20017ca54c3Smrg		    # Return netbsd for either.  FIX?
20117ca54c3Smrg		    os=netbsd
20217ca54c3Smrg		else
20317ca54c3Smrg		    os=netbsdelf
20417ca54c3Smrg		fi
20517ca54c3Smrg		;;
20617ca54c3Smrg	    *)
20717ca54c3Smrg		os=netbsd
20817ca54c3Smrg		;;
20917ca54c3Smrg	esac
21017ca54c3Smrg	# Determine ABI tags.
21117ca54c3Smrg	case "${UNAME_MACHINE_ARCH}" in
21217ca54c3Smrg	    earm*)
21317ca54c3Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
21417ca54c3Smrg		abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
21517ca54c3Smrg		;;
21617ca54c3Smrg	esac
21717ca54c3Smrg	# The OS release
21817ca54c3Smrg	# Debian GNU/NetBSD machines have a different userland, and
21917ca54c3Smrg	# thus, need a distinct triplet. However, they do not need
22017ca54c3Smrg	# kernel version information, so it can be replaced with a
22117ca54c3Smrg	# suitable tag, in the style of linux-gnu.
22217ca54c3Smrg	case "${UNAME_VERSION}" in
22317ca54c3Smrg	    Debian*)
22417ca54c3Smrg		release='-gnu'
22517ca54c3Smrg		;;
22617ca54c3Smrg	    *)
22717ca54c3Smrg		release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
22817ca54c3Smrg		;;
22917ca54c3Smrg	esac
23017ca54c3Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
23117ca54c3Smrg	# contains redundant information, the shorter form:
23217ca54c3Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
23317ca54c3Smrg	echo "${machine}-${os}${release}${abi}"
23417ca54c3Smrg	exit ;;
23517ca54c3Smrg    *:Bitrig:*:*)
23617ca54c3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
23717ca54c3Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
23817ca54c3Smrg	exit ;;
23917ca54c3Smrg    *:OpenBSD:*:*)
24017ca54c3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
24117ca54c3Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
24217ca54c3Smrg	exit ;;
24317ca54c3Smrg    *:LibertyBSD:*:*)
24417ca54c3Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
24517ca54c3Smrg	echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
24617ca54c3Smrg	exit ;;
24717ca54c3Smrg    *:ekkoBSD:*:*)
24817ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
24917ca54c3Smrg	exit ;;
25017ca54c3Smrg    *:SolidBSD:*:*)
25117ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
25217ca54c3Smrg	exit ;;
25317ca54c3Smrg    macppc:MirBSD:*:*)
25417ca54c3Smrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
25517ca54c3Smrg	exit ;;
25617ca54c3Smrg    *:MirBSD:*:*)
25717ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
25817ca54c3Smrg	exit ;;
25917ca54c3Smrg    *:Sortix:*:*)
26017ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-sortix
26117ca54c3Smrg	exit ;;
26217ca54c3Smrg    *:Redox:*:*)
26317ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-redox
26417ca54c3Smrg	exit ;;
26517ca54c3Smrg    alpha:OSF1:*:*)
26617ca54c3Smrg	case $UNAME_RELEASE in
26717ca54c3Smrg	*4.0)
26817ca54c3Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
26917ca54c3Smrg		;;
27017ca54c3Smrg	*5.*)
27117ca54c3Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
27217ca54c3Smrg		;;
27317ca54c3Smrg	esac
27417ca54c3Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
27517ca54c3Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
27617ca54c3Smrg	# covers most systems running today.  This code pipes the CPU
27717ca54c3Smrg	# types through head -n 1, so we only detect the type of CPU 0.
27817ca54c3Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
27917ca54c3Smrg	case "$ALPHA_CPU_TYPE" in
28017ca54c3Smrg	    "EV4 (21064)")
28117ca54c3Smrg		UNAME_MACHINE=alpha ;;
28217ca54c3Smrg	    "EV4.5 (21064)")
28317ca54c3Smrg		UNAME_MACHINE=alpha ;;
28417ca54c3Smrg	    "LCA4 (21066/21068)")
28517ca54c3Smrg		UNAME_MACHINE=alpha ;;
28617ca54c3Smrg	    "EV5 (21164)")
28717ca54c3Smrg		UNAME_MACHINE=alphaev5 ;;
28817ca54c3Smrg	    "EV5.6 (21164A)")
28917ca54c3Smrg		UNAME_MACHINE=alphaev56 ;;
29017ca54c3Smrg	    "EV5.6 (21164PC)")
29117ca54c3Smrg		UNAME_MACHINE=alphapca56 ;;
29217ca54c3Smrg	    "EV5.7 (21164PC)")
29317ca54c3Smrg		UNAME_MACHINE=alphapca57 ;;
29417ca54c3Smrg	    "EV6 (21264)")
29517ca54c3Smrg		UNAME_MACHINE=alphaev6 ;;
29617ca54c3Smrg	    "EV6.7 (21264A)")
29717ca54c3Smrg		UNAME_MACHINE=alphaev67 ;;
29817ca54c3Smrg	    "EV6.8CB (21264C)")
29917ca54c3Smrg		UNAME_MACHINE=alphaev68 ;;
30017ca54c3Smrg	    "EV6.8AL (21264B)")
30117ca54c3Smrg		UNAME_MACHINE=alphaev68 ;;
30217ca54c3Smrg	    "EV6.8CX (21264D)")
30317ca54c3Smrg		UNAME_MACHINE=alphaev68 ;;
30417ca54c3Smrg	    "EV6.9A (21264/EV69A)")
30517ca54c3Smrg		UNAME_MACHINE=alphaev69 ;;
30617ca54c3Smrg	    "EV7 (21364)")
30717ca54c3Smrg		UNAME_MACHINE=alphaev7 ;;
30817ca54c3Smrg	    "EV7.9 (21364A)")
30917ca54c3Smrg		UNAME_MACHINE=alphaev79 ;;
31017ca54c3Smrg	esac
31117ca54c3Smrg	# A Pn.n version is a patched version.
31217ca54c3Smrg	# A Vn.n version is a released version.
31317ca54c3Smrg	# A Tn.n version is a released field test version.
31417ca54c3Smrg	# A Xn.n version is an unreleased experimental baselevel.
31517ca54c3Smrg	# 1.2 uses "1.2" for uname -r.
31617ca54c3Smrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
31717ca54c3Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
31817ca54c3Smrg	exitcode=$?
31917ca54c3Smrg	trap '' 0
32017ca54c3Smrg	exit $exitcode ;;
32117ca54c3Smrg    Alpha\ *:Windows_NT*:*)
32217ca54c3Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
32317ca54c3Smrg	# Should we change UNAME_MACHINE based on the output of uname instead
32417ca54c3Smrg	# of the specific Alpha model?
32517ca54c3Smrg	echo alpha-pc-interix
32617ca54c3Smrg	exit ;;
32717ca54c3Smrg    21064:Windows_NT:50:3)
32817ca54c3Smrg	echo alpha-dec-winnt3.5
32917ca54c3Smrg	exit ;;
33017ca54c3Smrg    Amiga*:UNIX_System_V:4.0:*)
33117ca54c3Smrg	echo m68k-unknown-sysv4
33217ca54c3Smrg	exit ;;
33317ca54c3Smrg    *:[Aa]miga[Oo][Ss]:*:*)
33417ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-amigaos
33517ca54c3Smrg	exit ;;
33617ca54c3Smrg    *:[Mm]orph[Oo][Ss]:*:*)
33717ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-morphos
33817ca54c3Smrg	exit ;;
33917ca54c3Smrg    *:OS/390:*:*)
34017ca54c3Smrg	echo i370-ibm-openedition
34117ca54c3Smrg	exit ;;
34217ca54c3Smrg    *:z/VM:*:*)
34317ca54c3Smrg	echo s390-ibm-zvmoe
34417ca54c3Smrg	exit ;;
34517ca54c3Smrg    *:OS400:*:*)
34617ca54c3Smrg	echo powerpc-ibm-os400
34717ca54c3Smrg	exit ;;
34817ca54c3Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
34917ca54c3Smrg	echo arm-acorn-riscix${UNAME_RELEASE}
35017ca54c3Smrg	exit ;;
35117ca54c3Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
35217ca54c3Smrg	echo arm-unknown-riscos
35317ca54c3Smrg	exit ;;
35417ca54c3Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
35517ca54c3Smrg	echo hppa1.1-hitachi-hiuxmpp
35617ca54c3Smrg	exit ;;
35717ca54c3Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
35817ca54c3Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
35917ca54c3Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
36017ca54c3Smrg		echo pyramid-pyramid-sysv3
36117ca54c3Smrg	else
36217ca54c3Smrg		echo pyramid-pyramid-bsd
36317ca54c3Smrg	fi
36417ca54c3Smrg	exit ;;
36517ca54c3Smrg    NILE*:*:*:dcosx)
36617ca54c3Smrg	echo pyramid-pyramid-svr4
36717ca54c3Smrg	exit ;;
36817ca54c3Smrg    DRS?6000:unix:4.0:6*)
36917ca54c3Smrg	echo sparc-icl-nx6
37017ca54c3Smrg	exit ;;
37117ca54c3Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
37217ca54c3Smrg	case `/usr/bin/uname -p` in
37317ca54c3Smrg	    sparc) echo sparc-icl-nx7; exit ;;
37417ca54c3Smrg	esac ;;
37517ca54c3Smrg    s390x:SunOS:*:*)
37617ca54c3Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
37717ca54c3Smrg	exit ;;
37817ca54c3Smrg    sun4H:SunOS:5.*:*)
37917ca54c3Smrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
38017ca54c3Smrg	exit ;;
38117ca54c3Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
38217ca54c3Smrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
38317ca54c3Smrg	exit ;;
38417ca54c3Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
38517ca54c3Smrg	echo i386-pc-auroraux${UNAME_RELEASE}
38617ca54c3Smrg	exit ;;
38717ca54c3Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
38817ca54c3Smrg	eval $set_cc_for_build
38917ca54c3Smrg	SUN_ARCH=i386
39017ca54c3Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
39117ca54c3Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
39217ca54c3Smrg	# This test works for both compilers.
39317ca54c3Smrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
39417ca54c3Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
39517ca54c3Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
39617ca54c3Smrg		grep IS_64BIT_ARCH >/dev/null
39717ca54c3Smrg	    then
39817ca54c3Smrg		SUN_ARCH=x86_64
39917ca54c3Smrg	    fi
40017ca54c3Smrg	fi
40117ca54c3Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
40217ca54c3Smrg	exit ;;
40317ca54c3Smrg    sun4*:SunOS:6*:*)
40417ca54c3Smrg	# According to config.sub, this is the proper way to canonicalize
40517ca54c3Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
40617ca54c3Smrg	# it's likely to be more like Solaris than SunOS4.
40717ca54c3Smrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
40817ca54c3Smrg	exit ;;
40917ca54c3Smrg    sun4*:SunOS:*:*)
41017ca54c3Smrg	case "`/usr/bin/arch -k`" in
41117ca54c3Smrg	    Series*|S4*)
41217ca54c3Smrg		UNAME_RELEASE=`uname -v`
41317ca54c3Smrg		;;
41417ca54c3Smrg	esac
41517ca54c3Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
41617ca54c3Smrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
41717ca54c3Smrg	exit ;;
41817ca54c3Smrg    sun3*:SunOS:*:*)
41917ca54c3Smrg	echo m68k-sun-sunos${UNAME_RELEASE}
42017ca54c3Smrg	exit ;;
42117ca54c3Smrg    sun*:*:4.2BSD:*)
42217ca54c3Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
42317ca54c3Smrg	test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
42417ca54c3Smrg	case "`/bin/arch`" in
42517ca54c3Smrg	    sun3)
42617ca54c3Smrg		echo m68k-sun-sunos${UNAME_RELEASE}
42717ca54c3Smrg		;;
42817ca54c3Smrg	    sun4)
42917ca54c3Smrg		echo sparc-sun-sunos${UNAME_RELEASE}
43017ca54c3Smrg		;;
43117ca54c3Smrg	esac
43217ca54c3Smrg	exit ;;
43317ca54c3Smrg    aushp:SunOS:*:*)
43417ca54c3Smrg	echo sparc-auspex-sunos${UNAME_RELEASE}
43517ca54c3Smrg	exit ;;
43617ca54c3Smrg    # The situation for MiNT is a little confusing.  The machine name
43717ca54c3Smrg    # can be virtually everything (everything which is not
43817ca54c3Smrg    # "atarist" or "atariste" at least should have a processor
43917ca54c3Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
44017ca54c3Smrg    # to the lowercase version "mint" (or "freemint").  Finally
44117ca54c3Smrg    # the system name "TOS" denotes a system which is actually not
44217ca54c3Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
44317ca54c3Smrg    # be no problem.
44417ca54c3Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
44517ca54c3Smrg	echo m68k-atari-mint${UNAME_RELEASE}
44617ca54c3Smrg	exit ;;
44717ca54c3Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
44817ca54c3Smrg	echo m68k-atari-mint${UNAME_RELEASE}
44917ca54c3Smrg	exit ;;
45017ca54c3Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
45117ca54c3Smrg	echo m68k-atari-mint${UNAME_RELEASE}
45217ca54c3Smrg	exit ;;
45317ca54c3Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
45417ca54c3Smrg	echo m68k-milan-mint${UNAME_RELEASE}
45517ca54c3Smrg	exit ;;
45617ca54c3Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
45717ca54c3Smrg	echo m68k-hades-mint${UNAME_RELEASE}
45817ca54c3Smrg	exit ;;
45917ca54c3Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
46017ca54c3Smrg	echo m68k-unknown-mint${UNAME_RELEASE}
46117ca54c3Smrg	exit ;;
46217ca54c3Smrg    m68k:machten:*:*)
46317ca54c3Smrg	echo m68k-apple-machten${UNAME_RELEASE}
46417ca54c3Smrg	exit ;;
46517ca54c3Smrg    powerpc:machten:*:*)
46617ca54c3Smrg	echo powerpc-apple-machten${UNAME_RELEASE}
46717ca54c3Smrg	exit ;;
46817ca54c3Smrg    RISC*:Mach:*:*)
46917ca54c3Smrg	echo mips-dec-mach_bsd4.3
47017ca54c3Smrg	exit ;;
47117ca54c3Smrg    RISC*:ULTRIX:*:*)
47217ca54c3Smrg	echo mips-dec-ultrix${UNAME_RELEASE}
47317ca54c3Smrg	exit ;;
47417ca54c3Smrg    VAX*:ULTRIX*:*:*)
47517ca54c3Smrg	echo vax-dec-ultrix${UNAME_RELEASE}
47617ca54c3Smrg	exit ;;
47717ca54c3Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
47817ca54c3Smrg	echo clipper-intergraph-clix${UNAME_RELEASE}
47917ca54c3Smrg	exit ;;
48017ca54c3Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
48117ca54c3Smrg	eval $set_cc_for_build
48217ca54c3Smrg	sed 's/^	//' << EOF >$dummy.c
48317ca54c3Smrg#ifdef __cplusplus
48417ca54c3Smrg#include <stdio.h>  /* for printf() prototype */
48517ca54c3Smrg	int main (int argc, char *argv[]) {
48617ca54c3Smrg#else
48717ca54c3Smrg	int main (argc, argv) int argc; char *argv[]; {
48817ca54c3Smrg#endif
48917ca54c3Smrg	#if defined (host_mips) && defined (MIPSEB)
49017ca54c3Smrg	#if defined (SYSTYPE_SYSV)
49117ca54c3Smrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
49217ca54c3Smrg	#endif
49317ca54c3Smrg	#if defined (SYSTYPE_SVR4)
49417ca54c3Smrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
49517ca54c3Smrg	#endif
49617ca54c3Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
49717ca54c3Smrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
49817ca54c3Smrg	#endif
49917ca54c3Smrg	#endif
50017ca54c3Smrg	  exit (-1);
50117ca54c3Smrg	}
50217ca54c3SmrgEOF
50317ca54c3Smrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
50417ca54c3Smrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
50517ca54c3Smrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
50617ca54c3Smrg	    { echo "$SYSTEM_NAME"; exit; }
50717ca54c3Smrg	echo mips-mips-riscos${UNAME_RELEASE}
50817ca54c3Smrg	exit ;;
50917ca54c3Smrg    Motorola:PowerMAX_OS:*:*)
51017ca54c3Smrg	echo powerpc-motorola-powermax
51117ca54c3Smrg	exit ;;
51217ca54c3Smrg    Motorola:*:4.3:PL8-*)
51317ca54c3Smrg	echo powerpc-harris-powermax
51417ca54c3Smrg	exit ;;
51517ca54c3Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
51617ca54c3Smrg	echo powerpc-harris-powermax
51717ca54c3Smrg	exit ;;
51817ca54c3Smrg    Night_Hawk:Power_UNIX:*:*)
51917ca54c3Smrg	echo powerpc-harris-powerunix
52017ca54c3Smrg	exit ;;
52117ca54c3Smrg    m88k:CX/UX:7*:*)
52217ca54c3Smrg	echo m88k-harris-cxux7
52317ca54c3Smrg	exit ;;
52417ca54c3Smrg    m88k:*:4*:R4*)
52517ca54c3Smrg	echo m88k-motorola-sysv4
52617ca54c3Smrg	exit ;;
52717ca54c3Smrg    m88k:*:3*:R3*)
52817ca54c3Smrg	echo m88k-motorola-sysv3
52917ca54c3Smrg	exit ;;
53017ca54c3Smrg    AViiON:dgux:*:*)
53117ca54c3Smrg	# DG/UX returns AViiON for all architectures
53217ca54c3Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
53317ca54c3Smrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
53417ca54c3Smrg	then
53517ca54c3Smrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
53617ca54c3Smrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
53717ca54c3Smrg	    then
53817ca54c3Smrg		echo m88k-dg-dgux${UNAME_RELEASE}
53917ca54c3Smrg	    else
54017ca54c3Smrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
54117ca54c3Smrg	    fi
54217ca54c3Smrg	else
54317ca54c3Smrg	    echo i586-dg-dgux${UNAME_RELEASE}
54417ca54c3Smrg	fi
54517ca54c3Smrg	exit ;;
54617ca54c3Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
54717ca54c3Smrg	echo m88k-dolphin-sysv3
54817ca54c3Smrg	exit ;;
54917ca54c3Smrg    M88*:*:R3*:*)
55017ca54c3Smrg	# Delta 88k system running SVR3
55117ca54c3Smrg	echo m88k-motorola-sysv3
55217ca54c3Smrg	exit ;;
55317ca54c3Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
55417ca54c3Smrg	echo m88k-tektronix-sysv3
55517ca54c3Smrg	exit ;;
55617ca54c3Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
55717ca54c3Smrg	echo m68k-tektronix-bsd
55817ca54c3Smrg	exit ;;
55917ca54c3Smrg    *:IRIX*:*:*)
56017ca54c3Smrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
56117ca54c3Smrg	exit ;;
56217ca54c3Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
56317ca54c3Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
56417ca54c3Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
56517ca54c3Smrg    i*86:AIX:*:*)
56617ca54c3Smrg	echo i386-ibm-aix
56717ca54c3Smrg	exit ;;
56817ca54c3Smrg    ia64:AIX:*:*)
56917ca54c3Smrg	if [ -x /usr/bin/oslevel ] ; then
57017ca54c3Smrg		IBM_REV=`/usr/bin/oslevel`
57117ca54c3Smrg	else
57217ca54c3Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
57317ca54c3Smrg	fi
57417ca54c3Smrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
57517ca54c3Smrg	exit ;;
57617ca54c3Smrg    *:AIX:2:3)
57717ca54c3Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
57817ca54c3Smrg		eval $set_cc_for_build
57917ca54c3Smrg		sed 's/^		//' << EOF >$dummy.c
58017ca54c3Smrg		#include <sys/systemcfg.h>
58117ca54c3Smrg
58217ca54c3Smrg		main()
58317ca54c3Smrg			{
58417ca54c3Smrg			if (!__power_pc())
58517ca54c3Smrg				exit(1);
58617ca54c3Smrg			puts("powerpc-ibm-aix3.2.5");
58717ca54c3Smrg			exit(0);
58817ca54c3Smrg			}
58917ca54c3SmrgEOF
59017ca54c3Smrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
59117ca54c3Smrg		then
59217ca54c3Smrg			echo "$SYSTEM_NAME"
59317ca54c3Smrg		else
59417ca54c3Smrg			echo rs6000-ibm-aix3.2.5
59517ca54c3Smrg		fi
59617ca54c3Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
59717ca54c3Smrg		echo rs6000-ibm-aix3.2.4
59817ca54c3Smrg	else
59917ca54c3Smrg		echo rs6000-ibm-aix3.2
60017ca54c3Smrg	fi
60117ca54c3Smrg	exit ;;
60217ca54c3Smrg    *:AIX:*:[4567])
60317ca54c3Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
60417ca54c3Smrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
60517ca54c3Smrg		IBM_ARCH=rs6000
60617ca54c3Smrg	else
60717ca54c3Smrg		IBM_ARCH=powerpc
60817ca54c3Smrg	fi
60917ca54c3Smrg	if [ -x /usr/bin/lslpp ] ; then
61017ca54c3Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
61117ca54c3Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
61217ca54c3Smrg	else
61317ca54c3Smrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
61417ca54c3Smrg	fi
61517ca54c3Smrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
61617ca54c3Smrg	exit ;;
61717ca54c3Smrg    *:AIX:*:*)
61817ca54c3Smrg	echo rs6000-ibm-aix
61917ca54c3Smrg	exit ;;
62017ca54c3Smrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
62117ca54c3Smrg	echo romp-ibm-bsd4.4
62217ca54c3Smrg	exit ;;
62317ca54c3Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
62417ca54c3Smrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
62517ca54c3Smrg	exit ;;                             # report: romp-ibm BSD 4.3
62617ca54c3Smrg    *:BOSX:*:*)
62717ca54c3Smrg	echo rs6000-bull-bosx
62817ca54c3Smrg	exit ;;
62917ca54c3Smrg    DPX/2?00:B.O.S.:*:*)
63017ca54c3Smrg	echo m68k-bull-sysv3
63117ca54c3Smrg	exit ;;
63217ca54c3Smrg    9000/[34]??:4.3bsd:1.*:*)
63317ca54c3Smrg	echo m68k-hp-bsd
63417ca54c3Smrg	exit ;;
63517ca54c3Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
63617ca54c3Smrg	echo m68k-hp-bsd4.4
63717ca54c3Smrg	exit ;;
63817ca54c3Smrg    9000/[34678]??:HP-UX:*:*)
63917ca54c3Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
64017ca54c3Smrg	case "${UNAME_MACHINE}" in
64117ca54c3Smrg	    9000/31? )            HP_ARCH=m68000 ;;
64217ca54c3Smrg	    9000/[34]?? )         HP_ARCH=m68k ;;
64317ca54c3Smrg	    9000/[678][0-9][0-9])
64417ca54c3Smrg		if [ -x /usr/bin/getconf ]; then
64517ca54c3Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
64617ca54c3Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
64717ca54c3Smrg		    case "${sc_cpu_version}" in
64817ca54c3Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
64917ca54c3Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
65017ca54c3Smrg		      532)                      # CPU_PA_RISC2_0
65117ca54c3Smrg			case "${sc_kernel_bits}" in
65217ca54c3Smrg			  32) HP_ARCH=hppa2.0n ;;
65317ca54c3Smrg			  64) HP_ARCH=hppa2.0w ;;
65417ca54c3Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
65517ca54c3Smrg			esac ;;
65617ca54c3Smrg		    esac
65717ca54c3Smrg		fi
65817ca54c3Smrg		if [ "${HP_ARCH}" = "" ]; then
65917ca54c3Smrg		    eval $set_cc_for_build
66017ca54c3Smrg		    sed 's/^		//' << EOF >$dummy.c
66117ca54c3Smrg
66217ca54c3Smrg		#define _HPUX_SOURCE
66317ca54c3Smrg		#include <stdlib.h>
66417ca54c3Smrg		#include <unistd.h>
66517ca54c3Smrg
66617ca54c3Smrg		int main ()
66717ca54c3Smrg		{
66817ca54c3Smrg		#if defined(_SC_KERNEL_BITS)
66917ca54c3Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
67017ca54c3Smrg		#endif
67117ca54c3Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
67217ca54c3Smrg
67317ca54c3Smrg		    switch (cpu)
67417ca54c3Smrg			{
67517ca54c3Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
67617ca54c3Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
67717ca54c3Smrg			case CPU_PA_RISC2_0:
67817ca54c3Smrg		#if defined(_SC_KERNEL_BITS)
67917ca54c3Smrg			    switch (bits)
68017ca54c3Smrg				{
68117ca54c3Smrg				case 64: puts ("hppa2.0w"); break;
68217ca54c3Smrg				case 32: puts ("hppa2.0n"); break;
68317ca54c3Smrg				default: puts ("hppa2.0"); break;
68417ca54c3Smrg				} break;
68517ca54c3Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
68617ca54c3Smrg			    puts ("hppa2.0"); break;
68717ca54c3Smrg		#endif
68817ca54c3Smrg			default: puts ("hppa1.0"); break;
68917ca54c3Smrg			}
69017ca54c3Smrg		    exit (0);
69117ca54c3Smrg		}
69217ca54c3SmrgEOF
69317ca54c3Smrg		    (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
69417ca54c3Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
69517ca54c3Smrg		fi ;;
69617ca54c3Smrg	esac
69717ca54c3Smrg	if [ ${HP_ARCH} = hppa2.0w ]
69817ca54c3Smrg	then
69917ca54c3Smrg	    eval $set_cc_for_build
70017ca54c3Smrg
70117ca54c3Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
70217ca54c3Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
70317ca54c3Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
70417ca54c3Smrg	    #
70517ca54c3Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
70617ca54c3Smrg	    # => hppa2.0w-hp-hpux11.23
70717ca54c3Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
70817ca54c3Smrg	    # => hppa64-hp-hpux11.23
70917ca54c3Smrg
71017ca54c3Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
71117ca54c3Smrg		grep -q __LP64__
71217ca54c3Smrg	    then
71317ca54c3Smrg		HP_ARCH=hppa2.0w
71417ca54c3Smrg	    else
71517ca54c3Smrg		HP_ARCH=hppa64
71617ca54c3Smrg	    fi
71717ca54c3Smrg	fi
71817ca54c3Smrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
71917ca54c3Smrg	exit ;;
72017ca54c3Smrg    ia64:HP-UX:*:*)
72117ca54c3Smrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
72217ca54c3Smrg	echo ia64-hp-hpux${HPUX_REV}
72317ca54c3Smrg	exit ;;
72417ca54c3Smrg    3050*:HI-UX:*:*)
72517ca54c3Smrg	eval $set_cc_for_build
72617ca54c3Smrg	sed 's/^	//' << EOF >$dummy.c
72717ca54c3Smrg	#include <unistd.h>
72817ca54c3Smrg	int
72917ca54c3Smrg	main ()
73017ca54c3Smrg	{
73117ca54c3Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
73217ca54c3Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
73317ca54c3Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
73417ca54c3Smrg	     results, however.  */
73517ca54c3Smrg	  if (CPU_IS_PA_RISC (cpu))
73617ca54c3Smrg	    {
73717ca54c3Smrg	      switch (cpu)
73817ca54c3Smrg		{
73917ca54c3Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
74017ca54c3Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
74117ca54c3Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
74217ca54c3Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
74317ca54c3Smrg		}
74417ca54c3Smrg	    }
74517ca54c3Smrg	  else if (CPU_IS_HP_MC68K (cpu))
74617ca54c3Smrg	    puts ("m68k-hitachi-hiuxwe2");
74717ca54c3Smrg	  else puts ("unknown-hitachi-hiuxwe2");
74817ca54c3Smrg	  exit (0);
74917ca54c3Smrg	}
75017ca54c3SmrgEOF
75117ca54c3Smrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
75217ca54c3Smrg		{ echo "$SYSTEM_NAME"; exit; }
75317ca54c3Smrg	echo unknown-hitachi-hiuxwe2
75417ca54c3Smrg	exit ;;
75517ca54c3Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
75617ca54c3Smrg	echo hppa1.1-hp-bsd
75717ca54c3Smrg	exit ;;
75817ca54c3Smrg    9000/8??:4.3bsd:*:*)
75917ca54c3Smrg	echo hppa1.0-hp-bsd
76017ca54c3Smrg	exit ;;
76117ca54c3Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
76217ca54c3Smrg	echo hppa1.0-hp-mpeix
76317ca54c3Smrg	exit ;;
76417ca54c3Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
76517ca54c3Smrg	echo hppa1.1-hp-osf
76617ca54c3Smrg	exit ;;
76717ca54c3Smrg    hp8??:OSF1:*:*)
76817ca54c3Smrg	echo hppa1.0-hp-osf
76917ca54c3Smrg	exit ;;
77017ca54c3Smrg    i*86:OSF1:*:*)
77117ca54c3Smrg	if [ -x /usr/sbin/sysversion ] ; then
77217ca54c3Smrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
77317ca54c3Smrg	else
77417ca54c3Smrg	    echo ${UNAME_MACHINE}-unknown-osf1
77517ca54c3Smrg	fi
77617ca54c3Smrg	exit ;;
77717ca54c3Smrg    parisc*:Lites*:*:*)
77817ca54c3Smrg	echo hppa1.1-hp-lites
77917ca54c3Smrg	exit ;;
78017ca54c3Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
78117ca54c3Smrg	echo c1-convex-bsd
78217ca54c3Smrg	exit ;;
78317ca54c3Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
78417ca54c3Smrg	if getsysinfo -f scalar_acc
78517ca54c3Smrg	then echo c32-convex-bsd
78617ca54c3Smrg	else echo c2-convex-bsd
78717ca54c3Smrg	fi
78817ca54c3Smrg	exit ;;
78917ca54c3Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
79017ca54c3Smrg	echo c34-convex-bsd
79117ca54c3Smrg	exit ;;
79217ca54c3Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
79317ca54c3Smrg	echo c38-convex-bsd
79417ca54c3Smrg	exit ;;
79517ca54c3Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
79617ca54c3Smrg	echo c4-convex-bsd
79717ca54c3Smrg	exit ;;
79817ca54c3Smrg    CRAY*Y-MP:*:*:*)
79917ca54c3Smrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
80017ca54c3Smrg	exit ;;
80117ca54c3Smrg    CRAY*[A-Z]90:*:*:*)
80217ca54c3Smrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
80317ca54c3Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
80417ca54c3Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
80517ca54c3Smrg	      -e 's/\.[^.]*$/.X/'
80617ca54c3Smrg	exit ;;
80717ca54c3Smrg    CRAY*TS:*:*:*)
80817ca54c3Smrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
80917ca54c3Smrg	exit ;;
81017ca54c3Smrg    CRAY*T3E:*:*:*)
81117ca54c3Smrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
81217ca54c3Smrg	exit ;;
81317ca54c3Smrg    CRAY*SV1:*:*:*)
81417ca54c3Smrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
81517ca54c3Smrg	exit ;;
81617ca54c3Smrg    *:UNICOS/mp:*:*)
81717ca54c3Smrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
81817ca54c3Smrg	exit ;;
81917ca54c3Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
82017ca54c3Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
82117ca54c3Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
82217ca54c3Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
82317ca54c3Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
82417ca54c3Smrg	exit ;;
82517ca54c3Smrg    5000:UNIX_System_V:4.*:*)
82617ca54c3Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
82717ca54c3Smrg	FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
82817ca54c3Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
82917ca54c3Smrg	exit ;;
83017ca54c3Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
83117ca54c3Smrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
83217ca54c3Smrg	exit ;;
83317ca54c3Smrg    sparc*:BSD/OS:*:*)
83417ca54c3Smrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
83517ca54c3Smrg	exit ;;
83617ca54c3Smrg    *:BSD/OS:*:*)
83717ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
83817ca54c3Smrg	exit ;;
83917ca54c3Smrg    *:FreeBSD:*:*)
84017ca54c3Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
84117ca54c3Smrg	case ${UNAME_PROCESSOR} in
84217ca54c3Smrg	    amd64)
84317ca54c3Smrg		UNAME_PROCESSOR=x86_64 ;;
84417ca54c3Smrg	    i386)
84517ca54c3Smrg		UNAME_PROCESSOR=i586 ;;
84617ca54c3Smrg	esac
84717ca54c3Smrg	echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
84817ca54c3Smrg	exit ;;
84917ca54c3Smrg    i*:CYGWIN*:*)
85017ca54c3Smrg	echo ${UNAME_MACHINE}-pc-cygwin
85117ca54c3Smrg	exit ;;
85217ca54c3Smrg    *:MINGW64*:*)
85317ca54c3Smrg	echo ${UNAME_MACHINE}-pc-mingw64
85417ca54c3Smrg	exit ;;
85517ca54c3Smrg    *:MINGW*:*)
85617ca54c3Smrg	echo ${UNAME_MACHINE}-pc-mingw32
85717ca54c3Smrg	exit ;;
85817ca54c3Smrg    *:MSYS*:*)
85917ca54c3Smrg	echo ${UNAME_MACHINE}-pc-msys
86017ca54c3Smrg	exit ;;
86117ca54c3Smrg    i*:windows32*:*)
86217ca54c3Smrg	# uname -m includes "-pc" on this system.
86317ca54c3Smrg	echo ${UNAME_MACHINE}-mingw32
86417ca54c3Smrg	exit ;;
86517ca54c3Smrg    i*:PW*:*)
86617ca54c3Smrg	echo ${UNAME_MACHINE}-pc-pw32
86717ca54c3Smrg	exit ;;
86817ca54c3Smrg    *:Interix*:*)
86917ca54c3Smrg	case ${UNAME_MACHINE} in
87017ca54c3Smrg	    x86)
87117ca54c3Smrg		echo i586-pc-interix${UNAME_RELEASE}
87217ca54c3Smrg		exit ;;
87317ca54c3Smrg	    authenticamd | genuineintel | EM64T)
87417ca54c3Smrg		echo x86_64-unknown-interix${UNAME_RELEASE}
87517ca54c3Smrg		exit ;;
87617ca54c3Smrg	    IA64)
87717ca54c3Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
87817ca54c3Smrg		exit ;;
87917ca54c3Smrg	esac ;;
88017ca54c3Smrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
88117ca54c3Smrg	echo i${UNAME_MACHINE}-pc-mks
88217ca54c3Smrg	exit ;;
88317ca54c3Smrg    8664:Windows_NT:*)
88417ca54c3Smrg	echo x86_64-pc-mks
88517ca54c3Smrg	exit ;;
88617ca54c3Smrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
88717ca54c3Smrg	# How do we know it's Interix rather than the generic POSIX subsystem?
88817ca54c3Smrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
88917ca54c3Smrg	# UNAME_MACHINE based on the output of uname instead of i386?
89017ca54c3Smrg	echo i586-pc-interix
89117ca54c3Smrg	exit ;;
89217ca54c3Smrg    i*:UWIN*:*)
89317ca54c3Smrg	echo ${UNAME_MACHINE}-pc-uwin
89417ca54c3Smrg	exit ;;
89517ca54c3Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
89617ca54c3Smrg	echo x86_64-unknown-cygwin
89717ca54c3Smrg	exit ;;
89817ca54c3Smrg    p*:CYGWIN*:*)
89917ca54c3Smrg	echo powerpcle-unknown-cygwin
90017ca54c3Smrg	exit ;;
90117ca54c3Smrg    prep*:SunOS:5.*:*)
90217ca54c3Smrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
90317ca54c3Smrg	exit ;;
90417ca54c3Smrg    *:GNU:*:*)
90517ca54c3Smrg	# the GNU system
90617ca54c3Smrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
90717ca54c3Smrg	exit ;;
90817ca54c3Smrg    *:GNU/*:*:*)
90917ca54c3Smrg	# other systems with GNU libc and userland
91017ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
91117ca54c3Smrg	exit ;;
91217ca54c3Smrg    i*86:Minix:*:*)
91317ca54c3Smrg	echo ${UNAME_MACHINE}-pc-minix
91417ca54c3Smrg	exit ;;
91517ca54c3Smrg    aarch64:Linux:*:*)
91617ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
91717ca54c3Smrg	exit ;;
91817ca54c3Smrg    aarch64_be:Linux:*:*)
91917ca54c3Smrg	UNAME_MACHINE=aarch64_be
92017ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
92117ca54c3Smrg	exit ;;
92217ca54c3Smrg    alpha:Linux:*:*)
92317ca54c3Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
92417ca54c3Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
92517ca54c3Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
92617ca54c3Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
92717ca54c3Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
92817ca54c3Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
92917ca54c3Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
93017ca54c3Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
93117ca54c3Smrg	esac
93217ca54c3Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
93317ca54c3Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
93417ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
93517ca54c3Smrg	exit ;;
93617ca54c3Smrg    arc:Linux:*:* | arceb:Linux:*:*)
93717ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
93817ca54c3Smrg	exit ;;
93917ca54c3Smrg    arm*:Linux:*:*)
94017ca54c3Smrg	eval $set_cc_for_build
94117ca54c3Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
94217ca54c3Smrg	    | grep -q __ARM_EABI__
94317ca54c3Smrg	then
94417ca54c3Smrg	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
94517ca54c3Smrg	else
94617ca54c3Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
94717ca54c3Smrg		| grep -q __ARM_PCS_VFP
94817ca54c3Smrg	    then
94917ca54c3Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
95017ca54c3Smrg	    else
95117ca54c3Smrg		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
95217ca54c3Smrg	    fi
95317ca54c3Smrg	fi
95417ca54c3Smrg	exit ;;
95517ca54c3Smrg    avr32*:Linux:*:*)
95617ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
95717ca54c3Smrg	exit ;;
95817ca54c3Smrg    cris:Linux:*:*)
95917ca54c3Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
96017ca54c3Smrg	exit ;;
96117ca54c3Smrg    crisv32:Linux:*:*)
96217ca54c3Smrg	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
96317ca54c3Smrg	exit ;;
96417ca54c3Smrg    e2k:Linux:*:*)
96517ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
96617ca54c3Smrg	exit ;;
96717ca54c3Smrg    frv:Linux:*:*)
96817ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
96917ca54c3Smrg	exit ;;
97017ca54c3Smrg    hexagon:Linux:*:*)
97117ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
97217ca54c3Smrg	exit ;;
97317ca54c3Smrg    i*86:Linux:*:*)
97417ca54c3Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
97517ca54c3Smrg	exit ;;
97617ca54c3Smrg    ia64:Linux:*:*)
97717ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
97817ca54c3Smrg	exit ;;
97917ca54c3Smrg    k1om:Linux:*:*)
98017ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
98117ca54c3Smrg	exit ;;
98217ca54c3Smrg    m32r*:Linux:*:*)
98317ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
98417ca54c3Smrg	exit ;;
98517ca54c3Smrg    m68*:Linux:*:*)
98617ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
98717ca54c3Smrg	exit ;;
98817ca54c3Smrg    mips:Linux:*:* | mips64:Linux:*:*)
98917ca54c3Smrg	eval $set_cc_for_build
99017ca54c3Smrg	sed 's/^	//' << EOF >$dummy.c
99117ca54c3Smrg	#undef CPU
99217ca54c3Smrg	#undef ${UNAME_MACHINE}
99317ca54c3Smrg	#undef ${UNAME_MACHINE}el
99417ca54c3Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
99517ca54c3Smrg	CPU=${UNAME_MACHINE}el
99617ca54c3Smrg	#else
99717ca54c3Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
99817ca54c3Smrg	CPU=${UNAME_MACHINE}
99917ca54c3Smrg	#else
100017ca54c3Smrg	CPU=
100117ca54c3Smrg	#endif
100217ca54c3Smrg	#endif
100317ca54c3SmrgEOF
100417ca54c3Smrg	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
100517ca54c3Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
100617ca54c3Smrg	;;
100717ca54c3Smrg    mips64el:Linux:*:*)
100817ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
100917ca54c3Smrg	exit ;;
101017ca54c3Smrg    openrisc*:Linux:*:*)
101117ca54c3Smrg	echo or1k-unknown-linux-${LIBC}
101217ca54c3Smrg	exit ;;
101317ca54c3Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
101417ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
101517ca54c3Smrg	exit ;;
101617ca54c3Smrg    padre:Linux:*:*)
101717ca54c3Smrg	echo sparc-unknown-linux-${LIBC}
101817ca54c3Smrg	exit ;;
101917ca54c3Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
102017ca54c3Smrg	echo hppa64-unknown-linux-${LIBC}
102117ca54c3Smrg	exit ;;
102217ca54c3Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
102317ca54c3Smrg	# Look for CPU level
102417ca54c3Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
102517ca54c3Smrg	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
102617ca54c3Smrg	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
102717ca54c3Smrg	  *)    echo hppa-unknown-linux-${LIBC} ;;
102817ca54c3Smrg	esac
102917ca54c3Smrg	exit ;;
103017ca54c3Smrg    ppc64:Linux:*:*)
103117ca54c3Smrg	echo powerpc64-unknown-linux-${LIBC}
103217ca54c3Smrg	exit ;;
103317ca54c3Smrg    ppc:Linux:*:*)
103417ca54c3Smrg	echo powerpc-unknown-linux-${LIBC}
103517ca54c3Smrg	exit ;;
103617ca54c3Smrg    ppc64le:Linux:*:*)
103717ca54c3Smrg	echo powerpc64le-unknown-linux-${LIBC}
103817ca54c3Smrg	exit ;;
103917ca54c3Smrg    ppcle:Linux:*:*)
104017ca54c3Smrg	echo powerpcle-unknown-linux-${LIBC}
104117ca54c3Smrg	exit ;;
104217ca54c3Smrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
104317ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
104417ca54c3Smrg	exit ;;
104517ca54c3Smrg    s390:Linux:*:* | s390x:Linux:*:*)
104617ca54c3Smrg	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
104717ca54c3Smrg	exit ;;
104817ca54c3Smrg    sh64*:Linux:*:*)
104917ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
105017ca54c3Smrg	exit ;;
105117ca54c3Smrg    sh*:Linux:*:*)
105217ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
105317ca54c3Smrg	exit ;;
105417ca54c3Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
105517ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
105617ca54c3Smrg	exit ;;
105717ca54c3Smrg    tile*:Linux:*:*)
105817ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
105917ca54c3Smrg	exit ;;
106017ca54c3Smrg    vax:Linux:*:*)
106117ca54c3Smrg	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
106217ca54c3Smrg	exit ;;
106317ca54c3Smrg    x86_64:Linux:*:*)
106417ca54c3Smrg	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
106517ca54c3Smrg	exit ;;
106617ca54c3Smrg    xtensa*:Linux:*:*)
106717ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
106817ca54c3Smrg	exit ;;
106917ca54c3Smrg    i*86:DYNIX/ptx:4*:*)
107017ca54c3Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
107117ca54c3Smrg	# earlier versions are messed up and put the nodename in both
107217ca54c3Smrg	# sysname and nodename.
107317ca54c3Smrg	echo i386-sequent-sysv4
107417ca54c3Smrg	exit ;;
107517ca54c3Smrg    i*86:UNIX_SV:4.2MP:2.*)
107617ca54c3Smrg	# Unixware is an offshoot of SVR4, but it has its own version
107717ca54c3Smrg	# number series starting with 2...
107817ca54c3Smrg	# I am not positive that other SVR4 systems won't match this,
107917ca54c3Smrg	# I just have to hope.  -- rms.
108017ca54c3Smrg	# Use sysv4.2uw... so that sysv4* matches it.
108117ca54c3Smrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
108217ca54c3Smrg	exit ;;
108317ca54c3Smrg    i*86:OS/2:*:*)
108417ca54c3Smrg	# If we were able to find `uname', then EMX Unix compatibility
108517ca54c3Smrg	# is probably installed.
108617ca54c3Smrg	echo ${UNAME_MACHINE}-pc-os2-emx
108717ca54c3Smrg	exit ;;
108817ca54c3Smrg    i*86:XTS-300:*:STOP)
108917ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-stop
109017ca54c3Smrg	exit ;;
109117ca54c3Smrg    i*86:atheos:*:*)
109217ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-atheos
109317ca54c3Smrg	exit ;;
109417ca54c3Smrg    i*86:syllable:*:*)
109517ca54c3Smrg	echo ${UNAME_MACHINE}-pc-syllable
109617ca54c3Smrg	exit ;;
109717ca54c3Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
109817ca54c3Smrg	echo i386-unknown-lynxos${UNAME_RELEASE}
109917ca54c3Smrg	exit ;;
110017ca54c3Smrg    i*86:*DOS:*:*)
110117ca54c3Smrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
110217ca54c3Smrg	exit ;;
110317ca54c3Smrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
110417ca54c3Smrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
110517ca54c3Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
110617ca54c3Smrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
110717ca54c3Smrg	else
110817ca54c3Smrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
110917ca54c3Smrg	fi
111017ca54c3Smrg	exit ;;
111117ca54c3Smrg    i*86:*:5:[678]*)
111217ca54c3Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
111317ca54c3Smrg	case `/bin/uname -X | grep "^Machine"` in
111417ca54c3Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
111517ca54c3Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
111617ca54c3Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
111717ca54c3Smrg	esac
111817ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
111917ca54c3Smrg	exit ;;
112017ca54c3Smrg    i*86:*:3.2:*)
112117ca54c3Smrg	if test -f /usr/options/cb.name; then
112217ca54c3Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
112317ca54c3Smrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
112417ca54c3Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
112517ca54c3Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
112617ca54c3Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
112717ca54c3Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
112817ca54c3Smrg			&& UNAME_MACHINE=i586
112917ca54c3Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
113017ca54c3Smrg			&& UNAME_MACHINE=i686
113117ca54c3Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
113217ca54c3Smrg			&& UNAME_MACHINE=i686
113317ca54c3Smrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
113417ca54c3Smrg	else
113517ca54c3Smrg		echo ${UNAME_MACHINE}-pc-sysv32
113617ca54c3Smrg	fi
113717ca54c3Smrg	exit ;;
113817ca54c3Smrg    pc:*:*:*)
113917ca54c3Smrg	# Left here for compatibility:
114017ca54c3Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
114117ca54c3Smrg	# the processor, so we play safe by assuming i586.
114217ca54c3Smrg	# Note: whatever this is, it MUST be the same as what config.sub
114317ca54c3Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
114417ca54c3Smrg	# this is a cross-build.
114517ca54c3Smrg	echo i586-pc-msdosdjgpp
114617ca54c3Smrg	exit ;;
114717ca54c3Smrg    Intel:Mach:3*:*)
114817ca54c3Smrg	echo i386-pc-mach3
114917ca54c3Smrg	exit ;;
115017ca54c3Smrg    paragon:*:*:*)
115117ca54c3Smrg	echo i860-intel-osf1
115217ca54c3Smrg	exit ;;
115317ca54c3Smrg    i860:*:4.*:*) # i860-SVR4
115417ca54c3Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
115517ca54c3Smrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
115617ca54c3Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
115717ca54c3Smrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
115817ca54c3Smrg	fi
115917ca54c3Smrg	exit ;;
116017ca54c3Smrg    mini*:CTIX:SYS*5:*)
116117ca54c3Smrg	# "miniframe"
116217ca54c3Smrg	echo m68010-convergent-sysv
116317ca54c3Smrg	exit ;;
116417ca54c3Smrg    mc68k:UNIX:SYSTEM5:3.51m)
116517ca54c3Smrg	echo m68k-convergent-sysv
116617ca54c3Smrg	exit ;;
116717ca54c3Smrg    M680?0:D-NIX:5.3:*)
116817ca54c3Smrg	echo m68k-diab-dnix
116917ca54c3Smrg	exit ;;
117017ca54c3Smrg    M68*:*:R3V[5678]*:*)
117117ca54c3Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
117217ca54c3Smrg    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)
117317ca54c3Smrg	OS_REL=''
117417ca54c3Smrg	test -r /etc/.relid \
117517ca54c3Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
117617ca54c3Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
117717ca54c3Smrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
117817ca54c3Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
117917ca54c3Smrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
118017ca54c3Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
118117ca54c3Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
118217ca54c3Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
118317ca54c3Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
118417ca54c3Smrg	OS_REL='.3'
118517ca54c3Smrg	test -r /etc/.relid \
118617ca54c3Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
118717ca54c3Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
118817ca54c3Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
118917ca54c3Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
119017ca54c3Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
119117ca54c3Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
119217ca54c3Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
119317ca54c3Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
119417ca54c3Smrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
119517ca54c3Smrg	exit ;;
119617ca54c3Smrg    mc68030:UNIX_System_V:4.*:*)
119717ca54c3Smrg	echo m68k-atari-sysv4
119817ca54c3Smrg	exit ;;
119917ca54c3Smrg    TSUNAMI:LynxOS:2.*:*)
120017ca54c3Smrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
120117ca54c3Smrg	exit ;;
120217ca54c3Smrg    rs6000:LynxOS:2.*:*)
120317ca54c3Smrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
120417ca54c3Smrg	exit ;;
120517ca54c3Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
120617ca54c3Smrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
120717ca54c3Smrg	exit ;;
120817ca54c3Smrg    SM[BE]S:UNIX_SV:*:*)
120917ca54c3Smrg	echo mips-dde-sysv${UNAME_RELEASE}
121017ca54c3Smrg	exit ;;
121117ca54c3Smrg    RM*:ReliantUNIX-*:*:*)
121217ca54c3Smrg	echo mips-sni-sysv4
121317ca54c3Smrg	exit ;;
121417ca54c3Smrg    RM*:SINIX-*:*:*)
121517ca54c3Smrg	echo mips-sni-sysv4
121617ca54c3Smrg	exit ;;
121717ca54c3Smrg    *:SINIX-*:*:*)
121817ca54c3Smrg	if uname -p 2>/dev/null >/dev/null ; then
121917ca54c3Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
122017ca54c3Smrg		echo ${UNAME_MACHINE}-sni-sysv4
122117ca54c3Smrg	else
122217ca54c3Smrg		echo ns32k-sni-sysv
122317ca54c3Smrg	fi
122417ca54c3Smrg	exit ;;
122517ca54c3Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
122617ca54c3Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
122717ca54c3Smrg	echo i586-unisys-sysv4
122817ca54c3Smrg	exit ;;
122917ca54c3Smrg    *:UNIX_System_V:4*:FTX*)
123017ca54c3Smrg	# From Gerald Hewes <hewes@openmarket.com>.
123117ca54c3Smrg	# How about differentiating between stratus architectures? -djm
123217ca54c3Smrg	echo hppa1.1-stratus-sysv4
123317ca54c3Smrg	exit ;;
123417ca54c3Smrg    *:*:*:FTX*)
123517ca54c3Smrg	# From seanf@swdc.stratus.com.
123617ca54c3Smrg	echo i860-stratus-sysv4
123717ca54c3Smrg	exit ;;
123817ca54c3Smrg    i*86:VOS:*:*)
123917ca54c3Smrg	# From Paul.Green@stratus.com.
124017ca54c3Smrg	echo ${UNAME_MACHINE}-stratus-vos
124117ca54c3Smrg	exit ;;
124217ca54c3Smrg    *:VOS:*:*)
124317ca54c3Smrg	# From Paul.Green@stratus.com.
124417ca54c3Smrg	echo hppa1.1-stratus-vos
124517ca54c3Smrg	exit ;;
124617ca54c3Smrg    mc68*:A/UX:*:*)
124717ca54c3Smrg	echo m68k-apple-aux${UNAME_RELEASE}
124817ca54c3Smrg	exit ;;
124917ca54c3Smrg    news*:NEWS-OS:6*:*)
125017ca54c3Smrg	echo mips-sony-newsos6
125117ca54c3Smrg	exit ;;
125217ca54c3Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
125317ca54c3Smrg	if [ -d /usr/nec ]; then
125417ca54c3Smrg		echo mips-nec-sysv${UNAME_RELEASE}
125517ca54c3Smrg	else
125617ca54c3Smrg		echo mips-unknown-sysv${UNAME_RELEASE}
125717ca54c3Smrg	fi
125817ca54c3Smrg	exit ;;
125917ca54c3Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
126017ca54c3Smrg	echo powerpc-be-beos
126117ca54c3Smrg	exit ;;
126217ca54c3Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
126317ca54c3Smrg	echo powerpc-apple-beos
126417ca54c3Smrg	exit ;;
126517ca54c3Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
126617ca54c3Smrg	echo i586-pc-beos
126717ca54c3Smrg	exit ;;
126817ca54c3Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
126917ca54c3Smrg	echo i586-pc-haiku
127017ca54c3Smrg	exit ;;
127117ca54c3Smrg    x86_64:Haiku:*:*)
127217ca54c3Smrg	echo x86_64-unknown-haiku
127317ca54c3Smrg	exit ;;
127417ca54c3Smrg    SX-4:SUPER-UX:*:*)
127517ca54c3Smrg	echo sx4-nec-superux${UNAME_RELEASE}
127617ca54c3Smrg	exit ;;
127717ca54c3Smrg    SX-5:SUPER-UX:*:*)
127817ca54c3Smrg	echo sx5-nec-superux${UNAME_RELEASE}
127917ca54c3Smrg	exit ;;
128017ca54c3Smrg    SX-6:SUPER-UX:*:*)
128117ca54c3Smrg	echo sx6-nec-superux${UNAME_RELEASE}
128217ca54c3Smrg	exit ;;
128317ca54c3Smrg    SX-7:SUPER-UX:*:*)
128417ca54c3Smrg	echo sx7-nec-superux${UNAME_RELEASE}
128517ca54c3Smrg	exit ;;
128617ca54c3Smrg    SX-8:SUPER-UX:*:*)
128717ca54c3Smrg	echo sx8-nec-superux${UNAME_RELEASE}
128817ca54c3Smrg	exit ;;
128917ca54c3Smrg    SX-8R:SUPER-UX:*:*)
129017ca54c3Smrg	echo sx8r-nec-superux${UNAME_RELEASE}
129117ca54c3Smrg	exit ;;
129217ca54c3Smrg    SX-ACE:SUPER-UX:*:*)
129317ca54c3Smrg	echo sxace-nec-superux${UNAME_RELEASE}
129417ca54c3Smrg	exit ;;
129517ca54c3Smrg    Power*:Rhapsody:*:*)
129617ca54c3Smrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
129717ca54c3Smrg	exit ;;
129817ca54c3Smrg    *:Rhapsody:*:*)
129917ca54c3Smrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
130017ca54c3Smrg	exit ;;
130117ca54c3Smrg    *:Darwin:*:*)
130217ca54c3Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
130317ca54c3Smrg	eval $set_cc_for_build
130417ca54c3Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
130517ca54c3Smrg	    UNAME_PROCESSOR=powerpc
130617ca54c3Smrg	fi
130717ca54c3Smrg	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
130817ca54c3Smrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
130917ca54c3Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
131017ca54c3Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
131117ca54c3Smrg		       grep IS_64BIT_ARCH >/dev/null
131217ca54c3Smrg		then
131317ca54c3Smrg		    case $UNAME_PROCESSOR in
131417ca54c3Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
131517ca54c3Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
131617ca54c3Smrg		    esac
131717ca54c3Smrg		fi
131817ca54c3Smrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
131917ca54c3Smrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
132017ca54c3Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
132117ca54c3Smrg		       grep IS_PPC >/dev/null
132217ca54c3Smrg		then
132317ca54c3Smrg		    UNAME_PROCESSOR=powerpc
132417ca54c3Smrg		fi
132517ca54c3Smrg	    fi
132617ca54c3Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
132717ca54c3Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
132817ca54c3Smrg	    # that puts up a graphical alert prompting to install
132917ca54c3Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
133017ca54c3Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
133117ca54c3Smrg	    # processor. This is not true of the ARM version of Darwin
133217ca54c3Smrg	    # that Apple uses in portable devices.
133317ca54c3Smrg	    UNAME_PROCESSOR=x86_64
133417ca54c3Smrg	fi
133517ca54c3Smrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
133617ca54c3Smrg	exit ;;
133717ca54c3Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
133817ca54c3Smrg	UNAME_PROCESSOR=`uname -p`
133917ca54c3Smrg	if test "$UNAME_PROCESSOR" = x86; then
134017ca54c3Smrg		UNAME_PROCESSOR=i386
134117ca54c3Smrg		UNAME_MACHINE=pc
134217ca54c3Smrg	fi
134317ca54c3Smrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
134417ca54c3Smrg	exit ;;
134517ca54c3Smrg    *:QNX:*:4*)
134617ca54c3Smrg	echo i386-pc-qnx
134717ca54c3Smrg	exit ;;
134817ca54c3Smrg    NEO-*:NONSTOP_KERNEL:*:*)
134917ca54c3Smrg	echo neo-tandem-nsk${UNAME_RELEASE}
135017ca54c3Smrg	exit ;;
135117ca54c3Smrg    NSE-*:NONSTOP_KERNEL:*:*)
135217ca54c3Smrg	echo nse-tandem-nsk${UNAME_RELEASE}
135317ca54c3Smrg	exit ;;
135417ca54c3Smrg    NSR-*:NONSTOP_KERNEL:*:*)
135517ca54c3Smrg	echo nsr-tandem-nsk${UNAME_RELEASE}
135617ca54c3Smrg	exit ;;
135717ca54c3Smrg    NSX-*:NONSTOP_KERNEL:*:*)
135817ca54c3Smrg	echo nsx-tandem-nsk${UNAME_RELEASE}
135917ca54c3Smrg	exit ;;
136017ca54c3Smrg    *:NonStop-UX:*:*)
136117ca54c3Smrg	echo mips-compaq-nonstopux
136217ca54c3Smrg	exit ;;
136317ca54c3Smrg    BS2000:POSIX*:*:*)
136417ca54c3Smrg	echo bs2000-siemens-sysv
136517ca54c3Smrg	exit ;;
136617ca54c3Smrg    DS/*:UNIX_System_V:*:*)
136717ca54c3Smrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
136817ca54c3Smrg	exit ;;
136917ca54c3Smrg    *:Plan9:*:*)
137017ca54c3Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
137117ca54c3Smrg	# is converted to i386 for consistency with other x86
137217ca54c3Smrg	# operating systems.
137317ca54c3Smrg	if test "$cputype" = 386; then
137417ca54c3Smrg	    UNAME_MACHINE=i386
137517ca54c3Smrg	else
137617ca54c3Smrg	    UNAME_MACHINE="$cputype"
137717ca54c3Smrg	fi
137817ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-plan9
137917ca54c3Smrg	exit ;;
138017ca54c3Smrg    *:TOPS-10:*:*)
138117ca54c3Smrg	echo pdp10-unknown-tops10
138217ca54c3Smrg	exit ;;
138317ca54c3Smrg    *:TENEX:*:*)
138417ca54c3Smrg	echo pdp10-unknown-tenex
138517ca54c3Smrg	exit ;;
138617ca54c3Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
138717ca54c3Smrg	echo pdp10-dec-tops20
138817ca54c3Smrg	exit ;;
138917ca54c3Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
139017ca54c3Smrg	echo pdp10-xkl-tops20
139117ca54c3Smrg	exit ;;
139217ca54c3Smrg    *:TOPS-20:*:*)
139317ca54c3Smrg	echo pdp10-unknown-tops20
139417ca54c3Smrg	exit ;;
139517ca54c3Smrg    *:ITS:*:*)
139617ca54c3Smrg	echo pdp10-unknown-its
139717ca54c3Smrg	exit ;;
139817ca54c3Smrg    SEI:*:*:SEIUX)
139917ca54c3Smrg	echo mips-sei-seiux${UNAME_RELEASE}
140017ca54c3Smrg	exit ;;
140117ca54c3Smrg    *:DragonFly:*:*)
140217ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
140317ca54c3Smrg	exit ;;
140417ca54c3Smrg    *:*VMS:*:*)
140517ca54c3Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
140617ca54c3Smrg	case "${UNAME_MACHINE}" in
140717ca54c3Smrg	    A*) echo alpha-dec-vms ; exit ;;
140817ca54c3Smrg	    I*) echo ia64-dec-vms ; exit ;;
140917ca54c3Smrg	    V*) echo vax-dec-vms ; exit ;;
141017ca54c3Smrg	esac ;;
141117ca54c3Smrg    *:XENIX:*:SysV)
141217ca54c3Smrg	echo i386-pc-xenix
141317ca54c3Smrg	exit ;;
141417ca54c3Smrg    i*86:skyos:*:*)
141517ca54c3Smrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
141617ca54c3Smrg	exit ;;
141717ca54c3Smrg    i*86:rdos:*:*)
141817ca54c3Smrg	echo ${UNAME_MACHINE}-pc-rdos
141917ca54c3Smrg	exit ;;
142017ca54c3Smrg    i*86:AROS:*:*)
142117ca54c3Smrg	echo ${UNAME_MACHINE}-pc-aros
142217ca54c3Smrg	exit ;;
142317ca54c3Smrg    x86_64:VMkernel:*:*)
142417ca54c3Smrg	echo ${UNAME_MACHINE}-unknown-esx
142517ca54c3Smrg	exit ;;
142617ca54c3Smrg    amd64:Isilon\ OneFS:*:*)
142717ca54c3Smrg	echo x86_64-unknown-onefs
142817ca54c3Smrg	exit ;;
142917ca54c3Smrgesac
143017ca54c3Smrg
143117ca54c3Smrgcat >&2 <<EOF
143217ca54c3Smrg$0: unable to guess system type
143317ca54c3Smrg
143417ca54c3SmrgThis script (version $timestamp), has failed to recognize the
143517ca54c3Smrgoperating system you are using. If your script is old, overwrite *all*
143617ca54c3Smrgcopies of config.guess and config.sub with the latest versions from:
143717ca54c3Smrg
143817ca54c3Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
143917ca54c3Smrgand
144017ca54c3Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
144117ca54c3Smrg
144217ca54c3SmrgIf $0 has already been updated, send the following data and any
144317ca54c3Smrginformation you think might be pertinent to config-patches@gnu.org to
144417ca54c3Smrgprovide the necessary information to handle your system.
144517ca54c3Smrg
144617ca54c3Smrgconfig.guess timestamp = $timestamp
144717ca54c3Smrg
144817ca54c3Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
144917ca54c3Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
145017ca54c3Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
145117ca54c3Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
145217ca54c3Smrg
145317ca54c3Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
145417ca54c3Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
145517ca54c3Smrg
145617ca54c3Smrghostinfo               = `(hostinfo) 2>/dev/null`
145717ca54c3Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
145817ca54c3Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
145917ca54c3Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
146017ca54c3Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
146117ca54c3Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
146217ca54c3Smrg
146317ca54c3SmrgUNAME_MACHINE = ${UNAME_MACHINE}
146417ca54c3SmrgUNAME_RELEASE = ${UNAME_RELEASE}
146517ca54c3SmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
146617ca54c3SmrgUNAME_VERSION = ${UNAME_VERSION}
146717ca54c3SmrgEOF
146817ca54c3Smrg
146917ca54c3Smrgexit 1
147017ca54c3Smrg
147117ca54c3Smrg# Local variables:
147217ca54c3Smrg# eval: (add-hook 'write-file-hooks 'time-stamp)
147317ca54c3Smrg# time-stamp-start: "timestamp='"
147417ca54c3Smrg# time-stamp-format: "%:y-%02m-%02d"
147517ca54c3Smrg# time-stamp-end: "'"
147617ca54c3Smrg# End:
1477