Statistics
| Revision:

root / config.guess @ 1060

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