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