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