xref: /openbsd-src/gnu/lib/libstdc++/config.guess (revision fe696217b7faed623d31a3c2f8af0e510b49e8c5)
103a78d15Sespie#! /bin/sh
203a78d15Sespie# Attempt to guess a canonical system name.
303a78d15Sespie#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
403a78d15Sespie#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
503a78d15Sespie
603a78d15Sespietimestamp='2003-01-30'
703a78d15Sespie
803a78d15Sespie# This file is free software; you can redistribute it and/or modify it
903a78d15Sespie# under the terms of the GNU General Public License as published by
1003a78d15Sespie# the Free Software Foundation; either version 2 of the License, or
1103a78d15Sespie# (at your option) any later version.
1203a78d15Sespie#
1303a78d15Sespie# This program is distributed in the hope that it will be useful, but
1403a78d15Sespie# WITHOUT ANY WARRANTY; without even the implied warranty of
1503a78d15Sespie# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
1603a78d15Sespie# General Public License for more details.
1703a78d15Sespie#
1803a78d15Sespie# You should have received a copy of the GNU General Public License
1903a78d15Sespie# along with this program; if not, write to the Free Software
2003a78d15Sespie# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2103a78d15Sespie#
2203a78d15Sespie# As a special exception to the GNU General Public License, if you
2303a78d15Sespie# distribute this file as part of a program that contains a
2403a78d15Sespie# configuration script generated by Autoconf, you may include it under
2503a78d15Sespie# the same distribution terms that you use for the rest of that program.
2603a78d15Sespie
2703a78d15Sespie# Originally written by Per Bothner <per@bothner.com>.
2803a78d15Sespie# Please send patches to <config-patches@gnu.org>.  Submit a context
2903a78d15Sespie# diff and a properly formatted ChangeLog entry.
3003a78d15Sespie#
3103a78d15Sespie# This script attempts to guess a canonical system name similar to
3203a78d15Sespie# config.sub.  If it succeeds, it prints the system name on stdout, and
3303a78d15Sespie# exits with 0.  Otherwise, it exits with 1.
3403a78d15Sespie#
3503a78d15Sespie# The plan is that this can be called by configure scripts if you
3603a78d15Sespie# don't specify an explicit build system type.
3703a78d15Sespie
3803a78d15Sespieme=`echo "$0" | sed -e 's,.*/,,'`
3903a78d15Sespie
4003a78d15Sespieusage="\
4103a78d15SespieUsage: $0 [OPTION]
4203a78d15Sespie
4303a78d15SespieOutput the configuration name of the system \`$me' is run on.
4403a78d15Sespie
4503a78d15SespieOperation modes:
4603a78d15Sespie  -h, --help         print this help, then exit
4703a78d15Sespie  -t, --time-stamp   print date of last modification, then exit
4803a78d15Sespie  -v, --version      print version number, then exit
4903a78d15Sespie
5003a78d15SespieReport bugs and patches to <config-patches@gnu.org>."
5103a78d15Sespie
5203a78d15Sespieversion="\
5303a78d15SespieGNU config.guess ($timestamp)
5403a78d15Sespie
5503a78d15SespieOriginally written by Per Bothner.
5603a78d15SespieCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
5703a78d15SespieFree Software Foundation, Inc.
5803a78d15Sespie
5903a78d15SespieThis is free software; see the source for copying conditions.  There is NO
6003a78d15Sespiewarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
6103a78d15Sespie
6203a78d15Sespiehelp="
6303a78d15SespieTry \`$me --help' for more information."
6403a78d15Sespie
6503a78d15Sespie# Parse command line
6603a78d15Sespiewhile test $# -gt 0 ; do
6703a78d15Sespie  case $1 in
6803a78d15Sespie    --time-stamp | --time* | -t )
6903a78d15Sespie       echo "$timestamp" ; exit 0 ;;
7003a78d15Sespie    --version | -v )
7103a78d15Sespie       echo "$version" ; exit 0 ;;
7203a78d15Sespie    --help | --h* | -h )
7303a78d15Sespie       echo "$usage"; exit 0 ;;
7403a78d15Sespie    -- )     # Stop option processing
7503a78d15Sespie       shift; break ;;
7603a78d15Sespie    - )	# Use stdin as input.
7703a78d15Sespie       break ;;
7803a78d15Sespie    -* )
7903a78d15Sespie       echo "$me: invalid option $1$help" >&2
8003a78d15Sespie       exit 1 ;;
8103a78d15Sespie    * )
8203a78d15Sespie       break ;;
8303a78d15Sespie  esac
8403a78d15Sespiedone
8503a78d15Sespie
8603a78d15Sespieif test $# != 0; then
8703a78d15Sespie  echo "$me: too many arguments$help" >&2
8803a78d15Sespie  exit 1
8903a78d15Sespiefi
9003a78d15Sespie
9103a78d15Sespietrap 'exit 1' 1 2 15
9203a78d15Sespie
9303a78d15Sespie# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
9403a78d15Sespie# compiler to aid in system detection is discouraged as it requires
9503a78d15Sespie# temporary files to be created and, as you can see below, it is a
9603a78d15Sespie# headache to deal with in a portable fashion.
9703a78d15Sespie
9803a78d15Sespie# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
9903a78d15Sespie# use `HOST_CC' if defined, but it is deprecated.
10003a78d15Sespie
10103a78d15Sespie# Portable tmp directory creation inspired by the Autoconf team.
10203a78d15Sespie
10303a78d15Sespieset_cc_for_build='
10403a78d15Sespietrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
10503a78d15Sespietrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
10603a78d15Sespie: ${TMPDIR=/tmp} ;
10703a78d15Sespie { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
10803a78d15Sespie { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
10903a78d15Sespie { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
11003a78d15Sespiedummy=$tmp/dummy ;
11103a78d15Sespietmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
11203a78d15Sespiecase $CC_FOR_BUILD,$HOST_CC,$CC in
11303a78d15Sespie ,,)    echo "int x;" > $dummy.c ;
11403a78d15Sespie	for c in cc gcc c89 c99 ; do
11503a78d15Sespie	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
11603a78d15Sespie	     CC_FOR_BUILD="$c"; break ;
11703a78d15Sespie	  fi ;
11803a78d15Sespie	done ;
11903a78d15Sespie	if test x"$CC_FOR_BUILD" = x ; then
12003a78d15Sespie	  CC_FOR_BUILD=no_compiler_found ;
12103a78d15Sespie	fi
12203a78d15Sespie	;;
12303a78d15Sespie ,,*)   CC_FOR_BUILD=$CC ;;
12403a78d15Sespie ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
12503a78d15Sespieesac ;'
12603a78d15Sespie
12703a78d15Sespie# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
12803a78d15Sespie# (ghazi@noc.rutgers.edu 1994-08-24)
12903a78d15Sespieif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
13003a78d15Sespie	PATH=$PATH:/.attbin ; export PATH
13103a78d15Sespiefi
13203a78d15Sespie
13303a78d15SespieUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
13403a78d15SespieUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
13503a78d15SespieUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
13603a78d15SespieUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
13703a78d15Sespie
13803a78d15Sespie# Note: order is significant - the case branches are not exclusive.
13903a78d15Sespie
14003a78d15Sespiecase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
14103a78d15Sespie    *:NetBSD:*:*)
14203a78d15Sespie	# NetBSD (nbsd) targets should (where applicable) match one or
14303a78d15Sespie	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
14403a78d15Sespie	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
14503a78d15Sespie	# switched to ELF, *-*-netbsd* would select the old
14603a78d15Sespie	# object file format.  This provides both forward
14703a78d15Sespie	# compatibility and a consistent mechanism for selecting the
14803a78d15Sespie	# object file format.
14903a78d15Sespie	#
15003a78d15Sespie	# Note: NetBSD doesn't particularly care about the vendor
15103a78d15Sespie	# portion of the name.  We always set it to "unknown".
15203a78d15Sespie	sysctl="sysctl -n hw.machine_arch"
15303a78d15Sespie	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
15403a78d15Sespie	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
15503a78d15Sespie	case "${UNAME_MACHINE_ARCH}" in
15603a78d15Sespie	    armeb) machine=armeb-unknown ;;
15703a78d15Sespie	    arm*) machine=arm-unknown ;;
15803a78d15Sespie	    sh3el) machine=shl-unknown ;;
15903a78d15Sespie	    sh3eb) machine=sh-unknown ;;
16003a78d15Sespie	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
16103a78d15Sespie	esac
16203a78d15Sespie	# The Operating System including object format, if it has switched
16303a78d15Sespie	# to ELF recently, or will in the future.
16403a78d15Sespie	case "${UNAME_MACHINE_ARCH}" in
16503a78d15Sespie	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
16603a78d15Sespie		eval $set_cc_for_build
16703a78d15Sespie		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
16803a78d15Sespie			| grep __ELF__ >/dev/null
16903a78d15Sespie		then
17003a78d15Sespie		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
17103a78d15Sespie		    # Return netbsd for either.  FIX?
17203a78d15Sespie		    os=netbsd
17303a78d15Sespie		else
17403a78d15Sespie		    os=netbsdelf
17503a78d15Sespie		fi
17603a78d15Sespie		;;
17703a78d15Sespie	    *)
17803a78d15Sespie	        os=netbsd
17903a78d15Sespie		;;
18003a78d15Sespie	esac
18103a78d15Sespie	# The OS release
18203a78d15Sespie	# Debian GNU/NetBSD machines have a different userland, and
18303a78d15Sespie	# thus, need a distinct triplet. However, they do not need
18403a78d15Sespie	# kernel version information, so it can be replaced with a
18503a78d15Sespie	# suitable tag, in the style of linux-gnu.
18603a78d15Sespie	case "${UNAME_VERSION}" in
18703a78d15Sespie	    Debian*)
18803a78d15Sespie		release='-gnu'
18903a78d15Sespie		;;
19003a78d15Sespie	    *)
19103a78d15Sespie		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
19203a78d15Sespie		;;
19303a78d15Sespie	esac
19403a78d15Sespie	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
19503a78d15Sespie	# contains redundant information, the shorter form:
19603a78d15Sespie	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
19703a78d15Sespie	echo "${machine}-${os}${release}"
19803a78d15Sespie	exit 0 ;;
19903a78d15Sespie    *:OpenBSD:*:*)
200*ee19cecdSbrad	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
201*ee19cecdSbrad	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
20203a78d15Sespie	exit 0 ;;
20303a78d15Sespie    *:MicroBSD:*:*)
20403a78d15Sespie	echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
20503a78d15Sespie	exit 0 ;;
20603a78d15Sespie    alpha:OSF1:*:*)
20703a78d15Sespie	if test $UNAME_RELEASE = "V4.0"; then
20803a78d15Sespie		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
20903a78d15Sespie	fi
21003a78d15Sespie	# According to Compaq, /usr/sbin/psrinfo has been available on
21103a78d15Sespie	# OSF/1 and Tru64 systems produced since 1995.  I hope that
21203a78d15Sespie	# covers most systems running today.  This code pipes the CPU
21303a78d15Sespie	# types through head -n 1, so we only detect the type of CPU 0.
21403a78d15Sespie	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
21503a78d15Sespie	case "$ALPHA_CPU_TYPE" in
21603a78d15Sespie	    "EV4 (21064)")
21703a78d15Sespie		UNAME_MACHINE="alpha" ;;
21803a78d15Sespie	    "EV4.5 (21064)")
21903a78d15Sespie		UNAME_MACHINE="alpha" ;;
22003a78d15Sespie	    "LCA4 (21066/21068)")
22103a78d15Sespie		UNAME_MACHINE="alpha" ;;
22203a78d15Sespie	    "EV5 (21164)")
22303a78d15Sespie		UNAME_MACHINE="alphaev5" ;;
22403a78d15Sespie	    "EV5.6 (21164A)")
22503a78d15Sespie		UNAME_MACHINE="alphaev56" ;;
22603a78d15Sespie	    "EV5.6 (21164PC)")
22703a78d15Sespie		UNAME_MACHINE="alphapca56" ;;
22803a78d15Sespie	    "EV5.7 (21164PC)")
22903a78d15Sespie		UNAME_MACHINE="alphapca57" ;;
23003a78d15Sespie	    "EV6 (21264)")
23103a78d15Sespie		UNAME_MACHINE="alphaev6" ;;
23203a78d15Sespie	    "EV6.7 (21264A)")
23303a78d15Sespie		UNAME_MACHINE="alphaev67" ;;
23403a78d15Sespie	    "EV6.8CB (21264C)")
23503a78d15Sespie		UNAME_MACHINE="alphaev68" ;;
23603a78d15Sespie	    "EV6.8AL (21264B)")
23703a78d15Sespie		UNAME_MACHINE="alphaev68" ;;
23803a78d15Sespie	    "EV6.8CX (21264D)")
23903a78d15Sespie		UNAME_MACHINE="alphaev68" ;;
24003a78d15Sespie	    "EV6.9A (21264/EV69A)")
24103a78d15Sespie		UNAME_MACHINE="alphaev69" ;;
24203a78d15Sespie	    "EV7 (21364)")
24303a78d15Sespie		UNAME_MACHINE="alphaev7" ;;
24403a78d15Sespie	    "EV7.9 (21364A)")
24503a78d15Sespie		UNAME_MACHINE="alphaev79" ;;
24603a78d15Sespie	esac
24703a78d15Sespie	# A Vn.n version is a released version.
24803a78d15Sespie	# A Tn.n version is a released field test version.
24903a78d15Sespie	# A Xn.n version is an unreleased experimental baselevel.
25003a78d15Sespie	# 1.2 uses "1.2" for uname -r.
25103a78d15Sespie	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
25203a78d15Sespie	exit 0 ;;
25303a78d15Sespie    Alpha\ *:Windows_NT*:*)
25403a78d15Sespie	# How do we know it's Interix rather than the generic POSIX subsystem?
25503a78d15Sespie	# Should we change UNAME_MACHINE based on the output of uname instead
25603a78d15Sespie	# of the specific Alpha model?
25703a78d15Sespie	echo alpha-pc-interix
25803a78d15Sespie	exit 0 ;;
25903a78d15Sespie    21064:Windows_NT:50:3)
26003a78d15Sespie	echo alpha-dec-winnt3.5
26103a78d15Sespie	exit 0 ;;
26203a78d15Sespie    Amiga*:UNIX_System_V:4.0:*)
26303a78d15Sespie	echo m68k-unknown-sysv4
26403a78d15Sespie	exit 0;;
26503a78d15Sespie    *:[Aa]miga[Oo][Ss]:*:*)
26603a78d15Sespie	echo ${UNAME_MACHINE}-unknown-amigaos
26703a78d15Sespie	exit 0 ;;
26803a78d15Sespie    *:[Mm]orph[Oo][Ss]:*:*)
26903a78d15Sespie	echo ${UNAME_MACHINE}-unknown-morphos
27003a78d15Sespie	exit 0 ;;
27103a78d15Sespie    *:OS/390:*:*)
27203a78d15Sespie	echo i370-ibm-openedition
27303a78d15Sespie	exit 0 ;;
27403a78d15Sespie    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
27503a78d15Sespie	echo arm-acorn-riscix${UNAME_RELEASE}
27603a78d15Sespie	exit 0;;
27703a78d15Sespie    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
27803a78d15Sespie	echo hppa1.1-hitachi-hiuxmpp
27903a78d15Sespie	exit 0;;
28003a78d15Sespie    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
28103a78d15Sespie	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
28203a78d15Sespie	if test "`(/bin/universe) 2>/dev/null`" = att ; then
28303a78d15Sespie		echo pyramid-pyramid-sysv3
28403a78d15Sespie	else
28503a78d15Sespie		echo pyramid-pyramid-bsd
28603a78d15Sespie	fi
28703a78d15Sespie	exit 0 ;;
28803a78d15Sespie    NILE*:*:*:dcosx)
28903a78d15Sespie	echo pyramid-pyramid-svr4
29003a78d15Sespie	exit 0 ;;
29103a78d15Sespie    DRS?6000:UNIX_SV:4.2*:7*)
29203a78d15Sespie	case `/usr/bin/uname -p` in
29303a78d15Sespie	    sparc) echo sparc-icl-nx7 && exit 0 ;;
29403a78d15Sespie	esac ;;
29503a78d15Sespie    sun4H:SunOS:5.*:*)
29603a78d15Sespie	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
29703a78d15Sespie	exit 0 ;;
29803a78d15Sespie    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
29903a78d15Sespie	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
30003a78d15Sespie	exit 0 ;;
30103a78d15Sespie    i86pc:SunOS:5.*:*)
30203a78d15Sespie	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
30303a78d15Sespie	exit 0 ;;
30403a78d15Sespie    sun4*:SunOS:6*:*)
30503a78d15Sespie	# According to config.sub, this is the proper way to canonicalize
30603a78d15Sespie	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
30703a78d15Sespie	# it's likely to be more like Solaris than SunOS4.
30803a78d15Sespie	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
30903a78d15Sespie	exit 0 ;;
31003a78d15Sespie    sun4*:SunOS:*:*)
31103a78d15Sespie	case "`/usr/bin/arch -k`" in
31203a78d15Sespie	    Series*|S4*)
31303a78d15Sespie		UNAME_RELEASE=`uname -v`
31403a78d15Sespie		;;
31503a78d15Sespie	esac
31603a78d15Sespie	# Japanese Language versions have a version number like `4.1.3-JL'.
31703a78d15Sespie	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
31803a78d15Sespie	exit 0 ;;
31903a78d15Sespie    sun3*:SunOS:*:*)
32003a78d15Sespie	echo m68k-sun-sunos${UNAME_RELEASE}
32103a78d15Sespie	exit 0 ;;
32203a78d15Sespie    sun*:*:4.2BSD:*)
32303a78d15Sespie	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
32403a78d15Sespie	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
32503a78d15Sespie	case "`/bin/arch`" in
32603a78d15Sespie	    sun3)
32703a78d15Sespie		echo m68k-sun-sunos${UNAME_RELEASE}
32803a78d15Sespie		;;
32903a78d15Sespie	    sun4)
33003a78d15Sespie		echo sparc-sun-sunos${UNAME_RELEASE}
33103a78d15Sespie		;;
33203a78d15Sespie	esac
33303a78d15Sespie	exit 0 ;;
33403a78d15Sespie    aushp:SunOS:*:*)
33503a78d15Sespie	echo sparc-auspex-sunos${UNAME_RELEASE}
33603a78d15Sespie	exit 0 ;;
33703a78d15Sespie    # The situation for MiNT is a little confusing.  The machine name
33803a78d15Sespie    # can be virtually everything (everything which is not
33903a78d15Sespie    # "atarist" or "atariste" at least should have a processor
34003a78d15Sespie    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
34103a78d15Sespie    # to the lowercase version "mint" (or "freemint").  Finally
34203a78d15Sespie    # the system name "TOS" denotes a system which is actually not
34303a78d15Sespie    # MiNT.  But MiNT is downward compatible to TOS, so this should
34403a78d15Sespie    # be no problem.
34503a78d15Sespie    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
34603a78d15Sespie        echo m68k-atari-mint${UNAME_RELEASE}
34703a78d15Sespie	exit 0 ;;
34803a78d15Sespie    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
34903a78d15Sespie	echo m68k-atari-mint${UNAME_RELEASE}
35003a78d15Sespie        exit 0 ;;
35103a78d15Sespie    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
35203a78d15Sespie        echo m68k-atari-mint${UNAME_RELEASE}
35303a78d15Sespie	exit 0 ;;
35403a78d15Sespie    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
35503a78d15Sespie        echo m68k-milan-mint${UNAME_RELEASE}
35603a78d15Sespie        exit 0 ;;
35703a78d15Sespie    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
35803a78d15Sespie        echo m68k-hades-mint${UNAME_RELEASE}
35903a78d15Sespie        exit 0 ;;
36003a78d15Sespie    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
36103a78d15Sespie        echo m68k-unknown-mint${UNAME_RELEASE}
36203a78d15Sespie        exit 0 ;;
36303a78d15Sespie    powerpc:machten:*:*)
36403a78d15Sespie	echo powerpc-apple-machten${UNAME_RELEASE}
36503a78d15Sespie	exit 0 ;;
36603a78d15Sespie    RISC*:Mach:*:*)
36703a78d15Sespie	echo mips-dec-mach_bsd4.3
36803a78d15Sespie	exit 0 ;;
36903a78d15Sespie    RISC*:ULTRIX:*:*)
37003a78d15Sespie	echo mips-dec-ultrix${UNAME_RELEASE}
37103a78d15Sespie	exit 0 ;;
37203a78d15Sespie    VAX*:ULTRIX*:*:*)
37303a78d15Sespie	echo vax-dec-ultrix${UNAME_RELEASE}
37403a78d15Sespie	exit 0 ;;
37503a78d15Sespie    2020:CLIX:*:* | 2430:CLIX:*:*)
37603a78d15Sespie	echo clipper-intergraph-clix${UNAME_RELEASE}
37703a78d15Sespie	exit 0 ;;
37803a78d15Sespie    mips:*:*:UMIPS | mips:*:*:RISCos)
37903a78d15Sespie	eval $set_cc_for_build
38003a78d15Sespie	sed 's/^	//' << EOF >$dummy.c
38103a78d15Sespie#ifdef __cplusplus
38203a78d15Sespie#include <stdio.h>  /* for printf() prototype */
38303a78d15Sespie	int main (int argc, char *argv[]) {
38403a78d15Sespie#else
38503a78d15Sespie	int main (argc, argv) int argc; char *argv[]; {
38603a78d15Sespie#endif
38703a78d15Sespie	#if defined (host_mips) && defined (MIPSEB)
38803a78d15Sespie	#if defined (SYSTYPE_SYSV)
38903a78d15Sespie	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
39003a78d15Sespie	#endif
39103a78d15Sespie	#if defined (SYSTYPE_SVR4)
39203a78d15Sespie	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
39303a78d15Sespie	#endif
39403a78d15Sespie	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
39503a78d15Sespie	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
39603a78d15Sespie	#endif
39703a78d15Sespie	#endif
39803a78d15Sespie	  exit (-1);
39903a78d15Sespie	}
40003a78d15SespieEOF
40103a78d15Sespie	$CC_FOR_BUILD -o $dummy $dummy.c \
40203a78d15Sespie	  && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
40303a78d15Sespie	  && exit 0
40403a78d15Sespie	echo mips-mips-riscos${UNAME_RELEASE}
40503a78d15Sespie	exit 0 ;;
40603a78d15Sespie    Motorola:PowerMAX_OS:*:*)
40703a78d15Sespie	echo powerpc-motorola-powermax
40803a78d15Sespie	exit 0 ;;
40903a78d15Sespie    Motorola:*:4.3:PL8-*)
41003a78d15Sespie	echo powerpc-harris-powermax
41103a78d15Sespie	exit 0 ;;
41203a78d15Sespie    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
41303a78d15Sespie	echo powerpc-harris-powermax
41403a78d15Sespie	exit 0 ;;
41503a78d15Sespie    Night_Hawk:Power_UNIX:*:*)
41603a78d15Sespie	echo powerpc-harris-powerunix
41703a78d15Sespie	exit 0 ;;
41803a78d15Sespie    m88k:CX/UX:7*:*)
41903a78d15Sespie	echo m88k-harris-cxux7
42003a78d15Sespie	exit 0 ;;
42103a78d15Sespie    m88k:*:4*:R4*)
42203a78d15Sespie	echo m88k-motorola-sysv4
42303a78d15Sespie	exit 0 ;;
42403a78d15Sespie    m88k:*:3*:R3*)
42503a78d15Sespie	echo m88k-motorola-sysv3
42603a78d15Sespie	exit 0 ;;
42703a78d15Sespie    AViiON:dgux:*:*)
42803a78d15Sespie        # DG/UX returns AViiON for all architectures
42903a78d15Sespie        UNAME_PROCESSOR=`/usr/bin/uname -p`
43003a78d15Sespie	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
43103a78d15Sespie	then
43203a78d15Sespie	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
43303a78d15Sespie	       [ ${TARGET_BINARY_INTERFACE}x = x ]
43403a78d15Sespie	    then
43503a78d15Sespie		echo m88k-dg-dgux${UNAME_RELEASE}
43603a78d15Sespie	    else
43703a78d15Sespie		echo m88k-dg-dguxbcs${UNAME_RELEASE}
43803a78d15Sespie	    fi
43903a78d15Sespie	else
44003a78d15Sespie	    echo i586-dg-dgux${UNAME_RELEASE}
44103a78d15Sespie	fi
44203a78d15Sespie 	exit 0 ;;
44303a78d15Sespie    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
44403a78d15Sespie	echo m88k-dolphin-sysv3
44503a78d15Sespie	exit 0 ;;
44603a78d15Sespie    M88*:*:R3*:*)
44703a78d15Sespie	# Delta 88k system running SVR3
44803a78d15Sespie	echo m88k-motorola-sysv3
44903a78d15Sespie	exit 0 ;;
45003a78d15Sespie    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
45103a78d15Sespie	echo m88k-tektronix-sysv3
45203a78d15Sespie	exit 0 ;;
45303a78d15Sespie    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
45403a78d15Sespie	echo m68k-tektronix-bsd
45503a78d15Sespie	exit 0 ;;
45603a78d15Sespie    *:IRIX*:*:*)
45703a78d15Sespie	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
45803a78d15Sespie	exit 0 ;;
45903a78d15Sespie    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
46003a78d15Sespie	echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
46103a78d15Sespie	exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
46203a78d15Sespie    i*86:AIX:*:*)
46303a78d15Sespie	echo i386-ibm-aix
46403a78d15Sespie	exit 0 ;;
46503a78d15Sespie    ia64:AIX:*:*)
46603a78d15Sespie	if [ -x /usr/bin/oslevel ] ; then
46703a78d15Sespie		IBM_REV=`/usr/bin/oslevel`
46803a78d15Sespie	else
46903a78d15Sespie		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
47003a78d15Sespie	fi
47103a78d15Sespie	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
47203a78d15Sespie	exit 0 ;;
47303a78d15Sespie    *:AIX:2:3)
47403a78d15Sespie	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
47503a78d15Sespie		eval $set_cc_for_build
47603a78d15Sespie		sed 's/^		//' << EOF >$dummy.c
47703a78d15Sespie		#include <sys/systemcfg.h>
47803a78d15Sespie
47903a78d15Sespie		main()
48003a78d15Sespie			{
48103a78d15Sespie			if (!__power_pc())
48203a78d15Sespie				exit(1);
48303a78d15Sespie			puts("powerpc-ibm-aix3.2.5");
48403a78d15Sespie			exit(0);
48503a78d15Sespie			}
48603a78d15SespieEOF
48703a78d15Sespie		$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
48803a78d15Sespie		echo rs6000-ibm-aix3.2.5
48903a78d15Sespie	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
49003a78d15Sespie		echo rs6000-ibm-aix3.2.4
49103a78d15Sespie	else
49203a78d15Sespie		echo rs6000-ibm-aix3.2
49303a78d15Sespie	fi
49403a78d15Sespie	exit 0 ;;
49503a78d15Sespie    *:AIX:*:[45])
49603a78d15Sespie	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
49703a78d15Sespie	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
49803a78d15Sespie		IBM_ARCH=rs6000
49903a78d15Sespie	else
50003a78d15Sespie		IBM_ARCH=powerpc
50103a78d15Sespie	fi
50203a78d15Sespie	if [ -x /usr/bin/oslevel ] ; then
50303a78d15Sespie		IBM_REV=`/usr/bin/oslevel`
50403a78d15Sespie	else
50503a78d15Sespie		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
50603a78d15Sespie	fi
50703a78d15Sespie	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
50803a78d15Sespie	exit 0 ;;
50903a78d15Sespie    *:AIX:*:*)
51003a78d15Sespie	echo rs6000-ibm-aix
51103a78d15Sespie	exit 0 ;;
51203a78d15Sespie    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
51303a78d15Sespie	echo romp-ibm-bsd4.4
51403a78d15Sespie	exit 0 ;;
51503a78d15Sespie    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
51603a78d15Sespie	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
51703a78d15Sespie	exit 0 ;;                           # report: romp-ibm BSD 4.3
51803a78d15Sespie    *:BOSX:*:*)
51903a78d15Sespie	echo rs6000-bull-bosx
52003a78d15Sespie	exit 0 ;;
52103a78d15Sespie    DPX/2?00:B.O.S.:*:*)
52203a78d15Sespie	echo m68k-bull-sysv3
52303a78d15Sespie	exit 0 ;;
52403a78d15Sespie    9000/[34]??:4.3bsd:1.*:*)
52503a78d15Sespie	echo m68k-hp-bsd
52603a78d15Sespie	exit 0 ;;
52703a78d15Sespie    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
52803a78d15Sespie	echo m68k-hp-bsd4.4
52903a78d15Sespie	exit 0 ;;
53003a78d15Sespie    9000/[34678]??:HP-UX:*:*)
53103a78d15Sespie	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
53203a78d15Sespie	case "${UNAME_MACHINE}" in
53303a78d15Sespie	    9000/31? )            HP_ARCH=m68000 ;;
53403a78d15Sespie	    9000/[34]?? )         HP_ARCH=m68k ;;
53503a78d15Sespie	    9000/[678][0-9][0-9])
53603a78d15Sespie		if [ -x /usr/bin/getconf ]; then
53703a78d15Sespie		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
53803a78d15Sespie                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
53903a78d15Sespie                    case "${sc_cpu_version}" in
54003a78d15Sespie                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
54103a78d15Sespie                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
54203a78d15Sespie                      532)                      # CPU_PA_RISC2_0
54303a78d15Sespie                        case "${sc_kernel_bits}" in
54403a78d15Sespie                          32) HP_ARCH="hppa2.0n" ;;
54503a78d15Sespie                          64) HP_ARCH="hppa2.0w" ;;
54603a78d15Sespie			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
54703a78d15Sespie                        esac ;;
54803a78d15Sespie                    esac
54903a78d15Sespie		fi
55003a78d15Sespie		if [ "${HP_ARCH}" = "" ]; then
55103a78d15Sespie		    eval $set_cc_for_build
55203a78d15Sespie		    sed 's/^              //' << EOF >$dummy.c
55303a78d15Sespie
55403a78d15Sespie              #define _HPUX_SOURCE
55503a78d15Sespie              #include <stdlib.h>
55603a78d15Sespie              #include <unistd.h>
55703a78d15Sespie
55803a78d15Sespie              int main ()
55903a78d15Sespie              {
56003a78d15Sespie              #if defined(_SC_KERNEL_BITS)
56103a78d15Sespie                  long bits = sysconf(_SC_KERNEL_BITS);
56203a78d15Sespie              #endif
56303a78d15Sespie                  long cpu  = sysconf (_SC_CPU_VERSION);
56403a78d15Sespie
56503a78d15Sespie                  switch (cpu)
56603a78d15Sespie              	{
56703a78d15Sespie              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
56803a78d15Sespie              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
56903a78d15Sespie              	case CPU_PA_RISC2_0:
57003a78d15Sespie              #if defined(_SC_KERNEL_BITS)
57103a78d15Sespie              	    switch (bits)
57203a78d15Sespie              		{
57303a78d15Sespie              		case 64: puts ("hppa2.0w"); break;
57403a78d15Sespie              		case 32: puts ("hppa2.0n"); break;
57503a78d15Sespie              		default: puts ("hppa2.0"); break;
57603a78d15Sespie              		} break;
57703a78d15Sespie              #else  /* !defined(_SC_KERNEL_BITS) */
57803a78d15Sespie              	    puts ("hppa2.0"); break;
57903a78d15Sespie              #endif
58003a78d15Sespie              	default: puts ("hppa1.0"); break;
58103a78d15Sespie              	}
58203a78d15Sespie                  exit (0);
58303a78d15Sespie              }
58403a78d15SespieEOF
58503a78d15Sespie		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
58603a78d15Sespie		    test -z "$HP_ARCH" && HP_ARCH=hppa
58703a78d15Sespie		fi ;;
58803a78d15Sespie	esac
58903a78d15Sespie	if [ ${HP_ARCH} = "hppa2.0w" ]
59003a78d15Sespie	then
59103a78d15Sespie	    # avoid double evaluation of $set_cc_for_build
59203a78d15Sespie	    test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
59303a78d15Sespie	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
59403a78d15Sespie	    then
59503a78d15Sespie		HP_ARCH="hppa2.0w"
59603a78d15Sespie	    else
59703a78d15Sespie		HP_ARCH="hppa64"
59803a78d15Sespie	    fi
59903a78d15Sespie	fi
60003a78d15Sespie	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
60103a78d15Sespie	exit 0 ;;
60203a78d15Sespie    ia64:HP-UX:*:*)
60303a78d15Sespie	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
60403a78d15Sespie	echo ia64-hp-hpux${HPUX_REV}
60503a78d15Sespie	exit 0 ;;
60603a78d15Sespie    3050*:HI-UX:*:*)
60703a78d15Sespie	eval $set_cc_for_build
60803a78d15Sespie	sed 's/^	//' << EOF >$dummy.c
60903a78d15Sespie	#include <unistd.h>
61003a78d15Sespie	int
61103a78d15Sespie	main ()
61203a78d15Sespie	{
61303a78d15Sespie	  long cpu = sysconf (_SC_CPU_VERSION);
61403a78d15Sespie	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
61503a78d15Sespie	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
61603a78d15Sespie	     results, however.  */
61703a78d15Sespie	  if (CPU_IS_PA_RISC (cpu))
61803a78d15Sespie	    {
61903a78d15Sespie	      switch (cpu)
62003a78d15Sespie		{
62103a78d15Sespie		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
62203a78d15Sespie		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
62303a78d15Sespie		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
62403a78d15Sespie		  default: puts ("hppa-hitachi-hiuxwe2"); break;
62503a78d15Sespie		}
62603a78d15Sespie	    }
62703a78d15Sespie	  else if (CPU_IS_HP_MC68K (cpu))
62803a78d15Sespie	    puts ("m68k-hitachi-hiuxwe2");
62903a78d15Sespie	  else puts ("unknown-hitachi-hiuxwe2");
63003a78d15Sespie	  exit (0);
63103a78d15Sespie	}
63203a78d15SespieEOF
63303a78d15Sespie	$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
63403a78d15Sespie	echo unknown-hitachi-hiuxwe2
63503a78d15Sespie	exit 0 ;;
63603a78d15Sespie    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
63703a78d15Sespie	echo hppa1.1-hp-bsd
63803a78d15Sespie	exit 0 ;;
63903a78d15Sespie    9000/8??:4.3bsd:*:*)
64003a78d15Sespie	echo hppa1.0-hp-bsd
64103a78d15Sespie	exit 0 ;;
64203a78d15Sespie    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
64303a78d15Sespie	echo hppa1.0-hp-mpeix
64403a78d15Sespie	exit 0 ;;
64503a78d15Sespie    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
64603a78d15Sespie	echo hppa1.1-hp-osf
64703a78d15Sespie	exit 0 ;;
64803a78d15Sespie    hp8??:OSF1:*:*)
64903a78d15Sespie	echo hppa1.0-hp-osf
65003a78d15Sespie	exit 0 ;;
65103a78d15Sespie    i*86:OSF1:*:*)
65203a78d15Sespie	if [ -x /usr/sbin/sysversion ] ; then
65303a78d15Sespie	    echo ${UNAME_MACHINE}-unknown-osf1mk
65403a78d15Sespie	else
65503a78d15Sespie	    echo ${UNAME_MACHINE}-unknown-osf1
65603a78d15Sespie	fi
65703a78d15Sespie	exit 0 ;;
65803a78d15Sespie    parisc*:Lites*:*:*)
65903a78d15Sespie	echo hppa1.1-hp-lites
66003a78d15Sespie	exit 0 ;;
66103a78d15Sespie    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
66203a78d15Sespie	echo c1-convex-bsd
66303a78d15Sespie        exit 0 ;;
66403a78d15Sespie    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
66503a78d15Sespie	if getsysinfo -f scalar_acc
66603a78d15Sespie	then echo c32-convex-bsd
66703a78d15Sespie	else echo c2-convex-bsd
66803a78d15Sespie	fi
66903a78d15Sespie        exit 0 ;;
67003a78d15Sespie    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
67103a78d15Sespie	echo c34-convex-bsd
67203a78d15Sespie        exit 0 ;;
67303a78d15Sespie    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
67403a78d15Sespie	echo c38-convex-bsd
67503a78d15Sespie        exit 0 ;;
67603a78d15Sespie    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
67703a78d15Sespie	echo c4-convex-bsd
67803a78d15Sespie        exit 0 ;;
67903a78d15Sespie    CRAY*Y-MP:*:*:*)
68003a78d15Sespie	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
68103a78d15Sespie	exit 0 ;;
68203a78d15Sespie    CRAY*[A-Z]90:*:*:*)
68303a78d15Sespie	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
68403a78d15Sespie	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
68503a78d15Sespie	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
68603a78d15Sespie	      -e 's/\.[^.]*$/.X/'
68703a78d15Sespie	exit 0 ;;
68803a78d15Sespie    CRAY*TS:*:*:*)
68903a78d15Sespie	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
69003a78d15Sespie	exit 0 ;;
69103a78d15Sespie    CRAY*T3E:*:*:*)
69203a78d15Sespie	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
69303a78d15Sespie	exit 0 ;;
69403a78d15Sespie    CRAY*SV1:*:*:*)
69503a78d15Sespie	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
69603a78d15Sespie	exit 0 ;;
69703a78d15Sespie    *:UNICOS/mp:*:*)
69803a78d15Sespie	echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
69903a78d15Sespie	exit 0 ;;
70003a78d15Sespie    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
70103a78d15Sespie	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
70203a78d15Sespie        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
70303a78d15Sespie        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
70403a78d15Sespie        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
70503a78d15Sespie        exit 0 ;;
70603a78d15Sespie    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
70703a78d15Sespie	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
70803a78d15Sespie	exit 0 ;;
70903a78d15Sespie    sparc*:BSD/OS:*:*)
71003a78d15Sespie	echo sparc-unknown-bsdi${UNAME_RELEASE}
71103a78d15Sespie	exit 0 ;;
71203a78d15Sespie    *:BSD/OS:*:*)
71303a78d15Sespie	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
71403a78d15Sespie	exit 0 ;;
71503a78d15Sespie    *:FreeBSD:*:*)
71603a78d15Sespie	# Determine whether the default compiler uses glibc.
71703a78d15Sespie	eval $set_cc_for_build
71803a78d15Sespie	sed 's/^	//' << EOF >$dummy.c
71903a78d15Sespie	#include <features.h>
72003a78d15Sespie	#if __GLIBC__ >= 2
72103a78d15Sespie	LIBC=gnu
72203a78d15Sespie	#else
72303a78d15Sespie	LIBC=
72403a78d15Sespie	#endif
72503a78d15SespieEOF
72603a78d15Sespie	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
72703a78d15Sespie	echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
72803a78d15Sespie	exit 0 ;;
72903a78d15Sespie    i*:CYGWIN*:*)
73003a78d15Sespie	echo ${UNAME_MACHINE}-pc-cygwin
73103a78d15Sespie	exit 0 ;;
73203a78d15Sespie    i*:MINGW*:*)
73303a78d15Sespie	echo ${UNAME_MACHINE}-pc-mingw32
73403a78d15Sespie	exit 0 ;;
73503a78d15Sespie    i*:PW*:*)
73603a78d15Sespie	echo ${UNAME_MACHINE}-pc-pw32
73703a78d15Sespie	exit 0 ;;
73803a78d15Sespie    x86:Interix*:3*)
73903a78d15Sespie	echo i586-pc-interix3
74003a78d15Sespie	exit 0 ;;
74103a78d15Sespie    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
74203a78d15Sespie	echo i${UNAME_MACHINE}-pc-mks
74303a78d15Sespie	exit 0 ;;
74403a78d15Sespie    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
74503a78d15Sespie	# How do we know it's Interix rather than the generic POSIX subsystem?
74603a78d15Sespie	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
74703a78d15Sespie	# UNAME_MACHINE based on the output of uname instead of i386?
74803a78d15Sespie	echo i586-pc-interix
74903a78d15Sespie	exit 0 ;;
75003a78d15Sespie    i*:UWIN*:*)
75103a78d15Sespie	echo ${UNAME_MACHINE}-pc-uwin
75203a78d15Sespie	exit 0 ;;
75303a78d15Sespie    p*:CYGWIN*:*)
75403a78d15Sespie	echo powerpcle-unknown-cygwin
75503a78d15Sespie	exit 0 ;;
75603a78d15Sespie    prep*:SunOS:5.*:*)
75703a78d15Sespie	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
75803a78d15Sespie	exit 0 ;;
75903a78d15Sespie    *:GNU:*:*)
76003a78d15Sespie	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
76103a78d15Sespie	exit 0 ;;
76203a78d15Sespie    i*86:Minix:*:*)
76303a78d15Sespie	echo ${UNAME_MACHINE}-pc-minix
76403a78d15Sespie	exit 0 ;;
76503a78d15Sespie    arm*:Linux:*:*)
76603a78d15Sespie	echo ${UNAME_MACHINE}-unknown-linux-gnu
76703a78d15Sespie	exit 0 ;;
76803a78d15Sespie    ia64:Linux:*:*)
76903a78d15Sespie	echo ${UNAME_MACHINE}-unknown-linux-gnu
77003a78d15Sespie	exit 0 ;;
77103a78d15Sespie    m68*:Linux:*:*)
77203a78d15Sespie	echo ${UNAME_MACHINE}-unknown-linux-gnu
77303a78d15Sespie	exit 0 ;;
77403a78d15Sespie    mips:Linux:*:*)
77503a78d15Sespie	eval $set_cc_for_build
77603a78d15Sespie	sed 's/^	//' << EOF >$dummy.c
77703a78d15Sespie	#undef CPU
77803a78d15Sespie	#undef mips
77903a78d15Sespie	#undef mipsel
78003a78d15Sespie	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
78103a78d15Sespie	CPU=mipsel
78203a78d15Sespie	#else
78303a78d15Sespie	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
78403a78d15Sespie	CPU=mips
78503a78d15Sespie	#else
78603a78d15Sespie	CPU=
78703a78d15Sespie	#endif
78803a78d15Sespie	#endif
78903a78d15SespieEOF
79003a78d15Sespie	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
79103a78d15Sespie	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
79203a78d15Sespie	;;
79303a78d15Sespie    mips64:Linux:*:*)
79403a78d15Sespie	eval $set_cc_for_build
79503a78d15Sespie	sed 's/^	//' << EOF >$dummy.c
79603a78d15Sespie	#undef CPU
79703a78d15Sespie	#undef mips64
79803a78d15Sespie	#undef mips64el
79903a78d15Sespie	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
80003a78d15Sespie	CPU=mips64el
80103a78d15Sespie	#else
80203a78d15Sespie	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
80303a78d15Sespie	CPU=mips64
80403a78d15Sespie	#else
80503a78d15Sespie	CPU=
80603a78d15Sespie	#endif
80703a78d15Sespie	#endif
80803a78d15SespieEOF
80903a78d15Sespie	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
81003a78d15Sespie	test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
81103a78d15Sespie	;;
81203a78d15Sespie    ppc:Linux:*:*)
81303a78d15Sespie	echo powerpc-unknown-linux-gnu
81403a78d15Sespie	exit 0 ;;
81503a78d15Sespie    ppc64:Linux:*:*)
81603a78d15Sespie	echo powerpc64-unknown-linux-gnu
81703a78d15Sespie	exit 0 ;;
81803a78d15Sespie    alpha:Linux:*:*)
81903a78d15Sespie	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
82003a78d15Sespie	  EV5)   UNAME_MACHINE=alphaev5 ;;
82103a78d15Sespie	  EV56)  UNAME_MACHINE=alphaev56 ;;
82203a78d15Sespie	  PCA56) UNAME_MACHINE=alphapca56 ;;
82303a78d15Sespie	  PCA57) UNAME_MACHINE=alphapca56 ;;
82403a78d15Sespie	  EV6)   UNAME_MACHINE=alphaev6 ;;
82503a78d15Sespie	  EV67)  UNAME_MACHINE=alphaev67 ;;
82603a78d15Sespie	  EV68*) UNAME_MACHINE=alphaev68 ;;
82703a78d15Sespie        esac
82803a78d15Sespie	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
82903a78d15Sespie	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
83003a78d15Sespie	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
83103a78d15Sespie	exit 0 ;;
83203a78d15Sespie    parisc:Linux:*:* | hppa:Linux:*:*)
83303a78d15Sespie	# Look for CPU level
83403a78d15Sespie	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
83503a78d15Sespie	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
83603a78d15Sespie	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
83703a78d15Sespie	  *)    echo hppa-unknown-linux-gnu ;;
83803a78d15Sespie	esac
83903a78d15Sespie	exit 0 ;;
84003a78d15Sespie    parisc64:Linux:*:* | hppa64:Linux:*:*)
84103a78d15Sespie	echo hppa64-unknown-linux-gnu
84203a78d15Sespie	exit 0 ;;
84303a78d15Sespie    s390:Linux:*:* | s390x:Linux:*:*)
84403a78d15Sespie	echo ${UNAME_MACHINE}-ibm-linux
84503a78d15Sespie	exit 0 ;;
84603a78d15Sespie    sh*:Linux:*:*)
84703a78d15Sespie	echo ${UNAME_MACHINE}-unknown-linux-gnu
84803a78d15Sespie	exit 0 ;;
84903a78d15Sespie    sparc:Linux:*:* | sparc64:Linux:*:*)
85003a78d15Sespie	echo ${UNAME_MACHINE}-unknown-linux-gnu
85103a78d15Sespie	exit 0 ;;
85203a78d15Sespie    x86_64:Linux:*:*)
85303a78d15Sespie	echo x86_64-unknown-linux-gnu
85403a78d15Sespie	exit 0 ;;
85503a78d15Sespie    i*86:Linux:*:*)
85603a78d15Sespie	# The BFD linker knows what the default object file format is, so
85703a78d15Sespie	# first see if it will tell us. cd to the root directory to prevent
85803a78d15Sespie	# problems with other programs or directories called `ld' in the path.
85903a78d15Sespie	# Set LC_ALL=C to ensure ld outputs messages in English.
86003a78d15Sespie	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
86103a78d15Sespie			 | sed -ne '/supported targets:/!d
86203a78d15Sespie				    s/[ 	][ 	]*/ /g
86303a78d15Sespie				    s/.*supported targets: *//
86403a78d15Sespie				    s/ .*//
86503a78d15Sespie				    p'`
86603a78d15Sespie        case "$ld_supported_targets" in
86703a78d15Sespie	  elf32-i386)
86803a78d15Sespie		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
86903a78d15Sespie		;;
87003a78d15Sespie	  a.out-i386-linux)
87103a78d15Sespie		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
87203a78d15Sespie		exit 0 ;;
87303a78d15Sespie	  coff-i386)
87403a78d15Sespie		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
87503a78d15Sespie		exit 0 ;;
87603a78d15Sespie	  "")
87703a78d15Sespie		# Either a pre-BFD a.out linker (linux-gnuoldld) or
87803a78d15Sespie		# one that does not give us useful --help.
87903a78d15Sespie		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
88003a78d15Sespie		exit 0 ;;
88103a78d15Sespie	esac
88203a78d15Sespie	# Determine whether the default compiler is a.out or elf
88303a78d15Sespie	eval $set_cc_for_build
88403a78d15Sespie	sed 's/^	//' << EOF >$dummy.c
88503a78d15Sespie	#include <features.h>
88603a78d15Sespie	#ifdef __ELF__
88703a78d15Sespie	# ifdef __GLIBC__
88803a78d15Sespie	#  if __GLIBC__ >= 2
88903a78d15Sespie	LIBC=gnu
89003a78d15Sespie	#  else
89103a78d15Sespie	LIBC=gnulibc1
89203a78d15Sespie	#  endif
89303a78d15Sespie	# else
89403a78d15Sespie	LIBC=gnulibc1
89503a78d15Sespie	# endif
89603a78d15Sespie	#else
89703a78d15Sespie	#ifdef __INTEL_COMPILER
89803a78d15Sespie	LIBC=gnu
89903a78d15Sespie	#else
90003a78d15Sespie	LIBC=gnuaout
90103a78d15Sespie	#endif
90203a78d15Sespie	#endif
90303a78d15SespieEOF
90403a78d15Sespie	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
90503a78d15Sespie	test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
90603a78d15Sespie	test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
90703a78d15Sespie	;;
90803a78d15Sespie    i*86:DYNIX/ptx:4*:*)
90903a78d15Sespie	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
91003a78d15Sespie	# earlier versions are messed up and put the nodename in both
91103a78d15Sespie	# sysname and nodename.
91203a78d15Sespie	echo i386-sequent-sysv4
91303a78d15Sespie	exit 0 ;;
91403a78d15Sespie    i*86:UNIX_SV:4.2MP:2.*)
91503a78d15Sespie        # Unixware is an offshoot of SVR4, but it has its own version
91603a78d15Sespie        # number series starting with 2...
91703a78d15Sespie        # I am not positive that other SVR4 systems won't match this,
91803a78d15Sespie	# I just have to hope.  -- rms.
91903a78d15Sespie        # Use sysv4.2uw... so that sysv4* matches it.
92003a78d15Sespie	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
92103a78d15Sespie	exit 0 ;;
92203a78d15Sespie    i*86:OS/2:*:*)
92303a78d15Sespie	# If we were able to find `uname', then EMX Unix compatibility
92403a78d15Sespie	# is probably installed.
92503a78d15Sespie	echo ${UNAME_MACHINE}-pc-os2-emx
92603a78d15Sespie	exit 0 ;;
92703a78d15Sespie    i*86:XTS-300:*:STOP)
92803a78d15Sespie	echo ${UNAME_MACHINE}-unknown-stop
92903a78d15Sespie	exit 0 ;;
93003a78d15Sespie    i*86:atheos:*:*)
93103a78d15Sespie	echo ${UNAME_MACHINE}-unknown-atheos
93203a78d15Sespie	exit 0 ;;
93303a78d15Sespie    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
93403a78d15Sespie	echo i386-unknown-lynxos${UNAME_RELEASE}
93503a78d15Sespie	exit 0 ;;
93603a78d15Sespie    i*86:*DOS:*:*)
93703a78d15Sespie	echo ${UNAME_MACHINE}-pc-msdosdjgpp
93803a78d15Sespie	exit 0 ;;
93903a78d15Sespie    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
94003a78d15Sespie	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
94103a78d15Sespie	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
94203a78d15Sespie		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
94303a78d15Sespie	else
94403a78d15Sespie		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
94503a78d15Sespie	fi
94603a78d15Sespie	exit 0 ;;
94703a78d15Sespie    i*86:*:5:[78]*)
94803a78d15Sespie	case `/bin/uname -X | grep "^Machine"` in
94903a78d15Sespie	    *486*)	     UNAME_MACHINE=i486 ;;
95003a78d15Sespie	    *Pentium)	     UNAME_MACHINE=i586 ;;
95103a78d15Sespie	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
95203a78d15Sespie	esac
95303a78d15Sespie	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
95403a78d15Sespie	exit 0 ;;
95503a78d15Sespie    i*86:*:3.2:*)
95603a78d15Sespie	if test -f /usr/options/cb.name; then
95703a78d15Sespie		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
95803a78d15Sespie		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
95903a78d15Sespie	elif /bin/uname -X 2>/dev/null >/dev/null ; then
96003a78d15Sespie		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
96103a78d15Sespie		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
96203a78d15Sespie		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
96303a78d15Sespie			&& UNAME_MACHINE=i586
96403a78d15Sespie		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
96503a78d15Sespie			&& UNAME_MACHINE=i686
96603a78d15Sespie		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
96703a78d15Sespie			&& UNAME_MACHINE=i686
96803a78d15Sespie		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
96903a78d15Sespie	else
97003a78d15Sespie		echo ${UNAME_MACHINE}-pc-sysv32
97103a78d15Sespie	fi
97203a78d15Sespie	exit 0 ;;
97303a78d15Sespie    pc:*:*:*)
97403a78d15Sespie	# Left here for compatibility:
97503a78d15Sespie        # uname -m prints for DJGPP always 'pc', but it prints nothing about
97603a78d15Sespie        # the processor, so we play safe by assuming i386.
97703a78d15Sespie	echo i386-pc-msdosdjgpp
97803a78d15Sespie        exit 0 ;;
97903a78d15Sespie    Intel:Mach:3*:*)
98003a78d15Sespie	echo i386-pc-mach3
98103a78d15Sespie	exit 0 ;;
98203a78d15Sespie    paragon:*:*:*)
98303a78d15Sespie	echo i860-intel-osf1
98403a78d15Sespie	exit 0 ;;
98503a78d15Sespie    i860:*:4.*:*) # i860-SVR4
98603a78d15Sespie	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
98703a78d15Sespie	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
98803a78d15Sespie	else # Add other i860-SVR4 vendors below as they are discovered.
98903a78d15Sespie	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
99003a78d15Sespie	fi
99103a78d15Sespie	exit 0 ;;
99203a78d15Sespie    mini*:CTIX:SYS*5:*)
99303a78d15Sespie	# "miniframe"
99403a78d15Sespie	echo m68010-convergent-sysv
99503a78d15Sespie	exit 0 ;;
99603a78d15Sespie    mc68k:UNIX:SYSTEM5:3.51m)
99703a78d15Sespie	echo m68k-convergent-sysv
99803a78d15Sespie	exit 0 ;;
99903a78d15Sespie    M680?0:D-NIX:5.3:*)
100003a78d15Sespie	echo m68k-diab-dnix
100103a78d15Sespie	exit 0 ;;
100203a78d15Sespie    M68*:*:R3V[567]*:*)
100303a78d15Sespie	test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
100403a78d15Sespie    3[34]??:*: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)
100503a78d15Sespie	OS_REL=''
100603a78d15Sespie	test -r /etc/.relid \
100703a78d15Sespie	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
100803a78d15Sespie	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
100903a78d15Sespie	  && echo i486-ncr-sysv4.3${OS_REL} && exit 0
101003a78d15Sespie	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
101103a78d15Sespie	  && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
101203a78d15Sespie    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
101303a78d15Sespie        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
101403a78d15Sespie          && echo i486-ncr-sysv4 && exit 0 ;;
101503a78d15Sespie    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
101603a78d15Sespie	echo m68k-unknown-lynxos${UNAME_RELEASE}
101703a78d15Sespie	exit 0 ;;
101803a78d15Sespie    mc68030:UNIX_System_V:4.*:*)
101903a78d15Sespie	echo m68k-atari-sysv4
102003a78d15Sespie	exit 0 ;;
102103a78d15Sespie    TSUNAMI:LynxOS:2.*:*)
102203a78d15Sespie	echo sparc-unknown-lynxos${UNAME_RELEASE}
102303a78d15Sespie	exit 0 ;;
102403a78d15Sespie    rs6000:LynxOS:2.*:*)
102503a78d15Sespie	echo rs6000-unknown-lynxos${UNAME_RELEASE}
102603a78d15Sespie	exit 0 ;;
102703a78d15Sespie    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
102803a78d15Sespie	echo powerpc-unknown-lynxos${UNAME_RELEASE}
102903a78d15Sespie	exit 0 ;;
103003a78d15Sespie    SM[BE]S:UNIX_SV:*:*)
103103a78d15Sespie	echo mips-dde-sysv${UNAME_RELEASE}
103203a78d15Sespie	exit 0 ;;
103303a78d15Sespie    RM*:ReliantUNIX-*:*:*)
103403a78d15Sespie	echo mips-sni-sysv4
103503a78d15Sespie	exit 0 ;;
103603a78d15Sespie    RM*:SINIX-*:*:*)
103703a78d15Sespie	echo mips-sni-sysv4
103803a78d15Sespie	exit 0 ;;
103903a78d15Sespie    *:SINIX-*:*:*)
104003a78d15Sespie	if uname -p 2>/dev/null >/dev/null ; then
104103a78d15Sespie		UNAME_MACHINE=`(uname -p) 2>/dev/null`
104203a78d15Sespie		echo ${UNAME_MACHINE}-sni-sysv4
104303a78d15Sespie	else
104403a78d15Sespie		echo ns32k-sni-sysv
104503a78d15Sespie	fi
104603a78d15Sespie	exit 0 ;;
104703a78d15Sespie    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
104803a78d15Sespie                      # says <Richard.M.Bartel@ccMail.Census.GOV>
104903a78d15Sespie        echo i586-unisys-sysv4
105003a78d15Sespie        exit 0 ;;
105103a78d15Sespie    *:UNIX_System_V:4*:FTX*)
105203a78d15Sespie	# From Gerald Hewes <hewes@openmarket.com>.
105303a78d15Sespie	# How about differentiating between stratus architectures? -djm
105403a78d15Sespie	echo hppa1.1-stratus-sysv4
105503a78d15Sespie	exit 0 ;;
105603a78d15Sespie    *:*:*:FTX*)
105703a78d15Sespie	# From seanf@swdc.stratus.com.
105803a78d15Sespie	echo i860-stratus-sysv4
105903a78d15Sespie	exit 0 ;;
106003a78d15Sespie    *:VOS:*:*)
106103a78d15Sespie	# From Paul.Green@stratus.com.
106203a78d15Sespie	echo hppa1.1-stratus-vos
106303a78d15Sespie	exit 0 ;;
106403a78d15Sespie    mc68*:A/UX:*:*)
106503a78d15Sespie	echo m68k-apple-aux${UNAME_RELEASE}
106603a78d15Sespie	exit 0 ;;
106703a78d15Sespie    news*:NEWS-OS:6*:*)
106803a78d15Sespie	echo mips-sony-newsos6
106903a78d15Sespie	exit 0 ;;
107003a78d15Sespie    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
107103a78d15Sespie	if [ -d /usr/nec ]; then
107203a78d15Sespie	        echo mips-nec-sysv${UNAME_RELEASE}
107303a78d15Sespie	else
107403a78d15Sespie	        echo mips-unknown-sysv${UNAME_RELEASE}
107503a78d15Sespie	fi
107603a78d15Sespie        exit 0 ;;
107703a78d15Sespie    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
107803a78d15Sespie	echo powerpc-be-beos
107903a78d15Sespie	exit 0 ;;
108003a78d15Sespie    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
108103a78d15Sespie	echo powerpc-apple-beos
108203a78d15Sespie	exit 0 ;;
108303a78d15Sespie    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
108403a78d15Sespie	echo i586-pc-beos
108503a78d15Sespie	exit 0 ;;
108603a78d15Sespie    SX-4:SUPER-UX:*:*)
108703a78d15Sespie	echo sx4-nec-superux${UNAME_RELEASE}
108803a78d15Sespie	exit 0 ;;
108903a78d15Sespie    SX-5:SUPER-UX:*:*)
109003a78d15Sespie	echo sx5-nec-superux${UNAME_RELEASE}
109103a78d15Sespie	exit 0 ;;
109203a78d15Sespie    SX-6:SUPER-UX:*:*)
109303a78d15Sespie	echo sx6-nec-superux${UNAME_RELEASE}
109403a78d15Sespie	exit 0 ;;
109503a78d15Sespie    Power*:Rhapsody:*:*)
109603a78d15Sespie	echo powerpc-apple-rhapsody${UNAME_RELEASE}
109703a78d15Sespie	exit 0 ;;
109803a78d15Sespie    *:Rhapsody:*:*)
109903a78d15Sespie	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
110003a78d15Sespie	exit 0 ;;
110103a78d15Sespie    *:Darwin:*:*)
110203a78d15Sespie	case `uname -p` in
110303a78d15Sespie	    *86) UNAME_PROCESSOR=i686 ;;
110403a78d15Sespie	    powerpc) UNAME_PROCESSOR=powerpc ;;
110503a78d15Sespie	esac
110603a78d15Sespie	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
110703a78d15Sespie	exit 0 ;;
110803a78d15Sespie    *:procnto*:*:* | *:QNX:[0123456789]*:*)
110903a78d15Sespie	UNAME_PROCESSOR=`uname -p`
111003a78d15Sespie	if test "$UNAME_PROCESSOR" = "x86"; then
111103a78d15Sespie		UNAME_PROCESSOR=i386
111203a78d15Sespie		UNAME_MACHINE=pc
111303a78d15Sespie	fi
111403a78d15Sespie	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
111503a78d15Sespie	exit 0 ;;
111603a78d15Sespie    *:QNX:*:4*)
111703a78d15Sespie	echo i386-pc-qnx
111803a78d15Sespie	exit 0 ;;
111903a78d15Sespie    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
112003a78d15Sespie	echo nsr-tandem-nsk${UNAME_RELEASE}
112103a78d15Sespie	exit 0 ;;
112203a78d15Sespie    *:NonStop-UX:*:*)
112303a78d15Sespie	echo mips-compaq-nonstopux
112403a78d15Sespie	exit 0 ;;
112503a78d15Sespie    BS2000:POSIX*:*:*)
112603a78d15Sespie	echo bs2000-siemens-sysv
112703a78d15Sespie	exit 0 ;;
112803a78d15Sespie    DS/*:UNIX_System_V:*:*)
112903a78d15Sespie	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
113003a78d15Sespie	exit 0 ;;
113103a78d15Sespie    *:Plan9:*:*)
113203a78d15Sespie	# "uname -m" is not consistent, so use $cputype instead. 386
113303a78d15Sespie	# is converted to i386 for consistency with other x86
113403a78d15Sespie	# operating systems.
113503a78d15Sespie	if test "$cputype" = "386"; then
113603a78d15Sespie	    UNAME_MACHINE=i386
113703a78d15Sespie	else
113803a78d15Sespie	    UNAME_MACHINE="$cputype"
113903a78d15Sespie	fi
114003a78d15Sespie	echo ${UNAME_MACHINE}-unknown-plan9
114103a78d15Sespie	exit 0 ;;
114203a78d15Sespie    *:TOPS-10:*:*)
114303a78d15Sespie	echo pdp10-unknown-tops10
114403a78d15Sespie	exit 0 ;;
114503a78d15Sespie    *:TENEX:*:*)
114603a78d15Sespie	echo pdp10-unknown-tenex
114703a78d15Sespie	exit 0 ;;
114803a78d15Sespie    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
114903a78d15Sespie	echo pdp10-dec-tops20
115003a78d15Sespie	exit 0 ;;
115103a78d15Sespie    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
115203a78d15Sespie	echo pdp10-xkl-tops20
115303a78d15Sespie	exit 0 ;;
115403a78d15Sespie    *:TOPS-20:*:*)
115503a78d15Sespie	echo pdp10-unknown-tops20
115603a78d15Sespie	exit 0 ;;
115703a78d15Sespie    *:ITS:*:*)
115803a78d15Sespie	echo pdp10-unknown-its
115903a78d15Sespie	exit 0 ;;
116003a78d15Sespieesac
116103a78d15Sespie
116203a78d15Sespie#echo '(No uname command or uname output not recognized.)' 1>&2
116303a78d15Sespie#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
116403a78d15Sespie
116503a78d15Sespieeval $set_cc_for_build
116603a78d15Sespiecat >$dummy.c <<EOF
116703a78d15Sespie#ifdef _SEQUENT_
116803a78d15Sespie# include <sys/types.h>
116903a78d15Sespie# include <sys/utsname.h>
117003a78d15Sespie#endif
117103a78d15Sespiemain ()
117203a78d15Sespie{
117303a78d15Sespie#if defined (sony)
117403a78d15Sespie#if defined (MIPSEB)
117503a78d15Sespie  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
117603a78d15Sespie     I don't know....  */
117703a78d15Sespie  printf ("mips-sony-bsd\n"); exit (0);
117803a78d15Sespie#else
117903a78d15Sespie#include <sys/param.h>
118003a78d15Sespie  printf ("m68k-sony-newsos%s\n",
118103a78d15Sespie#ifdef NEWSOS4
118203a78d15Sespie          "4"
118303a78d15Sespie#else
118403a78d15Sespie	  ""
118503a78d15Sespie#endif
118603a78d15Sespie         ); exit (0);
118703a78d15Sespie#endif
118803a78d15Sespie#endif
118903a78d15Sespie
119003a78d15Sespie#if defined (__arm) && defined (__acorn) && defined (__unix)
119103a78d15Sespie  printf ("arm-acorn-riscix"); exit (0);
119203a78d15Sespie#endif
119303a78d15Sespie
119403a78d15Sespie#if defined (hp300) && !defined (hpux)
119503a78d15Sespie  printf ("m68k-hp-bsd\n"); exit (0);
119603a78d15Sespie#endif
119703a78d15Sespie
119803a78d15Sespie#if defined (NeXT)
119903a78d15Sespie#if !defined (__ARCHITECTURE__)
120003a78d15Sespie#define __ARCHITECTURE__ "m68k"
120103a78d15Sespie#endif
120203a78d15Sespie  int version;
120303a78d15Sespie  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
120403a78d15Sespie  if (version < 4)
120503a78d15Sespie    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
120603a78d15Sespie  else
120703a78d15Sespie    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
120803a78d15Sespie  exit (0);
120903a78d15Sespie#endif
121003a78d15Sespie
121103a78d15Sespie#if defined (MULTIMAX) || defined (n16)
121203a78d15Sespie#if defined (UMAXV)
121303a78d15Sespie  printf ("ns32k-encore-sysv\n"); exit (0);
121403a78d15Sespie#else
121503a78d15Sespie#if defined (CMU)
121603a78d15Sespie  printf ("ns32k-encore-mach\n"); exit (0);
121703a78d15Sespie#else
121803a78d15Sespie  printf ("ns32k-encore-bsd\n"); exit (0);
121903a78d15Sespie#endif
122003a78d15Sespie#endif
122103a78d15Sespie#endif
122203a78d15Sespie
122303a78d15Sespie#if defined (__386BSD__)
122403a78d15Sespie  printf ("i386-pc-bsd\n"); exit (0);
122503a78d15Sespie#endif
122603a78d15Sespie
122703a78d15Sespie#if defined (sequent)
122803a78d15Sespie#if defined (i386)
122903a78d15Sespie  printf ("i386-sequent-dynix\n"); exit (0);
123003a78d15Sespie#endif
123103a78d15Sespie#if defined (ns32000)
123203a78d15Sespie  printf ("ns32k-sequent-dynix\n"); exit (0);
123303a78d15Sespie#endif
123403a78d15Sespie#endif
123503a78d15Sespie
123603a78d15Sespie#if defined (_SEQUENT_)
123703a78d15Sespie    struct utsname un;
123803a78d15Sespie
123903a78d15Sespie    uname(&un);
124003a78d15Sespie
124103a78d15Sespie    if (strncmp(un.version, "V2", 2) == 0) {
124203a78d15Sespie	printf ("i386-sequent-ptx2\n"); exit (0);
124303a78d15Sespie    }
124403a78d15Sespie    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
124503a78d15Sespie	printf ("i386-sequent-ptx1\n"); exit (0);
124603a78d15Sespie    }
124703a78d15Sespie    printf ("i386-sequent-ptx\n"); exit (0);
124803a78d15Sespie
124903a78d15Sespie#endif
125003a78d15Sespie
125103a78d15Sespie#if defined (vax)
125203a78d15Sespie# if !defined (ultrix)
125303a78d15Sespie#  include <sys/param.h>
125403a78d15Sespie#  if defined (BSD)
125503a78d15Sespie#   if BSD == 43
125603a78d15Sespie      printf ("vax-dec-bsd4.3\n"); exit (0);
125703a78d15Sespie#   else
125803a78d15Sespie#    if BSD == 199006
125903a78d15Sespie      printf ("vax-dec-bsd4.3reno\n"); exit (0);
126003a78d15Sespie#    else
126103a78d15Sespie      printf ("vax-dec-bsd\n"); exit (0);
126203a78d15Sespie#    endif
126303a78d15Sespie#   endif
126403a78d15Sespie#  else
126503a78d15Sespie    printf ("vax-dec-bsd\n"); exit (0);
126603a78d15Sespie#  endif
126703a78d15Sespie# else
126803a78d15Sespie    printf ("vax-dec-ultrix\n"); exit (0);
126903a78d15Sespie# endif
127003a78d15Sespie#endif
127103a78d15Sespie
127203a78d15Sespie#if defined (alliant) && defined (i860)
127303a78d15Sespie  printf ("i860-alliant-bsd\n"); exit (0);
127403a78d15Sespie#endif
127503a78d15Sespie
127603a78d15Sespie  exit (1);
127703a78d15Sespie}
127803a78d15SespieEOF
127903a78d15Sespie
128003a78d15Sespie$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
128103a78d15Sespie
128203a78d15Sespie# Apollos put the system type in the environment.
128303a78d15Sespie
128403a78d15Sespietest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
128503a78d15Sespie
128603a78d15Sespie# Convex versions that predate uname can use getsysinfo(1)
128703a78d15Sespie
128803a78d15Sespieif [ -x /usr/convex/getsysinfo ]
128903a78d15Sespiethen
129003a78d15Sespie    case `getsysinfo -f cpu_type` in
129103a78d15Sespie    c1*)
129203a78d15Sespie	echo c1-convex-bsd
129303a78d15Sespie	exit 0 ;;
129403a78d15Sespie    c2*)
129503a78d15Sespie	if getsysinfo -f scalar_acc
129603a78d15Sespie	then echo c32-convex-bsd
129703a78d15Sespie	else echo c2-convex-bsd
129803a78d15Sespie	fi
129903a78d15Sespie	exit 0 ;;
130003a78d15Sespie    c34*)
130103a78d15Sespie	echo c34-convex-bsd
130203a78d15Sespie	exit 0 ;;
130303a78d15Sespie    c38*)
130403a78d15Sespie	echo c38-convex-bsd
130503a78d15Sespie	exit 0 ;;
130603a78d15Sespie    c4*)
130703a78d15Sespie	echo c4-convex-bsd
130803a78d15Sespie	exit 0 ;;
130903a78d15Sespie    esac
131003a78d15Sespiefi
131103a78d15Sespie
131203a78d15Sespiecat >&2 <<EOF
131303a78d15Sespie$0: unable to guess system type
131403a78d15Sespie
131503a78d15SespieThis script, last modified $timestamp, has failed to recognize
131603a78d15Sespiethe operating system you are using. It is advised that you
131703a78d15Sespiedownload the most up to date version of the config scripts from
131803a78d15Sespie
131903a78d15Sespie    ftp://ftp.gnu.org/pub/gnu/config/
132003a78d15Sespie
132103a78d15SespieIf the version you run ($0) is already up to date, please
132203a78d15Sespiesend the following data and any information you think might be
132303a78d15Sespiepertinent to <config-patches@gnu.org> in order to provide the needed
132403a78d15Sespieinformation to handle your system.
132503a78d15Sespie
132603a78d15Sespieconfig.guess timestamp = $timestamp
132703a78d15Sespie
132803a78d15Sespieuname -m = `(uname -m) 2>/dev/null || echo unknown`
132903a78d15Sespieuname -r = `(uname -r) 2>/dev/null || echo unknown`
133003a78d15Sespieuname -s = `(uname -s) 2>/dev/null || echo unknown`
133103a78d15Sespieuname -v = `(uname -v) 2>/dev/null || echo unknown`
133203a78d15Sespie
133303a78d15Sespie/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
133403a78d15Sespie/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
133503a78d15Sespie
133603a78d15Sespiehostinfo               = `(hostinfo) 2>/dev/null`
133703a78d15Sespie/bin/universe          = `(/bin/universe) 2>/dev/null`
133803a78d15Sespie/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
133903a78d15Sespie/bin/arch              = `(/bin/arch) 2>/dev/null`
134003a78d15Sespie/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
134103a78d15Sespie/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
134203a78d15Sespie
134303a78d15SespieUNAME_MACHINE = ${UNAME_MACHINE}
134403a78d15SespieUNAME_RELEASE = ${UNAME_RELEASE}
134503a78d15SespieUNAME_SYSTEM  = ${UNAME_SYSTEM}
134603a78d15SespieUNAME_VERSION = ${UNAME_VERSION}
134703a78d15SespieEOF
134803a78d15Sespie
134903a78d15Sespieexit 1
135003a78d15Sespie
135103a78d15Sespie# Local variables:
135203a78d15Sespie# eval: (add-hook 'write-file-hooks 'time-stamp)
135303a78d15Sespie# time-stamp-start: "timestamp='"
135403a78d15Sespie# time-stamp-format: "%:y-%02m-%02d"
135503a78d15Sespie# time-stamp-end: "'"
135603a78d15Sespie# End:
1357