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