Statistics
| Revision:

root / config.guess @ 134

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