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