config.guess revision e4f6584c
109885543Smrg#! /bin/sh 209885543Smrg# Attempt to guess a canonical system name. 309885543Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 4e4f6584cSmrg# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 57104f784Smrg# Free Software Foundation, Inc. 609885543Smrg 7e4f6584cSmrgtimestamp='2009-11-20' 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 30e4f6584cSmrg# Originally written by Per Bothner. Please send patches (context 31e4f6584cSmrg# diff format) to <config-patches@gnu.org> and include a ChangeLog 32e4f6584cSmrg# 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# 38e4f6584cSmrg# You can get the latest version of this script from: 39e4f6584cSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 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 14209885543Smrg# Note: order is significant - the case branches are not exclusive. 14309885543Smrg 14409885543Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 14509885543Smrg *:NetBSD:*:*) 14609885543Smrg # NetBSD (nbsd) targets should (where applicable) match one or 14709885543Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 14809885543Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 14909885543Smrg # switched to ELF, *-*-netbsd* would select the old 15009885543Smrg # object file format. This provides both forward 15109885543Smrg # compatibility and a consistent mechanism for selecting the 15209885543Smrg # object file format. 15309885543Smrg # 15409885543Smrg # Note: NetBSD doesn't particularly care about the vendor 15509885543Smrg # portion of the name. We always set it to "unknown". 15609885543Smrg sysctl="sysctl -n hw.machine_arch" 15709885543Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 15809885543Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 15909885543Smrg case "${UNAME_MACHINE_ARCH}" in 16009885543Smrg armeb) machine=armeb-unknown ;; 16109885543Smrg arm*) machine=arm-unknown ;; 16209885543Smrg sh3el) machine=shl-unknown ;; 16309885543Smrg sh3eb) machine=sh-unknown ;; 1647104f784Smrg sh5el) machine=sh5le-unknown ;; 16509885543Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 16609885543Smrg esac 16709885543Smrg # The Operating System including object format, if it has switched 16809885543Smrg # to ELF recently, or will in the future. 16909885543Smrg case "${UNAME_MACHINE_ARCH}" in 17009885543Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 17109885543Smrg eval $set_cc_for_build 17209885543Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 173e4f6584cSmrg | grep -q __ELF__ 17409885543Smrg then 17509885543Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 17609885543Smrg # Return netbsd for either. FIX? 17709885543Smrg os=netbsd 17809885543Smrg else 17909885543Smrg os=netbsdelf 18009885543Smrg fi 18109885543Smrg ;; 18209885543Smrg *) 18309885543Smrg os=netbsd 18409885543Smrg ;; 18509885543Smrg esac 18609885543Smrg # The OS release 18709885543Smrg # Debian GNU/NetBSD machines have a different userland, and 18809885543Smrg # thus, need a distinct triplet. However, they do not need 18909885543Smrg # kernel version information, so it can be replaced with a 19009885543Smrg # suitable tag, in the style of linux-gnu. 19109885543Smrg case "${UNAME_VERSION}" in 19209885543Smrg Debian*) 19309885543Smrg release='-gnu' 19409885543Smrg ;; 19509885543Smrg *) 19609885543Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 19709885543Smrg ;; 19809885543Smrg esac 19909885543Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 20009885543Smrg # contains redundant information, the shorter form: 20109885543Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 20209885543Smrg echo "${machine}-${os}${release}" 20309885543Smrg exit ;; 20409885543Smrg *:OpenBSD:*:*) 20509885543Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 20609885543Smrg echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 20709885543Smrg exit ;; 20809885543Smrg *:ekkoBSD:*:*) 20909885543Smrg echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 21009885543Smrg exit ;; 21109885543Smrg *:SolidBSD:*:*) 21209885543Smrg echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 21309885543Smrg exit ;; 21409885543Smrg macppc:MirBSD:*:*) 21509885543Smrg echo powerpc-unknown-mirbsd${UNAME_RELEASE} 21609885543Smrg exit ;; 21709885543Smrg *:MirBSD:*:*) 21809885543Smrg echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 21909885543Smrg exit ;; 22009885543Smrg alpha:OSF1:*:*) 22109885543Smrg case $UNAME_RELEASE in 22209885543Smrg *4.0) 22309885543Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 22409885543Smrg ;; 22509885543Smrg *5.*) 22609885543Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 22709885543Smrg ;; 22809885543Smrg esac 22909885543Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 23009885543Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 23109885543Smrg # covers most systems running today. This code pipes the CPU 23209885543Smrg # types through head -n 1, so we only detect the type of CPU 0. 23309885543Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 23409885543Smrg case "$ALPHA_CPU_TYPE" in 23509885543Smrg "EV4 (21064)") 23609885543Smrg UNAME_MACHINE="alpha" ;; 23709885543Smrg "EV4.5 (21064)") 23809885543Smrg UNAME_MACHINE="alpha" ;; 23909885543Smrg "LCA4 (21066/21068)") 24009885543Smrg UNAME_MACHINE="alpha" ;; 24109885543Smrg "EV5 (21164)") 24209885543Smrg UNAME_MACHINE="alphaev5" ;; 24309885543Smrg "EV5.6 (21164A)") 24409885543Smrg UNAME_MACHINE="alphaev56" ;; 24509885543Smrg "EV5.6 (21164PC)") 24609885543Smrg UNAME_MACHINE="alphapca56" ;; 24709885543Smrg "EV5.7 (21164PC)") 24809885543Smrg UNAME_MACHINE="alphapca57" ;; 24909885543Smrg "EV6 (21264)") 25009885543Smrg UNAME_MACHINE="alphaev6" ;; 25109885543Smrg "EV6.7 (21264A)") 25209885543Smrg UNAME_MACHINE="alphaev67" ;; 25309885543Smrg "EV6.8CB (21264C)") 25409885543Smrg UNAME_MACHINE="alphaev68" ;; 25509885543Smrg "EV6.8AL (21264B)") 25609885543Smrg UNAME_MACHINE="alphaev68" ;; 25709885543Smrg "EV6.8CX (21264D)") 25809885543Smrg UNAME_MACHINE="alphaev68" ;; 25909885543Smrg "EV6.9A (21264/EV69A)") 26009885543Smrg UNAME_MACHINE="alphaev69" ;; 26109885543Smrg "EV7 (21364)") 26209885543Smrg UNAME_MACHINE="alphaev7" ;; 26309885543Smrg "EV7.9 (21364A)") 26409885543Smrg UNAME_MACHINE="alphaev79" ;; 26509885543Smrg esac 26609885543Smrg # A Pn.n version is a patched version. 26709885543Smrg # A Vn.n version is a released version. 26809885543Smrg # A Tn.n version is a released field test version. 26909885543Smrg # A Xn.n version is an unreleased experimental baselevel. 27009885543Smrg # 1.2 uses "1.2" for uname -r. 27109885543Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 27209885543Smrg exit ;; 27309885543Smrg Alpha\ *:Windows_NT*:*) 27409885543Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 27509885543Smrg # Should we change UNAME_MACHINE based on the output of uname instead 27609885543Smrg # of the specific Alpha model? 27709885543Smrg echo alpha-pc-interix 27809885543Smrg exit ;; 27909885543Smrg 21064:Windows_NT:50:3) 28009885543Smrg echo alpha-dec-winnt3.5 28109885543Smrg exit ;; 28209885543Smrg Amiga*:UNIX_System_V:4.0:*) 28309885543Smrg echo m68k-unknown-sysv4 28409885543Smrg exit ;; 28509885543Smrg *:[Aa]miga[Oo][Ss]:*:*) 28609885543Smrg echo ${UNAME_MACHINE}-unknown-amigaos 28709885543Smrg exit ;; 28809885543Smrg *:[Mm]orph[Oo][Ss]:*:*) 28909885543Smrg echo ${UNAME_MACHINE}-unknown-morphos 29009885543Smrg exit ;; 29109885543Smrg *:OS/390:*:*) 29209885543Smrg echo i370-ibm-openedition 29309885543Smrg exit ;; 29409885543Smrg *:z/VM:*:*) 29509885543Smrg echo s390-ibm-zvmoe 29609885543Smrg exit ;; 29709885543Smrg *:OS400:*:*) 29809885543Smrg echo powerpc-ibm-os400 29909885543Smrg exit ;; 30009885543Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 30109885543Smrg echo arm-acorn-riscix${UNAME_RELEASE} 30209885543Smrg exit ;; 30309885543Smrg arm:riscos:*:*|arm:RISCOS:*:*) 30409885543Smrg echo arm-unknown-riscos 30509885543Smrg exit ;; 30609885543Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 30709885543Smrg echo hppa1.1-hitachi-hiuxmpp 30809885543Smrg exit ;; 30909885543Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 31009885543Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 31109885543Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 31209885543Smrg echo pyramid-pyramid-sysv3 31309885543Smrg else 31409885543Smrg echo pyramid-pyramid-bsd 31509885543Smrg fi 31609885543Smrg exit ;; 31709885543Smrg NILE*:*:*:dcosx) 31809885543Smrg echo pyramid-pyramid-svr4 31909885543Smrg exit ;; 32009885543Smrg DRS?6000:unix:4.0:6*) 32109885543Smrg echo sparc-icl-nx6 32209885543Smrg exit ;; 32309885543Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 32409885543Smrg case `/usr/bin/uname -p` in 32509885543Smrg sparc) echo sparc-icl-nx7; exit ;; 32609885543Smrg esac ;; 327e4f6584cSmrg s390x:SunOS:*:*) 328e4f6584cSmrg echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 329e4f6584cSmrg exit ;; 33009885543Smrg sun4H:SunOS:5.*:*) 33109885543Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33209885543Smrg exit ;; 33309885543Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 33409885543Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 33509885543Smrg exit ;; 336e4f6584cSmrg i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 337e4f6584cSmrg echo i386-pc-auroraux${UNAME_RELEASE} 338e4f6584cSmrg exit ;; 3397104f784Smrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 340e4f6584cSmrg eval $set_cc_for_build 341e4f6584cSmrg SUN_ARCH="i386" 342e4f6584cSmrg # If there is a compiler, see if it is configured for 64-bit objects. 343e4f6584cSmrg # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 344e4f6584cSmrg # This test works for both compilers. 345e4f6584cSmrg if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 346e4f6584cSmrg if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 347e4f6584cSmrg (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 348e4f6584cSmrg grep IS_64BIT_ARCH >/dev/null 349e4f6584cSmrg then 350e4f6584cSmrg SUN_ARCH="x86_64" 351e4f6584cSmrg fi 352e4f6584cSmrg fi 353e4f6584cSmrg echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 35409885543Smrg exit ;; 35509885543Smrg sun4*:SunOS:6*:*) 35609885543Smrg # According to config.sub, this is the proper way to canonicalize 35709885543Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 35809885543Smrg # it's likely to be more like Solaris than SunOS4. 35909885543Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 36009885543Smrg exit ;; 36109885543Smrg sun4*:SunOS:*:*) 36209885543Smrg case "`/usr/bin/arch -k`" in 36309885543Smrg Series*|S4*) 36409885543Smrg UNAME_RELEASE=`uname -v` 36509885543Smrg ;; 36609885543Smrg esac 36709885543Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 36809885543Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 36909885543Smrg exit ;; 37009885543Smrg sun3*:SunOS:*:*) 37109885543Smrg echo m68k-sun-sunos${UNAME_RELEASE} 37209885543Smrg exit ;; 37309885543Smrg sun*:*:4.2BSD:*) 37409885543Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 37509885543Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 37609885543Smrg case "`/bin/arch`" in 37709885543Smrg sun3) 37809885543Smrg echo m68k-sun-sunos${UNAME_RELEASE} 37909885543Smrg ;; 38009885543Smrg sun4) 38109885543Smrg echo sparc-sun-sunos${UNAME_RELEASE} 38209885543Smrg ;; 38309885543Smrg esac 38409885543Smrg exit ;; 38509885543Smrg aushp:SunOS:*:*) 38609885543Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 38709885543Smrg exit ;; 38809885543Smrg # The situation for MiNT is a little confusing. The machine name 38909885543Smrg # can be virtually everything (everything which is not 39009885543Smrg # "atarist" or "atariste" at least should have a processor 39109885543Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 39209885543Smrg # to the lowercase version "mint" (or "freemint"). Finally 39309885543Smrg # the system name "TOS" denotes a system which is actually not 39409885543Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 39509885543Smrg # be no problem. 39609885543Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 39709885543Smrg echo m68k-atari-mint${UNAME_RELEASE} 39809885543Smrg exit ;; 39909885543Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 40009885543Smrg echo m68k-atari-mint${UNAME_RELEASE} 40109885543Smrg exit ;; 40209885543Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 40309885543Smrg echo m68k-atari-mint${UNAME_RELEASE} 40409885543Smrg exit ;; 40509885543Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 40609885543Smrg echo m68k-milan-mint${UNAME_RELEASE} 40709885543Smrg exit ;; 40809885543Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 40909885543Smrg echo m68k-hades-mint${UNAME_RELEASE} 41009885543Smrg exit ;; 41109885543Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 41209885543Smrg echo m68k-unknown-mint${UNAME_RELEASE} 41309885543Smrg exit ;; 41409885543Smrg m68k:machten:*:*) 41509885543Smrg echo m68k-apple-machten${UNAME_RELEASE} 41609885543Smrg exit ;; 41709885543Smrg powerpc:machten:*:*) 41809885543Smrg echo powerpc-apple-machten${UNAME_RELEASE} 41909885543Smrg exit ;; 42009885543Smrg RISC*:Mach:*:*) 42109885543Smrg echo mips-dec-mach_bsd4.3 42209885543Smrg exit ;; 42309885543Smrg RISC*:ULTRIX:*:*) 42409885543Smrg echo mips-dec-ultrix${UNAME_RELEASE} 42509885543Smrg exit ;; 42609885543Smrg VAX*:ULTRIX*:*:*) 42709885543Smrg echo vax-dec-ultrix${UNAME_RELEASE} 42809885543Smrg exit ;; 42909885543Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 43009885543Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 43109885543Smrg exit ;; 43209885543Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 43309885543Smrg eval $set_cc_for_build 43409885543Smrg sed 's/^ //' << EOF >$dummy.c 43509885543Smrg#ifdef __cplusplus 43609885543Smrg#include <stdio.h> /* for printf() prototype */ 43709885543Smrg int main (int argc, char *argv[]) { 43809885543Smrg#else 43909885543Smrg int main (argc, argv) int argc; char *argv[]; { 44009885543Smrg#endif 44109885543Smrg #if defined (host_mips) && defined (MIPSEB) 44209885543Smrg #if defined (SYSTYPE_SYSV) 44309885543Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 44409885543Smrg #endif 44509885543Smrg #if defined (SYSTYPE_SVR4) 44609885543Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 44709885543Smrg #endif 44809885543Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 44909885543Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 45009885543Smrg #endif 45109885543Smrg #endif 45209885543Smrg exit (-1); 45309885543Smrg } 45409885543SmrgEOF 45509885543Smrg $CC_FOR_BUILD -o $dummy $dummy.c && 45609885543Smrg dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 45709885543Smrg SYSTEM_NAME=`$dummy $dummyarg` && 45809885543Smrg { echo "$SYSTEM_NAME"; exit; } 45909885543Smrg echo mips-mips-riscos${UNAME_RELEASE} 46009885543Smrg exit ;; 46109885543Smrg Motorola:PowerMAX_OS:*:*) 46209885543Smrg echo powerpc-motorola-powermax 46309885543Smrg exit ;; 46409885543Smrg Motorola:*:4.3:PL8-*) 46509885543Smrg echo powerpc-harris-powermax 46609885543Smrg exit ;; 46709885543Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 46809885543Smrg echo powerpc-harris-powermax 46909885543Smrg exit ;; 47009885543Smrg Night_Hawk:Power_UNIX:*:*) 47109885543Smrg echo powerpc-harris-powerunix 47209885543Smrg exit ;; 47309885543Smrg m88k:CX/UX:7*:*) 47409885543Smrg echo m88k-harris-cxux7 47509885543Smrg exit ;; 47609885543Smrg m88k:*:4*:R4*) 47709885543Smrg echo m88k-motorola-sysv4 47809885543Smrg exit ;; 47909885543Smrg m88k:*:3*:R3*) 48009885543Smrg echo m88k-motorola-sysv3 48109885543Smrg exit ;; 48209885543Smrg AViiON:dgux:*:*) 48309885543Smrg # DG/UX returns AViiON for all architectures 48409885543Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 48509885543Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 48609885543Smrg then 48709885543Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 48809885543Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 48909885543Smrg then 49009885543Smrg echo m88k-dg-dgux${UNAME_RELEASE} 49109885543Smrg else 49209885543Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 49309885543Smrg fi 49409885543Smrg else 49509885543Smrg echo i586-dg-dgux${UNAME_RELEASE} 49609885543Smrg fi 49709885543Smrg exit ;; 49809885543Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 49909885543Smrg echo m88k-dolphin-sysv3 50009885543Smrg exit ;; 50109885543Smrg M88*:*:R3*:*) 50209885543Smrg # Delta 88k system running SVR3 50309885543Smrg echo m88k-motorola-sysv3 50409885543Smrg exit ;; 50509885543Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 50609885543Smrg echo m88k-tektronix-sysv3 50709885543Smrg exit ;; 50809885543Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 50909885543Smrg echo m68k-tektronix-bsd 51009885543Smrg exit ;; 51109885543Smrg *:IRIX*:*:*) 51209885543Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 51309885543Smrg exit ;; 51409885543Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 51509885543Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 51609885543Smrg exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 51709885543Smrg i*86:AIX:*:*) 51809885543Smrg echo i386-ibm-aix 51909885543Smrg exit ;; 52009885543Smrg ia64:AIX:*:*) 52109885543Smrg if [ -x /usr/bin/oslevel ] ; then 52209885543Smrg IBM_REV=`/usr/bin/oslevel` 52309885543Smrg else 52409885543Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 52509885543Smrg fi 52609885543Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 52709885543Smrg exit ;; 52809885543Smrg *:AIX:2:3) 52909885543Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 53009885543Smrg eval $set_cc_for_build 53109885543Smrg sed 's/^ //' << EOF >$dummy.c 53209885543Smrg #include <sys/systemcfg.h> 53309885543Smrg 53409885543Smrg main() 53509885543Smrg { 53609885543Smrg if (!__power_pc()) 53709885543Smrg exit(1); 53809885543Smrg puts("powerpc-ibm-aix3.2.5"); 53909885543Smrg exit(0); 54009885543Smrg } 54109885543SmrgEOF 54209885543Smrg if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 54309885543Smrg then 54409885543Smrg echo "$SYSTEM_NAME" 54509885543Smrg else 54609885543Smrg echo rs6000-ibm-aix3.2.5 54709885543Smrg fi 54809885543Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 54909885543Smrg echo rs6000-ibm-aix3.2.4 55009885543Smrg else 55109885543Smrg echo rs6000-ibm-aix3.2 55209885543Smrg fi 55309885543Smrg exit ;; 5547104f784Smrg *:AIX:*:[456]) 55509885543Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 55609885543Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 55709885543Smrg IBM_ARCH=rs6000 55809885543Smrg else 55909885543Smrg IBM_ARCH=powerpc 56009885543Smrg fi 56109885543Smrg if [ -x /usr/bin/oslevel ] ; then 56209885543Smrg IBM_REV=`/usr/bin/oslevel` 56309885543Smrg else 56409885543Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 56509885543Smrg fi 56609885543Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 56709885543Smrg exit ;; 56809885543Smrg *:AIX:*:*) 56909885543Smrg echo rs6000-ibm-aix 57009885543Smrg exit ;; 57109885543Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 57209885543Smrg echo romp-ibm-bsd4.4 57309885543Smrg exit ;; 57409885543Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 57509885543Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 57609885543Smrg exit ;; # report: romp-ibm BSD 4.3 57709885543Smrg *:BOSX:*:*) 57809885543Smrg echo rs6000-bull-bosx 57909885543Smrg exit ;; 58009885543Smrg DPX/2?00:B.O.S.:*:*) 58109885543Smrg echo m68k-bull-sysv3 58209885543Smrg exit ;; 58309885543Smrg 9000/[34]??:4.3bsd:1.*:*) 58409885543Smrg echo m68k-hp-bsd 58509885543Smrg exit ;; 58609885543Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 58709885543Smrg echo m68k-hp-bsd4.4 58809885543Smrg exit ;; 58909885543Smrg 9000/[34678]??:HP-UX:*:*) 59009885543Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 59109885543Smrg case "${UNAME_MACHINE}" in 59209885543Smrg 9000/31? ) HP_ARCH=m68000 ;; 59309885543Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 59409885543Smrg 9000/[678][0-9][0-9]) 59509885543Smrg if [ -x /usr/bin/getconf ]; then 59609885543Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 59709885543Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 59809885543Smrg case "${sc_cpu_version}" in 59909885543Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 60009885543Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 60109885543Smrg 532) # CPU_PA_RISC2_0 60209885543Smrg case "${sc_kernel_bits}" in 60309885543Smrg 32) HP_ARCH="hppa2.0n" ;; 60409885543Smrg 64) HP_ARCH="hppa2.0w" ;; 60509885543Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 60609885543Smrg esac ;; 60709885543Smrg esac 60809885543Smrg fi 60909885543Smrg if [ "${HP_ARCH}" = "" ]; then 61009885543Smrg eval $set_cc_for_build 61109885543Smrg sed 's/^ //' << EOF >$dummy.c 61209885543Smrg 61309885543Smrg #define _HPUX_SOURCE 61409885543Smrg #include <stdlib.h> 61509885543Smrg #include <unistd.h> 61609885543Smrg 61709885543Smrg int main () 61809885543Smrg { 61909885543Smrg #if defined(_SC_KERNEL_BITS) 62009885543Smrg long bits = sysconf(_SC_KERNEL_BITS); 62109885543Smrg #endif 62209885543Smrg long cpu = sysconf (_SC_CPU_VERSION); 62309885543Smrg 62409885543Smrg switch (cpu) 62509885543Smrg { 62609885543Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 62709885543Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 62809885543Smrg case CPU_PA_RISC2_0: 62909885543Smrg #if defined(_SC_KERNEL_BITS) 63009885543Smrg switch (bits) 63109885543Smrg { 63209885543Smrg case 64: puts ("hppa2.0w"); break; 63309885543Smrg case 32: puts ("hppa2.0n"); break; 63409885543Smrg default: puts ("hppa2.0"); break; 63509885543Smrg } break; 63609885543Smrg #else /* !defined(_SC_KERNEL_BITS) */ 63709885543Smrg puts ("hppa2.0"); break; 63809885543Smrg #endif 63909885543Smrg default: puts ("hppa1.0"); break; 64009885543Smrg } 64109885543Smrg exit (0); 64209885543Smrg } 64309885543SmrgEOF 64409885543Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 64509885543Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 64609885543Smrg fi ;; 64709885543Smrg esac 64809885543Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 64909885543Smrg then 65009885543Smrg eval $set_cc_for_build 65109885543Smrg 65209885543Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 65309885543Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 65409885543Smrg # generating 64-bit code. GNU and HP use different nomenclature: 65509885543Smrg # 65609885543Smrg # $ CC_FOR_BUILD=cc ./config.guess 65709885543Smrg # => hppa2.0w-hp-hpux11.23 65809885543Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 65909885543Smrg # => hppa64-hp-hpux11.23 66009885543Smrg 66109885543Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 662e4f6584cSmrg grep -q __LP64__ 66309885543Smrg then 66409885543Smrg HP_ARCH="hppa2.0w" 66509885543Smrg else 66609885543Smrg HP_ARCH="hppa64" 66709885543Smrg fi 66809885543Smrg fi 66909885543Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 67009885543Smrg exit ;; 67109885543Smrg ia64:HP-UX:*:*) 67209885543Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 67309885543Smrg echo ia64-hp-hpux${HPUX_REV} 67409885543Smrg exit ;; 67509885543Smrg 3050*:HI-UX:*:*) 67609885543Smrg eval $set_cc_for_build 67709885543Smrg sed 's/^ //' << EOF >$dummy.c 67809885543Smrg #include <unistd.h> 67909885543Smrg int 68009885543Smrg main () 68109885543Smrg { 68209885543Smrg long cpu = sysconf (_SC_CPU_VERSION); 68309885543Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 68409885543Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 68509885543Smrg results, however. */ 68609885543Smrg if (CPU_IS_PA_RISC (cpu)) 68709885543Smrg { 68809885543Smrg switch (cpu) 68909885543Smrg { 69009885543Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 69109885543Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 69209885543Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 69309885543Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 69409885543Smrg } 69509885543Smrg } 69609885543Smrg else if (CPU_IS_HP_MC68K (cpu)) 69709885543Smrg puts ("m68k-hitachi-hiuxwe2"); 69809885543Smrg else puts ("unknown-hitachi-hiuxwe2"); 69909885543Smrg exit (0); 70009885543Smrg } 70109885543SmrgEOF 70209885543Smrg $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 70309885543Smrg { echo "$SYSTEM_NAME"; exit; } 70409885543Smrg echo unknown-hitachi-hiuxwe2 70509885543Smrg exit ;; 70609885543Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 70709885543Smrg echo hppa1.1-hp-bsd 70809885543Smrg exit ;; 70909885543Smrg 9000/8??:4.3bsd:*:*) 71009885543Smrg echo hppa1.0-hp-bsd 71109885543Smrg exit ;; 71209885543Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 71309885543Smrg echo hppa1.0-hp-mpeix 71409885543Smrg exit ;; 71509885543Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 71609885543Smrg echo hppa1.1-hp-osf 71709885543Smrg exit ;; 71809885543Smrg hp8??:OSF1:*:*) 71909885543Smrg echo hppa1.0-hp-osf 72009885543Smrg exit ;; 72109885543Smrg i*86:OSF1:*:*) 72209885543Smrg if [ -x /usr/sbin/sysversion ] ; then 72309885543Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 72409885543Smrg else 72509885543Smrg echo ${UNAME_MACHINE}-unknown-osf1 72609885543Smrg fi 72709885543Smrg exit ;; 72809885543Smrg parisc*:Lites*:*:*) 72909885543Smrg echo hppa1.1-hp-lites 73009885543Smrg exit ;; 73109885543Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 73209885543Smrg echo c1-convex-bsd 73309885543Smrg exit ;; 73409885543Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 73509885543Smrg if getsysinfo -f scalar_acc 73609885543Smrg then echo c32-convex-bsd 73709885543Smrg else echo c2-convex-bsd 73809885543Smrg fi 73909885543Smrg exit ;; 74009885543Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 74109885543Smrg echo c34-convex-bsd 74209885543Smrg exit ;; 74309885543Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 74409885543Smrg echo c38-convex-bsd 74509885543Smrg exit ;; 74609885543Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 74709885543Smrg echo c4-convex-bsd 74809885543Smrg exit ;; 74909885543Smrg CRAY*Y-MP:*:*:*) 75009885543Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 75109885543Smrg exit ;; 75209885543Smrg CRAY*[A-Z]90:*:*:*) 75309885543Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 75409885543Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 75509885543Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 75609885543Smrg -e 's/\.[^.]*$/.X/' 75709885543Smrg exit ;; 75809885543Smrg CRAY*TS:*:*:*) 75909885543Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76009885543Smrg exit ;; 76109885543Smrg CRAY*T3E:*:*:*) 76209885543Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76309885543Smrg exit ;; 76409885543Smrg CRAY*SV1:*:*:*) 76509885543Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76609885543Smrg exit ;; 76709885543Smrg *:UNICOS/mp:*:*) 76809885543Smrg echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 76909885543Smrg exit ;; 77009885543Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 77109885543Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 77209885543Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 77309885543Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 77409885543Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 77509885543Smrg exit ;; 77609885543Smrg 5000:UNIX_System_V:4.*:*) 77709885543Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 77809885543Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 77909885543Smrg echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 78009885543Smrg exit ;; 78109885543Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 78209885543Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 78309885543Smrg exit ;; 78409885543Smrg sparc*:BSD/OS:*:*) 78509885543Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 78609885543Smrg exit ;; 78709885543Smrg *:BSD/OS:*:*) 78809885543Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 78909885543Smrg exit ;; 79009885543Smrg *:FreeBSD:*:*) 79109885543Smrg case ${UNAME_MACHINE} in 79209885543Smrg pc98) 79309885543Smrg echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 79409885543Smrg amd64) 79509885543Smrg echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 79609885543Smrg *) 79709885543Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 79809885543Smrg esac 79909885543Smrg exit ;; 80009885543Smrg i*:CYGWIN*:*) 80109885543Smrg echo ${UNAME_MACHINE}-pc-cygwin 80209885543Smrg exit ;; 8037104f784Smrg *:MINGW*:*) 80409885543Smrg echo ${UNAME_MACHINE}-pc-mingw32 80509885543Smrg exit ;; 80609885543Smrg i*:windows32*:*) 80709885543Smrg # uname -m includes "-pc" on this system. 80809885543Smrg echo ${UNAME_MACHINE}-mingw32 80909885543Smrg exit ;; 81009885543Smrg i*:PW*:*) 81109885543Smrg echo ${UNAME_MACHINE}-pc-pw32 81209885543Smrg exit ;; 813e4f6584cSmrg *:Interix*:*) 8147104f784Smrg case ${UNAME_MACHINE} in 8157104f784Smrg x86) 8167104f784Smrg echo i586-pc-interix${UNAME_RELEASE} 8177104f784Smrg exit ;; 818e4f6584cSmrg authenticamd | genuineintel | EM64T) 8197104f784Smrg echo x86_64-unknown-interix${UNAME_RELEASE} 8207104f784Smrg exit ;; 8217104f784Smrg IA64) 8227104f784Smrg echo ia64-unknown-interix${UNAME_RELEASE} 8237104f784Smrg exit ;; 8247104f784Smrg esac ;; 82509885543Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 82609885543Smrg echo i${UNAME_MACHINE}-pc-mks 82709885543Smrg exit ;; 828e4f6584cSmrg 8664:Windows_NT:*) 829e4f6584cSmrg echo x86_64-pc-mks 830e4f6584cSmrg exit ;; 83109885543Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 83209885543Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 83309885543Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 83409885543Smrg # UNAME_MACHINE based on the output of uname instead of i386? 83509885543Smrg echo i586-pc-interix 83609885543Smrg exit ;; 83709885543Smrg i*:UWIN*:*) 83809885543Smrg echo ${UNAME_MACHINE}-pc-uwin 83909885543Smrg exit ;; 84009885543Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 84109885543Smrg echo x86_64-unknown-cygwin 84209885543Smrg exit ;; 84309885543Smrg p*:CYGWIN*:*) 84409885543Smrg echo powerpcle-unknown-cygwin 84509885543Smrg exit ;; 84609885543Smrg prep*:SunOS:5.*:*) 84709885543Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 84809885543Smrg exit ;; 84909885543Smrg *:GNU:*:*) 85009885543Smrg # the GNU system 85109885543Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 85209885543Smrg exit ;; 85309885543Smrg *:GNU/*:*:*) 85409885543Smrg # other systems with GNU libc and userland 85509885543Smrg echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 85609885543Smrg exit ;; 85709885543Smrg i*86:Minix:*:*) 85809885543Smrg echo ${UNAME_MACHINE}-pc-minix 85909885543Smrg exit ;; 860e4f6584cSmrg alpha:Linux:*:*) 861e4f6584cSmrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 862e4f6584cSmrg EV5) UNAME_MACHINE=alphaev5 ;; 863e4f6584cSmrg EV56) UNAME_MACHINE=alphaev56 ;; 864e4f6584cSmrg PCA56) UNAME_MACHINE=alphapca56 ;; 865e4f6584cSmrg PCA57) UNAME_MACHINE=alphapca56 ;; 866e4f6584cSmrg EV6) UNAME_MACHINE=alphaev6 ;; 867e4f6584cSmrg EV67) UNAME_MACHINE=alphaev67 ;; 868e4f6584cSmrg EV68*) UNAME_MACHINE=alphaev68 ;; 869e4f6584cSmrg esac 870e4f6584cSmrg objdump --private-headers /bin/sh | grep -q ld.so.1 871e4f6584cSmrg if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 872e4f6584cSmrg echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 873e4f6584cSmrg exit ;; 87409885543Smrg arm*:Linux:*:*) 8757104f784Smrg eval $set_cc_for_build 8767104f784Smrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 8777104f784Smrg | grep -q __ARM_EABI__ 8787104f784Smrg then 8792ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 8807104f784Smrg else 8812ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnueabi 8827104f784Smrg fi 88309885543Smrg exit ;; 88409885543Smrg avr32*:Linux:*:*) 8852ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 88609885543Smrg exit ;; 88709885543Smrg cris:Linux:*:*) 8882ec8c4b4Smrg echo cris-axis-linux-gnu 88909885543Smrg exit ;; 89009885543Smrg crisv32:Linux:*:*) 8912ec8c4b4Smrg echo crisv32-axis-linux-gnu 89209885543Smrg exit ;; 89309885543Smrg frv:Linux:*:*) 8942ec8c4b4Smrg echo frv-unknown-linux-gnu 89509885543Smrg exit ;; 896e4f6584cSmrg i*86:Linux:*:*) 897e4f6584cSmrg LIBC=gnu 898e4f6584cSmrg eval $set_cc_for_build 899e4f6584cSmrg sed 's/^ //' << EOF >$dummy.c 900e4f6584cSmrg #ifdef __dietlibc__ 901e4f6584cSmrg LIBC=dietlibc 902e4f6584cSmrg #endif 903e4f6584cSmrgEOF 904e4f6584cSmrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 905e4f6584cSmrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 906e4f6584cSmrg exit ;; 90709885543Smrg ia64:Linux:*:*) 9082ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 90909885543Smrg exit ;; 91009885543Smrg m32r*:Linux:*:*) 9112ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 91209885543Smrg exit ;; 91309885543Smrg m68*:Linux:*:*) 9142ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 91509885543Smrg exit ;; 916e4f6584cSmrg mips:Linux:*:* | mips64:Linux:*:*) 91709885543Smrg eval $set_cc_for_build 91809885543Smrg sed 's/^ //' << EOF >$dummy.c 91909885543Smrg #undef CPU 920e4f6584cSmrg #undef ${UNAME_MACHINE} 921e4f6584cSmrg #undef ${UNAME_MACHINE}el 92209885543Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 923e4f6584cSmrg CPU=${UNAME_MACHINE}el 92409885543Smrg #else 92509885543Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 926e4f6584cSmrg CPU=${UNAME_MACHINE} 92709885543Smrg #else 92809885543Smrg CPU= 92909885543Smrg #endif 93009885543Smrg #endif 93109885543SmrgEOF 932e4f6584cSmrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 9332ec8c4b4Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 93409885543Smrg ;; 93509885543Smrg or32:Linux:*:*) 9362ec8c4b4Smrg echo or32-unknown-linux-gnu 93709885543Smrg exit ;; 938e4f6584cSmrg padre:Linux:*:*) 939e4f6584cSmrg echo sparc-unknown-linux-gnu 94009885543Smrg exit ;; 941e4f6584cSmrg parisc64:Linux:*:* | hppa64:Linux:*:*) 942e4f6584cSmrg echo hppa64-unknown-linux-gnu 9432ec8c4b4Smrg exit ;; 94409885543Smrg parisc:Linux:*:* | hppa:Linux:*:*) 94509885543Smrg # Look for CPU level 94609885543Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 9472ec8c4b4Smrg PA7*) echo hppa1.1-unknown-linux-gnu ;; 9482ec8c4b4Smrg PA8*) echo hppa2.0-unknown-linux-gnu ;; 9492ec8c4b4Smrg *) echo hppa-unknown-linux-gnu ;; 95009885543Smrg esac 95109885543Smrg exit ;; 952e4f6584cSmrg ppc64:Linux:*:*) 953e4f6584cSmrg echo powerpc64-unknown-linux-gnu 954e4f6584cSmrg exit ;; 955e4f6584cSmrg ppc:Linux:*:*) 956e4f6584cSmrg echo powerpc-unknown-linux-gnu 95709885543Smrg exit ;; 95809885543Smrg s390:Linux:*:* | s390x:Linux:*:*) 95909885543Smrg echo ${UNAME_MACHINE}-ibm-linux 96009885543Smrg exit ;; 96109885543Smrg sh64*:Linux:*:*) 9622ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 96309885543Smrg exit ;; 96409885543Smrg sh*:Linux:*:*) 9652ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 96609885543Smrg exit ;; 96709885543Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 9682ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 96909885543Smrg exit ;; 97009885543Smrg vax:Linux:*:*) 9712ec8c4b4Smrg echo ${UNAME_MACHINE}-dec-linux-gnu 97209885543Smrg exit ;; 97309885543Smrg x86_64:Linux:*:*) 9742ec8c4b4Smrg echo x86_64-unknown-linux-gnu 9757104f784Smrg exit ;; 9767104f784Smrg xtensa*:Linux:*:*) 9772ec8c4b4Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 97809885543Smrg exit ;; 97909885543Smrg i*86:DYNIX/ptx:4*:*) 98009885543Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 98109885543Smrg # earlier versions are messed up and put the nodename in both 98209885543Smrg # sysname and nodename. 98309885543Smrg echo i386-sequent-sysv4 98409885543Smrg exit ;; 98509885543Smrg i*86:UNIX_SV:4.2MP:2.*) 98609885543Smrg # Unixware is an offshoot of SVR4, but it has its own version 98709885543Smrg # number series starting with 2... 98809885543Smrg # I am not positive that other SVR4 systems won't match this, 98909885543Smrg # I just have to hope. -- rms. 99009885543Smrg # Use sysv4.2uw... so that sysv4* matches it. 99109885543Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 99209885543Smrg exit ;; 99309885543Smrg i*86:OS/2:*:*) 99409885543Smrg # If we were able to find `uname', then EMX Unix compatibility 99509885543Smrg # is probably installed. 99609885543Smrg echo ${UNAME_MACHINE}-pc-os2-emx 99709885543Smrg exit ;; 99809885543Smrg i*86:XTS-300:*:STOP) 99909885543Smrg echo ${UNAME_MACHINE}-unknown-stop 100009885543Smrg exit ;; 100109885543Smrg i*86:atheos:*:*) 100209885543Smrg echo ${UNAME_MACHINE}-unknown-atheos 100309885543Smrg exit ;; 100409885543Smrg i*86:syllable:*:*) 100509885543Smrg echo ${UNAME_MACHINE}-pc-syllable 100609885543Smrg exit ;; 1007e4f6584cSmrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 100809885543Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 100909885543Smrg exit ;; 101009885543Smrg i*86:*DOS:*:*) 101109885543Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 101209885543Smrg exit ;; 101309885543Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 101409885543Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 101509885543Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 101609885543Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 101709885543Smrg else 101809885543Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 101909885543Smrg fi 102009885543Smrg exit ;; 102109885543Smrg i*86:*:5:[678]*) 102209885543Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 102309885543Smrg case `/bin/uname -X | grep "^Machine"` in 102409885543Smrg *486*) UNAME_MACHINE=i486 ;; 102509885543Smrg *Pentium) UNAME_MACHINE=i586 ;; 102609885543Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 102709885543Smrg esac 102809885543Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 102909885543Smrg exit ;; 103009885543Smrg i*86:*:3.2:*) 103109885543Smrg if test -f /usr/options/cb.name; then 103209885543Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 103309885543Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 103409885543Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 103509885543Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 103609885543Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 103709885543Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 103809885543Smrg && UNAME_MACHINE=i586 103909885543Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 104009885543Smrg && UNAME_MACHINE=i686 104109885543Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 104209885543Smrg && UNAME_MACHINE=i686 104309885543Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 104409885543Smrg else 104509885543Smrg echo ${UNAME_MACHINE}-pc-sysv32 104609885543Smrg fi 104709885543Smrg exit ;; 104809885543Smrg pc:*:*:*) 104909885543Smrg # Left here for compatibility: 105009885543Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 1051e4f6584cSmrg # the processor, so we play safe by assuming i586. 1052e4f6584cSmrg # Note: whatever this is, it MUST be the same as what config.sub 1053e4f6584cSmrg # prints for the "djgpp" host, or else GDB configury will decide that 1054e4f6584cSmrg # this is a cross-build. 1055e4f6584cSmrg echo i586-pc-msdosdjgpp 105609885543Smrg exit ;; 105709885543Smrg Intel:Mach:3*:*) 105809885543Smrg echo i386-pc-mach3 105909885543Smrg exit ;; 106009885543Smrg paragon:*:*:*) 106109885543Smrg echo i860-intel-osf1 106209885543Smrg exit ;; 106309885543Smrg i860:*:4.*:*) # i860-SVR4 106409885543Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 106509885543Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 106609885543Smrg else # Add other i860-SVR4 vendors below as they are discovered. 106709885543Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 106809885543Smrg fi 106909885543Smrg exit ;; 107009885543Smrg mini*:CTIX:SYS*5:*) 107109885543Smrg # "miniframe" 107209885543Smrg echo m68010-convergent-sysv 107309885543Smrg exit ;; 107409885543Smrg mc68k:UNIX:SYSTEM5:3.51m) 107509885543Smrg echo m68k-convergent-sysv 107609885543Smrg exit ;; 107709885543Smrg M680?0:D-NIX:5.3:*) 107809885543Smrg echo m68k-diab-dnix 107909885543Smrg exit ;; 108009885543Smrg M68*:*:R3V[5678]*:*) 108109885543Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 108209885543Smrg 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) 108309885543Smrg OS_REL='' 108409885543Smrg test -r /etc/.relid \ 108509885543Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 108609885543Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 108709885543Smrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 108809885543Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 108909885543Smrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 109009885543Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 109109885543Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 109209885543Smrg && { echo i486-ncr-sysv4; exit; } ;; 1093e4f6584cSmrg NCR*:*:4.2:* | MPRAS*:*:4.2:*) 1094e4f6584cSmrg OS_REL='.3' 1095e4f6584cSmrg test -r /etc/.relid \ 1096e4f6584cSmrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 1097e4f6584cSmrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 1098e4f6584cSmrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 1099e4f6584cSmrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 1100e4f6584cSmrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 1101e4f6584cSmrg /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 1102e4f6584cSmrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 110309885543Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 110409885543Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 110509885543Smrg exit ;; 110609885543Smrg mc68030:UNIX_System_V:4.*:*) 110709885543Smrg echo m68k-atari-sysv4 110809885543Smrg exit ;; 110909885543Smrg TSUNAMI:LynxOS:2.*:*) 111009885543Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 111109885543Smrg exit ;; 111209885543Smrg rs6000:LynxOS:2.*:*) 111309885543Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 111409885543Smrg exit ;; 1115e4f6584cSmrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 111609885543Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 111709885543Smrg exit ;; 111809885543Smrg SM[BE]S:UNIX_SV:*:*) 111909885543Smrg echo mips-dde-sysv${UNAME_RELEASE} 112009885543Smrg exit ;; 112109885543Smrg RM*:ReliantUNIX-*:*:*) 112209885543Smrg echo mips-sni-sysv4 112309885543Smrg exit ;; 112409885543Smrg RM*:SINIX-*:*:*) 112509885543Smrg echo mips-sni-sysv4 112609885543Smrg exit ;; 112709885543Smrg *:SINIX-*:*:*) 112809885543Smrg if uname -p 2>/dev/null >/dev/null ; then 112909885543Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 113009885543Smrg echo ${UNAME_MACHINE}-sni-sysv4 113109885543Smrg else 113209885543Smrg echo ns32k-sni-sysv 113309885543Smrg fi 113409885543Smrg exit ;; 113509885543Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 113609885543Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 113709885543Smrg echo i586-unisys-sysv4 113809885543Smrg exit ;; 113909885543Smrg *:UNIX_System_V:4*:FTX*) 114009885543Smrg # From Gerald Hewes <hewes@openmarket.com>. 114109885543Smrg # How about differentiating between stratus architectures? -djm 114209885543Smrg echo hppa1.1-stratus-sysv4 114309885543Smrg exit ;; 114409885543Smrg *:*:*:FTX*) 114509885543Smrg # From seanf@swdc.stratus.com. 114609885543Smrg echo i860-stratus-sysv4 114709885543Smrg exit ;; 114809885543Smrg i*86:VOS:*:*) 114909885543Smrg # From Paul.Green@stratus.com. 115009885543Smrg echo ${UNAME_MACHINE}-stratus-vos 115109885543Smrg exit ;; 115209885543Smrg *:VOS:*:*) 115309885543Smrg # From Paul.Green@stratus.com. 115409885543Smrg echo hppa1.1-stratus-vos 115509885543Smrg exit ;; 115609885543Smrg mc68*:A/UX:*:*) 115709885543Smrg echo m68k-apple-aux${UNAME_RELEASE} 115809885543Smrg exit ;; 115909885543Smrg news*:NEWS-OS:6*:*) 116009885543Smrg echo mips-sony-newsos6 116109885543Smrg exit ;; 116209885543Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 116309885543Smrg if [ -d /usr/nec ]; then 116409885543Smrg echo mips-nec-sysv${UNAME_RELEASE} 116509885543Smrg else 116609885543Smrg echo mips-unknown-sysv${UNAME_RELEASE} 116709885543Smrg fi 116809885543Smrg exit ;; 116909885543Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 117009885543Smrg echo powerpc-be-beos 117109885543Smrg exit ;; 117209885543Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 117309885543Smrg echo powerpc-apple-beos 117409885543Smrg exit ;; 117509885543Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 117609885543Smrg echo i586-pc-beos 117709885543Smrg exit ;; 1178e4f6584cSmrg BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 1179e4f6584cSmrg echo i586-pc-haiku 1180e4f6584cSmrg exit ;; 118109885543Smrg SX-4:SUPER-UX:*:*) 118209885543Smrg echo sx4-nec-superux${UNAME_RELEASE} 118309885543Smrg exit ;; 118409885543Smrg SX-5:SUPER-UX:*:*) 118509885543Smrg echo sx5-nec-superux${UNAME_RELEASE} 118609885543Smrg exit ;; 118709885543Smrg SX-6:SUPER-UX:*:*) 118809885543Smrg echo sx6-nec-superux${UNAME_RELEASE} 118909885543Smrg exit ;; 11907104f784Smrg SX-7:SUPER-UX:*:*) 11917104f784Smrg echo sx7-nec-superux${UNAME_RELEASE} 11927104f784Smrg exit ;; 11937104f784Smrg SX-8:SUPER-UX:*:*) 11947104f784Smrg echo sx8-nec-superux${UNAME_RELEASE} 11957104f784Smrg exit ;; 11967104f784Smrg SX-8R:SUPER-UX:*:*) 11977104f784Smrg echo sx8r-nec-superux${UNAME_RELEASE} 11987104f784Smrg exit ;; 119909885543Smrg Power*:Rhapsody:*:*) 120009885543Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 120109885543Smrg exit ;; 120209885543Smrg *:Rhapsody:*:*) 120309885543Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 120409885543Smrg exit ;; 120509885543Smrg *:Darwin:*:*) 120609885543Smrg UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 120709885543Smrg case $UNAME_PROCESSOR in 1208e4f6584cSmrg i386) 1209e4f6584cSmrg eval $set_cc_for_build 1210e4f6584cSmrg if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 1211e4f6584cSmrg if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 1212e4f6584cSmrg (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 1213e4f6584cSmrg grep IS_64BIT_ARCH >/dev/null 1214e4f6584cSmrg then 1215e4f6584cSmrg UNAME_PROCESSOR="x86_64" 1216e4f6584cSmrg fi 1217e4f6584cSmrg fi ;; 121809885543Smrg unknown) UNAME_PROCESSOR=powerpc ;; 121909885543Smrg esac 122009885543Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 122109885543Smrg exit ;; 122209885543Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 122309885543Smrg UNAME_PROCESSOR=`uname -p` 122409885543Smrg if test "$UNAME_PROCESSOR" = "x86"; then 122509885543Smrg UNAME_PROCESSOR=i386 122609885543Smrg UNAME_MACHINE=pc 122709885543Smrg fi 122809885543Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 122909885543Smrg exit ;; 123009885543Smrg *:QNX:*:4*) 123109885543Smrg echo i386-pc-qnx 123209885543Smrg exit ;; 123309885543Smrg NSE-?:NONSTOP_KERNEL:*:*) 123409885543Smrg echo nse-tandem-nsk${UNAME_RELEASE} 123509885543Smrg exit ;; 123609885543Smrg NSR-?:NONSTOP_KERNEL:*:*) 123709885543Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 123809885543Smrg exit ;; 123909885543Smrg *:NonStop-UX:*:*) 124009885543Smrg echo mips-compaq-nonstopux 124109885543Smrg exit ;; 124209885543Smrg BS2000:POSIX*:*:*) 124309885543Smrg echo bs2000-siemens-sysv 124409885543Smrg exit ;; 124509885543Smrg DS/*:UNIX_System_V:*:*) 124609885543Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 124709885543Smrg exit ;; 124809885543Smrg *:Plan9:*:*) 124909885543Smrg # "uname -m" is not consistent, so use $cputype instead. 386 125009885543Smrg # is converted to i386 for consistency with other x86 125109885543Smrg # operating systems. 125209885543Smrg if test "$cputype" = "386"; then 125309885543Smrg UNAME_MACHINE=i386 125409885543Smrg else 125509885543Smrg UNAME_MACHINE="$cputype" 125609885543Smrg fi 125709885543Smrg echo ${UNAME_MACHINE}-unknown-plan9 125809885543Smrg exit ;; 125909885543Smrg *:TOPS-10:*:*) 126009885543Smrg echo pdp10-unknown-tops10 126109885543Smrg exit ;; 126209885543Smrg *:TENEX:*:*) 126309885543Smrg echo pdp10-unknown-tenex 126409885543Smrg exit ;; 126509885543Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 126609885543Smrg echo pdp10-dec-tops20 126709885543Smrg exit ;; 126809885543Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 126909885543Smrg echo pdp10-xkl-tops20 127009885543Smrg exit ;; 127109885543Smrg *:TOPS-20:*:*) 127209885543Smrg echo pdp10-unknown-tops20 127309885543Smrg exit ;; 127409885543Smrg *:ITS:*:*) 127509885543Smrg echo pdp10-unknown-its 127609885543Smrg exit ;; 127709885543Smrg SEI:*:*:SEIUX) 127809885543Smrg echo mips-sei-seiux${UNAME_RELEASE} 127909885543Smrg exit ;; 128009885543Smrg *:DragonFly:*:*) 128109885543Smrg echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 128209885543Smrg exit ;; 128309885543Smrg *:*VMS:*:*) 128409885543Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 128509885543Smrg case "${UNAME_MACHINE}" in 128609885543Smrg A*) echo alpha-dec-vms ; exit ;; 128709885543Smrg I*) echo ia64-dec-vms ; exit ;; 128809885543Smrg V*) echo vax-dec-vms ; exit ;; 128909885543Smrg esac ;; 129009885543Smrg *:XENIX:*:SysV) 129109885543Smrg echo i386-pc-xenix 129209885543Smrg exit ;; 129309885543Smrg i*86:skyos:*:*) 129409885543Smrg echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 129509885543Smrg exit ;; 129609885543Smrg i*86:rdos:*:*) 129709885543Smrg echo ${UNAME_MACHINE}-pc-rdos 129809885543Smrg exit ;; 1299e4f6584cSmrg i*86:AROS:*:*) 1300e4f6584cSmrg echo ${UNAME_MACHINE}-pc-aros 1301e4f6584cSmrg exit ;; 130209885543Smrgesac 130309885543Smrg 130409885543Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 130509885543Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 130609885543Smrg 130709885543Smrgeval $set_cc_for_build 130809885543Smrgcat >$dummy.c <<EOF 130909885543Smrg#ifdef _SEQUENT_ 131009885543Smrg# include <sys/types.h> 131109885543Smrg# include <sys/utsname.h> 131209885543Smrg#endif 131309885543Smrgmain () 131409885543Smrg{ 131509885543Smrg#if defined (sony) 131609885543Smrg#if defined (MIPSEB) 131709885543Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 131809885543Smrg I don't know.... */ 131909885543Smrg printf ("mips-sony-bsd\n"); exit (0); 132009885543Smrg#else 132109885543Smrg#include <sys/param.h> 132209885543Smrg printf ("m68k-sony-newsos%s\n", 132309885543Smrg#ifdef NEWSOS4 132409885543Smrg "4" 132509885543Smrg#else 132609885543Smrg "" 132709885543Smrg#endif 132809885543Smrg ); exit (0); 132909885543Smrg#endif 133009885543Smrg#endif 133109885543Smrg 133209885543Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 133309885543Smrg printf ("arm-acorn-riscix\n"); exit (0); 133409885543Smrg#endif 133509885543Smrg 133609885543Smrg#if defined (hp300) && !defined (hpux) 133709885543Smrg printf ("m68k-hp-bsd\n"); exit (0); 133809885543Smrg#endif 133909885543Smrg 134009885543Smrg#if defined (NeXT) 134109885543Smrg#if !defined (__ARCHITECTURE__) 134209885543Smrg#define __ARCHITECTURE__ "m68k" 134309885543Smrg#endif 134409885543Smrg int version; 134509885543Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 134609885543Smrg if (version < 4) 134709885543Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 134809885543Smrg else 134909885543Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 135009885543Smrg exit (0); 135109885543Smrg#endif 135209885543Smrg 135309885543Smrg#if defined (MULTIMAX) || defined (n16) 135409885543Smrg#if defined (UMAXV) 135509885543Smrg printf ("ns32k-encore-sysv\n"); exit (0); 135609885543Smrg#else 135709885543Smrg#if defined (CMU) 135809885543Smrg printf ("ns32k-encore-mach\n"); exit (0); 135909885543Smrg#else 136009885543Smrg printf ("ns32k-encore-bsd\n"); exit (0); 136109885543Smrg#endif 136209885543Smrg#endif 136309885543Smrg#endif 136409885543Smrg 136509885543Smrg#if defined (__386BSD__) 136609885543Smrg printf ("i386-pc-bsd\n"); exit (0); 136709885543Smrg#endif 136809885543Smrg 136909885543Smrg#if defined (sequent) 137009885543Smrg#if defined (i386) 137109885543Smrg printf ("i386-sequent-dynix\n"); exit (0); 137209885543Smrg#endif 137309885543Smrg#if defined (ns32000) 137409885543Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 137509885543Smrg#endif 137609885543Smrg#endif 137709885543Smrg 137809885543Smrg#if defined (_SEQUENT_) 137909885543Smrg struct utsname un; 138009885543Smrg 138109885543Smrg uname(&un); 138209885543Smrg 138309885543Smrg if (strncmp(un.version, "V2", 2) == 0) { 138409885543Smrg printf ("i386-sequent-ptx2\n"); exit (0); 138509885543Smrg } 138609885543Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 138709885543Smrg printf ("i386-sequent-ptx1\n"); exit (0); 138809885543Smrg } 138909885543Smrg printf ("i386-sequent-ptx\n"); exit (0); 139009885543Smrg 139109885543Smrg#endif 139209885543Smrg 139309885543Smrg#if defined (vax) 139409885543Smrg# if !defined (ultrix) 139509885543Smrg# include <sys/param.h> 139609885543Smrg# if defined (BSD) 139709885543Smrg# if BSD == 43 139809885543Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 139909885543Smrg# else 140009885543Smrg# if BSD == 199006 140109885543Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 140209885543Smrg# else 140309885543Smrg printf ("vax-dec-bsd\n"); exit (0); 140409885543Smrg# endif 140509885543Smrg# endif 140609885543Smrg# else 140709885543Smrg printf ("vax-dec-bsd\n"); exit (0); 140809885543Smrg# endif 140909885543Smrg# else 141009885543Smrg printf ("vax-dec-ultrix\n"); exit (0); 141109885543Smrg# endif 141209885543Smrg#endif 141309885543Smrg 141409885543Smrg#if defined (alliant) && defined (i860) 141509885543Smrg printf ("i860-alliant-bsd\n"); exit (0); 141609885543Smrg#endif 141709885543Smrg 141809885543Smrg exit (1); 141909885543Smrg} 142009885543SmrgEOF 142109885543Smrg 142209885543Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 142309885543Smrg { echo "$SYSTEM_NAME"; exit; } 142409885543Smrg 142509885543Smrg# Apollos put the system type in the environment. 142609885543Smrg 142709885543Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 142809885543Smrg 142909885543Smrg# Convex versions that predate uname can use getsysinfo(1) 143009885543Smrg 143109885543Smrgif [ -x /usr/convex/getsysinfo ] 143209885543Smrgthen 143309885543Smrg case `getsysinfo -f cpu_type` in 143409885543Smrg c1*) 143509885543Smrg echo c1-convex-bsd 143609885543Smrg exit ;; 143709885543Smrg c2*) 143809885543Smrg if getsysinfo -f scalar_acc 143909885543Smrg then echo c32-convex-bsd 144009885543Smrg else echo c2-convex-bsd 144109885543Smrg fi 144209885543Smrg exit ;; 144309885543Smrg c34*) 144409885543Smrg echo c34-convex-bsd 144509885543Smrg exit ;; 144609885543Smrg c38*) 144709885543Smrg echo c38-convex-bsd 144809885543Smrg exit ;; 144909885543Smrg c4*) 145009885543Smrg echo c4-convex-bsd 145109885543Smrg exit ;; 145209885543Smrg esac 145309885543Smrgfi 145409885543Smrg 145509885543Smrgcat >&2 <<EOF 145609885543Smrg$0: unable to guess system type 145709885543Smrg 145809885543SmrgThis script, last modified $timestamp, has failed to recognize 145909885543Smrgthe operating system you are using. It is advised that you 146009885543Smrgdownload the most up to date version of the config scripts from 146109885543Smrg 14627104f784Smrg http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 146309885543Smrgand 14647104f784Smrg http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 146509885543Smrg 146609885543SmrgIf the version you run ($0) is already up to date, please 146709885543Smrgsend the following data and any information you think might be 146809885543Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 146909885543Smrginformation to handle your system. 147009885543Smrg 147109885543Smrgconfig.guess timestamp = $timestamp 147209885543Smrg 147309885543Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 147409885543Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 147509885543Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 147609885543Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 147709885543Smrg 147809885543Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 147909885543Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 148009885543Smrg 148109885543Smrghostinfo = `(hostinfo) 2>/dev/null` 148209885543Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 148309885543Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 148409885543Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 148509885543Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 148609885543Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 148709885543Smrg 148809885543SmrgUNAME_MACHINE = ${UNAME_MACHINE} 148909885543SmrgUNAME_RELEASE = ${UNAME_RELEASE} 149009885543SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 149109885543SmrgUNAME_VERSION = ${UNAME_VERSION} 149209885543SmrgEOF 149309885543Smrg 149409885543Smrgexit 1 149509885543Smrg 149609885543Smrg# Local variables: 149709885543Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 149809885543Smrg# time-stamp-start: "timestamp='" 149909885543Smrg# time-stamp-format: "%:y-%02m-%02d" 150009885543Smrg# time-stamp-end: "'" 150109885543Smrg# End: 1502