Statistics
| Revision:

root / config.guess @ 1144

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