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