config.guess
author Sam Lantinga <slouken@libsdl.org>
Tue, 25 Jan 2005 16:57:11 +0000
changeset 1032 c1c2efca4548
parent 729 dac996d69abb
child 1270 b1425473be0f
permissions -rwxr-xr-x
Date: Mon, 24 Jan 2005 21:37:56 +0800
From: Chris Taylor
Subject: Patch to put back dynamic OpenGL loading for MPW

I sent a patch a while ago that removes dynamic OpenGL loading for
Macintosh Programmer's Workshop. Dynamic loading DOES actually work
when an SDL program is built with MPW, it just has to be set up for it.
(Whoops!!) This is the ideal way to get OpenGL extensions to work,
which D2X uses quite a few of.

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