Statistics
| Revision:

root / config.guess @ 3053

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