~mirabilos/jupp/trunk

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