config.guess revision 29459361
129459361Smrg#! /bin/sh 229459361Smrg# Attempt to guess a canonical system name. 329459361Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 429459361Smrg# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, 529459361Smrg# Inc. 629459361Smrg 729459361Smrgtimestamp='2006-12-08' 829459361Smrg 929459361Smrg# This file is free software; you can redistribute it and/or modify it 1029459361Smrg# under the terms of the GNU General Public License as published by 1129459361Smrg# the Free Software Foundation; either version 2 of the License, or 1229459361Smrg# (at your option) any later version. 1329459361Smrg# 1429459361Smrg# This program is distributed in the hope that it will be useful, but 1529459361Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1629459361Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1729459361Smrg# General Public License for more details. 1829459361Smrg# 1929459361Smrg# You should have received a copy of the GNU General Public License 2029459361Smrg# along with this program; if not, write to the Free Software 2129459361Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 2229459361Smrg# 02110-1301, USA. 2329459361Smrg# 2429459361Smrg# As a special exception to the GNU General Public License, if you 2529459361Smrg# distribute this file as part of a program that contains a 2629459361Smrg# configuration script generated by Autoconf, you may include it under 2729459361Smrg# the same distribution terms that you use for the rest of that program. 2829459361Smrg 2929459361Smrg 3029459361Smrg# Originally written by Per Bothner <per@bothner.com>. 3129459361Smrg# Please send patches to <config-patches@gnu.org>. Submit a context 3229459361Smrg# diff and a properly formatted ChangeLog entry. 3329459361Smrg# 3429459361Smrg# This script attempts to guess a canonical system name similar to 3529459361Smrg# config.sub. If it succeeds, it prints the system name on stdout, and 3629459361Smrg# exits with 0. Otherwise, it exits with 1. 3729459361Smrg# 3829459361Smrg# The plan is that this can be called by configure scripts if you 3929459361Smrg# don't specify an explicit build system type. 4029459361Smrg 4129459361Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4229459361Smrg 4329459361Smrgusage="\ 4429459361SmrgUsage: $0 [OPTION] 4529459361Smrg 4629459361SmrgOutput the configuration name of the system \`$me' is run on. 4729459361Smrg 4829459361SmrgOperation modes: 4929459361Smrg -h, --help print this help, then exit 5029459361Smrg -t, --time-stamp print date of last modification, then exit 5129459361Smrg -v, --version print version number, then exit 5229459361Smrg 5329459361SmrgReport bugs and patches to <config-patches@gnu.org>." 5429459361Smrg 5529459361Smrgversion="\ 5629459361SmrgGNU config.guess ($timestamp) 5729459361Smrg 5829459361SmrgOriginally written by Per Bothner. 5929459361SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 6029459361SmrgFree Software Foundation, Inc. 6129459361Smrg 6229459361SmrgThis is free software; see the source for copying conditions. There is NO 6329459361Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6429459361Smrg 6529459361Smrghelp=" 6629459361SmrgTry \`$me --help' for more information." 6729459361Smrg 6829459361Smrg# Parse command line 6929459361Smrgwhile test $# -gt 0 ; do 7029459361Smrg case $1 in 7129459361Smrg --time-stamp | --time* | -t ) 7229459361Smrg echo "$timestamp" ; exit ;; 7329459361Smrg --version | -v ) 7429459361Smrg echo "$version" ; exit ;; 7529459361Smrg --help | --h* | -h ) 7629459361Smrg echo "$usage"; exit ;; 7729459361Smrg -- ) # Stop option processing 7829459361Smrg shift; break ;; 7929459361Smrg - ) # Use stdin as input. 8029459361Smrg break ;; 8129459361Smrg -* ) 8229459361Smrg echo "$me: invalid option $1$help" >&2 8329459361Smrg exit 1 ;; 8429459361Smrg * ) 8529459361Smrg break ;; 8629459361Smrg esac 8729459361Smrgdone 8829459361Smrg 8929459361Smrgif test $# != 0; then 9029459361Smrg echo "$me: too many arguments$help" >&2 9129459361Smrg exit 1 9229459361Smrgfi 9329459361Smrg 9429459361Smrgtrap 'exit 1' 1 2 15 9529459361Smrg 9629459361Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 9729459361Smrg# compiler to aid in system detection is discouraged as it requires 9829459361Smrg# temporary files to be created and, as you can see below, it is a 9929459361Smrg# headache to deal with in a portable fashion. 10029459361Smrg 10129459361Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 10229459361Smrg# use `HOST_CC' if defined, but it is deprecated. 10329459361Smrg 10429459361Smrg# Portable tmp directory creation inspired by the Autoconf team. 10529459361Smrg 10629459361Smrgset_cc_for_build=' 10729459361Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 10829459361Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 10929459361Smrg: ${TMPDIR=/tmp} ; 11029459361Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 11129459361Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 11229459361Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 11329459361Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 11429459361Smrgdummy=$tmp/dummy ; 11529459361Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 11629459361Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in 11729459361Smrg ,,) echo "int x;" > $dummy.c ; 11829459361Smrg for c in cc gcc c89 c99 ; do 11929459361Smrg if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 12029459361Smrg CC_FOR_BUILD="$c"; break ; 12129459361Smrg fi ; 12229459361Smrg done ; 12329459361Smrg if test x"$CC_FOR_BUILD" = x ; then 12429459361Smrg CC_FOR_BUILD=no_compiler_found ; 12529459361Smrg fi 12629459361Smrg ;; 12729459361Smrg ,,*) CC_FOR_BUILD=$CC ;; 12829459361Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 12929459361Smrgesac ; set_cc_for_build= ;' 13029459361Smrg 13129459361Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 13229459361Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 13329459361Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 13429459361Smrg PATH=$PATH:/.attbin ; export PATH 13529459361Smrgfi 13629459361Smrg 13729459361SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 13829459361SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 13929459361SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 14029459361SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 14129459361Smrg 14229459361Smrg# Note: order is significant - the case branches are not exclusive. 14329459361Smrg 14429459361Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 14529459361Smrg *:NetBSD:*:*) 14629459361Smrg # NetBSD (nbsd) targets should (where applicable) match one or 14729459361Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 14829459361Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 14929459361Smrg # switched to ELF, *-*-netbsd* would select the old 15029459361Smrg # object file format. This provides both forward 15129459361Smrg # compatibility and a consistent mechanism for selecting the 15229459361Smrg # object file format. 15329459361Smrg # 15429459361Smrg # Note: NetBSD doesn't particularly care about the vendor 15529459361Smrg # portion of the name. We always set it to "unknown". 15629459361Smrg sysctl="sysctl -n hw.machine_arch" 15729459361Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 15829459361Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 15929459361Smrg case "${UNAME_MACHINE_ARCH}" in 16029459361Smrg armeb) machine=armeb-unknown ;; 16129459361Smrg arm*) machine=arm-unknown ;; 16229459361Smrg sh3el) machine=shl-unknown ;; 16329459361Smrg sh3eb) machine=sh-unknown ;; 16429459361Smrg sh5el) machine=sh5le-unknown ;; 16529459361Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 16629459361Smrg esac 16729459361Smrg # The Operating System including object format, if it has switched 16829459361Smrg # to ELF recently, or will in the future. 16929459361Smrg case "${UNAME_MACHINE_ARCH}" in 17029459361Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 17129459361Smrg eval $set_cc_for_build 17229459361Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 17329459361Smrg | grep __ELF__ >/dev/null 17429459361Smrg then 17529459361Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 17629459361Smrg # Return netbsd for either. FIX? 17729459361Smrg os=netbsd 17829459361Smrg else 17929459361Smrg os=netbsdelf 18029459361Smrg fi 18129459361Smrg ;; 18229459361Smrg *) 18329459361Smrg os=netbsd 18429459361Smrg ;; 18529459361Smrg esac 18629459361Smrg # The OS release 18729459361Smrg # Debian GNU/NetBSD machines have a different userland, and 18829459361Smrg # thus, need a distinct triplet. However, they do not need 18929459361Smrg # kernel version information, so it can be replaced with a 19029459361Smrg # suitable tag, in the style of linux-gnu. 19129459361Smrg case "${UNAME_VERSION}" in 19229459361Smrg Debian*) 19329459361Smrg release='-gnu' 19429459361Smrg ;; 19529459361Smrg *) 19629459361Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 19729459361Smrg ;; 19829459361Smrg esac 19929459361Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 20029459361Smrg # contains redundant information, the shorter form: 20129459361Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 20229459361Smrg echo "${machine}-${os}${release}" 20329459361Smrg exit ;; 20429459361Smrg *:OpenBSD:*:*) 20529459361Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 20629459361Smrg echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 20729459361Smrg exit ;; 20829459361Smrg *:ekkoBSD:*:*) 20929459361Smrg echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 21029459361Smrg exit ;; 21129459361Smrg *:SolidBSD:*:*) 21229459361Smrg echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 21329459361Smrg exit ;; 21429459361Smrg macppc:MirBSD:*:*) 21529459361Smrg echo powerpc-unknown-mirbsd${UNAME_RELEASE} 21629459361Smrg exit ;; 21729459361Smrg *:MirBSD:*:*) 21829459361Smrg echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 21929459361Smrg exit ;; 22029459361Smrg alpha:OSF1:*:*) 22129459361Smrg case $UNAME_RELEASE in 22229459361Smrg *4.0) 22329459361Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 22429459361Smrg ;; 22529459361Smrg *5.*) 22629459361Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 22729459361Smrg ;; 22829459361Smrg esac 22929459361Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 23029459361Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 23129459361Smrg # covers most systems running today. This code pipes the CPU 23229459361Smrg # types through head -n 1, so we only detect the type of CPU 0. 23329459361Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 23429459361Smrg case "$ALPHA_CPU_TYPE" in 23529459361Smrg "EV4 (21064)") 23629459361Smrg UNAME_MACHINE="alpha" ;; 23729459361Smrg "EV4.5 (21064)") 23829459361Smrg UNAME_MACHINE="alpha" ;; 23929459361Smrg "LCA4 (21066/21068)") 24029459361Smrg UNAME_MACHINE="alpha" ;; 24129459361Smrg "EV5 (21164)") 24229459361Smrg UNAME_MACHINE="alphaev5" ;; 24329459361Smrg "EV5.6 (21164A)") 24429459361Smrg UNAME_MACHINE="alphaev56" ;; 24529459361Smrg "EV5.6 (21164PC)") 24629459361Smrg UNAME_MACHINE="alphapca56" ;; 24729459361Smrg "EV5.7 (21164PC)") 24829459361Smrg UNAME_MACHINE="alphapca57" ;; 24929459361Smrg "EV6 (21264)") 25029459361Smrg UNAME_MACHINE="alphaev6" ;; 25129459361Smrg "EV6.7 (21264A)") 25229459361Smrg UNAME_MACHINE="alphaev67" ;; 25329459361Smrg "EV6.8CB (21264C)") 25429459361Smrg UNAME_MACHINE="alphaev68" ;; 25529459361Smrg "EV6.8AL (21264B)") 25629459361Smrg UNAME_MACHINE="alphaev68" ;; 25729459361Smrg "EV6.8CX (21264D)") 25829459361Smrg UNAME_MACHINE="alphaev68" ;; 25929459361Smrg "EV6.9A (21264/EV69A)") 26029459361Smrg UNAME_MACHINE="alphaev69" ;; 26129459361Smrg "EV7 (21364)") 26229459361Smrg UNAME_MACHINE="alphaev7" ;; 26329459361Smrg "EV7.9 (21364A)") 26429459361Smrg UNAME_MACHINE="alphaev79" ;; 26529459361Smrg esac 26629459361Smrg # A Pn.n version is a patched version. 26729459361Smrg # A Vn.n version is a released version. 26829459361Smrg # A Tn.n version is a released field test version. 26929459361Smrg # A Xn.n version is an unreleased experimental baselevel. 27029459361Smrg # 1.2 uses "1.2" for uname -r. 27129459361Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 27229459361Smrg exit ;; 27329459361Smrg Alpha\ *:Windows_NT*:*) 27429459361Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 27529459361Smrg # Should we change UNAME_MACHINE based on the output of uname instead 27629459361Smrg # of the specific Alpha model? 27729459361Smrg echo alpha-pc-interix 27829459361Smrg exit ;; 27929459361Smrg 21064:Windows_NT:50:3) 28029459361Smrg echo alpha-dec-winnt3.5 28129459361Smrg exit ;; 28229459361Smrg Amiga*:UNIX_System_V:4.0:*) 28329459361Smrg echo m68k-unknown-sysv4 28429459361Smrg exit ;; 28529459361Smrg *:[Aa]miga[Oo][Ss]:*:*) 28629459361Smrg echo ${UNAME_MACHINE}-unknown-amigaos 28729459361Smrg exit ;; 28829459361Smrg *:[Mm]orph[Oo][Ss]:*:*) 28929459361Smrg echo ${UNAME_MACHINE}-unknown-morphos 29029459361Smrg exit ;; 29129459361Smrg *:OS/390:*:*) 29229459361Smrg echo i370-ibm-openedition 29329459361Smrg exit ;; 29429459361Smrg *:z/VM:*:*) 29529459361Smrg echo s390-ibm-zvmoe 29629459361Smrg exit ;; 29729459361Smrg *:OS400:*:*) 29829459361Smrg echo powerpc-ibm-os400 29929459361Smrg exit ;; 30029459361Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 30129459361Smrg echo arm-acorn-riscix${UNAME_RELEASE} 30229459361Smrg exit ;; 30329459361Smrg arm:riscos:*:*|arm:RISCOS:*:*) 30429459361Smrg echo arm-unknown-riscos 30529459361Smrg exit ;; 30629459361Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 30729459361Smrg echo hppa1.1-hitachi-hiuxmpp 30829459361Smrg exit ;; 30929459361Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 31029459361Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 31129459361Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 31229459361Smrg echo pyramid-pyramid-sysv3 31329459361Smrg else 31429459361Smrg echo pyramid-pyramid-bsd 31529459361Smrg fi 31629459361Smrg exit ;; 31729459361Smrg NILE*:*:*:dcosx) 31829459361Smrg echo pyramid-pyramid-svr4 31929459361Smrg exit ;; 32029459361Smrg DRS?6000:unix:4.0:6*) 32129459361Smrg echo sparc-icl-nx6 32229459361Smrg exit ;; 32329459361Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 32429459361Smrg case `/usr/bin/uname -p` in 32529459361Smrg sparc) echo sparc-icl-nx7; exit ;; 32629459361Smrg esac ;; 32729459361Smrg sun4H:SunOS:5.*:*) 32829459361Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32929459361Smrg exit ;; 33029459361Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 33129459361Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33229459361Smrg exit ;; 33329459361Smrg i86pc:SunOS:5.*:*) 33429459361Smrg echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33529459361Smrg exit ;; 33629459361Smrg sun4*:SunOS:6*:*) 33729459361Smrg # According to config.sub, this is the proper way to canonicalize 33829459361Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 33929459361Smrg # it's likely to be more like Solaris than SunOS4. 34029459361Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 34129459361Smrg exit ;; 34229459361Smrg sun4*:SunOS:*:*) 34329459361Smrg case "`/usr/bin/arch -k`" in 34429459361Smrg Series*|S4*) 34529459361Smrg UNAME_RELEASE=`uname -v` 34629459361Smrg ;; 34729459361Smrg esac 34829459361Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 34929459361Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 35029459361Smrg exit ;; 35129459361Smrg sun3*:SunOS:*:*) 35229459361Smrg echo m68k-sun-sunos${UNAME_RELEASE} 35329459361Smrg exit ;; 35429459361Smrg sun*:*:4.2BSD:*) 35529459361Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 35629459361Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 35729459361Smrg case "`/bin/arch`" in 35829459361Smrg sun3) 35929459361Smrg echo m68k-sun-sunos${UNAME_RELEASE} 36029459361Smrg ;; 36129459361Smrg sun4) 36229459361Smrg echo sparc-sun-sunos${UNAME_RELEASE} 36329459361Smrg ;; 36429459361Smrg esac 36529459361Smrg exit ;; 36629459361Smrg aushp:SunOS:*:*) 36729459361Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 36829459361Smrg exit ;; 36929459361Smrg # The situation for MiNT is a little confusing. The machine name 37029459361Smrg # can be virtually everything (everything which is not 37129459361Smrg # "atarist" or "atariste" at least should have a processor 37229459361Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 37329459361Smrg # to the lowercase version "mint" (or "freemint"). Finally 37429459361Smrg # the system name "TOS" denotes a system which is actually not 37529459361Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 37629459361Smrg # be no problem. 37729459361Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 37829459361Smrg echo m68k-atari-mint${UNAME_RELEASE} 37929459361Smrg exit ;; 38029459361Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 38129459361Smrg echo m68k-atari-mint${UNAME_RELEASE} 38229459361Smrg exit ;; 38329459361Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 38429459361Smrg echo m68k-atari-mint${UNAME_RELEASE} 38529459361Smrg exit ;; 38629459361Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 38729459361Smrg echo m68k-milan-mint${UNAME_RELEASE} 38829459361Smrg exit ;; 38929459361Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 39029459361Smrg echo m68k-hades-mint${UNAME_RELEASE} 39129459361Smrg exit ;; 39229459361Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 39329459361Smrg echo m68k-unknown-mint${UNAME_RELEASE} 39429459361Smrg exit ;; 39529459361Smrg m68k:machten:*:*) 39629459361Smrg echo m68k-apple-machten${UNAME_RELEASE} 39729459361Smrg exit ;; 39829459361Smrg powerpc:machten:*:*) 39929459361Smrg echo powerpc-apple-machten${UNAME_RELEASE} 40029459361Smrg exit ;; 40129459361Smrg RISC*:Mach:*:*) 40229459361Smrg echo mips-dec-mach_bsd4.3 40329459361Smrg exit ;; 40429459361Smrg RISC*:ULTRIX:*:*) 40529459361Smrg echo mips-dec-ultrix${UNAME_RELEASE} 40629459361Smrg exit ;; 40729459361Smrg VAX*:ULTRIX*:*:*) 40829459361Smrg echo vax-dec-ultrix${UNAME_RELEASE} 40929459361Smrg exit ;; 41029459361Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 41129459361Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 41229459361Smrg exit ;; 41329459361Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 41429459361Smrg eval $set_cc_for_build 41529459361Smrg sed 's/^ //' << EOF >$dummy.c 41629459361Smrg#ifdef __cplusplus 41729459361Smrg#include <stdio.h> /* for printf() prototype */ 41829459361Smrg int main (int argc, char *argv[]) { 41929459361Smrg#else 42029459361Smrg int main (argc, argv) int argc; char *argv[]; { 42129459361Smrg#endif 42229459361Smrg #if defined (host_mips) && defined (MIPSEB) 42329459361Smrg #if defined (SYSTYPE_SYSV) 42429459361Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 42529459361Smrg #endif 42629459361Smrg #if defined (SYSTYPE_SVR4) 42729459361Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 42829459361Smrg #endif 42929459361Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 43029459361Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 43129459361Smrg #endif 43229459361Smrg #endif 43329459361Smrg exit (-1); 43429459361Smrg } 43529459361SmrgEOF 43629459361Smrg $CC_FOR_BUILD -o $dummy $dummy.c && 43729459361Smrg dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 43829459361Smrg SYSTEM_NAME=`$dummy $dummyarg` && 43929459361Smrg { echo "$SYSTEM_NAME"; exit; } 44029459361Smrg echo mips-mips-riscos${UNAME_RELEASE} 44129459361Smrg exit ;; 44229459361Smrg Motorola:PowerMAX_OS:*:*) 44329459361Smrg echo powerpc-motorola-powermax 44429459361Smrg exit ;; 44529459361Smrg Motorola:*:4.3:PL8-*) 44629459361Smrg echo powerpc-harris-powermax 44729459361Smrg exit ;; 44829459361Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 44929459361Smrg echo powerpc-harris-powermax 45029459361Smrg exit ;; 45129459361Smrg Night_Hawk:Power_UNIX:*:*) 45229459361Smrg echo powerpc-harris-powerunix 45329459361Smrg exit ;; 45429459361Smrg m88k:CX/UX:7*:*) 45529459361Smrg echo m88k-harris-cxux7 45629459361Smrg exit ;; 45729459361Smrg m88k:*:4*:R4*) 45829459361Smrg echo m88k-motorola-sysv4 45929459361Smrg exit ;; 46029459361Smrg m88k:*:3*:R3*) 46129459361Smrg echo m88k-motorola-sysv3 46229459361Smrg exit ;; 46329459361Smrg AViiON:dgux:*:*) 46429459361Smrg # DG/UX returns AViiON for all architectures 46529459361Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 46629459361Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 46729459361Smrg then 46829459361Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 46929459361Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 47029459361Smrg then 47129459361Smrg echo m88k-dg-dgux${UNAME_RELEASE} 47229459361Smrg else 47329459361Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 47429459361Smrg fi 47529459361Smrg else 47629459361Smrg echo i586-dg-dgux${UNAME_RELEASE} 47729459361Smrg fi 47829459361Smrg exit ;; 47929459361Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 48029459361Smrg echo m88k-dolphin-sysv3 48129459361Smrg exit ;; 48229459361Smrg M88*:*:R3*:*) 48329459361Smrg # Delta 88k system running SVR3 48429459361Smrg echo m88k-motorola-sysv3 48529459361Smrg exit ;; 48629459361Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 48729459361Smrg echo m88k-tektronix-sysv3 48829459361Smrg exit ;; 48929459361Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 49029459361Smrg echo m68k-tektronix-bsd 49129459361Smrg exit ;; 49229459361Smrg *:IRIX*:*:*) 49329459361Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 49429459361Smrg exit ;; 49529459361Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 49629459361Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 49729459361Smrg exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 49829459361Smrg i*86:AIX:*:*) 49929459361Smrg echo i386-ibm-aix 50029459361Smrg exit ;; 50129459361Smrg ia64:AIX:*:*) 50229459361Smrg if [ -x /usr/bin/oslevel ] ; then 50329459361Smrg IBM_REV=`/usr/bin/oslevel` 50429459361Smrg else 50529459361Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 50629459361Smrg fi 50729459361Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 50829459361Smrg exit ;; 50929459361Smrg *:AIX:2:3) 51029459361Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 51129459361Smrg eval $set_cc_for_build 51229459361Smrg sed 's/^ //' << EOF >$dummy.c 51329459361Smrg #include <sys/systemcfg.h> 51429459361Smrg 51529459361Smrg main() 51629459361Smrg { 51729459361Smrg if (!__power_pc()) 51829459361Smrg exit(1); 51929459361Smrg puts("powerpc-ibm-aix3.2.5"); 52029459361Smrg exit(0); 52129459361Smrg } 52229459361SmrgEOF 52329459361Smrg if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 52429459361Smrg then 52529459361Smrg echo "$SYSTEM_NAME" 52629459361Smrg else 52729459361Smrg echo rs6000-ibm-aix3.2.5 52829459361Smrg fi 52929459361Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 53029459361Smrg echo rs6000-ibm-aix3.2.4 53129459361Smrg else 53229459361Smrg echo rs6000-ibm-aix3.2 53329459361Smrg fi 53429459361Smrg exit ;; 53529459361Smrg *:AIX:*:[45]) 53629459361Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 53729459361Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 53829459361Smrg IBM_ARCH=rs6000 53929459361Smrg else 54029459361Smrg IBM_ARCH=powerpc 54129459361Smrg fi 54229459361Smrg if [ -x /usr/bin/oslevel ] ; then 54329459361Smrg IBM_REV=`/usr/bin/oslevel` 54429459361Smrg else 54529459361Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 54629459361Smrg fi 54729459361Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 54829459361Smrg exit ;; 54929459361Smrg *:AIX:*:*) 55029459361Smrg echo rs6000-ibm-aix 55129459361Smrg exit ;; 55229459361Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 55329459361Smrg echo romp-ibm-bsd4.4 55429459361Smrg exit ;; 55529459361Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 55629459361Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 55729459361Smrg exit ;; # report: romp-ibm BSD 4.3 55829459361Smrg *:BOSX:*:*) 55929459361Smrg echo rs6000-bull-bosx 56029459361Smrg exit ;; 56129459361Smrg DPX/2?00:B.O.S.:*:*) 56229459361Smrg echo m68k-bull-sysv3 56329459361Smrg exit ;; 56429459361Smrg 9000/[34]??:4.3bsd:1.*:*) 56529459361Smrg echo m68k-hp-bsd 56629459361Smrg exit ;; 56729459361Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 56829459361Smrg echo m68k-hp-bsd4.4 56929459361Smrg exit ;; 57029459361Smrg 9000/[34678]??:HP-UX:*:*) 57129459361Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 57229459361Smrg case "${UNAME_MACHINE}" in 57329459361Smrg 9000/31? ) HP_ARCH=m68000 ;; 57429459361Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 57529459361Smrg 9000/[678][0-9][0-9]) 57629459361Smrg if [ -x /usr/bin/getconf ]; then 57729459361Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 57829459361Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 57929459361Smrg case "${sc_cpu_version}" in 58029459361Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 58129459361Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 58229459361Smrg 532) # CPU_PA_RISC2_0 58329459361Smrg case "${sc_kernel_bits}" in 58429459361Smrg 32) HP_ARCH="hppa2.0n" ;; 58529459361Smrg 64) HP_ARCH="hppa2.0w" ;; 58629459361Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 58729459361Smrg esac ;; 58829459361Smrg esac 58929459361Smrg fi 59029459361Smrg if [ "${HP_ARCH}" = "" ]; then 59129459361Smrg eval $set_cc_for_build 59229459361Smrg sed 's/^ //' << EOF >$dummy.c 59329459361Smrg 59429459361Smrg #define _HPUX_SOURCE 59529459361Smrg #include <stdlib.h> 59629459361Smrg #include <unistd.h> 59729459361Smrg 59829459361Smrg int main () 59929459361Smrg { 60029459361Smrg #if defined(_SC_KERNEL_BITS) 60129459361Smrg long bits = sysconf(_SC_KERNEL_BITS); 60229459361Smrg #endif 60329459361Smrg long cpu = sysconf (_SC_CPU_VERSION); 60429459361Smrg 60529459361Smrg switch (cpu) 60629459361Smrg { 60729459361Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 60829459361Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 60929459361Smrg case CPU_PA_RISC2_0: 61029459361Smrg #if defined(_SC_KERNEL_BITS) 61129459361Smrg switch (bits) 61229459361Smrg { 61329459361Smrg case 64: puts ("hppa2.0w"); break; 61429459361Smrg case 32: puts ("hppa2.0n"); break; 61529459361Smrg default: puts ("hppa2.0"); break; 61629459361Smrg } break; 61729459361Smrg #else /* !defined(_SC_KERNEL_BITS) */ 61829459361Smrg puts ("hppa2.0"); break; 61929459361Smrg #endif 62029459361Smrg default: puts ("hppa1.0"); break; 62129459361Smrg } 62229459361Smrg exit (0); 62329459361Smrg } 62429459361SmrgEOF 62529459361Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 62629459361Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 62729459361Smrg fi ;; 62829459361Smrg esac 62929459361Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 63029459361Smrg then 63129459361Smrg eval $set_cc_for_build 63229459361Smrg 63329459361Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 63429459361Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 63529459361Smrg # generating 64-bit code. GNU and HP use different nomenclature: 63629459361Smrg # 63729459361Smrg # $ CC_FOR_BUILD=cc ./config.guess 63829459361Smrg # => hppa2.0w-hp-hpux11.23 63929459361Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 64029459361Smrg # => hppa64-hp-hpux11.23 64129459361Smrg 64229459361Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 64329459361Smrg grep __LP64__ >/dev/null 64429459361Smrg then 64529459361Smrg HP_ARCH="hppa2.0w" 64629459361Smrg else 64729459361Smrg HP_ARCH="hppa64" 64829459361Smrg fi 64929459361Smrg fi 65029459361Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 65129459361Smrg exit ;; 65229459361Smrg ia64:HP-UX:*:*) 65329459361Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 65429459361Smrg echo ia64-hp-hpux${HPUX_REV} 65529459361Smrg exit ;; 65629459361Smrg 3050*:HI-UX:*:*) 65729459361Smrg eval $set_cc_for_build 65829459361Smrg sed 's/^ //' << EOF >$dummy.c 65929459361Smrg #include <unistd.h> 66029459361Smrg int 66129459361Smrg main () 66229459361Smrg { 66329459361Smrg long cpu = sysconf (_SC_CPU_VERSION); 66429459361Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 66529459361Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 66629459361Smrg results, however. */ 66729459361Smrg if (CPU_IS_PA_RISC (cpu)) 66829459361Smrg { 66929459361Smrg switch (cpu) 67029459361Smrg { 67129459361Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 67229459361Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 67329459361Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 67429459361Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 67529459361Smrg } 67629459361Smrg } 67729459361Smrg else if (CPU_IS_HP_MC68K (cpu)) 67829459361Smrg puts ("m68k-hitachi-hiuxwe2"); 67929459361Smrg else puts ("unknown-hitachi-hiuxwe2"); 68029459361Smrg exit (0); 68129459361Smrg } 68229459361SmrgEOF 68329459361Smrg $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 68429459361Smrg { echo "$SYSTEM_NAME"; exit; } 68529459361Smrg echo unknown-hitachi-hiuxwe2 68629459361Smrg exit ;; 68729459361Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 68829459361Smrg echo hppa1.1-hp-bsd 68929459361Smrg exit ;; 69029459361Smrg 9000/8??:4.3bsd:*:*) 69129459361Smrg echo hppa1.0-hp-bsd 69229459361Smrg exit ;; 69329459361Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 69429459361Smrg echo hppa1.0-hp-mpeix 69529459361Smrg exit ;; 69629459361Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 69729459361Smrg echo hppa1.1-hp-osf 69829459361Smrg exit ;; 69929459361Smrg hp8??:OSF1:*:*) 70029459361Smrg echo hppa1.0-hp-osf 70129459361Smrg exit ;; 70229459361Smrg i*86:OSF1:*:*) 70329459361Smrg if [ -x /usr/sbin/sysversion ] ; then 70429459361Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 70529459361Smrg else 70629459361Smrg echo ${UNAME_MACHINE}-unknown-osf1 70729459361Smrg fi 70829459361Smrg exit ;; 70929459361Smrg parisc*:Lites*:*:*) 71029459361Smrg echo hppa1.1-hp-lites 71129459361Smrg exit ;; 71229459361Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 71329459361Smrg echo c1-convex-bsd 71429459361Smrg exit ;; 71529459361Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 71629459361Smrg if getsysinfo -f scalar_acc 71729459361Smrg then echo c32-convex-bsd 71829459361Smrg else echo c2-convex-bsd 71929459361Smrg fi 72029459361Smrg exit ;; 72129459361Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 72229459361Smrg echo c34-convex-bsd 72329459361Smrg exit ;; 72429459361Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 72529459361Smrg echo c38-convex-bsd 72629459361Smrg exit ;; 72729459361Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 72829459361Smrg echo c4-convex-bsd 72929459361Smrg exit ;; 73029459361Smrg CRAY*Y-MP:*:*:*) 73129459361Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73229459361Smrg exit ;; 73329459361Smrg CRAY*[A-Z]90:*:*:*) 73429459361Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 73529459361Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 73629459361Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 73729459361Smrg -e 's/\.[^.]*$/.X/' 73829459361Smrg exit ;; 73929459361Smrg CRAY*TS:*:*:*) 74029459361Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74129459361Smrg exit ;; 74229459361Smrg CRAY*T3E:*:*:*) 74329459361Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74429459361Smrg exit ;; 74529459361Smrg CRAY*SV1:*:*:*) 74629459361Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74729459361Smrg exit ;; 74829459361Smrg *:UNICOS/mp:*:*) 74929459361Smrg echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 75029459361Smrg exit ;; 75129459361Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 75229459361Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 75329459361Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 75429459361Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 75529459361Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 75629459361Smrg exit ;; 75729459361Smrg 5000:UNIX_System_V:4.*:*) 75829459361Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 75929459361Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 76029459361Smrg echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 76129459361Smrg exit ;; 76229459361Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 76329459361Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 76429459361Smrg exit ;; 76529459361Smrg sparc*:BSD/OS:*:*) 76629459361Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 76729459361Smrg exit ;; 76829459361Smrg *:BSD/OS:*:*) 76929459361Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 77029459361Smrg exit ;; 77129459361Smrg *:FreeBSD:*:*) 77229459361Smrg case ${UNAME_MACHINE} in 77329459361Smrg pc98) 77429459361Smrg echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 77529459361Smrg amd64) 77629459361Smrg echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 77729459361Smrg *) 77829459361Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 77929459361Smrg esac 78029459361Smrg exit ;; 78129459361Smrg i*:CYGWIN*:*) 78229459361Smrg echo ${UNAME_MACHINE}-pc-cygwin 78329459361Smrg exit ;; 78429459361Smrg i*:MINGW*:*) 78529459361Smrg echo ${UNAME_MACHINE}-pc-mingw32 78629459361Smrg exit ;; 78729459361Smrg i*:windows32*:*) 78829459361Smrg # uname -m includes "-pc" on this system. 78929459361Smrg echo ${UNAME_MACHINE}-mingw32 79029459361Smrg exit ;; 79129459361Smrg i*:PW*:*) 79229459361Smrg echo ${UNAME_MACHINE}-pc-pw32 79329459361Smrg exit ;; 79429459361Smrg x86:Interix*:[3456]*) 79529459361Smrg echo i586-pc-interix${UNAME_RELEASE} 79629459361Smrg exit ;; 79729459361Smrg EM64T:Interix*:[3456]* | authenticamd:Interix*:[3456]*) 79829459361Smrg echo x86_64-unknown-interix${UNAME_RELEASE} 79929459361Smrg exit ;; 80029459361Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 80129459361Smrg echo i${UNAME_MACHINE}-pc-mks 80229459361Smrg exit ;; 80329459361Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 80429459361Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 80529459361Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 80629459361Smrg # UNAME_MACHINE based on the output of uname instead of i386? 80729459361Smrg echo i586-pc-interix 80829459361Smrg exit ;; 80929459361Smrg i*:UWIN*:*) 81029459361Smrg echo ${UNAME_MACHINE}-pc-uwin 81129459361Smrg exit ;; 81229459361Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 81329459361Smrg echo x86_64-unknown-cygwin 81429459361Smrg exit ;; 81529459361Smrg p*:CYGWIN*:*) 81629459361Smrg echo powerpcle-unknown-cygwin 81729459361Smrg exit ;; 81829459361Smrg prep*:SunOS:5.*:*) 81929459361Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 82029459361Smrg exit ;; 82129459361Smrg *:GNU:*:*) 82229459361Smrg # the GNU system 82329459361Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 82429459361Smrg exit ;; 82529459361Smrg *:GNU/*:*:*) 82629459361Smrg # other systems with GNU libc and userland 82729459361Smrg echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 82829459361Smrg exit ;; 82929459361Smrg i*86:Minix:*:*) 83029459361Smrg echo ${UNAME_MACHINE}-pc-minix 83129459361Smrg exit ;; 83229459361Smrg arm*:Linux:*:*) 83329459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 83429459361Smrg exit ;; 83529459361Smrg avr32*:Linux:*:*) 83629459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 83729459361Smrg exit ;; 83829459361Smrg cris:Linux:*:*) 83929459361Smrg echo cris-axis-linux-gnu 84029459361Smrg exit ;; 84129459361Smrg crisv32:Linux:*:*) 84229459361Smrg echo crisv32-axis-linux-gnu 84329459361Smrg exit ;; 84429459361Smrg frv:Linux:*:*) 84529459361Smrg echo frv-unknown-linux-gnu 84629459361Smrg exit ;; 84729459361Smrg ia64:Linux:*:*) 84829459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 84929459361Smrg exit ;; 85029459361Smrg m32r*:Linux:*:*) 85129459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 85229459361Smrg exit ;; 85329459361Smrg m68*:Linux:*:*) 85429459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 85529459361Smrg exit ;; 85629459361Smrg mips:Linux:*:*) 85729459361Smrg eval $set_cc_for_build 85829459361Smrg sed 's/^ //' << EOF >$dummy.c 85929459361Smrg #undef CPU 86029459361Smrg #undef mips 86129459361Smrg #undef mipsel 86229459361Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 86329459361Smrg CPU=mipsel 86429459361Smrg #else 86529459361Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 86629459361Smrg CPU=mips 86729459361Smrg #else 86829459361Smrg CPU= 86929459361Smrg #endif 87029459361Smrg #endif 87129459361SmrgEOF 87229459361Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 87329459361Smrg /^CPU/{ 87429459361Smrg s: ::g 87529459361Smrg p 87629459361Smrg }'`" 87729459361Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 87829459361Smrg ;; 87929459361Smrg mips64:Linux:*:*) 88029459361Smrg eval $set_cc_for_build 88129459361Smrg sed 's/^ //' << EOF >$dummy.c 88229459361Smrg #undef CPU 88329459361Smrg #undef mips64 88429459361Smrg #undef mips64el 88529459361Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 88629459361Smrg CPU=mips64el 88729459361Smrg #else 88829459361Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 88929459361Smrg CPU=mips64 89029459361Smrg #else 89129459361Smrg CPU= 89229459361Smrg #endif 89329459361Smrg #endif 89429459361SmrgEOF 89529459361Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 89629459361Smrg /^CPU/{ 89729459361Smrg s: ::g 89829459361Smrg p 89929459361Smrg }'`" 90029459361Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 90129459361Smrg ;; 90229459361Smrg or32:Linux:*:*) 90329459361Smrg echo or32-unknown-linux-gnu 90429459361Smrg exit ;; 90529459361Smrg ppc:Linux:*:*) 90629459361Smrg echo powerpc-unknown-linux-gnu 90729459361Smrg exit ;; 90829459361Smrg ppc64:Linux:*:*) 90929459361Smrg echo powerpc64-unknown-linux-gnu 91029459361Smrg exit ;; 91129459361Smrg alpha:Linux:*:*) 91229459361Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 91329459361Smrg EV5) UNAME_MACHINE=alphaev5 ;; 91429459361Smrg EV56) UNAME_MACHINE=alphaev56 ;; 91529459361Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 91629459361Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 91729459361Smrg EV6) UNAME_MACHINE=alphaev6 ;; 91829459361Smrg EV67) UNAME_MACHINE=alphaev67 ;; 91929459361Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 92029459361Smrg esac 92129459361Smrg objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 92229459361Smrg if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 92329459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 92429459361Smrg exit ;; 92529459361Smrg parisc:Linux:*:* | hppa:Linux:*:*) 92629459361Smrg # Look for CPU level 92729459361Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 92829459361Smrg PA7*) echo hppa1.1-unknown-linux-gnu ;; 92929459361Smrg PA8*) echo hppa2.0-unknown-linux-gnu ;; 93029459361Smrg *) echo hppa-unknown-linux-gnu ;; 93129459361Smrg esac 93229459361Smrg exit ;; 93329459361Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 93429459361Smrg echo hppa64-unknown-linux-gnu 93529459361Smrg exit ;; 93629459361Smrg s390:Linux:*:* | s390x:Linux:*:*) 93729459361Smrg echo ${UNAME_MACHINE}-ibm-linux 93829459361Smrg exit ;; 93929459361Smrg sh64*:Linux:*:*) 94029459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 94129459361Smrg exit ;; 94229459361Smrg sh*:Linux:*:*) 94329459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 94429459361Smrg exit ;; 94529459361Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 94629459361Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 94729459361Smrg exit ;; 94829459361Smrg vax:Linux:*:*) 94929459361Smrg echo ${UNAME_MACHINE}-dec-linux-gnu 95029459361Smrg exit ;; 95129459361Smrg x86_64:Linux:*:*) 95229459361Smrg echo x86_64-unknown-linux-gnu 95329459361Smrg exit ;; 95429459361Smrg xtensa:Linux:*:*) 95529459361Smrg echo xtensa-unknown-linux-gnu 95629459361Smrg exit ;; 95729459361Smrg i*86:Linux:*:*) 95829459361Smrg # The BFD linker knows what the default object file format is, so 95929459361Smrg # first see if it will tell us. cd to the root directory to prevent 96029459361Smrg # problems with other programs or directories called `ld' in the path. 96129459361Smrg # Set LC_ALL=C to ensure ld outputs messages in English. 96229459361Smrg ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 96329459361Smrg | sed -ne '/supported targets:/!d 96429459361Smrg s/[ ][ ]*/ /g 96529459361Smrg s/.*supported targets: *// 96629459361Smrg s/ .*// 96729459361Smrg p'` 96829459361Smrg case "$ld_supported_targets" in 96929459361Smrg elf32-i386) 97029459361Smrg TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 97129459361Smrg ;; 97229459361Smrg a.out-i386-linux) 97329459361Smrg echo "${UNAME_MACHINE}-pc-linux-gnuaout" 97429459361Smrg exit ;; 97529459361Smrg coff-i386) 97629459361Smrg echo "${UNAME_MACHINE}-pc-linux-gnucoff" 97729459361Smrg exit ;; 97829459361Smrg "") 97929459361Smrg # Either a pre-BFD a.out linker (linux-gnuoldld) or 98029459361Smrg # one that does not give us useful --help. 98129459361Smrg echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 98229459361Smrg exit ;; 98329459361Smrg esac 98429459361Smrg # Determine whether the default compiler is a.out or elf 98529459361Smrg eval $set_cc_for_build 98629459361Smrg sed 's/^ //' << EOF >$dummy.c 98729459361Smrg #include <features.h> 98829459361Smrg #ifdef __ELF__ 98929459361Smrg # ifdef __GLIBC__ 99029459361Smrg # if __GLIBC__ >= 2 99129459361Smrg LIBC=gnu 99229459361Smrg # else 99329459361Smrg LIBC=gnulibc1 99429459361Smrg # endif 99529459361Smrg # else 99629459361Smrg LIBC=gnulibc1 99729459361Smrg # endif 99829459361Smrg #else 99929459361Smrg #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 100029459361Smrg LIBC=gnu 100129459361Smrg #else 100229459361Smrg LIBC=gnuaout 100329459361Smrg #endif 100429459361Smrg #endif 100529459361Smrg #ifdef __dietlibc__ 100629459361Smrg LIBC=dietlibc 100729459361Smrg #endif 100829459361SmrgEOF 100929459361Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 101029459361Smrg /^LIBC/{ 101129459361Smrg s: ::g 101229459361Smrg p 101329459361Smrg }'`" 101429459361Smrg test x"${LIBC}" != x && { 101529459361Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 101629459361Smrg exit 101729459361Smrg } 101829459361Smrg test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } 101929459361Smrg ;; 102029459361Smrg i*86:DYNIX/ptx:4*:*) 102129459361Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 102229459361Smrg # earlier versions are messed up and put the nodename in both 102329459361Smrg # sysname and nodename. 102429459361Smrg echo i386-sequent-sysv4 102529459361Smrg exit ;; 102629459361Smrg i*86:UNIX_SV:4.2MP:2.*) 102729459361Smrg # Unixware is an offshoot of SVR4, but it has its own version 102829459361Smrg # number series starting with 2... 102929459361Smrg # I am not positive that other SVR4 systems won't match this, 103029459361Smrg # I just have to hope. -- rms. 103129459361Smrg # Use sysv4.2uw... so that sysv4* matches it. 103229459361Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 103329459361Smrg exit ;; 103429459361Smrg i*86:OS/2:*:*) 103529459361Smrg # If we were able to find `uname', then EMX Unix compatibility 103629459361Smrg # is probably installed. 103729459361Smrg echo ${UNAME_MACHINE}-pc-os2-emx 103829459361Smrg exit ;; 103929459361Smrg i*86:XTS-300:*:STOP) 104029459361Smrg echo ${UNAME_MACHINE}-unknown-stop 104129459361Smrg exit ;; 104229459361Smrg i*86:atheos:*:*) 104329459361Smrg echo ${UNAME_MACHINE}-unknown-atheos 104429459361Smrg exit ;; 104529459361Smrg i*86:syllable:*:*) 104629459361Smrg echo ${UNAME_MACHINE}-pc-syllable 104729459361Smrg exit ;; 104829459361Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 104929459361Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 105029459361Smrg exit ;; 105129459361Smrg i*86:*DOS:*:*) 105229459361Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 105329459361Smrg exit ;; 105429459361Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 105529459361Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 105629459361Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 105729459361Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 105829459361Smrg else 105929459361Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 106029459361Smrg fi 106129459361Smrg exit ;; 106229459361Smrg i*86:*:5:[678]*) 106329459361Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 106429459361Smrg case `/bin/uname -X | grep "^Machine"` in 106529459361Smrg *486*) UNAME_MACHINE=i486 ;; 106629459361Smrg *Pentium) UNAME_MACHINE=i586 ;; 106729459361Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 106829459361Smrg esac 106929459361Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 107029459361Smrg exit ;; 107129459361Smrg i*86:*:3.2:*) 107229459361Smrg if test -f /usr/options/cb.name; then 107329459361Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 107429459361Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 107529459361Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 107629459361Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 107729459361Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 107829459361Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 107929459361Smrg && UNAME_MACHINE=i586 108029459361Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 108129459361Smrg && UNAME_MACHINE=i686 108229459361Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 108329459361Smrg && UNAME_MACHINE=i686 108429459361Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 108529459361Smrg else 108629459361Smrg echo ${UNAME_MACHINE}-pc-sysv32 108729459361Smrg fi 108829459361Smrg exit ;; 108929459361Smrg pc:*:*:*) 109029459361Smrg # Left here for compatibility: 109129459361Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 109229459361Smrg # the processor, so we play safe by assuming i386. 109329459361Smrg echo i386-pc-msdosdjgpp 109429459361Smrg exit ;; 109529459361Smrg Intel:Mach:3*:*) 109629459361Smrg echo i386-pc-mach3 109729459361Smrg exit ;; 109829459361Smrg paragon:*:*:*) 109929459361Smrg echo i860-intel-osf1 110029459361Smrg exit ;; 110129459361Smrg i860:*:4.*:*) # i860-SVR4 110229459361Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 110329459361Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 110429459361Smrg else # Add other i860-SVR4 vendors below as they are discovered. 110529459361Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 110629459361Smrg fi 110729459361Smrg exit ;; 110829459361Smrg mini*:CTIX:SYS*5:*) 110929459361Smrg # "miniframe" 111029459361Smrg echo m68010-convergent-sysv 111129459361Smrg exit ;; 111229459361Smrg mc68k:UNIX:SYSTEM5:3.51m) 111329459361Smrg echo m68k-convergent-sysv 111429459361Smrg exit ;; 111529459361Smrg M680?0:D-NIX:5.3:*) 111629459361Smrg echo m68k-diab-dnix 111729459361Smrg exit ;; 111829459361Smrg M68*:*:R3V[5678]*:*) 111929459361Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 112029459361Smrg 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) 112129459361Smrg OS_REL='' 112229459361Smrg test -r /etc/.relid \ 112329459361Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 112429459361Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 112529459361Smrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 112629459361Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 112729459361Smrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 112829459361Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 112929459361Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 113029459361Smrg && { echo i486-ncr-sysv4; exit; } ;; 113129459361Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 113229459361Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 113329459361Smrg exit ;; 113429459361Smrg mc68030:UNIX_System_V:4.*:*) 113529459361Smrg echo m68k-atari-sysv4 113629459361Smrg exit ;; 113729459361Smrg TSUNAMI:LynxOS:2.*:*) 113829459361Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 113929459361Smrg exit ;; 114029459361Smrg rs6000:LynxOS:2.*:*) 114129459361Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 114229459361Smrg exit ;; 114329459361Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 114429459361Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 114529459361Smrg exit ;; 114629459361Smrg SM[BE]S:UNIX_SV:*:*) 114729459361Smrg echo mips-dde-sysv${UNAME_RELEASE} 114829459361Smrg exit ;; 114929459361Smrg RM*:ReliantUNIX-*:*:*) 115029459361Smrg echo mips-sni-sysv4 115129459361Smrg exit ;; 115229459361Smrg RM*:SINIX-*:*:*) 115329459361Smrg echo mips-sni-sysv4 115429459361Smrg exit ;; 115529459361Smrg *:SINIX-*:*:*) 115629459361Smrg if uname -p 2>/dev/null >/dev/null ; then 115729459361Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 115829459361Smrg echo ${UNAME_MACHINE}-sni-sysv4 115929459361Smrg else 116029459361Smrg echo ns32k-sni-sysv 116129459361Smrg fi 116229459361Smrg exit ;; 116329459361Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 116429459361Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 116529459361Smrg echo i586-unisys-sysv4 116629459361Smrg exit ;; 116729459361Smrg *:UNIX_System_V:4*:FTX*) 116829459361Smrg # From Gerald Hewes <hewes@openmarket.com>. 116929459361Smrg # How about differentiating between stratus architectures? -djm 117029459361Smrg echo hppa1.1-stratus-sysv4 117129459361Smrg exit ;; 117229459361Smrg *:*:*:FTX*) 117329459361Smrg # From seanf@swdc.stratus.com. 117429459361Smrg echo i860-stratus-sysv4 117529459361Smrg exit ;; 117629459361Smrg i*86:VOS:*:*) 117729459361Smrg # From Paul.Green@stratus.com. 117829459361Smrg echo ${UNAME_MACHINE}-stratus-vos 117929459361Smrg exit ;; 118029459361Smrg *:VOS:*:*) 118129459361Smrg # From Paul.Green@stratus.com. 118229459361Smrg echo hppa1.1-stratus-vos 118329459361Smrg exit ;; 118429459361Smrg mc68*:A/UX:*:*) 118529459361Smrg echo m68k-apple-aux${UNAME_RELEASE} 118629459361Smrg exit ;; 118729459361Smrg news*:NEWS-OS:6*:*) 118829459361Smrg echo mips-sony-newsos6 118929459361Smrg exit ;; 119029459361Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 119129459361Smrg if [ -d /usr/nec ]; then 119229459361Smrg echo mips-nec-sysv${UNAME_RELEASE} 119329459361Smrg else 119429459361Smrg echo mips-unknown-sysv${UNAME_RELEASE} 119529459361Smrg fi 119629459361Smrg exit ;; 119729459361Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 119829459361Smrg echo powerpc-be-beos 119929459361Smrg exit ;; 120029459361Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 120129459361Smrg echo powerpc-apple-beos 120229459361Smrg exit ;; 120329459361Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 120429459361Smrg echo i586-pc-beos 120529459361Smrg exit ;; 120629459361Smrg SX-4:SUPER-UX:*:*) 120729459361Smrg echo sx4-nec-superux${UNAME_RELEASE} 120829459361Smrg exit ;; 120929459361Smrg SX-5:SUPER-UX:*:*) 121029459361Smrg echo sx5-nec-superux${UNAME_RELEASE} 121129459361Smrg exit ;; 121229459361Smrg SX-6:SUPER-UX:*:*) 121329459361Smrg echo sx6-nec-superux${UNAME_RELEASE} 121429459361Smrg exit ;; 121529459361Smrg SX-7:SUPER-UX:*:*) 121629459361Smrg echo sx7-nec-superux${UNAME_RELEASE} 121729459361Smrg exit ;; 121829459361Smrg SX-8:SUPER-UX:*:*) 121929459361Smrg echo sx8-nec-superux${UNAME_RELEASE} 122029459361Smrg exit ;; 122129459361Smrg Power*:Rhapsody:*:*) 122229459361Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 122329459361Smrg exit ;; 122429459361Smrg *:Rhapsody:*:*) 122529459361Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 122629459361Smrg exit ;; 122729459361Smrg *:Darwin:*:*) 122829459361Smrg UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 122929459361Smrg case $UNAME_PROCESSOR in 123029459361Smrg unknown) UNAME_PROCESSOR=powerpc ;; 123129459361Smrg esac 123229459361Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 123329459361Smrg exit ;; 123429459361Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 123529459361Smrg UNAME_PROCESSOR=`uname -p` 123629459361Smrg if test "$UNAME_PROCESSOR" = "x86"; then 123729459361Smrg UNAME_PROCESSOR=i386 123829459361Smrg UNAME_MACHINE=pc 123929459361Smrg fi 124029459361Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 124129459361Smrg exit ;; 124229459361Smrg *:QNX:*:4*) 124329459361Smrg echo i386-pc-qnx 124429459361Smrg exit ;; 124529459361Smrg NSE-?:NONSTOP_KERNEL:*:*) 124629459361Smrg echo nse-tandem-nsk${UNAME_RELEASE} 124729459361Smrg exit ;; 124829459361Smrg NSR-?:NONSTOP_KERNEL:*:*) 124929459361Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 125029459361Smrg exit ;; 125129459361Smrg *:NonStop-UX:*:*) 125229459361Smrg echo mips-compaq-nonstopux 125329459361Smrg exit ;; 125429459361Smrg BS2000:POSIX*:*:*) 125529459361Smrg echo bs2000-siemens-sysv 125629459361Smrg exit ;; 125729459361Smrg DS/*:UNIX_System_V:*:*) 125829459361Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 125929459361Smrg exit ;; 126029459361Smrg *:Plan9:*:*) 126129459361Smrg # "uname -m" is not consistent, so use $cputype instead. 386 126229459361Smrg # is converted to i386 for consistency with other x86 126329459361Smrg # operating systems. 126429459361Smrg if test "$cputype" = "386"; then 126529459361Smrg UNAME_MACHINE=i386 126629459361Smrg else 126729459361Smrg UNAME_MACHINE="$cputype" 126829459361Smrg fi 126929459361Smrg echo ${UNAME_MACHINE}-unknown-plan9 127029459361Smrg exit ;; 127129459361Smrg *:TOPS-10:*:*) 127229459361Smrg echo pdp10-unknown-tops10 127329459361Smrg exit ;; 127429459361Smrg *:TENEX:*:*) 127529459361Smrg echo pdp10-unknown-tenex 127629459361Smrg exit ;; 127729459361Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 127829459361Smrg echo pdp10-dec-tops20 127929459361Smrg exit ;; 128029459361Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 128129459361Smrg echo pdp10-xkl-tops20 128229459361Smrg exit ;; 128329459361Smrg *:TOPS-20:*:*) 128429459361Smrg echo pdp10-unknown-tops20 128529459361Smrg exit ;; 128629459361Smrg *:ITS:*:*) 128729459361Smrg echo pdp10-unknown-its 128829459361Smrg exit ;; 128929459361Smrg SEI:*:*:SEIUX) 129029459361Smrg echo mips-sei-seiux${UNAME_RELEASE} 129129459361Smrg exit ;; 129229459361Smrg *:DragonFly:*:*) 129329459361Smrg echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 129429459361Smrg exit ;; 129529459361Smrg *:*VMS:*:*) 129629459361Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 129729459361Smrg case "${UNAME_MACHINE}" in 129829459361Smrg A*) echo alpha-dec-vms ; exit ;; 129929459361Smrg I*) echo ia64-dec-vms ; exit ;; 130029459361Smrg V*) echo vax-dec-vms ; exit ;; 130129459361Smrg esac ;; 130229459361Smrg *:XENIX:*:SysV) 130329459361Smrg echo i386-pc-xenix 130429459361Smrg exit ;; 130529459361Smrg i*86:skyos:*:*) 130629459361Smrg echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 130729459361Smrg exit ;; 130829459361Smrg i*86:rdos:*:*) 130929459361Smrg echo ${UNAME_MACHINE}-pc-rdos 131029459361Smrg exit ;; 131129459361Smrgesac 131229459361Smrg 131329459361Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 131429459361Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 131529459361Smrg 131629459361Smrgeval $set_cc_for_build 131729459361Smrgcat >$dummy.c <<EOF 131829459361Smrg#ifdef _SEQUENT_ 131929459361Smrg# include <sys/types.h> 132029459361Smrg# include <sys/utsname.h> 132129459361Smrg#endif 132229459361Smrgmain () 132329459361Smrg{ 132429459361Smrg#if defined (sony) 132529459361Smrg#if defined (MIPSEB) 132629459361Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 132729459361Smrg I don't know.... */ 132829459361Smrg printf ("mips-sony-bsd\n"); exit (0); 132929459361Smrg#else 133029459361Smrg#include <sys/param.h> 133129459361Smrg printf ("m68k-sony-newsos%s\n", 133229459361Smrg#ifdef NEWSOS4 133329459361Smrg "4" 133429459361Smrg#else 133529459361Smrg "" 133629459361Smrg#endif 133729459361Smrg ); exit (0); 133829459361Smrg#endif 133929459361Smrg#endif 134029459361Smrg 134129459361Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 134229459361Smrg printf ("arm-acorn-riscix\n"); exit (0); 134329459361Smrg#endif 134429459361Smrg 134529459361Smrg#if defined (hp300) && !defined (hpux) 134629459361Smrg printf ("m68k-hp-bsd\n"); exit (0); 134729459361Smrg#endif 134829459361Smrg 134929459361Smrg#if defined (NeXT) 135029459361Smrg#if !defined (__ARCHITECTURE__) 135129459361Smrg#define __ARCHITECTURE__ "m68k" 135229459361Smrg#endif 135329459361Smrg int version; 135429459361Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 135529459361Smrg if (version < 4) 135629459361Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 135729459361Smrg else 135829459361Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 135929459361Smrg exit (0); 136029459361Smrg#endif 136129459361Smrg 136229459361Smrg#if defined (MULTIMAX) || defined (n16) 136329459361Smrg#if defined (UMAXV) 136429459361Smrg printf ("ns32k-encore-sysv\n"); exit (0); 136529459361Smrg#else 136629459361Smrg#if defined (CMU) 136729459361Smrg printf ("ns32k-encore-mach\n"); exit (0); 136829459361Smrg#else 136929459361Smrg printf ("ns32k-encore-bsd\n"); exit (0); 137029459361Smrg#endif 137129459361Smrg#endif 137229459361Smrg#endif 137329459361Smrg 137429459361Smrg#if defined (__386BSD__) 137529459361Smrg printf ("i386-pc-bsd\n"); exit (0); 137629459361Smrg#endif 137729459361Smrg 137829459361Smrg#if defined (sequent) 137929459361Smrg#if defined (i386) 138029459361Smrg printf ("i386-sequent-dynix\n"); exit (0); 138129459361Smrg#endif 138229459361Smrg#if defined (ns32000) 138329459361Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 138429459361Smrg#endif 138529459361Smrg#endif 138629459361Smrg 138729459361Smrg#if defined (_SEQUENT_) 138829459361Smrg struct utsname un; 138929459361Smrg 139029459361Smrg uname(&un); 139129459361Smrg 139229459361Smrg if (strncmp(un.version, "V2", 2) == 0) { 139329459361Smrg printf ("i386-sequent-ptx2\n"); exit (0); 139429459361Smrg } 139529459361Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 139629459361Smrg printf ("i386-sequent-ptx1\n"); exit (0); 139729459361Smrg } 139829459361Smrg printf ("i386-sequent-ptx\n"); exit (0); 139929459361Smrg 140029459361Smrg#endif 140129459361Smrg 140229459361Smrg#if defined (vax) 140329459361Smrg# if !defined (ultrix) 140429459361Smrg# include <sys/param.h> 140529459361Smrg# if defined (BSD) 140629459361Smrg# if BSD == 43 140729459361Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 140829459361Smrg# else 140929459361Smrg# if BSD == 199006 141029459361Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 141129459361Smrg# else 141229459361Smrg printf ("vax-dec-bsd\n"); exit (0); 141329459361Smrg# endif 141429459361Smrg# endif 141529459361Smrg# else 141629459361Smrg printf ("vax-dec-bsd\n"); exit (0); 141729459361Smrg# endif 141829459361Smrg# else 141929459361Smrg printf ("vax-dec-ultrix\n"); exit (0); 142029459361Smrg# endif 142129459361Smrg#endif 142229459361Smrg 142329459361Smrg#if defined (alliant) && defined (i860) 142429459361Smrg printf ("i860-alliant-bsd\n"); exit (0); 142529459361Smrg#endif 142629459361Smrg 142729459361Smrg exit (1); 142829459361Smrg} 142929459361SmrgEOF 143029459361Smrg 143129459361Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 143229459361Smrg { echo "$SYSTEM_NAME"; exit; } 143329459361Smrg 143429459361Smrg# Apollos put the system type in the environment. 143529459361Smrg 143629459361Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 143729459361Smrg 143829459361Smrg# Convex versions that predate uname can use getsysinfo(1) 143929459361Smrg 144029459361Smrgif [ -x /usr/convex/getsysinfo ] 144129459361Smrgthen 144229459361Smrg case `getsysinfo -f cpu_type` in 144329459361Smrg c1*) 144429459361Smrg echo c1-convex-bsd 144529459361Smrg exit ;; 144629459361Smrg c2*) 144729459361Smrg if getsysinfo -f scalar_acc 144829459361Smrg then echo c32-convex-bsd 144929459361Smrg else echo c2-convex-bsd 145029459361Smrg fi 145129459361Smrg exit ;; 145229459361Smrg c34*) 145329459361Smrg echo c34-convex-bsd 145429459361Smrg exit ;; 145529459361Smrg c38*) 145629459361Smrg echo c38-convex-bsd 145729459361Smrg exit ;; 145829459361Smrg c4*) 145929459361Smrg echo c4-convex-bsd 146029459361Smrg exit ;; 146129459361Smrg esac 146229459361Smrgfi 146329459361Smrg 146429459361Smrgcat >&2 <<EOF 146529459361Smrg$0: unable to guess system type 146629459361Smrg 146729459361SmrgThis script, last modified $timestamp, has failed to recognize 146829459361Smrgthe operating system you are using. It is advised that you 146929459361Smrgdownload the most up to date version of the config scripts from 147029459361Smrg 147129459361Smrg http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess 147229459361Smrgand 147329459361Smrg http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub 147429459361Smrg 147529459361SmrgIf the version you run ($0) is already up to date, please 147629459361Smrgsend the following data and any information you think might be 147729459361Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 147829459361Smrginformation to handle your system. 147929459361Smrg 148029459361Smrgconfig.guess timestamp = $timestamp 148129459361Smrg 148229459361Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 148329459361Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 148429459361Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 148529459361Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 148629459361Smrg 148729459361Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 148829459361Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 148929459361Smrg 149029459361Smrghostinfo = `(hostinfo) 2>/dev/null` 149129459361Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 149229459361Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 149329459361Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 149429459361Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 149529459361Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 149629459361Smrg 149729459361SmrgUNAME_MACHINE = ${UNAME_MACHINE} 149829459361SmrgUNAME_RELEASE = ${UNAME_RELEASE} 149929459361SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 150029459361SmrgUNAME_VERSION = ${UNAME_VERSION} 150129459361SmrgEOF 150229459361Smrg 150329459361Smrgexit 1 150429459361Smrg 150529459361Smrg# Local variables: 150629459361Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 150729459361Smrg# time-stamp-start: "timestamp='" 150829459361Smrg# time-stamp-format: "%:y-%02m-%02d" 150929459361Smrg# time-stamp-end: "'" 151029459361Smrg# End: 1511