config.guess revision 423b239c
11a30de1fSmrg#! /bin/sh
21a30de1fSmrg# Attempt to guess a canonical system name.
3423b239cSmrg#   Copyright 1992-2018 Free Software Foundation, Inc.
41a30de1fSmrg
5423b239cSmrgtimestamp='2018-03-01'
61a30de1fSmrg
71a30de1fSmrg# This file is free software; you can redistribute it and/or modify it
81a30de1fSmrg# under the terms of the GNU General Public License as published by
9a733a5bfSmrg# the Free Software Foundation; either version 3 of the License, or
101a30de1fSmrg# (at your option) any later version.
111a30de1fSmrg#
121a30de1fSmrg# This program is distributed in the hope that it will be useful, but
131a30de1fSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
141a30de1fSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
151a30de1fSmrg# General Public License for more details.
161a30de1fSmrg#
171a30de1fSmrg# You should have received a copy of the GNU General Public License
18423b239cSmrg# along with this program; if not, see <https://www.gnu.org/licenses/>.
191a30de1fSmrg#
201a30de1fSmrg# As a special exception to the GNU General Public License, if you
211a30de1fSmrg# distribute this file as part of a program that contains a
221a30de1fSmrg# configuration script generated by Autoconf, you may include it under
23a733a5bfSmrg# the same distribution terms that you use for the rest of that
24a733a5bfSmrg# program.  This Exception is an additional permission under section 7
25a733a5bfSmrg# of the GNU General Public License, version 3 ("GPLv3").
261a30de1fSmrg#
271b983734Smrg# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
281a30de1fSmrg#
29ce62200cSmrg# You can get the latest version of this script from:
30423b239cSmrg# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
31a733a5bfSmrg#
321b983734Smrg# Please send patches to <config-patches@gnu.org>.
33a733a5bfSmrg
341a30de1fSmrg
351a30de1fSmrgme=`echo "$0" | sed -e 's,.*/,,'`
361a30de1fSmrg
371a30de1fSmrgusage="\
381a30de1fSmrgUsage: $0 [OPTION]
391a30de1fSmrg
401a30de1fSmrgOutput the configuration name of the system \`$me' is run on.
411a30de1fSmrg
42423b239cSmrgOptions:
431a30de1fSmrg  -h, --help         print this help, then exit
441a30de1fSmrg  -t, --time-stamp   print date of last modification, then exit
451a30de1fSmrg  -v, --version      print version number, then exit
461a30de1fSmrg
471a30de1fSmrgReport bugs and patches to <config-patches@gnu.org>."
481a30de1fSmrg
491a30de1fSmrgversion="\
501a30de1fSmrgGNU config.guess ($timestamp)
511a30de1fSmrg
521a30de1fSmrgOriginally written by Per Bothner.
53423b239cSmrgCopyright 1992-2018 Free Software Foundation, Inc.
541a30de1fSmrg
551a30de1fSmrgThis is free software; see the source for copying conditions.  There is NO
561a30de1fSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
571a30de1fSmrg
581a30de1fSmrghelp="
591a30de1fSmrgTry \`$me --help' for more information."
601a30de1fSmrg
611a30de1fSmrg# Parse command line
621a30de1fSmrgwhile test $# -gt 0 ; do
631a30de1fSmrg  case $1 in
641a30de1fSmrg    --time-stamp | --time* | -t )
651a30de1fSmrg       echo "$timestamp" ; exit ;;
661a30de1fSmrg    --version | -v )
671a30de1fSmrg       echo "$version" ; exit ;;
681a30de1fSmrg    --help | --h* | -h )
691a30de1fSmrg       echo "$usage"; exit ;;
701a30de1fSmrg    -- )     # Stop option processing
711a30de1fSmrg       shift; break ;;
721a30de1fSmrg    - )	# Use stdin as input.
731a30de1fSmrg       break ;;
741a30de1fSmrg    -* )
751a30de1fSmrg       echo "$me: invalid option $1$help" >&2
761a30de1fSmrg       exit 1 ;;
771a30de1fSmrg    * )
781a30de1fSmrg       break ;;
791a30de1fSmrg  esac
801a30de1fSmrgdone
811a30de1fSmrg
821a30de1fSmrgif test $# != 0; then
831a30de1fSmrg  echo "$me: too many arguments$help" >&2
841a30de1fSmrg  exit 1
851a30de1fSmrgfi
861a30de1fSmrg
87a733a5bfSmrgtrap 'exit 1' 1 2 15
881a30de1fSmrg
891a30de1fSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
901a30de1fSmrg# compiler to aid in system detection is discouraged as it requires
911a30de1fSmrg# temporary files to be created and, as you can see below, it is a
921a30de1fSmrg# headache to deal with in a portable fashion.
931a30de1fSmrg
941a30de1fSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
951a30de1fSmrg# use `HOST_CC' if defined, but it is deprecated.
961a30de1fSmrg
971a30de1fSmrg# Portable tmp directory creation inspired by the Autoconf team.
981a30de1fSmrg
991a30de1fSmrgset_cc_for_build='
1001a30de1fSmrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
101a733a5bfSmrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
1021a30de1fSmrg: ${TMPDIR=/tmp} ;
1031a30de1fSmrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
1041a30de1fSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
1051a30de1fSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
1061a30de1fSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
1071a30de1fSmrgdummy=$tmp/dummy ;
1081a30de1fSmrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
1091a30de1fSmrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
110423b239cSmrg ,,)    echo "int x;" > "$dummy.c" ;
1111a30de1fSmrg	for c in cc gcc c89 c99 ; do
112423b239cSmrg	  if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
1131a30de1fSmrg	     CC_FOR_BUILD="$c"; break ;
1141a30de1fSmrg	  fi ;
1151a30de1fSmrg	done ;
1161a30de1fSmrg	if test x"$CC_FOR_BUILD" = x ; then
1171a30de1fSmrg	  CC_FOR_BUILD=no_compiler_found ;
1181a30de1fSmrg	fi
1191a30de1fSmrg	;;
1201a30de1fSmrg ,,*)   CC_FOR_BUILD=$CC ;;
1211a30de1fSmrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
1221a30de1fSmrgesac ; set_cc_for_build= ;'
1231a30de1fSmrg
1241a30de1fSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
1251a30de1fSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
1261a30de1fSmrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
1271a30de1fSmrg	PATH=$PATH:/.attbin ; export PATH
1281a30de1fSmrgfi
1291a30de1fSmrg
1301a30de1fSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
1311a30de1fSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
1321a30de1fSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
1331a30de1fSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
1341a30de1fSmrg
135423b239cSmrgcase "$UNAME_SYSTEM" in
136a733a5bfSmrgLinux|GNU|GNU/*)
137a733a5bfSmrg	# If the system lacks a compiler, then just pick glibc.
138a733a5bfSmrg	# We could probably try harder.
139a733a5bfSmrg	LIBC=gnu
140a733a5bfSmrg
141423b239cSmrg	eval "$set_cc_for_build"
142423b239cSmrg	cat <<-EOF > "$dummy.c"
143a733a5bfSmrg	#include <features.h>
144a733a5bfSmrg	#if defined(__UCLIBC__)
145a733a5bfSmrg	LIBC=uclibc
146a733a5bfSmrg	#elif defined(__dietlibc__)
147a733a5bfSmrg	LIBC=dietlibc
148a733a5bfSmrg	#else
149a733a5bfSmrg	LIBC=gnu
150a733a5bfSmrg	#endif
151a733a5bfSmrg	EOF
152423b239cSmrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
153423b239cSmrg
154423b239cSmrg	# If ldd exists, use it to detect musl libc.
155423b239cSmrg	if command -v ldd >/dev/null && \
156423b239cSmrg		ldd --version 2>&1 | grep -q ^musl
157423b239cSmrg	then
158423b239cSmrg	    LIBC=musl
159423b239cSmrg	fi
160a733a5bfSmrg	;;
161a733a5bfSmrgesac
162a733a5bfSmrg
1631a30de1fSmrg# Note: order is significant - the case branches are not exclusive.
1641a30de1fSmrg
165423b239cSmrgcase "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
1661a30de1fSmrg    *:NetBSD:*:*)
1671a30de1fSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
168a733a5bfSmrg	# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
1691a30de1fSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
1701a30de1fSmrg	# switched to ELF, *-*-netbsd* would select the old
1711a30de1fSmrg	# object file format.  This provides both forward
1721a30de1fSmrg	# compatibility and a consistent mechanism for selecting the
1731a30de1fSmrg	# object file format.
1741a30de1fSmrg	#
1751a30de1fSmrg	# Note: NetBSD doesn't particularly care about the vendor
1761a30de1fSmrg	# portion of the name.  We always set it to "unknown".
1771a30de1fSmrg	sysctl="sysctl -n hw.machine_arch"
178423b239cSmrg	UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
179423b239cSmrg	    "/sbin/$sysctl" 2>/dev/null || \
180423b239cSmrg	    "/usr/sbin/$sysctl" 2>/dev/null || \
181423b239cSmrg	    echo unknown)`
182423b239cSmrg	case "$UNAME_MACHINE_ARCH" in
1831a30de1fSmrg	    armeb) machine=armeb-unknown ;;
1841a30de1fSmrg	    arm*) machine=arm-unknown ;;
1851a30de1fSmrg	    sh3el) machine=shl-unknown ;;
1861a30de1fSmrg	    sh3eb) machine=sh-unknown ;;
187b7fb5eacSmrg	    sh5el) machine=sh5le-unknown ;;
188423b239cSmrg	    earmv*)
189423b239cSmrg		arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
190423b239cSmrg		endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
191423b239cSmrg		machine="${arch}${endian}"-unknown
192423b239cSmrg		;;
193423b239cSmrg	    *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
1941a30de1fSmrg	esac
1951a30de1fSmrg	# The Operating System including object format, if it has switched
196423b239cSmrg	# to ELF recently (or will in the future) and ABI.
197423b239cSmrg	case "$UNAME_MACHINE_ARCH" in
198423b239cSmrg	    earm*)
199423b239cSmrg		os=netbsdelf
200423b239cSmrg		;;
2011a30de1fSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
202423b239cSmrg		eval "$set_cc_for_build"
2031a30de1fSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
204ce62200cSmrg			| grep -q __ELF__
2051a30de1fSmrg		then
2061a30de1fSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
2071a30de1fSmrg		    # Return netbsd for either.  FIX?
2081a30de1fSmrg		    os=netbsd
2091a30de1fSmrg		else
2101a30de1fSmrg		    os=netbsdelf
2111a30de1fSmrg		fi
2121a30de1fSmrg		;;
2131a30de1fSmrg	    *)
214a733a5bfSmrg		os=netbsd
2151a30de1fSmrg		;;
2161a30de1fSmrg	esac
217423b239cSmrg	# Determine ABI tags.
218423b239cSmrg	case "$UNAME_MACHINE_ARCH" in
219423b239cSmrg	    earm*)
220423b239cSmrg		expr='s/^earmv[0-9]/-eabi/;s/eb$//'
221423b239cSmrg		abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
222423b239cSmrg		;;
223423b239cSmrg	esac
2241a30de1fSmrg	# The OS release
2251a30de1fSmrg	# Debian GNU/NetBSD machines have a different userland, and
2261a30de1fSmrg	# thus, need a distinct triplet. However, they do not need
2271a30de1fSmrg	# kernel version information, so it can be replaced with a
2281a30de1fSmrg	# suitable tag, in the style of linux-gnu.
229423b239cSmrg	case "$UNAME_VERSION" in
2301a30de1fSmrg	    Debian*)
2311a30de1fSmrg		release='-gnu'
2321a30de1fSmrg		;;
2331a30de1fSmrg	    *)
234423b239cSmrg		release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
2351a30de1fSmrg		;;
2361a30de1fSmrg	esac
2371a30de1fSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
2381a30de1fSmrg	# contains redundant information, the shorter form:
2391a30de1fSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
240423b239cSmrg	echo "$machine-${os}${release}${abi}"
2411a30de1fSmrg	exit ;;
242a733a5bfSmrg    *:Bitrig:*:*)
243a733a5bfSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
244423b239cSmrg	echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
245a733a5bfSmrg	exit ;;
2461a30de1fSmrg    *:OpenBSD:*:*)
2471a30de1fSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
248423b239cSmrg	echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
249423b239cSmrg	exit ;;
250423b239cSmrg    *:LibertyBSD:*:*)
251423b239cSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
252423b239cSmrg	echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
253423b239cSmrg	exit ;;
254423b239cSmrg    *:MidnightBSD:*:*)
255423b239cSmrg	echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
2561a30de1fSmrg	exit ;;
2571a30de1fSmrg    *:ekkoBSD:*:*)
258423b239cSmrg	echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
2591a30de1fSmrg	exit ;;
2601a30de1fSmrg    *:SolidBSD:*:*)
261423b239cSmrg	echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
2621a30de1fSmrg	exit ;;
2631a30de1fSmrg    macppc:MirBSD:*:*)
264423b239cSmrg	echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
2651a30de1fSmrg	exit ;;
2661a30de1fSmrg    *:MirBSD:*:*)
267423b239cSmrg	echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
2681a30de1fSmrg	exit ;;
269423b239cSmrg    *:Sortix:*:*)
270423b239cSmrg	echo "$UNAME_MACHINE"-unknown-sortix
271423b239cSmrg	exit ;;
272423b239cSmrg    *:Redox:*:*)
273423b239cSmrg	echo "$UNAME_MACHINE"-unknown-redox
274423b239cSmrg	exit ;;
275423b239cSmrg    mips:OSF1:*.*)
276423b239cSmrg        echo mips-dec-osf1
277423b239cSmrg        exit ;;
2781a30de1fSmrg    alpha:OSF1:*:*)
2791a30de1fSmrg	case $UNAME_RELEASE in
2801a30de1fSmrg	*4.0)
2811a30de1fSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
2821a30de1fSmrg		;;
2831a30de1fSmrg	*5.*)
284a733a5bfSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
2851a30de1fSmrg		;;
2861a30de1fSmrg	esac
2871a30de1fSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
2881a30de1fSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
2891a30de1fSmrg	# covers most systems running today.  This code pipes the CPU
2901a30de1fSmrg	# types through head -n 1, so we only detect the type of CPU 0.
2911a30de1fSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
2921a30de1fSmrg	case "$ALPHA_CPU_TYPE" in
2931a30de1fSmrg	    "EV4 (21064)")
294423b239cSmrg		UNAME_MACHINE=alpha ;;
2951a30de1fSmrg	    "EV4.5 (21064)")
296423b239cSmrg		UNAME_MACHINE=alpha ;;
2971a30de1fSmrg	    "LCA4 (21066/21068)")
298423b239cSmrg		UNAME_MACHINE=alpha ;;
2991a30de1fSmrg	    "EV5 (21164)")
300423b239cSmrg		UNAME_MACHINE=alphaev5 ;;
3011a30de1fSmrg	    "EV5.6 (21164A)")
302423b239cSmrg		UNAME_MACHINE=alphaev56 ;;
3031a30de1fSmrg	    "EV5.6 (21164PC)")
304423b239cSmrg		UNAME_MACHINE=alphapca56 ;;
3051a30de1fSmrg	    "EV5.7 (21164PC)")
306423b239cSmrg		UNAME_MACHINE=alphapca57 ;;
3071a30de1fSmrg	    "EV6 (21264)")
308423b239cSmrg		UNAME_MACHINE=alphaev6 ;;
3091a30de1fSmrg	    "EV6.7 (21264A)")
310423b239cSmrg		UNAME_MACHINE=alphaev67 ;;
3111a30de1fSmrg	    "EV6.8CB (21264C)")
312423b239cSmrg		UNAME_MACHINE=alphaev68 ;;
3131a30de1fSmrg	    "EV6.8AL (21264B)")
314423b239cSmrg		UNAME_MACHINE=alphaev68 ;;
3151a30de1fSmrg	    "EV6.8CX (21264D)")
316423b239cSmrg		UNAME_MACHINE=alphaev68 ;;
3171a30de1fSmrg	    "EV6.9A (21264/EV69A)")
318423b239cSmrg		UNAME_MACHINE=alphaev69 ;;
3191a30de1fSmrg	    "EV7 (21364)")
320423b239cSmrg		UNAME_MACHINE=alphaev7 ;;
3211a30de1fSmrg	    "EV7.9 (21364A)")
322423b239cSmrg		UNAME_MACHINE=alphaev79 ;;
3231a30de1fSmrg	esac
3241a30de1fSmrg	# A Pn.n version is a patched version.
3251a30de1fSmrg	# A Vn.n version is a released version.
3261a30de1fSmrg	# A Tn.n version is a released field test version.
3271a30de1fSmrg	# A Xn.n version is an unreleased experimental baselevel.
3281a30de1fSmrg	# 1.2 uses "1.2" for uname -r.
329423b239cSmrg	echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
330a733a5bfSmrg	# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
331a733a5bfSmrg	exitcode=$?
332a733a5bfSmrg	trap '' 0
333a733a5bfSmrg	exit $exitcode ;;
3341a30de1fSmrg    Amiga*:UNIX_System_V:4.0:*)
3351a30de1fSmrg	echo m68k-unknown-sysv4
3361a30de1fSmrg	exit ;;
3371a30de1fSmrg    *:[Aa]miga[Oo][Ss]:*:*)
338423b239cSmrg	echo "$UNAME_MACHINE"-unknown-amigaos
3391a30de1fSmrg	exit ;;
3401a30de1fSmrg    *:[Mm]orph[Oo][Ss]:*:*)
341423b239cSmrg	echo "$UNAME_MACHINE"-unknown-morphos
3421a30de1fSmrg	exit ;;
3431a30de1fSmrg    *:OS/390:*:*)
3441a30de1fSmrg	echo i370-ibm-openedition
3451a30de1fSmrg	exit ;;
3461a30de1fSmrg    *:z/VM:*:*)
3471a30de1fSmrg	echo s390-ibm-zvmoe
3481a30de1fSmrg	exit ;;
3491a30de1fSmrg    *:OS400:*:*)
350a733a5bfSmrg	echo powerpc-ibm-os400
3511a30de1fSmrg	exit ;;
3521a30de1fSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
353423b239cSmrg	echo arm-acorn-riscix"$UNAME_RELEASE"
3541a30de1fSmrg	exit ;;
355a733a5bfSmrg    arm*:riscos:*:*|arm*:RISCOS:*:*)
3561a30de1fSmrg	echo arm-unknown-riscos
3571a30de1fSmrg	exit ;;
3581a30de1fSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
3591a30de1fSmrg	echo hppa1.1-hitachi-hiuxmpp
3601a30de1fSmrg	exit ;;
3611a30de1fSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
3621a30de1fSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
3631a30de1fSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
3641a30de1fSmrg		echo pyramid-pyramid-sysv3
3651a30de1fSmrg	else
3661a30de1fSmrg		echo pyramid-pyramid-bsd
3671a30de1fSmrg	fi
3681a30de1fSmrg	exit ;;
3691a30de1fSmrg    NILE*:*:*:dcosx)
3701a30de1fSmrg	echo pyramid-pyramid-svr4
3711a30de1fSmrg	exit ;;
3721a30de1fSmrg    DRS?6000:unix:4.0:6*)
3731a30de1fSmrg	echo sparc-icl-nx6
3741a30de1fSmrg	exit ;;
3751a30de1fSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
3761a30de1fSmrg	case `/usr/bin/uname -p` in
3771a30de1fSmrg	    sparc) echo sparc-icl-nx7; exit ;;
3781a30de1fSmrg	esac ;;
379b7fb5eacSmrg    s390x:SunOS:*:*)
380423b239cSmrg	echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
381b7fb5eacSmrg	exit ;;
3821a30de1fSmrg    sun4H:SunOS:5.*:*)
383423b239cSmrg	echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
3841a30de1fSmrg	exit ;;
3851a30de1fSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
386423b239cSmrg	echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
3871a30de1fSmrg	exit ;;
388ce62200cSmrg    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
389423b239cSmrg	echo i386-pc-auroraux"$UNAME_RELEASE"
390ce62200cSmrg	exit ;;
391b7fb5eacSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
392423b239cSmrg	eval "$set_cc_for_build"
393423b239cSmrg	SUN_ARCH=i386
394b7fb5eacSmrg	# If there is a compiler, see if it is configured for 64-bit objects.
395b7fb5eacSmrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
396b7fb5eacSmrg	# This test works for both compilers.
397423b239cSmrg	if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
398b7fb5eacSmrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
399423b239cSmrg		(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
400b7fb5eacSmrg		grep IS_64BIT_ARCH >/dev/null
401b7fb5eacSmrg	    then
402423b239cSmrg		SUN_ARCH=x86_64
403b7fb5eacSmrg	    fi
404b7fb5eacSmrg	fi
405423b239cSmrg	echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
4061a30de1fSmrg	exit ;;
4071a30de1fSmrg    sun4*:SunOS:6*:*)
4081a30de1fSmrg	# According to config.sub, this is the proper way to canonicalize
4091a30de1fSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
4101a30de1fSmrg	# it's likely to be more like Solaris than SunOS4.
411423b239cSmrg	echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
4121a30de1fSmrg	exit ;;
4131a30de1fSmrg    sun4*:SunOS:*:*)
4141a30de1fSmrg	case "`/usr/bin/arch -k`" in
4151a30de1fSmrg	    Series*|S4*)
4161a30de1fSmrg		UNAME_RELEASE=`uname -v`
4171a30de1fSmrg		;;
4181a30de1fSmrg	esac
4191a30de1fSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
420423b239cSmrg	echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
4211a30de1fSmrg	exit ;;
4221a30de1fSmrg    sun3*:SunOS:*:*)
423423b239cSmrg	echo m68k-sun-sunos"$UNAME_RELEASE"
4241a30de1fSmrg	exit ;;
4251a30de1fSmrg    sun*:*:4.2BSD:*)
4261a30de1fSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
427423b239cSmrg	test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
4281a30de1fSmrg	case "`/bin/arch`" in
4291a30de1fSmrg	    sun3)
430423b239cSmrg		echo m68k-sun-sunos"$UNAME_RELEASE"
4311a30de1fSmrg		;;
4321a30de1fSmrg	    sun4)
433423b239cSmrg		echo sparc-sun-sunos"$UNAME_RELEASE"
4341a30de1fSmrg		;;
4351a30de1fSmrg	esac
4361a30de1fSmrg	exit ;;
4371a30de1fSmrg    aushp:SunOS:*:*)
438423b239cSmrg	echo sparc-auspex-sunos"$UNAME_RELEASE"
4391a30de1fSmrg	exit ;;
4401a30de1fSmrg    # The situation for MiNT is a little confusing.  The machine name
4411a30de1fSmrg    # can be virtually everything (everything which is not
4421a30de1fSmrg    # "atarist" or "atariste" at least should have a processor
4431a30de1fSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
4441a30de1fSmrg    # to the lowercase version "mint" (or "freemint").  Finally
4451a30de1fSmrg    # the system name "TOS" denotes a system which is actually not
4461a30de1fSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
4471a30de1fSmrg    # be no problem.
4481a30de1fSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
449423b239cSmrg	echo m68k-atari-mint"$UNAME_RELEASE"
4501a30de1fSmrg	exit ;;
4511a30de1fSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
452423b239cSmrg	echo m68k-atari-mint"$UNAME_RELEASE"
453a733a5bfSmrg	exit ;;
4541a30de1fSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
455423b239cSmrg	echo m68k-atari-mint"$UNAME_RELEASE"
4561a30de1fSmrg	exit ;;
4571a30de1fSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
458423b239cSmrg	echo m68k-milan-mint"$UNAME_RELEASE"
459a733a5bfSmrg	exit ;;
4601a30de1fSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
461423b239cSmrg	echo m68k-hades-mint"$UNAME_RELEASE"
462a733a5bfSmrg	exit ;;
4631a30de1fSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
464423b239cSmrg	echo m68k-unknown-mint"$UNAME_RELEASE"
465a733a5bfSmrg	exit ;;
4661a30de1fSmrg    m68k:machten:*:*)
467423b239cSmrg	echo m68k-apple-machten"$UNAME_RELEASE"
4681a30de1fSmrg	exit ;;
4691a30de1fSmrg    powerpc:machten:*:*)
470423b239cSmrg	echo powerpc-apple-machten"$UNAME_RELEASE"
4711a30de1fSmrg	exit ;;
4721a30de1fSmrg    RISC*:Mach:*:*)
4731a30de1fSmrg	echo mips-dec-mach_bsd4.3
4741a30de1fSmrg	exit ;;
4751a30de1fSmrg    RISC*:ULTRIX:*:*)
476423b239cSmrg	echo mips-dec-ultrix"$UNAME_RELEASE"
4771a30de1fSmrg	exit ;;
4781a30de1fSmrg    VAX*:ULTRIX*:*:*)
479423b239cSmrg	echo vax-dec-ultrix"$UNAME_RELEASE"
4801a30de1fSmrg	exit ;;
4811a30de1fSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
482423b239cSmrg	echo clipper-intergraph-clix"$UNAME_RELEASE"
4831a30de1fSmrg	exit ;;
4841a30de1fSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
485423b239cSmrg	eval "$set_cc_for_build"
486423b239cSmrg	sed 's/^	//' << EOF > "$dummy.c"
4871a30de1fSmrg#ifdef __cplusplus
4881a30de1fSmrg#include <stdio.h>  /* for printf() prototype */
4891a30de1fSmrg	int main (int argc, char *argv[]) {
4901a30de1fSmrg#else
4911a30de1fSmrg	int main (argc, argv) int argc; char *argv[]; {
4921a30de1fSmrg#endif
4931a30de1fSmrg	#if defined (host_mips) && defined (MIPSEB)
4941a30de1fSmrg	#if defined (SYSTYPE_SYSV)
495423b239cSmrg	  printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
4961a30de1fSmrg	#endif
4971a30de1fSmrg	#if defined (SYSTYPE_SVR4)
498423b239cSmrg	  printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
4991a30de1fSmrg	#endif
5001a30de1fSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
501423b239cSmrg	  printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
5021a30de1fSmrg	#endif
5031a30de1fSmrg	#endif
5041a30de1fSmrg	  exit (-1);
5051a30de1fSmrg	}
5061a30de1fSmrgEOF
507423b239cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
508423b239cSmrg	  dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
509423b239cSmrg	  SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
5101a30de1fSmrg	    { echo "$SYSTEM_NAME"; exit; }
511423b239cSmrg	echo mips-mips-riscos"$UNAME_RELEASE"
5121a30de1fSmrg	exit ;;
5131a30de1fSmrg    Motorola:PowerMAX_OS:*:*)
5141a30de1fSmrg	echo powerpc-motorola-powermax
5151a30de1fSmrg	exit ;;
5161a30de1fSmrg    Motorola:*:4.3:PL8-*)
5171a30de1fSmrg	echo powerpc-harris-powermax
5181a30de1fSmrg	exit ;;
5191a30de1fSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
5201a30de1fSmrg	echo powerpc-harris-powermax
5211a30de1fSmrg	exit ;;
5221a30de1fSmrg    Night_Hawk:Power_UNIX:*:*)
5231a30de1fSmrg	echo powerpc-harris-powerunix
5241a30de1fSmrg	exit ;;
5251a30de1fSmrg    m88k:CX/UX:7*:*)
5261a30de1fSmrg	echo m88k-harris-cxux7
5271a30de1fSmrg	exit ;;
5281a30de1fSmrg    m88k:*:4*:R4*)
5291a30de1fSmrg	echo m88k-motorola-sysv4
5301a30de1fSmrg	exit ;;
5311a30de1fSmrg    m88k:*:3*:R3*)
5321a30de1fSmrg	echo m88k-motorola-sysv3
5331a30de1fSmrg	exit ;;
5341a30de1fSmrg    AViiON:dgux:*:*)
535a733a5bfSmrg	# DG/UX returns AViiON for all architectures
536a733a5bfSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
537423b239cSmrg	if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
5381a30de1fSmrg	then
539423b239cSmrg	    if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
540423b239cSmrg	       [ "$TARGET_BINARY_INTERFACE"x = x ]
5411a30de1fSmrg	    then
542423b239cSmrg		echo m88k-dg-dgux"$UNAME_RELEASE"
5431a30de1fSmrg	    else
544423b239cSmrg		echo m88k-dg-dguxbcs"$UNAME_RELEASE"
5451a30de1fSmrg	    fi
5461a30de1fSmrg	else
547423b239cSmrg	    echo i586-dg-dgux"$UNAME_RELEASE"
5481a30de1fSmrg	fi
549a733a5bfSmrg	exit ;;
5501a30de1fSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
5511a30de1fSmrg	echo m88k-dolphin-sysv3
5521a30de1fSmrg	exit ;;
5531a30de1fSmrg    M88*:*:R3*:*)
5541a30de1fSmrg	# Delta 88k system running SVR3
5551a30de1fSmrg	echo m88k-motorola-sysv3
5561a30de1fSmrg	exit ;;
5571a30de1fSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
5581a30de1fSmrg	echo m88k-tektronix-sysv3
5591a30de1fSmrg	exit ;;
5601a30de1fSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
5611a30de1fSmrg	echo m68k-tektronix-bsd
5621a30de1fSmrg	exit ;;
5631a30de1fSmrg    *:IRIX*:*:*)
564423b239cSmrg	echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
5651a30de1fSmrg	exit ;;
5661a30de1fSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
5671a30de1fSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
5681a30de1fSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
5691a30de1fSmrg    i*86:AIX:*:*)
5701a30de1fSmrg	echo i386-ibm-aix
5711a30de1fSmrg	exit ;;
5721a30de1fSmrg    ia64:AIX:*:*)
5731a30de1fSmrg	if [ -x /usr/bin/oslevel ] ; then
5741a30de1fSmrg		IBM_REV=`/usr/bin/oslevel`
5751a30de1fSmrg	else
576423b239cSmrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
5771a30de1fSmrg	fi
578423b239cSmrg	echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
5791a30de1fSmrg	exit ;;
5801a30de1fSmrg    *:AIX:2:3)
5811a30de1fSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
582423b239cSmrg		eval "$set_cc_for_build"
583423b239cSmrg		sed 's/^		//' << EOF > "$dummy.c"
5841a30de1fSmrg		#include <sys/systemcfg.h>
5851a30de1fSmrg
5861a30de1fSmrg		main()
5871a30de1fSmrg			{
5881a30de1fSmrg			if (!__power_pc())
5891a30de1fSmrg				exit(1);
5901a30de1fSmrg			puts("powerpc-ibm-aix3.2.5");
5911a30de1fSmrg			exit(0);
5921a30de1fSmrg			}
5931a30de1fSmrgEOF
594423b239cSmrg		if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
5951a30de1fSmrg		then
5961a30de1fSmrg			echo "$SYSTEM_NAME"
5971a30de1fSmrg		else
5981a30de1fSmrg			echo rs6000-ibm-aix3.2.5
5991a30de1fSmrg		fi
6001a30de1fSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
6011a30de1fSmrg		echo rs6000-ibm-aix3.2.4
6021a30de1fSmrg	else
6031a30de1fSmrg		echo rs6000-ibm-aix3.2
6041a30de1fSmrg	fi
6051a30de1fSmrg	exit ;;
606ce62200cSmrg    *:AIX:*:[4567])
6071a30de1fSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
608423b239cSmrg	if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
6091a30de1fSmrg		IBM_ARCH=rs6000
6101a30de1fSmrg	else
6111a30de1fSmrg		IBM_ARCH=powerpc
6121a30de1fSmrg	fi
6131b983734Smrg	if [ -x /usr/bin/lslpp ] ; then
6141b983734Smrg		IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
6151b983734Smrg			   awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
6161a30de1fSmrg	else
617423b239cSmrg		IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
6181a30de1fSmrg	fi
619423b239cSmrg	echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
6201a30de1fSmrg	exit ;;
6211a30de1fSmrg    *:AIX:*:*)
6221a30de1fSmrg	echo rs6000-ibm-aix
6231a30de1fSmrg	exit ;;
624423b239cSmrg    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
6251a30de1fSmrg	echo romp-ibm-bsd4.4
6261a30de1fSmrg	exit ;;
6271a30de1fSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
628423b239cSmrg	echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
6291a30de1fSmrg	exit ;;                             # report: romp-ibm BSD 4.3
6301a30de1fSmrg    *:BOSX:*:*)
6311a30de1fSmrg	echo rs6000-bull-bosx
6321a30de1fSmrg	exit ;;
6331a30de1fSmrg    DPX/2?00:B.O.S.:*:*)
6341a30de1fSmrg	echo m68k-bull-sysv3
6351a30de1fSmrg	exit ;;
6361a30de1fSmrg    9000/[34]??:4.3bsd:1.*:*)
6371a30de1fSmrg	echo m68k-hp-bsd
6381a30de1fSmrg	exit ;;
6391a30de1fSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
6401a30de1fSmrg	echo m68k-hp-bsd4.4
6411a30de1fSmrg	exit ;;
6421a30de1fSmrg    9000/[34678]??:HP-UX:*:*)
643423b239cSmrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
644423b239cSmrg	case "$UNAME_MACHINE" in
645423b239cSmrg	    9000/31?)            HP_ARCH=m68000 ;;
646423b239cSmrg	    9000/[34]??)         HP_ARCH=m68k ;;
6471a30de1fSmrg	    9000/[678][0-9][0-9])
6481a30de1fSmrg		if [ -x /usr/bin/getconf ]; then
6491a30de1fSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
650a733a5bfSmrg		    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
651423b239cSmrg		    case "$sc_cpu_version" in
652423b239cSmrg		      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
653423b239cSmrg		      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
654a733a5bfSmrg		      532)                      # CPU_PA_RISC2_0
655423b239cSmrg			case "$sc_kernel_bits" in
656423b239cSmrg			  32) HP_ARCH=hppa2.0n ;;
657423b239cSmrg			  64) HP_ARCH=hppa2.0w ;;
658423b239cSmrg			  '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
659a733a5bfSmrg			esac ;;
660a733a5bfSmrg		    esac
6611a30de1fSmrg		fi
662423b239cSmrg		if [ "$HP_ARCH" = "" ]; then
663423b239cSmrg		    eval "$set_cc_for_build"
664423b239cSmrg		    sed 's/^		//' << EOF > "$dummy.c"
6651a30de1fSmrg
666a733a5bfSmrg		#define _HPUX_SOURCE
667a733a5bfSmrg		#include <stdlib.h>
668a733a5bfSmrg		#include <unistd.h>
6691a30de1fSmrg
670a733a5bfSmrg		int main ()
671a733a5bfSmrg		{
672a733a5bfSmrg		#if defined(_SC_KERNEL_BITS)
673a733a5bfSmrg		    long bits = sysconf(_SC_KERNEL_BITS);
674a733a5bfSmrg		#endif
675a733a5bfSmrg		    long cpu  = sysconf (_SC_CPU_VERSION);
6761a30de1fSmrg
677a733a5bfSmrg		    switch (cpu)
678a733a5bfSmrg			{
679a733a5bfSmrg			case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
680a733a5bfSmrg			case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
681a733a5bfSmrg			case CPU_PA_RISC2_0:
682a733a5bfSmrg		#if defined(_SC_KERNEL_BITS)
683a733a5bfSmrg			    switch (bits)
684a733a5bfSmrg				{
685a733a5bfSmrg				case 64: puts ("hppa2.0w"); break;
686a733a5bfSmrg				case 32: puts ("hppa2.0n"); break;
687a733a5bfSmrg				default: puts ("hppa2.0"); break;
688a733a5bfSmrg				} break;
689a733a5bfSmrg		#else  /* !defined(_SC_KERNEL_BITS) */
690a733a5bfSmrg			    puts ("hppa2.0"); break;
691a733a5bfSmrg		#endif
692a733a5bfSmrg			default: puts ("hppa1.0"); break;
693a733a5bfSmrg			}
694a733a5bfSmrg		    exit (0);
695a733a5bfSmrg		}
6961a30de1fSmrgEOF
697423b239cSmrg		    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
6981a30de1fSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
6991a30de1fSmrg		fi ;;
7001a30de1fSmrg	esac
701423b239cSmrg	if [ "$HP_ARCH" = hppa2.0w ]
7021a30de1fSmrg	then
703423b239cSmrg	    eval "$set_cc_for_build"
7041a30de1fSmrg
7051a30de1fSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
7061a30de1fSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
7071a30de1fSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
7081a30de1fSmrg	    #
7091a30de1fSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
7101a30de1fSmrg	    # => hppa2.0w-hp-hpux11.23
7111a30de1fSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
7121a30de1fSmrg	    # => hppa64-hp-hpux11.23
7131a30de1fSmrg
714423b239cSmrg	    if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
715ce62200cSmrg		grep -q __LP64__
7161a30de1fSmrg	    then
717423b239cSmrg		HP_ARCH=hppa2.0w
7181a30de1fSmrg	    else
719423b239cSmrg		HP_ARCH=hppa64
7201a30de1fSmrg	    fi
7211a30de1fSmrg	fi
722423b239cSmrg	echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
7231a30de1fSmrg	exit ;;
7241a30de1fSmrg    ia64:HP-UX:*:*)
725423b239cSmrg	HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
726423b239cSmrg	echo ia64-hp-hpux"$HPUX_REV"
7271a30de1fSmrg	exit ;;
7281a30de1fSmrg    3050*:HI-UX:*:*)
729423b239cSmrg	eval "$set_cc_for_build"
730423b239cSmrg	sed 's/^	//' << EOF > "$dummy.c"
7311a30de1fSmrg	#include <unistd.h>
7321a30de1fSmrg	int
7331a30de1fSmrg	main ()
7341a30de1fSmrg	{
7351a30de1fSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
7361a30de1fSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
7371a30de1fSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
7381a30de1fSmrg	     results, however.  */
7391a30de1fSmrg	  if (CPU_IS_PA_RISC (cpu))
7401a30de1fSmrg	    {
7411a30de1fSmrg	      switch (cpu)
7421a30de1fSmrg		{
7431a30de1fSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
7441a30de1fSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
7451a30de1fSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
7461a30de1fSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
7471a30de1fSmrg		}
7481a30de1fSmrg	    }
7491a30de1fSmrg	  else if (CPU_IS_HP_MC68K (cpu))
7501a30de1fSmrg	    puts ("m68k-hitachi-hiuxwe2");
7511a30de1fSmrg	  else puts ("unknown-hitachi-hiuxwe2");
7521a30de1fSmrg	  exit (0);
7531a30de1fSmrg	}
7541a30de1fSmrgEOF
755423b239cSmrg	$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
7561a30de1fSmrg		{ echo "$SYSTEM_NAME"; exit; }
7571a30de1fSmrg	echo unknown-hitachi-hiuxwe2
7581a30de1fSmrg	exit ;;
759423b239cSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
7601a30de1fSmrg	echo hppa1.1-hp-bsd
7611a30de1fSmrg	exit ;;
7621a30de1fSmrg    9000/8??:4.3bsd:*:*)
7631a30de1fSmrg	echo hppa1.0-hp-bsd
7641a30de1fSmrg	exit ;;
7651a30de1fSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
7661a30de1fSmrg	echo hppa1.0-hp-mpeix
7671a30de1fSmrg	exit ;;
768423b239cSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
7691a30de1fSmrg	echo hppa1.1-hp-osf
7701a30de1fSmrg	exit ;;
7711a30de1fSmrg    hp8??:OSF1:*:*)
7721a30de1fSmrg	echo hppa1.0-hp-osf
7731a30de1fSmrg	exit ;;
7741a30de1fSmrg    i*86:OSF1:*:*)
7751a30de1fSmrg	if [ -x /usr/sbin/sysversion ] ; then
776423b239cSmrg	    echo "$UNAME_MACHINE"-unknown-osf1mk
7771a30de1fSmrg	else
778423b239cSmrg	    echo "$UNAME_MACHINE"-unknown-osf1
7791a30de1fSmrg	fi
7801a30de1fSmrg	exit ;;
7811a30de1fSmrg    parisc*:Lites*:*:*)
7821a30de1fSmrg	echo hppa1.1-hp-lites
7831a30de1fSmrg	exit ;;
7841a30de1fSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
7851a30de1fSmrg	echo c1-convex-bsd
786a733a5bfSmrg	exit ;;
7871a30de1fSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
7881a30de1fSmrg	if getsysinfo -f scalar_acc
7891a30de1fSmrg	then echo c32-convex-bsd
7901a30de1fSmrg	else echo c2-convex-bsd
7911a30de1fSmrg	fi
792a733a5bfSmrg	exit ;;
7931a30de1fSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
7941a30de1fSmrg	echo c34-convex-bsd
795a733a5bfSmrg	exit ;;
7961a30de1fSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
7971a30de1fSmrg	echo c38-convex-bsd
798a733a5bfSmrg	exit ;;
7991a30de1fSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
8001a30de1fSmrg	echo c4-convex-bsd
801a733a5bfSmrg	exit ;;
8021a30de1fSmrg    CRAY*Y-MP:*:*:*)
803423b239cSmrg	echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8041a30de1fSmrg	exit ;;
8051a30de1fSmrg    CRAY*[A-Z]90:*:*:*)
806423b239cSmrg	echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
8071a30de1fSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
8081a30de1fSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
8091a30de1fSmrg	      -e 's/\.[^.]*$/.X/'
8101a30de1fSmrg	exit ;;
8111a30de1fSmrg    CRAY*TS:*:*:*)
812423b239cSmrg	echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8131a30de1fSmrg	exit ;;
8141a30de1fSmrg    CRAY*T3E:*:*:*)
815423b239cSmrg	echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8161a30de1fSmrg	exit ;;
8171a30de1fSmrg    CRAY*SV1:*:*:*)
818423b239cSmrg	echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8191a30de1fSmrg	exit ;;
8201a30de1fSmrg    *:UNICOS/mp:*:*)
821423b239cSmrg	echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
8221a30de1fSmrg	exit ;;
8231a30de1fSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
824423b239cSmrg	FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
825423b239cSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
826423b239cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
827a733a5bfSmrg	echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
828a733a5bfSmrg	exit ;;
8291a30de1fSmrg    5000:UNIX_System_V:4.*:*)
830423b239cSmrg	FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
831423b239cSmrg	FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
832a733a5bfSmrg	echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
8331a30de1fSmrg	exit ;;
8341a30de1fSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
835423b239cSmrg	echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
8361a30de1fSmrg	exit ;;
8371a30de1fSmrg    sparc*:BSD/OS:*:*)
838423b239cSmrg	echo sparc-unknown-bsdi"$UNAME_RELEASE"
8391a30de1fSmrg	exit ;;
8401a30de1fSmrg    *:BSD/OS:*:*)
841423b239cSmrg	echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
8421a30de1fSmrg	exit ;;
8431a30de1fSmrg    *:FreeBSD:*:*)
844a733a5bfSmrg	UNAME_PROCESSOR=`/usr/bin/uname -p`
845423b239cSmrg	case "$UNAME_PROCESSOR" in
8461a30de1fSmrg	    amd64)
847423b239cSmrg		UNAME_PROCESSOR=x86_64 ;;
848423b239cSmrg	    i386)
849423b239cSmrg		UNAME_PROCESSOR=i586 ;;
8501a30de1fSmrg	esac
851423b239cSmrg	echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
8521a30de1fSmrg	exit ;;
8531a30de1fSmrg    i*:CYGWIN*:*)
854423b239cSmrg	echo "$UNAME_MACHINE"-pc-cygwin
8551a30de1fSmrg	exit ;;
856a733a5bfSmrg    *:MINGW64*:*)
857423b239cSmrg	echo "$UNAME_MACHINE"-pc-mingw64
858a733a5bfSmrg	exit ;;
859b7fb5eacSmrg    *:MINGW*:*)
860423b239cSmrg	echo "$UNAME_MACHINE"-pc-mingw32
8611a30de1fSmrg	exit ;;
8621b983734Smrg    *:MSYS*:*)
863423b239cSmrg	echo "$UNAME_MACHINE"-pc-msys
8641a30de1fSmrg	exit ;;
8651a30de1fSmrg    i*:PW*:*)
866423b239cSmrg	echo "$UNAME_MACHINE"-pc-pw32
8671a30de1fSmrg	exit ;;
868ce62200cSmrg    *:Interix*:*)
869423b239cSmrg	case "$UNAME_MACHINE" in
870b7fb5eacSmrg	    x86)
871423b239cSmrg		echo i586-pc-interix"$UNAME_RELEASE"
872b7fb5eacSmrg		exit ;;
873ce62200cSmrg	    authenticamd | genuineintel | EM64T)
874423b239cSmrg		echo x86_64-unknown-interix"$UNAME_RELEASE"
875b7fb5eacSmrg		exit ;;
876b7fb5eacSmrg	    IA64)
877423b239cSmrg		echo ia64-unknown-interix"$UNAME_RELEASE"
878b7fb5eacSmrg		exit ;;
879b7fb5eacSmrg	esac ;;
8801a30de1fSmrg    i*:UWIN*:*)
881423b239cSmrg	echo "$UNAME_MACHINE"-pc-uwin
8821a30de1fSmrg	exit ;;
8831a30de1fSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
8841a30de1fSmrg	echo x86_64-unknown-cygwin
8851a30de1fSmrg	exit ;;
8861a30de1fSmrg    prep*:SunOS:5.*:*)
887423b239cSmrg	echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
8881a30de1fSmrg	exit ;;
8891a30de1fSmrg    *:GNU:*:*)
8901a30de1fSmrg	# the GNU system
891423b239cSmrg	echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
8921a30de1fSmrg	exit ;;
8931a30de1fSmrg    *:GNU/*:*:*)
8941a30de1fSmrg	# other systems with GNU libc and userland
895423b239cSmrg	echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
8961a30de1fSmrg	exit ;;
8971a30de1fSmrg    i*86:Minix:*:*)
898423b239cSmrg	echo "$UNAME_MACHINE"-pc-minix
8991a30de1fSmrg	exit ;;
900a733a5bfSmrg    aarch64:Linux:*:*)
901423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
902a733a5bfSmrg	exit ;;
903a733a5bfSmrg    aarch64_be:Linux:*:*)
904a733a5bfSmrg	UNAME_MACHINE=aarch64_be
905423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
906a733a5bfSmrg	exit ;;
907ce62200cSmrg    alpha:Linux:*:*)
908ce62200cSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
909ce62200cSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
910ce62200cSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
911ce62200cSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
912ce62200cSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
913ce62200cSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
914ce62200cSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
915ce62200cSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
916a733a5bfSmrg	esac
917ce62200cSmrg	objdump --private-headers /bin/sh | grep -q ld.so.1
918423b239cSmrg	if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
919423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
920a733a5bfSmrg	exit ;;
921a733a5bfSmrg    arc:Linux:*:* | arceb:Linux:*:*)
922423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
923ce62200cSmrg	exit ;;
9241a30de1fSmrg    arm*:Linux:*:*)
925423b239cSmrg	eval "$set_cc_for_build"
926b7fb5eacSmrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
927b7fb5eacSmrg	    | grep -q __ARM_EABI__
928b7fb5eacSmrg	then
929423b239cSmrg	    echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
930b7fb5eacSmrg	else
931a733a5bfSmrg	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
932a733a5bfSmrg		| grep -q __ARM_PCS_VFP
933a733a5bfSmrg	    then
934423b239cSmrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
935a733a5bfSmrg	    else
936423b239cSmrg		echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
937a733a5bfSmrg	    fi
938b7fb5eacSmrg	fi
9391a30de1fSmrg	exit ;;
9401a30de1fSmrg    avr32*:Linux:*:*)
941423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9421a30de1fSmrg	exit ;;
9431a30de1fSmrg    cris:Linux:*:*)
944423b239cSmrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
9451a30de1fSmrg	exit ;;
9461a30de1fSmrg    crisv32:Linux:*:*)
947423b239cSmrg	echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
948423b239cSmrg	exit ;;
949423b239cSmrg    e2k:Linux:*:*)
950423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9511a30de1fSmrg	exit ;;
9521a30de1fSmrg    frv:Linux:*:*)
953423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
954a733a5bfSmrg	exit ;;
955a733a5bfSmrg    hexagon:Linux:*:*)
956423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9571a30de1fSmrg	exit ;;
958ce62200cSmrg    i*86:Linux:*:*)
959423b239cSmrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
960ce62200cSmrg	exit ;;
9611a30de1fSmrg    ia64:Linux:*:*)
962423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963423b239cSmrg	exit ;;
964423b239cSmrg    k1om:Linux:*:*)
965423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9661a30de1fSmrg	exit ;;
9671a30de1fSmrg    m32r*:Linux:*:*)
968423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9691a30de1fSmrg	exit ;;
9701a30de1fSmrg    m68*:Linux:*:*)
971423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
9721a30de1fSmrg	exit ;;
973ce62200cSmrg    mips:Linux:*:* | mips64:Linux:*:*)
974423b239cSmrg	eval "$set_cc_for_build"
975423b239cSmrg	sed 's/^	//' << EOF > "$dummy.c"
9761a30de1fSmrg	#undef CPU
977ce62200cSmrg	#undef ${UNAME_MACHINE}
978ce62200cSmrg	#undef ${UNAME_MACHINE}el
9791a30de1fSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
980ce62200cSmrg	CPU=${UNAME_MACHINE}el
9811a30de1fSmrg	#else
9821a30de1fSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
983ce62200cSmrg	CPU=${UNAME_MACHINE}
9841a30de1fSmrg	#else
9851a30de1fSmrg	CPU=
9861a30de1fSmrg	#endif
9871a30de1fSmrg	#endif
9881a30de1fSmrgEOF
989423b239cSmrg	eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
990423b239cSmrg	test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
9911a30de1fSmrg	;;
992423b239cSmrg    mips64el:Linux:*:*)
993423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
994423b239cSmrg	exit ;;
9951b983734Smrg    openrisc*:Linux:*:*)
996423b239cSmrg	echo or1k-unknown-linux-"$LIBC"
997a733a5bfSmrg	exit ;;
9981b983734Smrg    or32:Linux:*:* | or1k*:Linux:*:*)
999423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10001a30de1fSmrg	exit ;;
1001b7fb5eacSmrg    padre:Linux:*:*)
1002423b239cSmrg	echo sparc-unknown-linux-"$LIBC"
1003b7fb5eacSmrg	exit ;;
1004ce62200cSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
1005423b239cSmrg	echo hppa64-unknown-linux-"$LIBC"
1006ce62200cSmrg	exit ;;
10071a30de1fSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
10081a30de1fSmrg	# Look for CPU level
10091a30de1fSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
1010423b239cSmrg	  PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
1011423b239cSmrg	  PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
1012423b239cSmrg	  *)    echo hppa-unknown-linux-"$LIBC" ;;
10131a30de1fSmrg	esac
10141a30de1fSmrg	exit ;;
1015ce62200cSmrg    ppc64:Linux:*:*)
1016423b239cSmrg	echo powerpc64-unknown-linux-"$LIBC"
1017ce62200cSmrg	exit ;;
1018ce62200cSmrg    ppc:Linux:*:*)
1019423b239cSmrg	echo powerpc-unknown-linux-"$LIBC"
1020a733a5bfSmrg	exit ;;
1021a733a5bfSmrg    ppc64le:Linux:*:*)
1022423b239cSmrg	echo powerpc64le-unknown-linux-"$LIBC"
1023a733a5bfSmrg	exit ;;
1024a733a5bfSmrg    ppcle:Linux:*:*)
1025423b239cSmrg	echo powerpcle-unknown-linux-"$LIBC"
1026423b239cSmrg	exit ;;
1027423b239cSmrg    riscv32:Linux:*:* | riscv64:Linux:*:*)
1028423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10291a30de1fSmrg	exit ;;
10301a30de1fSmrg    s390:Linux:*:* | s390x:Linux:*:*)
1031423b239cSmrg	echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
10321a30de1fSmrg	exit ;;
10331a30de1fSmrg    sh64*:Linux:*:*)
1034423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10351a30de1fSmrg	exit ;;
10361a30de1fSmrg    sh*:Linux:*:*)
1037423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10381a30de1fSmrg	exit ;;
10391a30de1fSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
1040423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
10411a30de1fSmrg	exit ;;
1042ce62200cSmrg    tile*:Linux:*:*)
1043423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1044ce62200cSmrg	exit ;;
10451a30de1fSmrg    vax:Linux:*:*)
1046423b239cSmrg	echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
10471a30de1fSmrg	exit ;;
10481a30de1fSmrg    x86_64:Linux:*:*)
1049423b239cSmrg	echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
10501a30de1fSmrg	exit ;;
1051b7fb5eacSmrg    xtensa*:Linux:*:*)
1052423b239cSmrg	echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
1053b7fb5eacSmrg	exit ;;
10541a30de1fSmrg    i*86:DYNIX/ptx:4*:*)
10551a30de1fSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
10561a30de1fSmrg	# earlier versions are messed up and put the nodename in both
10571a30de1fSmrg	# sysname and nodename.
10581a30de1fSmrg	echo i386-sequent-sysv4
10591a30de1fSmrg	exit ;;
10601a30de1fSmrg    i*86:UNIX_SV:4.2MP:2.*)
1061a733a5bfSmrg	# Unixware is an offshoot of SVR4, but it has its own version
1062a733a5bfSmrg	# number series starting with 2...
1063a733a5bfSmrg	# I am not positive that other SVR4 systems won't match this,
10641a30de1fSmrg	# I just have to hope.  -- rms.
1065a733a5bfSmrg	# Use sysv4.2uw... so that sysv4* matches it.
1066423b239cSmrg	echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
10671a30de1fSmrg	exit ;;
10681a30de1fSmrg    i*86:OS/2:*:*)
10691a30de1fSmrg	# If we were able to find `uname', then EMX Unix compatibility
10701a30de1fSmrg	# is probably installed.
1071423b239cSmrg	echo "$UNAME_MACHINE"-pc-os2-emx
10721a30de1fSmrg	exit ;;
10731a30de1fSmrg    i*86:XTS-300:*:STOP)
1074423b239cSmrg	echo "$UNAME_MACHINE"-unknown-stop
10751a30de1fSmrg	exit ;;
10761a30de1fSmrg    i*86:atheos:*:*)
1077423b239cSmrg	echo "$UNAME_MACHINE"-unknown-atheos
10781a30de1fSmrg	exit ;;
10791a30de1fSmrg    i*86:syllable:*:*)
1080423b239cSmrg	echo "$UNAME_MACHINE"-pc-syllable
10811a30de1fSmrg	exit ;;
1082ce62200cSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1083423b239cSmrg	echo i386-unknown-lynxos"$UNAME_RELEASE"
10841a30de1fSmrg	exit ;;
10851a30de1fSmrg    i*86:*DOS:*:*)
1086423b239cSmrg	echo "$UNAME_MACHINE"-pc-msdosdjgpp
10871a30de1fSmrg	exit ;;
1088423b239cSmrg    i*86:*:4.*:*)
1089423b239cSmrg	UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
10901a30de1fSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1091423b239cSmrg		echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
10921a30de1fSmrg	else
1093423b239cSmrg		echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
10941a30de1fSmrg	fi
10951a30de1fSmrg	exit ;;
10961a30de1fSmrg    i*86:*:5:[678]*)
1097a733a5bfSmrg	# UnixWare 7.x, OpenUNIX and OpenServer 6.
10981a30de1fSmrg	case `/bin/uname -X | grep "^Machine"` in
10991a30de1fSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
11001a30de1fSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
11011a30de1fSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
11021a30de1fSmrg	esac
1103423b239cSmrg	echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
11041a30de1fSmrg	exit ;;
11051a30de1fSmrg    i*86:*:3.2:*)
11061a30de1fSmrg	if test -f /usr/options/cb.name; then
11071a30de1fSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1108423b239cSmrg		echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
11091a30de1fSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
11101a30de1fSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
11111a30de1fSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
11121a30de1fSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
11131a30de1fSmrg			&& UNAME_MACHINE=i586
11141a30de1fSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
11151a30de1fSmrg			&& UNAME_MACHINE=i686
11161a30de1fSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
11171a30de1fSmrg			&& UNAME_MACHINE=i686
1118423b239cSmrg		echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
11191a30de1fSmrg	else
1120423b239cSmrg		echo "$UNAME_MACHINE"-pc-sysv32
11211a30de1fSmrg	fi
11221a30de1fSmrg	exit ;;
11231a30de1fSmrg    pc:*:*:*)
11241a30de1fSmrg	# Left here for compatibility:
1125a733a5bfSmrg	# uname -m prints for DJGPP always 'pc', but it prints nothing about
1126a733a5bfSmrg	# the processor, so we play safe by assuming i586.
1127b7fb5eacSmrg	# Note: whatever this is, it MUST be the same as what config.sub
1128423b239cSmrg	# prints for the "djgpp" host, or else GDB configure will decide that
1129b7fb5eacSmrg	# this is a cross-build.
1130b7fb5eacSmrg	echo i586-pc-msdosdjgpp
1131a733a5bfSmrg	exit ;;
11321a30de1fSmrg    Intel:Mach:3*:*)
11331a30de1fSmrg	echo i386-pc-mach3
11341a30de1fSmrg	exit ;;
11351a30de1fSmrg    paragon:*:*:*)
11361a30de1fSmrg	echo i860-intel-osf1
11371a30de1fSmrg	exit ;;
11381a30de1fSmrg    i860:*:4.*:*) # i860-SVR4
11391a30de1fSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1140423b239cSmrg	  echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
11411a30de1fSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
1142423b239cSmrg	  echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
11431a30de1fSmrg	fi
11441a30de1fSmrg	exit ;;
11451a30de1fSmrg    mini*:CTIX:SYS*5:*)
11461a30de1fSmrg	# "miniframe"
11471a30de1fSmrg	echo m68010-convergent-sysv
11481a30de1fSmrg	exit ;;
11491a30de1fSmrg    mc68k:UNIX:SYSTEM5:3.51m)
11501a30de1fSmrg	echo m68k-convergent-sysv
11511a30de1fSmrg	exit ;;
11521a30de1fSmrg    M680?0:D-NIX:5.3:*)
11531a30de1fSmrg	echo m68k-diab-dnix
11541a30de1fSmrg	exit ;;
11551a30de1fSmrg    M68*:*:R3V[5678]*:*)
11561a30de1fSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
11571a30de1fSmrg    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)
11581a30de1fSmrg	OS_REL=''
11591a30de1fSmrg	test -r /etc/.relid \
11601a30de1fSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
11611a30de1fSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1162423b239cSmrg	  && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
11631a30de1fSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1164423b239cSmrg	  && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11651a30de1fSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1166a733a5bfSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1167a733a5bfSmrg	  && { echo i486-ncr-sysv4; exit; } ;;
1168b7fb5eacSmrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1169b7fb5eacSmrg	OS_REL='.3'
1170b7fb5eacSmrg	test -r /etc/.relid \
1171b7fb5eacSmrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1172b7fb5eacSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1173423b239cSmrg	    && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1174b7fb5eacSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1175423b239cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1176b7fb5eacSmrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1177423b239cSmrg	    && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
11781a30de1fSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1179423b239cSmrg	echo m68k-unknown-lynxos"$UNAME_RELEASE"
11801a30de1fSmrg	exit ;;
11811a30de1fSmrg    mc68030:UNIX_System_V:4.*:*)
11821a30de1fSmrg	echo m68k-atari-sysv4
11831a30de1fSmrg	exit ;;
11841a30de1fSmrg    TSUNAMI:LynxOS:2.*:*)
1185423b239cSmrg	echo sparc-unknown-lynxos"$UNAME_RELEASE"
11861a30de1fSmrg	exit ;;
11871a30de1fSmrg    rs6000:LynxOS:2.*:*)
1188423b239cSmrg	echo rs6000-unknown-lynxos"$UNAME_RELEASE"
11891a30de1fSmrg	exit ;;
1190ce62200cSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1191423b239cSmrg	echo powerpc-unknown-lynxos"$UNAME_RELEASE"
11921a30de1fSmrg	exit ;;
11931a30de1fSmrg    SM[BE]S:UNIX_SV:*:*)
1194423b239cSmrg	echo mips-dde-sysv"$UNAME_RELEASE"
11951a30de1fSmrg	exit ;;
11961a30de1fSmrg    RM*:ReliantUNIX-*:*:*)
11971a30de1fSmrg	echo mips-sni-sysv4
11981a30de1fSmrg	exit ;;
11991a30de1fSmrg    RM*:SINIX-*:*:*)
12001a30de1fSmrg	echo mips-sni-sysv4
12011a30de1fSmrg	exit ;;
12021a30de1fSmrg    *:SINIX-*:*:*)
12031a30de1fSmrg	if uname -p 2>/dev/null >/dev/null ; then
12041a30de1fSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1205423b239cSmrg		echo "$UNAME_MACHINE"-sni-sysv4
12061a30de1fSmrg	else
12071a30de1fSmrg		echo ns32k-sni-sysv
12081a30de1fSmrg	fi
12091a30de1fSmrg	exit ;;
1210a733a5bfSmrg    PENTIUM:*:4.0*:*)	# Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1211a733a5bfSmrg			# says <Richard.M.Bartel@ccMail.Census.GOV>
1212a733a5bfSmrg	echo i586-unisys-sysv4
1213a733a5bfSmrg	exit ;;
12141a30de1fSmrg    *:UNIX_System_V:4*:FTX*)
12151a30de1fSmrg	# From Gerald Hewes <hewes@openmarket.com>.
12161a30de1fSmrg	# How about differentiating between stratus architectures? -djm
12171a30de1fSmrg	echo hppa1.1-stratus-sysv4
12181a30de1fSmrg	exit ;;
12191a30de1fSmrg    *:*:*:FTX*)
12201a30de1fSmrg	# From seanf@swdc.stratus.com.
12211a30de1fSmrg	echo i860-stratus-sysv4
12221a30de1fSmrg	exit ;;
12231a30de1fSmrg    i*86:VOS:*:*)
12241a30de1fSmrg	# From Paul.Green@stratus.com.
1225423b239cSmrg	echo "$UNAME_MACHINE"-stratus-vos
12261a30de1fSmrg	exit ;;
12271a30de1fSmrg    *:VOS:*:*)
12281a30de1fSmrg	# From Paul.Green@stratus.com.
12291a30de1fSmrg	echo hppa1.1-stratus-vos
12301a30de1fSmrg	exit ;;
12311a30de1fSmrg    mc68*:A/UX:*:*)
1232423b239cSmrg	echo m68k-apple-aux"$UNAME_RELEASE"
12331a30de1fSmrg	exit ;;
12341a30de1fSmrg    news*:NEWS-OS:6*:*)
12351a30de1fSmrg	echo mips-sony-newsos6
12361a30de1fSmrg	exit ;;
12371a30de1fSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
12381a30de1fSmrg	if [ -d /usr/nec ]; then
1239423b239cSmrg		echo mips-nec-sysv"$UNAME_RELEASE"
12401a30de1fSmrg	else
1241423b239cSmrg		echo mips-unknown-sysv"$UNAME_RELEASE"
12421a30de1fSmrg	fi
1243a733a5bfSmrg	exit ;;
12441a30de1fSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
12451a30de1fSmrg	echo powerpc-be-beos
12461a30de1fSmrg	exit ;;
12471a30de1fSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
12481a30de1fSmrg	echo powerpc-apple-beos
12491a30de1fSmrg	exit ;;
12501a30de1fSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
12511a30de1fSmrg	echo i586-pc-beos
12521a30de1fSmrg	exit ;;
1253b7fb5eacSmrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
1254b7fb5eacSmrg	echo i586-pc-haiku
1255b7fb5eacSmrg	exit ;;
1256a733a5bfSmrg    x86_64:Haiku:*:*)
1257a733a5bfSmrg	echo x86_64-unknown-haiku
1258a733a5bfSmrg	exit ;;
12591a30de1fSmrg    SX-4:SUPER-UX:*:*)
1260423b239cSmrg	echo sx4-nec-superux"$UNAME_RELEASE"
12611a30de1fSmrg	exit ;;
12621a30de1fSmrg    SX-5:SUPER-UX:*:*)
1263423b239cSmrg	echo sx5-nec-superux"$UNAME_RELEASE"
12641a30de1fSmrg	exit ;;
12651a30de1fSmrg    SX-6:SUPER-UX:*:*)
1266423b239cSmrg	echo sx6-nec-superux"$UNAME_RELEASE"
12671a30de1fSmrg	exit ;;
1268b7fb5eacSmrg    SX-7:SUPER-UX:*:*)
1269423b239cSmrg	echo sx7-nec-superux"$UNAME_RELEASE"
1270b7fb5eacSmrg	exit ;;
1271b7fb5eacSmrg    SX-8:SUPER-UX:*:*)
1272423b239cSmrg	echo sx8-nec-superux"$UNAME_RELEASE"
1273b7fb5eacSmrg	exit ;;
1274b7fb5eacSmrg    SX-8R:SUPER-UX:*:*)
1275423b239cSmrg	echo sx8r-nec-superux"$UNAME_RELEASE"
1276423b239cSmrg	exit ;;
1277423b239cSmrg    SX-ACE:SUPER-UX:*:*)
1278423b239cSmrg	echo sxace-nec-superux"$UNAME_RELEASE"
1279b7fb5eacSmrg	exit ;;
12801a30de1fSmrg    Power*:Rhapsody:*:*)
1281423b239cSmrg	echo powerpc-apple-rhapsody"$UNAME_RELEASE"
12821a30de1fSmrg	exit ;;
12831a30de1fSmrg    *:Rhapsody:*:*)
1284423b239cSmrg	echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
12851a30de1fSmrg	exit ;;
12861a30de1fSmrg    *:Darwin:*:*)
12871a30de1fSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1288423b239cSmrg	eval "$set_cc_for_build"
1289a733a5bfSmrg	if test "$UNAME_PROCESSOR" = unknown ; then
1290a733a5bfSmrg	    UNAME_PROCESSOR=powerpc
1291a733a5bfSmrg	fi
1292423b239cSmrg	if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
1293423b239cSmrg	    if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
12941b983734Smrg		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1295423b239cSmrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1296423b239cSmrg		       grep IS_64BIT_ARCH >/dev/null
12971b983734Smrg		then
12981b983734Smrg		    case $UNAME_PROCESSOR in
12991b983734Smrg			i386) UNAME_PROCESSOR=x86_64 ;;
13001b983734Smrg			powerpc) UNAME_PROCESSOR=powerpc64 ;;
13011b983734Smrg		    esac
13021b983734Smrg		fi
1303423b239cSmrg		# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
1304423b239cSmrg		if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
1305423b239cSmrg		       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
1306423b239cSmrg		       grep IS_PPC >/dev/null
1307423b239cSmrg		then
1308423b239cSmrg		    UNAME_PROCESSOR=powerpc
1309423b239cSmrg		fi
1310a733a5bfSmrg	    fi
13111b983734Smrg	elif test "$UNAME_PROCESSOR" = i386 ; then
13121b983734Smrg	    # Avoid executing cc on OS X 10.9, as it ships with a stub
13131b983734Smrg	    # that puts up a graphical alert prompting to install
13141b983734Smrg	    # developer tools.  Any system running Mac OS X 10.7 or
13151b983734Smrg	    # later (Darwin 11 and later) is required to have a 64-bit
13161b983734Smrg	    # processor. This is not true of the ARM version of Darwin
13171b983734Smrg	    # that Apple uses in portable devices.
13181b983734Smrg	    UNAME_PROCESSOR=x86_64
1319a733a5bfSmrg	fi
1320423b239cSmrg	echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
13211a30de1fSmrg	exit ;;
13221a30de1fSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
13231a30de1fSmrg	UNAME_PROCESSOR=`uname -p`
1324423b239cSmrg	if test "$UNAME_PROCESSOR" = x86; then
13251a30de1fSmrg		UNAME_PROCESSOR=i386
13261a30de1fSmrg		UNAME_MACHINE=pc
13271a30de1fSmrg	fi
1328423b239cSmrg	echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
13291a30de1fSmrg	exit ;;
13301a30de1fSmrg    *:QNX:*:4*)
13311a30de1fSmrg	echo i386-pc-qnx
13321a30de1fSmrg	exit ;;
1333423b239cSmrg    NEO-*:NONSTOP_KERNEL:*:*)
1334423b239cSmrg	echo neo-tandem-nsk"$UNAME_RELEASE"
1335a733a5bfSmrg	exit ;;
1336a733a5bfSmrg    NSE-*:NONSTOP_KERNEL:*:*)
1337423b239cSmrg	echo nse-tandem-nsk"$UNAME_RELEASE"
1338423b239cSmrg	exit ;;
1339423b239cSmrg    NSR-*:NONSTOP_KERNEL:*:*)
1340423b239cSmrg	echo nsr-tandem-nsk"$UNAME_RELEASE"
13411a30de1fSmrg	exit ;;
1342423b239cSmrg    NSV-*:NONSTOP_KERNEL:*:*)
1343423b239cSmrg	echo nsv-tandem-nsk"$UNAME_RELEASE"
1344423b239cSmrg	exit ;;
1345423b239cSmrg    NSX-*:NONSTOP_KERNEL:*:*)
1346423b239cSmrg	echo nsx-tandem-nsk"$UNAME_RELEASE"
13471a30de1fSmrg	exit ;;
13481a30de1fSmrg    *:NonStop-UX:*:*)
13491a30de1fSmrg	echo mips-compaq-nonstopux
13501a30de1fSmrg	exit ;;
13511a30de1fSmrg    BS2000:POSIX*:*:*)
13521a30de1fSmrg	echo bs2000-siemens-sysv
13531a30de1fSmrg	exit ;;
13541a30de1fSmrg    DS/*:UNIX_System_V:*:*)
1355423b239cSmrg	echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
13561a30de1fSmrg	exit ;;
13571a30de1fSmrg    *:Plan9:*:*)
13581a30de1fSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
13591a30de1fSmrg	# is converted to i386 for consistency with other x86
13601a30de1fSmrg	# operating systems.
1361423b239cSmrg	if test "$cputype" = 386; then
13621a30de1fSmrg	    UNAME_MACHINE=i386
13631a30de1fSmrg	else
13641a30de1fSmrg	    UNAME_MACHINE="$cputype"
13651a30de1fSmrg	fi
1366423b239cSmrg	echo "$UNAME_MACHINE"-unknown-plan9
13671a30de1fSmrg	exit ;;
13681a30de1fSmrg    *:TOPS-10:*:*)
13691a30de1fSmrg	echo pdp10-unknown-tops10
13701a30de1fSmrg	exit ;;
13711a30de1fSmrg    *:TENEX:*:*)
13721a30de1fSmrg	echo pdp10-unknown-tenex
13731a30de1fSmrg	exit ;;
13741a30de1fSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
13751a30de1fSmrg	echo pdp10-dec-tops20
13761a30de1fSmrg	exit ;;
13771a30de1fSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
13781a30de1fSmrg	echo pdp10-xkl-tops20
13791a30de1fSmrg	exit ;;
13801a30de1fSmrg    *:TOPS-20:*:*)
13811a30de1fSmrg	echo pdp10-unknown-tops20
13821a30de1fSmrg	exit ;;
13831a30de1fSmrg    *:ITS:*:*)
13841a30de1fSmrg	echo pdp10-unknown-its
13851a30de1fSmrg	exit ;;
13861a30de1fSmrg    SEI:*:*:SEIUX)
1387423b239cSmrg	echo mips-sei-seiux"$UNAME_RELEASE"
13881a30de1fSmrg	exit ;;
13891a30de1fSmrg    *:DragonFly:*:*)
1390423b239cSmrg	echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
13911a30de1fSmrg	exit ;;
13921a30de1fSmrg    *:*VMS:*:*)
1393a733a5bfSmrg	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1394423b239cSmrg	case "$UNAME_MACHINE" in
13951a30de1fSmrg	    A*) echo alpha-dec-vms ; exit ;;
13961a30de1fSmrg	    I*) echo ia64-dec-vms ; exit ;;
13971a30de1fSmrg	    V*) echo vax-dec-vms ; exit ;;
13981a30de1fSmrg	esac ;;
13991a30de1fSmrg    *:XENIX:*:SysV)
14001a30de1fSmrg	echo i386-pc-xenix
14011a30de1fSmrg	exit ;;
14021a30de1fSmrg    i*86:skyos:*:*)
1403423b239cSmrg	echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
14041a30de1fSmrg	exit ;;
14051a30de1fSmrg    i*86:rdos:*:*)
1406423b239cSmrg	echo "$UNAME_MACHINE"-pc-rdos
14071a30de1fSmrg	exit ;;
1408b7fb5eacSmrg    i*86:AROS:*:*)
1409423b239cSmrg	echo "$UNAME_MACHINE"-pc-aros
1410b7fb5eacSmrg	exit ;;
1411a733a5bfSmrg    x86_64:VMkernel:*:*)
1412423b239cSmrg	echo "$UNAME_MACHINE"-unknown-esx
1413423b239cSmrg	exit ;;
1414423b239cSmrg    amd64:Isilon\ OneFS:*:*)
1415423b239cSmrg	echo x86_64-unknown-onefs
1416a733a5bfSmrg	exit ;;
14171a30de1fSmrgesac
14181a30de1fSmrg
1419423b239cSmrgecho "$0: unable to guess system type" >&2
1420423b239cSmrg
1421423b239cSmrgcase "$UNAME_MACHINE:$UNAME_SYSTEM" in
1422423b239cSmrg    mips:Linux | mips64:Linux)
1423423b239cSmrg	# If we got here on MIPS GNU/Linux, output extra information.
1424423b239cSmrg	cat >&2 <<EOF
1425423b239cSmrg
1426423b239cSmrgNOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
1427423b239cSmrgthe system type. Please install a C compiler and try again.
1428423b239cSmrgEOF
1429423b239cSmrg	;;
1430423b239cSmrgesac
1431423b239cSmrg
14321a30de1fSmrgcat >&2 <<EOF
14331a30de1fSmrg
1434423b239cSmrgThis script (version $timestamp), has failed to recognize the
1435423b239cSmrgoperating system you are using. If your script is old, overwrite *all*
1436423b239cSmrgcopies of config.guess and config.sub with the latest versions from:
14371a30de1fSmrg
1438423b239cSmrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
14391a30de1fSmrgand
1440423b239cSmrg  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
14411a30de1fSmrg
1442423b239cSmrgIf $0 has already been updated, send the following data and any
1443423b239cSmrginformation you think might be pertinent to config-patches@gnu.org to
1444423b239cSmrgprovide the necessary information to handle your system.
14451a30de1fSmrg
14461a30de1fSmrgconfig.guess timestamp = $timestamp
14471a30de1fSmrg
14481a30de1fSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
14491a30de1fSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
14501a30de1fSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
14511a30de1fSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
14521a30de1fSmrg
14531a30de1fSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
14541a30de1fSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
14551a30de1fSmrg
14561a30de1fSmrghostinfo               = `(hostinfo) 2>/dev/null`
14571a30de1fSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
14581a30de1fSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
14591a30de1fSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
14601a30de1fSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
14611a30de1fSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
14621a30de1fSmrg
1463423b239cSmrgUNAME_MACHINE = "$UNAME_MACHINE"
1464423b239cSmrgUNAME_RELEASE = "$UNAME_RELEASE"
1465423b239cSmrgUNAME_SYSTEM  = "$UNAME_SYSTEM"
1466423b239cSmrgUNAME_VERSION = "$UNAME_VERSION"
14671a30de1fSmrgEOF
14681a30de1fSmrg
14691a30de1fSmrgexit 1
14701a30de1fSmrg
14711a30de1fSmrg# Local variables:
1472423b239cSmrg# eval: (add-hook 'write-file-functions 'time-stamp)
14731a30de1fSmrg# time-stamp-start: "timestamp='"
14741a30de1fSmrg# time-stamp-format: "%:y-%02m-%02d"
14751a30de1fSmrg# time-stamp-end: "'"
14761a30de1fSmrg# End:
1477