Statistics
| Revision:

root / config.guess @ 999

History | View | Annotate | Download (42.5 kB)

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