config.guess revision 7104f784
109885543Smrg#! /bin/sh 209885543Smrg# Attempt to guess a canonical system name. 309885543Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 47104f784Smrg# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 57104f784Smrg# Free Software Foundation, Inc. 609885543Smrg 77104f784Smrgtimestamp='2008-01-23' 809885543Smrg 909885543Smrg# This file is free software; you can redistribute it and/or modify it 1009885543Smrg# under the terms of the GNU General Public License as published by 1109885543Smrg# the Free Software Foundation; either version 2 of the License, or 1209885543Smrg# (at your option) any later version. 1309885543Smrg# 1409885543Smrg# This program is distributed in the hope that it will be useful, but 1509885543Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 1609885543Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1709885543Smrg# General Public License for more details. 1809885543Smrg# 1909885543Smrg# You should have received a copy of the GNU General Public License 2009885543Smrg# along with this program; if not, write to the Free Software 2109885543Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 2209885543Smrg# 02110-1301, USA. 2309885543Smrg# 2409885543Smrg# As a special exception to the GNU General Public License, if you 2509885543Smrg# distribute this file as part of a program that contains a 2609885543Smrg# configuration script generated by Autoconf, you may include it under 2709885543Smrg# the same distribution terms that you use for the rest of that program. 2809885543Smrg 2909885543Smrg 3009885543Smrg# Originally written by Per Bothner <per@bothner.com>. 3109885543Smrg# Please send patches to <config-patches@gnu.org>. Submit a context 3209885543Smrg# diff and a properly formatted ChangeLog entry. 3309885543Smrg# 3409885543Smrg# This script attempts to guess a canonical system name similar to 3509885543Smrg# config.sub. If it succeeds, it prints the system name on stdout, and 3609885543Smrg# exits with 0. Otherwise, it exits with 1. 3709885543Smrg# 3809885543Smrg# The plan is that this can be called by configure scripts if you 3909885543Smrg# don't specify an explicit build system type. 4009885543Smrg 4109885543Smrgme=`echo "$0" | sed -e 's,.*/,,'` 4209885543Smrg 4309885543Smrgusage="\ 4409885543SmrgUsage: $0 [OPTION] 4509885543Smrg 4609885543SmrgOutput the configuration name of the system \`$me' is run on. 4709885543Smrg 4809885543SmrgOperation modes: 4909885543Smrg -h, --help print this help, then exit 5009885543Smrg -t, --time-stamp print date of last modification, then exit 5109885543Smrg -v, --version print version number, then exit 5209885543Smrg 5309885543SmrgReport bugs and patches to <config-patches@gnu.org>." 5409885543Smrg 5509885543Smrgversion="\ 5609885543SmrgGNU config.guess ($timestamp) 5709885543Smrg 5809885543SmrgOriginally written by Per Bothner. 597104f784SmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 607104f784Smrg2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. 6109885543Smrg 6209885543SmrgThis is free software; see the source for copying conditions. There is NO 6309885543Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 6409885543Smrg 6509885543Smrghelp=" 6609885543SmrgTry \`$me --help' for more information." 6709885543Smrg 6809885543Smrg# Parse command line 6909885543Smrgwhile test $# -gt 0 ; do 7009885543Smrg case $1 in 7109885543Smrg --time-stamp | --time* | -t ) 7209885543Smrg echo "$timestamp" ; exit ;; 7309885543Smrg --version | -v ) 7409885543Smrg echo "$version" ; exit ;; 7509885543Smrg --help | --h* | -h ) 7609885543Smrg echo "$usage"; exit ;; 7709885543Smrg -- ) # Stop option processing 7809885543Smrg shift; break ;; 7909885543Smrg - ) # Use stdin as input. 8009885543Smrg break ;; 8109885543Smrg -* ) 8209885543Smrg echo "$me: invalid option $1$help" >&2 8309885543Smrg exit 1 ;; 8409885543Smrg * ) 8509885543Smrg break ;; 8609885543Smrg esac 8709885543Smrgdone 8809885543Smrg 8909885543Smrgif test $# != 0; then 9009885543Smrg echo "$me: too many arguments$help" >&2 9109885543Smrg exit 1 9209885543Smrgfi 9309885543Smrg 9409885543Smrgtrap 'exit 1' 1 2 15 9509885543Smrg 9609885543Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 9709885543Smrg# compiler to aid in system detection is discouraged as it requires 9809885543Smrg# temporary files to be created and, as you can see below, it is a 9909885543Smrg# headache to deal with in a portable fashion. 10009885543Smrg 10109885543Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 10209885543Smrg# use `HOST_CC' if defined, but it is deprecated. 10309885543Smrg 10409885543Smrg# Portable tmp directory creation inspired by the Autoconf team. 10509885543Smrg 10609885543Smrgset_cc_for_build=' 10709885543Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 10809885543Smrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; 10909885543Smrg: ${TMPDIR=/tmp} ; 11009885543Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 11109885543Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 11209885543Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 11309885543Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 11409885543Smrgdummy=$tmp/dummy ; 11509885543Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 11609885543Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in 11709885543Smrg ,,) echo "int x;" > $dummy.c ; 11809885543Smrg for c in cc gcc c89 c99 ; do 11909885543Smrg if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 12009885543Smrg CC_FOR_BUILD="$c"; break ; 12109885543Smrg fi ; 12209885543Smrg done ; 12309885543Smrg if test x"$CC_FOR_BUILD" = x ; then 12409885543Smrg CC_FOR_BUILD=no_compiler_found ; 12509885543Smrg fi 12609885543Smrg ;; 12709885543Smrg ,,*) CC_FOR_BUILD=$CC ;; 12809885543Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 12909885543Smrgesac ; set_cc_for_build= ;' 13009885543Smrg 13109885543Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 13209885543Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 13309885543Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 13409885543Smrg PATH=$PATH:/.attbin ; export PATH 13509885543Smrgfi 13609885543Smrg 13709885543SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 13809885543SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 13909885543SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 14009885543SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 14109885543Smrg 1427104f784Smrgif [ "${UNAME_SYSTEM}" = "Linux" ] ; then 1437104f784Smrg eval $set_cc_for_build 1447104f784Smrg cat << EOF > $dummy.c 1457104f784Smrg #include <features.h> 1467104f784Smrg #ifdef __UCLIBC__ 1477104f784Smrg # ifdef __UCLIBC_CONFIG_VERSION__ 1487104f784Smrg LIBC=uclibc __UCLIBC_CONFIG_VERSION__ 1497104f784Smrg # else 1507104f784Smrg LIBC=uclibc 1517104f784Smrg # endif 1527104f784Smrg #else 1537104f784Smrg LIBC=gnu 1547104f784Smrg #endif 1557104f784SmrgEOF 1567104f784Smrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` 1577104f784Smrgfi 1587104f784Smrg 15909885543Smrg# Note: order is significant - the case branches are not exclusive. 16009885543Smrg 16109885543Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 16209885543Smrg *:NetBSD:*:*) 16309885543Smrg # NetBSD (nbsd) targets should (where applicable) match one or 16409885543Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 16509885543Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 16609885543Smrg # switched to ELF, *-*-netbsd* would select the old 16709885543Smrg # object file format. This provides both forward 16809885543Smrg # compatibility and a consistent mechanism for selecting the 16909885543Smrg # object file format. 17009885543Smrg # 17109885543Smrg # Note: NetBSD doesn't particularly care about the vendor 17209885543Smrg # portion of the name. We always set it to "unknown". 17309885543Smrg sysctl="sysctl -n hw.machine_arch" 17409885543Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 17509885543Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 17609885543Smrg case "${UNAME_MACHINE_ARCH}" in 17709885543Smrg armeb) machine=armeb-unknown ;; 17809885543Smrg arm*) machine=arm-unknown ;; 17909885543Smrg sh3el) machine=shl-unknown ;; 18009885543Smrg sh3eb) machine=sh-unknown ;; 1817104f784Smrg sh5el) machine=sh5le-unknown ;; 18209885543Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 18309885543Smrg esac 18409885543Smrg # The Operating System including object format, if it has switched 18509885543Smrg # to ELF recently, or will in the future. 18609885543Smrg case "${UNAME_MACHINE_ARCH}" in 18709885543Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 18809885543Smrg eval $set_cc_for_build 18909885543Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 19009885543Smrg | grep __ELF__ >/dev/null 19109885543Smrg then 19209885543Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 19309885543Smrg # Return netbsd for either. FIX? 19409885543Smrg os=netbsd 19509885543Smrg else 19609885543Smrg os=netbsdelf 19709885543Smrg fi 19809885543Smrg ;; 19909885543Smrg *) 20009885543Smrg os=netbsd 20109885543Smrg ;; 20209885543Smrg esac 20309885543Smrg # The OS release 20409885543Smrg # Debian GNU/NetBSD machines have a different userland, and 20509885543Smrg # thus, need a distinct triplet. However, they do not need 20609885543Smrg # kernel version information, so it can be replaced with a 20709885543Smrg # suitable tag, in the style of linux-gnu. 20809885543Smrg case "${UNAME_VERSION}" in 20909885543Smrg Debian*) 21009885543Smrg release='-gnu' 21109885543Smrg ;; 21209885543Smrg *) 21309885543Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 21409885543Smrg ;; 21509885543Smrg esac 21609885543Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 21709885543Smrg # contains redundant information, the shorter form: 21809885543Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 21909885543Smrg echo "${machine}-${os}${release}" 22009885543Smrg exit ;; 22109885543Smrg *:OpenBSD:*:*) 22209885543Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 22309885543Smrg echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 22409885543Smrg exit ;; 22509885543Smrg *:ekkoBSD:*:*) 22609885543Smrg echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 22709885543Smrg exit ;; 22809885543Smrg *:SolidBSD:*:*) 22909885543Smrg echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 23009885543Smrg exit ;; 23109885543Smrg macppc:MirBSD:*:*) 23209885543Smrg echo powerpc-unknown-mirbsd${UNAME_RELEASE} 23309885543Smrg exit ;; 23409885543Smrg *:MirBSD:*:*) 23509885543Smrg echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 23609885543Smrg exit ;; 23709885543Smrg alpha:OSF1:*:*) 23809885543Smrg case $UNAME_RELEASE in 23909885543Smrg *4.0) 24009885543Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 24109885543Smrg ;; 24209885543Smrg *5.*) 24309885543Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 24409885543Smrg ;; 24509885543Smrg esac 24609885543Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 24709885543Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 24809885543Smrg # covers most systems running today. This code pipes the CPU 24909885543Smrg # types through head -n 1, so we only detect the type of CPU 0. 25009885543Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 25109885543Smrg case "$ALPHA_CPU_TYPE" in 25209885543Smrg "EV4 (21064)") 25309885543Smrg UNAME_MACHINE="alpha" ;; 25409885543Smrg "EV4.5 (21064)") 25509885543Smrg UNAME_MACHINE="alpha" ;; 25609885543Smrg "LCA4 (21066/21068)") 25709885543Smrg UNAME_MACHINE="alpha" ;; 25809885543Smrg "EV5 (21164)") 25909885543Smrg UNAME_MACHINE="alphaev5" ;; 26009885543Smrg "EV5.6 (21164A)") 26109885543Smrg UNAME_MACHINE="alphaev56" ;; 26209885543Smrg "EV5.6 (21164PC)") 26309885543Smrg UNAME_MACHINE="alphapca56" ;; 26409885543Smrg "EV5.7 (21164PC)") 26509885543Smrg UNAME_MACHINE="alphapca57" ;; 26609885543Smrg "EV6 (21264)") 26709885543Smrg UNAME_MACHINE="alphaev6" ;; 26809885543Smrg "EV6.7 (21264A)") 26909885543Smrg UNAME_MACHINE="alphaev67" ;; 27009885543Smrg "EV6.8CB (21264C)") 27109885543Smrg UNAME_MACHINE="alphaev68" ;; 27209885543Smrg "EV6.8AL (21264B)") 27309885543Smrg UNAME_MACHINE="alphaev68" ;; 27409885543Smrg "EV6.8CX (21264D)") 27509885543Smrg UNAME_MACHINE="alphaev68" ;; 27609885543Smrg "EV6.9A (21264/EV69A)") 27709885543Smrg UNAME_MACHINE="alphaev69" ;; 27809885543Smrg "EV7 (21364)") 27909885543Smrg UNAME_MACHINE="alphaev7" ;; 28009885543Smrg "EV7.9 (21364A)") 28109885543Smrg UNAME_MACHINE="alphaev79" ;; 28209885543Smrg esac 28309885543Smrg # A Pn.n version is a patched version. 28409885543Smrg # A Vn.n version is a released version. 28509885543Smrg # A Tn.n version is a released field test version. 28609885543Smrg # A Xn.n version is an unreleased experimental baselevel. 28709885543Smrg # 1.2 uses "1.2" for uname -r. 28809885543Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 28909885543Smrg exit ;; 29009885543Smrg Alpha\ *:Windows_NT*:*) 29109885543Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 29209885543Smrg # Should we change UNAME_MACHINE based on the output of uname instead 29309885543Smrg # of the specific Alpha model? 29409885543Smrg echo alpha-pc-interix 29509885543Smrg exit ;; 29609885543Smrg 21064:Windows_NT:50:3) 29709885543Smrg echo alpha-dec-winnt3.5 29809885543Smrg exit ;; 29909885543Smrg Amiga*:UNIX_System_V:4.0:*) 30009885543Smrg echo m68k-unknown-sysv4 30109885543Smrg exit ;; 30209885543Smrg *:[Aa]miga[Oo][Ss]:*:*) 30309885543Smrg echo ${UNAME_MACHINE}-unknown-amigaos 30409885543Smrg exit ;; 30509885543Smrg *:[Mm]orph[Oo][Ss]:*:*) 30609885543Smrg echo ${UNAME_MACHINE}-unknown-morphos 30709885543Smrg exit ;; 30809885543Smrg *:OS/390:*:*) 30909885543Smrg echo i370-ibm-openedition 31009885543Smrg exit ;; 31109885543Smrg *:z/VM:*:*) 31209885543Smrg echo s390-ibm-zvmoe 31309885543Smrg exit ;; 31409885543Smrg *:OS400:*:*) 31509885543Smrg echo powerpc-ibm-os400 31609885543Smrg exit ;; 31709885543Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 31809885543Smrg echo arm-acorn-riscix${UNAME_RELEASE} 31909885543Smrg exit ;; 32009885543Smrg arm:riscos:*:*|arm:RISCOS:*:*) 32109885543Smrg echo arm-unknown-riscos 32209885543Smrg exit ;; 32309885543Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 32409885543Smrg echo hppa1.1-hitachi-hiuxmpp 32509885543Smrg exit ;; 32609885543Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 32709885543Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 32809885543Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 32909885543Smrg echo pyramid-pyramid-sysv3 33009885543Smrg else 33109885543Smrg echo pyramid-pyramid-bsd 33209885543Smrg fi 33309885543Smrg exit ;; 33409885543Smrg NILE*:*:*:dcosx) 33509885543Smrg echo pyramid-pyramid-svr4 33609885543Smrg exit ;; 33709885543Smrg DRS?6000:unix:4.0:6*) 33809885543Smrg echo sparc-icl-nx6 33909885543Smrg exit ;; 34009885543Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 34109885543Smrg case `/usr/bin/uname -p` in 34209885543Smrg sparc) echo sparc-icl-nx7; exit ;; 34309885543Smrg esac ;; 34409885543Smrg sun4H:SunOS:5.*:*) 34509885543Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 34609885543Smrg exit ;; 34709885543Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 34809885543Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 34909885543Smrg exit ;; 3507104f784Smrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 35109885543Smrg echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 35209885543Smrg exit ;; 35309885543Smrg sun4*:SunOS:6*:*) 35409885543Smrg # According to config.sub, this is the proper way to canonicalize 35509885543Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 35609885543Smrg # it's likely to be more like Solaris than SunOS4. 35709885543Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 35809885543Smrg exit ;; 35909885543Smrg sun4*:SunOS:*:*) 36009885543Smrg case "`/usr/bin/arch -k`" in 36109885543Smrg Series*|S4*) 36209885543Smrg UNAME_RELEASE=`uname -v` 36309885543Smrg ;; 36409885543Smrg esac 36509885543Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 36609885543Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 36709885543Smrg exit ;; 36809885543Smrg sun3*:SunOS:*:*) 36909885543Smrg echo m68k-sun-sunos${UNAME_RELEASE} 37009885543Smrg exit ;; 37109885543Smrg sun*:*:4.2BSD:*) 37209885543Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 37309885543Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 37409885543Smrg case "`/bin/arch`" in 37509885543Smrg sun3) 37609885543Smrg echo m68k-sun-sunos${UNAME_RELEASE} 37709885543Smrg ;; 37809885543Smrg sun4) 37909885543Smrg echo sparc-sun-sunos${UNAME_RELEASE} 38009885543Smrg ;; 38109885543Smrg esac 38209885543Smrg exit ;; 38309885543Smrg aushp:SunOS:*:*) 38409885543Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 38509885543Smrg exit ;; 38609885543Smrg # The situation for MiNT is a little confusing. The machine name 38709885543Smrg # can be virtually everything (everything which is not 38809885543Smrg # "atarist" or "atariste" at least should have a processor 38909885543Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 39009885543Smrg # to the lowercase version "mint" (or "freemint"). Finally 39109885543Smrg # the system name "TOS" denotes a system which is actually not 39209885543Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 39309885543Smrg # be no problem. 39409885543Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 39509885543Smrg echo m68k-atari-mint${UNAME_RELEASE} 39609885543Smrg exit ;; 39709885543Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 39809885543Smrg echo m68k-atari-mint${UNAME_RELEASE} 39909885543Smrg exit ;; 40009885543Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 40109885543Smrg echo m68k-atari-mint${UNAME_RELEASE} 40209885543Smrg exit ;; 40309885543Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 40409885543Smrg echo m68k-milan-mint${UNAME_RELEASE} 40509885543Smrg exit ;; 40609885543Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 40709885543Smrg echo m68k-hades-mint${UNAME_RELEASE} 40809885543Smrg exit ;; 40909885543Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 41009885543Smrg echo m68k-unknown-mint${UNAME_RELEASE} 41109885543Smrg exit ;; 41209885543Smrg m68k:machten:*:*) 41309885543Smrg echo m68k-apple-machten${UNAME_RELEASE} 41409885543Smrg exit ;; 41509885543Smrg powerpc:machten:*:*) 41609885543Smrg echo powerpc-apple-machten${UNAME_RELEASE} 41709885543Smrg exit ;; 41809885543Smrg RISC*:Mach:*:*) 41909885543Smrg echo mips-dec-mach_bsd4.3 42009885543Smrg exit ;; 42109885543Smrg RISC*:ULTRIX:*:*) 42209885543Smrg echo mips-dec-ultrix${UNAME_RELEASE} 42309885543Smrg exit ;; 42409885543Smrg VAX*:ULTRIX*:*:*) 42509885543Smrg echo vax-dec-ultrix${UNAME_RELEASE} 42609885543Smrg exit ;; 42709885543Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 42809885543Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 42909885543Smrg exit ;; 43009885543Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 43109885543Smrg eval $set_cc_for_build 43209885543Smrg sed 's/^ //' << EOF >$dummy.c 43309885543Smrg#ifdef __cplusplus 43409885543Smrg#include <stdio.h> /* for printf() prototype */ 43509885543Smrg int main (int argc, char *argv[]) { 43609885543Smrg#else 43709885543Smrg int main (argc, argv) int argc; char *argv[]; { 43809885543Smrg#endif 43909885543Smrg #if defined (host_mips) && defined (MIPSEB) 44009885543Smrg #if defined (SYSTYPE_SYSV) 44109885543Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 44209885543Smrg #endif 44309885543Smrg #if defined (SYSTYPE_SVR4) 44409885543Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 44509885543Smrg #endif 44609885543Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 44709885543Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 44809885543Smrg #endif 44909885543Smrg #endif 45009885543Smrg exit (-1); 45109885543Smrg } 45209885543SmrgEOF 45309885543Smrg $CC_FOR_BUILD -o $dummy $dummy.c && 45409885543Smrg dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 45509885543Smrg SYSTEM_NAME=`$dummy $dummyarg` && 45609885543Smrg { echo "$SYSTEM_NAME"; exit; } 45709885543Smrg echo mips-mips-riscos${UNAME_RELEASE} 45809885543Smrg exit ;; 45909885543Smrg Motorola:PowerMAX_OS:*:*) 46009885543Smrg echo powerpc-motorola-powermax 46109885543Smrg exit ;; 46209885543Smrg Motorola:*:4.3:PL8-*) 46309885543Smrg echo powerpc-harris-powermax 46409885543Smrg exit ;; 46509885543Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 46609885543Smrg echo powerpc-harris-powermax 46709885543Smrg exit ;; 46809885543Smrg Night_Hawk:Power_UNIX:*:*) 46909885543Smrg echo powerpc-harris-powerunix 47009885543Smrg exit ;; 47109885543Smrg m88k:CX/UX:7*:*) 47209885543Smrg echo m88k-harris-cxux7 47309885543Smrg exit ;; 47409885543Smrg m88k:*:4*:R4*) 47509885543Smrg echo m88k-motorola-sysv4 47609885543Smrg exit ;; 47709885543Smrg m88k:*:3*:R3*) 47809885543Smrg echo m88k-motorola-sysv3 47909885543Smrg exit ;; 48009885543Smrg AViiON:dgux:*:*) 48109885543Smrg # DG/UX returns AViiON for all architectures 48209885543Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 48309885543Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 48409885543Smrg then 48509885543Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 48609885543Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 48709885543Smrg then 48809885543Smrg echo m88k-dg-dgux${UNAME_RELEASE} 48909885543Smrg else 49009885543Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 49109885543Smrg fi 49209885543Smrg else 49309885543Smrg echo i586-dg-dgux${UNAME_RELEASE} 49409885543Smrg fi 49509885543Smrg exit ;; 49609885543Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 49709885543Smrg echo m88k-dolphin-sysv3 49809885543Smrg exit ;; 49909885543Smrg M88*:*:R3*:*) 50009885543Smrg # Delta 88k system running SVR3 50109885543Smrg echo m88k-motorola-sysv3 50209885543Smrg exit ;; 50309885543Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 50409885543Smrg echo m88k-tektronix-sysv3 50509885543Smrg exit ;; 50609885543Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 50709885543Smrg echo m68k-tektronix-bsd 50809885543Smrg exit ;; 50909885543Smrg *:IRIX*:*:*) 51009885543Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 51109885543Smrg exit ;; 51209885543Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 51309885543Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 51409885543Smrg exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 51509885543Smrg i*86:AIX:*:*) 51609885543Smrg echo i386-ibm-aix 51709885543Smrg exit ;; 51809885543Smrg ia64:AIX:*:*) 51909885543Smrg if [ -x /usr/bin/oslevel ] ; then 52009885543Smrg IBM_REV=`/usr/bin/oslevel` 52109885543Smrg else 52209885543Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 52309885543Smrg fi 52409885543Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 52509885543Smrg exit ;; 52609885543Smrg *:AIX:2:3) 52709885543Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 52809885543Smrg eval $set_cc_for_build 52909885543Smrg sed 's/^ //' << EOF >$dummy.c 53009885543Smrg #include <sys/systemcfg.h> 53109885543Smrg 53209885543Smrg main() 53309885543Smrg { 53409885543Smrg if (!__power_pc()) 53509885543Smrg exit(1); 53609885543Smrg puts("powerpc-ibm-aix3.2.5"); 53709885543Smrg exit(0); 53809885543Smrg } 53909885543SmrgEOF 54009885543Smrg if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 54109885543Smrg then 54209885543Smrg echo "$SYSTEM_NAME" 54309885543Smrg else 54409885543Smrg echo rs6000-ibm-aix3.2.5 54509885543Smrg fi 54609885543Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 54709885543Smrg echo rs6000-ibm-aix3.2.4 54809885543Smrg else 54909885543Smrg echo rs6000-ibm-aix3.2 55009885543Smrg fi 55109885543Smrg exit ;; 5527104f784Smrg *:AIX:*:[456]) 55309885543Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 55409885543Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 55509885543Smrg IBM_ARCH=rs6000 55609885543Smrg else 55709885543Smrg IBM_ARCH=powerpc 55809885543Smrg fi 55909885543Smrg if [ -x /usr/bin/oslevel ] ; then 56009885543Smrg IBM_REV=`/usr/bin/oslevel` 56109885543Smrg else 56209885543Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 56309885543Smrg fi 56409885543Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 56509885543Smrg exit ;; 56609885543Smrg *:AIX:*:*) 56709885543Smrg echo rs6000-ibm-aix 56809885543Smrg exit ;; 56909885543Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 57009885543Smrg echo romp-ibm-bsd4.4 57109885543Smrg exit ;; 57209885543Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 57309885543Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 57409885543Smrg exit ;; # report: romp-ibm BSD 4.3 57509885543Smrg *:BOSX:*:*) 57609885543Smrg echo rs6000-bull-bosx 57709885543Smrg exit ;; 57809885543Smrg DPX/2?00:B.O.S.:*:*) 57909885543Smrg echo m68k-bull-sysv3 58009885543Smrg exit ;; 58109885543Smrg 9000/[34]??:4.3bsd:1.*:*) 58209885543Smrg echo m68k-hp-bsd 58309885543Smrg exit ;; 58409885543Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 58509885543Smrg echo m68k-hp-bsd4.4 58609885543Smrg exit ;; 58709885543Smrg 9000/[34678]??:HP-UX:*:*) 58809885543Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 58909885543Smrg case "${UNAME_MACHINE}" in 59009885543Smrg 9000/31? ) HP_ARCH=m68000 ;; 59109885543Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 59209885543Smrg 9000/[678][0-9][0-9]) 59309885543Smrg if [ -x /usr/bin/getconf ]; then 59409885543Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 59509885543Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 59609885543Smrg case "${sc_cpu_version}" in 59709885543Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 59809885543Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 59909885543Smrg 532) # CPU_PA_RISC2_0 60009885543Smrg case "${sc_kernel_bits}" in 60109885543Smrg 32) HP_ARCH="hppa2.0n" ;; 60209885543Smrg 64) HP_ARCH="hppa2.0w" ;; 60309885543Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 60409885543Smrg esac ;; 60509885543Smrg esac 60609885543Smrg fi 60709885543Smrg if [ "${HP_ARCH}" = "" ]; then 60809885543Smrg eval $set_cc_for_build 60909885543Smrg sed 's/^ //' << EOF >$dummy.c 61009885543Smrg 61109885543Smrg #define _HPUX_SOURCE 61209885543Smrg #include <stdlib.h> 61309885543Smrg #include <unistd.h> 61409885543Smrg 61509885543Smrg int main () 61609885543Smrg { 61709885543Smrg #if defined(_SC_KERNEL_BITS) 61809885543Smrg long bits = sysconf(_SC_KERNEL_BITS); 61909885543Smrg #endif 62009885543Smrg long cpu = sysconf (_SC_CPU_VERSION); 62109885543Smrg 62209885543Smrg switch (cpu) 62309885543Smrg { 62409885543Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 62509885543Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 62609885543Smrg case CPU_PA_RISC2_0: 62709885543Smrg #if defined(_SC_KERNEL_BITS) 62809885543Smrg switch (bits) 62909885543Smrg { 63009885543Smrg case 64: puts ("hppa2.0w"); break; 63109885543Smrg case 32: puts ("hppa2.0n"); break; 63209885543Smrg default: puts ("hppa2.0"); break; 63309885543Smrg } break; 63409885543Smrg #else /* !defined(_SC_KERNEL_BITS) */ 63509885543Smrg puts ("hppa2.0"); break; 63609885543Smrg #endif 63709885543Smrg default: puts ("hppa1.0"); break; 63809885543Smrg } 63909885543Smrg exit (0); 64009885543Smrg } 64109885543SmrgEOF 64209885543Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 64309885543Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 64409885543Smrg fi ;; 64509885543Smrg esac 64609885543Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 64709885543Smrg then 64809885543Smrg eval $set_cc_for_build 64909885543Smrg 65009885543Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 65109885543Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 65209885543Smrg # generating 64-bit code. GNU and HP use different nomenclature: 65309885543Smrg # 65409885543Smrg # $ CC_FOR_BUILD=cc ./config.guess 65509885543Smrg # => hppa2.0w-hp-hpux11.23 65609885543Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 65709885543Smrg # => hppa64-hp-hpux11.23 65809885543Smrg 65909885543Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 66009885543Smrg grep __LP64__ >/dev/null 66109885543Smrg then 66209885543Smrg HP_ARCH="hppa2.0w" 66309885543Smrg else 66409885543Smrg HP_ARCH="hppa64" 66509885543Smrg fi 66609885543Smrg fi 66709885543Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 66809885543Smrg exit ;; 66909885543Smrg ia64:HP-UX:*:*) 67009885543Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 67109885543Smrg echo ia64-hp-hpux${HPUX_REV} 67209885543Smrg exit ;; 67309885543Smrg 3050*:HI-UX:*:*) 67409885543Smrg eval $set_cc_for_build 67509885543Smrg sed 's/^ //' << EOF >$dummy.c 67609885543Smrg #include <unistd.h> 67709885543Smrg int 67809885543Smrg main () 67909885543Smrg { 68009885543Smrg long cpu = sysconf (_SC_CPU_VERSION); 68109885543Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 68209885543Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 68309885543Smrg results, however. */ 68409885543Smrg if (CPU_IS_PA_RISC (cpu)) 68509885543Smrg { 68609885543Smrg switch (cpu) 68709885543Smrg { 68809885543Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 68909885543Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 69009885543Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 69109885543Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 69209885543Smrg } 69309885543Smrg } 69409885543Smrg else if (CPU_IS_HP_MC68K (cpu)) 69509885543Smrg puts ("m68k-hitachi-hiuxwe2"); 69609885543Smrg else puts ("unknown-hitachi-hiuxwe2"); 69709885543Smrg exit (0); 69809885543Smrg } 69909885543SmrgEOF 70009885543Smrg $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 70109885543Smrg { echo "$SYSTEM_NAME"; exit; } 70209885543Smrg echo unknown-hitachi-hiuxwe2 70309885543Smrg exit ;; 70409885543Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 70509885543Smrg echo hppa1.1-hp-bsd 70609885543Smrg exit ;; 70709885543Smrg 9000/8??:4.3bsd:*:*) 70809885543Smrg echo hppa1.0-hp-bsd 70909885543Smrg exit ;; 71009885543Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 71109885543Smrg echo hppa1.0-hp-mpeix 71209885543Smrg exit ;; 71309885543Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 71409885543Smrg echo hppa1.1-hp-osf 71509885543Smrg exit ;; 71609885543Smrg hp8??:OSF1:*:*) 71709885543Smrg echo hppa1.0-hp-osf 71809885543Smrg exit ;; 71909885543Smrg i*86:OSF1:*:*) 72009885543Smrg if [ -x /usr/sbin/sysversion ] ; then 72109885543Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 72209885543Smrg else 72309885543Smrg echo ${UNAME_MACHINE}-unknown-osf1 72409885543Smrg fi 72509885543Smrg exit ;; 72609885543Smrg parisc*:Lites*:*:*) 72709885543Smrg echo hppa1.1-hp-lites 72809885543Smrg exit ;; 72909885543Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 73009885543Smrg echo c1-convex-bsd 73109885543Smrg exit ;; 73209885543Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 73309885543Smrg if getsysinfo -f scalar_acc 73409885543Smrg then echo c32-convex-bsd 73509885543Smrg else echo c2-convex-bsd 73609885543Smrg fi 73709885543Smrg exit ;; 73809885543Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 73909885543Smrg echo c34-convex-bsd 74009885543Smrg exit ;; 74109885543Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 74209885543Smrg echo c38-convex-bsd 74309885543Smrg exit ;; 74409885543Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 74509885543Smrg echo c4-convex-bsd 74609885543Smrg exit ;; 74709885543Smrg CRAY*Y-MP:*:*:*) 74809885543Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 74909885543Smrg exit ;; 75009885543Smrg CRAY*[A-Z]90:*:*:*) 75109885543Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 75209885543Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 75309885543Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 75409885543Smrg -e 's/\.[^.]*$/.X/' 75509885543Smrg exit ;; 75609885543Smrg CRAY*TS:*:*:*) 75709885543Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 75809885543Smrg exit ;; 75909885543Smrg CRAY*T3E:*:*:*) 76009885543Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76109885543Smrg exit ;; 76209885543Smrg CRAY*SV1:*:*:*) 76309885543Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76409885543Smrg exit ;; 76509885543Smrg *:UNICOS/mp:*:*) 76609885543Smrg echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76709885543Smrg exit ;; 76809885543Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 76909885543Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 77009885543Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 77109885543Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 77209885543Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 77309885543Smrg exit ;; 77409885543Smrg 5000:UNIX_System_V:4.*:*) 77509885543Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 77609885543Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 77709885543Smrg echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 77809885543Smrg exit ;; 77909885543Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 78009885543Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 78109885543Smrg exit ;; 78209885543Smrg sparc*:BSD/OS:*:*) 78309885543Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 78409885543Smrg exit ;; 78509885543Smrg *:BSD/OS:*:*) 78609885543Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 78709885543Smrg exit ;; 78809885543Smrg *:FreeBSD:*:*) 78909885543Smrg case ${UNAME_MACHINE} in 79009885543Smrg pc98) 79109885543Smrg echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 79209885543Smrg amd64) 79309885543Smrg echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 79409885543Smrg *) 79509885543Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 79609885543Smrg esac 79709885543Smrg exit ;; 79809885543Smrg i*:CYGWIN*:*) 79909885543Smrg echo ${UNAME_MACHINE}-pc-cygwin 80009885543Smrg exit ;; 8017104f784Smrg *:MINGW*:*) 80209885543Smrg echo ${UNAME_MACHINE}-pc-mingw32 80309885543Smrg exit ;; 80409885543Smrg i*:windows32*:*) 80509885543Smrg # uname -m includes "-pc" on this system. 80609885543Smrg echo ${UNAME_MACHINE}-mingw32 80709885543Smrg exit ;; 80809885543Smrg i*:PW*:*) 80909885543Smrg echo ${UNAME_MACHINE}-pc-pw32 81009885543Smrg exit ;; 8117104f784Smrg *:Interix*:[3456]*) 8127104f784Smrg case ${UNAME_MACHINE} in 8137104f784Smrg x86) 8147104f784Smrg echo i586-pc-interix${UNAME_RELEASE} 8157104f784Smrg exit ;; 8167104f784Smrg EM64T | authenticamd) 8177104f784Smrg echo x86_64-unknown-interix${UNAME_RELEASE} 8187104f784Smrg exit ;; 8197104f784Smrg IA64) 8207104f784Smrg echo ia64-unknown-interix${UNAME_RELEASE} 8217104f784Smrg exit ;; 8227104f784Smrg esac ;; 82309885543Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 82409885543Smrg echo i${UNAME_MACHINE}-pc-mks 82509885543Smrg exit ;; 82609885543Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 82709885543Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 82809885543Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 82909885543Smrg # UNAME_MACHINE based on the output of uname instead of i386? 83009885543Smrg echo i586-pc-interix 83109885543Smrg exit ;; 83209885543Smrg i*:UWIN*:*) 83309885543Smrg echo ${UNAME_MACHINE}-pc-uwin 83409885543Smrg exit ;; 83509885543Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 83609885543Smrg echo x86_64-unknown-cygwin 83709885543Smrg exit ;; 83809885543Smrg p*:CYGWIN*:*) 83909885543Smrg echo powerpcle-unknown-cygwin 84009885543Smrg exit ;; 84109885543Smrg prep*:SunOS:5.*:*) 84209885543Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 84309885543Smrg exit ;; 84409885543Smrg *:GNU:*:*) 84509885543Smrg # the GNU system 84609885543Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 84709885543Smrg exit ;; 84809885543Smrg *:GNU/*:*:*) 84909885543Smrg # other systems with GNU libc and userland 85009885543Smrg echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 85109885543Smrg exit ;; 85209885543Smrg i*86:Minix:*:*) 85309885543Smrg echo ${UNAME_MACHINE}-pc-minix 85409885543Smrg exit ;; 85509885543Smrg arm*:Linux:*:*) 8567104f784Smrg eval $set_cc_for_build 8577104f784Smrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 8587104f784Smrg | grep -q __ARM_EABI__ 8597104f784Smrg then 8607104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 8617104f784Smrg else 8627104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi 8637104f784Smrg fi 86409885543Smrg exit ;; 86509885543Smrg avr32*:Linux:*:*) 8667104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 86709885543Smrg exit ;; 86809885543Smrg cris:Linux:*:*) 8697104f784Smrg echo cris-axis-linux-${LIBC} 87009885543Smrg exit ;; 87109885543Smrg crisv32:Linux:*:*) 8727104f784Smrg echo crisv32-axis-linux-${LIBC} 87309885543Smrg exit ;; 87409885543Smrg frv:Linux:*:*) 8757104f784Smrg echo frv-unknown-linux-${LIBC} 87609885543Smrg exit ;; 87709885543Smrg ia64:Linux:*:*) 8787104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 87909885543Smrg exit ;; 88009885543Smrg m32r*:Linux:*:*) 8817104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 88209885543Smrg exit ;; 88309885543Smrg m68*:Linux:*:*) 8847104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 88509885543Smrg exit ;; 88609885543Smrg mips:Linux:*:*) 88709885543Smrg eval $set_cc_for_build 88809885543Smrg sed 's/^ //' << EOF >$dummy.c 88909885543Smrg #undef CPU 89009885543Smrg #undef mips 89109885543Smrg #undef mipsel 89209885543Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 89309885543Smrg CPU=mipsel 89409885543Smrg #else 89509885543Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 89609885543Smrg CPU=mips 89709885543Smrg #else 89809885543Smrg CPU= 89909885543Smrg #endif 90009885543Smrg #endif 90109885543SmrgEOF 90209885543Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 90309885543Smrg /^CPU/{ 90409885543Smrg s: ::g 90509885543Smrg p 90609885543Smrg }'`" 9077104f784Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 90809885543Smrg ;; 90909885543Smrg mips64:Linux:*:*) 91009885543Smrg eval $set_cc_for_build 91109885543Smrg sed 's/^ //' << EOF >$dummy.c 91209885543Smrg #undef CPU 91309885543Smrg #undef mips64 91409885543Smrg #undef mips64el 91509885543Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 91609885543Smrg CPU=mips64el 91709885543Smrg #else 91809885543Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 91909885543Smrg CPU=mips64 92009885543Smrg #else 92109885543Smrg CPU= 92209885543Smrg #endif 92309885543Smrg #endif 92409885543SmrgEOF 92509885543Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 92609885543Smrg /^CPU/{ 92709885543Smrg s: ::g 92809885543Smrg p 92909885543Smrg }'`" 9307104f784Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } 93109885543Smrg ;; 93209885543Smrg or32:Linux:*:*) 9337104f784Smrg echo or32-unknown-linux-${LIBC} 93409885543Smrg exit ;; 93509885543Smrg ppc:Linux:*:*) 9367104f784Smrg echo powerpc-unknown-linux-${LIBC} 93709885543Smrg exit ;; 93809885543Smrg ppc64:Linux:*:*) 9397104f784Smrg echo powerpc64-unknown-linux-${LIBC} 94009885543Smrg exit ;; 94109885543Smrg alpha:Linux:*:*) 94209885543Smrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 94309885543Smrg EV5) UNAME_MACHINE=alphaev5 ;; 94409885543Smrg EV56) UNAME_MACHINE=alphaev56 ;; 94509885543Smrg PCA56) UNAME_MACHINE=alphapca56 ;; 94609885543Smrg PCA57) UNAME_MACHINE=alphapca56 ;; 94709885543Smrg EV6) UNAME_MACHINE=alphaev6 ;; 94809885543Smrg EV67) UNAME_MACHINE=alphaev67 ;; 94909885543Smrg EV68*) UNAME_MACHINE=alphaev68 ;; 95009885543Smrg esac 95109885543Smrg objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null 9527104f784Smrg if test "$?" = 0 ; then LIBC="gnulibc1" ; fi 9537104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 95409885543Smrg exit ;; 95509885543Smrg parisc:Linux:*:* | hppa:Linux:*:*) 95609885543Smrg # Look for CPU level 95709885543Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 9587104f784Smrg PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; 9597104f784Smrg PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; 9607104f784Smrg *) echo hppa-unknown-linux-${LIBC} ;; 96109885543Smrg esac 96209885543Smrg exit ;; 96309885543Smrg parisc64:Linux:*:* | hppa64:Linux:*:*) 9647104f784Smrg echo hppa64-unknown-linux-${LIBC} 96509885543Smrg exit ;; 96609885543Smrg s390:Linux:*:* | s390x:Linux:*:*) 96709885543Smrg echo ${UNAME_MACHINE}-ibm-linux 96809885543Smrg exit ;; 96909885543Smrg sh64*:Linux:*:*) 9707104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 97109885543Smrg exit ;; 97209885543Smrg sh*:Linux:*:*) 9737104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 97409885543Smrg exit ;; 97509885543Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 9767104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 97709885543Smrg exit ;; 97809885543Smrg vax:Linux:*:*) 9797104f784Smrg echo ${UNAME_MACHINE}-dec-linux-${LIBC} 98009885543Smrg exit ;; 98109885543Smrg x86_64:Linux:*:*) 9827104f784Smrg echo x86_64-unknown-linux-${LIBC} 9837104f784Smrg exit ;; 9847104f784Smrg xtensa*:Linux:*:*) 9857104f784Smrg echo ${UNAME_MACHINE}-unknown-linux-${LIBC} 98609885543Smrg exit ;; 98709885543Smrg i*86:Linux:*:*) 98809885543Smrg # The BFD linker knows what the default object file format is, so 98909885543Smrg # first see if it will tell us. cd to the root directory to prevent 99009885543Smrg # problems with other programs or directories called `ld' in the path. 99109885543Smrg # Set LC_ALL=C to ensure ld outputs messages in English. 99209885543Smrg ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ 99309885543Smrg | sed -ne '/supported targets:/!d 99409885543Smrg s/[ ][ ]*/ /g 99509885543Smrg s/.*supported targets: *// 99609885543Smrg s/ .*// 99709885543Smrg p'` 99809885543Smrg case "$ld_supported_targets" in 99909885543Smrg elf32-i386) 10007104f784Smrg TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" 100109885543Smrg ;; 100209885543Smrg a.out-i386-linux) 10037104f784Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" 100409885543Smrg exit ;; 100509885543Smrg coff-i386) 10067104f784Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff" 100709885543Smrg exit ;; 100809885543Smrg "") 100909885543Smrg # Either a pre-BFD a.out linker (linux-gnuoldld) or 101009885543Smrg # one that does not give us useful --help. 10117104f784Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" 101209885543Smrg exit ;; 101309885543Smrg esac 10147104f784Smrg # This should get integrated into the C code below, but now we hack 10157104f784Smrg if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi 101609885543Smrg # Determine whether the default compiler is a.out or elf 101709885543Smrg eval $set_cc_for_build 101809885543Smrg sed 's/^ //' << EOF >$dummy.c 101909885543Smrg #include <features.h> 102009885543Smrg #ifdef __ELF__ 102109885543Smrg # ifdef __GLIBC__ 102209885543Smrg # if __GLIBC__ >= 2 102309885543Smrg LIBC=gnu 102409885543Smrg # else 102509885543Smrg LIBC=gnulibc1 102609885543Smrg # endif 102709885543Smrg # else 102809885543Smrg LIBC=gnulibc1 102909885543Smrg # endif 103009885543Smrg #else 103109885543Smrg #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) 103209885543Smrg LIBC=gnu 103309885543Smrg #else 103409885543Smrg LIBC=gnuaout 103509885543Smrg #endif 103609885543Smrg #endif 103709885543Smrg #ifdef __dietlibc__ 103809885543Smrg LIBC=dietlibc 103909885543Smrg #endif 104009885543SmrgEOF 104109885543Smrg eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' 104209885543Smrg /^LIBC/{ 104309885543Smrg s: ::g 104409885543Smrg p 104509885543Smrg }'`" 104609885543Smrg test x"${LIBC}" != x && { 104709885543Smrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 104809885543Smrg exit 104909885543Smrg } 105009885543Smrg test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } 105109885543Smrg ;; 105209885543Smrg i*86:DYNIX/ptx:4*:*) 105309885543Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 105409885543Smrg # earlier versions are messed up and put the nodename in both 105509885543Smrg # sysname and nodename. 105609885543Smrg echo i386-sequent-sysv4 105709885543Smrg exit ;; 105809885543Smrg i*86:UNIX_SV:4.2MP:2.*) 105909885543Smrg # Unixware is an offshoot of SVR4, but it has its own version 106009885543Smrg # number series starting with 2... 106109885543Smrg # I am not positive that other SVR4 systems won't match this, 106209885543Smrg # I just have to hope. -- rms. 106309885543Smrg # Use sysv4.2uw... so that sysv4* matches it. 106409885543Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 106509885543Smrg exit ;; 106609885543Smrg i*86:OS/2:*:*) 106709885543Smrg # If we were able to find `uname', then EMX Unix compatibility 106809885543Smrg # is probably installed. 106909885543Smrg echo ${UNAME_MACHINE}-pc-os2-emx 107009885543Smrg exit ;; 107109885543Smrg i*86:XTS-300:*:STOP) 107209885543Smrg echo ${UNAME_MACHINE}-unknown-stop 107309885543Smrg exit ;; 107409885543Smrg i*86:atheos:*:*) 107509885543Smrg echo ${UNAME_MACHINE}-unknown-atheos 107609885543Smrg exit ;; 107709885543Smrg i*86:syllable:*:*) 107809885543Smrg echo ${UNAME_MACHINE}-pc-syllable 107909885543Smrg exit ;; 108009885543Smrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) 108109885543Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 108209885543Smrg exit ;; 108309885543Smrg i*86:*DOS:*:*) 108409885543Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 108509885543Smrg exit ;; 108609885543Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 108709885543Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 108809885543Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 108909885543Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 109009885543Smrg else 109109885543Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 109209885543Smrg fi 109309885543Smrg exit ;; 109409885543Smrg i*86:*:5:[678]*) 109509885543Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 109609885543Smrg case `/bin/uname -X | grep "^Machine"` in 109709885543Smrg *486*) UNAME_MACHINE=i486 ;; 109809885543Smrg *Pentium) UNAME_MACHINE=i586 ;; 109909885543Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 110009885543Smrg esac 110109885543Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 110209885543Smrg exit ;; 110309885543Smrg i*86:*:3.2:*) 110409885543Smrg if test -f /usr/options/cb.name; then 110509885543Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 110609885543Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 110709885543Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 110809885543Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 110909885543Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 111009885543Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 111109885543Smrg && UNAME_MACHINE=i586 111209885543Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 111309885543Smrg && UNAME_MACHINE=i686 111409885543Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 111509885543Smrg && UNAME_MACHINE=i686 111609885543Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 111709885543Smrg else 111809885543Smrg echo ${UNAME_MACHINE}-pc-sysv32 111909885543Smrg fi 112009885543Smrg exit ;; 112109885543Smrg pc:*:*:*) 112209885543Smrg # Left here for compatibility: 112309885543Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 112409885543Smrg # the processor, so we play safe by assuming i386. 112509885543Smrg echo i386-pc-msdosdjgpp 112609885543Smrg exit ;; 112709885543Smrg Intel:Mach:3*:*) 112809885543Smrg echo i386-pc-mach3 112909885543Smrg exit ;; 113009885543Smrg paragon:*:*:*) 113109885543Smrg echo i860-intel-osf1 113209885543Smrg exit ;; 113309885543Smrg i860:*:4.*:*) # i860-SVR4 113409885543Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 113509885543Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 113609885543Smrg else # Add other i860-SVR4 vendors below as they are discovered. 113709885543Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 113809885543Smrg fi 113909885543Smrg exit ;; 114009885543Smrg mini*:CTIX:SYS*5:*) 114109885543Smrg # "miniframe" 114209885543Smrg echo m68010-convergent-sysv 114309885543Smrg exit ;; 114409885543Smrg mc68k:UNIX:SYSTEM5:3.51m) 114509885543Smrg echo m68k-convergent-sysv 114609885543Smrg exit ;; 114709885543Smrg M680?0:D-NIX:5.3:*) 114809885543Smrg echo m68k-diab-dnix 114909885543Smrg exit ;; 115009885543Smrg M68*:*:R3V[5678]*:*) 115109885543Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 115209885543Smrg 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) 115309885543Smrg OS_REL='' 115409885543Smrg test -r /etc/.relid \ 115509885543Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 115609885543Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 115709885543Smrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 115809885543Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 115909885543Smrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 116009885543Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 116109885543Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 116209885543Smrg && { echo i486-ncr-sysv4; exit; } ;; 116309885543Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 116409885543Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 116509885543Smrg exit ;; 116609885543Smrg mc68030:UNIX_System_V:4.*:*) 116709885543Smrg echo m68k-atari-sysv4 116809885543Smrg exit ;; 116909885543Smrg TSUNAMI:LynxOS:2.*:*) 117009885543Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 117109885543Smrg exit ;; 117209885543Smrg rs6000:LynxOS:2.*:*) 117309885543Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 117409885543Smrg exit ;; 117509885543Smrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) 117609885543Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 117709885543Smrg exit ;; 117809885543Smrg SM[BE]S:UNIX_SV:*:*) 117909885543Smrg echo mips-dde-sysv${UNAME_RELEASE} 118009885543Smrg exit ;; 118109885543Smrg RM*:ReliantUNIX-*:*:*) 118209885543Smrg echo mips-sni-sysv4 118309885543Smrg exit ;; 118409885543Smrg RM*:SINIX-*:*:*) 118509885543Smrg echo mips-sni-sysv4 118609885543Smrg exit ;; 118709885543Smrg *:SINIX-*:*:*) 118809885543Smrg if uname -p 2>/dev/null >/dev/null ; then 118909885543Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 119009885543Smrg echo ${UNAME_MACHINE}-sni-sysv4 119109885543Smrg else 119209885543Smrg echo ns32k-sni-sysv 119309885543Smrg fi 119409885543Smrg exit ;; 119509885543Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 119609885543Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 119709885543Smrg echo i586-unisys-sysv4 119809885543Smrg exit ;; 119909885543Smrg *:UNIX_System_V:4*:FTX*) 120009885543Smrg # From Gerald Hewes <hewes@openmarket.com>. 120109885543Smrg # How about differentiating between stratus architectures? -djm 120209885543Smrg echo hppa1.1-stratus-sysv4 120309885543Smrg exit ;; 120409885543Smrg *:*:*:FTX*) 120509885543Smrg # From seanf@swdc.stratus.com. 120609885543Smrg echo i860-stratus-sysv4 120709885543Smrg exit ;; 120809885543Smrg i*86:VOS:*:*) 120909885543Smrg # From Paul.Green@stratus.com. 121009885543Smrg echo ${UNAME_MACHINE}-stratus-vos 121109885543Smrg exit ;; 121209885543Smrg *:VOS:*:*) 121309885543Smrg # From Paul.Green@stratus.com. 121409885543Smrg echo hppa1.1-stratus-vos 121509885543Smrg exit ;; 121609885543Smrg mc68*:A/UX:*:*) 121709885543Smrg echo m68k-apple-aux${UNAME_RELEASE} 121809885543Smrg exit ;; 121909885543Smrg news*:NEWS-OS:6*:*) 122009885543Smrg echo mips-sony-newsos6 122109885543Smrg exit ;; 122209885543Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 122309885543Smrg if [ -d /usr/nec ]; then 122409885543Smrg echo mips-nec-sysv${UNAME_RELEASE} 122509885543Smrg else 122609885543Smrg echo mips-unknown-sysv${UNAME_RELEASE} 122709885543Smrg fi 122809885543Smrg exit ;; 122909885543Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 123009885543Smrg echo powerpc-be-beos 123109885543Smrg exit ;; 123209885543Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 123309885543Smrg echo powerpc-apple-beos 123409885543Smrg exit ;; 123509885543Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 123609885543Smrg echo i586-pc-beos 123709885543Smrg exit ;; 123809885543Smrg SX-4:SUPER-UX:*:*) 123909885543Smrg echo sx4-nec-superux${UNAME_RELEASE} 124009885543Smrg exit ;; 124109885543Smrg SX-5:SUPER-UX:*:*) 124209885543Smrg echo sx5-nec-superux${UNAME_RELEASE} 124309885543Smrg exit ;; 124409885543Smrg SX-6:SUPER-UX:*:*) 124509885543Smrg echo sx6-nec-superux${UNAME_RELEASE} 124609885543Smrg exit ;; 12477104f784Smrg SX-7:SUPER-UX:*:*) 12487104f784Smrg echo sx7-nec-superux${UNAME_RELEASE} 12497104f784Smrg exit ;; 12507104f784Smrg SX-8:SUPER-UX:*:*) 12517104f784Smrg echo sx8-nec-superux${UNAME_RELEASE} 12527104f784Smrg exit ;; 12537104f784Smrg SX-8R:SUPER-UX:*:*) 12547104f784Smrg echo sx8r-nec-superux${UNAME_RELEASE} 12557104f784Smrg exit ;; 125609885543Smrg Power*:Rhapsody:*:*) 125709885543Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 125809885543Smrg exit ;; 125909885543Smrg *:Rhapsody:*:*) 126009885543Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 126109885543Smrg exit ;; 126209885543Smrg *:Darwin:*:*) 126309885543Smrg UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 126409885543Smrg case $UNAME_PROCESSOR in 126509885543Smrg unknown) UNAME_PROCESSOR=powerpc ;; 126609885543Smrg esac 126709885543Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 126809885543Smrg exit ;; 126909885543Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 127009885543Smrg UNAME_PROCESSOR=`uname -p` 127109885543Smrg if test "$UNAME_PROCESSOR" = "x86"; then 127209885543Smrg UNAME_PROCESSOR=i386 127309885543Smrg UNAME_MACHINE=pc 127409885543Smrg fi 127509885543Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 127609885543Smrg exit ;; 127709885543Smrg *:QNX:*:4*) 127809885543Smrg echo i386-pc-qnx 127909885543Smrg exit ;; 128009885543Smrg NSE-?:NONSTOP_KERNEL:*:*) 128109885543Smrg echo nse-tandem-nsk${UNAME_RELEASE} 128209885543Smrg exit ;; 128309885543Smrg NSR-?:NONSTOP_KERNEL:*:*) 128409885543Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 128509885543Smrg exit ;; 128609885543Smrg *:NonStop-UX:*:*) 128709885543Smrg echo mips-compaq-nonstopux 128809885543Smrg exit ;; 128909885543Smrg BS2000:POSIX*:*:*) 129009885543Smrg echo bs2000-siemens-sysv 129109885543Smrg exit ;; 129209885543Smrg DS/*:UNIX_System_V:*:*) 129309885543Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 129409885543Smrg exit ;; 129509885543Smrg *:Plan9:*:*) 129609885543Smrg # "uname -m" is not consistent, so use $cputype instead. 386 129709885543Smrg # is converted to i386 for consistency with other x86 129809885543Smrg # operating systems. 129909885543Smrg if test "$cputype" = "386"; then 130009885543Smrg UNAME_MACHINE=i386 130109885543Smrg else 130209885543Smrg UNAME_MACHINE="$cputype" 130309885543Smrg fi 130409885543Smrg echo ${UNAME_MACHINE}-unknown-plan9 130509885543Smrg exit ;; 130609885543Smrg *:TOPS-10:*:*) 130709885543Smrg echo pdp10-unknown-tops10 130809885543Smrg exit ;; 130909885543Smrg *:TENEX:*:*) 131009885543Smrg echo pdp10-unknown-tenex 131109885543Smrg exit ;; 131209885543Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 131309885543Smrg echo pdp10-dec-tops20 131409885543Smrg exit ;; 131509885543Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 131609885543Smrg echo pdp10-xkl-tops20 131709885543Smrg exit ;; 131809885543Smrg *:TOPS-20:*:*) 131909885543Smrg echo pdp10-unknown-tops20 132009885543Smrg exit ;; 132109885543Smrg *:ITS:*:*) 132209885543Smrg echo pdp10-unknown-its 132309885543Smrg exit ;; 132409885543Smrg SEI:*:*:SEIUX) 132509885543Smrg echo mips-sei-seiux${UNAME_RELEASE} 132609885543Smrg exit ;; 132709885543Smrg *:DragonFly:*:*) 132809885543Smrg echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 132909885543Smrg exit ;; 133009885543Smrg *:*VMS:*:*) 133109885543Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 133209885543Smrg case "${UNAME_MACHINE}" in 133309885543Smrg A*) echo alpha-dec-vms ; exit ;; 133409885543Smrg I*) echo ia64-dec-vms ; exit ;; 133509885543Smrg V*) echo vax-dec-vms ; exit ;; 133609885543Smrg esac ;; 133709885543Smrg *:XENIX:*:SysV) 133809885543Smrg echo i386-pc-xenix 133909885543Smrg exit ;; 134009885543Smrg i*86:skyos:*:*) 134109885543Smrg echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 134209885543Smrg exit ;; 134309885543Smrg i*86:rdos:*:*) 134409885543Smrg echo ${UNAME_MACHINE}-pc-rdos 134509885543Smrg exit ;; 134609885543Smrgesac 134709885543Smrg 134809885543Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 134909885543Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 135009885543Smrg 135109885543Smrgeval $set_cc_for_build 135209885543Smrgcat >$dummy.c <<EOF 135309885543Smrg#ifdef _SEQUENT_ 135409885543Smrg# include <sys/types.h> 135509885543Smrg# include <sys/utsname.h> 135609885543Smrg#endif 135709885543Smrgmain () 135809885543Smrg{ 135909885543Smrg#if defined (sony) 136009885543Smrg#if defined (MIPSEB) 136109885543Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 136209885543Smrg I don't know.... */ 136309885543Smrg printf ("mips-sony-bsd\n"); exit (0); 136409885543Smrg#else 136509885543Smrg#include <sys/param.h> 136609885543Smrg printf ("m68k-sony-newsos%s\n", 136709885543Smrg#ifdef NEWSOS4 136809885543Smrg "4" 136909885543Smrg#else 137009885543Smrg "" 137109885543Smrg#endif 137209885543Smrg ); exit (0); 137309885543Smrg#endif 137409885543Smrg#endif 137509885543Smrg 137609885543Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 137709885543Smrg printf ("arm-acorn-riscix\n"); exit (0); 137809885543Smrg#endif 137909885543Smrg 138009885543Smrg#if defined (hp300) && !defined (hpux) 138109885543Smrg printf ("m68k-hp-bsd\n"); exit (0); 138209885543Smrg#endif 138309885543Smrg 138409885543Smrg#if defined (NeXT) 138509885543Smrg#if !defined (__ARCHITECTURE__) 138609885543Smrg#define __ARCHITECTURE__ "m68k" 138709885543Smrg#endif 138809885543Smrg int version; 138909885543Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 139009885543Smrg if (version < 4) 139109885543Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 139209885543Smrg else 139309885543Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 139409885543Smrg exit (0); 139509885543Smrg#endif 139609885543Smrg 139709885543Smrg#if defined (MULTIMAX) || defined (n16) 139809885543Smrg#if defined (UMAXV) 139909885543Smrg printf ("ns32k-encore-sysv\n"); exit (0); 140009885543Smrg#else 140109885543Smrg#if defined (CMU) 140209885543Smrg printf ("ns32k-encore-mach\n"); exit (0); 140309885543Smrg#else 140409885543Smrg printf ("ns32k-encore-bsd\n"); exit (0); 140509885543Smrg#endif 140609885543Smrg#endif 140709885543Smrg#endif 140809885543Smrg 140909885543Smrg#if defined (__386BSD__) 141009885543Smrg printf ("i386-pc-bsd\n"); exit (0); 141109885543Smrg#endif 141209885543Smrg 141309885543Smrg#if defined (sequent) 141409885543Smrg#if defined (i386) 141509885543Smrg printf ("i386-sequent-dynix\n"); exit (0); 141609885543Smrg#endif 141709885543Smrg#if defined (ns32000) 141809885543Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 141909885543Smrg#endif 142009885543Smrg#endif 142109885543Smrg 142209885543Smrg#if defined (_SEQUENT_) 142309885543Smrg struct utsname un; 142409885543Smrg 142509885543Smrg uname(&un); 142609885543Smrg 142709885543Smrg if (strncmp(un.version, "V2", 2) == 0) { 142809885543Smrg printf ("i386-sequent-ptx2\n"); exit (0); 142909885543Smrg } 143009885543Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 143109885543Smrg printf ("i386-sequent-ptx1\n"); exit (0); 143209885543Smrg } 143309885543Smrg printf ("i386-sequent-ptx\n"); exit (0); 143409885543Smrg 143509885543Smrg#endif 143609885543Smrg 143709885543Smrg#if defined (vax) 143809885543Smrg# if !defined (ultrix) 143909885543Smrg# include <sys/param.h> 144009885543Smrg# if defined (BSD) 144109885543Smrg# if BSD == 43 144209885543Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 144309885543Smrg# else 144409885543Smrg# if BSD == 199006 144509885543Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 144609885543Smrg# else 144709885543Smrg printf ("vax-dec-bsd\n"); exit (0); 144809885543Smrg# endif 144909885543Smrg# endif 145009885543Smrg# else 145109885543Smrg printf ("vax-dec-bsd\n"); exit (0); 145209885543Smrg# endif 145309885543Smrg# else 145409885543Smrg printf ("vax-dec-ultrix\n"); exit (0); 145509885543Smrg# endif 145609885543Smrg#endif 145709885543Smrg 145809885543Smrg#if defined (alliant) && defined (i860) 145909885543Smrg printf ("i860-alliant-bsd\n"); exit (0); 146009885543Smrg#endif 146109885543Smrg 146209885543Smrg exit (1); 146309885543Smrg} 146409885543SmrgEOF 146509885543Smrg 146609885543Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 146709885543Smrg { echo "$SYSTEM_NAME"; exit; } 146809885543Smrg 146909885543Smrg# Apollos put the system type in the environment. 147009885543Smrg 147109885543Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 147209885543Smrg 147309885543Smrg# Convex versions that predate uname can use getsysinfo(1) 147409885543Smrg 147509885543Smrgif [ -x /usr/convex/getsysinfo ] 147609885543Smrgthen 147709885543Smrg case `getsysinfo -f cpu_type` in 147809885543Smrg c1*) 147909885543Smrg echo c1-convex-bsd 148009885543Smrg exit ;; 148109885543Smrg c2*) 148209885543Smrg if getsysinfo -f scalar_acc 148309885543Smrg then echo c32-convex-bsd 148409885543Smrg else echo c2-convex-bsd 148509885543Smrg fi 148609885543Smrg exit ;; 148709885543Smrg c34*) 148809885543Smrg echo c34-convex-bsd 148909885543Smrg exit ;; 149009885543Smrg c38*) 149109885543Smrg echo c38-convex-bsd 149209885543Smrg exit ;; 149309885543Smrg c4*) 149409885543Smrg echo c4-convex-bsd 149509885543Smrg exit ;; 149609885543Smrg esac 149709885543Smrgfi 149809885543Smrg 149909885543Smrgcat >&2 <<EOF 150009885543Smrg$0: unable to guess system type 150109885543Smrg 150209885543SmrgThis script, last modified $timestamp, has failed to recognize 150309885543Smrgthe operating system you are using. It is advised that you 150409885543Smrgdownload the most up to date version of the config scripts from 150509885543Smrg 15067104f784Smrg http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 150709885543Smrgand 15087104f784Smrg http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 150909885543Smrg 151009885543SmrgIf the version you run ($0) is already up to date, please 151109885543Smrgsend the following data and any information you think might be 151209885543Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 151309885543Smrginformation to handle your system. 151409885543Smrg 151509885543Smrgconfig.guess timestamp = $timestamp 151609885543Smrg 151709885543Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 151809885543Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 151909885543Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 152009885543Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 152109885543Smrg 152209885543Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 152309885543Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 152409885543Smrg 152509885543Smrghostinfo = `(hostinfo) 2>/dev/null` 152609885543Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 152709885543Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 152809885543Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 152909885543Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 153009885543Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 153109885543Smrg 153209885543SmrgUNAME_MACHINE = ${UNAME_MACHINE} 153309885543SmrgUNAME_RELEASE = ${UNAME_RELEASE} 153409885543SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 153509885543SmrgUNAME_VERSION = ${UNAME_VERSION} 153609885543SmrgEOF 153709885543Smrg 153809885543Smrgexit 1 153909885543Smrg 154009885543Smrg# Local variables: 154109885543Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 154209885543Smrg# time-stamp-start: "timestamp='" 154309885543Smrg# time-stamp-format: "%:y-%02m-%02d" 154409885543Smrg# time-stamp-end: "'" 154509885543Smrg# End: 1546