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