config.guess revision 27702724
127702724Smrg#! /bin/sh 227702724Smrg# Attempt to guess a canonical system name. 327702724Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 427702724Smrg# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. 527702724Smrg 627702724Smrgtimestamp='2006-02-23' 727702724Smrg 827702724Smrg# This file is free software; you can redistribute it and/or modify it 927702724Smrg# under the terms of the GNU General Public License as published by 1027702724Smrg# the Free Software Foundation; either version 2 of the License, or 1127702724Smrg# (at your option) any later version. 1227702724Smrg# 1327702724Smrg# This program is distributed in the hope that it will be useful, but 1427702724Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1527702724Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1627702724Smrg# General Public License for more details. 1727702724Smrg# 1827702724Smrg# You should have received a copy of the GNU General Public License 1927702724Smrg# along with this program; if not, write to the Free Software 2027702724Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 2127702724Smrg# 02110-1301, USA. 2227702724Smrg# 2327702724Smrg# As a special exception to the GNU General Public License, if you 2427702724Smrg# distribute this file as part of a program that contains a 2527702724Smrg# configuration script generated by Autoconf, you may include it under 2627702724Smrg# the same distribution terms that you use for the rest of that program. 2727702724Smrg 2827702724Smrg 2927702724Smrg# Originally written by Per Bothner <per@bothner.com>. 3027702724Smrg# Please send patches to <config-patches@gnu.org>. Submit a context 3127702724Smrg# diff and a properly formatted ChangeLog entry. 3227702724Smrg# 3327702724Smrg# This script attempts to guess a canonical system name similar to 3427702724Smrg# config.sub. If it succeeds, it prints the system name on stdout, and 3527702724Smrg# exits with 0. Otherwise, it exits with 1. 3627702724Smrg# 3727702724Smrg# The plan is that this can be called by configure scripts if you 3827702724Smrg# don't specify an explicit build system type. 3927702724Smrg 4027702724Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4127702724Smrg 4227702724Smrgusage="\ 4327702724SmrgUsage: $0 [OPTION] 4427702724Smrg 4527702724SmrgOutput the configuration name of the system \`$me' is run on. 4627702724Smrg 4727702724SmrgOperation modes: 4827702724Smrg -h, --help print this help, then exit 4927702724Smrg -t, --time-stamp print date of last modification, then exit 5027702724Smrg -v, --version print version number, then exit 5127702724Smrg 5227702724SmrgReport bugs and patches to <config-patches@gnu.org>." 5327702724Smrg 5427702724Smrgversion="\ 5527702724SmrgGNU config.guess ($timestamp) 5627702724Smrg 5727702724SmrgOriginally written by Per Bothner. 5827702724SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 5927702724SmrgFree Software Foundation, Inc. 6027702724Smrg 6127702724SmrgThis is free software; see the source for copying conditions. There is NO 6227702724Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6327702724Smrg 6427702724Smrghelp=" 6527702724SmrgTry \`$me --help' for more information." 6627702724Smrg 6727702724Smrg# Parse command line 6827702724Smrgwhile test $# -gt 0 ; do 6927702724Smrg case $1 in 7027702724Smrg --time-stamp | --time* | -t ) 7127702724Smrg echo "$timestamp" ; exit ;; 7227702724Smrg --version | -v ) 7327702724Smrg echo "$version" ; exit ;; 7427702724Smrg --help | --h* | -h ) 7527702724Smrg echo "$usage"; exit ;; 7627702724Smrg -- ) # Stop option processing 7727702724Smrg shift; break ;; 7827702724Smrg - ) # Use stdin as input. 7927702724Smrg break ;; 8027702724Smrg -* ) 8127702724Smrg echo "$me: invalid option $1$help" >&2 8227702724Smrg exit 1 ;; 8327702724Smrg * ) 8427702724Smrg break ;; 8527702724Smrg esac 8627702724Smrgdone 8727702724Smrg 8827702724Smrgif test $# != 0; then 8927702724Smrg echo "$me: too many arguments$help" >&2 9027702724Smrg exit 1 9127702724Smrgfi 9227702724Smrg 9327702724Smrgtrap 'exit 1' 1 2 15 9427702724Smrg 9527702724Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 9627702724Smrg# compiler to aid in system detection is discouraged as it requires 9727702724Smrg# temporary files to be created and, as you can see below, it is a 9827702724Smrg# headache to deal with in a portable fashion. 9927702724Smrg 10027702724Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 10127702724Smrg# use `HOST_CC' if defined, but it is deprecated. 10227702724Smrg 10327702724Smrg# Portable tmp directory creation inspired by the Autoconf team. 10427702724Smrg 10527702724Smrgset_cc_for_build=' 10627702724Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 10727702724Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 10827702724Smrg: ${TMPDIR=/tmp} ; 10927702724Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 11027702724Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 11127702724Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 11227702724Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 11327702724Smrgdummy=$tmp/dummy ; 11427702724Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 11527702724Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in 11627702724Smrg ,,) echo "int x;" > $dummy.c ; 11727702724Smrg for c in cc gcc c89 c99 ; do 11827702724Smrg if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 11927702724Smrg CC_FOR_BUILD="$c"; break ; 12027702724Smrg fi ; 12127702724Smrg done ; 12227702724Smrg if test x"$CC_FOR_BUILD" = x ; then 12327702724Smrg CC_FOR_BUILD=no_compiler_found ; 12427702724Smrg fi 12527702724Smrg ;; 12627702724Smrg ,,*) CC_FOR_BUILD=$CC ;; 12727702724Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 12827702724Smrgesac ; set_cc_for_build= ;' 12927702724Smrg 13027702724Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 13127702724Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 13227702724Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 13327702724Smrg PATH=$PATH:/.attbin ; export PATH 13427702724Smrgfi 13527702724Smrg 13627702724SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 13727702724SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 13827702724SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 13927702724SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 14027702724Smrg 14127702724Smrg# Note: order is significant - the case branches are not exclusive. 14227702724Smrg 14327702724Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 14427702724Smrg *:NetBSD:*:*) 14527702724Smrg # NetBSD (nbsd) targets should (where applicable) match one or 14627702724Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 14727702724Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 14827702724Smrg # switched to ELF, *-*-netbsd* would select the old 14927702724Smrg # object file format. This provides both forward 15027702724Smrg # compatibility and a consistent mechanism for selecting the 15127702724Smrg # object file format. 15227702724Smrg # 15327702724Smrg # Note: NetBSD doesn't particularly care about the vendor 15427702724Smrg # portion of the name. We always set it to "unknown". 15527702724Smrg sysctl="sysctl -n hw.machine_arch" 15627702724Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 15727702724Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 15827702724Smrg case "${UNAME_MACHINE_ARCH}" in 15927702724Smrg armeb) machine=armeb-unknown ;; 16027702724Smrg arm*) machine=arm-unknown ;; 16127702724Smrg sh3el) machine=shl-unknown ;; 16227702724Smrg sh3eb) machine=sh-unknown ;; 16327702724Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 16427702724Smrg esac 16527702724Smrg # The Operating System including object format, if it has switched 16627702724Smrg # to ELF recently, or will in the future. 16727702724Smrg case "${UNAME_MACHINE_ARCH}" in 16827702724Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 16927702724Smrg eval $set_cc_for_build 17027702724Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 17127702724Smrg | grep __ELF__ >/dev/null 17227702724Smrg then 17327702724Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 17427702724Smrg # Return netbsd for either. FIX? 17527702724Smrg os=netbsd 17627702724Smrg else 17727702724Smrg os=netbsdelf 17827702724Smrg fi 17927702724Smrg ;; 18027702724Smrg *) 18127702724Smrg os=netbsd 18227702724Smrg ;; 18327702724Smrg esac 18427702724Smrg # The OS release 18527702724Smrg # Debian GNU/NetBSD machines have a different userland, and 18627702724Smrg # thus, need a distinct triplet. However, they do not need 18727702724Smrg # kernel version information, so it can be replaced with a 18827702724Smrg # suitable tag, in the style of linux-gnu. 18927702724Smrg case "${UNAME_VERSION}" in 19027702724Smrg Debian*) 19127702724Smrg release='-gnu' 19227702724Smrg ;; 19327702724Smrg *) 19427702724Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 19527702724Smrg ;; 19627702724Smrg esac 19727702724Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 19827702724Smrg # contains redundant information, the shorter form: 19927702724Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 20027702724Smrg echo "${machine}-${os}${release}" 20127702724Smrg exit ;; 20227702724Smrg *:OpenBSD:*:*) 20327702724Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 20427702724Smrg echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 20527702724Smrg exit ;; 20627702724Smrg *:ekkoBSD:*:*) 20727702724Smrg echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 20827702724Smrg exit ;; 20927702724Smrg *:SolidBSD:*:*) 21027702724Smrg echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 21127702724Smrg exit ;; 21227702724Smrg macppc:MirBSD:*:*) 21327702724Smrg echo powerppc-unknown-mirbsd${UNAME_RELEASE} 21427702724Smrg exit ;; 21527702724Smrg *:MirBSD:*:*) 21627702724Smrg echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 21727702724Smrg exit ;; 21827702724Smrg alpha:OSF1:*:*) 21927702724Smrg case $UNAME_RELEASE in 22027702724Smrg *4.0) 22127702724Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 22227702724Smrg ;; 22327702724Smrg *5.*) 22427702724Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 22527702724Smrg ;; 22627702724Smrg esac 22727702724Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 22827702724Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 22927702724Smrg # covers most systems running today. This code pipes the CPU 23027702724Smrg # types through head -n 1, so we only detect the type of CPU 0. 23127702724Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 23227702724Smrg case "$ALPHA_CPU_TYPE" in 23327702724Smrg "EV4 (21064)") 23427702724Smrg UNAME_MACHINE="alpha" ;; 23527702724Smrg "EV4.5 (21064)") 23627702724Smrg UNAME_MACHINE="alpha" ;; 23727702724Smrg "LCA4 (21066/21068)") 23827702724Smrg UNAME_MACHINE="alpha" ;; 23927702724Smrg "EV5 (21164)") 24027702724Smrg UNAME_MACHINE="alphaev5" ;; 24127702724Smrg "EV5.6 (21164A)") 24227702724Smrg UNAME_MACHINE="alphaev56" ;; 24327702724Smrg "EV5.6 (21164PC)") 24427702724Smrg UNAME_MACHINE="alphapca56" ;; 24527702724Smrg "EV5.7 (21164PC)") 24627702724Smrg UNAME_MACHINE="alphapca57" ;; 24727702724Smrg "EV6 (21264)") 24827702724Smrg UNAME_MACHINE="alphaev6" ;; 24927702724Smrg "EV6.7 (21264A)") 25027702724Smrg UNAME_MACHINE="alphaev67" ;; 25127702724Smrg "EV6.8CB (21264C)") 25227702724Smrg UNAME_MACHINE="alphaev68" ;; 25327702724Smrg "EV6.8AL (21264B)") 25427702724Smrg UNAME_MACHINE="alphaev68" ;; 25527702724Smrg "EV6.8CX (21264D)") 25627702724Smrg UNAME_MACHINE="alphaev68" ;; 25727702724Smrg "EV6.9A (21264/EV69A)") 25827702724Smrg UNAME_MACHINE="alphaev69" ;; 25927702724Smrg "EV7 (21364)") 26027702724Smrg UNAME_MACHINE="alphaev7" ;; 26127702724Smrg "EV7.9 (21364A)") 26227702724Smrg UNAME_MACHINE="alphaev79" ;; 26327702724Smrg esac 26427702724Smrg # A Pn.n version is a patched version. 26527702724Smrg # A Vn.n version is a released version. 26627702724Smrg # A Tn.n version is a released field test version. 26727702724Smrg # A Xn.n version is an unreleased experimental baselevel. 26827702724Smrg # 1.2 uses "1.2" for uname -r. 26927702724Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 27027702724Smrg exit ;; 27127702724Smrg Alpha\ *:Windows_NT*:*) 27227702724Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 27327702724Smrg # Should we change UNAME_MACHINE based on the output of uname instead 27427702724Smrg # of the specific Alpha model? 27527702724Smrg echo alpha-pc-interix 27627702724Smrg exit ;; 27727702724Smrg 21064:Windows_NT:50:3) 27827702724Smrg echo alpha-dec-winnt3.5 27927702724Smrg exit ;; 28027702724Smrg Amiga*:UNIX_System_V:4.0:*) 28127702724Smrg echo m68k-unknown-sysv4 28227702724Smrg exit ;; 28327702724Smrg *:[Aa]miga[Oo][Ss]:*:*) 28427702724Smrg echo ${UNAME_MACHINE}-unknown-amigaos 28527702724Smrg exit ;; 28627702724Smrg *:[Mm]orph[Oo][Ss]:*:*) 28727702724Smrg echo ${UNAME_MACHINE}-unknown-morphos 28827702724Smrg exit ;; 28927702724Smrg *:OS/390:*:*) 29027702724Smrg echo i370-ibm-openedition 29127702724Smrg exit ;; 29227702724Smrg *:z/VM:*:*) 29327702724Smrg echo s390-ibm-zvmoe 29427702724Smrg exit ;; 29527702724Smrg *:OS400:*:*) 29627702724Smrg echo powerpc-ibm-os400 29727702724Smrg exit ;; 29827702724Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 29927702724Smrg echo arm-acorn-riscix${UNAME_RELEASE} 30027702724Smrg exit ;; 30127702724Smrg arm:riscos:*:*|arm:RISCOS:*:*) 30227702724Smrg echo arm-unknown-riscos 30327702724Smrg exit ;; 30427702724Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 30527702724Smrg echo hppa1.1-hitachi-hiuxmpp 30627702724Smrg exit ;; 30727702724Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 30827702724Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 30927702724Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 31027702724Smrg echo pyramid-pyramid-sysv3 31127702724Smrg else 31227702724Smrg echo pyramid-pyramid-bsd 31327702724Smrg fi 31427702724Smrg exit ;; 31527702724Smrg NILE*:*:*:dcosx) 31627702724Smrg echo pyramid-pyramid-svr4 31727702724Smrg exit ;; 31827702724Smrg DRS?6000:unix:4.0:6*) 31927702724Smrg echo sparc-icl-nx6 32027702724Smrg exit ;; 32127702724Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 32227702724Smrg case `/usr/bin/uname -p` in 32327702724Smrg sparc) echo sparc-icl-nx7; exit ;; 32427702724Smrg esac ;; 32527702724Smrg sun4H:SunOS:5.*:*) 32627702724Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 32727702724Smrg exit ;; 32827702724Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 32927702724Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33027702724Smrg exit ;; 33127702724Smrg i86pc:SunOS:5.*:*) 33227702724Smrg echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33327702724Smrg exit ;; 33427702724Smrg sun4*:SunOS:6*:*) 33527702724Smrg # According to config.sub, this is the proper way to canonicalize 33627702724Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 33727702724Smrg # it's likely to be more like Solaris than SunOS4. 33827702724Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33927702724Smrg exit ;; 34027702724Smrg sun4*:SunOS:*:*) 34127702724Smrg case "`/usr/bin/arch -k`" in 34227702724Smrg Series*|S4*) 34327702724Smrg UNAME_RELEASE=`uname -v` 34427702724Smrg ;; 34527702724Smrg esac 34627702724Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 34727702724Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 34827702724Smrg exit ;; 34927702724Smrg sun3*:SunOS:*:*) 35027702724Smrg echo m68k-sun-sunos${UNAME_RELEASE} 35127702724Smrg exit ;; 35227702724Smrg sun*:*:4.2BSD:*) 35327702724Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 35427702724Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 35527702724Smrg case "`/bin/arch`" in 35627702724Smrg sun3) 35727702724Smrg echo m68k-sun-sunos${UNAME_RELEASE} 35827702724Smrg ;; 35927702724Smrg sun4) 36027702724Smrg echo sparc-sun-sunos${UNAME_RELEASE} 36127702724Smrg ;; 36227702724Smrg esac 36327702724Smrg exit ;; 36427702724Smrg aushp:SunOS:*:*) 36527702724Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 36627702724Smrg exit ;; 36727702724Smrg # The situation for MiNT is a little confusing. The machine name 36827702724Smrg # can be virtually everything (everything which is not 36927702724Smrg # "atarist" or "atariste" at least should have a processor 37027702724Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 37127702724Smrg # to the lowercase version "mint" (or "freemint"). Finally 37227702724Smrg # the system name "TOS" denotes a system which is actually not 37327702724Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 37427702724Smrg # be no problem. 37527702724Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 37627702724Smrg echo m68k-atari-mint${UNAME_RELEASE} 37727702724Smrg exit ;; 37827702724Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 37927702724Smrg echo m68k-atari-mint${UNAME_RELEASE} 38027702724Smrg exit ;; 38127702724Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 38227702724Smrg echo m68k-atari-mint${UNAME_RELEASE} 38327702724Smrg exit ;; 38427702724Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 38527702724Smrg echo m68k-milan-mint${UNAME_RELEASE} 38627702724Smrg exit ;; 38727702724Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 38827702724Smrg echo m68k-hades-mint${UNAME_RELEASE} 38927702724Smrg exit ;; 39027702724Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 39127702724Smrg echo m68k-unknown-mint${UNAME_RELEASE} 39227702724Smrg exit ;; 39327702724Smrg m68k:machten:*:*) 39427702724Smrg echo m68k-apple-machten${UNAME_RELEASE} 39527702724Smrg exit ;; 39627702724Smrg powerpc:machten:*:*) 39727702724Smrg echo powerpc-apple-machten${UNAME_RELEASE} 39827702724Smrg exit ;; 39927702724Smrg RISC*:Mach:*:*) 40027702724Smrg echo mips-dec-mach_bsd4.3 40127702724Smrg exit ;; 40227702724Smrg RISC*:ULTRIX:*:*) 40327702724Smrg echo mips-dec-ultrix${UNAME_RELEASE} 40427702724Smrg exit ;; 40527702724Smrg VAX*:ULTRIX*:*:*) 40627702724Smrg echo vax-dec-ultrix${UNAME_RELEASE} 40727702724Smrg exit ;; 40827702724Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 40927702724Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 41027702724Smrg exit ;; 41127702724Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 41227702724Smrg eval $set_cc_for_build 41327702724Smrg sed 's/^ //' << EOF >$dummy.c 41427702724Smrg#ifdef __cplusplus 41527702724Smrg#include <stdio.h> /* for printf() prototype */ 41627702724Smrg int main (int argc, char *argv[]) { 41727702724Smrg#else 41827702724Smrg int main (argc, argv) int argc; char *argv[]; { 41927702724Smrg#endif 42027702724Smrg #if defined (host_mips) && defined (MIPSEB) 42127702724Smrg #if defined (SYSTYPE_SYSV) 42227702724Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 42327702724Smrg #endif 42427702724Smrg #if defined (SYSTYPE_SVR4) 42527702724Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 42627702724Smrg #endif 42727702724Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 42827702724Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 42927702724Smrg #endif 43027702724Smrg #endif 43127702724Smrg exit (-1); 43227702724Smrg } 43327702724SmrgEOF 43427702724Smrg $CC_FOR_BUILD -o $dummy $dummy.c && 43527702724Smrg dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 43627702724Smrg SYSTEM_NAME=`$dummy $dummyarg` && 43727702724Smrg { echo "$SYSTEM_NAME"; exit; } 43827702724Smrg echo mips-mips-riscos${UNAME_RELEASE} 43927702724Smrg exit ;; 44027702724Smrg Motorola:PowerMAX_OS:*:*) 44127702724Smrg echo powerpc-motorola-powermax 44227702724Smrg exit ;; 44327702724Smrg Motorola:*:4.3:PL8-*) 44427702724Smrg echo powerpc-harris-powermax 44527702724Smrg exit ;; 44627702724Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 44727702724Smrg echo powerpc-harris-powermax 44827702724Smrg exit ;; 44927702724Smrg Night_Hawk:Power_UNIX:*:*) 45027702724Smrg echo powerpc-harris-powerunix 45127702724Smrg exit ;; 45227702724Smrg m88k:CX/UX:7*:*) 45327702724Smrg echo m88k-harris-cxux7 45427702724Smrg exit ;; 45527702724Smrg m88k:*:4*:R4*) 45627702724Smrg echo m88k-motorola-sysv4 45727702724Smrg exit ;; 45827702724Smrg m88k:*:3*:R3*) 45927702724Smrg echo m88k-motorola-sysv3 46027702724Smrg exit ;; 46127702724Smrg AViiON:dgux:*:*) 46227702724Smrg # DG/UX returns AViiON for all architectures 46327702724Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 46427702724Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 46527702724Smrg then 46627702724Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 46727702724Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 46827702724Smrg then 46927702724Smrg echo m88k-dg-dgux${UNAME_RELEASE} 47027702724Smrg else 47127702724Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 47227702724Smrg fi 47327702724Smrg else 47427702724Smrg echo i586-dg-dgux${UNAME_RELEASE} 47527702724Smrg fi 47627702724Smrg exit ;; 47727702724Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 47827702724Smrg echo m88k-dolphin-sysv3 47927702724Smrg exit ;; 48027702724Smrg M88*:*:R3*:*) 48127702724Smrg # Delta 88k system running SVR3 48227702724Smrg echo m88k-motorola-sysv3 48327702724Smrg exit ;; 48427702724Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 48527702724Smrg echo m88k-tektronix-sysv3 48627702724Smrg exit ;; 48727702724Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 48827702724Smrg echo m68k-tektronix-bsd 48927702724Smrg exit ;; 49027702724Smrg *:IRIX*:*:*) 49127702724Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 49227702724Smrg exit ;; 49327702724Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 49427702724Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 49527702724Smrg exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 49627702724Smrg i*86:AIX:*:*) 49727702724Smrg echo i386-ibm-aix 49827702724Smrg exit ;; 49927702724Smrg ia64:AIX:*:*) 50027702724Smrg if [ -x /usr/bin/oslevel ] ; then 50127702724Smrg IBM_REV=`/usr/bin/oslevel` 50227702724Smrg else 50327702724Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 50427702724Smrg fi 50527702724Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 50627702724Smrg exit ;; 50727702724Smrg *:AIX:2:3) 50827702724Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 50927702724Smrg eval $set_cc_for_build 51027702724Smrg sed 's/^ //' << EOF >$dummy.c 51127702724Smrg #include <sys/systemcfg.h> 51227702724Smrg 51327702724Smrg main() 51427702724Smrg { 51527702724Smrg if (!__power_pc()) 51627702724Smrg exit(1); 51727702724Smrg puts("powerpc-ibm-aix3.2.5"); 51827702724Smrg exit(0); 51927702724Smrg } 52027702724SmrgEOF 52127702724Smrg if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 52227702724Smrg then 52327702724Smrg echo "$SYSTEM_NAME" 52427702724Smrg else 52527702724Smrg echo rs6000-ibm-aix3.2.5 52627702724Smrg fi 52727702724Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 52827702724Smrg echo rs6000-ibm-aix3.2.4 52927702724Smrg else 53027702724Smrg echo rs6000-ibm-aix3.2 53127702724Smrg fi 53227702724Smrg exit ;; 53327702724Smrg *:AIX:*:[45]) 53427702724Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 53527702724Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 53627702724Smrg IBM_ARCH=rs6000 53727702724Smrg else 53827702724Smrg IBM_ARCH=powerpc 53927702724Smrg fi 54027702724Smrg if [ -x /usr/bin/oslevel ] ; then 54127702724Smrg IBM_REV=`/usr/bin/oslevel` 54227702724Smrg else 54327702724Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 54427702724Smrg fi 54527702724Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 54627702724Smrg exit ;; 54727702724Smrg *:AIX:*:*) 54827702724Smrg echo rs6000-ibm-aix 54927702724Smrg exit ;; 55027702724Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 55127702724Smrg echo romp-ibm-bsd4.4 55227702724Smrg exit ;; 55327702724Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 55427702724Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 55527702724Smrg exit ;; # report: romp-ibm BSD 4.3 55627702724Smrg *:BOSX:*:*) 55727702724Smrg echo rs6000-bull-bosx 55827702724Smrg exit ;; 55927702724Smrg DPX/2?00:B.O.S.:*:*) 56027702724Smrg echo m68k-bull-sysv3 56127702724Smrg exit ;; 56227702724Smrg 9000/[34]??:4.3bsd:1.*:*) 56327702724Smrg echo m68k-hp-bsd 56427702724Smrg exit ;; 56527702724Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 56627702724Smrg echo m68k-hp-bsd4.4 56727702724Smrg exit ;; 56827702724Smrg 9000/[34678]??:HP-UX:*:*) 56927702724Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 57027702724Smrg case "${UNAME_MACHINE}" in 57127702724Smrg 9000/31? ) HP_ARCH=m68000 ;; 57227702724Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 57327702724Smrg 9000/[678][0-9][0-9]) 57427702724Smrg if [ -x /usr/bin/getconf ]; then 57527702724Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 57627702724Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 57727702724Smrg case "${sc_cpu_version}" in 57827702724Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 57927702724Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 58027702724Smrg 532) # CPU_PA_RISC2_0 58127702724Smrg case "${sc_kernel_bits}" in 58227702724Smrg 32) HP_ARCH="hppa2.0n" ;; 58327702724Smrg 64) HP_ARCH="hppa2.0w" ;; 58427702724Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 58527702724Smrg esac ;; 58627702724Smrg esac 58727702724Smrg fi 58827702724Smrg if [ "${HP_ARCH}" = "" ]; then 58927702724Smrg eval $set_cc_for_build 59027702724Smrg sed 's/^ //' << EOF >$dummy.c 59127702724Smrg 59227702724Smrg #define _HPUX_SOURCE 59327702724Smrg #include <stdlib.h> 59427702724Smrg #include <unistd.h> 59527702724Smrg 59627702724Smrg int main () 59727702724Smrg { 59827702724Smrg #if defined(_SC_KERNEL_BITS) 59927702724Smrg long bits = sysconf(_SC_KERNEL_BITS); 60027702724Smrg #endif 60127702724Smrg long cpu = sysconf (_SC_CPU_VERSION); 60227702724Smrg 60327702724Smrg switch (cpu) 60427702724Smrg { 60527702724Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 60627702724Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 60727702724Smrg case CPU_PA_RISC2_0: 60827702724Smrg #if defined(_SC_KERNEL_BITS) 60927702724Smrg switch (bits) 61027702724Smrg { 61127702724Smrg case 64: puts ("hppa2.0w"); break; 61227702724Smrg case 32: puts ("hppa2.0n"); break; 61327702724Smrg default: puts ("hppa2.0"); break; 61427702724Smrg } break; 61527702724Smrg #else /* !defined(_SC_KERNEL_BITS) */ 61627702724Smrg puts ("hppa2.0"); break; 61727702724Smrg #endif 61827702724Smrg default: puts ("hppa1.0"); break; 61927702724Smrg } 62027702724Smrg exit (0); 62127702724Smrg } 62227702724SmrgEOF 62327702724Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 62427702724Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 62527702724Smrg fi ;; 62627702724Smrg esac 62727702724Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 62827702724Smrg then 62927702724Smrg eval $set_cc_for_build 63027702724Smrg 63127702724Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 63227702724Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 63327702724Smrg # generating 64-bit code. GNU and HP use different nomenclature: 63427702724Smrg # 63527702724Smrg # $ CC_FOR_BUILD=cc ./config.guess 63627702724Smrg # => hppa2.0w-hp-hpux11.23 63727702724Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 63827702724Smrg # => hppa64-hp-hpux11.23 63927702724Smrg 64027702724Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 64127702724Smrg grep __LP64__ >/dev/null 64227702724Smrg then 64327702724Smrg HP_ARCH="hppa2.0w" 64427702724Smrg else 64527702724Smrg HP_ARCH="hppa64" 64627702724Smrg fi 64727702724Smrg fi 64827702724Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 64927702724Smrg exit ;; 65027702724Smrg ia64:HP-UX:*:*) 65127702724Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 65227702724Smrg echo ia64-hp-hpux${HPUX_REV} 65327702724Smrg exit ;; 65427702724Smrg 3050*:HI-UX:*:*) 65527702724Smrg eval $set_cc_for_build 65627702724Smrg sed 's/^ //' << EOF >$dummy.c 65727702724Smrg #include <unistd.h> 65827702724Smrg int 65927702724Smrg main () 66027702724Smrg { 66127702724Smrg long cpu = sysconf (_SC_CPU_VERSION); 66227702724Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 66327702724Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 66427702724Smrg results, however. */ 66527702724Smrg if (CPU_IS_PA_RISC (cpu)) 66627702724Smrg { 66727702724Smrg switch (cpu) 66827702724Smrg { 66927702724Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 67027702724Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 67127702724Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 67227702724Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 67327702724Smrg } 67427702724Smrg } 67527702724Smrg else if (CPU_IS_HP_MC68K (cpu)) 67627702724Smrg puts ("m68k-hitachi-hiuxwe2"); 67727702724Smrg else puts ("unknown-hitachi-hiuxwe2"); 67827702724Smrg exit (0); 67927702724Smrg } 68027702724SmrgEOF 68127702724Smrg $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 68227702724Smrg { echo "$SYSTEM_NAME"; exit; } 68327702724Smrg echo unknown-hitachi-hiuxwe2 68427702724Smrg exit ;; 68527702724Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 68627702724Smrg echo hppa1.1-hp-bsd 68727702724Smrg exit ;; 68827702724Smrg 9000/8??:4.3bsd:*:*) 68927702724Smrg echo hppa1.0-hp-bsd 69027702724Smrg exit ;; 69127702724Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 69227702724Smrg echo hppa1.0-hp-mpeix 69327702724Smrg exit ;; 69427702724Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 69527702724Smrg echo hppa1.1-hp-osf 69627702724Smrg exit ;; 69727702724Smrg hp8??:OSF1:*:*) 69827702724Smrg echo hppa1.0-hp-osf 69927702724Smrg exit ;; 70027702724Smrg i*86:OSF1:*:*) 70127702724Smrg if [ -x /usr/sbin/sysversion ] ; then 70227702724Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 70327702724Smrg else 70427702724Smrg echo ${UNAME_MACHINE}-unknown-osf1 70527702724Smrg fi 70627702724Smrg exit ;; 70727702724Smrg parisc*:Lites*:*:*) 70827702724Smrg echo hppa1.1-hp-lites 70927702724Smrg exit ;; 71027702724Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 71127702724Smrg echo c1-convex-bsd 71227702724Smrg exit ;; 71327702724Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 71427702724Smrg if getsysinfo -f scalar_acc 71527702724Smrg then echo c32-convex-bsd 71627702724Smrg else echo c2-convex-bsd 71727702724Smrg fi 71827702724Smrg exit ;; 71927702724Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 72027702724Smrg echo c34-convex-bsd 72127702724Smrg exit ;; 72227702724Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 72327702724Smrg echo c38-convex-bsd 72427702724Smrg exit ;; 72527702724Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 72627702724Smrg echo c4-convex-bsd 72727702724Smrg exit ;; 72827702724Smrg CRAY*Y-MP:*:*:*) 72927702724Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73027702724Smrg exit ;; 73127702724Smrg CRAY*[A-Z]90:*:*:*) 73227702724Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 73327702724Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 73427702724Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 73527702724Smrg -e 's/\.[^.]*$/.X/' 73627702724Smrg exit ;; 73727702724Smrg CRAY*TS:*:*:*) 73827702724Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 73927702724Smrg exit ;; 74027702724Smrg CRAY*T3E:*:*:*) 74127702724Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74227702724Smrg exit ;; 74327702724Smrg CRAY*SV1:*:*:*) 74427702724Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74527702724Smrg exit ;; 74627702724Smrg *:UNICOS/mp:*:*) 74727702724Smrg echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74827702724Smrg exit ;; 74927702724Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 75027702724Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 75127702724Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 75227702724Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 75327702724Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 75427702724Smrg exit ;; 75527702724Smrg 5000:UNIX_System_V:4.*:*) 75627702724Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 75727702724Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 75827702724Smrg echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 75927702724Smrg exit ;; 76027702724Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 76127702724Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 76227702724Smrg exit ;; 76327702724Smrg sparc*:BSD/OS:*:*) 76427702724Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 76527702724Smrg exit ;; 76627702724Smrg *:BSD/OS:*:*) 76727702724Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 76827702724Smrg exit ;; 76927702724Smrg *:FreeBSD:*:*) 77027702724Smrg case ${UNAME_MACHINE} in 77127702724Smrg pc98) 77227702724Smrg echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 77327702724Smrg *) 77427702724Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 77527702724Smrg esac 77627702724Smrg exit ;; 77727702724Smrg i*:CYGWIN*:*) 77827702724Smrg echo ${UNAME_MACHINE}-pc-cygwin 77927702724Smrg exit ;; 78027702724Smrg i*:MINGW*:*) 78127702724Smrg echo ${UNAME_MACHINE}-pc-mingw32 78227702724Smrg exit ;; 78327702724Smrg i*:MSYS_NT-*:*:*) 78427702724Smrg echo ${UNAME_MACHINE}-pc-mingw32 78527702724Smrg exit ;; 78627702724Smrg i*:windows32*:*) 78727702724Smrg # uname -m includes "-pc" on this system. 78827702724Smrg echo ${UNAME_MACHINE}-mingw32 78927702724Smrg exit ;; 79027702724Smrg i*:PW*:*) 79127702724Smrg echo ${UNAME_MACHINE}-pc-pw32 79227702724Smrg exit ;; 79327702724Smrg x86:Interix*:[345]*) 79427702724Smrg echo i586-pc-interix${UNAME_RELEASE} 79527702724Smrg exit ;; 79627702724Smrg EM64T:Interix*:[345]*) 79727702724Smrg echo x86_64-unknown-interix${UNAME_RELEASE} 79827702724Smrg exit ;; 79927702724Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 80027702724Smrg echo i${UNAME_MACHINE}-pc-mks 80127702724Smrg exit ;; 80227702724Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 80327702724Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 80427702724Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 80527702724Smrg # UNAME_MACHINE based on the output of uname instead of i386? 80627702724Smrg echo i586-pc-interix 80727702724Smrg exit ;; 80827702724Smrg i*:UWIN*:*) 80927702724Smrg echo ${UNAME_MACHINE}-pc-uwin 81027702724Smrg exit ;; 81127702724Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 81227702724Smrg echo x86_64-unknown-cygwin 81327702724Smrg exit ;; 81427702724Smrg p*:CYGWIN*:*) 81527702724Smrg echo powerpcle-unknown-cygwin 81627702724Smrg exit ;; 81727702724Smrg prep*:SunOS:5.*:*) 81827702724Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 81927702724Smrg exit ;; 82027702724Smrg *:GNU:*:*) 82127702724Smrg # the GNU system 82227702724Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 82327702724Smrg exit ;; 82427702724Smrg *:GNU/*:*:*) 82527702724Smrg # other systems with GNU libc and userland 82627702724Smrg echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 82727702724Smrg exit ;; 82827702724Smrg i*86:Minix:*:*) 82927702724Smrg echo ${UNAME_MACHINE}-pc-minix 83027702724Smrg exit ;; 83127702724Smrg arm*:Linux:*:*) 83227702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 83327702724Smrg exit ;; 83427702724Smrg cris:Linux:*:*) 83527702724Smrg echo cris-axis-linux-gnu 83627702724Smrg exit ;; 83727702724Smrg crisv32:Linux:*:*) 83827702724Smrg echo crisv32-axis-linux-gnu 83927702724Smrg exit ;; 84027702724Smrg frv:Linux:*:*) 84127702724Smrg echo frv-unknown-linux-gnu 84227702724Smrg exit ;; 84327702724Smrg ia64:Linux:*:*) 84427702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 84527702724Smrg exit ;; 84627702724Smrg m32r*:Linux:*:*) 84727702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 84827702724Smrg exit ;; 84927702724Smrg m68*:Linux:*:*) 85027702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 85127702724Smrg exit ;; 85227702724Smrg mips:Linux:*:*) 85327702724Smrg eval $set_cc_for_build 85427702724Smrg sed 's/^ //' << EOF >$dummy.c 85527702724Smrg #undef CPU 85627702724Smrg #undef mips 85727702724Smrg #undef mipsel 85827702724Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 85927702724Smrg CPU=mipsel 86027702724Smrg #else 86127702724Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 86227702724Smrg CPU=mips 86327702724Smrg #else 86427702724Smrg CPU= 86527702724Smrg #endif 86627702724Smrg #endif 86727702724SmrgEOF 86827702724Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 86927702724Smrg /^CPU/{ 87027702724Smrg s: ::g 87127702724Smrg p 87227702724Smrg }'`" 87327702724Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 87427702724Smrg ;; 87527702724Smrg mips64:Linux:*:*) 87627702724Smrg eval $set_cc_for_build 87727702724Smrg sed 's/^ //' << EOF >$dummy.c 87827702724Smrg #undef CPU 87927702724Smrg #undef mips64 88027702724Smrg #undef mips64el 88127702724Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 88227702724Smrg CPU=mips64el 88327702724Smrg #else 88427702724Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 88527702724Smrg CPU=mips64 88627702724Smrg #else 88727702724Smrg CPU= 88827702724Smrg #endif 88927702724Smrg #endif 89027702724SmrgEOF 89127702724Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 89227702724Smrg /^CPU/{ 89327702724Smrg s: ::g 89427702724Smrg p 89527702724Smrg }'`" 89627702724Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 89727702724Smrg ;; 89827702724Smrg or32:Linux:*:*) 89927702724Smrg echo or32-unknown-linux-gnu 90027702724Smrg exit ;; 90127702724Smrg ppc:Linux:*:*) 90227702724Smrg echo powerpc-unknown-linux-gnu 90327702724Smrg exit ;; 90427702724Smrg ppc64:Linux:*:*) 90527702724Smrg echo powerpc64-unknown-linux-gnu 90627702724Smrg exit ;; 90727702724Smrg alpha:Linux:*:*) 90827702724Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 90927702724Smrg EV5) UNAME_MACHINE=alphaev5 ;; 91027702724Smrg EV56) UNAME_MACHINE=alphaev56 ;; 91127702724Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 91227702724Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 91327702724Smrg EV6) UNAME_MACHINE=alphaev6 ;; 91427702724Smrg EV67) UNAME_MACHINE=alphaev67 ;; 91527702724Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 91627702724Smrg esac 91727702724Smrg objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 91827702724Smrg if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 91927702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 92027702724Smrg exit ;; 92127702724Smrg parisc:Linux:*:* | hppa:Linux:*:*) 92227702724Smrg # Look for CPU level 92327702724Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 92427702724Smrg PA7*) echo hppa1.1-unknown-linux-gnu ;; 92527702724Smrg PA8*) echo hppa2.0-unknown-linux-gnu ;; 92627702724Smrg *) echo hppa-unknown-linux-gnu ;; 92727702724Smrg esac 92827702724Smrg exit ;; 92927702724Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 93027702724Smrg echo hppa64-unknown-linux-gnu 93127702724Smrg exit ;; 93227702724Smrg s390:Linux:*:* | s390x:Linux:*:*) 93327702724Smrg echo ${UNAME_MACHINE}-ibm-linux 93427702724Smrg exit ;; 93527702724Smrg sh64*:Linux:*:*) 93627702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 93727702724Smrg exit ;; 93827702724Smrg sh*:Linux:*:*) 93927702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 94027702724Smrg exit ;; 94127702724Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 94227702724Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 94327702724Smrg exit ;; 94427702724Smrg vax:Linux:*:*) 94527702724Smrg echo ${UNAME_MACHINE}-dec-linux-gnu 94627702724Smrg exit ;; 94727702724Smrg x86_64:Linux:*:*) 94827702724Smrg echo x86_64-unknown-linux-gnu 94927702724Smrg exit ;; 95027702724Smrg i*86:Linux:*:*) 95127702724Smrg # The BFD linker knows what the default object file format is, so 95227702724Smrg # first see if it will tell us. cd to the root directory to prevent 95327702724Smrg # problems with other programs or directories called `ld' in the path. 95427702724Smrg # Set LC_ALL=C to ensure ld outputs messages in English. 95527702724Smrg ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 95627702724Smrg | sed -ne '/supported targets:/!d 95727702724Smrg s/[ ][ ]*/ /g 95827702724Smrg s/.*supported targets: *// 95927702724Smrg s/ .*// 96027702724Smrg p'` 96127702724Smrg case "$ld_supported_targets" in 96227702724Smrg elf32-i386) 96327702724Smrg TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" 96427702724Smrg ;; 96527702724Smrg a.out-i386-linux) 96627702724Smrg echo "${UNAME_MACHINE}-pc-linux-gnuaout" 96727702724Smrg exit ;; 96827702724Smrg coff-i386) 96927702724Smrg echo "${UNAME_MACHINE}-pc-linux-gnucoff" 97027702724Smrg exit ;; 97127702724Smrg "") 97227702724Smrg # Either a pre-BFD a.out linker (linux-gnuoldld) or 97327702724Smrg # one that does not give us useful --help. 97427702724Smrg echo "${UNAME_MACHINE}-pc-linux-gnuoldld" 97527702724Smrg exit ;; 97627702724Smrg esac 97727702724Smrg # Determine whether the default compiler is a.out or elf 97827702724Smrg eval $set_cc_for_build 97927702724Smrg sed 's/^ //' << EOF >$dummy.c 98027702724Smrg #include <features.h> 98127702724Smrg #ifdef __ELF__ 98227702724Smrg # ifdef __GLIBC__ 98327702724Smrg # if __GLIBC__ >= 2 98427702724Smrg LIBC=gnu 98527702724Smrg # else 98627702724Smrg LIBC=gnulibc1 98727702724Smrg # endif 98827702724Smrg # else 98927702724Smrg LIBC=gnulibc1 99027702724Smrg # endif 99127702724Smrg #else 99227702724Smrg #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__sun) 99327702724Smrg LIBC=gnu 99427702724Smrg #else 99527702724Smrg LIBC=gnuaout 99627702724Smrg #endif 99727702724Smrg #endif 99827702724Smrg #ifdef __dietlibc__ 99927702724Smrg LIBC=dietlibc 100027702724Smrg #endif 100127702724SmrgEOF 100227702724Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 100327702724Smrg /^LIBC/{ 100427702724Smrg s: ::g 100527702724Smrg p 100627702724Smrg }'`" 100727702724Smrg test x"${LIBC}" != x && { 100827702724Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 100927702724Smrg exit 101027702724Smrg } 101127702724Smrg test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } 101227702724Smrg ;; 101327702724Smrg i*86:DYNIX/ptx:4*:*) 101427702724Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 101527702724Smrg # earlier versions are messed up and put the nodename in both 101627702724Smrg # sysname and nodename. 101727702724Smrg echo i386-sequent-sysv4 101827702724Smrg exit ;; 101927702724Smrg i*86:UNIX_SV:4.2MP:2.*) 102027702724Smrg # Unixware is an offshoot of SVR4, but it has its own version 102127702724Smrg # number series starting with 2... 102227702724Smrg # I am not positive that other SVR4 systems won't match this, 102327702724Smrg # I just have to hope. -- rms. 102427702724Smrg # Use sysv4.2uw... so that sysv4* matches it. 102527702724Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 102627702724Smrg exit ;; 102727702724Smrg i*86:OS/2:*:*) 102827702724Smrg # If we were able to find `uname', then EMX Unix compatibility 102927702724Smrg # is probably installed. 103027702724Smrg echo ${UNAME_MACHINE}-pc-os2-emx 103127702724Smrg exit ;; 103227702724Smrg i*86:XTS-300:*:STOP) 103327702724Smrg echo ${UNAME_MACHINE}-unknown-stop 103427702724Smrg exit ;; 103527702724Smrg i*86:atheos:*:*) 103627702724Smrg echo ${UNAME_MACHINE}-unknown-atheos 103727702724Smrg exit ;; 103827702724Smrg i*86:syllable:*:*) 103927702724Smrg echo ${UNAME_MACHINE}-pc-syllable 104027702724Smrg exit ;; 104127702724Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 104227702724Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 104327702724Smrg exit ;; 104427702724Smrg i*86:*DOS:*:*) 104527702724Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 104627702724Smrg exit ;; 104727702724Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 104827702724Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 104927702724Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 105027702724Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 105127702724Smrg else 105227702724Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 105327702724Smrg fi 105427702724Smrg exit ;; 105527702724Smrg i*86:*:5:[678]*) 105627702724Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 105727702724Smrg case `/bin/uname -X | grep "^Machine"` in 105827702724Smrg *486*) UNAME_MACHINE=i486 ;; 105927702724Smrg *Pentium) UNAME_MACHINE=i586 ;; 106027702724Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 106127702724Smrg esac 106227702724Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 106327702724Smrg exit ;; 106427702724Smrg i*86:*:3.2:*) 106527702724Smrg if test -f /usr/options/cb.name; then 106627702724Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 106727702724Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 106827702724Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 106927702724Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 107027702724Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 107127702724Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 107227702724Smrg && UNAME_MACHINE=i586 107327702724Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 107427702724Smrg && UNAME_MACHINE=i686 107527702724Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 107627702724Smrg && UNAME_MACHINE=i686 107727702724Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 107827702724Smrg else 107927702724Smrg echo ${UNAME_MACHINE}-pc-sysv32 108027702724Smrg fi 108127702724Smrg exit ;; 108227702724Smrg pc:*:*:*) 108327702724Smrg # Left here for compatibility: 108427702724Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 108527702724Smrg # the processor, so we play safe by assuming i386. 108627702724Smrg echo i386-pc-msdosdjgpp 108727702724Smrg exit ;; 108827702724Smrg Intel:Mach:3*:*) 108927702724Smrg echo i386-pc-mach3 109027702724Smrg exit ;; 109127702724Smrg paragon:*:*:*) 109227702724Smrg echo i860-intel-osf1 109327702724Smrg exit ;; 109427702724Smrg i860:*:4.*:*) # i860-SVR4 109527702724Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 109627702724Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 109727702724Smrg else # Add other i860-SVR4 vendors below as they are discovered. 109827702724Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 109927702724Smrg fi 110027702724Smrg exit ;; 110127702724Smrg mini*:CTIX:SYS*5:*) 110227702724Smrg # "miniframe" 110327702724Smrg echo m68010-convergent-sysv 110427702724Smrg exit ;; 110527702724Smrg mc68k:UNIX:SYSTEM5:3.51m) 110627702724Smrg echo m68k-convergent-sysv 110727702724Smrg exit ;; 110827702724Smrg M680?0:D-NIX:5.3:*) 110927702724Smrg echo m68k-diab-dnix 111027702724Smrg exit ;; 111127702724Smrg M68*:*:R3V[5678]*:*) 111227702724Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 111327702724Smrg 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) 111427702724Smrg OS_REL='' 111527702724Smrg test -r /etc/.relid \ 111627702724Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 111727702724Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 111827702724Smrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 111927702724Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 112027702724Smrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 112127702724Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 112227702724Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 112327702724Smrg && { echo i486-ncr-sysv4; exit; } ;; 112427702724Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 112527702724Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 112627702724Smrg exit ;; 112727702724Smrg mc68030:UNIX_System_V:4.*:*) 112827702724Smrg echo m68k-atari-sysv4 112927702724Smrg exit ;; 113027702724Smrg TSUNAMI:LynxOS:2.*:*) 113127702724Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 113227702724Smrg exit ;; 113327702724Smrg rs6000:LynxOS:2.*:*) 113427702724Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 113527702724Smrg exit ;; 113627702724Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 113727702724Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 113827702724Smrg exit ;; 113927702724Smrg SM[BE]S:UNIX_SV:*:*) 114027702724Smrg echo mips-dde-sysv${UNAME_RELEASE} 114127702724Smrg exit ;; 114227702724Smrg RM*:ReliantUNIX-*:*:*) 114327702724Smrg echo mips-sni-sysv4 114427702724Smrg exit ;; 114527702724Smrg RM*:SINIX-*:*:*) 114627702724Smrg echo mips-sni-sysv4 114727702724Smrg exit ;; 114827702724Smrg *:SINIX-*:*:*) 114927702724Smrg if uname -p 2>/dev/null >/dev/null ; then 115027702724Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 115127702724Smrg echo ${UNAME_MACHINE}-sni-sysv4 115227702724Smrg else 115327702724Smrg echo ns32k-sni-sysv 115427702724Smrg fi 115527702724Smrg exit ;; 115627702724Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 115727702724Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 115827702724Smrg echo i586-unisys-sysv4 115927702724Smrg exit ;; 116027702724Smrg *:UNIX_System_V:4*:FTX*) 116127702724Smrg # From Gerald Hewes <hewes@openmarket.com>. 116227702724Smrg # How about differentiating between stratus architectures? -djm 116327702724Smrg echo hppa1.1-stratus-sysv4 116427702724Smrg exit ;; 116527702724Smrg *:*:*:FTX*) 116627702724Smrg # From seanf@swdc.stratus.com. 116727702724Smrg echo i860-stratus-sysv4 116827702724Smrg exit ;; 116927702724Smrg i*86:VOS:*:*) 117027702724Smrg # From Paul.Green@stratus.com. 117127702724Smrg echo ${UNAME_MACHINE}-stratus-vos 117227702724Smrg exit ;; 117327702724Smrg *:VOS:*:*) 117427702724Smrg # From Paul.Green@stratus.com. 117527702724Smrg echo hppa1.1-stratus-vos 117627702724Smrg exit ;; 117727702724Smrg mc68*:A/UX:*:*) 117827702724Smrg echo m68k-apple-aux${UNAME_RELEASE} 117927702724Smrg exit ;; 118027702724Smrg news*:NEWS-OS:6*:*) 118127702724Smrg echo mips-sony-newsos6 118227702724Smrg exit ;; 118327702724Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 118427702724Smrg if [ -d /usr/nec ]; then 118527702724Smrg echo mips-nec-sysv${UNAME_RELEASE} 118627702724Smrg else 118727702724Smrg echo mips-unknown-sysv${UNAME_RELEASE} 118827702724Smrg fi 118927702724Smrg exit ;; 119027702724Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 119127702724Smrg echo powerpc-be-beos 119227702724Smrg exit ;; 119327702724Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 119427702724Smrg echo powerpc-apple-beos 119527702724Smrg exit ;; 119627702724Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 119727702724Smrg echo i586-pc-beos 119827702724Smrg exit ;; 119927702724Smrg SX-4:SUPER-UX:*:*) 120027702724Smrg echo sx4-nec-superux${UNAME_RELEASE} 120127702724Smrg exit ;; 120227702724Smrg SX-5:SUPER-UX:*:*) 120327702724Smrg echo sx5-nec-superux${UNAME_RELEASE} 120427702724Smrg exit ;; 120527702724Smrg SX-6:SUPER-UX:*:*) 120627702724Smrg echo sx6-nec-superux${UNAME_RELEASE} 120727702724Smrg exit ;; 120827702724Smrg Power*:Rhapsody:*:*) 120927702724Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 121027702724Smrg exit ;; 121127702724Smrg *:Rhapsody:*:*) 121227702724Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 121327702724Smrg exit ;; 121427702724Smrg *:Darwin:*:*) 121527702724Smrg UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 121627702724Smrg case $UNAME_PROCESSOR in 121727702724Smrg unknown) UNAME_PROCESSOR=powerpc ;; 121827702724Smrg esac 121927702724Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 122027702724Smrg exit ;; 122127702724Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 122227702724Smrg UNAME_PROCESSOR=`uname -p` 122327702724Smrg if test "$UNAME_PROCESSOR" = "x86"; then 122427702724Smrg UNAME_PROCESSOR=i386 122527702724Smrg UNAME_MACHINE=pc 122627702724Smrg fi 122727702724Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 122827702724Smrg exit ;; 122927702724Smrg *:QNX:*:4*) 123027702724Smrg echo i386-pc-qnx 123127702724Smrg exit ;; 123227702724Smrg NSE-?:NONSTOP_KERNEL:*:*) 123327702724Smrg echo nse-tandem-nsk${UNAME_RELEASE} 123427702724Smrg exit ;; 123527702724Smrg NSR-?:NONSTOP_KERNEL:*:*) 123627702724Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 123727702724Smrg exit ;; 123827702724Smrg *:NonStop-UX:*:*) 123927702724Smrg echo mips-compaq-nonstopux 124027702724Smrg exit ;; 124127702724Smrg BS2000:POSIX*:*:*) 124227702724Smrg echo bs2000-siemens-sysv 124327702724Smrg exit ;; 124427702724Smrg DS/*:UNIX_System_V:*:*) 124527702724Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 124627702724Smrg exit ;; 124727702724Smrg *:Plan9:*:*) 124827702724Smrg # "uname -m" is not consistent, so use $cputype instead. 386 124927702724Smrg # is converted to i386 for consistency with other x86 125027702724Smrg # operating systems. 125127702724Smrg if test "$cputype" = "386"; then 125227702724Smrg UNAME_MACHINE=i386 125327702724Smrg else 125427702724Smrg UNAME_MACHINE="$cputype" 125527702724Smrg fi 125627702724Smrg echo ${UNAME_MACHINE}-unknown-plan9 125727702724Smrg exit ;; 125827702724Smrg *:TOPS-10:*:*) 125927702724Smrg echo pdp10-unknown-tops10 126027702724Smrg exit ;; 126127702724Smrg *:TENEX:*:*) 126227702724Smrg echo pdp10-unknown-tenex 126327702724Smrg exit ;; 126427702724Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 126527702724Smrg echo pdp10-dec-tops20 126627702724Smrg exit ;; 126727702724Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 126827702724Smrg echo pdp10-xkl-tops20 126927702724Smrg exit ;; 127027702724Smrg *:TOPS-20:*:*) 127127702724Smrg echo pdp10-unknown-tops20 127227702724Smrg exit ;; 127327702724Smrg *:ITS:*:*) 127427702724Smrg echo pdp10-unknown-its 127527702724Smrg exit ;; 127627702724Smrg SEI:*:*:SEIUX) 127727702724Smrg echo mips-sei-seiux${UNAME_RELEASE} 127827702724Smrg exit ;; 127927702724Smrg *:DragonFly:*:*) 128027702724Smrg echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 128127702724Smrg exit ;; 128227702724Smrg *:*VMS:*:*) 128327702724Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 128427702724Smrg case "${UNAME_MACHINE}" in 128527702724Smrg A*) echo alpha-dec-vms ; exit ;; 128627702724Smrg I*) echo ia64-dec-vms ; exit ;; 128727702724Smrg V*) echo vax-dec-vms ; exit ;; 128827702724Smrg esac ;; 128927702724Smrg *:XENIX:*:SysV) 129027702724Smrg echo i386-pc-xenix 129127702724Smrg exit ;; 129227702724Smrg i*86:skyos:*:*) 129327702724Smrg echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 129427702724Smrg exit ;; 129527702724Smrg i*86:rdos:*:*) 129627702724Smrg echo ${UNAME_MACHINE}-pc-rdos 129727702724Smrg exit ;; 129827702724Smrgesac 129927702724Smrg 130027702724Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 130127702724Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 130227702724Smrg 130327702724Smrgeval $set_cc_for_build 130427702724Smrgcat >$dummy.c <<EOF 130527702724Smrg#ifdef _SEQUENT_ 130627702724Smrg# include <sys/types.h> 130727702724Smrg# include <sys/utsname.h> 130827702724Smrg#endif 130927702724Smrgmain () 131027702724Smrg{ 131127702724Smrg#if defined (sony) 131227702724Smrg#if defined (MIPSEB) 131327702724Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 131427702724Smrg I don't know.... */ 131527702724Smrg printf ("mips-sony-bsd\n"); exit (0); 131627702724Smrg#else 131727702724Smrg#include <sys/param.h> 131827702724Smrg printf ("m68k-sony-newsos%s\n", 131927702724Smrg#ifdef NEWSOS4 132027702724Smrg "4" 132127702724Smrg#else 132227702724Smrg "" 132327702724Smrg#endif 132427702724Smrg ); exit (0); 132527702724Smrg#endif 132627702724Smrg#endif 132727702724Smrg 132827702724Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 132927702724Smrg printf ("arm-acorn-riscix\n"); exit (0); 133027702724Smrg#endif 133127702724Smrg 133227702724Smrg#if defined (hp300) && !defined (hpux) 133327702724Smrg printf ("m68k-hp-bsd\n"); exit (0); 133427702724Smrg#endif 133527702724Smrg 133627702724Smrg#if defined (NeXT) 133727702724Smrg#if !defined (__ARCHITECTURE__) 133827702724Smrg#define __ARCHITECTURE__ "m68k" 133927702724Smrg#endif 134027702724Smrg int version; 134127702724Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 134227702724Smrg if (version < 4) 134327702724Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 134427702724Smrg else 134527702724Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 134627702724Smrg exit (0); 134727702724Smrg#endif 134827702724Smrg 134927702724Smrg#if defined (MULTIMAX) || defined (n16) 135027702724Smrg#if defined (UMAXV) 135127702724Smrg printf ("ns32k-encore-sysv\n"); exit (0); 135227702724Smrg#else 135327702724Smrg#if defined (CMU) 135427702724Smrg printf ("ns32k-encore-mach\n"); exit (0); 135527702724Smrg#else 135627702724Smrg printf ("ns32k-encore-bsd\n"); exit (0); 135727702724Smrg#endif 135827702724Smrg#endif 135927702724Smrg#endif 136027702724Smrg 136127702724Smrg#if defined (__386BSD__) 136227702724Smrg printf ("i386-pc-bsd\n"); exit (0); 136327702724Smrg#endif 136427702724Smrg 136527702724Smrg#if defined (sequent) 136627702724Smrg#if defined (i386) 136727702724Smrg printf ("i386-sequent-dynix\n"); exit (0); 136827702724Smrg#endif 136927702724Smrg#if defined (ns32000) 137027702724Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 137127702724Smrg#endif 137227702724Smrg#endif 137327702724Smrg 137427702724Smrg#if defined (_SEQUENT_) 137527702724Smrg struct utsname un; 137627702724Smrg 137727702724Smrg uname(&un); 137827702724Smrg 137927702724Smrg if (strncmp(un.version, "V2", 2) == 0) { 138027702724Smrg printf ("i386-sequent-ptx2\n"); exit (0); 138127702724Smrg } 138227702724Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 138327702724Smrg printf ("i386-sequent-ptx1\n"); exit (0); 138427702724Smrg } 138527702724Smrg printf ("i386-sequent-ptx\n"); exit (0); 138627702724Smrg 138727702724Smrg#endif 138827702724Smrg 138927702724Smrg#if defined (vax) 139027702724Smrg# if !defined (ultrix) 139127702724Smrg# include <sys/param.h> 139227702724Smrg# if defined (BSD) 139327702724Smrg# if BSD == 43 139427702724Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 139527702724Smrg# else 139627702724Smrg# if BSD == 199006 139727702724Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 139827702724Smrg# else 139927702724Smrg printf ("vax-dec-bsd\n"); exit (0); 140027702724Smrg# endif 140127702724Smrg# endif 140227702724Smrg# else 140327702724Smrg printf ("vax-dec-bsd\n"); exit (0); 140427702724Smrg# endif 140527702724Smrg# else 140627702724Smrg printf ("vax-dec-ultrix\n"); exit (0); 140727702724Smrg# endif 140827702724Smrg#endif 140927702724Smrg 141027702724Smrg#if defined (alliant) && defined (i860) 141127702724Smrg printf ("i860-alliant-bsd\n"); exit (0); 141227702724Smrg#endif 141327702724Smrg 141427702724Smrg exit (1); 141527702724Smrg} 141627702724SmrgEOF 141727702724Smrg 141827702724Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 141927702724Smrg { echo "$SYSTEM_NAME"; exit; } 142027702724Smrg 142127702724Smrg# Apollos put the system type in the environment. 142227702724Smrg 142327702724Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 142427702724Smrg 142527702724Smrg# Convex versions that predate uname can use getsysinfo(1) 142627702724Smrg 142727702724Smrgif [ -x /usr/convex/getsysinfo ] 142827702724Smrgthen 142927702724Smrg case `getsysinfo -f cpu_type` in 143027702724Smrg c1*) 143127702724Smrg echo c1-convex-bsd 143227702724Smrg exit ;; 143327702724Smrg c2*) 143427702724Smrg if getsysinfo -f scalar_acc 143527702724Smrg then echo c32-convex-bsd 143627702724Smrg else echo c2-convex-bsd 143727702724Smrg fi 143827702724Smrg exit ;; 143927702724Smrg c34*) 144027702724Smrg echo c34-convex-bsd 144127702724Smrg exit ;; 144227702724Smrg c38*) 144327702724Smrg echo c38-convex-bsd 144427702724Smrg exit ;; 144527702724Smrg c4*) 144627702724Smrg echo c4-convex-bsd 144727702724Smrg exit ;; 144827702724Smrg esac 144927702724Smrgfi 145027702724Smrg 145127702724Smrgcat >&2 <<EOF 145227702724Smrg$0: unable to guess system type 145327702724Smrg 145427702724SmrgThis script, last modified $timestamp, has failed to recognize 145527702724Smrgthe operating system you are using. It is advised that you 145627702724Smrgdownload the most up to date version of the config scripts from 145727702724Smrg 145827702724Smrg http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess 145927702724Smrgand 146027702724Smrg http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub 146127702724Smrg 146227702724SmrgIf the version you run ($0) is already up to date, please 146327702724Smrgsend the following data and any information you think might be 146427702724Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 146527702724Smrginformation to handle your system. 146627702724Smrg 146727702724Smrgconfig.guess timestamp = $timestamp 146827702724Smrg 146927702724Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 147027702724Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 147127702724Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 147227702724Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 147327702724Smrg 147427702724Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 147527702724Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 147627702724Smrg 147727702724Smrghostinfo = `(hostinfo) 2>/dev/null` 147827702724Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 147927702724Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 148027702724Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 148127702724Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 148227702724Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 148327702724Smrg 148427702724SmrgUNAME_MACHINE = ${UNAME_MACHINE} 148527702724SmrgUNAME_RELEASE = ${UNAME_RELEASE} 148627702724SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 148727702724SmrgUNAME_VERSION = ${UNAME_VERSION} 148827702724SmrgEOF 148927702724Smrg 149027702724Smrgexit 1 149127702724Smrg 149227702724Smrg# Local variables: 149327702724Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 149427702724Smrg# time-stamp-start: "timestamp='" 149527702724Smrg# time-stamp-format: "%:y-%02m-%02d" 149627702724Smrg# time-stamp-end: "'" 149727702724Smrg# End: 1498