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