config.guess revision 76910425
176910425Smrg#! /bin/sh 276910425Smrg# Attempt to guess a canonical system name. 376910425Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 476910425Smrg# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 576910425Smrg 676910425Smrgtimestamp='2005-07-08' 776910425Smrg 876910425Smrg# This file is free software; you can redistribute it and/or modify it 976910425Smrg# under the terms of the GNU General Public License as published by 1076910425Smrg# the Free Software Foundation; either version 2 of the License, or 1176910425Smrg# (at your option) any later version. 1276910425Smrg# 1376910425Smrg# This program is distributed in the hope that it will be useful, but 1476910425Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1576910425Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1676910425Smrg# General Public License for more details. 1776910425Smrg# 1876910425Smrg# You should have received a copy of the GNU General Public License 1976910425Smrg# along with this program; if not, write to the Free Software 2076910425Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 2176910425Smrg# 02110-1301, USA. 2276910425Smrg# 2376910425Smrg# As a special exception to the GNU General Public License, if you 2476910425Smrg# distribute this file as part of a program that contains a 2576910425Smrg# configuration script generated by Autoconf, you may include it under 2676910425Smrg# the same distribution terms that you use for the rest of that program. 2776910425Smrg 2876910425Smrg 2976910425Smrg# Originally written by Per Bothner <per@bothner.com>. 3076910425Smrg# Please send patches to <config-patches@gnu.org>. Submit a context 3176910425Smrg# diff and a properly formatted ChangeLog entry. 3276910425Smrg# 3376910425Smrg# This script attempts to guess a canonical system name similar to 3476910425Smrg# config.sub. If it succeeds, it prints the system name on stdout, and 3576910425Smrg# exits with 0. Otherwise, it exits with 1. 3676910425Smrg# 3776910425Smrg# The plan is that this can be called by configure scripts if you 3876910425Smrg# don't specify an explicit build system type. 3976910425Smrg 4076910425Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4176910425Smrg 4276910425Smrgusage="\ 4376910425SmrgUsage: $0 [OPTION] 4476910425Smrg 4576910425SmrgOutput the configuration name of the system \`$me' is run on. 4676910425Smrg 4776910425SmrgOperation modes: 4876910425Smrg -h, --help print this help, then exit 4976910425Smrg -t, --time-stamp print date of last modification, then exit 5076910425Smrg -v, --version print version number, then exit 5176910425Smrg 5276910425SmrgReport bugs and patches to <config-patches@gnu.org>." 5376910425Smrg 5476910425Smrgversion="\ 5576910425SmrgGNU config.guess ($timestamp) 5676910425Smrg 5776910425SmrgOriginally written by Per Bothner. 5876910425SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 5976910425SmrgFree Software Foundation, Inc. 6076910425Smrg 6176910425SmrgThis is free software; see the source for copying conditions. There is NO 6276910425Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6376910425Smrg 6476910425Smrghelp=" 6576910425SmrgTry \`$me --help' for more information." 6676910425Smrg 6776910425Smrg# Parse command line 6876910425Smrgwhile test $# -gt 0 ; do 6976910425Smrg case $1 in 7076910425Smrg --time-stamp | --time* | -t ) 7176910425Smrg echo "$timestamp" ; exit ;; 7276910425Smrg --version | -v ) 7376910425Smrg echo "$version" ; exit ;; 7476910425Smrg --help | --h* | -h ) 7576910425Smrg echo "$usage"; exit ;; 7676910425Smrg -- ) # Stop option processing 7776910425Smrg shift; break ;; 7876910425Smrg - ) # Use stdin as input. 7976910425Smrg break ;; 8076910425Smrg -* ) 8176910425Smrg echo "$me: invalid option $1$help" >&2 8276910425Smrg exit 1 ;; 8376910425Smrg * ) 8476910425Smrg break ;; 8576910425Smrg esac 8676910425Smrgdone 8776910425Smrg 8876910425Smrgif test $# != 0; then 8976910425Smrg echo "$me: too many arguments$help" >&2 9076910425Smrg exit 1 9176910425Smrgfi 9276910425Smrg 9376910425Smrgtrap 'exit 1' 1 2 15 9476910425Smrg 9576910425Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 9676910425Smrg# compiler to aid in system detection is discouraged as it requires 9776910425Smrg# temporary files to be created and, as you can see below, it is a 9876910425Smrg# headache to deal with in a portable fashion. 9976910425Smrg 10076910425Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 10176910425Smrg# use `HOST_CC' if defined, but it is deprecated. 10276910425Smrg 10376910425Smrg# Portable tmp directory creation inspired by the Autoconf team. 10476910425Smrg 10576910425Smrgset_cc_for_build=' 10676910425Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 10776910425Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 10876910425Smrg: ${TMPDIR=/tmp} ; 10976910425Smrg { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 11076910425Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 11176910425Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 11276910425Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 11376910425Smrgdummy=$tmp/dummy ; 11476910425Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 11576910425Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in 11676910425Smrg ,,) echo "int x;" > $dummy.c ; 11776910425Smrg for c in cc gcc c89 c99 ; do 11876910425Smrg if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 11976910425Smrg CC_FOR_BUILD="$c"; break ; 12076910425Smrg fi ; 12176910425Smrg done ; 12276910425Smrg if test x"$CC_FOR_BUILD" = x ; then 12376910425Smrg CC_FOR_BUILD=no_compiler_found ; 12476910425Smrg fi 12576910425Smrg ;; 12676910425Smrg ,,*) CC_FOR_BUILD=$CC ;; 12776910425Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 12876910425Smrgesac ; set_cc_for_build= ;' 12976910425Smrg 13076910425Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 13176910425Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 13276910425Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 13376910425Smrg PATH=$PATH:/.attbin ; export PATH 13476910425Smrgfi 13576910425Smrg 13676910425SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 13776910425SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 13876910425SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 13976910425SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 14076910425Smrg 14176910425Smrg# Note: order is significant - the case branches are not exclusive. 14276910425Smrg 14376910425Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 14476910425Smrg *:NetBSD:*:*) 14576910425Smrg # NetBSD (nbsd) targets should (where applicable) match one or 14676910425Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 14776910425Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 14876910425Smrg # switched to ELF, *-*-netbsd* would select the old 14976910425Smrg # object file format. This provides both forward 15076910425Smrg # compatibility and a consistent mechanism for selecting the 15176910425Smrg # object file format. 15276910425Smrg # 15376910425Smrg # Note: NetBSD doesn't particularly care about the vendor 15476910425Smrg # portion of the name. We always set it to "unknown". 15576910425Smrg sysctl="sysctl -n hw.machine_arch" 15676910425Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 15776910425Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 15876910425Smrg case "${UNAME_MACHINE_ARCH}" in 15976910425Smrg armeb) machine=armeb-unknown ;; 16076910425Smrg arm*) machine=arm-unknown ;; 16176910425Smrg sh3el) machine=shl-unknown ;; 16276910425Smrg sh3eb) machine=sh-unknown ;; 16376910425Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 16476910425Smrg esac 16576910425Smrg # The Operating System including object format, if it has switched 16676910425Smrg # to ELF recently, or will in the future. 16776910425Smrg case "${UNAME_MACHINE_ARCH}" in 16876910425Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 16976910425Smrg eval $set_cc_for_build 17076910425Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 17176910425Smrg | grep __ELF__ >/dev/null 17276910425Smrg then 17376910425Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 17476910425Smrg # Return netbsd for either. FIX? 17576910425Smrg os=netbsd 17676910425Smrg else 17776910425Smrg os=netbsdelf 17876910425Smrg fi 17976910425Smrg ;; 18076910425Smrg *) 18176910425Smrg os=netbsd 18276910425Smrg ;; 18376910425Smrg esac 18476910425Smrg # The OS release 18576910425Smrg # Debian GNU/NetBSD machines have a different userland, and 18676910425Smrg # thus, need a distinct triplet. However, they do not need 18776910425Smrg # kernel version information, so it can be replaced with a 18876910425Smrg # suitable tag, in the style of linux-gnu. 18976910425Smrg case "${UNAME_VERSION}" in 19076910425Smrg Debian*) 19176910425Smrg release='-gnu' 19276910425Smrg ;; 19376910425Smrg *) 19476910425Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 19576910425Smrg ;; 19676910425Smrg esac 19776910425Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 19876910425Smrg # contains redundant information, the shorter form: 19976910425Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 20076910425Smrg echo "${machine}-${os}${release}" 20176910425Smrg exit ;; 20276910425Smrg *:OpenBSD:*:*) 20376910425Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 20476910425Smrg echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 20576910425Smrg exit ;; 20676910425Smrg *:ekkoBSD:*:*) 20776910425Smrg echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 20876910425Smrg exit ;; 20976910425Smrg macppc:MirBSD:*:*) 21076910425Smrg echo powerppc-unknown-mirbsd${UNAME_RELEASE} 21176910425Smrg exit ;; 21276910425Smrg *:MirBSD:*:*) 21376910425Smrg echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 21476910425Smrg exit ;; 21576910425Smrg alpha:OSF1:*:*) 21676910425Smrg case $UNAME_RELEASE in 21776910425Smrg *4.0) 21876910425Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 21976910425Smrg ;; 22076910425Smrg *5.*) 22176910425Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 22276910425Smrg ;; 22376910425Smrg esac 22476910425Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 22576910425Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 22676910425Smrg # covers most systems running today. This code pipes the CPU 22776910425Smrg # types through head -n 1, so we only detect the type of CPU 0. 22876910425Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 22976910425Smrg case "$ALPHA_CPU_TYPE" in 23076910425Smrg "EV4 (21064)") 23176910425Smrg UNAME_MACHINE="alpha" ;; 23276910425Smrg "EV4.5 (21064)") 23376910425Smrg UNAME_MACHINE="alpha" ;; 23476910425Smrg "LCA4 (21066/21068)") 23576910425Smrg UNAME_MACHINE="alpha" ;; 23676910425Smrg "EV5 (21164)") 23776910425Smrg UNAME_MACHINE="alphaev5" ;; 23876910425Smrg "EV5.6 (21164A)") 23976910425Smrg UNAME_MACHINE="alphaev56" ;; 24076910425Smrg "EV5.6 (21164PC)") 24176910425Smrg UNAME_MACHINE="alphapca56" ;; 24276910425Smrg "EV5.7 (21164PC)") 24376910425Smrg UNAME_MACHINE="alphapca57" ;; 24476910425Smrg "EV6 (21264)") 24576910425Smrg UNAME_MACHINE="alphaev6" ;; 24676910425Smrg "EV6.7 (21264A)") 24776910425Smrg UNAME_MACHINE="alphaev67" ;; 24876910425Smrg "EV6.8CB (21264C)") 24976910425Smrg UNAME_MACHINE="alphaev68" ;; 25076910425Smrg "EV6.8AL (21264B)") 25176910425Smrg UNAME_MACHINE="alphaev68" ;; 25276910425Smrg "EV6.8CX (21264D)") 25376910425Smrg UNAME_MACHINE="alphaev68" ;; 25476910425Smrg "EV6.9A (21264/EV69A)") 25576910425Smrg UNAME_MACHINE="alphaev69" ;; 25676910425Smrg "EV7 (21364)") 25776910425Smrg UNAME_MACHINE="alphaev7" ;; 25876910425Smrg "EV7.9 (21364A)") 25976910425Smrg UNAME_MACHINE="alphaev79" ;; 26076910425Smrg esac 26176910425Smrg # A Pn.n version is a patched version. 26276910425Smrg # A Vn.n version is a released version. 26376910425Smrg # A Tn.n version is a released field test version. 26476910425Smrg # A Xn.n version is an unreleased experimental baselevel. 26576910425Smrg # 1.2 uses "1.2" for uname -r. 26676910425Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 26776910425Smrg exit ;; 26876910425Smrg Alpha\ *:Windows_NT*:*) 26976910425Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 27076910425Smrg # Should we change UNAME_MACHINE based on the output of uname instead 27176910425Smrg # of the specific Alpha model? 27276910425Smrg echo alpha-pc-interix 27376910425Smrg exit ;; 27476910425Smrg 21064:Windows_NT:50:3) 27576910425Smrg echo alpha-dec-winnt3.5 27676910425Smrg exit ;; 27776910425Smrg Amiga*:UNIX_System_V:4.0:*) 27876910425Smrg echo m68k-unknown-sysv4 27976910425Smrg exit ;; 28076910425Smrg *:[Aa]miga[Oo][Ss]:*:*) 28176910425Smrg echo ${UNAME_MACHINE}-unknown-amigaos 28276910425Smrg exit ;; 28376910425Smrg *:[Mm]orph[Oo][Ss]:*:*) 28476910425Smrg echo ${UNAME_MACHINE}-unknown-morphos 28576910425Smrg exit ;; 28676910425Smrg *:OS/390:*:*) 28776910425Smrg echo i370-ibm-openedition 28876910425Smrg exit ;; 28976910425Smrg *:z/VM:*:*) 29076910425Smrg echo s390-ibm-zvmoe 29176910425Smrg exit ;; 29276910425Smrg *:OS400:*:*) 29376910425Smrg echo powerpc-ibm-os400 29476910425Smrg exit ;; 29576910425Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 29676910425Smrg echo arm-acorn-riscix${UNAME_RELEASE} 29776910425Smrg exit ;; 29876910425Smrg arm:riscos:*:*|arm:RISCOS:*:*) 29976910425Smrg echo arm-unknown-riscos 30076910425Smrg exit ;; 30176910425Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 30276910425Smrg echo hppa1.1-hitachi-hiuxmpp 30376910425Smrg exit ;; 30476910425Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 30576910425Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 30676910425Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 30776910425Smrg echo pyramid-pyramid-sysv3 30876910425Smrg else 30976910425Smrg echo pyramid-pyramid-bsd 31076910425Smrg fi 31176910425Smrg exit ;; 31276910425Smrg NILE*:*:*:dcosx) 31376910425Smrg echo pyramid-pyramid-svr4 31476910425Smrg exit ;; 31576910425Smrg DRS?6000:unix:4.0:6*) 31676910425Smrg echo sparc-icl-nx6 31776910425Smrg exit ;; 31876910425Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 31976910425Smrg case `/usr/bin/uname -p` in 32076910425Smrg sparc) echo sparc-icl-nx7; exit ;; 32176910425Smrg esac ;; 32276910425Smrg sun4H:SunOS:5.*:*) 32376910425Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32476910425Smrg exit ;; 32576910425Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 32676910425Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32776910425Smrg exit ;; 32876910425Smrg i86pc:SunOS:5.*:*) 32976910425Smrg echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33076910425Smrg exit ;; 33176910425Smrg sun4*:SunOS:6*:*) 33276910425Smrg # According to config.sub, this is the proper way to canonicalize 33376910425Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 33476910425Smrg # it's likely to be more like Solaris than SunOS4. 33576910425Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33676910425Smrg exit ;; 33776910425Smrg sun4*:SunOS:*:*) 33876910425Smrg case "`/usr/bin/arch -k`" in 33976910425Smrg Series*|S4*) 34076910425Smrg UNAME_RELEASE=`uname -v` 34176910425Smrg ;; 34276910425Smrg esac 34376910425Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 34476910425Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 34576910425Smrg exit ;; 34676910425Smrg sun3*:SunOS:*:*) 34776910425Smrg echo m68k-sun-sunos${UNAME_RELEASE} 34876910425Smrg exit ;; 34976910425Smrg sun*:*:4.2BSD:*) 35076910425Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 35176910425Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 35276910425Smrg case "`/bin/arch`" in 35376910425Smrg sun3) 35476910425Smrg echo m68k-sun-sunos${UNAME_RELEASE} 35576910425Smrg ;; 35676910425Smrg sun4) 35776910425Smrg echo sparc-sun-sunos${UNAME_RELEASE} 35876910425Smrg ;; 35976910425Smrg esac 36076910425Smrg exit ;; 36176910425Smrg aushp:SunOS:*:*) 36276910425Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 36376910425Smrg exit ;; 36476910425Smrg # The situation for MiNT is a little confusing. The machine name 36576910425Smrg # can be virtually everything (everything which is not 36676910425Smrg # "atarist" or "atariste" at least should have a processor 36776910425Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 36876910425Smrg # to the lowercase version "mint" (or "freemint"). Finally 36976910425Smrg # the system name "TOS" denotes a system which is actually not 37076910425Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 37176910425Smrg # be no problem. 37276910425Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 37376910425Smrg echo m68k-atari-mint${UNAME_RELEASE} 37476910425Smrg exit ;; 37576910425Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 37676910425Smrg echo m68k-atari-mint${UNAME_RELEASE} 37776910425Smrg exit ;; 37876910425Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 37976910425Smrg echo m68k-atari-mint${UNAME_RELEASE} 38076910425Smrg exit ;; 38176910425Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 38276910425Smrg echo m68k-milan-mint${UNAME_RELEASE} 38376910425Smrg exit ;; 38476910425Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 38576910425Smrg echo m68k-hades-mint${UNAME_RELEASE} 38676910425Smrg exit ;; 38776910425Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 38876910425Smrg echo m68k-unknown-mint${UNAME_RELEASE} 38976910425Smrg exit ;; 39076910425Smrg m68k:machten:*:*) 39176910425Smrg echo m68k-apple-machten${UNAME_RELEASE} 39276910425Smrg exit ;; 39376910425Smrg powerpc:machten:*:*) 39476910425Smrg echo powerpc-apple-machten${UNAME_RELEASE} 39576910425Smrg exit ;; 39676910425Smrg RISC*:Mach:*:*) 39776910425Smrg echo mips-dec-mach_bsd4.3 39876910425Smrg exit ;; 39976910425Smrg RISC*:ULTRIX:*:*) 40076910425Smrg echo mips-dec-ultrix${UNAME_RELEASE} 40176910425Smrg exit ;; 40276910425Smrg VAX*:ULTRIX*:*:*) 40376910425Smrg echo vax-dec-ultrix${UNAME_RELEASE} 40476910425Smrg exit ;; 40576910425Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 40676910425Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 40776910425Smrg exit ;; 40876910425Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 40976910425Smrg eval $set_cc_for_build 41076910425Smrg sed 's/^ //' << EOF >$dummy.c 41176910425Smrg#ifdef __cplusplus 41276910425Smrg#include <stdio.h> /* for printf() prototype */ 41376910425Smrg int main (int argc, char *argv[]) { 41476910425Smrg#else 41576910425Smrg int main (argc, argv) int argc; char *argv[]; { 41676910425Smrg#endif 41776910425Smrg #if defined (host_mips) && defined (MIPSEB) 41876910425Smrg #if defined (SYSTYPE_SYSV) 41976910425Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 42076910425Smrg #endif 42176910425Smrg #if defined (SYSTYPE_SVR4) 42276910425Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 42376910425Smrg #endif 42476910425Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 42576910425Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 42676910425Smrg #endif 42776910425Smrg #endif 42876910425Smrg exit (-1); 42976910425Smrg } 43076910425SmrgEOF 43176910425Smrg $CC_FOR_BUILD -o $dummy $dummy.c && 43276910425Smrg dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 43376910425Smrg SYSTEM_NAME=`$dummy $dummyarg` && 43476910425Smrg { echo "$SYSTEM_NAME"; exit; } 43576910425Smrg echo mips-mips-riscos${UNAME_RELEASE} 43676910425Smrg exit ;; 43776910425Smrg Motorola:PowerMAX_OS:*:*) 43876910425Smrg echo powerpc-motorola-powermax 43976910425Smrg exit ;; 44076910425Smrg Motorola:*:4.3:PL8-*) 44176910425Smrg echo powerpc-harris-powermax 44276910425Smrg exit ;; 44376910425Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 44476910425Smrg echo powerpc-harris-powermax 44576910425Smrg exit ;; 44676910425Smrg Night_Hawk:Power_UNIX:*:*) 44776910425Smrg echo powerpc-harris-powerunix 44876910425Smrg exit ;; 44976910425Smrg m88k:CX/UX:7*:*) 45076910425Smrg echo m88k-harris-cxux7 45176910425Smrg exit ;; 45276910425Smrg m88k:*:4*:R4*) 45376910425Smrg echo m88k-motorola-sysv4 45476910425Smrg exit ;; 45576910425Smrg m88k:*:3*:R3*) 45676910425Smrg echo m88k-motorola-sysv3 45776910425Smrg exit ;; 45876910425Smrg AViiON:dgux:*:*) 45976910425Smrg # DG/UX returns AViiON for all architectures 46076910425Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 46176910425Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 46276910425Smrg then 46376910425Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 46476910425Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 46576910425Smrg then 46676910425Smrg echo m88k-dg-dgux${UNAME_RELEASE} 46776910425Smrg else 46876910425Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 46976910425Smrg fi 47076910425Smrg else 47176910425Smrg echo i586-dg-dgux${UNAME_RELEASE} 47276910425Smrg fi 47376910425Smrg exit ;; 47476910425Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 47576910425Smrg echo m88k-dolphin-sysv3 47676910425Smrg exit ;; 47776910425Smrg M88*:*:R3*:*) 47876910425Smrg # Delta 88k system running SVR3 47976910425Smrg echo m88k-motorola-sysv3 48076910425Smrg exit ;; 48176910425Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 48276910425Smrg echo m88k-tektronix-sysv3 48376910425Smrg exit ;; 48476910425Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 48576910425Smrg echo m68k-tektronix-bsd 48676910425Smrg exit ;; 48776910425Smrg *:IRIX*:*:*) 48876910425Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 48976910425Smrg exit ;; 49076910425Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 49176910425Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 49276910425Smrg exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 49376910425Smrg i*86:AIX:*:*) 49476910425Smrg echo i386-ibm-aix 49576910425Smrg exit ;; 49676910425Smrg ia64:AIX:*:*) 49776910425Smrg if [ -x /usr/bin/oslevel ] ; then 49876910425Smrg IBM_REV=`/usr/bin/oslevel` 49976910425Smrg else 50076910425Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 50176910425Smrg fi 50276910425Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 50376910425Smrg exit ;; 50476910425Smrg *:AIX:2:3) 50576910425Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 50676910425Smrg eval $set_cc_for_build 50776910425Smrg sed 's/^ //' << EOF >$dummy.c 50876910425Smrg #include <sys/systemcfg.h> 50976910425Smrg 51076910425Smrg main() 51176910425Smrg { 51276910425Smrg if (!__power_pc()) 51376910425Smrg exit(1); 51476910425Smrg puts("powerpc-ibm-aix3.2.5"); 51576910425Smrg exit(0); 51676910425Smrg } 51776910425SmrgEOF 51876910425Smrg if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 51976910425Smrg then 52076910425Smrg echo "$SYSTEM_NAME" 52176910425Smrg else 52276910425Smrg echo rs6000-ibm-aix3.2.5 52376910425Smrg fi 52476910425Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 52576910425Smrg echo rs6000-ibm-aix3.2.4 52676910425Smrg else 52776910425Smrg echo rs6000-ibm-aix3.2 52876910425Smrg fi 52976910425Smrg exit ;; 53076910425Smrg *:AIX:*:[45]) 53176910425Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 53276910425Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 53376910425Smrg IBM_ARCH=rs6000 53476910425Smrg else 53576910425Smrg IBM_ARCH=powerpc 53676910425Smrg fi 53776910425Smrg if [ -x /usr/bin/oslevel ] ; then 53876910425Smrg IBM_REV=`/usr/bin/oslevel` 53976910425Smrg else 54076910425Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 54176910425Smrg fi 54276910425Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 54376910425Smrg exit ;; 54476910425Smrg *:AIX:*:*) 54576910425Smrg echo rs6000-ibm-aix 54676910425Smrg exit ;; 54776910425Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 54876910425Smrg echo romp-ibm-bsd4.4 54976910425Smrg exit ;; 55076910425Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 55176910425Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 55276910425Smrg exit ;; # report: romp-ibm BSD 4.3 55376910425Smrg *:BOSX:*:*) 55476910425Smrg echo rs6000-bull-bosx 55576910425Smrg exit ;; 55676910425Smrg DPX/2?00:B.O.S.:*:*) 55776910425Smrg echo m68k-bull-sysv3 55876910425Smrg exit ;; 55976910425Smrg 9000/[34]??:4.3bsd:1.*:*) 56076910425Smrg echo m68k-hp-bsd 56176910425Smrg exit ;; 56276910425Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 56376910425Smrg echo m68k-hp-bsd4.4 56476910425Smrg exit ;; 56576910425Smrg 9000/[34678]??:HP-UX:*:*) 56676910425Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 56776910425Smrg case "${UNAME_MACHINE}" in 56876910425Smrg 9000/31? ) HP_ARCH=m68000 ;; 56976910425Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 57076910425Smrg 9000/[678][0-9][0-9]) 57176910425Smrg if [ -x /usr/bin/getconf ]; then 57276910425Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 57376910425Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 57476910425Smrg case "${sc_cpu_version}" in 57576910425Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 57676910425Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 57776910425Smrg 532) # CPU_PA_RISC2_0 57876910425Smrg case "${sc_kernel_bits}" in 57976910425Smrg 32) HP_ARCH="hppa2.0n" ;; 58076910425Smrg 64) HP_ARCH="hppa2.0w" ;; 58176910425Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 58276910425Smrg esac ;; 58376910425Smrg esac 58476910425Smrg fi 58576910425Smrg if [ "${HP_ARCH}" = "" ]; then 58676910425Smrg eval $set_cc_for_build 58776910425Smrg sed 's/^ //' << EOF >$dummy.c 58876910425Smrg 58976910425Smrg #define _HPUX_SOURCE 59076910425Smrg #include <stdlib.h> 59176910425Smrg #include <unistd.h> 59276910425Smrg 59376910425Smrg int main () 59476910425Smrg { 59576910425Smrg #if defined(_SC_KERNEL_BITS) 59676910425Smrg long bits = sysconf(_SC_KERNEL_BITS); 59776910425Smrg #endif 59876910425Smrg long cpu = sysconf (_SC_CPU_VERSION); 59976910425Smrg 60076910425Smrg switch (cpu) 60176910425Smrg { 60276910425Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 60376910425Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 60476910425Smrg case CPU_PA_RISC2_0: 60576910425Smrg #if defined(_SC_KERNEL_BITS) 60676910425Smrg switch (bits) 60776910425Smrg { 60876910425Smrg case 64: puts ("hppa2.0w"); break; 60976910425Smrg case 32: puts ("hppa2.0n"); break; 61076910425Smrg default: puts ("hppa2.0"); break; 61176910425Smrg } break; 61276910425Smrg #else /* !defined(_SC_KERNEL_BITS) */ 61376910425Smrg puts ("hppa2.0"); break; 61476910425Smrg #endif 61576910425Smrg default: puts ("hppa1.0"); break; 61676910425Smrg } 61776910425Smrg exit (0); 61876910425Smrg } 61976910425SmrgEOF 62076910425Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 62176910425Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 62276910425Smrg fi ;; 62376910425Smrg esac 62476910425Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 62576910425Smrg then 62676910425Smrg eval $set_cc_for_build 62776910425Smrg 62876910425Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 62976910425Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 63076910425Smrg # generating 64-bit code. GNU and HP use different nomenclature: 63176910425Smrg # 63276910425Smrg # $ CC_FOR_BUILD=cc ./config.guess 63376910425Smrg # => hppa2.0w-hp-hpux11.23 63476910425Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 63576910425Smrg # => hppa64-hp-hpux11.23 63676910425Smrg 63776910425Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 63876910425Smrg grep __LP64__ >/dev/null 63976910425Smrg then 64076910425Smrg HP_ARCH="hppa2.0w" 64176910425Smrg else 64276910425Smrg HP_ARCH="hppa64" 64376910425Smrg fi 64476910425Smrg fi 64576910425Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 64676910425Smrg exit ;; 64776910425Smrg ia64:HP-UX:*:*) 64876910425Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 64976910425Smrg echo ia64-hp-hpux${HPUX_REV} 65076910425Smrg exit ;; 65176910425Smrg 3050*:HI-UX:*:*) 65276910425Smrg eval $set_cc_for_build 65376910425Smrg sed 's/^ //' << EOF >$dummy.c 65476910425Smrg #include <unistd.h> 65576910425Smrg int 65676910425Smrg main () 65776910425Smrg { 65876910425Smrg long cpu = sysconf (_SC_CPU_VERSION); 65976910425Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 66076910425Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 66176910425Smrg results, however. */ 66276910425Smrg if (CPU_IS_PA_RISC (cpu)) 66376910425Smrg { 66476910425Smrg switch (cpu) 66576910425Smrg { 66676910425Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 66776910425Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 66876910425Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 66976910425Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 67076910425Smrg } 67176910425Smrg } 67276910425Smrg else if (CPU_IS_HP_MC68K (cpu)) 67376910425Smrg puts ("m68k-hitachi-hiuxwe2"); 67476910425Smrg else puts ("unknown-hitachi-hiuxwe2"); 67576910425Smrg exit (0); 67676910425Smrg } 67776910425SmrgEOF 67876910425Smrg $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 67976910425Smrg { echo "$SYSTEM_NAME"; exit; } 68076910425Smrg echo unknown-hitachi-hiuxwe2 68176910425Smrg exit ;; 68276910425Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 68376910425Smrg echo hppa1.1-hp-bsd 68476910425Smrg exit ;; 68576910425Smrg 9000/8??:4.3bsd:*:*) 68676910425Smrg echo hppa1.0-hp-bsd 68776910425Smrg exit ;; 68876910425Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 68976910425Smrg echo hppa1.0-hp-mpeix 69076910425Smrg exit ;; 69176910425Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 69276910425Smrg echo hppa1.1-hp-osf 69376910425Smrg exit ;; 69476910425Smrg hp8??:OSF1:*:*) 69576910425Smrg echo hppa1.0-hp-osf 69676910425Smrg exit ;; 69776910425Smrg i*86:OSF1:*:*) 69876910425Smrg if [ -x /usr/sbin/sysversion ] ; then 69976910425Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 70076910425Smrg else 70176910425Smrg echo ${UNAME_MACHINE}-unknown-osf1 70276910425Smrg fi 70376910425Smrg exit ;; 70476910425Smrg parisc*:Lites*:*:*) 70576910425Smrg echo hppa1.1-hp-lites 70676910425Smrg exit ;; 70776910425Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 70876910425Smrg echo c1-convex-bsd 70976910425Smrg exit ;; 71076910425Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 71176910425Smrg if getsysinfo -f scalar_acc 71276910425Smrg then echo c32-convex-bsd 71376910425Smrg else echo c2-convex-bsd 71476910425Smrg fi 71576910425Smrg exit ;; 71676910425Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 71776910425Smrg echo c34-convex-bsd 71876910425Smrg exit ;; 71976910425Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 72076910425Smrg echo c38-convex-bsd 72176910425Smrg exit ;; 72276910425Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 72376910425Smrg echo c4-convex-bsd 72476910425Smrg exit ;; 72576910425Smrg CRAY*Y-MP:*:*:*) 72676910425Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 72776910425Smrg exit ;; 72876910425Smrg CRAY*[A-Z]90:*:*:*) 72976910425Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 73076910425Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 73176910425Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 73276910425Smrg -e 's/\.[^.]*$/.X/' 73376910425Smrg exit ;; 73476910425Smrg CRAY*TS:*:*:*) 73576910425Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73676910425Smrg exit ;; 73776910425Smrg CRAY*T3E:*:*:*) 73876910425Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73976910425Smrg exit ;; 74076910425Smrg CRAY*SV1:*:*:*) 74176910425Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74276910425Smrg exit ;; 74376910425Smrg *:UNICOS/mp:*:*) 74476910425Smrg echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74576910425Smrg exit ;; 74676910425Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 74776910425Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 74876910425Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 74976910425Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 75076910425Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 75176910425Smrg exit ;; 75276910425Smrg 5000:UNIX_System_V:4.*:*) 75376910425Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 75476910425Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 75576910425Smrg echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 75676910425Smrg exit ;; 75776910425Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 75876910425Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 75976910425Smrg exit ;; 76076910425Smrg sparc*:BSD/OS:*:*) 76176910425Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 76276910425Smrg exit ;; 76376910425Smrg *:BSD/OS:*:*) 76476910425Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 76576910425Smrg exit ;; 76676910425Smrg *:FreeBSD:*:*) 76776910425Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 76876910425Smrg exit ;; 76976910425Smrg i*:CYGWIN*:*) 77076910425Smrg echo ${UNAME_MACHINE}-pc-cygwin 77176910425Smrg exit ;; 77276910425Smrg i*:MINGW*:*) 77376910425Smrg echo ${UNAME_MACHINE}-pc-mingw32 77476910425Smrg exit ;; 77576910425Smrg i*:windows32*:*) 77676910425Smrg # uname -m includes "-pc" on this system. 77776910425Smrg echo ${UNAME_MACHINE}-mingw32 77876910425Smrg exit ;; 77976910425Smrg i*:PW*:*) 78076910425Smrg echo ${UNAME_MACHINE}-pc-pw32 78176910425Smrg exit ;; 78276910425Smrg x86:Interix*:[34]*) 78376910425Smrg echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' 78476910425Smrg exit ;; 78576910425Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 78676910425Smrg echo i${UNAME_MACHINE}-pc-mks 78776910425Smrg exit ;; 78876910425Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 78976910425Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 79076910425Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 79176910425Smrg # UNAME_MACHINE based on the output of uname instead of i386? 79276910425Smrg echo i586-pc-interix 79376910425Smrg exit ;; 79476910425Smrg i*:UWIN*:*) 79576910425Smrg echo ${UNAME_MACHINE}-pc-uwin 79676910425Smrg exit ;; 79776910425Smrg amd64:CYGWIN*:*:*) 79876910425Smrg echo x86_64-unknown-cygwin 79976910425Smrg exit ;; 80076910425Smrg p*:CYGWIN*:*) 80176910425Smrg echo powerpcle-unknown-cygwin 80276910425Smrg exit ;; 80376910425Smrg prep*:SunOS:5.*:*) 80476910425Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 80576910425Smrg exit ;; 80676910425Smrg *:GNU:*:*) 80776910425Smrg # the GNU system 80876910425Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 80976910425Smrg exit ;; 81076910425Smrg *:GNU/*:*:*) 81176910425Smrg # other systems with GNU libc and userland 81276910425Smrg echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 81376910425Smrg exit ;; 81476910425Smrg i*86:Minix:*:*) 81576910425Smrg echo ${UNAME_MACHINE}-pc-minix 81676910425Smrg exit ;; 81776910425Smrg arm*:Linux:*:*) 81876910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 81976910425Smrg exit ;; 82076910425Smrg cris:Linux:*:*) 82176910425Smrg echo cris-axis-linux-gnu 82276910425Smrg exit ;; 82376910425Smrg crisv32:Linux:*:*) 82476910425Smrg echo crisv32-axis-linux-gnu 82576910425Smrg exit ;; 82676910425Smrg frv:Linux:*:*) 82776910425Smrg echo frv-unknown-linux-gnu 82876910425Smrg exit ;; 82976910425Smrg ia64:Linux:*:*) 83076910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 83176910425Smrg exit ;; 83276910425Smrg m32r*:Linux:*:*) 83376910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 83476910425Smrg exit ;; 83576910425Smrg m68*:Linux:*:*) 83676910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 83776910425Smrg exit ;; 83876910425Smrg mips:Linux:*:*) 83976910425Smrg eval $set_cc_for_build 84076910425Smrg sed 's/^ //' << EOF >$dummy.c 84176910425Smrg #undef CPU 84276910425Smrg #undef mips 84376910425Smrg #undef mipsel 84476910425Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 84576910425Smrg CPU=mipsel 84676910425Smrg #else 84776910425Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 84876910425Smrg CPU=mips 84976910425Smrg #else 85076910425Smrg CPU= 85176910425Smrg #endif 85276910425Smrg #endif 85376910425SmrgEOF 85476910425Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 85576910425Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 85676910425Smrg ;; 85776910425Smrg mips64:Linux:*:*) 85876910425Smrg eval $set_cc_for_build 85976910425Smrg sed 's/^ //' << EOF >$dummy.c 86076910425Smrg #undef CPU 86176910425Smrg #undef mips64 86276910425Smrg #undef mips64el 86376910425Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 86476910425Smrg CPU=mips64el 86576910425Smrg #else 86676910425Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 86776910425Smrg CPU=mips64 86876910425Smrg #else 86976910425Smrg CPU= 87076910425Smrg #endif 87176910425Smrg #endif 87276910425SmrgEOF 87376910425Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` 87476910425Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 87576910425Smrg ;; 87676910425Smrg ppc:Linux:*:*) 87776910425Smrg echo powerpc-unknown-linux-gnu 87876910425Smrg exit ;; 87976910425Smrg ppc64:Linux:*:*) 88076910425Smrg echo powerpc64-unknown-linux-gnu 88176910425Smrg exit ;; 88276910425Smrg alpha:Linux:*:*) 88376910425Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 88476910425Smrg EV5) UNAME_MACHINE=alphaev5 ;; 88576910425Smrg EV56) UNAME_MACHINE=alphaev56 ;; 88676910425Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 88776910425Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 88876910425Smrg EV6) UNAME_MACHINE=alphaev6 ;; 88976910425Smrg EV67) UNAME_MACHINE=alphaev67 ;; 89076910425Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 89176910425Smrg esac 89276910425Smrg objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 89376910425Smrg if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 89476910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 89576910425Smrg exit ;; 89676910425Smrg parisc:Linux:*:* | hppa:Linux:*:*) 89776910425Smrg # Look for CPU level 89876910425Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 89976910425Smrg PA7*) echo hppa1.1-unknown-linux-gnu ;; 90076910425Smrg PA8*) echo hppa2.0-unknown-linux-gnu ;; 90176910425Smrg *) echo hppa-unknown-linux-gnu ;; 90276910425Smrg esac 90376910425Smrg exit ;; 90476910425Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 90576910425Smrg echo hppa64-unknown-linux-gnu 90676910425Smrg exit ;; 90776910425Smrg s390:Linux:*:* | s390x:Linux:*:*) 90876910425Smrg echo ${UNAME_MACHINE}-ibm-linux 90976910425Smrg exit ;; 91076910425Smrg sh64*:Linux:*:*) 91176910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 91276910425Smrg exit ;; 91376910425Smrg sh*:Linux:*:*) 91476910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 91576910425Smrg exit ;; 91676910425Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 91776910425Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 91876910425Smrg exit ;; 91976910425Smrg x86_64:Linux:*:*) 92076910425Smrg echo x86_64-unknown-linux-gnu 92176910425Smrg exit ;; 92276910425Smrg i*86:Linux:*:*) 92376910425Smrg # The BFD linker knows what the default object file format is, so 92476910425Smrg # first see if it will tell us. cd to the root directory to prevent 92576910425Smrg # problems with other programs or directories called `ld' in the path. 92676910425Smrg # Set LC_ALL=C to ensure ld outputs messages in English. 92776910425Smrg ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 92876910425Smrg | sed -ne '/supported targets:/!d 92976910425Smrg s/[ ][ ]*/ /g 93076910425Smrg s/.*supported targets: *// 93176910425Smrg s/ .*// 93276910425Smrg p'` 93376910425Smrg case "$ld_supported_targets" in 93476910425Smrg elf32-i386) 93576910425Smrg TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 93676910425Smrg ;; 93776910425Smrg a.out-i386-linux) 93876910425Smrg echo "${UNAME_MACHINE}-pc-linux-gnuaout" 93976910425Smrg exit ;; 94076910425Smrg coff-i386) 94176910425Smrg echo "${UNAME_MACHINE}-pc-linux-gnucoff" 94276910425Smrg exit ;; 94376910425Smrg "") 94476910425Smrg # Either a pre-BFD a.out linker (linux-gnuoldld) or 94576910425Smrg # one that does not give us useful --help. 94676910425Smrg echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 94776910425Smrg exit ;; 94876910425Smrg esac 94976910425Smrg # Determine whether the default compiler is a.out or elf 95076910425Smrg eval $set_cc_for_build 95176910425Smrg sed 's/^ //' << EOF >$dummy.c 95276910425Smrg #include <features.h> 95376910425Smrg #ifdef __ELF__ 95476910425Smrg # ifdef __GLIBC__ 95576910425Smrg # if __GLIBC__ >= 2 95676910425Smrg LIBC=gnu 95776910425Smrg # else 95876910425Smrg LIBC=gnulibc1 95976910425Smrg # endif 96076910425Smrg # else 96176910425Smrg LIBC=gnulibc1 96276910425Smrg # endif 96376910425Smrg #else 96476910425Smrg #ifdef __INTEL_COMPILER 96576910425Smrg LIBC=gnu 96676910425Smrg #else 96776910425Smrg LIBC=gnuaout 96876910425Smrg #endif 96976910425Smrg #endif 97076910425Smrg #ifdef __dietlibc__ 97176910425Smrg LIBC=dietlibc 97276910425Smrg #endif 97376910425SmrgEOF 97476910425Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` 97576910425Smrg test x"${LIBC}" != x && { 97676910425Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 97776910425Smrg exit 97876910425Smrg } 97976910425Smrg test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } 98076910425Smrg ;; 98176910425Smrg i*86:DYNIX/ptx:4*:*) 98276910425Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 98376910425Smrg # earlier versions are messed up and put the nodename in both 98476910425Smrg # sysname and nodename. 98576910425Smrg echo i386-sequent-sysv4 98676910425Smrg exit ;; 98776910425Smrg i*86:UNIX_SV:4.2MP:2.*) 98876910425Smrg # Unixware is an offshoot of SVR4, but it has its own version 98976910425Smrg # number series starting with 2... 99076910425Smrg # I am not positive that other SVR4 systems won't match this, 99176910425Smrg # I just have to hope. -- rms. 99276910425Smrg # Use sysv4.2uw... so that sysv4* matches it. 99376910425Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 99476910425Smrg exit ;; 99576910425Smrg i*86:OS/2:*:*) 99676910425Smrg # If we were able to find `uname', then EMX Unix compatibility 99776910425Smrg # is probably installed. 99876910425Smrg echo ${UNAME_MACHINE}-pc-os2-emx 99976910425Smrg exit ;; 100076910425Smrg i*86:XTS-300:*:STOP) 100176910425Smrg echo ${UNAME_MACHINE}-unknown-stop 100276910425Smrg exit ;; 100376910425Smrg i*86:atheos:*:*) 100476910425Smrg echo ${UNAME_MACHINE}-unknown-atheos 100576910425Smrg exit ;; 100676910425Smrg i*86:syllable:*:*) 100776910425Smrg echo ${UNAME_MACHINE}-pc-syllable 100876910425Smrg exit ;; 100976910425Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 101076910425Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 101176910425Smrg exit ;; 101276910425Smrg i*86:*DOS:*:*) 101376910425Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 101476910425Smrg exit ;; 101576910425Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 101676910425Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 101776910425Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 101876910425Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 101976910425Smrg else 102076910425Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 102176910425Smrg fi 102276910425Smrg exit ;; 102376910425Smrg i*86:*:5:[678]*) 102476910425Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 102576910425Smrg case `/bin/uname -X | grep "^Machine"` in 102676910425Smrg *486*) UNAME_MACHINE=i486 ;; 102776910425Smrg *Pentium) UNAME_MACHINE=i586 ;; 102876910425Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 102976910425Smrg esac 103076910425Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 103176910425Smrg exit ;; 103276910425Smrg i*86:*:3.2:*) 103376910425Smrg if test -f /usr/options/cb.name; then 103476910425Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 103576910425Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 103676910425Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 103776910425Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 103876910425Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 103976910425Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 104076910425Smrg && UNAME_MACHINE=i586 104176910425Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 104276910425Smrg && UNAME_MACHINE=i686 104376910425Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 104476910425Smrg && UNAME_MACHINE=i686 104576910425Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 104676910425Smrg else 104776910425Smrg echo ${UNAME_MACHINE}-pc-sysv32 104876910425Smrg fi 104976910425Smrg exit ;; 105076910425Smrg pc:*:*:*) 105176910425Smrg # Left here for compatibility: 105276910425Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 105376910425Smrg # the processor, so we play safe by assuming i386. 105476910425Smrg echo i386-pc-msdosdjgpp 105576910425Smrg exit ;; 105676910425Smrg Intel:Mach:3*:*) 105776910425Smrg echo i386-pc-mach3 105876910425Smrg exit ;; 105976910425Smrg paragon:*:*:*) 106076910425Smrg echo i860-intel-osf1 106176910425Smrg exit ;; 106276910425Smrg i860:*:4.*:*) # i860-SVR4 106376910425Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 106476910425Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 106576910425Smrg else # Add other i860-SVR4 vendors below as they are discovered. 106676910425Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 106776910425Smrg fi 106876910425Smrg exit ;; 106976910425Smrg mini*:CTIX:SYS*5:*) 107076910425Smrg # "miniframe" 107176910425Smrg echo m68010-convergent-sysv 107276910425Smrg exit ;; 107376910425Smrg mc68k:UNIX:SYSTEM5:3.51m) 107476910425Smrg echo m68k-convergent-sysv 107576910425Smrg exit ;; 107676910425Smrg M680?0:D-NIX:5.3:*) 107776910425Smrg echo m68k-diab-dnix 107876910425Smrg exit ;; 107976910425Smrg M68*:*:R3V[5678]*:*) 108076910425Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 108176910425Smrg 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) 108276910425Smrg OS_REL='' 108376910425Smrg test -r /etc/.relid \ 108476910425Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 108576910425Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 108676910425Smrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 108776910425Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 108876910425Smrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 108976910425Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 109076910425Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 109176910425Smrg && { echo i486-ncr-sysv4; exit; } ;; 109276910425Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 109376910425Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 109476910425Smrg exit ;; 109576910425Smrg mc68030:UNIX_System_V:4.*:*) 109676910425Smrg echo m68k-atari-sysv4 109776910425Smrg exit ;; 109876910425Smrg TSUNAMI:LynxOS:2.*:*) 109976910425Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 110076910425Smrg exit ;; 110176910425Smrg rs6000:LynxOS:2.*:*) 110276910425Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 110376910425Smrg exit ;; 110476910425Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 110576910425Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 110676910425Smrg exit ;; 110776910425Smrg SM[BE]S:UNIX_SV:*:*) 110876910425Smrg echo mips-dde-sysv${UNAME_RELEASE} 110976910425Smrg exit ;; 111076910425Smrg RM*:ReliantUNIX-*:*:*) 111176910425Smrg echo mips-sni-sysv4 111276910425Smrg exit ;; 111376910425Smrg RM*:SINIX-*:*:*) 111476910425Smrg echo mips-sni-sysv4 111576910425Smrg exit ;; 111676910425Smrg *:SINIX-*:*:*) 111776910425Smrg if uname -p 2>/dev/null >/dev/null ; then 111876910425Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 111976910425Smrg echo ${UNAME_MACHINE}-sni-sysv4 112076910425Smrg else 112176910425Smrg echo ns32k-sni-sysv 112276910425Smrg fi 112376910425Smrg exit ;; 112476910425Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 112576910425Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 112676910425Smrg echo i586-unisys-sysv4 112776910425Smrg exit ;; 112876910425Smrg *:UNIX_System_V:4*:FTX*) 112976910425Smrg # From Gerald Hewes <hewes@openmarket.com>. 113076910425Smrg # How about differentiating between stratus architectures? -djm 113176910425Smrg echo hppa1.1-stratus-sysv4 113276910425Smrg exit ;; 113376910425Smrg *:*:*:FTX*) 113476910425Smrg # From seanf@swdc.stratus.com. 113576910425Smrg echo i860-stratus-sysv4 113676910425Smrg exit ;; 113776910425Smrg i*86:VOS:*:*) 113876910425Smrg # From Paul.Green@stratus.com. 113976910425Smrg echo ${UNAME_MACHINE}-stratus-vos 114076910425Smrg exit ;; 114176910425Smrg *:VOS:*:*) 114276910425Smrg # From Paul.Green@stratus.com. 114376910425Smrg echo hppa1.1-stratus-vos 114476910425Smrg exit ;; 114576910425Smrg mc68*:A/UX:*:*) 114676910425Smrg echo m68k-apple-aux${UNAME_RELEASE} 114776910425Smrg exit ;; 114876910425Smrg news*:NEWS-OS:6*:*) 114976910425Smrg echo mips-sony-newsos6 115076910425Smrg exit ;; 115176910425Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 115276910425Smrg if [ -d /usr/nec ]; then 115376910425Smrg echo mips-nec-sysv${UNAME_RELEASE} 115476910425Smrg else 115576910425Smrg echo mips-unknown-sysv${UNAME_RELEASE} 115676910425Smrg fi 115776910425Smrg exit ;; 115876910425Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 115976910425Smrg echo powerpc-be-beos 116076910425Smrg exit ;; 116176910425Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 116276910425Smrg echo powerpc-apple-beos 116376910425Smrg exit ;; 116476910425Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 116576910425Smrg echo i586-pc-beos 116676910425Smrg exit ;; 116776910425Smrg SX-4:SUPER-UX:*:*) 116876910425Smrg echo sx4-nec-superux${UNAME_RELEASE} 116976910425Smrg exit ;; 117076910425Smrg SX-5:SUPER-UX:*:*) 117176910425Smrg echo sx5-nec-superux${UNAME_RELEASE} 117276910425Smrg exit ;; 117376910425Smrg SX-6:SUPER-UX:*:*) 117476910425Smrg echo sx6-nec-superux${UNAME_RELEASE} 117576910425Smrg exit ;; 117676910425Smrg Power*:Rhapsody:*:*) 117776910425Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 117876910425Smrg exit ;; 117976910425Smrg *:Rhapsody:*:*) 118076910425Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 118176910425Smrg exit ;; 118276910425Smrg *:Darwin:*:*) 118376910425Smrg UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 118476910425Smrg case $UNAME_PROCESSOR in 118576910425Smrg *86) UNAME_PROCESSOR=i686 ;; 118676910425Smrg unknown) UNAME_PROCESSOR=powerpc ;; 118776910425Smrg esac 118876910425Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 118976910425Smrg exit ;; 119076910425Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 119176910425Smrg UNAME_PROCESSOR=`uname -p` 119276910425Smrg if test "$UNAME_PROCESSOR" = "x86"; then 119376910425Smrg UNAME_PROCESSOR=i386 119476910425Smrg UNAME_MACHINE=pc 119576910425Smrg fi 119676910425Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 119776910425Smrg exit ;; 119876910425Smrg *:QNX:*:4*) 119976910425Smrg echo i386-pc-qnx 120076910425Smrg exit ;; 120176910425Smrg NSE-?:NONSTOP_KERNEL:*:*) 120276910425Smrg echo nse-tandem-nsk${UNAME_RELEASE} 120376910425Smrg exit ;; 120476910425Smrg NSR-?:NONSTOP_KERNEL:*:*) 120576910425Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 120676910425Smrg exit ;; 120776910425Smrg *:NonStop-UX:*:*) 120876910425Smrg echo mips-compaq-nonstopux 120976910425Smrg exit ;; 121076910425Smrg BS2000:POSIX*:*:*) 121176910425Smrg echo bs2000-siemens-sysv 121276910425Smrg exit ;; 121376910425Smrg DS/*:UNIX_System_V:*:*) 121476910425Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 121576910425Smrg exit ;; 121676910425Smrg *:Plan9:*:*) 121776910425Smrg # "uname -m" is not consistent, so use $cputype instead. 386 121876910425Smrg # is converted to i386 for consistency with other x86 121976910425Smrg # operating systems. 122076910425Smrg if test "$cputype" = "386"; then 122176910425Smrg UNAME_MACHINE=i386 122276910425Smrg else 122376910425Smrg UNAME_MACHINE="$cputype" 122476910425Smrg fi 122576910425Smrg echo ${UNAME_MACHINE}-unknown-plan9 122676910425Smrg exit ;; 122776910425Smrg *:TOPS-10:*:*) 122876910425Smrg echo pdp10-unknown-tops10 122976910425Smrg exit ;; 123076910425Smrg *:TENEX:*:*) 123176910425Smrg echo pdp10-unknown-tenex 123276910425Smrg exit ;; 123376910425Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 123476910425Smrg echo pdp10-dec-tops20 123576910425Smrg exit ;; 123676910425Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 123776910425Smrg echo pdp10-xkl-tops20 123876910425Smrg exit ;; 123976910425Smrg *:TOPS-20:*:*) 124076910425Smrg echo pdp10-unknown-tops20 124176910425Smrg exit ;; 124276910425Smrg *:ITS:*:*) 124376910425Smrg echo pdp10-unknown-its 124476910425Smrg exit ;; 124576910425Smrg SEI:*:*:SEIUX) 124676910425Smrg echo mips-sei-seiux${UNAME_RELEASE} 124776910425Smrg exit ;; 124876910425Smrg *:DragonFly:*:*) 124976910425Smrg echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 125076910425Smrg exit ;; 125176910425Smrg *:*VMS:*:*) 125276910425Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 125376910425Smrg case "${UNAME_MACHINE}" in 125476910425Smrg A*) echo alpha-dec-vms ; exit ;; 125576910425Smrg I*) echo ia64-dec-vms ; exit ;; 125676910425Smrg V*) echo vax-dec-vms ; exit ;; 125776910425Smrg esac ;; 125876910425Smrg *:XENIX:*:SysV) 125976910425Smrg echo i386-pc-xenix 126076910425Smrg exit ;; 126176910425Smrg i*86:skyos:*:*) 126276910425Smrg echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 126376910425Smrg exit ;; 126476910425Smrgesac 126576910425Smrg 126676910425Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 126776910425Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 126876910425Smrg 126976910425Smrgeval $set_cc_for_build 127076910425Smrgcat >$dummy.c <<EOF 127176910425Smrg#ifdef _SEQUENT_ 127276910425Smrg# include <sys/types.h> 127376910425Smrg# include <sys/utsname.h> 127476910425Smrg#endif 127576910425Smrgmain () 127676910425Smrg{ 127776910425Smrg#if defined (sony) 127876910425Smrg#if defined (MIPSEB) 127976910425Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 128076910425Smrg I don't know.... */ 128176910425Smrg printf ("mips-sony-bsd\n"); exit (0); 128276910425Smrg#else 128376910425Smrg#include <sys/param.h> 128476910425Smrg printf ("m68k-sony-newsos%s\n", 128576910425Smrg#ifdef NEWSOS4 128676910425Smrg "4" 128776910425Smrg#else 128876910425Smrg "" 128976910425Smrg#endif 129076910425Smrg ); exit (0); 129176910425Smrg#endif 129276910425Smrg#endif 129376910425Smrg 129476910425Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 129576910425Smrg printf ("arm-acorn-riscix\n"); exit (0); 129676910425Smrg#endif 129776910425Smrg 129876910425Smrg#if defined (hp300) && !defined (hpux) 129976910425Smrg printf ("m68k-hp-bsd\n"); exit (0); 130076910425Smrg#endif 130176910425Smrg 130276910425Smrg#if defined (NeXT) 130376910425Smrg#if !defined (__ARCHITECTURE__) 130476910425Smrg#define __ARCHITECTURE__ "m68k" 130576910425Smrg#endif 130676910425Smrg int version; 130776910425Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 130876910425Smrg if (version < 4) 130976910425Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 131076910425Smrg else 131176910425Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 131276910425Smrg exit (0); 131376910425Smrg#endif 131476910425Smrg 131576910425Smrg#if defined (MULTIMAX) || defined (n16) 131676910425Smrg#if defined (UMAXV) 131776910425Smrg printf ("ns32k-encore-sysv\n"); exit (0); 131876910425Smrg#else 131976910425Smrg#if defined (CMU) 132076910425Smrg printf ("ns32k-encore-mach\n"); exit (0); 132176910425Smrg#else 132276910425Smrg printf ("ns32k-encore-bsd\n"); exit (0); 132376910425Smrg#endif 132476910425Smrg#endif 132576910425Smrg#endif 132676910425Smrg 132776910425Smrg#if defined (__386BSD__) 132876910425Smrg printf ("i386-pc-bsd\n"); exit (0); 132976910425Smrg#endif 133076910425Smrg 133176910425Smrg#if defined (sequent) 133276910425Smrg#if defined (i386) 133376910425Smrg printf ("i386-sequent-dynix\n"); exit (0); 133476910425Smrg#endif 133576910425Smrg#if defined (ns32000) 133676910425Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 133776910425Smrg#endif 133876910425Smrg#endif 133976910425Smrg 134076910425Smrg#if defined (_SEQUENT_) 134176910425Smrg struct utsname un; 134276910425Smrg 134376910425Smrg uname(&un); 134476910425Smrg 134576910425Smrg if (strncmp(un.version, "V2", 2) == 0) { 134676910425Smrg printf ("i386-sequent-ptx2\n"); exit (0); 134776910425Smrg } 134876910425Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 134976910425Smrg printf ("i386-sequent-ptx1\n"); exit (0); 135076910425Smrg } 135176910425Smrg printf ("i386-sequent-ptx\n"); exit (0); 135276910425Smrg 135376910425Smrg#endif 135476910425Smrg 135576910425Smrg#if defined (vax) 135676910425Smrg# if !defined (ultrix) 135776910425Smrg# include <sys/param.h> 135876910425Smrg# if defined (BSD) 135976910425Smrg# if BSD == 43 136076910425Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 136176910425Smrg# else 136276910425Smrg# if BSD == 199006 136376910425Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 136476910425Smrg# else 136576910425Smrg printf ("vax-dec-bsd\n"); exit (0); 136676910425Smrg# endif 136776910425Smrg# endif 136876910425Smrg# else 136976910425Smrg printf ("vax-dec-bsd\n"); exit (0); 137076910425Smrg# endif 137176910425Smrg# else 137276910425Smrg printf ("vax-dec-ultrix\n"); exit (0); 137376910425Smrg# endif 137476910425Smrg#endif 137576910425Smrg 137676910425Smrg#if defined (alliant) && defined (i860) 137776910425Smrg printf ("i860-alliant-bsd\n"); exit (0); 137876910425Smrg#endif 137976910425Smrg 138076910425Smrg exit (1); 138176910425Smrg} 138276910425SmrgEOF 138376910425Smrg 138476910425Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 138576910425Smrg { echo "$SYSTEM_NAME"; exit; } 138676910425Smrg 138776910425Smrg# Apollos put the system type in the environment. 138876910425Smrg 138976910425Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 139076910425Smrg 139176910425Smrg# Convex versions that predate uname can use getsysinfo(1) 139276910425Smrg 139376910425Smrgif [ -x /usr/convex/getsysinfo ] 139476910425Smrgthen 139576910425Smrg case `getsysinfo -f cpu_type` in 139676910425Smrg c1*) 139776910425Smrg echo c1-convex-bsd 139876910425Smrg exit ;; 139976910425Smrg c2*) 140076910425Smrg if getsysinfo -f scalar_acc 140176910425Smrg then echo c32-convex-bsd 140276910425Smrg else echo c2-convex-bsd 140376910425Smrg fi 140476910425Smrg exit ;; 140576910425Smrg c34*) 140676910425Smrg echo c34-convex-bsd 140776910425Smrg exit ;; 140876910425Smrg c38*) 140976910425Smrg echo c38-convex-bsd 141076910425Smrg exit ;; 141176910425Smrg c4*) 141276910425Smrg echo c4-convex-bsd 141376910425Smrg exit ;; 141476910425Smrg esac 141576910425Smrgfi 141676910425Smrg 141776910425Smrgcat >&2 <<EOF 141876910425Smrg$0: unable to guess system type 141976910425Smrg 142076910425SmrgThis script, last modified $timestamp, has failed to recognize 142176910425Smrgthe operating system you are using. It is advised that you 142276910425Smrgdownload the most up to date version of the config scripts from 142376910425Smrg 142476910425Smrg http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess 142576910425Smrgand 142676910425Smrg http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub 142776910425Smrg 142876910425SmrgIf the version you run ($0) is already up to date, please 142976910425Smrgsend the following data and any information you think might be 143076910425Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 143176910425Smrginformation to handle your system. 143276910425Smrg 143376910425Smrgconfig.guess timestamp = $timestamp 143476910425Smrg 143576910425Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 143676910425Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 143776910425Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 143876910425Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 143976910425Smrg 144076910425Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 144176910425Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 144276910425Smrg 144376910425Smrghostinfo = `(hostinfo) 2>/dev/null` 144476910425Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 144576910425Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 144676910425Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 144776910425Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 144876910425Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 144976910425Smrg 145076910425SmrgUNAME_MACHINE = ${UNAME_MACHINE} 145176910425SmrgUNAME_RELEASE = ${UNAME_RELEASE} 145276910425SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 145376910425SmrgUNAME_VERSION = ${UNAME_VERSION} 145476910425SmrgEOF 145576910425Smrg 145676910425Smrgexit 1 145776910425Smrg 145876910425Smrg# Local variables: 145976910425Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 146076910425Smrg# time-stamp-start: "timestamp='" 146176910425Smrg# time-stamp-format: "%:y-%02m-%02d" 146276910425Smrg# time-stamp-end: "'" 146376910425Smrg# End: 1464