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