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