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