config.guess revision 10998002
1ff7e0accSmrg#! /bin/sh
2ff7e0accSmrg# Attempt to guess a canonical system name.
3ff7e0accSmrg#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4a005d216Smrg#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
5a005d216Smrg#   Free Software Foundation, Inc.
6ff7e0accSmrg
710998002Smrgtimestamp='2009-04-27'
8ff7e0accSmrg
9ff7e0accSmrg# This file is free software; you can redistribute it and/or modify it
10ff7e0accSmrg# under the terms of the GNU General Public License as published by
11ff7e0accSmrg# the Free Software Foundation; either version 2 of the License, or
12ff7e0accSmrg# (at your option) any later version.
13ff7e0accSmrg#
14ff7e0accSmrg# This program is distributed in the hope that it will be useful, but
15ff7e0accSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
16ff7e0accSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17ff7e0accSmrg# General Public License for more details.
18ff7e0accSmrg#
19ff7e0accSmrg# You should have received a copy of the GNU General Public License
20ff7e0accSmrg# along with this program; if not, write to the Free Software
21ff7e0accSmrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22ff7e0accSmrg# 02110-1301, USA.
23ff7e0accSmrg#
24ff7e0accSmrg# As a special exception to the GNU General Public License, if you
25ff7e0accSmrg# distribute this file as part of a program that contains a
26ff7e0accSmrg# configuration script generated by Autoconf, you may include it under
27ff7e0accSmrg# the same distribution terms that you use for the rest of that program.
28ff7e0accSmrg
29ff7e0accSmrg
30ff7e0accSmrg# Originally written by Per Bothner <per@bothner.com>.
31ff7e0accSmrg# Please send patches to <config-patches@gnu.org>.  Submit a context
32ff7e0accSmrg# diff and a properly formatted ChangeLog entry.
33ff7e0accSmrg#
34ff7e0accSmrg# This script attempts to guess a canonical system name similar to
35ff7e0accSmrg# config.sub.  If it succeeds, it prints the system name on stdout, and
36ff7e0accSmrg# exits with 0.  Otherwise, it exits with 1.
37ff7e0accSmrg#
38ff7e0accSmrg# The plan is that this can be called by configure scripts if you
39ff7e0accSmrg# don't specify an explicit build system type.
40ff7e0accSmrg
41ff7e0accSmrgme=`echo "$0" | sed -e 's,.*/,,'`
42ff7e0accSmrg
43ff7e0accSmrgusage="\
44ff7e0accSmrgUsage: $0 [OPTION]
45ff7e0accSmrg
46ff7e0accSmrgOutput the configuration name of the system \`$me' is run on.
47ff7e0accSmrg
48ff7e0accSmrgOperation modes:
49ff7e0accSmrg  -h, --help         print this help, then exit
50ff7e0accSmrg  -t, --time-stamp   print date of last modification, then exit
51ff7e0accSmrg  -v, --version      print version number, then exit
52ff7e0accSmrg
53ff7e0accSmrgReport bugs and patches to <config-patches@gnu.org>."
54ff7e0accSmrg
55ff7e0accSmrgversion="\
56ff7e0accSmrgGNU config.guess ($timestamp)
57ff7e0accSmrg
58ff7e0accSmrgOriginally written by Per Bothner.
59a005d216SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60a005d216Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
61ff7e0accSmrg
62ff7e0accSmrgThis is free software; see the source for copying conditions.  There is NO
63ff7e0accSmrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
64ff7e0accSmrg
65ff7e0accSmrghelp="
66ff7e0accSmrgTry \`$me --help' for more information."
67ff7e0accSmrg
68ff7e0accSmrg# Parse command line
69ff7e0accSmrgwhile test $# -gt 0 ; do
70ff7e0accSmrg  case $1 in
71ff7e0accSmrg    --time-stamp | --time* | -t )
72ff7e0accSmrg       echo "$timestamp" ; exit ;;
73ff7e0accSmrg    --version | -v )
74ff7e0accSmrg       echo "$version" ; exit ;;
75ff7e0accSmrg    --help | --h* | -h )
76ff7e0accSmrg       echo "$usage"; exit ;;
77ff7e0accSmrg    -- )     # Stop option processing
78ff7e0accSmrg       shift; break ;;
79ff7e0accSmrg    - )	# Use stdin as input.
80ff7e0accSmrg       break ;;
81ff7e0accSmrg    -* )
82ff7e0accSmrg       echo "$me: invalid option $1$help" >&2
83ff7e0accSmrg       exit 1 ;;
84ff7e0accSmrg    * )
85ff7e0accSmrg       break ;;
86ff7e0accSmrg  esac
87ff7e0accSmrgdone
88ff7e0accSmrg
89ff7e0accSmrgif test $# != 0; then
90ff7e0accSmrg  echo "$me: too many arguments$help" >&2
91ff7e0accSmrg  exit 1
92ff7e0accSmrgfi
93ff7e0accSmrg
94ff7e0accSmrgtrap 'exit 1' 1 2 15
95ff7e0accSmrg
96ff7e0accSmrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
97ff7e0accSmrg# compiler to aid in system detection is discouraged as it requires
98ff7e0accSmrg# temporary files to be created and, as you can see below, it is a
99ff7e0accSmrg# headache to deal with in a portable fashion.
100ff7e0accSmrg
101ff7e0accSmrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102ff7e0accSmrg# use `HOST_CC' if defined, but it is deprecated.
103ff7e0accSmrg
104ff7e0accSmrg# Portable tmp directory creation inspired by the Autoconf team.
105ff7e0accSmrg
106ff7e0accSmrgset_cc_for_build='
107ff7e0accSmrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
108ff7e0accSmrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109ff7e0accSmrg: ${TMPDIR=/tmp} ;
110ff7e0accSmrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
111ff7e0accSmrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
112ff7e0accSmrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
113ff7e0accSmrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114ff7e0accSmrgdummy=$tmp/dummy ;
115ff7e0accSmrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116ff7e0accSmrgcase $CC_FOR_BUILD,$HOST_CC,$CC in
117ff7e0accSmrg ,,)    echo "int x;" > $dummy.c ;
118ff7e0accSmrg	for c in cc gcc c89 c99 ; do
119ff7e0accSmrg	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
120ff7e0accSmrg	     CC_FOR_BUILD="$c"; break ;
121ff7e0accSmrg	  fi ;
122ff7e0accSmrg	done ;
123ff7e0accSmrg	if test x"$CC_FOR_BUILD" = x ; then
124ff7e0accSmrg	  CC_FOR_BUILD=no_compiler_found ;
125ff7e0accSmrg	fi
126ff7e0accSmrg	;;
127ff7e0accSmrg ,,*)   CC_FOR_BUILD=$CC ;;
128ff7e0accSmrg ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
129ff7e0accSmrgesac ; set_cc_for_build= ;'
130ff7e0accSmrg
131ff7e0accSmrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
132ff7e0accSmrg# (ghazi@noc.rutgers.edu 1994-08-24)
133ff7e0accSmrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then
134ff7e0accSmrg	PATH=$PATH:/.attbin ; export PATH
135ff7e0accSmrgfi
136ff7e0accSmrg
137ff7e0accSmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
138ff7e0accSmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
139ff7e0accSmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
140ff7e0accSmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141ff7e0accSmrg
142ff7e0accSmrg# Note: order is significant - the case branches are not exclusive.
143ff7e0accSmrg
144ff7e0accSmrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
145ff7e0accSmrg    *:NetBSD:*:*)
146ff7e0accSmrg	# NetBSD (nbsd) targets should (where applicable) match one or
147ff7e0accSmrg	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
148ff7e0accSmrg	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
149ff7e0accSmrg	# switched to ELF, *-*-netbsd* would select the old
150ff7e0accSmrg	# object file format.  This provides both forward
151ff7e0accSmrg	# compatibility and a consistent mechanism for selecting the
152ff7e0accSmrg	# object file format.
153ff7e0accSmrg	#
154ff7e0accSmrg	# Note: NetBSD doesn't particularly care about the vendor
155ff7e0accSmrg	# portion of the name.  We always set it to "unknown".
156ff7e0accSmrg	sysctl="sysctl -n hw.machine_arch"
157ff7e0accSmrg	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158ff7e0accSmrg	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159ff7e0accSmrg	case "${UNAME_MACHINE_ARCH}" in
160ff7e0accSmrg	    armeb) machine=armeb-unknown ;;
161ff7e0accSmrg	    arm*) machine=arm-unknown ;;
162ff7e0accSmrg	    sh3el) machine=shl-unknown ;;
163ff7e0accSmrg	    sh3eb) machine=sh-unknown ;;
164ff7e0accSmrg	    sh5el) machine=sh5le-unknown ;;
165ff7e0accSmrg	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
166ff7e0accSmrg	esac
167ff7e0accSmrg	# The Operating System including object format, if it has switched
168ff7e0accSmrg	# to ELF recently, or will in the future.
169ff7e0accSmrg	case "${UNAME_MACHINE_ARCH}" in
170ff7e0accSmrg	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171ff7e0accSmrg		eval $set_cc_for_build
172ff7e0accSmrg		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173ff7e0accSmrg			| grep __ELF__ >/dev/null
174ff7e0accSmrg		then
175ff7e0accSmrg		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
176ff7e0accSmrg		    # Return netbsd for either.  FIX?
177ff7e0accSmrg		    os=netbsd
178ff7e0accSmrg		else
179ff7e0accSmrg		    os=netbsdelf
180ff7e0accSmrg		fi
181ff7e0accSmrg		;;
182ff7e0accSmrg	    *)
183ff7e0accSmrg	        os=netbsd
184ff7e0accSmrg		;;
185ff7e0accSmrg	esac
186ff7e0accSmrg	# The OS release
187ff7e0accSmrg	# Debian GNU/NetBSD machines have a different userland, and
188ff7e0accSmrg	# thus, need a distinct triplet. However, they do not need
189ff7e0accSmrg	# kernel version information, so it can be replaced with a
190ff7e0accSmrg	# suitable tag, in the style of linux-gnu.
191ff7e0accSmrg	case "${UNAME_VERSION}" in
192ff7e0accSmrg	    Debian*)
193ff7e0accSmrg		release='-gnu'
194ff7e0accSmrg		;;
195ff7e0accSmrg	    *)
196ff7e0accSmrg		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
197ff7e0accSmrg		;;
198ff7e0accSmrg	esac
199ff7e0accSmrg	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200ff7e0accSmrg	# contains redundant information, the shorter form:
201ff7e0accSmrg	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202ff7e0accSmrg	echo "${machine}-${os}${release}"
203ff7e0accSmrg	exit ;;
204ff7e0accSmrg    *:OpenBSD:*:*)
205ff7e0accSmrg	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206ff7e0accSmrg	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
207ff7e0accSmrg	exit ;;
208ff7e0accSmrg    *:ekkoBSD:*:*)
209ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
210ff7e0accSmrg	exit ;;
211ff7e0accSmrg    *:SolidBSD:*:*)
212ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
213ff7e0accSmrg	exit ;;
214ff7e0accSmrg    macppc:MirBSD:*:*)
215ff7e0accSmrg	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
216ff7e0accSmrg	exit ;;
217ff7e0accSmrg    *:MirBSD:*:*)
218ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219ff7e0accSmrg	exit ;;
220ff7e0accSmrg    alpha:OSF1:*:*)
221ff7e0accSmrg	case $UNAME_RELEASE in
222ff7e0accSmrg	*4.0)
223ff7e0accSmrg		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224ff7e0accSmrg		;;
225ff7e0accSmrg	*5.*)
226ff7e0accSmrg	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227ff7e0accSmrg		;;
228ff7e0accSmrg	esac
229ff7e0accSmrg	# According to Compaq, /usr/sbin/psrinfo has been available on
230ff7e0accSmrg	# OSF/1 and Tru64 systems produced since 1995.  I hope that
231ff7e0accSmrg	# covers most systems running today.  This code pipes the CPU
232ff7e0accSmrg	# types through head -n 1, so we only detect the type of CPU 0.
233ff7e0accSmrg	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234ff7e0accSmrg	case "$ALPHA_CPU_TYPE" in
235ff7e0accSmrg	    "EV4 (21064)")
236ff7e0accSmrg		UNAME_MACHINE="alpha" ;;
237ff7e0accSmrg	    "EV4.5 (21064)")
238ff7e0accSmrg		UNAME_MACHINE="alpha" ;;
239ff7e0accSmrg	    "LCA4 (21066/21068)")
240ff7e0accSmrg		UNAME_MACHINE="alpha" ;;
241ff7e0accSmrg	    "EV5 (21164)")
242ff7e0accSmrg		UNAME_MACHINE="alphaev5" ;;
243ff7e0accSmrg	    "EV5.6 (21164A)")
244ff7e0accSmrg		UNAME_MACHINE="alphaev56" ;;
245ff7e0accSmrg	    "EV5.6 (21164PC)")
246ff7e0accSmrg		UNAME_MACHINE="alphapca56" ;;
247ff7e0accSmrg	    "EV5.7 (21164PC)")
248ff7e0accSmrg		UNAME_MACHINE="alphapca57" ;;
249ff7e0accSmrg	    "EV6 (21264)")
250ff7e0accSmrg		UNAME_MACHINE="alphaev6" ;;
251ff7e0accSmrg	    "EV6.7 (21264A)")
252ff7e0accSmrg		UNAME_MACHINE="alphaev67" ;;
253ff7e0accSmrg	    "EV6.8CB (21264C)")
254ff7e0accSmrg		UNAME_MACHINE="alphaev68" ;;
255ff7e0accSmrg	    "EV6.8AL (21264B)")
256ff7e0accSmrg		UNAME_MACHINE="alphaev68" ;;
257ff7e0accSmrg	    "EV6.8CX (21264D)")
258ff7e0accSmrg		UNAME_MACHINE="alphaev68" ;;
259ff7e0accSmrg	    "EV6.9A (21264/EV69A)")
260ff7e0accSmrg		UNAME_MACHINE="alphaev69" ;;
261ff7e0accSmrg	    "EV7 (21364)")
262ff7e0accSmrg		UNAME_MACHINE="alphaev7" ;;
263ff7e0accSmrg	    "EV7.9 (21364A)")
264ff7e0accSmrg		UNAME_MACHINE="alphaev79" ;;
265ff7e0accSmrg	esac
266ff7e0accSmrg	# A Pn.n version is a patched version.
267ff7e0accSmrg	# A Vn.n version is a released version.
268ff7e0accSmrg	# A Tn.n version is a released field test version.
269ff7e0accSmrg	# A Xn.n version is an unreleased experimental baselevel.
270ff7e0accSmrg	# 1.2 uses "1.2" for uname -r.
271ff7e0accSmrg	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272ff7e0accSmrg	exit ;;
273ff7e0accSmrg    Alpha\ *:Windows_NT*:*)
274ff7e0accSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
275ff7e0accSmrg	# Should we change UNAME_MACHINE based on the output of uname instead
276ff7e0accSmrg	# of the specific Alpha model?
277ff7e0accSmrg	echo alpha-pc-interix
278ff7e0accSmrg	exit ;;
279ff7e0accSmrg    21064:Windows_NT:50:3)
280ff7e0accSmrg	echo alpha-dec-winnt3.5
281ff7e0accSmrg	exit ;;
282ff7e0accSmrg    Amiga*:UNIX_System_V:4.0:*)
283ff7e0accSmrg	echo m68k-unknown-sysv4
284ff7e0accSmrg	exit ;;
285ff7e0accSmrg    *:[Aa]miga[Oo][Ss]:*:*)
286ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-amigaos
287ff7e0accSmrg	exit ;;
288ff7e0accSmrg    *:[Mm]orph[Oo][Ss]:*:*)
289ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-morphos
290ff7e0accSmrg	exit ;;
291ff7e0accSmrg    *:OS/390:*:*)
292ff7e0accSmrg	echo i370-ibm-openedition
293ff7e0accSmrg	exit ;;
294ff7e0accSmrg    *:z/VM:*:*)
295ff7e0accSmrg	echo s390-ibm-zvmoe
296ff7e0accSmrg	exit ;;
297ff7e0accSmrg    *:OS400:*:*)
298ff7e0accSmrg        echo powerpc-ibm-os400
299ff7e0accSmrg	exit ;;
300ff7e0accSmrg    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301ff7e0accSmrg	echo arm-acorn-riscix${UNAME_RELEASE}
302ff7e0accSmrg	exit ;;
303ff7e0accSmrg    arm:riscos:*:*|arm:RISCOS:*:*)
304ff7e0accSmrg	echo arm-unknown-riscos
305ff7e0accSmrg	exit ;;
306ff7e0accSmrg    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
307ff7e0accSmrg	echo hppa1.1-hitachi-hiuxmpp
308ff7e0accSmrg	exit ;;
309ff7e0accSmrg    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
310ff7e0accSmrg	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
311ff7e0accSmrg	if test "`(/bin/universe) 2>/dev/null`" = att ; then
312ff7e0accSmrg		echo pyramid-pyramid-sysv3
313ff7e0accSmrg	else
314ff7e0accSmrg		echo pyramid-pyramid-bsd
315ff7e0accSmrg	fi
316ff7e0accSmrg	exit ;;
317ff7e0accSmrg    NILE*:*:*:dcosx)
318ff7e0accSmrg	echo pyramid-pyramid-svr4
319ff7e0accSmrg	exit ;;
320ff7e0accSmrg    DRS?6000:unix:4.0:6*)
321ff7e0accSmrg	echo sparc-icl-nx6
322ff7e0accSmrg	exit ;;
323ff7e0accSmrg    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
324ff7e0accSmrg	case `/usr/bin/uname -p` in
325ff7e0accSmrg	    sparc) echo sparc-icl-nx7; exit ;;
326ff7e0accSmrg	esac ;;
32710998002Smrg    s390x:SunOS:*:*)
32810998002Smrg	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
32910998002Smrg	exit ;;
330ff7e0accSmrg    sun4H:SunOS:5.*:*)
331ff7e0accSmrg	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
332ff7e0accSmrg	exit ;;
333ff7e0accSmrg    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
334ff7e0accSmrg	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
335ff7e0accSmrg	exit ;;
336ff7e0accSmrg    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
33710998002Smrg	eval $set_cc_for_build
33810998002Smrg	SUN_ARCH="i386"
33910998002Smrg	# If there is a compiler, see if it is configured for 64-bit objects.
34010998002Smrg	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
34110998002Smrg	# This test works for both compilers.
34210998002Smrg	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
34310998002Smrg	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
34410998002Smrg		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
34510998002Smrg		grep IS_64BIT_ARCH >/dev/null
34610998002Smrg	    then
34710998002Smrg		SUN_ARCH="x86_64"
34810998002Smrg	    fi
34910998002Smrg	fi
35010998002Smrg	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
351ff7e0accSmrg	exit ;;
352ff7e0accSmrg    sun4*:SunOS:6*:*)
353ff7e0accSmrg	# According to config.sub, this is the proper way to canonicalize
354ff7e0accSmrg	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
355ff7e0accSmrg	# it's likely to be more like Solaris than SunOS4.
356ff7e0accSmrg	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
357ff7e0accSmrg	exit ;;
358ff7e0accSmrg    sun4*:SunOS:*:*)
359ff7e0accSmrg	case "`/usr/bin/arch -k`" in
360ff7e0accSmrg	    Series*|S4*)
361ff7e0accSmrg		UNAME_RELEASE=`uname -v`
362ff7e0accSmrg		;;
363ff7e0accSmrg	esac
364ff7e0accSmrg	# Japanese Language versions have a version number like `4.1.3-JL'.
365ff7e0accSmrg	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
366ff7e0accSmrg	exit ;;
367ff7e0accSmrg    sun3*:SunOS:*:*)
368ff7e0accSmrg	echo m68k-sun-sunos${UNAME_RELEASE}
369ff7e0accSmrg	exit ;;
370ff7e0accSmrg    sun*:*:4.2BSD:*)
371ff7e0accSmrg	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
372ff7e0accSmrg	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
373ff7e0accSmrg	case "`/bin/arch`" in
374ff7e0accSmrg	    sun3)
375ff7e0accSmrg		echo m68k-sun-sunos${UNAME_RELEASE}
376ff7e0accSmrg		;;
377ff7e0accSmrg	    sun4)
378ff7e0accSmrg		echo sparc-sun-sunos${UNAME_RELEASE}
379ff7e0accSmrg		;;
380ff7e0accSmrg	esac
381ff7e0accSmrg	exit ;;
382ff7e0accSmrg    aushp:SunOS:*:*)
383ff7e0accSmrg	echo sparc-auspex-sunos${UNAME_RELEASE}
384ff7e0accSmrg	exit ;;
385ff7e0accSmrg    # The situation for MiNT is a little confusing.  The machine name
386ff7e0accSmrg    # can be virtually everything (everything which is not
387ff7e0accSmrg    # "atarist" or "atariste" at least should have a processor
388ff7e0accSmrg    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
389ff7e0accSmrg    # to the lowercase version "mint" (or "freemint").  Finally
390ff7e0accSmrg    # the system name "TOS" denotes a system which is actually not
391ff7e0accSmrg    # MiNT.  But MiNT is downward compatible to TOS, so this should
392ff7e0accSmrg    # be no problem.
393ff7e0accSmrg    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
394ff7e0accSmrg        echo m68k-atari-mint${UNAME_RELEASE}
395ff7e0accSmrg	exit ;;
396ff7e0accSmrg    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
397ff7e0accSmrg	echo m68k-atari-mint${UNAME_RELEASE}
398ff7e0accSmrg        exit ;;
399ff7e0accSmrg    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
400ff7e0accSmrg        echo m68k-atari-mint${UNAME_RELEASE}
401ff7e0accSmrg	exit ;;
402ff7e0accSmrg    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
403ff7e0accSmrg        echo m68k-milan-mint${UNAME_RELEASE}
404ff7e0accSmrg        exit ;;
405ff7e0accSmrg    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
406ff7e0accSmrg        echo m68k-hades-mint${UNAME_RELEASE}
407ff7e0accSmrg        exit ;;
408ff7e0accSmrg    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
409ff7e0accSmrg        echo m68k-unknown-mint${UNAME_RELEASE}
410ff7e0accSmrg        exit ;;
411ff7e0accSmrg    m68k:machten:*:*)
412ff7e0accSmrg	echo m68k-apple-machten${UNAME_RELEASE}
413ff7e0accSmrg	exit ;;
414ff7e0accSmrg    powerpc:machten:*:*)
415ff7e0accSmrg	echo powerpc-apple-machten${UNAME_RELEASE}
416ff7e0accSmrg	exit ;;
417ff7e0accSmrg    RISC*:Mach:*:*)
418ff7e0accSmrg	echo mips-dec-mach_bsd4.3
419ff7e0accSmrg	exit ;;
420ff7e0accSmrg    RISC*:ULTRIX:*:*)
421ff7e0accSmrg	echo mips-dec-ultrix${UNAME_RELEASE}
422ff7e0accSmrg	exit ;;
423ff7e0accSmrg    VAX*:ULTRIX*:*:*)
424ff7e0accSmrg	echo vax-dec-ultrix${UNAME_RELEASE}
425ff7e0accSmrg	exit ;;
426ff7e0accSmrg    2020:CLIX:*:* | 2430:CLIX:*:*)
427ff7e0accSmrg	echo clipper-intergraph-clix${UNAME_RELEASE}
428ff7e0accSmrg	exit ;;
429ff7e0accSmrg    mips:*:*:UMIPS | mips:*:*:RISCos)
430ff7e0accSmrg	eval $set_cc_for_build
431ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
432ff7e0accSmrg#ifdef __cplusplus
433ff7e0accSmrg#include <stdio.h>  /* for printf() prototype */
434ff7e0accSmrg	int main (int argc, char *argv[]) {
435ff7e0accSmrg#else
436ff7e0accSmrg	int main (argc, argv) int argc; char *argv[]; {
437ff7e0accSmrg#endif
438ff7e0accSmrg	#if defined (host_mips) && defined (MIPSEB)
439ff7e0accSmrg	#if defined (SYSTYPE_SYSV)
440ff7e0accSmrg	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
441ff7e0accSmrg	#endif
442ff7e0accSmrg	#if defined (SYSTYPE_SVR4)
443ff7e0accSmrg	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
444ff7e0accSmrg	#endif
445ff7e0accSmrg	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
446ff7e0accSmrg	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
447ff7e0accSmrg	#endif
448ff7e0accSmrg	#endif
449ff7e0accSmrg	  exit (-1);
450ff7e0accSmrg	}
451ff7e0accSmrgEOF
452ff7e0accSmrg	$CC_FOR_BUILD -o $dummy $dummy.c &&
453ff7e0accSmrg	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
454ff7e0accSmrg	  SYSTEM_NAME=`$dummy $dummyarg` &&
455ff7e0accSmrg	    { echo "$SYSTEM_NAME"; exit; }
456ff7e0accSmrg	echo mips-mips-riscos${UNAME_RELEASE}
457ff7e0accSmrg	exit ;;
458ff7e0accSmrg    Motorola:PowerMAX_OS:*:*)
459ff7e0accSmrg	echo powerpc-motorola-powermax
460ff7e0accSmrg	exit ;;
461ff7e0accSmrg    Motorola:*:4.3:PL8-*)
462ff7e0accSmrg	echo powerpc-harris-powermax
463ff7e0accSmrg	exit ;;
464ff7e0accSmrg    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
465ff7e0accSmrg	echo powerpc-harris-powermax
466ff7e0accSmrg	exit ;;
467ff7e0accSmrg    Night_Hawk:Power_UNIX:*:*)
468ff7e0accSmrg	echo powerpc-harris-powerunix
469ff7e0accSmrg	exit ;;
470ff7e0accSmrg    m88k:CX/UX:7*:*)
471ff7e0accSmrg	echo m88k-harris-cxux7
472ff7e0accSmrg	exit ;;
473ff7e0accSmrg    m88k:*:4*:R4*)
474ff7e0accSmrg	echo m88k-motorola-sysv4
475ff7e0accSmrg	exit ;;
476ff7e0accSmrg    m88k:*:3*:R3*)
477ff7e0accSmrg	echo m88k-motorola-sysv3
478ff7e0accSmrg	exit ;;
479ff7e0accSmrg    AViiON:dgux:*:*)
480ff7e0accSmrg        # DG/UX returns AViiON for all architectures
481ff7e0accSmrg        UNAME_PROCESSOR=`/usr/bin/uname -p`
482ff7e0accSmrg	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
483ff7e0accSmrg	then
484ff7e0accSmrg	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
485ff7e0accSmrg	       [ ${TARGET_BINARY_INTERFACE}x = x ]
486ff7e0accSmrg	    then
487ff7e0accSmrg		echo m88k-dg-dgux${UNAME_RELEASE}
488ff7e0accSmrg	    else
489ff7e0accSmrg		echo m88k-dg-dguxbcs${UNAME_RELEASE}
490ff7e0accSmrg	    fi
491ff7e0accSmrg	else
492ff7e0accSmrg	    echo i586-dg-dgux${UNAME_RELEASE}
493ff7e0accSmrg	fi
494ff7e0accSmrg 	exit ;;
495ff7e0accSmrg    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
496ff7e0accSmrg	echo m88k-dolphin-sysv3
497ff7e0accSmrg	exit ;;
498ff7e0accSmrg    M88*:*:R3*:*)
499ff7e0accSmrg	# Delta 88k system running SVR3
500ff7e0accSmrg	echo m88k-motorola-sysv3
501ff7e0accSmrg	exit ;;
502ff7e0accSmrg    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
503ff7e0accSmrg	echo m88k-tektronix-sysv3
504ff7e0accSmrg	exit ;;
505ff7e0accSmrg    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
506ff7e0accSmrg	echo m68k-tektronix-bsd
507ff7e0accSmrg	exit ;;
508ff7e0accSmrg    *:IRIX*:*:*)
509ff7e0accSmrg	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
510ff7e0accSmrg	exit ;;
511ff7e0accSmrg    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
512ff7e0accSmrg	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
513ff7e0accSmrg	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
514ff7e0accSmrg    i*86:AIX:*:*)
515ff7e0accSmrg	echo i386-ibm-aix
516ff7e0accSmrg	exit ;;
517ff7e0accSmrg    ia64:AIX:*:*)
518ff7e0accSmrg	if [ -x /usr/bin/oslevel ] ; then
519ff7e0accSmrg		IBM_REV=`/usr/bin/oslevel`
520ff7e0accSmrg	else
521ff7e0accSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
522ff7e0accSmrg	fi
523ff7e0accSmrg	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
524ff7e0accSmrg	exit ;;
525ff7e0accSmrg    *:AIX:2:3)
526ff7e0accSmrg	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
527ff7e0accSmrg		eval $set_cc_for_build
528ff7e0accSmrg		sed 's/^		//' << EOF >$dummy.c
529ff7e0accSmrg		#include <sys/systemcfg.h>
530ff7e0accSmrg
531ff7e0accSmrg		main()
532ff7e0accSmrg			{
533ff7e0accSmrg			if (!__power_pc())
534ff7e0accSmrg				exit(1);
535ff7e0accSmrg			puts("powerpc-ibm-aix3.2.5");
536ff7e0accSmrg			exit(0);
537ff7e0accSmrg			}
538ff7e0accSmrgEOF
539ff7e0accSmrg		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
540ff7e0accSmrg		then
541ff7e0accSmrg			echo "$SYSTEM_NAME"
542ff7e0accSmrg		else
543ff7e0accSmrg			echo rs6000-ibm-aix3.2.5
544ff7e0accSmrg		fi
545ff7e0accSmrg	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
546ff7e0accSmrg		echo rs6000-ibm-aix3.2.4
547ff7e0accSmrg	else
548ff7e0accSmrg		echo rs6000-ibm-aix3.2
549ff7e0accSmrg	fi
550ff7e0accSmrg	exit ;;
551a005d216Smrg    *:AIX:*:[456])
552ff7e0accSmrg	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
553ff7e0accSmrg	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
554ff7e0accSmrg		IBM_ARCH=rs6000
555ff7e0accSmrg	else
556ff7e0accSmrg		IBM_ARCH=powerpc
557ff7e0accSmrg	fi
558ff7e0accSmrg	if [ -x /usr/bin/oslevel ] ; then
559ff7e0accSmrg		IBM_REV=`/usr/bin/oslevel`
560ff7e0accSmrg	else
561ff7e0accSmrg		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
562ff7e0accSmrg	fi
563ff7e0accSmrg	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
564ff7e0accSmrg	exit ;;
565ff7e0accSmrg    *:AIX:*:*)
566ff7e0accSmrg	echo rs6000-ibm-aix
567ff7e0accSmrg	exit ;;
568ff7e0accSmrg    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
569ff7e0accSmrg	echo romp-ibm-bsd4.4
570ff7e0accSmrg	exit ;;
571ff7e0accSmrg    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
572ff7e0accSmrg	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
573ff7e0accSmrg	exit ;;                             # report: romp-ibm BSD 4.3
574ff7e0accSmrg    *:BOSX:*:*)
575ff7e0accSmrg	echo rs6000-bull-bosx
576ff7e0accSmrg	exit ;;
577ff7e0accSmrg    DPX/2?00:B.O.S.:*:*)
578ff7e0accSmrg	echo m68k-bull-sysv3
579ff7e0accSmrg	exit ;;
580ff7e0accSmrg    9000/[34]??:4.3bsd:1.*:*)
581ff7e0accSmrg	echo m68k-hp-bsd
582ff7e0accSmrg	exit ;;
583ff7e0accSmrg    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
584ff7e0accSmrg	echo m68k-hp-bsd4.4
585ff7e0accSmrg	exit ;;
586ff7e0accSmrg    9000/[34678]??:HP-UX:*:*)
587ff7e0accSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
588ff7e0accSmrg	case "${UNAME_MACHINE}" in
589ff7e0accSmrg	    9000/31? )            HP_ARCH=m68000 ;;
590ff7e0accSmrg	    9000/[34]?? )         HP_ARCH=m68k ;;
591ff7e0accSmrg	    9000/[678][0-9][0-9])
592ff7e0accSmrg		if [ -x /usr/bin/getconf ]; then
593ff7e0accSmrg		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
594ff7e0accSmrg                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
595ff7e0accSmrg                    case "${sc_cpu_version}" in
596ff7e0accSmrg                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
597ff7e0accSmrg                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
598ff7e0accSmrg                      532)                      # CPU_PA_RISC2_0
599ff7e0accSmrg                        case "${sc_kernel_bits}" in
600ff7e0accSmrg                          32) HP_ARCH="hppa2.0n" ;;
601ff7e0accSmrg                          64) HP_ARCH="hppa2.0w" ;;
602ff7e0accSmrg			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
603ff7e0accSmrg                        esac ;;
604ff7e0accSmrg                    esac
605ff7e0accSmrg		fi
606ff7e0accSmrg		if [ "${HP_ARCH}" = "" ]; then
607ff7e0accSmrg		    eval $set_cc_for_build
608ff7e0accSmrg		    sed 's/^              //' << EOF >$dummy.c
609ff7e0accSmrg
610ff7e0accSmrg              #define _HPUX_SOURCE
611ff7e0accSmrg              #include <stdlib.h>
612ff7e0accSmrg              #include <unistd.h>
613ff7e0accSmrg
614ff7e0accSmrg              int main ()
615ff7e0accSmrg              {
616ff7e0accSmrg              #if defined(_SC_KERNEL_BITS)
617ff7e0accSmrg                  long bits = sysconf(_SC_KERNEL_BITS);
618ff7e0accSmrg              #endif
619ff7e0accSmrg                  long cpu  = sysconf (_SC_CPU_VERSION);
620ff7e0accSmrg
621ff7e0accSmrg                  switch (cpu)
622ff7e0accSmrg              	{
623ff7e0accSmrg              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
624ff7e0accSmrg              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
625ff7e0accSmrg              	case CPU_PA_RISC2_0:
626ff7e0accSmrg              #if defined(_SC_KERNEL_BITS)
627ff7e0accSmrg              	    switch (bits)
628ff7e0accSmrg              		{
629ff7e0accSmrg              		case 64: puts ("hppa2.0w"); break;
630ff7e0accSmrg              		case 32: puts ("hppa2.0n"); break;
631ff7e0accSmrg              		default: puts ("hppa2.0"); break;
632ff7e0accSmrg              		} break;
633ff7e0accSmrg              #else  /* !defined(_SC_KERNEL_BITS) */
634ff7e0accSmrg              	    puts ("hppa2.0"); break;
635ff7e0accSmrg              #endif
636ff7e0accSmrg              	default: puts ("hppa1.0"); break;
637ff7e0accSmrg              	}
638ff7e0accSmrg                  exit (0);
639ff7e0accSmrg              }
640ff7e0accSmrgEOF
641ff7e0accSmrg		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
642ff7e0accSmrg		    test -z "$HP_ARCH" && HP_ARCH=hppa
643ff7e0accSmrg		fi ;;
644ff7e0accSmrg	esac
645ff7e0accSmrg	if [ ${HP_ARCH} = "hppa2.0w" ]
646ff7e0accSmrg	then
647ff7e0accSmrg	    eval $set_cc_for_build
648ff7e0accSmrg
649ff7e0accSmrg	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
650ff7e0accSmrg	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
651ff7e0accSmrg	    # generating 64-bit code.  GNU and HP use different nomenclature:
652ff7e0accSmrg	    #
653ff7e0accSmrg	    # $ CC_FOR_BUILD=cc ./config.guess
654ff7e0accSmrg	    # => hppa2.0w-hp-hpux11.23
655ff7e0accSmrg	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
656ff7e0accSmrg	    # => hppa64-hp-hpux11.23
657ff7e0accSmrg
658ff7e0accSmrg	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
659ff7e0accSmrg		grep __LP64__ >/dev/null
660ff7e0accSmrg	    then
661ff7e0accSmrg		HP_ARCH="hppa2.0w"
662ff7e0accSmrg	    else
663ff7e0accSmrg		HP_ARCH="hppa64"
664ff7e0accSmrg	    fi
665ff7e0accSmrg	fi
666ff7e0accSmrg	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
667ff7e0accSmrg	exit ;;
668ff7e0accSmrg    ia64:HP-UX:*:*)
669ff7e0accSmrg	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
670ff7e0accSmrg	echo ia64-hp-hpux${HPUX_REV}
671ff7e0accSmrg	exit ;;
672ff7e0accSmrg    3050*:HI-UX:*:*)
673ff7e0accSmrg	eval $set_cc_for_build
674ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
675ff7e0accSmrg	#include <unistd.h>
676ff7e0accSmrg	int
677ff7e0accSmrg	main ()
678ff7e0accSmrg	{
679ff7e0accSmrg	  long cpu = sysconf (_SC_CPU_VERSION);
680ff7e0accSmrg	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
681ff7e0accSmrg	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
682ff7e0accSmrg	     results, however.  */
683ff7e0accSmrg	  if (CPU_IS_PA_RISC (cpu))
684ff7e0accSmrg	    {
685ff7e0accSmrg	      switch (cpu)
686ff7e0accSmrg		{
687ff7e0accSmrg		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
688ff7e0accSmrg		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
689ff7e0accSmrg		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
690ff7e0accSmrg		  default: puts ("hppa-hitachi-hiuxwe2"); break;
691ff7e0accSmrg		}
692ff7e0accSmrg	    }
693ff7e0accSmrg	  else if (CPU_IS_HP_MC68K (cpu))
694ff7e0accSmrg	    puts ("m68k-hitachi-hiuxwe2");
695ff7e0accSmrg	  else puts ("unknown-hitachi-hiuxwe2");
696ff7e0accSmrg	  exit (0);
697ff7e0accSmrg	}
698ff7e0accSmrgEOF
699ff7e0accSmrg	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
700ff7e0accSmrg		{ echo "$SYSTEM_NAME"; exit; }
701ff7e0accSmrg	echo unknown-hitachi-hiuxwe2
702ff7e0accSmrg	exit ;;
703ff7e0accSmrg    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
704ff7e0accSmrg	echo hppa1.1-hp-bsd
705ff7e0accSmrg	exit ;;
706ff7e0accSmrg    9000/8??:4.3bsd:*:*)
707ff7e0accSmrg	echo hppa1.0-hp-bsd
708ff7e0accSmrg	exit ;;
709ff7e0accSmrg    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
710ff7e0accSmrg	echo hppa1.0-hp-mpeix
711ff7e0accSmrg	exit ;;
712ff7e0accSmrg    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
713ff7e0accSmrg	echo hppa1.1-hp-osf
714ff7e0accSmrg	exit ;;
715ff7e0accSmrg    hp8??:OSF1:*:*)
716ff7e0accSmrg	echo hppa1.0-hp-osf
717ff7e0accSmrg	exit ;;
718ff7e0accSmrg    i*86:OSF1:*:*)
719ff7e0accSmrg	if [ -x /usr/sbin/sysversion ] ; then
720ff7e0accSmrg	    echo ${UNAME_MACHINE}-unknown-osf1mk
721ff7e0accSmrg	else
722ff7e0accSmrg	    echo ${UNAME_MACHINE}-unknown-osf1
723ff7e0accSmrg	fi
724ff7e0accSmrg	exit ;;
725ff7e0accSmrg    parisc*:Lites*:*:*)
726ff7e0accSmrg	echo hppa1.1-hp-lites
727ff7e0accSmrg	exit ;;
728ff7e0accSmrg    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
729ff7e0accSmrg	echo c1-convex-bsd
730ff7e0accSmrg        exit ;;
731ff7e0accSmrg    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
732ff7e0accSmrg	if getsysinfo -f scalar_acc
733ff7e0accSmrg	then echo c32-convex-bsd
734ff7e0accSmrg	else echo c2-convex-bsd
735ff7e0accSmrg	fi
736ff7e0accSmrg        exit ;;
737ff7e0accSmrg    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
738ff7e0accSmrg	echo c34-convex-bsd
739ff7e0accSmrg        exit ;;
740ff7e0accSmrg    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
741ff7e0accSmrg	echo c38-convex-bsd
742ff7e0accSmrg        exit ;;
743ff7e0accSmrg    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
744ff7e0accSmrg	echo c4-convex-bsd
745ff7e0accSmrg        exit ;;
746ff7e0accSmrg    CRAY*Y-MP:*:*:*)
747ff7e0accSmrg	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
748ff7e0accSmrg	exit ;;
749ff7e0accSmrg    CRAY*[A-Z]90:*:*:*)
750ff7e0accSmrg	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
751ff7e0accSmrg	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
752ff7e0accSmrg	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
753ff7e0accSmrg	      -e 's/\.[^.]*$/.X/'
754ff7e0accSmrg	exit ;;
755ff7e0accSmrg    CRAY*TS:*:*:*)
756ff7e0accSmrg	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
757ff7e0accSmrg	exit ;;
758ff7e0accSmrg    CRAY*T3E:*:*:*)
759ff7e0accSmrg	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
760ff7e0accSmrg	exit ;;
761ff7e0accSmrg    CRAY*SV1:*:*:*)
762ff7e0accSmrg	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
763ff7e0accSmrg	exit ;;
764ff7e0accSmrg    *:UNICOS/mp:*:*)
765ff7e0accSmrg	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
766ff7e0accSmrg	exit ;;
767ff7e0accSmrg    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
768ff7e0accSmrg	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
769ff7e0accSmrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
770ff7e0accSmrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
771ff7e0accSmrg        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
772ff7e0accSmrg        exit ;;
773ff7e0accSmrg    5000:UNIX_System_V:4.*:*)
774ff7e0accSmrg        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
775ff7e0accSmrg        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
776ff7e0accSmrg        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
777ff7e0accSmrg	exit ;;
778ff7e0accSmrg    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
779ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
780ff7e0accSmrg	exit ;;
781ff7e0accSmrg    sparc*:BSD/OS:*:*)
782ff7e0accSmrg	echo sparc-unknown-bsdi${UNAME_RELEASE}
783ff7e0accSmrg	exit ;;
784ff7e0accSmrg    *:BSD/OS:*:*)
785ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
786ff7e0accSmrg	exit ;;
787ff7e0accSmrg    *:FreeBSD:*:*)
788ff7e0accSmrg	case ${UNAME_MACHINE} in
789ff7e0accSmrg	    pc98)
790ff7e0accSmrg		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
791ff7e0accSmrg	    amd64)
792ff7e0accSmrg		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
793ff7e0accSmrg	    *)
794ff7e0accSmrg		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
795ff7e0accSmrg	esac
796ff7e0accSmrg	exit ;;
797ff7e0accSmrg    i*:CYGWIN*:*)
798ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-cygwin
799ff7e0accSmrg	exit ;;
800ff7e0accSmrg    *:MINGW*:*)
801ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-mingw32
802ff7e0accSmrg	exit ;;
803ff7e0accSmrg    i*:windows32*:*)
804ff7e0accSmrg    	# uname -m includes "-pc" on this system.
805ff7e0accSmrg    	echo ${UNAME_MACHINE}-mingw32
806ff7e0accSmrg	exit ;;
807ff7e0accSmrg    i*:PW*:*)
808ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-pw32
809ff7e0accSmrg	exit ;;
810ff7e0accSmrg    *:Interix*:[3456]*)
811ff7e0accSmrg    	case ${UNAME_MACHINE} in
812ff7e0accSmrg	    x86)
813ff7e0accSmrg		echo i586-pc-interix${UNAME_RELEASE}
814ff7e0accSmrg		exit ;;
81510998002Smrg	    EM64T | authenticamd | genuineintel)
816ff7e0accSmrg		echo x86_64-unknown-interix${UNAME_RELEASE}
817ff7e0accSmrg		exit ;;
818a005d216Smrg	    IA64)
819a005d216Smrg		echo ia64-unknown-interix${UNAME_RELEASE}
820a005d216Smrg		exit ;;
821ff7e0accSmrg	esac ;;
822ff7e0accSmrg    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
823ff7e0accSmrg	echo i${UNAME_MACHINE}-pc-mks
824ff7e0accSmrg	exit ;;
825ff7e0accSmrg    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
826ff7e0accSmrg	# How do we know it's Interix rather than the generic POSIX subsystem?
827ff7e0accSmrg	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
828ff7e0accSmrg	# UNAME_MACHINE based on the output of uname instead of i386?
829ff7e0accSmrg	echo i586-pc-interix
830ff7e0accSmrg	exit ;;
831ff7e0accSmrg    i*:UWIN*:*)
832ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-uwin
833ff7e0accSmrg	exit ;;
834ff7e0accSmrg    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
835ff7e0accSmrg	echo x86_64-unknown-cygwin
836ff7e0accSmrg	exit ;;
837ff7e0accSmrg    p*:CYGWIN*:*)
838ff7e0accSmrg	echo powerpcle-unknown-cygwin
839ff7e0accSmrg	exit ;;
840ff7e0accSmrg    prep*:SunOS:5.*:*)
841ff7e0accSmrg	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
842ff7e0accSmrg	exit ;;
843ff7e0accSmrg    *:GNU:*:*)
844ff7e0accSmrg	# the GNU system
845ff7e0accSmrg	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
846ff7e0accSmrg	exit ;;
847ff7e0accSmrg    *:GNU/*:*:*)
848ff7e0accSmrg	# other systems with GNU libc and userland
849ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
850ff7e0accSmrg	exit ;;
851ff7e0accSmrg    i*86:Minix:*:*)
852ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-minix
853ff7e0accSmrg	exit ;;
854ff7e0accSmrg    arm*:Linux:*:*)
855a005d216Smrg	eval $set_cc_for_build
856a005d216Smrg	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
857a005d216Smrg	    | grep -q __ARM_EABI__
858a005d216Smrg	then
85910998002Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnu
860a005d216Smrg	else
86110998002Smrg	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
862a005d216Smrg	fi
863ff7e0accSmrg	exit ;;
864ff7e0accSmrg    avr32*:Linux:*:*)
86510998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
866ff7e0accSmrg	exit ;;
867ff7e0accSmrg    cris:Linux:*:*)
86810998002Smrg	echo cris-axis-linux-gnu
869ff7e0accSmrg	exit ;;
870ff7e0accSmrg    crisv32:Linux:*:*)
87110998002Smrg	echo crisv32-axis-linux-gnu
872ff7e0accSmrg	exit ;;
873ff7e0accSmrg    frv:Linux:*:*)
87410998002Smrg    	echo frv-unknown-linux-gnu
875ff7e0accSmrg	exit ;;
876ff7e0accSmrg    ia64:Linux:*:*)
87710998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
878ff7e0accSmrg	exit ;;
879ff7e0accSmrg    m32r*:Linux:*:*)
88010998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
881ff7e0accSmrg	exit ;;
882ff7e0accSmrg    m68*:Linux:*:*)
88310998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
884ff7e0accSmrg	exit ;;
885ff7e0accSmrg    mips:Linux:*:*)
886ff7e0accSmrg	eval $set_cc_for_build
887ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
888ff7e0accSmrg	#undef CPU
889ff7e0accSmrg	#undef mips
890ff7e0accSmrg	#undef mipsel
891ff7e0accSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
892ff7e0accSmrg	CPU=mipsel
893ff7e0accSmrg	#else
894ff7e0accSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
895ff7e0accSmrg	CPU=mips
896ff7e0accSmrg	#else
897ff7e0accSmrg	CPU=
898ff7e0accSmrg	#endif
899ff7e0accSmrg	#endif
900ff7e0accSmrgEOF
901ff7e0accSmrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
902ff7e0accSmrg	    /^CPU/{
903ff7e0accSmrg		s: ::g
904ff7e0accSmrg		p
905ff7e0accSmrg	    }'`"
90610998002Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
907ff7e0accSmrg	;;
908ff7e0accSmrg    mips64:Linux:*:*)
909ff7e0accSmrg	eval $set_cc_for_build
910ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
911ff7e0accSmrg	#undef CPU
912ff7e0accSmrg	#undef mips64
913ff7e0accSmrg	#undef mips64el
914ff7e0accSmrg	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
915ff7e0accSmrg	CPU=mips64el
916ff7e0accSmrg	#else
917ff7e0accSmrg	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
918ff7e0accSmrg	CPU=mips64
919ff7e0accSmrg	#else
920ff7e0accSmrg	CPU=
921ff7e0accSmrg	#endif
922ff7e0accSmrg	#endif
923ff7e0accSmrgEOF
924ff7e0accSmrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
925ff7e0accSmrg	    /^CPU/{
926ff7e0accSmrg		s: ::g
927ff7e0accSmrg		p
928ff7e0accSmrg	    }'`"
92910998002Smrg	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
930ff7e0accSmrg	;;
931ff7e0accSmrg    or32:Linux:*:*)
93210998002Smrg	echo or32-unknown-linux-gnu
933ff7e0accSmrg	exit ;;
934ff7e0accSmrg    ppc:Linux:*:*)
93510998002Smrg	echo powerpc-unknown-linux-gnu
936ff7e0accSmrg	exit ;;
937ff7e0accSmrg    ppc64:Linux:*:*)
93810998002Smrg	echo powerpc64-unknown-linux-gnu
939ff7e0accSmrg	exit ;;
940ff7e0accSmrg    alpha:Linux:*:*)
941ff7e0accSmrg	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
942ff7e0accSmrg	  EV5)   UNAME_MACHINE=alphaev5 ;;
943ff7e0accSmrg	  EV56)  UNAME_MACHINE=alphaev56 ;;
944ff7e0accSmrg	  PCA56) UNAME_MACHINE=alphapca56 ;;
945ff7e0accSmrg	  PCA57) UNAME_MACHINE=alphapca56 ;;
946ff7e0accSmrg	  EV6)   UNAME_MACHINE=alphaev6 ;;
947ff7e0accSmrg	  EV67)  UNAME_MACHINE=alphaev67 ;;
948ff7e0accSmrg	  EV68*) UNAME_MACHINE=alphaev68 ;;
949ff7e0accSmrg        esac
950ff7e0accSmrg	objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
95110998002Smrg	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
95210998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
95310998002Smrg	exit ;;
95410998002Smrg    padre:Linux:*:*)
95510998002Smrg	echo sparc-unknown-linux-gnu
956ff7e0accSmrg	exit ;;
957ff7e0accSmrg    parisc:Linux:*:* | hppa:Linux:*:*)
958ff7e0accSmrg	# Look for CPU level
959ff7e0accSmrg	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
96010998002Smrg	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
96110998002Smrg	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
96210998002Smrg	  *)    echo hppa-unknown-linux-gnu ;;
963ff7e0accSmrg	esac
964ff7e0accSmrg	exit ;;
965ff7e0accSmrg    parisc64:Linux:*:* | hppa64:Linux:*:*)
96610998002Smrg	echo hppa64-unknown-linux-gnu
967ff7e0accSmrg	exit ;;
968ff7e0accSmrg    s390:Linux:*:* | s390x:Linux:*:*)
969ff7e0accSmrg	echo ${UNAME_MACHINE}-ibm-linux
970ff7e0accSmrg	exit ;;
971ff7e0accSmrg    sh64*:Linux:*:*)
97210998002Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
973ff7e0accSmrg	exit ;;
974ff7e0accSmrg    sh*:Linux:*:*)
97510998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
976ff7e0accSmrg	exit ;;
977ff7e0accSmrg    sparc:Linux:*:* | sparc64:Linux:*:*)
97810998002Smrg	echo ${UNAME_MACHINE}-unknown-linux-gnu
979ff7e0accSmrg	exit ;;
980ff7e0accSmrg    vax:Linux:*:*)
98110998002Smrg	echo ${UNAME_MACHINE}-dec-linux-gnu
982ff7e0accSmrg	exit ;;
983ff7e0accSmrg    x86_64:Linux:*:*)
98410998002Smrg	echo x86_64-unknown-linux-gnu
985ff7e0accSmrg	exit ;;
986a005d216Smrg    xtensa*:Linux:*:*)
98710998002Smrg    	echo ${UNAME_MACHINE}-unknown-linux-gnu
988ff7e0accSmrg	exit ;;
989ff7e0accSmrg    i*86:Linux:*:*)
990ff7e0accSmrg	# The BFD linker knows what the default object file format is, so
991ff7e0accSmrg	# first see if it will tell us. cd to the root directory to prevent
992ff7e0accSmrg	# problems with other programs or directories called `ld' in the path.
993ff7e0accSmrg	# Set LC_ALL=C to ensure ld outputs messages in English.
994ff7e0accSmrg	ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
995ff7e0accSmrg			 | sed -ne '/supported targets:/!d
996ff7e0accSmrg				    s/[ 	][ 	]*/ /g
997ff7e0accSmrg				    s/.*supported targets: *//
998ff7e0accSmrg				    s/ .*//
999ff7e0accSmrg				    p'`
1000ff7e0accSmrg        case "$ld_supported_targets" in
1001ff7e0accSmrg	  elf32-i386)
100210998002Smrg		TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
1003ff7e0accSmrg		;;
1004ff7e0accSmrg	  a.out-i386-linux)
100510998002Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuaout"
1006ff7e0accSmrg		exit ;;
1007ff7e0accSmrg	  "")
1008ff7e0accSmrg		# Either a pre-BFD a.out linker (linux-gnuoldld) or
1009ff7e0accSmrg		# one that does not give us useful --help.
101010998002Smrg		echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
1011ff7e0accSmrg		exit ;;
1012ff7e0accSmrg	esac
1013ff7e0accSmrg	# Determine whether the default compiler is a.out or elf
1014ff7e0accSmrg	eval $set_cc_for_build
1015ff7e0accSmrg	sed 's/^	//' << EOF >$dummy.c
1016ff7e0accSmrg	#include <features.h>
1017ff7e0accSmrg	#ifdef __ELF__
1018ff7e0accSmrg	# ifdef __GLIBC__
1019ff7e0accSmrg	#  if __GLIBC__ >= 2
1020ff7e0accSmrg	LIBC=gnu
1021ff7e0accSmrg	#  else
1022ff7e0accSmrg	LIBC=gnulibc1
1023ff7e0accSmrg	#  endif
1024ff7e0accSmrg	# else
1025ff7e0accSmrg	LIBC=gnulibc1
1026ff7e0accSmrg	# endif
1027ff7e0accSmrg	#else
1028ff7e0accSmrg	#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
1029ff7e0accSmrg	LIBC=gnu
1030ff7e0accSmrg	#else
1031ff7e0accSmrg	LIBC=gnuaout
1032ff7e0accSmrg	#endif
1033ff7e0accSmrg	#endif
1034ff7e0accSmrg	#ifdef __dietlibc__
1035ff7e0accSmrg	LIBC=dietlibc
1036ff7e0accSmrg	#endif
1037ff7e0accSmrgEOF
1038ff7e0accSmrg	eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
1039ff7e0accSmrg	    /^LIBC/{
1040ff7e0accSmrg		s: ::g
1041ff7e0accSmrg		p
1042ff7e0accSmrg	    }'`"
1043ff7e0accSmrg	test x"${LIBC}" != x && {
1044ff7e0accSmrg		echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1045ff7e0accSmrg		exit
1046ff7e0accSmrg	}
1047ff7e0accSmrg	test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
1048ff7e0accSmrg	;;
1049ff7e0accSmrg    i*86:DYNIX/ptx:4*:*)
1050ff7e0accSmrg	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
1051ff7e0accSmrg	# earlier versions are messed up and put the nodename in both
1052ff7e0accSmrg	# sysname and nodename.
1053ff7e0accSmrg	echo i386-sequent-sysv4
1054ff7e0accSmrg	exit ;;
1055ff7e0accSmrg    i*86:UNIX_SV:4.2MP:2.*)
1056ff7e0accSmrg        # Unixware is an offshoot of SVR4, but it has its own version
1057ff7e0accSmrg        # number series starting with 2...
1058ff7e0accSmrg        # I am not positive that other SVR4 systems won't match this,
1059ff7e0accSmrg	# I just have to hope.  -- rms.
1060ff7e0accSmrg        # Use sysv4.2uw... so that sysv4* matches it.
1061ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1062ff7e0accSmrg	exit ;;
1063ff7e0accSmrg    i*86:OS/2:*:*)
1064ff7e0accSmrg	# If we were able to find `uname', then EMX Unix compatibility
1065ff7e0accSmrg	# is probably installed.
1066ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-os2-emx
1067ff7e0accSmrg	exit ;;
1068ff7e0accSmrg    i*86:XTS-300:*:STOP)
1069ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-stop
1070ff7e0accSmrg	exit ;;
1071ff7e0accSmrg    i*86:atheos:*:*)
1072ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-atheos
1073ff7e0accSmrg	exit ;;
1074ff7e0accSmrg    i*86:syllable:*:*)
1075ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-syllable
1076ff7e0accSmrg	exit ;;
1077ff7e0accSmrg    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1078ff7e0accSmrg	echo i386-unknown-lynxos${UNAME_RELEASE}
1079ff7e0accSmrg	exit ;;
1080ff7e0accSmrg    i*86:*DOS:*:*)
1081ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-msdosdjgpp
1082ff7e0accSmrg	exit ;;
1083ff7e0accSmrg    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1084ff7e0accSmrg	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
1085ff7e0accSmrg	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1086ff7e0accSmrg		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
1087ff7e0accSmrg	else
1088ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1089ff7e0accSmrg	fi
1090ff7e0accSmrg	exit ;;
1091ff7e0accSmrg    i*86:*:5:[678]*)
1092ff7e0accSmrg    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
1093ff7e0accSmrg	case `/bin/uname -X | grep "^Machine"` in
1094ff7e0accSmrg	    *486*)	     UNAME_MACHINE=i486 ;;
1095ff7e0accSmrg	    *Pentium)	     UNAME_MACHINE=i586 ;;
1096ff7e0accSmrg	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1097ff7e0accSmrg	esac
1098ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
1099ff7e0accSmrg	exit ;;
1100ff7e0accSmrg    i*86:*:3.2:*)
1101ff7e0accSmrg	if test -f /usr/options/cb.name; then
1102ff7e0accSmrg		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1103ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1104ff7e0accSmrg	elif /bin/uname -X 2>/dev/null >/dev/null ; then
1105ff7e0accSmrg		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1106ff7e0accSmrg		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1107ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
1108ff7e0accSmrg			&& UNAME_MACHINE=i586
1109ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
1110ff7e0accSmrg			&& UNAME_MACHINE=i686
1111ff7e0accSmrg		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1112ff7e0accSmrg			&& UNAME_MACHINE=i686
1113ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1114ff7e0accSmrg	else
1115ff7e0accSmrg		echo ${UNAME_MACHINE}-pc-sysv32
1116ff7e0accSmrg	fi
1117ff7e0accSmrg	exit ;;
1118ff7e0accSmrg    pc:*:*:*)
1119ff7e0accSmrg	# Left here for compatibility:
1120ff7e0accSmrg        # uname -m prints for DJGPP always 'pc', but it prints nothing about
112110998002Smrg        # the processor, so we play safe by assuming i586.
112210998002Smrg	# Note: whatever this is, it MUST be the same as what config.sub
112310998002Smrg	# prints for the "djgpp" host, or else GDB configury will decide that
112410998002Smrg	# this is a cross-build.
112510998002Smrg	echo i586-pc-msdosdjgpp
1126ff7e0accSmrg        exit ;;
1127ff7e0accSmrg    Intel:Mach:3*:*)
1128ff7e0accSmrg	echo i386-pc-mach3
1129ff7e0accSmrg	exit ;;
1130ff7e0accSmrg    paragon:*:*:*)
1131ff7e0accSmrg	echo i860-intel-osf1
1132ff7e0accSmrg	exit ;;
1133ff7e0accSmrg    i860:*:4.*:*) # i860-SVR4
1134ff7e0accSmrg	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1135ff7e0accSmrg	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
1136ff7e0accSmrg	else # Add other i860-SVR4 vendors below as they are discovered.
1137ff7e0accSmrg	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
1138ff7e0accSmrg	fi
1139ff7e0accSmrg	exit ;;
1140ff7e0accSmrg    mini*:CTIX:SYS*5:*)
1141ff7e0accSmrg	# "miniframe"
1142ff7e0accSmrg	echo m68010-convergent-sysv
1143ff7e0accSmrg	exit ;;
1144ff7e0accSmrg    mc68k:UNIX:SYSTEM5:3.51m)
1145ff7e0accSmrg	echo m68k-convergent-sysv
1146ff7e0accSmrg	exit ;;
1147ff7e0accSmrg    M680?0:D-NIX:5.3:*)
1148ff7e0accSmrg	echo m68k-diab-dnix
1149ff7e0accSmrg	exit ;;
1150ff7e0accSmrg    M68*:*:R3V[5678]*:*)
1151ff7e0accSmrg	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1152ff7e0accSmrg    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)
1153ff7e0accSmrg	OS_REL=''
1154ff7e0accSmrg	test -r /etc/.relid \
1155ff7e0accSmrg	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1156ff7e0accSmrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1157ff7e0accSmrg	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
1158ff7e0accSmrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1159ff7e0accSmrg	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1160ff7e0accSmrg    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1161ff7e0accSmrg        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1162ff7e0accSmrg          && { echo i486-ncr-sysv4; exit; } ;;
116310998002Smrg    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
116410998002Smrg	OS_REL='.3'
116510998002Smrg	test -r /etc/.relid \
116610998002Smrg	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
116710998002Smrg	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
116810998002Smrg	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
116910998002Smrg	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
117010998002Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
117110998002Smrg	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
117210998002Smrg	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
1173ff7e0accSmrg    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1174ff7e0accSmrg	echo m68k-unknown-lynxos${UNAME_RELEASE}
1175ff7e0accSmrg	exit ;;
1176ff7e0accSmrg    mc68030:UNIX_System_V:4.*:*)
1177ff7e0accSmrg	echo m68k-atari-sysv4
1178ff7e0accSmrg	exit ;;
1179ff7e0accSmrg    TSUNAMI:LynxOS:2.*:*)
1180ff7e0accSmrg	echo sparc-unknown-lynxos${UNAME_RELEASE}
1181ff7e0accSmrg	exit ;;
1182ff7e0accSmrg    rs6000:LynxOS:2.*:*)
1183ff7e0accSmrg	echo rs6000-unknown-lynxos${UNAME_RELEASE}
1184ff7e0accSmrg	exit ;;
1185ff7e0accSmrg    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1186ff7e0accSmrg	echo powerpc-unknown-lynxos${UNAME_RELEASE}
1187ff7e0accSmrg	exit ;;
1188ff7e0accSmrg    SM[BE]S:UNIX_SV:*:*)
1189ff7e0accSmrg	echo mips-dde-sysv${UNAME_RELEASE}
1190ff7e0accSmrg	exit ;;
1191ff7e0accSmrg    RM*:ReliantUNIX-*:*:*)
1192ff7e0accSmrg	echo mips-sni-sysv4
1193ff7e0accSmrg	exit ;;
1194ff7e0accSmrg    RM*:SINIX-*:*:*)
1195ff7e0accSmrg	echo mips-sni-sysv4
1196ff7e0accSmrg	exit ;;
1197ff7e0accSmrg    *:SINIX-*:*:*)
1198ff7e0accSmrg	if uname -p 2>/dev/null >/dev/null ; then
1199ff7e0accSmrg		UNAME_MACHINE=`(uname -p) 2>/dev/null`
1200ff7e0accSmrg		echo ${UNAME_MACHINE}-sni-sysv4
1201ff7e0accSmrg	else
1202ff7e0accSmrg		echo ns32k-sni-sysv
1203ff7e0accSmrg	fi
1204ff7e0accSmrg	exit ;;
1205ff7e0accSmrg    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1206ff7e0accSmrg                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1207ff7e0accSmrg        echo i586-unisys-sysv4
1208ff7e0accSmrg        exit ;;
1209ff7e0accSmrg    *:UNIX_System_V:4*:FTX*)
1210ff7e0accSmrg	# From Gerald Hewes <hewes@openmarket.com>.
1211ff7e0accSmrg	# How about differentiating between stratus architectures? -djm
1212ff7e0accSmrg	echo hppa1.1-stratus-sysv4
1213ff7e0accSmrg	exit ;;
1214ff7e0accSmrg    *:*:*:FTX*)
1215ff7e0accSmrg	# From seanf@swdc.stratus.com.
1216ff7e0accSmrg	echo i860-stratus-sysv4
1217ff7e0accSmrg	exit ;;
1218ff7e0accSmrg    i*86:VOS:*:*)
1219ff7e0accSmrg	# From Paul.Green@stratus.com.
1220ff7e0accSmrg	echo ${UNAME_MACHINE}-stratus-vos
1221ff7e0accSmrg	exit ;;
1222ff7e0accSmrg    *:VOS:*:*)
1223ff7e0accSmrg	# From Paul.Green@stratus.com.
1224ff7e0accSmrg	echo hppa1.1-stratus-vos
1225ff7e0accSmrg	exit ;;
1226ff7e0accSmrg    mc68*:A/UX:*:*)
1227ff7e0accSmrg	echo m68k-apple-aux${UNAME_RELEASE}
1228ff7e0accSmrg	exit ;;
1229ff7e0accSmrg    news*:NEWS-OS:6*:*)
1230ff7e0accSmrg	echo mips-sony-newsos6
1231ff7e0accSmrg	exit ;;
1232ff7e0accSmrg    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1233ff7e0accSmrg	if [ -d /usr/nec ]; then
1234ff7e0accSmrg	        echo mips-nec-sysv${UNAME_RELEASE}
1235ff7e0accSmrg	else
1236ff7e0accSmrg	        echo mips-unknown-sysv${UNAME_RELEASE}
1237ff7e0accSmrg	fi
1238ff7e0accSmrg        exit ;;
1239ff7e0accSmrg    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
1240ff7e0accSmrg	echo powerpc-be-beos
1241ff7e0accSmrg	exit ;;
1242ff7e0accSmrg    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
1243ff7e0accSmrg	echo powerpc-apple-beos
1244ff7e0accSmrg	exit ;;
1245ff7e0accSmrg    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
1246ff7e0accSmrg	echo i586-pc-beos
1247ff7e0accSmrg	exit ;;
124810998002Smrg    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
124910998002Smrg	echo i586-pc-haiku
125010998002Smrg	exit ;;
1251ff7e0accSmrg    SX-4:SUPER-UX:*:*)
1252ff7e0accSmrg	echo sx4-nec-superux${UNAME_RELEASE}
1253ff7e0accSmrg	exit ;;
1254ff7e0accSmrg    SX-5:SUPER-UX:*:*)
1255ff7e0accSmrg	echo sx5-nec-superux${UNAME_RELEASE}
1256ff7e0accSmrg	exit ;;
1257ff7e0accSmrg    SX-6:SUPER-UX:*:*)
1258ff7e0accSmrg	echo sx6-nec-superux${UNAME_RELEASE}
1259ff7e0accSmrg	exit ;;
1260ff7e0accSmrg    SX-7:SUPER-UX:*:*)
1261ff7e0accSmrg	echo sx7-nec-superux${UNAME_RELEASE}
1262ff7e0accSmrg	exit ;;
1263ff7e0accSmrg    SX-8:SUPER-UX:*:*)
1264ff7e0accSmrg	echo sx8-nec-superux${UNAME_RELEASE}
1265ff7e0accSmrg	exit ;;
1266ff7e0accSmrg    SX-8R:SUPER-UX:*:*)
1267ff7e0accSmrg	echo sx8r-nec-superux${UNAME_RELEASE}
1268ff7e0accSmrg	exit ;;
1269ff7e0accSmrg    Power*:Rhapsody:*:*)
1270ff7e0accSmrg	echo powerpc-apple-rhapsody${UNAME_RELEASE}
1271ff7e0accSmrg	exit ;;
1272ff7e0accSmrg    *:Rhapsody:*:*)
1273ff7e0accSmrg	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1274ff7e0accSmrg	exit ;;
1275ff7e0accSmrg    *:Darwin:*:*)
1276ff7e0accSmrg	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1277ff7e0accSmrg	case $UNAME_PROCESSOR in
1278ff7e0accSmrg	    unknown) UNAME_PROCESSOR=powerpc ;;
1279ff7e0accSmrg	esac
1280ff7e0accSmrg	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1281ff7e0accSmrg	exit ;;
1282ff7e0accSmrg    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1283ff7e0accSmrg	UNAME_PROCESSOR=`uname -p`
1284ff7e0accSmrg	if test "$UNAME_PROCESSOR" = "x86"; then
1285ff7e0accSmrg		UNAME_PROCESSOR=i386
1286ff7e0accSmrg		UNAME_MACHINE=pc
1287ff7e0accSmrg	fi
1288ff7e0accSmrg	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1289ff7e0accSmrg	exit ;;
1290ff7e0accSmrg    *:QNX:*:4*)
1291ff7e0accSmrg	echo i386-pc-qnx
1292ff7e0accSmrg	exit ;;
1293ff7e0accSmrg    NSE-?:NONSTOP_KERNEL:*:*)
1294ff7e0accSmrg	echo nse-tandem-nsk${UNAME_RELEASE}
1295ff7e0accSmrg	exit ;;
1296ff7e0accSmrg    NSR-?:NONSTOP_KERNEL:*:*)
1297ff7e0accSmrg	echo nsr-tandem-nsk${UNAME_RELEASE}
1298ff7e0accSmrg	exit ;;
1299ff7e0accSmrg    *:NonStop-UX:*:*)
1300ff7e0accSmrg	echo mips-compaq-nonstopux
1301ff7e0accSmrg	exit ;;
1302ff7e0accSmrg    BS2000:POSIX*:*:*)
1303ff7e0accSmrg	echo bs2000-siemens-sysv
1304ff7e0accSmrg	exit ;;
1305ff7e0accSmrg    DS/*:UNIX_System_V:*:*)
1306ff7e0accSmrg	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1307ff7e0accSmrg	exit ;;
1308ff7e0accSmrg    *:Plan9:*:*)
1309ff7e0accSmrg	# "uname -m" is not consistent, so use $cputype instead. 386
1310ff7e0accSmrg	# is converted to i386 for consistency with other x86
1311ff7e0accSmrg	# operating systems.
1312ff7e0accSmrg	if test "$cputype" = "386"; then
1313ff7e0accSmrg	    UNAME_MACHINE=i386
1314ff7e0accSmrg	else
1315ff7e0accSmrg	    UNAME_MACHINE="$cputype"
1316ff7e0accSmrg	fi
1317ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-plan9
1318ff7e0accSmrg	exit ;;
1319ff7e0accSmrg    *:TOPS-10:*:*)
1320ff7e0accSmrg	echo pdp10-unknown-tops10
1321ff7e0accSmrg	exit ;;
1322ff7e0accSmrg    *:TENEX:*:*)
1323ff7e0accSmrg	echo pdp10-unknown-tenex
1324ff7e0accSmrg	exit ;;
1325ff7e0accSmrg    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1326ff7e0accSmrg	echo pdp10-dec-tops20
1327ff7e0accSmrg	exit ;;
1328ff7e0accSmrg    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1329ff7e0accSmrg	echo pdp10-xkl-tops20
1330ff7e0accSmrg	exit ;;
1331ff7e0accSmrg    *:TOPS-20:*:*)
1332ff7e0accSmrg	echo pdp10-unknown-tops20
1333ff7e0accSmrg	exit ;;
1334ff7e0accSmrg    *:ITS:*:*)
1335ff7e0accSmrg	echo pdp10-unknown-its
1336ff7e0accSmrg	exit ;;
1337ff7e0accSmrg    SEI:*:*:SEIUX)
1338ff7e0accSmrg        echo mips-sei-seiux${UNAME_RELEASE}
1339ff7e0accSmrg	exit ;;
1340ff7e0accSmrg    *:DragonFly:*:*)
1341ff7e0accSmrg	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1342ff7e0accSmrg	exit ;;
1343ff7e0accSmrg    *:*VMS:*:*)
1344ff7e0accSmrg    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
1345ff7e0accSmrg	case "${UNAME_MACHINE}" in
1346ff7e0accSmrg	    A*) echo alpha-dec-vms ; exit ;;
1347ff7e0accSmrg	    I*) echo ia64-dec-vms ; exit ;;
1348ff7e0accSmrg	    V*) echo vax-dec-vms ; exit ;;
1349ff7e0accSmrg	esac ;;
1350ff7e0accSmrg    *:XENIX:*:SysV)
1351ff7e0accSmrg	echo i386-pc-xenix
1352ff7e0accSmrg	exit ;;
1353ff7e0accSmrg    i*86:skyos:*:*)
1354ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1355ff7e0accSmrg	exit ;;
1356ff7e0accSmrg    i*86:rdos:*:*)
1357ff7e0accSmrg	echo ${UNAME_MACHINE}-pc-rdos
1358ff7e0accSmrg	exit ;;
135910998002Smrg    i*86:AROS:*:*)
136010998002Smrg	echo ${UNAME_MACHINE}-pc-aros
136110998002Smrg	exit ;;
1362ff7e0accSmrgesac
1363ff7e0accSmrg
1364ff7e0accSmrg#echo '(No uname command or uname output not recognized.)' 1>&2
1365ff7e0accSmrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1366ff7e0accSmrg
1367ff7e0accSmrgeval $set_cc_for_build
1368ff7e0accSmrgcat >$dummy.c <<EOF
1369ff7e0accSmrg#ifdef _SEQUENT_
1370ff7e0accSmrg# include <sys/types.h>
1371ff7e0accSmrg# include <sys/utsname.h>
1372ff7e0accSmrg#endif
1373ff7e0accSmrgmain ()
1374ff7e0accSmrg{
1375ff7e0accSmrg#if defined (sony)
1376ff7e0accSmrg#if defined (MIPSEB)
1377ff7e0accSmrg  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1378ff7e0accSmrg     I don't know....  */
1379ff7e0accSmrg  printf ("mips-sony-bsd\n"); exit (0);
1380ff7e0accSmrg#else
1381ff7e0accSmrg#include <sys/param.h>
1382ff7e0accSmrg  printf ("m68k-sony-newsos%s\n",
1383ff7e0accSmrg#ifdef NEWSOS4
1384ff7e0accSmrg          "4"
1385ff7e0accSmrg#else
1386ff7e0accSmrg	  ""
1387ff7e0accSmrg#endif
1388ff7e0accSmrg         ); exit (0);
1389ff7e0accSmrg#endif
1390ff7e0accSmrg#endif
1391ff7e0accSmrg
1392ff7e0accSmrg#if defined (__arm) && defined (__acorn) && defined (__unix)
1393ff7e0accSmrg  printf ("arm-acorn-riscix\n"); exit (0);
1394ff7e0accSmrg#endif
1395ff7e0accSmrg
1396ff7e0accSmrg#if defined (hp300) && !defined (hpux)
1397ff7e0accSmrg  printf ("m68k-hp-bsd\n"); exit (0);
1398ff7e0accSmrg#endif
1399ff7e0accSmrg
1400ff7e0accSmrg#if defined (NeXT)
1401ff7e0accSmrg#if !defined (__ARCHITECTURE__)
1402ff7e0accSmrg#define __ARCHITECTURE__ "m68k"
1403ff7e0accSmrg#endif
1404ff7e0accSmrg  int version;
1405ff7e0accSmrg  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1406ff7e0accSmrg  if (version < 4)
1407ff7e0accSmrg    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1408ff7e0accSmrg  else
1409ff7e0accSmrg    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1410ff7e0accSmrg  exit (0);
1411ff7e0accSmrg#endif
1412ff7e0accSmrg
1413ff7e0accSmrg#if defined (MULTIMAX) || defined (n16)
1414ff7e0accSmrg#if defined (UMAXV)
1415ff7e0accSmrg  printf ("ns32k-encore-sysv\n"); exit (0);
1416ff7e0accSmrg#else
1417ff7e0accSmrg#if defined (CMU)
1418ff7e0accSmrg  printf ("ns32k-encore-mach\n"); exit (0);
1419ff7e0accSmrg#else
1420ff7e0accSmrg  printf ("ns32k-encore-bsd\n"); exit (0);
1421ff7e0accSmrg#endif
1422ff7e0accSmrg#endif
1423ff7e0accSmrg#endif
1424ff7e0accSmrg
1425ff7e0accSmrg#if defined (__386BSD__)
1426ff7e0accSmrg  printf ("i386-pc-bsd\n"); exit (0);
1427ff7e0accSmrg#endif
1428ff7e0accSmrg
1429ff7e0accSmrg#if defined (sequent)
1430ff7e0accSmrg#if defined (i386)
1431ff7e0accSmrg  printf ("i386-sequent-dynix\n"); exit (0);
1432ff7e0accSmrg#endif
1433ff7e0accSmrg#if defined (ns32000)
1434ff7e0accSmrg  printf ("ns32k-sequent-dynix\n"); exit (0);
1435ff7e0accSmrg#endif
1436ff7e0accSmrg#endif
1437ff7e0accSmrg
1438ff7e0accSmrg#if defined (_SEQUENT_)
1439ff7e0accSmrg    struct utsname un;
1440ff7e0accSmrg
1441ff7e0accSmrg    uname(&un);
1442ff7e0accSmrg
1443ff7e0accSmrg    if (strncmp(un.version, "V2", 2) == 0) {
1444ff7e0accSmrg	printf ("i386-sequent-ptx2\n"); exit (0);
1445ff7e0accSmrg    }
1446ff7e0accSmrg    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1447ff7e0accSmrg	printf ("i386-sequent-ptx1\n"); exit (0);
1448ff7e0accSmrg    }
1449ff7e0accSmrg    printf ("i386-sequent-ptx\n"); exit (0);
1450ff7e0accSmrg
1451ff7e0accSmrg#endif
1452ff7e0accSmrg
1453ff7e0accSmrg#if defined (vax)
1454ff7e0accSmrg# if !defined (ultrix)
1455ff7e0accSmrg#  include <sys/param.h>
1456ff7e0accSmrg#  if defined (BSD)
1457ff7e0accSmrg#   if BSD == 43
1458ff7e0accSmrg      printf ("vax-dec-bsd4.3\n"); exit (0);
1459ff7e0accSmrg#   else
1460ff7e0accSmrg#    if BSD == 199006
1461ff7e0accSmrg      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1462ff7e0accSmrg#    else
1463ff7e0accSmrg      printf ("vax-dec-bsd\n"); exit (0);
1464ff7e0accSmrg#    endif
1465ff7e0accSmrg#   endif
1466ff7e0accSmrg#  else
1467ff7e0accSmrg    printf ("vax-dec-bsd\n"); exit (0);
1468ff7e0accSmrg#  endif
1469ff7e0accSmrg# else
1470ff7e0accSmrg    printf ("vax-dec-ultrix\n"); exit (0);
1471ff7e0accSmrg# endif
1472ff7e0accSmrg#endif
1473ff7e0accSmrg
1474ff7e0accSmrg#if defined (alliant) && defined (i860)
1475ff7e0accSmrg  printf ("i860-alliant-bsd\n"); exit (0);
1476ff7e0accSmrg#endif
1477ff7e0accSmrg
1478ff7e0accSmrg  exit (1);
1479ff7e0accSmrg}
1480ff7e0accSmrgEOF
1481ff7e0accSmrg
1482ff7e0accSmrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1483ff7e0accSmrg	{ echo "$SYSTEM_NAME"; exit; }
1484ff7e0accSmrg
1485ff7e0accSmrg# Apollos put the system type in the environment.
1486ff7e0accSmrg
1487ff7e0accSmrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1488ff7e0accSmrg
1489ff7e0accSmrg# Convex versions that predate uname can use getsysinfo(1)
1490ff7e0accSmrg
1491ff7e0accSmrgif [ -x /usr/convex/getsysinfo ]
1492ff7e0accSmrgthen
1493ff7e0accSmrg    case `getsysinfo -f cpu_type` in
1494ff7e0accSmrg    c1*)
1495ff7e0accSmrg	echo c1-convex-bsd
1496ff7e0accSmrg	exit ;;
1497ff7e0accSmrg    c2*)
1498ff7e0accSmrg	if getsysinfo -f scalar_acc
1499ff7e0accSmrg	then echo c32-convex-bsd
1500ff7e0accSmrg	else echo c2-convex-bsd
1501ff7e0accSmrg	fi
1502ff7e0accSmrg	exit ;;
1503ff7e0accSmrg    c34*)
1504ff7e0accSmrg	echo c34-convex-bsd
1505ff7e0accSmrg	exit ;;
1506ff7e0accSmrg    c38*)
1507ff7e0accSmrg	echo c38-convex-bsd
1508ff7e0accSmrg	exit ;;
1509ff7e0accSmrg    c4*)
1510ff7e0accSmrg	echo c4-convex-bsd
1511ff7e0accSmrg	exit ;;
1512ff7e0accSmrg    esac
1513ff7e0accSmrgfi
1514ff7e0accSmrg
1515ff7e0accSmrgcat >&2 <<EOF
1516ff7e0accSmrg$0: unable to guess system type
1517ff7e0accSmrg
1518ff7e0accSmrgThis script, last modified $timestamp, has failed to recognize
1519ff7e0accSmrgthe operating system you are using. It is advised that you
1520ff7e0accSmrgdownload the most up to date version of the config scripts from
1521ff7e0accSmrg
1522a005d216Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
1523ff7e0accSmrgand
1524a005d216Smrg  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
1525ff7e0accSmrg
1526ff7e0accSmrgIf the version you run ($0) is already up to date, please
1527ff7e0accSmrgsend the following data and any information you think might be
1528ff7e0accSmrgpertinent to <config-patches@gnu.org> in order to provide the needed
1529ff7e0accSmrginformation to handle your system.
1530ff7e0accSmrg
1531ff7e0accSmrgconfig.guess timestamp = $timestamp
1532ff7e0accSmrg
1533ff7e0accSmrguname -m = `(uname -m) 2>/dev/null || echo unknown`
1534ff7e0accSmrguname -r = `(uname -r) 2>/dev/null || echo unknown`
1535ff7e0accSmrguname -s = `(uname -s) 2>/dev/null || echo unknown`
1536ff7e0accSmrguname -v = `(uname -v) 2>/dev/null || echo unknown`
1537ff7e0accSmrg
1538ff7e0accSmrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1539ff7e0accSmrg/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1540ff7e0accSmrg
1541ff7e0accSmrghostinfo               = `(hostinfo) 2>/dev/null`
1542ff7e0accSmrg/bin/universe          = `(/bin/universe) 2>/dev/null`
1543ff7e0accSmrg/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1544ff7e0accSmrg/bin/arch              = `(/bin/arch) 2>/dev/null`
1545ff7e0accSmrg/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1546ff7e0accSmrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1547ff7e0accSmrg
1548ff7e0accSmrgUNAME_MACHINE = ${UNAME_MACHINE}
1549ff7e0accSmrgUNAME_RELEASE = ${UNAME_RELEASE}
1550ff7e0accSmrgUNAME_SYSTEM  = ${UNAME_SYSTEM}
1551ff7e0accSmrgUNAME_VERSION = ${UNAME_VERSION}
1552ff7e0accSmrgEOF
1553ff7e0accSmrg
1554ff7e0accSmrgexit 1
1555ff7e0accSmrg
1556ff7e0accSmrg# Local variables:
1557ff7e0accSmrg# eval: (add-hook 'write-file-hooks 'time-stamp)
1558ff7e0accSmrg# time-stamp-start: "timestamp='"
1559ff7e0accSmrg# time-stamp-format: "%:y-%02m-%02d"
1560ff7e0accSmrg# time-stamp-end: "'"
1561ff7e0accSmrg# End:
1562