172b676d7Smrg#! /bin/sh
272b676d7Smrg# Attempt to guess a canonical system name.
374fcc364Smrg#   Copyright 1992-2018 Free Software Foundation, Inc.
472b676d7Smrg
574fcc364Smrgtimestamp='2018-02-24'
672b676d7Smrg
772b676d7Smrg# This file is free software; you can redistribute it and/or modify it
872b676d7Smrg# under the terms of the GNU General Public License as published by
993d9adc1Smrg# the Free Software Foundation; either version 3 of the License, or
1072b676d7Smrg# (at your option) any later version.
1172b676d7Smrg#
1272b676d7Smrg# This program is distributed in the hope that it will be useful, but
1372b676d7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
1472b676d7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1572b676d7Smrg# General Public License for more details.
1672b676d7Smrg#
1772b676d7Smrg# You should have received a copy of the GNU General Public License
1874fcc364Smrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
1972b676d7Smrg#
2072b676d7Smrg# As a special exception to the GNU General Public License, if you
2172b676d7Smrg# distribute this file as part of a program that contains a
2272b676d7Smrg# configuration script generated by Autoconf, you may include it under
2393d9adc1Smrg# the same distribution terms that you use for the rest of that
2493d9adc1Smrg# program.  This Exception is an additional permission under section 7
2593d9adc1Smrg# of the GNU General Public License, version 3 ("GPLv3").
2672b676d7Smrg#
2793d9adc1Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
2872b676d7Smrg#
2974c14cd6Smrg# You can get the latest version of this script from:
3074fcc364Smrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
3193d9adc1Smrg#
3293d9adc1Smrg# Please send patches to <config-patches@gnu.org>.
3393d9adc1Smrg
3472b676d7Smrg
3572b676d7Smrgme=`echo "$0" | sed -e 's,.*/,,'`
3672b676d7Smrg
3772b676d7Smrgusage="\
3872b676d7SmrgUsage: $0 [OPTION]
3972b676d7Smrg
4072b676d7SmrgOutput the configuration name of the system \`$me' is run on.
4172b676d7Smrg
4274fcc364SmrgOptions:
4372b676d7Smrg  -h, --help         print this help, then exit
4472b676d7Smrg  -t, --time-stamp   print date of last modification, then exit
4572b676d7Smrg  -v, --version      print version number, then exit
4672b676d7Smrg
4772b676d7SmrgReport bugs and patches to <config-patches@gnu.org>."
4872b676d7Smrg
4972b676d7Smrgversion="\
5072b676d7SmrgGNU config.guess ($timestamp)
5172b676d7Smrg
5272b676d7SmrgOriginally written by Per Bothner.
5374fcc364SmrgCopyright 1992-2018 Free Software Foundation, Inc.
5472b676d7Smrg
5572b676d7SmrgThis is free software; see the source for copying conditions.  There is NO
5672b676d7Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
5772b676d7Smrg
5872b676d7Smrghelp="
5972b676d7SmrgTry \`$me --help' for more information."
6072b676d7Smrg
6172b676d7Smrg# Parse command line
6272b676d7Smrgwhile test $# -gt 0 ; do
6372b676d7Smrg  case $1 in
6472b676d7Smrg    --time-stamp | --time* | -t )
6572b676d7Smrg       echo "$timestamp" ; exit ;;
6672b676d7Smrg    --version | -v )
6772b676d7Smrg       echo "$version" ; exit ;;
6872b676d7Smrg    --help | --h* | -h )
6972b676d7Smrg       echo "$usage"; exit ;;
7072b676d7Smrg    -- )     # Stop option processing
7172b676d7Smrg       shift; break ;;
7272b676d7Smrg    - )	# Use stdin as input.
7372b676d7Smrg       break ;;
7472b676d7Smrg    -* )
7572b676d7Smrg       echo "$me: invalid option $1$help" >&2
7672b676d7Smrg       exit 1 ;;
7772b676d7Smrg    * )
7872b676d7Smrg       break ;;
7972b676d7Smrg  esac
8072b676d7Smrgdone
8172b676d7Smrg
8272b676d7Smrgif test $# != 0; then
8372b676d7Smrg  echo "$me: too many arguments$help" >&2
8472b676d7Smrg  exit 1
8572b676d7Smrgfi
8672b676d7Smrg
8772b676d7Smrgtrap 'exit 1' 1 2 15
8872b676d7Smrg
8972b676d7Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9072b676d7Smrg# compiler to aid in system detection is discouraged as it requires
9172b676d7Smrg# temporary files to be created and, as you can see below, it is a
9272b676d7Smrg# headache to deal with in a portable fashion.
9372b676d7Smrg
9472b676d7Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
9572b676d7Smrg# use `HOST_CC' if defined, but it is deprecated.
9672b676d7Smrg
9772b676d7Smrg# Portable tmp directory creation inspired by the Autoconf team.
9872b676d7Smrg
9972b676d7Smrgset_cc_for_build='
10072b676d7Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10172b676d7Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10272b676d7Smrg: ${TMPDIR=/tmp} ;
10372b676d7Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
10472b676d7Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
10572b676d7Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
10672b676d7Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
10772b676d7Smrgdummy=$tmp/dummy ;
10872b676d7Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
10972b676d7Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
11074fcc364Smrg ,,)    echo "int x;" > "$dummy.c" ;
11172b676d7Smrg	for c in cc gcc c89 c99 ; do
11274fcc364Smrg	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
11372b676d7Smrg	     CC_FOR_BUILD="$c"; break ;
11472b676d7Smrg	  fi ;
11572b676d7Smrg	done ;
11672b676d7Smrg	if test x"$CC_FOR_BUILD" = x ; then
11772b676d7Smrg	  CC_FOR_BUILD=no_compiler_found ;
11872b676d7Smrg	fi
11972b676d7Smrg	;;
12072b676d7Smrg ,,*)   CC_FOR_BUILD=$CC ;;
12172b676d7Smrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12272b676d7Smrgesac ; set_cc_for_build= ;'
12372b676d7Smrg
12472b676d7Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
12572b676d7Smrg# (ghazi@noc.rutgers.edu 1994-08-24)
12672b676d7Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
12772b676d7Smrg	PATH=$PATH:/.attbin ; export PATH
12872b676d7Smrgfi
12972b676d7Smrg
13072b676d7SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13172b676d7SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13272b676d7SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
13372b676d7SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
13472b676d7Smrg
13574fcc364Smrgcase "$UNAME_SYSTEM" in
13693d9adc1SmrgLinux|GNU|GNU/*)
13793d9adc1Smrg	# If the system lacks a compiler, then just pick glibc.
13893d9adc1Smrg	# We could probably try harder.
13993d9adc1Smrg	LIBC=gnu
14093d9adc1Smrg
14174fcc364Smrg	eval "$set_cc_for_build"
14274fcc364Smrg	cat <<-EOF > "$dummy.c"
14321525869Smrg	#include <features.h>
14493d9adc1Smrg	#if defined(__UCLIBC__)
14521525869Smrg	LIBC=uclibc
14693d9adc1Smrg	#elif defined(__dietlibc__)
14721525869Smrg	LIBC=dietlibc
14893d9adc1Smrg	#else
14921525869Smrg	LIBC=gnu
15021525869Smrg	#endif
15121525869Smrg	EOF
15274fcc364Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
15374fcc364Smrg
15474fcc364Smrg	# If ldd exists, use it to detect musl libc.
15574fcc364Smrg	if command -v ldd >/dev/null && \
15674fcc364Smrg		ldd --version 2>&1 | grep -q ^musl
15774fcc364Smrg	then
15874fcc364Smrg	    LIBC=musl
15974fcc364Smrg	fi
16021525869Smrg	;;
16121525869Smrgesac
16221525869Smrg
16372b676d7Smrg# Note: order is significant - the case branches are not exclusive.
16472b676d7Smrg
16574fcc364Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
16672b676d7Smrg    *:NetBSD:*:*)
16772b676d7Smrg	# NetBSD (nbsd) targets should (where applicable) match one or
16893d9adc1Smrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
16972b676d7Smrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
17072b676d7Smrg	# switched to ELF, *-*-netbsd* would select the old
17172b676d7Smrg	# object file format.  This provides both forward
17272b676d7Smrg	# compatibility and a consistent mechanism for selecting the
17372b676d7Smrg	# object file format.
17472b676d7Smrg	#
17572b676d7Smrg	# Note: NetBSD doesn't particularly care about the vendor
17672b676d7Smrg	# portion of the name.  We always set it to "unknown".
17772b676d7Smrg	sysctl="sysctl -n hw.machine_arch"
17893d9adc1Smrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
17974fcc364Smrg	    "/sbin/$sysctl" 2>/dev/null || \
18074fcc364Smrg	    "/usr/sbin/$sysctl" 2>/dev/null || \
18193d9adc1Smrg	    echo unknown)`
18274fcc364Smrg	case "$UNAME_MACHINE_ARCH" in
18372b676d7Smrg	    armeb) machine=armeb-unknown ;;
18472b676d7Smrg	    arm*) machine=arm-unknown ;;
18572b676d7Smrg	    sh3el) machine=shl-unknown ;;
18672b676d7Smrg	    sh3eb) machine=sh-unknown ;;
1871fd23544Smrg	    sh5el) machine=sh5le-unknown ;;
18893d9adc1Smrg	    earmv*)
18974fcc364Smrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
19074fcc364Smrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
19174fcc364Smrg		machine="${arch}${endian}"-unknown
19293d9adc1Smrg		;;
19374fcc364Smrg	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
19472b676d7Smrg	esac
19572b676d7Smrg	# The Operating System including object format, if it has switched
19674fcc364Smrg	# to ELF recently (or will in the future) and ABI.
19774fcc364Smrg	case "$UNAME_MACHINE_ARCH" in
19874fcc364Smrg	    earm*)
19974fcc364Smrg		os=netbsdelf
20074fcc364Smrg		;;
20174fcc364Smrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
20274fcc364Smrg		eval "$set_cc_for_build"
20372b676d7Smrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
20474c14cd6Smrg			| grep -q __ELF__
20572b676d7Smrg		then
20672b676d7Smrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
20772b676d7Smrg		    # Return netbsd for either.  FIX?
20872b676d7Smrg		    os=netbsd
20972b676d7Smrg		else
21072b676d7Smrg		    os=netbsdelf
21172b676d7Smrg		fi
21272b676d7Smrg		;;
21372b676d7Smrg	    *)
21474c14cd6Smrg		os=netbsd
21572b676d7Smrg		;;
21672b676d7Smrg	esac
21793d9adc1Smrg	# Determine ABI tags.
21874fcc364Smrg	case "$UNAME_MACHINE_ARCH" in
21993d9adc1Smrg	    earm*)
22093d9adc1Smrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
22174fcc364Smrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
22293d9adc1Smrg		;;
22393d9adc1Smrg	esac
22472b676d7Smrg	# The OS release
22572b676d7Smrg	# Debian GNU/NetBSD machines have a different userland, and
22672b676d7Smrg	# thus, need a distinct triplet. However, they do not need
22772b676d7Smrg	# kernel version information, so it can be replaced with a
22872b676d7Smrg	# suitable tag, in the style of linux-gnu.
22974fcc364Smrg	case "$UNAME_VERSION" in
23072b676d7Smrg	    Debian*)
23172b676d7Smrg		release='-gnu'
23272b676d7Smrg		;;
23372b676d7Smrg	    *)
23474fcc364Smrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
23572b676d7Smrg		;;
23672b676d7Smrg	esac
23772b676d7Smrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
23872b676d7Smrg	# contains redundant information, the shorter form:
23972b676d7Smrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
24074fcc364Smrg	echo "$machine-${os}${release}${abi}"
24193d9adc1Smrg	exit ;;
24293d9adc1Smrg    *:Bitrig:*:*)
24393d9adc1Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
24474fcc364Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
24572b676d7Smrg	exit ;;
24672b676d7Smrg    *:OpenBSD:*:*)
24772b676d7Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
24874fcc364Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
24972b676d7Smrg	exit ;;
25093d9adc1Smrg    *:LibertyBSD:*:*)
25193d9adc1Smrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
25274fcc364Smrg	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
25374fcc364Smrg	exit ;;
25474fcc364Smrg    *:MidnightBSD:*:*)
25574fcc364Smrg	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
25693d9adc1Smrg	exit ;;
25772b676d7Smrg    *:ekkoBSD:*:*)
25874fcc364Smrg	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
25972b676d7Smrg	exit ;;
26072b676d7Smrg    *:SolidBSD:*:*)
26174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
26272b676d7Smrg	exit ;;
26372b676d7Smrg    macppc:MirBSD:*:*)
26474fcc364Smrg	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
26572b676d7Smrg	exit ;;
26672b676d7Smrg    *:MirBSD:*:*)
26774fcc364Smrg	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
26872b676d7Smrg	exit ;;
26993d9adc1Smrg    *:Sortix:*:*)
27074fcc364Smrg	echo "$UNAME_MACHINE"-unknown-sortix
27193d9adc1Smrg	exit ;;
27274fcc364Smrg    *:Redox:*:*)
27374fcc364Smrg	echo "$UNAME_MACHINE"-unknown-redox
27474fcc364Smrg	exit ;;
27574fcc364Smrg    mips:OSF1:*.*)
27674fcc364Smrg        echo mips-dec-osf1
27774fcc364Smrg        exit ;;
27872b676d7Smrg    alpha:OSF1:*:*)
27972b676d7Smrg	case $UNAME_RELEASE in
28072b676d7Smrg	*4.0)
28172b676d7Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
28272b676d7Smrg		;;
28372b676d7Smrg	*5.*)
28474c14cd6Smrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
28572b676d7Smrg		;;
28672b676d7Smrg	esac
28772b676d7Smrg	# According to Compaq, /usr/sbin/psrinfo has been available on
28872b676d7Smrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
28972b676d7Smrg	# covers most systems running today.  This code pipes the CPU
29072b676d7Smrg	# types through head -n 1, so we only detect the type of CPU 0.
29172b676d7Smrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
29272b676d7Smrg	case "$ALPHA_CPU_TYPE" in
29372b676d7Smrg	    "EV4 (21064)")
29493d9adc1Smrg		UNAME_MACHINE=alpha ;;
29572b676d7Smrg	    "EV4.5 (21064)")
29693d9adc1Smrg		UNAME_MACHINE=alpha ;;
29772b676d7Smrg	    "LCA4 (21066/21068)")
29893d9adc1Smrg		UNAME_MACHINE=alpha ;;
29972b676d7Smrg	    "EV5 (21164)")
30093d9adc1Smrg		UNAME_MACHINE=alphaev5 ;;
30172b676d7Smrg	    "EV5.6 (21164A)")
30293d9adc1Smrg		UNAME_MACHINE=alphaev56 ;;
30372b676d7Smrg	    "EV5.6 (21164PC)")
30493d9adc1Smrg		UNAME_MACHINE=alphapca56 ;;
30572b676d7Smrg	    "EV5.7 (21164PC)")
30693d9adc1Smrg		UNAME_MACHINE=alphapca57 ;;
30772b676d7Smrg	    "EV6 (21264)")
30893d9adc1Smrg		UNAME_MACHINE=alphaev6 ;;
30972b676d7Smrg	    "EV6.7 (21264A)")
31093d9adc1Smrg		UNAME_MACHINE=alphaev67 ;;
31172b676d7Smrg	    "EV6.8CB (21264C)")
31293d9adc1Smrg		UNAME_MACHINE=alphaev68 ;;
31372b676d7Smrg	    "EV6.8AL (21264B)")
31493d9adc1Smrg		UNAME_MACHINE=alphaev68 ;;
31572b676d7Smrg	    "EV6.8CX (21264D)")
31693d9adc1Smrg		UNAME_MACHINE=alphaev68 ;;
31772b676d7Smrg	    "EV6.9A (21264/EV69A)")
31893d9adc1Smrg		UNAME_MACHINE=alphaev69 ;;
31972b676d7Smrg	    "EV7 (21364)")
32093d9adc1Smrg		UNAME_MACHINE=alphaev7 ;;
32172b676d7Smrg	    "EV7.9 (21364A)")
32293d9adc1Smrg		UNAME_MACHINE=alphaev79 ;;
32372b676d7Smrg	esac
32472b676d7Smrg	# A Pn.n version is a patched version.
32572b676d7Smrg	# A Vn.n version is a released version.
32672b676d7Smrg	# A Tn.n version is a released field test version.
32772b676d7Smrg	# A Xn.n version is an unreleased experimental baselevel.
32872b676d7Smrg	# 1.2 uses "1.2" for uname -r.
32974fcc364Smrg	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
33074c14cd6Smrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
33174c14cd6Smrg	exitcode=$?
33274c14cd6Smrg	trap '' 0
33374c14cd6Smrg	exit $exitcode ;;
33472b676d7Smrg    Amiga*:UNIX_System_V:4.0:*)
33572b676d7Smrg	echo m68k-unknown-sysv4
33672b676d7Smrg	exit ;;
33772b676d7Smrg    *:[Aa]miga[Oo][Ss]:*:*)
33874fcc364Smrg	echo "$UNAME_MACHINE"-unknown-amigaos
33972b676d7Smrg	exit ;;
34072b676d7Smrg    *:[Mm]orph[Oo][Ss]:*:*)
34174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-morphos
34272b676d7Smrg	exit ;;
34372b676d7Smrg    *:OS/390:*:*)
34472b676d7Smrg	echo i370-ibm-openedition
34572b676d7Smrg	exit ;;
34672b676d7Smrg    *:z/VM:*:*)
34772b676d7Smrg	echo s390-ibm-zvmoe
34872b676d7Smrg	exit ;;
34972b676d7Smrg    *:OS400:*:*)
35074c14cd6Smrg	echo powerpc-ibm-os400
35172b676d7Smrg	exit ;;
35272b676d7Smrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
35374fcc364Smrg	echo arm-acorn-riscix"$UNAME_RELEASE"
35472b676d7Smrg	exit ;;
35593d9adc1Smrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
35672b676d7Smrg	echo arm-unknown-riscos
35772b676d7Smrg	exit ;;
35872b676d7Smrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
35972b676d7Smrg	echo hppa1.1-hitachi-hiuxmpp
36072b676d7Smrg	exit ;;
36172b676d7Smrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
36272b676d7Smrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
36372b676d7Smrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
36472b676d7Smrg		echo pyramid-pyramid-sysv3
36572b676d7Smrg	else
36672b676d7Smrg		echo pyramid-pyramid-bsd
36772b676d7Smrg	fi
36872b676d7Smrg	exit ;;
36972b676d7Smrg    NILE*:*:*:dcosx)
37072b676d7Smrg	echo pyramid-pyramid-svr4
37172b676d7Smrg	exit ;;
37272b676d7Smrg    DRS?6000:unix:4.0:6*)
37372b676d7Smrg	echo sparc-icl-nx6
37472b676d7Smrg	exit ;;
37572b676d7Smrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
37672b676d7Smrg	case `/usr/bin/uname -p` in
37772b676d7Smrg	    sparc) echo sparc-icl-nx7; exit ;;
37872b676d7Smrg	esac ;;
37974c14cd6Smrg    s390x:SunOS:*:*)
38074fcc364Smrg	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
38174c14cd6Smrg	exit ;;
38272b676d7Smrg    sun4H:SunOS:5.*:*)
38374fcc364Smrg	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
38472b676d7Smrg	exit ;;
38572b676d7Smrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
38674fcc364Smrg	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
38772b676d7Smrg	exit ;;
38874c14cd6Smrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
38974fcc364Smrg	echo i386-pc-auroraux"$UNAME_RELEASE"
39074c14cd6Smrg	exit ;;
3911fd23544Smrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
39274fcc364Smrg	eval "$set_cc_for_build"
39393d9adc1Smrg	SUN_ARCH=i386
39474c14cd6Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
39574c14cd6Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
39674c14cd6Smrg	# This test works for both compilers.
39793d9adc1Smrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
39874c14cd6Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
39993d9adc1Smrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
40074c14cd6Smrg		grep IS_64BIT_ARCH >/dev/null
40174c14cd6Smrg	    then
40293d9adc1Smrg		SUN_ARCH=x86_64
40374c14cd6Smrg	    fi
40474c14cd6Smrg	fi
40574fcc364Smrg	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
40672b676d7Smrg	exit ;;
40772b676d7Smrg    sun4*:SunOS:6*:*)
40872b676d7Smrg	# According to config.sub, this is the proper way to canonicalize
40972b676d7Smrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
41072b676d7Smrg	# it's likely to be more like Solaris than SunOS4.
41174fcc364Smrg	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
41272b676d7Smrg	exit ;;
41372b676d7Smrg    sun4*:SunOS:*:*)
41472b676d7Smrg	case "`/usr/bin/arch -k`" in
41572b676d7Smrg	    Series*|S4*)
41672b676d7Smrg		UNAME_RELEASE=`uname -v`
41772b676d7Smrg		;;
41872b676d7Smrg	esac
41972b676d7Smrg	# Japanese Language versions have a version number like `4.1.3-JL'.
42074fcc364Smrg	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
42172b676d7Smrg	exit ;;
42272b676d7Smrg    sun3*:SunOS:*:*)
42374fcc364Smrg	echo m68k-sun-sunos"$UNAME_RELEASE"
42472b676d7Smrg	exit ;;
42572b676d7Smrg    sun*:*:4.2BSD:*)
42672b676d7Smrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
42774fcc364Smrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
42872b676d7Smrg	case "`/bin/arch`" in
42972b676d7Smrg	    sun3)
43074fcc364Smrg		echo m68k-sun-sunos"$UNAME_RELEASE"
43172b676d7Smrg		;;
43272b676d7Smrg	    sun4)
43374fcc364Smrg		echo sparc-sun-sunos"$UNAME_RELEASE"
43472b676d7Smrg		;;
43572b676d7Smrg	esac
43672b676d7Smrg	exit ;;
43772b676d7Smrg    aushp:SunOS:*:*)
43874fcc364Smrg	echo sparc-auspex-sunos"$UNAME_RELEASE"
43972b676d7Smrg	exit ;;
44072b676d7Smrg    # The situation for MiNT is a little confusing.  The machine name
44172b676d7Smrg    # can be virtually everything (everything which is not
44272b676d7Smrg    # "atarist" or "atariste" at least should have a processor
44372b676d7Smrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
44472b676d7Smrg    # to the lowercase version "mint" (or "freemint").  Finally
44572b676d7Smrg    # the system name "TOS" denotes a system which is actually not
44672b676d7Smrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
44772b676d7Smrg    # be no problem.
44872b676d7Smrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
44974fcc364Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45072b676d7Smrg	exit ;;
45172b676d7Smrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
45274fcc364Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45374c14cd6Smrg	exit ;;
45472b676d7Smrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
45574fcc364Smrg	echo m68k-atari-mint"$UNAME_RELEASE"
45672b676d7Smrg	exit ;;
45772b676d7Smrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
45874fcc364Smrg	echo m68k-milan-mint"$UNAME_RELEASE"
45974c14cd6Smrg	exit ;;
46072b676d7Smrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
46174fcc364Smrg	echo m68k-hades-mint"$UNAME_RELEASE"
46274c14cd6Smrg	exit ;;
46372b676d7Smrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
46474fcc364Smrg	echo m68k-unknown-mint"$UNAME_RELEASE"
46574c14cd6Smrg	exit ;;
46672b676d7Smrg    m68k:machten:*:*)
46774fcc364Smrg	echo m68k-apple-machten"$UNAME_RELEASE"
46872b676d7Smrg	exit ;;
46972b676d7Smrg    powerpc:machten:*:*)
47074fcc364Smrg	echo powerpc-apple-machten"$UNAME_RELEASE"
47172b676d7Smrg	exit ;;
47272b676d7Smrg    RISC*:Mach:*:*)
47372b676d7Smrg	echo mips-dec-mach_bsd4.3
47472b676d7Smrg	exit ;;
47572b676d7Smrg    RISC*:ULTRIX:*:*)
47674fcc364Smrg	echo mips-dec-ultrix"$UNAME_RELEASE"
47772b676d7Smrg	exit ;;
47872b676d7Smrg    VAX*:ULTRIX*:*:*)
47974fcc364Smrg	echo vax-dec-ultrix"$UNAME_RELEASE"
48072b676d7Smrg	exit ;;
48172b676d7Smrg    2020:CLIX:*:* | 2430:CLIX:*:*)
48274fcc364Smrg	echo clipper-intergraph-clix"$UNAME_RELEASE"
48372b676d7Smrg	exit ;;
48472b676d7Smrg    mips:*:*:UMIPS | mips:*:*:RISCos)
48574fcc364Smrg	eval "$set_cc_for_build"
48674fcc364Smrg	sed 's/^	//' << EOF > "$dummy.c"
48772b676d7Smrg#ifdef __cplusplus
48872b676d7Smrg#include <stdio.h>  /* for printf() prototype */
48972b676d7Smrg	int main (int argc, char *argv[]) {
49072b676d7Smrg#else
49172b676d7Smrg	int main (argc, argv) int argc; char *argv[]; {
49272b676d7Smrg#endif
49372b676d7Smrg	#if defined (host_mips) && defined (MIPSEB)
49472b676d7Smrg	#if defined (SYSTYPE_SYSV)
49574fcc364Smrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
49672b676d7Smrg	#endif
49772b676d7Smrg	#if defined (SYSTYPE_SVR4)
49874fcc364Smrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
49972b676d7Smrg	#endif
50072b676d7Smrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
50174fcc364Smrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
50272b676d7Smrg	#endif
50372b676d7Smrg	#endif
50472b676d7Smrg	  exit (-1);
50572b676d7Smrg	}
50672b676d7SmrgEOF
50774fcc364Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
50874fcc364Smrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
50974fcc364Smrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
51072b676d7Smrg	    { echo "$SYSTEM_NAME"; exit; }
51174fcc364Smrg	echo mips-mips-riscos"$UNAME_RELEASE"
51272b676d7Smrg	exit ;;
51372b676d7Smrg    Motorola:PowerMAX_OS:*:*)
51472b676d7Smrg	echo powerpc-motorola-powermax
51572b676d7Smrg	exit ;;
51672b676d7Smrg    Motorola:*:4.3:PL8-*)
51772b676d7Smrg	echo powerpc-harris-powermax
51872b676d7Smrg	exit ;;
51972b676d7Smrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
52072b676d7Smrg	echo powerpc-harris-powermax
52172b676d7Smrg	exit ;;
52272b676d7Smrg    Night_Hawk:Power_UNIX:*:*)
52372b676d7Smrg	echo powerpc-harris-powerunix
52472b676d7Smrg	exit ;;
52572b676d7Smrg    m88k:CX/UX:7*:*)
52672b676d7Smrg	echo m88k-harris-cxux7
52772b676d7Smrg	exit ;;
52872b676d7Smrg    m88k:*:4*:R4*)
52972b676d7Smrg	echo m88k-motorola-sysv4
53072b676d7Smrg	exit ;;
53172b676d7Smrg    m88k:*:3*:R3*)
53272b676d7Smrg	echo m88k-motorola-sysv3
53372b676d7Smrg	exit ;;
53472b676d7Smrg    AViiON:dgux:*:*)
53574c14cd6Smrg	# DG/UX returns AViiON for all architectures
53674c14cd6Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
53774fcc364Smrg	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
53872b676d7Smrg	then
53974fcc364Smrg	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
54074fcc364Smrg	       [ "$TARGET_BINARY_INTERFACE"x = x ]
54172b676d7Smrg	    then
54274fcc364Smrg		echo m88k-dg-dgux"$UNAME_RELEASE"
54372b676d7Smrg	    else
54474fcc364Smrg		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
54572b676d7Smrg	    fi
54672b676d7Smrg	else
54774fcc364Smrg	    echo i586-dg-dgux"$UNAME_RELEASE"
54872b676d7Smrg	fi
54974c14cd6Smrg	exit ;;
55072b676d7Smrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
55172b676d7Smrg	echo m88k-dolphin-sysv3
55272b676d7Smrg	exit ;;
55372b676d7Smrg    M88*:*:R3*:*)
55472b676d7Smrg	# Delta 88k system running SVR3
55572b676d7Smrg	echo m88k-motorola-sysv3
55672b676d7Smrg	exit ;;
55772b676d7Smrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
55872b676d7Smrg	echo m88k-tektronix-sysv3
55972b676d7Smrg	exit ;;
56072b676d7Smrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
56172b676d7Smrg	echo m68k-tektronix-bsd
56272b676d7Smrg	exit ;;
56372b676d7Smrg    *:IRIX*:*:*)
56474fcc364Smrg	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
56572b676d7Smrg	exit ;;
56672b676d7Smrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
56772b676d7Smrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
56872b676d7Smrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
56972b676d7Smrg    i*86:AIX:*:*)
57072b676d7Smrg	echo i386-ibm-aix
57172b676d7Smrg	exit ;;
57272b676d7Smrg    ia64:AIX:*:*)
57372b676d7Smrg	if [ -x /usr/bin/oslevel ] ; then
57472b676d7Smrg		IBM_REV=`/usr/bin/oslevel`
57572b676d7Smrg	else
57674fcc364Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
57772b676d7Smrg	fi
57874fcc364Smrg	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
57972b676d7Smrg	exit ;;
58072b676d7Smrg    *:AIX:2:3)
58172b676d7Smrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
58274fcc364Smrg		eval "$set_cc_for_build"
58374fcc364Smrg		sed 's/^		//' << EOF > "$dummy.c"
58472b676d7Smrg		#include <sys/systemcfg.h>
58572b676d7Smrg
58672b676d7Smrg		main()
58772b676d7Smrg			{
58872b676d7Smrg			if (!__power_pc())
58972b676d7Smrg				exit(1);
59072b676d7Smrg			puts("powerpc-ibm-aix3.2.5");
59172b676d7Smrg			exit(0);
59272b676d7Smrg			}
59372b676d7SmrgEOF
59474fcc364Smrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
59572b676d7Smrg		then
59672b676d7Smrg			echo "$SYSTEM_NAME"
59772b676d7Smrg		else
59872b676d7Smrg			echo rs6000-ibm-aix3.2.5
59972b676d7Smrg		fi
60072b676d7Smrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
60172b676d7Smrg		echo rs6000-ibm-aix3.2.4
60272b676d7Smrg	else
60372b676d7Smrg		echo rs6000-ibm-aix3.2
60472b676d7Smrg	fi
60572b676d7Smrg	exit ;;
60674c14cd6Smrg    *:AIX:*:[4567])
60772b676d7Smrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
60874fcc364Smrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
60972b676d7Smrg		IBM_ARCH=rs6000
61072b676d7Smrg	else
61172b676d7Smrg		IBM_ARCH=powerpc
61272b676d7Smrg	fi
61393d9adc1Smrg	if [ -x /usr/bin/lslpp ] ; then
61493d9adc1Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
61593d9adc1Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
61672b676d7Smrg	else
61774fcc364Smrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
61872b676d7Smrg	fi
61974fcc364Smrg	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
62072b676d7Smrg	exit ;;
62172b676d7Smrg    *:AIX:*:*)
62272b676d7Smrg	echo rs6000-ibm-aix
62372b676d7Smrg	exit ;;
62474fcc364Smrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
62572b676d7Smrg	echo romp-ibm-bsd4.4
62672b676d7Smrg	exit ;;
62772b676d7Smrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
62874fcc364Smrg	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
62972b676d7Smrg	exit ;;                             # report: romp-ibm BSD 4.3
63072b676d7Smrg    *:BOSX:*:*)
63172b676d7Smrg	echo rs6000-bull-bosx
63272b676d7Smrg	exit ;;
63372b676d7Smrg    DPX/2?00:B.O.S.:*:*)
63472b676d7Smrg	echo m68k-bull-sysv3
63572b676d7Smrg	exit ;;
63672b676d7Smrg    9000/[34]??:4.3bsd:1.*:*)
63772b676d7Smrg	echo m68k-hp-bsd
63872b676d7Smrg	exit ;;
63972b676d7Smrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
64072b676d7Smrg	echo m68k-hp-bsd4.4
64172b676d7Smrg	exit ;;
64272b676d7Smrg    9000/[34678]??:HP-UX:*:*)
64374fcc364Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
64474fcc364Smrg	case "$UNAME_MACHINE" in
64574fcc364Smrg	    9000/31?)            HP_ARCH=m68000 ;;
64674fcc364Smrg	    9000/[34]??)         HP_ARCH=m68k ;;
64772b676d7Smrg	    9000/[678][0-9][0-9])
64872b676d7Smrg		if [ -x /usr/bin/getconf ]; then
64972b676d7Smrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
65074c14cd6Smrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
65174fcc364Smrg		    case "$sc_cpu_version" in
65293d9adc1Smrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
65393d9adc1Smrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
65474c14cd6Smrg		      532)                      # CPU_PA_RISC2_0
65574fcc364Smrg			case "$sc_kernel_bits" in
65693d9adc1Smrg			  32) HP_ARCH=hppa2.0n ;;
65793d9adc1Smrg			  64) HP_ARCH=hppa2.0w ;;
65893d9adc1Smrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
65974c14cd6Smrg			esac ;;
66074c14cd6Smrg		    esac
66172b676d7Smrg		fi
66274fcc364Smrg		if [ "$HP_ARCH" = "" ]; then
66374fcc364Smrg		    eval "$set_cc_for_build"
66474fcc364Smrg		    sed 's/^		//' << EOF > "$dummy.c"
66572b676d7Smrg
66674c14cd6Smrg		#define _HPUX_SOURCE
66774c14cd6Smrg		#include <stdlib.h>
66874c14cd6Smrg		#include <unistd.h>
66972b676d7Smrg
67074c14cd6Smrg		int main ()
67174c14cd6Smrg		{
67274c14cd6Smrg		#if defined(_SC_KERNEL_BITS)
67374c14cd6Smrg		    long bits = sysconf(_SC_KERNEL_BITS);
67474c14cd6Smrg		#endif
67574c14cd6Smrg		    long cpu  = sysconf (_SC_CPU_VERSION);
67672b676d7Smrg
67774c14cd6Smrg		    switch (cpu)
67874c14cd6Smrg			{
67974c14cd6Smrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
68074c14cd6Smrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
68174c14cd6Smrg			case CPU_PA_RISC2_0:
68274c14cd6Smrg		#if defined(_SC_KERNEL_BITS)
68374c14cd6Smrg			    switch (bits)
68474c14cd6Smrg				{
68574c14cd6Smrg				case 64: puts ("hppa2.0w"); break;
68674c14cd6Smrg				case 32: puts ("hppa2.0n"); break;
68774c14cd6Smrg				default: puts ("hppa2.0"); break;
68874c14cd6Smrg				} break;
68974c14cd6Smrg		#else  /* !defined(_SC_KERNEL_BITS) */
69074c14cd6Smrg			    puts ("hppa2.0"); break;
69174c14cd6Smrg		#endif
69274c14cd6Smrg			default: puts ("hppa1.0"); break;
69374c14cd6Smrg			}
69474c14cd6Smrg		    exit (0);
69574c14cd6Smrg		}
69672b676d7SmrgEOF
69774fcc364Smrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
69872b676d7Smrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
69972b676d7Smrg		fi ;;
70072b676d7Smrg	esac
70174fcc364Smrg	if [ "$HP_ARCH" = hppa2.0w ]
70272b676d7Smrg	then
70374fcc364Smrg	    eval "$set_cc_for_build"
70472b676d7Smrg
70572b676d7Smrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
70672b676d7Smrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
70772b676d7Smrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
70872b676d7Smrg	    #
70972b676d7Smrg	    # $ CC_FOR_BUILD=cc ./config.guess
71072b676d7Smrg	    # => hppa2.0w-hp-hpux11.23
71172b676d7Smrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
71272b676d7Smrg	    # => hppa64-hp-hpux11.23
71372b676d7Smrg
71493d9adc1Smrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
71574c14cd6Smrg		grep -q __LP64__
71672b676d7Smrg	    then
71793d9adc1Smrg		HP_ARCH=hppa2.0w
71872b676d7Smrg	    else
71993d9adc1Smrg		HP_ARCH=hppa64
72072b676d7Smrg	    fi
72172b676d7Smrg	fi
72274fcc364Smrg	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
72372b676d7Smrg	exit ;;
72472b676d7Smrg    ia64:HP-UX:*:*)
72574fcc364Smrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
72674fcc364Smrg	echo ia64-hp-hpux"$HPUX_REV"
72772b676d7Smrg	exit ;;
72872b676d7Smrg    3050*:HI-UX:*:*)
72974fcc364Smrg	eval "$set_cc_for_build"
73074fcc364Smrg	sed 's/^	//' << EOF > "$dummy.c"
73172b676d7Smrg	#include <unistd.h>
73272b676d7Smrg	int
73372b676d7Smrg	main ()
73472b676d7Smrg	{
73572b676d7Smrg	  long cpu = sysconf (_SC_CPU_VERSION);
73672b676d7Smrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
73772b676d7Smrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
73872b676d7Smrg	     results, however.  */
73972b676d7Smrg	  if (CPU_IS_PA_RISC (cpu))
74072b676d7Smrg	    {
74172b676d7Smrg	      switch (cpu)
74272b676d7Smrg		{
74372b676d7Smrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
74472b676d7Smrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
74572b676d7Smrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
74672b676d7Smrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
74772b676d7Smrg		}
74872b676d7Smrg	    }
74972b676d7Smrg	  else if (CPU_IS_HP_MC68K (cpu))
75072b676d7Smrg	    puts ("m68k-hitachi-hiuxwe2");
75172b676d7Smrg	  else puts ("unknown-hitachi-hiuxwe2");
75272b676d7Smrg	  exit (0);
75372b676d7Smrg	}
75472b676d7SmrgEOF
75574fcc364Smrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
75672b676d7Smrg		{ echo "$SYSTEM_NAME"; exit; }
75772b676d7Smrg	echo unknown-hitachi-hiuxwe2
75872b676d7Smrg	exit ;;
75974fcc364Smrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
76072b676d7Smrg	echo hppa1.1-hp-bsd
76172b676d7Smrg	exit ;;
76272b676d7Smrg    9000/8??:4.3bsd:*:*)
76372b676d7Smrg	echo hppa1.0-hp-bsd
76472b676d7Smrg	exit ;;
76572b676d7Smrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
76672b676d7Smrg	echo hppa1.0-hp-mpeix
76772b676d7Smrg	exit ;;
76874fcc364Smrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
76972b676d7Smrg	echo hppa1.1-hp-osf
77072b676d7Smrg	exit ;;
77172b676d7Smrg    hp8??:OSF1:*:*)
77272b676d7Smrg	echo hppa1.0-hp-osf
77372b676d7Smrg	exit ;;
77472b676d7Smrg    i*86:OSF1:*:*)
77572b676d7Smrg	if [ -x /usr/sbin/sysversion ] ; then
77674fcc364Smrg	    echo "$UNAME_MACHINE"-unknown-osf1mk
77772b676d7Smrg	else
77874fcc364Smrg	    echo "$UNAME_MACHINE"-unknown-osf1
77972b676d7Smrg	fi
78072b676d7Smrg	exit ;;
78172b676d7Smrg    parisc*:Lites*:*:*)
78272b676d7Smrg	echo hppa1.1-hp-lites
78372b676d7Smrg	exit ;;
78472b676d7Smrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
78572b676d7Smrg	echo c1-convex-bsd
78674c14cd6Smrg	exit ;;
78772b676d7Smrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
78872b676d7Smrg	if getsysinfo -f scalar_acc
78972b676d7Smrg	then echo c32-convex-bsd
79072b676d7Smrg	else echo c2-convex-bsd
79172b676d7Smrg	fi
79274c14cd6Smrg	exit ;;
79372b676d7Smrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
79472b676d7Smrg	echo c34-convex-bsd
79574c14cd6Smrg	exit ;;
79672b676d7Smrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
79772b676d7Smrg	echo c38-convex-bsd
79874c14cd6Smrg	exit ;;
79972b676d7Smrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
80072b676d7Smrg	echo c4-convex-bsd
80174c14cd6Smrg	exit ;;
80272b676d7Smrg    CRAY*Y-MP:*:*:*)
80374fcc364Smrg	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
80472b676d7Smrg	exit ;;
80572b676d7Smrg    CRAY*[A-Z]90:*:*:*)
80674fcc364Smrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
80772b676d7Smrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
80872b676d7Smrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
80972b676d7Smrg	      -e 's/\.[^.]*$/.X/'
81072b676d7Smrg	exit ;;
81172b676d7Smrg    CRAY*TS:*:*:*)
81274fcc364Smrg	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
81372b676d7Smrg	exit ;;
81472b676d7Smrg    CRAY*T3E:*:*:*)
81574fcc364Smrg	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
81672b676d7Smrg	exit ;;
81772b676d7Smrg    CRAY*SV1:*:*:*)
81874fcc364Smrg	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
81972b676d7Smrg	exit ;;
82072b676d7Smrg    *:UNICOS/mp:*:*)
82174fcc364Smrg	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
82272b676d7Smrg	exit ;;
82372b676d7Smrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
82493d9adc1Smrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
82593d9adc1Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
82674fcc364Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
82774c14cd6Smrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
82874c14cd6Smrg	exit ;;
82972b676d7Smrg    5000:UNIX_System_V:4.*:*)
83093d9adc1Smrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
83174fcc364Smrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
83274c14cd6Smrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
83372b676d7Smrg	exit ;;
83472b676d7Smrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
83574fcc364Smrg	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
83672b676d7Smrg	exit ;;
83772b676d7Smrg    sparc*:BSD/OS:*:*)
83874fcc364Smrg	echo sparc-unknown-bsdi"$UNAME_RELEASE"
83972b676d7Smrg	exit ;;
84072b676d7Smrg    *:BSD/OS:*:*)
84174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
84272b676d7Smrg	exit ;;
84372b676d7Smrg    *:FreeBSD:*:*)
84493d9adc1Smrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
84574fcc364Smrg	case "$UNAME_PROCESSOR" in
8461fd23544Smrg	    amd64)
84774fcc364Smrg		UNAME_PROCESSOR=x86_64 ;;
84874fcc364Smrg	    i386)
84974fcc364Smrg		UNAME_PROCESSOR=i586 ;;
85072b676d7Smrg	esac
85174fcc364Smrg	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
85272b676d7Smrg	exit ;;
85372b676d7Smrg    i*:CYGWIN*:*)
85474fcc364Smrg	echo "$UNAME_MACHINE"-pc-cygwin
85572b676d7Smrg	exit ;;
85693d9adc1Smrg    *:MINGW64*:*)
85774fcc364Smrg	echo "$UNAME_MACHINE"-pc-mingw64
85893d9adc1Smrg	exit ;;
8591fd23544Smrg    *:MINGW*:*)
86074fcc364Smrg	echo "$UNAME_MACHINE"-pc-mingw32
86172b676d7Smrg	exit ;;
86293d9adc1Smrg    *:MSYS*:*)
86374fcc364Smrg	echo "$UNAME_MACHINE"-pc-msys
86472b676d7Smrg	exit ;;
86572b676d7Smrg    i*:PW*:*)
86674fcc364Smrg	echo "$UNAME_MACHINE"-pc-pw32
86772b676d7Smrg	exit ;;
86874c14cd6Smrg    *:Interix*:*)
86974fcc364Smrg	case "$UNAME_MACHINE" in
8701fd23544Smrg	    x86)
87174fcc364Smrg		echo i586-pc-interix"$UNAME_RELEASE"
8721fd23544Smrg		exit ;;
87374c14cd6Smrg	    authenticamd | genuineintel | EM64T)
87474fcc364Smrg		echo x86_64-unknown-interix"$UNAME_RELEASE"
8751fd23544Smrg		exit ;;
8761fd23544Smrg	    IA64)
87774fcc364Smrg		echo ia64-unknown-interix"$UNAME_RELEASE"
8781fd23544Smrg		exit ;;
8791fd23544Smrg	esac ;;
88072b676d7Smrg    i*:UWIN*:*)
88174fcc364Smrg	echo "$UNAME_MACHINE"-pc-uwin
88272b676d7Smrg	exit ;;
88372b676d7Smrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
88472b676d7Smrg	echo x86_64-unknown-cygwin
88572b676d7Smrg	exit ;;
88672b676d7Smrg    prep*:SunOS:5.*:*)
88774fcc364Smrg	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
88872b676d7Smrg	exit ;;
88972b676d7Smrg    *:GNU:*:*)
89072b676d7Smrg	# the GNU system
89174fcc364Smrg	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
89272b676d7Smrg	exit ;;
89372b676d7Smrg    *:GNU/*:*:*)
89472b676d7Smrg	# other systems with GNU libc and userland
89574fcc364Smrg	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
89672b676d7Smrg	exit ;;
89772b676d7Smrg    i*86:Minix:*:*)
89874fcc364Smrg	echo "$UNAME_MACHINE"-pc-minix
89972b676d7Smrg	exit ;;
90093d9adc1Smrg    aarch64:Linux:*:*)
90174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90293d9adc1Smrg	exit ;;
90393d9adc1Smrg    aarch64_be:Linux:*:*)
90493d9adc1Smrg	UNAME_MACHINE=aarch64_be
90574fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
90693d9adc1Smrg	exit ;;
90774c14cd6Smrg    alpha:Linux:*:*)
90874c14cd6Smrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
90974c14cd6Smrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
91074c14cd6Smrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
91174c14cd6Smrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
91274c14cd6Smrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
91374c14cd6Smrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
91474c14cd6Smrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
91574c14cd6Smrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
91674c14cd6Smrg	esac
91774c14cd6Smrg	objdump --private-headers /bin/sh | grep -q ld.so.1
91893d9adc1Smrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
91974fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
92093d9adc1Smrg	exit ;;
92193d9adc1Smrg    arc:Linux:*:* | arceb:Linux:*:*)
92274fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
92374c14cd6Smrg	exit ;;
92472b676d7Smrg    arm*:Linux:*:*)
92574fcc364Smrg	eval "$set_cc_for_build"
9261fd23544Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
9271fd23544Smrg	    | grep -q __ARM_EABI__
9281fd23544Smrg	then
92974fcc364Smrg	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9301fd23544Smrg	else
93193d9adc1Smrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
93293d9adc1Smrg		| grep -q __ARM_PCS_VFP
93393d9adc1Smrg	    then
93474fcc364Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
93593d9adc1Smrg	    else
93674fcc364Smrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
93793d9adc1Smrg	    fi
9381fd23544Smrg	fi
9391fd23544Smrg	exit ;;
9401fd23544Smrg    avr32*:Linux:*:*)
94174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
94272b676d7Smrg	exit ;;
94372b676d7Smrg    cris:Linux:*:*)
94474fcc364Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
94572b676d7Smrg	exit ;;
94672b676d7Smrg    crisv32:Linux:*:*)
94774fcc364Smrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
94893d9adc1Smrg	exit ;;
94993d9adc1Smrg    e2k:Linux:*:*)
95074fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95172b676d7Smrg	exit ;;
95272b676d7Smrg    frv:Linux:*:*)
95374fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95493d9adc1Smrg	exit ;;
95593d9adc1Smrg    hexagon:Linux:*:*)
95674fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
95774c14cd6Smrg	exit ;;
95874c14cd6Smrg    i*86:Linux:*:*)
95974fcc364Smrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
96072b676d7Smrg	exit ;;
96172b676d7Smrg    ia64:Linux:*:*)
96274fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
96372b676d7Smrg	exit ;;
96493d9adc1Smrg    k1om:Linux:*:*)
96574fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
96693d9adc1Smrg	exit ;;
96772b676d7Smrg    m32r*:Linux:*:*)
96874fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
96972b676d7Smrg	exit ;;
97072b676d7Smrg    m68*:Linux:*:*)
97174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
97272b676d7Smrg	exit ;;
97374c14cd6Smrg    mips:Linux:*:* | mips64:Linux:*:*)
97474fcc364Smrg	eval "$set_cc_for_build"
97574fcc364Smrg	sed 's/^	//' << EOF > "$dummy.c"
97672b676d7Smrg	#undef CPU
97774c14cd6Smrg	#undef ${UNAME_MACHINE}
97874c14cd6Smrg	#undef ${UNAME_MACHINE}el
97972b676d7Smrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
98074c14cd6Smrg	CPU=${UNAME_MACHINE}el
98172b676d7Smrg	#else
98272b676d7Smrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
98374c14cd6Smrg	CPU=${UNAME_MACHINE}
98472b676d7Smrg	#else
98572b676d7Smrg	CPU=
98672b676d7Smrg	#endif
98772b676d7Smrg	#endif
98872b676d7SmrgEOF
98974fcc364Smrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
99074fcc364Smrg	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
99172b676d7Smrg	;;
99274fcc364Smrg    mips64el:Linux:*:*)
99374fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
99474fcc364Smrg	exit ;;
99593d9adc1Smrg    openrisc*:Linux:*:*)
99674fcc364Smrg	echo or1k-unknown-linux-"$LIBC"
99793d9adc1Smrg	exit ;;
99893d9adc1Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
99974fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
100072b676d7Smrg	exit ;;
100174c14cd6Smrg    padre:Linux:*:*)
100274fcc364Smrg	echo sparc-unknown-linux-"$LIBC"
100372b676d7Smrg	exit ;;
100474c14cd6Smrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
100574fcc364Smrg	echo hppa64-unknown-linux-"$LIBC"
100672b676d7Smrg	exit ;;
100772b676d7Smrg    parisc:Linux:*:* | hppa:Linux:*:*)
100872b676d7Smrg	# Look for CPU level
100972b676d7Smrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
101074fcc364Smrg	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
101174fcc364Smrg	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
101274fcc364Smrg	  *)    echo hppa-unknown-linux-"$LIBC" ;;
101372b676d7Smrg	esac
101472b676d7Smrg	exit ;;
101574c14cd6Smrg    ppc64:Linux:*:*)
101674fcc364Smrg	echo powerpc64-unknown-linux-"$LIBC"
101774c14cd6Smrg	exit ;;
101874c14cd6Smrg    ppc:Linux:*:*)
101974fcc364Smrg	echo powerpc-unknown-linux-"$LIBC"
102072b676d7Smrg	exit ;;
102193d9adc1Smrg    ppc64le:Linux:*:*)
102274fcc364Smrg	echo powerpc64le-unknown-linux-"$LIBC"
102393d9adc1Smrg	exit ;;
102493d9adc1Smrg    ppcle:Linux:*:*)
102574fcc364Smrg	echo powerpcle-unknown-linux-"$LIBC"
102674fcc364Smrg	exit ;;
102774fcc364Smrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
102874fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
102993d9adc1Smrg	exit ;;
103072b676d7Smrg    s390:Linux:*:* | s390x:Linux:*:*)
103174fcc364Smrg	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
103272b676d7Smrg	exit ;;
103372b676d7Smrg    sh64*:Linux:*:*)
103474fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
103572b676d7Smrg	exit ;;
103672b676d7Smrg    sh*:Linux:*:*)
103774fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
103872b676d7Smrg	exit ;;
103972b676d7Smrg    sparc:Linux:*:* | sparc64:Linux:*:*)
104074fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
104172b676d7Smrg	exit ;;
104274c14cd6Smrg    tile*:Linux:*:*)
104374fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
104474c14cd6Smrg	exit ;;
104572b676d7Smrg    vax:Linux:*:*)
104674fcc364Smrg	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
104772b676d7Smrg	exit ;;
104872b676d7Smrg    x86_64:Linux:*:*)
104974fcc364Smrg	if objdump -f /bin/sh | grep -q elf32-x86-64; then
105074fcc364Smrg	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
105174fcc364Smrg	else
105274fcc364Smrg	    echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
105393d9adc1Smrg	fi
105472b676d7Smrg	exit ;;
10551fd23544Smrg    xtensa*:Linux:*:*)
105674fcc364Smrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10571fd23544Smrg	exit ;;
105872b676d7Smrg    i*86:DYNIX/ptx:4*:*)
105972b676d7Smrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
106072b676d7Smrg	# earlier versions are messed up and put the nodename in both
106172b676d7Smrg	# sysname and nodename.
106272b676d7Smrg	echo i386-sequent-sysv4
106372b676d7Smrg	exit ;;
106472b676d7Smrg    i*86:UNIX_SV:4.2MP:2.*)
106574c14cd6Smrg	# Unixware is an offshoot of SVR4, but it has its own version
106674c14cd6Smrg	# number series starting with 2...
106774c14cd6Smrg	# I am not positive that other SVR4 systems won't match this,
106872b676d7Smrg	# I just have to hope.  -- rms.
106974c14cd6Smrg	# Use sysv4.2uw... so that sysv4* matches it.
107074fcc364Smrg	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
107172b676d7Smrg	exit ;;
107272b676d7Smrg    i*86:OS/2:*:*)
107372b676d7Smrg	# If we were able to find `uname', then EMX Unix compatibility
107472b676d7Smrg	# is probably installed.
107574fcc364Smrg	echo "$UNAME_MACHINE"-pc-os2-emx
107672b676d7Smrg	exit ;;
107772b676d7Smrg    i*86:XTS-300:*:STOP)
107874fcc364Smrg	echo "$UNAME_MACHINE"-unknown-stop
107972b676d7Smrg	exit ;;
108072b676d7Smrg    i*86:atheos:*:*)
108174fcc364Smrg	echo "$UNAME_MACHINE"-unknown-atheos
108272b676d7Smrg	exit ;;
108372b676d7Smrg    i*86:syllable:*:*)
108474fcc364Smrg	echo "$UNAME_MACHINE"-pc-syllable
108572b676d7Smrg	exit ;;
108674c14cd6Smrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
108774fcc364Smrg	echo i386-unknown-lynxos"$UNAME_RELEASE"
108872b676d7Smrg	exit ;;
108972b676d7Smrg    i*86:*DOS:*:*)
109074fcc364Smrg	echo "$UNAME_MACHINE"-pc-msdosdjgpp
109172b676d7Smrg	exit ;;
109274fcc364Smrg    i*86:*:4.*:*)
109374fcc364Smrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
109472b676d7Smrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
109574fcc364Smrg		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
109672b676d7Smrg	else
109774fcc364Smrg		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
109872b676d7Smrg	fi
109972b676d7Smrg	exit ;;
110072b676d7Smrg    i*86:*:5:[678]*)
110174c14cd6Smrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
110272b676d7Smrg	case `/bin/uname -X | grep "^Machine"` in
110372b676d7Smrg	    *486*)	     UNAME_MACHINE=i486 ;;
110472b676d7Smrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
110572b676d7Smrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
110672b676d7Smrg	esac
110774fcc364Smrg	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
110872b676d7Smrg	exit ;;
110972b676d7Smrg    i*86:*:3.2:*)
111072b676d7Smrg	if test -f /usr/options/cb.name; then
111172b676d7Smrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
111274fcc364Smrg		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
111372b676d7Smrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
111472b676d7Smrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
111572b676d7Smrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
111672b676d7Smrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
111772b676d7Smrg			&& UNAME_MACHINE=i586
111872b676d7Smrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
111972b676d7Smrg			&& UNAME_MACHINE=i686
112072b676d7Smrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
112172b676d7Smrg			&& UNAME_MACHINE=i686
112274fcc364Smrg		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
112372b676d7Smrg	else
112474fcc364Smrg		echo "$UNAME_MACHINE"-pc-sysv32
112572b676d7Smrg	fi
112672b676d7Smrg	exit ;;
112772b676d7Smrg    pc:*:*:*)
112872b676d7Smrg	# Left here for compatibility:
112974c14cd6Smrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
113074c14cd6Smrg	# the processor, so we play safe by assuming i586.
113174c14cd6Smrg	# Note: whatever this is, it MUST be the same as what config.sub
113293d9adc1Smrg	# prints for the "djgpp" host, or else GDB configure will decide that
113374c14cd6Smrg	# this is a cross-build.
113474c14cd6Smrg	echo i586-pc-msdosdjgpp
113574c14cd6Smrg	exit ;;
113672b676d7Smrg    Intel:Mach:3*:*)
113772b676d7Smrg	echo i386-pc-mach3
113872b676d7Smrg	exit ;;
113972b676d7Smrg    paragon:*:*:*)
114072b676d7Smrg	echo i860-intel-osf1
114172b676d7Smrg	exit ;;
114272b676d7Smrg    i860:*:4.*:*) # i860-SVR4
114372b676d7Smrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
114474fcc364Smrg	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
114572b676d7Smrg	else # Add other i860-SVR4 vendors below as they are discovered.
114674fcc364Smrg	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
114772b676d7Smrg	fi
114872b676d7Smrg	exit ;;
114972b676d7Smrg    mini*:CTIX:SYS*5:*)
115072b676d7Smrg	# "miniframe"
115172b676d7Smrg	echo m68010-convergent-sysv
115272b676d7Smrg	exit ;;
115372b676d7Smrg    mc68k:UNIX:SYSTEM5:3.51m)
115472b676d7Smrg	echo m68k-convergent-sysv
115572b676d7Smrg	exit ;;
115672b676d7Smrg    M680?0:D-NIX:5.3:*)
115772b676d7Smrg	echo m68k-diab-dnix
115872b676d7Smrg	exit ;;
115972b676d7Smrg    M68*:*:R3V[5678]*:*)
116072b676d7Smrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
116172b676d7Smrg    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)
116272b676d7Smrg	OS_REL=''
116372b676d7Smrg	test -r /etc/.relid \
116472b676d7Smrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
116572b676d7Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
116674fcc364Smrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
116772b676d7Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
116874fcc364Smrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
116972b676d7Smrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
117074c14cd6Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
117174c14cd6Smrg	  && { echo i486-ncr-sysv4; exit; } ;;
117274c14cd6Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
117374c14cd6Smrg	OS_REL='.3'
117474c14cd6Smrg	test -r /etc/.relid \
117574c14cd6Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
117674c14cd6Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
117774fcc364Smrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
117874c14cd6Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
117974fcc364Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
118074c14cd6Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
118174fcc364Smrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
118272b676d7Smrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
118374fcc364Smrg	echo m68k-unknown-lynxos"$UNAME_RELEASE"
118472b676d7Smrg	exit ;;
118572b676d7Smrg    mc68030:UNIX_System_V:4.*:*)
118672b676d7Smrg	echo m68k-atari-sysv4
118772b676d7Smrg	exit ;;
118872b676d7Smrg    TSUNAMI:LynxOS:2.*:*)
118974fcc364Smrg	echo sparc-unknown-lynxos"$UNAME_RELEASE"
119072b676d7Smrg	exit ;;
119172b676d7Smrg    rs6000:LynxOS:2.*:*)
119274fcc364Smrg	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
119372b676d7Smrg	exit ;;
119474c14cd6Smrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
119574fcc364Smrg	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
119672b676d7Smrg	exit ;;
119772b676d7Smrg    SM[BE]S:UNIX_SV:*:*)
119874fcc364Smrg	echo mips-dde-sysv"$UNAME_RELEASE"
119972b676d7Smrg	exit ;;
120072b676d7Smrg    RM*:ReliantUNIX-*:*:*)
120172b676d7Smrg	echo mips-sni-sysv4
120272b676d7Smrg	exit ;;
120372b676d7Smrg    RM*:SINIX-*:*:*)
120472b676d7Smrg	echo mips-sni-sysv4
120572b676d7Smrg	exit ;;
120672b676d7Smrg    *:SINIX-*:*:*)
120772b676d7Smrg	if uname -p 2>/dev/null >/dev/null ; then
120872b676d7Smrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
120974fcc364Smrg		echo "$UNAME_MACHINE"-sni-sysv4
121072b676d7Smrg	else
121172b676d7Smrg		echo ns32k-sni-sysv
121272b676d7Smrg	fi
121372b676d7Smrg	exit ;;
121474c14cd6Smrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
121574c14cd6Smrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
121674c14cd6Smrg	echo i586-unisys-sysv4
121774c14cd6Smrg	exit ;;
121872b676d7Smrg    *:UNIX_System_V:4*:FTX*)
121972b676d7Smrg	# From Gerald Hewes <hewes@openmarket.com>.
122072b676d7Smrg	# How about differentiating between stratus architectures? -djm
122172b676d7Smrg	echo hppa1.1-stratus-sysv4
122272b676d7Smrg	exit ;;
122372b676d7Smrg    *:*:*:FTX*)
122472b676d7Smrg	# From seanf@swdc.stratus.com.
122572b676d7Smrg	echo i860-stratus-sysv4
122672b676d7Smrg	exit ;;
122772b676d7Smrg    i*86:VOS:*:*)
122872b676d7Smrg	# From Paul.Green@stratus.com.
122974fcc364Smrg	echo "$UNAME_MACHINE"-stratus-vos
123072b676d7Smrg	exit ;;
123172b676d7Smrg    *:VOS:*:*)
123272b676d7Smrg	# From Paul.Green@stratus.com.
123372b676d7Smrg	echo hppa1.1-stratus-vos
123472b676d7Smrg	exit ;;
123572b676d7Smrg    mc68*:A/UX:*:*)
123674fcc364Smrg	echo m68k-apple-aux"$UNAME_RELEASE"
123772b676d7Smrg	exit ;;
123872b676d7Smrg    news*:NEWS-OS:6*:*)
123972b676d7Smrg	echo mips-sony-newsos6
124072b676d7Smrg	exit ;;
124172b676d7Smrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
124272b676d7Smrg	if [ -d /usr/nec ]; then
124374fcc364Smrg		echo mips-nec-sysv"$UNAME_RELEASE"
124472b676d7Smrg	else
124574fcc364Smrg		echo mips-unknown-sysv"$UNAME_RELEASE"
124672b676d7Smrg	fi
124774c14cd6Smrg	exit ;;
124872b676d7Smrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
124972b676d7Smrg	echo powerpc-be-beos
125072b676d7Smrg	exit ;;
125172b676d7Smrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
125272b676d7Smrg	echo powerpc-apple-beos
125372b676d7Smrg	exit ;;
125472b676d7Smrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
125572b676d7Smrg	echo i586-pc-beos
125672b676d7Smrg	exit ;;
125774c14cd6Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
125874c14cd6Smrg	echo i586-pc-haiku
125974c14cd6Smrg	exit ;;
126093d9adc1Smrg    x86_64:Haiku:*:*)
126193d9adc1Smrg	echo x86_64-unknown-haiku
126293d9adc1Smrg	exit ;;
126372b676d7Smrg    SX-4:SUPER-UX:*:*)
126474fcc364Smrg	echo sx4-nec-superux"$UNAME_RELEASE"
126572b676d7Smrg	exit ;;
126672b676d7Smrg    SX-5:SUPER-UX:*:*)
126774fcc364Smrg	echo sx5-nec-superux"$UNAME_RELEASE"
126872b676d7Smrg	exit ;;
126972b676d7Smrg    SX-6:SUPER-UX:*:*)
127074fcc364Smrg	echo sx6-nec-superux"$UNAME_RELEASE"
127172b676d7Smrg	exit ;;
12721fd23544Smrg    SX-7:SUPER-UX:*:*)
127374fcc364Smrg	echo sx7-nec-superux"$UNAME_RELEASE"
12741fd23544Smrg	exit ;;
12751fd23544Smrg    SX-8:SUPER-UX:*:*)
127674fcc364Smrg	echo sx8-nec-superux"$UNAME_RELEASE"
12771fd23544Smrg	exit ;;
12781fd23544Smrg    SX-8R:SUPER-UX:*:*)
127974fcc364Smrg	echo sx8r-nec-superux"$UNAME_RELEASE"
12801fd23544Smrg	exit ;;
128193d9adc1Smrg    SX-ACE:SUPER-UX:*:*)
128274fcc364Smrg	echo sxace-nec-superux"$UNAME_RELEASE"
128393d9adc1Smrg	exit ;;
128472b676d7Smrg    Power*:Rhapsody:*:*)
128574fcc364Smrg	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
128672b676d7Smrg	exit ;;
128772b676d7Smrg    *:Rhapsody:*:*)
128874fcc364Smrg	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
128972b676d7Smrg	exit ;;
129072b676d7Smrg    *:Darwin:*:*)
129172b676d7Smrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
129274fcc364Smrg	eval "$set_cc_for_build"
129393d9adc1Smrg	if test "$UNAME_PROCESSOR" = unknown ; then
129493d9adc1Smrg	    UNAME_PROCESSOR=powerpc
129593d9adc1Smrg	fi
129674fcc364Smrg	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
129793d9adc1Smrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
129893d9adc1Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
129974fcc364Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
130074fcc364Smrg		       grep IS_64BIT_ARCH >/dev/null
130193d9adc1Smrg		then
130293d9adc1Smrg		    case $UNAME_PROCESSOR in
130393d9adc1Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
130493d9adc1Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
130593d9adc1Smrg		    esac
130693d9adc1Smrg		fi
130774fcc364Smrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
130874fcc364Smrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
130974fcc364Smrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
131074fcc364Smrg		       grep IS_PPC >/dev/null
131174fcc364Smrg		then
131274fcc364Smrg		    UNAME_PROCESSOR=powerpc
131374fcc364Smrg		fi
131493d9adc1Smrg	    fi
131593d9adc1Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
131693d9adc1Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
131793d9adc1Smrg	    # that puts up a graphical alert prompting to install
131893d9adc1Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
131993d9adc1Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
132093d9adc1Smrg	    # processor. This is not true of the ARM version of Darwin
132193d9adc1Smrg	    # that Apple uses in portable devices.
132293d9adc1Smrg	    UNAME_PROCESSOR=x86_64
132393d9adc1Smrg	fi
132474fcc364Smrg	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
132572b676d7Smrg	exit ;;
132672b676d7Smrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
132772b676d7Smrg	UNAME_PROCESSOR=`uname -p`
132893d9adc1Smrg	if test "$UNAME_PROCESSOR" = x86; then
132972b676d7Smrg		UNAME_PROCESSOR=i386
133072b676d7Smrg		UNAME_MACHINE=pc
133172b676d7Smrg	fi
133274fcc364Smrg	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
133372b676d7Smrg	exit ;;
133472b676d7Smrg    *:QNX:*:4*)
133572b676d7Smrg	echo i386-pc-qnx
133672b676d7Smrg	exit ;;
133774fcc364Smrg    NEO-*:NONSTOP_KERNEL:*:*)
133874fcc364Smrg	echo neo-tandem-nsk"$UNAME_RELEASE"
133974c14cd6Smrg	exit ;;
134093d9adc1Smrg    NSE-*:NONSTOP_KERNEL:*:*)
134174fcc364Smrg	echo nse-tandem-nsk"$UNAME_RELEASE"
134274fcc364Smrg	exit ;;
134374fcc364Smrg    NSR-*:NONSTOP_KERNEL:*:*)
134474fcc364Smrg	echo nsr-tandem-nsk"$UNAME_RELEASE"
134572b676d7Smrg	exit ;;
134674fcc364Smrg    NSV-*:NONSTOP_KERNEL:*:*)
134774fcc364Smrg	echo nsv-tandem-nsk"$UNAME_RELEASE"
134874fcc364Smrg	exit ;;
134974fcc364Smrg    NSX-*:NONSTOP_KERNEL:*:*)
135074fcc364Smrg	echo nsx-tandem-nsk"$UNAME_RELEASE"
135172b676d7Smrg	exit ;;
135272b676d7Smrg    *:NonStop-UX:*:*)
135372b676d7Smrg	echo mips-compaq-nonstopux
135472b676d7Smrg	exit ;;
135572b676d7Smrg    BS2000:POSIX*:*:*)
135672b676d7Smrg	echo bs2000-siemens-sysv
135772b676d7Smrg	exit ;;
135872b676d7Smrg    DS/*:UNIX_System_V:*:*)
135974fcc364Smrg	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
136072b676d7Smrg	exit ;;
136172b676d7Smrg    *:Plan9:*:*)
136272b676d7Smrg	# "uname -m" is not consistent, so use $cputype instead. 386
136372b676d7Smrg	# is converted to i386 for consistency with other x86
136472b676d7Smrg	# operating systems.
136593d9adc1Smrg	if test "$cputype" = 386; then
136672b676d7Smrg	    UNAME_MACHINE=i386
136772b676d7Smrg	else
136872b676d7Smrg	    UNAME_MACHINE="$cputype"
136972b676d7Smrg	fi
137074fcc364Smrg	echo "$UNAME_MACHINE"-unknown-plan9
137172b676d7Smrg	exit ;;
137272b676d7Smrg    *:TOPS-10:*:*)
137372b676d7Smrg	echo pdp10-unknown-tops10
137472b676d7Smrg	exit ;;
137572b676d7Smrg    *:TENEX:*:*)
137672b676d7Smrg	echo pdp10-unknown-tenex
137772b676d7Smrg	exit ;;
137872b676d7Smrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
137972b676d7Smrg	echo pdp10-dec-tops20
138072b676d7Smrg	exit ;;
138172b676d7Smrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
138272b676d7Smrg	echo pdp10-xkl-tops20
138372b676d7Smrg	exit ;;
138472b676d7Smrg    *:TOPS-20:*:*)
138572b676d7Smrg	echo pdp10-unknown-tops20
138672b676d7Smrg	exit ;;
138772b676d7Smrg    *:ITS:*:*)
138872b676d7Smrg	echo pdp10-unknown-its
138972b676d7Smrg	exit ;;
139072b676d7Smrg    SEI:*:*:SEIUX)
139174fcc364Smrg	echo mips-sei-seiux"$UNAME_RELEASE"
139272b676d7Smrg	exit ;;
139372b676d7Smrg    *:DragonFly:*:*)
139474fcc364Smrg	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
139572b676d7Smrg	exit ;;
139672b676d7Smrg    *:*VMS:*:*)
139774c14cd6Smrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
139874fcc364Smrg	case "$UNAME_MACHINE" in
139972b676d7Smrg	    A*) echo alpha-dec-vms ; exit ;;
140072b676d7Smrg	    I*) echo ia64-dec-vms ; exit ;;
140172b676d7Smrg	    V*) echo vax-dec-vms ; exit ;;
140272b676d7Smrg	esac ;;
140372b676d7Smrg    *:XENIX:*:SysV)
140472b676d7Smrg	echo i386-pc-xenix
140572b676d7Smrg	exit ;;
140672b676d7Smrg    i*86:skyos:*:*)
140774fcc364Smrg	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
140872b676d7Smrg	exit ;;
140972b676d7Smrg    i*86:rdos:*:*)
141074fcc364Smrg	echo "$UNAME_MACHINE"-pc-rdos
141172b676d7Smrg	exit ;;
141274c14cd6Smrg    i*86:AROS:*:*)
141374fcc364Smrg	echo "$UNAME_MACHINE"-pc-aros
141474c14cd6Smrg	exit ;;
141593d9adc1Smrg    x86_64:VMkernel:*:*)
141674fcc364Smrg	echo "$UNAME_MACHINE"-unknown-esx
141772b676d7Smrg	exit ;;
141893d9adc1Smrg    amd64:Isilon\ OneFS:*:*)
141993d9adc1Smrg	echo x86_64-unknown-onefs
142072b676d7Smrg	exit ;;
142193d9adc1Smrgesac
142272b676d7Smrg
142374fcc364Smrgecho "$0: unable to guess system type" >&2
142474fcc364Smrg
142574fcc364Smrgcase "$UNAME_MACHINE:$UNAME_SYSTEM" in
142674fcc364Smrg    mips:Linux | mips64:Linux)
142774fcc364Smrg	# If we got here on MIPS GNU/Linux, output extra information.
142874fcc364Smrg	cat >&2 <<EOF
142974fcc364Smrg
143074fcc364SmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
143174fcc364Smrgthe system type. Please install a C compiler and try again.
143274fcc364SmrgEOF
143374fcc364Smrg	;;
143474fcc364Smrgesac
143574fcc364Smrg
143672b676d7Smrgcat >&2 <<EOF
143772b676d7Smrg
143874fcc364SmrgThis script (version $timestamp), has failed to recognize the
143974fcc364Smrgoperating system you are using. If your script is old, overwrite *all*
144074fcc364Smrgcopies of config.guess and config.sub with the latest versions from:
144172b676d7Smrg
144274fcc364Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
144372b676d7Smrgand
144474fcc364Smrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
144572b676d7Smrg
144674fcc364SmrgIf $0 has already been updated, send the following data and any
144774fcc364Smrginformation you think might be pertinent to config-patches@gnu.org to
144874fcc364Smrgprovide the necessary information to handle your system.
144972b676d7Smrg
145072b676d7Smrgconfig.guess timestamp = $timestamp
145172b676d7Smrg
145272b676d7Smrguname -m = `(uname -m) 2>/dev/null || echo unknown`
145372b676d7Smrguname -r = `(uname -r) 2>/dev/null || echo unknown`
145472b676d7Smrguname -s = `(uname -s) 2>/dev/null || echo unknown`
145572b676d7Smrguname -v = `(uname -v) 2>/dev/null || echo unknown`
145672b676d7Smrg
145772b676d7Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
145872b676d7Smrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
145972b676d7Smrg
146072b676d7Smrghostinfo               = `(hostinfo) 2>/dev/null`
146172b676d7Smrg/bin/universe          = `(/bin/universe) 2>/dev/null`
146272b676d7Smrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
146372b676d7Smrg/bin/arch              = `(/bin/arch) 2>/dev/null`
146472b676d7Smrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
146572b676d7Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
146672b676d7Smrg
146774fcc364SmrgUNAME_MACHINE = "$UNAME_MACHINE"
146874fcc364SmrgUNAME_RELEASE = "$UNAME_RELEASE"
146974fcc364SmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
147074fcc364SmrgUNAME_VERSION = "$UNAME_VERSION"
147172b676d7SmrgEOF
147272b676d7Smrg
147372b676d7Smrgexit 1
147472b676d7Smrg
147572b676d7Smrg# Local variables:
147674fcc364Smrg# eval: (add-hook 'write-file-functions 'time-stamp)
147772b676d7Smrg# time-stamp-start: "timestamp='"
147872b676d7Smrg# time-stamp-format: "%:y-%02m-%02d"
147972b676d7Smrg# time-stamp-end: "'"
148072b676d7Smrg# End:
1481