config.guess revision 4cd6a3ae
18c9fbc29Smrg#! /bin/sh 28c9fbc29Smrg# Attempt to guess a canonical system name. 38c9fbc29Smrg# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 44cd6a3aeSmrg# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 54e411241Smrg# Free Software Foundation, Inc. 68c9fbc29Smrg 74cd6a3aeSmrgtimestamp='2010-08-21' 88c9fbc29Smrg 98c9fbc29Smrg# This file is free software; you can redistribute it and/or modify it 108c9fbc29Smrg# under the terms of the GNU General Public License as published by 118c9fbc29Smrg# the Free Software Foundation; either version 2 of the License, or 128c9fbc29Smrg# (at your option) any later version. 138c9fbc29Smrg# 148c9fbc29Smrg# This program is distributed in the hope that it will be useful, but 158c9fbc29Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of 168c9fbc29Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 178c9fbc29Smrg# General Public License for more details. 188c9fbc29Smrg# 198c9fbc29Smrg# You should have received a copy of the GNU General Public License 208c9fbc29Smrg# along with this program; if not, write to the Free Software 218c9fbc29Smrg# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 228c9fbc29Smrg# 02110-1301, USA. 238c9fbc29Smrg# 248c9fbc29Smrg# As a special exception to the GNU General Public License, if you 258c9fbc29Smrg# distribute this file as part of a program that contains a 268c9fbc29Smrg# configuration script generated by Autoconf, you may include it under 278c9fbc29Smrg# the same distribution terms that you use for the rest of that program. 288c9fbc29Smrg 298c9fbc29Smrg 304cd6a3aeSmrg# Originally written by Per Bothner. Please send patches (context 314cd6a3aeSmrg# diff format) to <config-patches@gnu.org> and include a ChangeLog 324cd6a3aeSmrg# entry. 338c9fbc29Smrg# 348c9fbc29Smrg# This script attempts to guess a canonical system name similar to 358c9fbc29Smrg# config.sub. If it succeeds, it prints the system name on stdout, and 368c9fbc29Smrg# exits with 0. Otherwise, it exits with 1. 378c9fbc29Smrg# 384cd6a3aeSmrg# You can get the latest version of this script from: 394cd6a3aeSmrg# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 408c9fbc29Smrg 418c9fbc29Smrgme=`echo "$0" | sed -e 's,.*/,,'` 428c9fbc29Smrg 438c9fbc29Smrgusage="\ 448c9fbc29SmrgUsage: $0 [OPTION] 458c9fbc29Smrg 468c9fbc29SmrgOutput the configuration name of the system \`$me' is run on. 478c9fbc29Smrg 488c9fbc29SmrgOperation modes: 498c9fbc29Smrg -h, --help print this help, then exit 508c9fbc29Smrg -t, --time-stamp print date of last modification, then exit 518c9fbc29Smrg -v, --version print version number, then exit 528c9fbc29Smrg 538c9fbc29SmrgReport bugs and patches to <config-patches@gnu.org>." 548c9fbc29Smrg 558c9fbc29Smrgversion="\ 568c9fbc29SmrgGNU config.guess ($timestamp) 578c9fbc29Smrg 588c9fbc29SmrgOriginally written by Per Bothner. 594cd6a3aeSmrgCopyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 604cd6a3aeSmrg2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free 614cd6a3aeSmrgSoftware Foundation, Inc. 628c9fbc29Smrg 638c9fbc29SmrgThis is free software; see the source for copying conditions. There is NO 648c9fbc29Smrgwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." 658c9fbc29Smrg 668c9fbc29Smrghelp=" 678c9fbc29SmrgTry \`$me --help' for more information." 688c9fbc29Smrg 698c9fbc29Smrg# Parse command line 708c9fbc29Smrgwhile test $# -gt 0 ; do 718c9fbc29Smrg case $1 in 728c9fbc29Smrg --time-stamp | --time* | -t ) 738c9fbc29Smrg echo "$timestamp" ; exit ;; 748c9fbc29Smrg --version | -v ) 758c9fbc29Smrg echo "$version" ; exit ;; 768c9fbc29Smrg --help | --h* | -h ) 778c9fbc29Smrg echo "$usage"; exit ;; 788c9fbc29Smrg -- ) # Stop option processing 798c9fbc29Smrg shift; break ;; 808c9fbc29Smrg - ) # Use stdin as input. 818c9fbc29Smrg break ;; 828c9fbc29Smrg -* ) 838c9fbc29Smrg echo "$me: invalid option $1$help" >&2 848c9fbc29Smrg exit 1 ;; 858c9fbc29Smrg * ) 868c9fbc29Smrg break ;; 878c9fbc29Smrg esac 888c9fbc29Smrgdone 898c9fbc29Smrg 908c9fbc29Smrgif test $# != 0; then 918c9fbc29Smrg echo "$me: too many arguments$help" >&2 928c9fbc29Smrg exit 1 938c9fbc29Smrgfi 948c9fbc29Smrg 954cd6a3aeSmrgtrap 'exit 1' HUP INT TERM 968c9fbc29Smrg 978c9fbc29Smrg# CC_FOR_BUILD -- compiler used by this script. Note that the use of a 988c9fbc29Smrg# compiler to aid in system detection is discouraged as it requires 998c9fbc29Smrg# temporary files to be created and, as you can see below, it is a 1008c9fbc29Smrg# headache to deal with in a portable fashion. 1018c9fbc29Smrg 1028c9fbc29Smrg# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still 1038c9fbc29Smrg# use `HOST_CC' if defined, but it is deprecated. 1048c9fbc29Smrg 1058c9fbc29Smrg# Portable tmp directory creation inspired by the Autoconf team. 1068c9fbc29Smrg 1078c9fbc29Smrgset_cc_for_build=' 1088c9fbc29Smrgtrap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; 1094cd6a3aeSmrgtrap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; 1108c9fbc29Smrg: ${TMPDIR=/tmp} ; 1114e411241Smrg { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || 1128c9fbc29Smrg { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || 1138c9fbc29Smrg { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || 1148c9fbc29Smrg { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; 1158c9fbc29Smrgdummy=$tmp/dummy ; 1168c9fbc29Smrgtmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; 1178c9fbc29Smrgcase $CC_FOR_BUILD,$HOST_CC,$CC in 1188c9fbc29Smrg ,,) echo "int x;" > $dummy.c ; 1198c9fbc29Smrg for c in cc gcc c89 c99 ; do 1208c9fbc29Smrg if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then 1218c9fbc29Smrg CC_FOR_BUILD="$c"; break ; 1228c9fbc29Smrg fi ; 1238c9fbc29Smrg done ; 1248c9fbc29Smrg if test x"$CC_FOR_BUILD" = x ; then 1258c9fbc29Smrg CC_FOR_BUILD=no_compiler_found ; 1268c9fbc29Smrg fi 1278c9fbc29Smrg ;; 1288c9fbc29Smrg ,,*) CC_FOR_BUILD=$CC ;; 1298c9fbc29Smrg ,*,*) CC_FOR_BUILD=$HOST_CC ;; 1308c9fbc29Smrgesac ; set_cc_for_build= ;' 1318c9fbc29Smrg 1328c9fbc29Smrg# This is needed to find uname on a Pyramid OSx when run in the BSD universe. 1338c9fbc29Smrg# (ghazi@noc.rutgers.edu 1994-08-24) 1348c9fbc29Smrgif (test -f /.attbin/uname) >/dev/null 2>&1 ; then 1358c9fbc29Smrg PATH=$PATH:/.attbin ; export PATH 1368c9fbc29Smrgfi 1378c9fbc29Smrg 1388c9fbc29SmrgUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown 1398c9fbc29SmrgUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown 1408c9fbc29SmrgUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown 1418c9fbc29SmrgUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown 1428c9fbc29Smrg 1438c9fbc29Smrg# Note: order is significant - the case branches are not exclusive. 1448c9fbc29Smrg 1458c9fbc29Smrgcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 1468c9fbc29Smrg *:NetBSD:*:*) 1478c9fbc29Smrg # NetBSD (nbsd) targets should (where applicable) match one or 1488c9fbc29Smrg # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, 1498c9fbc29Smrg # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently 1508c9fbc29Smrg # switched to ELF, *-*-netbsd* would select the old 1518c9fbc29Smrg # object file format. This provides both forward 1528c9fbc29Smrg # compatibility and a consistent mechanism for selecting the 1538c9fbc29Smrg # object file format. 1548c9fbc29Smrg # 1558c9fbc29Smrg # Note: NetBSD doesn't particularly care about the vendor 1568c9fbc29Smrg # portion of the name. We always set it to "unknown". 1578c9fbc29Smrg sysctl="sysctl -n hw.machine_arch" 1588c9fbc29Smrg UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ 1598c9fbc29Smrg /usr/sbin/$sysctl 2>/dev/null || echo unknown)` 1608c9fbc29Smrg case "${UNAME_MACHINE_ARCH}" in 1618c9fbc29Smrg armeb) machine=armeb-unknown ;; 1628c9fbc29Smrg arm*) machine=arm-unknown ;; 1638c9fbc29Smrg sh3el) machine=shl-unknown ;; 1648c9fbc29Smrg sh3eb) machine=sh-unknown ;; 1654e411241Smrg sh5el) machine=sh5le-unknown ;; 1668c9fbc29Smrg *) machine=${UNAME_MACHINE_ARCH}-unknown ;; 1678c9fbc29Smrg esac 1688c9fbc29Smrg # The Operating System including object format, if it has switched 1698c9fbc29Smrg # to ELF recently, or will in the future. 1708c9fbc29Smrg case "${UNAME_MACHINE_ARCH}" in 1718c9fbc29Smrg arm*|i386|m68k|ns32k|sh3*|sparc|vax) 1728c9fbc29Smrg eval $set_cc_for_build 1738c9fbc29Smrg if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ 1744cd6a3aeSmrg | grep -q __ELF__ 1758c9fbc29Smrg then 1768c9fbc29Smrg # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). 1778c9fbc29Smrg # Return netbsd for either. FIX? 1788c9fbc29Smrg os=netbsd 1798c9fbc29Smrg else 1808c9fbc29Smrg os=netbsdelf 1818c9fbc29Smrg fi 1828c9fbc29Smrg ;; 1838c9fbc29Smrg *) 1848c9fbc29Smrg os=netbsd 1858c9fbc29Smrg ;; 1868c9fbc29Smrg esac 1878c9fbc29Smrg # The OS release 1888c9fbc29Smrg # Debian GNU/NetBSD machines have a different userland, and 1898c9fbc29Smrg # thus, need a distinct triplet. However, they do not need 1908c9fbc29Smrg # kernel version information, so it can be replaced with a 1918c9fbc29Smrg # suitable tag, in the style of linux-gnu. 1928c9fbc29Smrg case "${UNAME_VERSION}" in 1938c9fbc29Smrg Debian*) 1948c9fbc29Smrg release='-gnu' 1958c9fbc29Smrg ;; 1968c9fbc29Smrg *) 1978c9fbc29Smrg release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` 1988c9fbc29Smrg ;; 1998c9fbc29Smrg esac 2008c9fbc29Smrg # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: 2018c9fbc29Smrg # contains redundant information, the shorter form: 2028c9fbc29Smrg # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. 2038c9fbc29Smrg echo "${machine}-${os}${release}" 2048c9fbc29Smrg exit ;; 2058c9fbc29Smrg *:OpenBSD:*:*) 2068c9fbc29Smrg UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 2078c9fbc29Smrg echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} 2088c9fbc29Smrg exit ;; 2098c9fbc29Smrg *:ekkoBSD:*:*) 2108c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} 2118c9fbc29Smrg exit ;; 2124e411241Smrg *:SolidBSD:*:*) 2134e411241Smrg echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} 2144e411241Smrg exit ;; 2158c9fbc29Smrg macppc:MirBSD:*:*) 2164e411241Smrg echo powerpc-unknown-mirbsd${UNAME_RELEASE} 2178c9fbc29Smrg exit ;; 2188c9fbc29Smrg *:MirBSD:*:*) 2198c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} 2208c9fbc29Smrg exit ;; 2218c9fbc29Smrg alpha:OSF1:*:*) 2228c9fbc29Smrg case $UNAME_RELEASE in 2238c9fbc29Smrg *4.0) 2248c9fbc29Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` 2258c9fbc29Smrg ;; 2268c9fbc29Smrg *5.*) 2278c9fbc29Smrg UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` 2288c9fbc29Smrg ;; 2298c9fbc29Smrg esac 2308c9fbc29Smrg # According to Compaq, /usr/sbin/psrinfo has been available on 2318c9fbc29Smrg # OSF/1 and Tru64 systems produced since 1995. I hope that 2328c9fbc29Smrg # covers most systems running today. This code pipes the CPU 2338c9fbc29Smrg # types through head -n 1, so we only detect the type of CPU 0. 2348c9fbc29Smrg ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` 2358c9fbc29Smrg case "$ALPHA_CPU_TYPE" in 2368c9fbc29Smrg "EV4 (21064)") 2378c9fbc29Smrg UNAME_MACHINE="alpha" ;; 2388c9fbc29Smrg "EV4.5 (21064)") 2398c9fbc29Smrg UNAME_MACHINE="alpha" ;; 2408c9fbc29Smrg "LCA4 (21066/21068)") 2418c9fbc29Smrg UNAME_MACHINE="alpha" ;; 2428c9fbc29Smrg "EV5 (21164)") 2438c9fbc29Smrg UNAME_MACHINE="alphaev5" ;; 2448c9fbc29Smrg "EV5.6 (21164A)") 2458c9fbc29Smrg UNAME_MACHINE="alphaev56" ;; 2468c9fbc29Smrg "EV5.6 (21164PC)") 2478c9fbc29Smrg UNAME_MACHINE="alphapca56" ;; 2488c9fbc29Smrg "EV5.7 (21164PC)") 2498c9fbc29Smrg UNAME_MACHINE="alphapca57" ;; 2508c9fbc29Smrg "EV6 (21264)") 2518c9fbc29Smrg UNAME_MACHINE="alphaev6" ;; 2528c9fbc29Smrg "EV6.7 (21264A)") 2538c9fbc29Smrg UNAME_MACHINE="alphaev67" ;; 2548c9fbc29Smrg "EV6.8CB (21264C)") 2558c9fbc29Smrg UNAME_MACHINE="alphaev68" ;; 2568c9fbc29Smrg "EV6.8AL (21264B)") 2578c9fbc29Smrg UNAME_MACHINE="alphaev68" ;; 2588c9fbc29Smrg "EV6.8CX (21264D)") 2598c9fbc29Smrg UNAME_MACHINE="alphaev68" ;; 2608c9fbc29Smrg "EV6.9A (21264/EV69A)") 2618c9fbc29Smrg UNAME_MACHINE="alphaev69" ;; 2628c9fbc29Smrg "EV7 (21364)") 2638c9fbc29Smrg UNAME_MACHINE="alphaev7" ;; 2648c9fbc29Smrg "EV7.9 (21364A)") 2658c9fbc29Smrg UNAME_MACHINE="alphaev79" ;; 2668c9fbc29Smrg esac 2678c9fbc29Smrg # A Pn.n version is a patched version. 2688c9fbc29Smrg # A Vn.n version is a released version. 2698c9fbc29Smrg # A Tn.n version is a released field test version. 2708c9fbc29Smrg # A Xn.n version is an unreleased experimental baselevel. 2718c9fbc29Smrg # 1.2 uses "1.2" for uname -r. 2728c9fbc29Smrg echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 2738c9fbc29Smrg exit ;; 2748c9fbc29Smrg Alpha\ *:Windows_NT*:*) 2758c9fbc29Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 2768c9fbc29Smrg # Should we change UNAME_MACHINE based on the output of uname instead 2778c9fbc29Smrg # of the specific Alpha model? 2788c9fbc29Smrg echo alpha-pc-interix 2798c9fbc29Smrg exit ;; 2808c9fbc29Smrg 21064:Windows_NT:50:3) 2818c9fbc29Smrg echo alpha-dec-winnt3.5 2828c9fbc29Smrg exit ;; 2838c9fbc29Smrg Amiga*:UNIX_System_V:4.0:*) 2848c9fbc29Smrg echo m68k-unknown-sysv4 2858c9fbc29Smrg exit ;; 2868c9fbc29Smrg *:[Aa]miga[Oo][Ss]:*:*) 2878c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-amigaos 2888c9fbc29Smrg exit ;; 2898c9fbc29Smrg *:[Mm]orph[Oo][Ss]:*:*) 2908c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-morphos 2918c9fbc29Smrg exit ;; 2928c9fbc29Smrg *:OS/390:*:*) 2938c9fbc29Smrg echo i370-ibm-openedition 2948c9fbc29Smrg exit ;; 2958c9fbc29Smrg *:z/VM:*:*) 2968c9fbc29Smrg echo s390-ibm-zvmoe 2978c9fbc29Smrg exit ;; 2988c9fbc29Smrg *:OS400:*:*) 2998c9fbc29Smrg echo powerpc-ibm-os400 3008c9fbc29Smrg exit ;; 3018c9fbc29Smrg arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) 3028c9fbc29Smrg echo arm-acorn-riscix${UNAME_RELEASE} 3038c9fbc29Smrg exit ;; 3048c9fbc29Smrg arm:riscos:*:*|arm:RISCOS:*:*) 3058c9fbc29Smrg echo arm-unknown-riscos 3068c9fbc29Smrg exit ;; 3078c9fbc29Smrg SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) 3088c9fbc29Smrg echo hppa1.1-hitachi-hiuxmpp 3098c9fbc29Smrg exit ;; 3108c9fbc29Smrg Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) 3118c9fbc29Smrg # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. 3128c9fbc29Smrg if test "`(/bin/universe) 2>/dev/null`" = att ; then 3138c9fbc29Smrg echo pyramid-pyramid-sysv3 3148c9fbc29Smrg else 3158c9fbc29Smrg echo pyramid-pyramid-bsd 3168c9fbc29Smrg fi 3178c9fbc29Smrg exit ;; 3188c9fbc29Smrg NILE*:*:*:dcosx) 3198c9fbc29Smrg echo pyramid-pyramid-svr4 3208c9fbc29Smrg exit ;; 3218c9fbc29Smrg DRS?6000:unix:4.0:6*) 3228c9fbc29Smrg echo sparc-icl-nx6 3238c9fbc29Smrg exit ;; 3248c9fbc29Smrg DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) 3258c9fbc29Smrg case `/usr/bin/uname -p` in 3268c9fbc29Smrg sparc) echo sparc-icl-nx7; exit ;; 3278c9fbc29Smrg esac ;; 3284cd6a3aeSmrg s390x:SunOS:*:*) 3294cd6a3aeSmrg echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 3304cd6a3aeSmrg exit ;; 3318c9fbc29Smrg sun4H:SunOS:5.*:*) 3328c9fbc29Smrg echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 3338c9fbc29Smrg exit ;; 3348c9fbc29Smrg sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) 3358c9fbc29Smrg echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 3368c9fbc29Smrg exit ;; 3374cd6a3aeSmrg i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) 3384cd6a3aeSmrg echo i386-pc-auroraux${UNAME_RELEASE} 3394cd6a3aeSmrg exit ;; 3404e411241Smrg i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) 3414cd6a3aeSmrg eval $set_cc_for_build 3424cd6a3aeSmrg SUN_ARCH="i386" 3434cd6a3aeSmrg # If there is a compiler, see if it is configured for 64-bit objects. 3444cd6a3aeSmrg # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. 3454cd6a3aeSmrg # This test works for both compilers. 3464cd6a3aeSmrg if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 3474cd6a3aeSmrg if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ 3484cd6a3aeSmrg (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 3494cd6a3aeSmrg grep IS_64BIT_ARCH >/dev/null 3504cd6a3aeSmrg then 3514cd6a3aeSmrg SUN_ARCH="x86_64" 3524cd6a3aeSmrg fi 3534cd6a3aeSmrg fi 3544cd6a3aeSmrg echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 3558c9fbc29Smrg exit ;; 3568c9fbc29Smrg sun4*:SunOS:6*:*) 3578c9fbc29Smrg # According to config.sub, this is the proper way to canonicalize 3588c9fbc29Smrg # SunOS6. Hard to guess exactly what SunOS6 will be like, but 3598c9fbc29Smrg # it's likely to be more like Solaris than SunOS4. 3608c9fbc29Smrg echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 3618c9fbc29Smrg exit ;; 3628c9fbc29Smrg sun4*:SunOS:*:*) 3638c9fbc29Smrg case "`/usr/bin/arch -k`" in 3648c9fbc29Smrg Series*|S4*) 3658c9fbc29Smrg UNAME_RELEASE=`uname -v` 3668c9fbc29Smrg ;; 3678c9fbc29Smrg esac 3688c9fbc29Smrg # Japanese Language versions have a version number like `4.1.3-JL'. 3698c9fbc29Smrg echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` 3708c9fbc29Smrg exit ;; 3718c9fbc29Smrg sun3*:SunOS:*:*) 3728c9fbc29Smrg echo m68k-sun-sunos${UNAME_RELEASE} 3738c9fbc29Smrg exit ;; 3748c9fbc29Smrg sun*:*:4.2BSD:*) 3758c9fbc29Smrg UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` 3768c9fbc29Smrg test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 3778c9fbc29Smrg case "`/bin/arch`" in 3788c9fbc29Smrg sun3) 3798c9fbc29Smrg echo m68k-sun-sunos${UNAME_RELEASE} 3808c9fbc29Smrg ;; 3818c9fbc29Smrg sun4) 3828c9fbc29Smrg echo sparc-sun-sunos${UNAME_RELEASE} 3838c9fbc29Smrg ;; 3848c9fbc29Smrg esac 3858c9fbc29Smrg exit ;; 3868c9fbc29Smrg aushp:SunOS:*:*) 3878c9fbc29Smrg echo sparc-auspex-sunos${UNAME_RELEASE} 3888c9fbc29Smrg exit ;; 3898c9fbc29Smrg # The situation for MiNT is a little confusing. The machine name 3908c9fbc29Smrg # can be virtually everything (everything which is not 3918c9fbc29Smrg # "atarist" or "atariste" at least should have a processor 3928c9fbc29Smrg # > m68000). The system name ranges from "MiNT" over "FreeMiNT" 3938c9fbc29Smrg # to the lowercase version "mint" (or "freemint"). Finally 3948c9fbc29Smrg # the system name "TOS" denotes a system which is actually not 3958c9fbc29Smrg # MiNT. But MiNT is downward compatible to TOS, so this should 3968c9fbc29Smrg # be no problem. 3978c9fbc29Smrg atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) 3988c9fbc29Smrg echo m68k-atari-mint${UNAME_RELEASE} 3998c9fbc29Smrg exit ;; 4008c9fbc29Smrg atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) 4018c9fbc29Smrg echo m68k-atari-mint${UNAME_RELEASE} 4028c9fbc29Smrg exit ;; 4038c9fbc29Smrg *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) 4048c9fbc29Smrg echo m68k-atari-mint${UNAME_RELEASE} 4058c9fbc29Smrg exit ;; 4068c9fbc29Smrg milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) 4078c9fbc29Smrg echo m68k-milan-mint${UNAME_RELEASE} 4088c9fbc29Smrg exit ;; 4098c9fbc29Smrg hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) 4108c9fbc29Smrg echo m68k-hades-mint${UNAME_RELEASE} 4118c9fbc29Smrg exit ;; 4128c9fbc29Smrg *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) 4138c9fbc29Smrg echo m68k-unknown-mint${UNAME_RELEASE} 4148c9fbc29Smrg exit ;; 4158c9fbc29Smrg m68k:machten:*:*) 4168c9fbc29Smrg echo m68k-apple-machten${UNAME_RELEASE} 4178c9fbc29Smrg exit ;; 4188c9fbc29Smrg powerpc:machten:*:*) 4198c9fbc29Smrg echo powerpc-apple-machten${UNAME_RELEASE} 4208c9fbc29Smrg exit ;; 4218c9fbc29Smrg RISC*:Mach:*:*) 4228c9fbc29Smrg echo mips-dec-mach_bsd4.3 4238c9fbc29Smrg exit ;; 4248c9fbc29Smrg RISC*:ULTRIX:*:*) 4258c9fbc29Smrg echo mips-dec-ultrix${UNAME_RELEASE} 4268c9fbc29Smrg exit ;; 4278c9fbc29Smrg VAX*:ULTRIX*:*:*) 4288c9fbc29Smrg echo vax-dec-ultrix${UNAME_RELEASE} 4298c9fbc29Smrg exit ;; 4308c9fbc29Smrg 2020:CLIX:*:* | 2430:CLIX:*:*) 4318c9fbc29Smrg echo clipper-intergraph-clix${UNAME_RELEASE} 4328c9fbc29Smrg exit ;; 4338c9fbc29Smrg mips:*:*:UMIPS | mips:*:*:RISCos) 4348c9fbc29Smrg eval $set_cc_for_build 4358c9fbc29Smrg sed 's/^ //' << EOF >$dummy.c 4368c9fbc29Smrg#ifdef __cplusplus 4378c9fbc29Smrg#include <stdio.h> /* for printf() prototype */ 4388c9fbc29Smrg int main (int argc, char *argv[]) { 4398c9fbc29Smrg#else 4408c9fbc29Smrg int main (argc, argv) int argc; char *argv[]; { 4418c9fbc29Smrg#endif 4428c9fbc29Smrg #if defined (host_mips) && defined (MIPSEB) 4438c9fbc29Smrg #if defined (SYSTYPE_SYSV) 4448c9fbc29Smrg printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); 4458c9fbc29Smrg #endif 4468c9fbc29Smrg #if defined (SYSTYPE_SVR4) 4478c9fbc29Smrg printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); 4488c9fbc29Smrg #endif 4498c9fbc29Smrg #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) 4508c9fbc29Smrg printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); 4518c9fbc29Smrg #endif 4528c9fbc29Smrg #endif 4538c9fbc29Smrg exit (-1); 4548c9fbc29Smrg } 4558c9fbc29SmrgEOF 4568c9fbc29Smrg $CC_FOR_BUILD -o $dummy $dummy.c && 4578c9fbc29Smrg dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && 4588c9fbc29Smrg SYSTEM_NAME=`$dummy $dummyarg` && 4598c9fbc29Smrg { echo "$SYSTEM_NAME"; exit; } 4608c9fbc29Smrg echo mips-mips-riscos${UNAME_RELEASE} 4618c9fbc29Smrg exit ;; 4628c9fbc29Smrg Motorola:PowerMAX_OS:*:*) 4638c9fbc29Smrg echo powerpc-motorola-powermax 4648c9fbc29Smrg exit ;; 4658c9fbc29Smrg Motorola:*:4.3:PL8-*) 4668c9fbc29Smrg echo powerpc-harris-powermax 4678c9fbc29Smrg exit ;; 4688c9fbc29Smrg Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) 4698c9fbc29Smrg echo powerpc-harris-powermax 4708c9fbc29Smrg exit ;; 4718c9fbc29Smrg Night_Hawk:Power_UNIX:*:*) 4728c9fbc29Smrg echo powerpc-harris-powerunix 4738c9fbc29Smrg exit ;; 4748c9fbc29Smrg m88k:CX/UX:7*:*) 4758c9fbc29Smrg echo m88k-harris-cxux7 4768c9fbc29Smrg exit ;; 4778c9fbc29Smrg m88k:*:4*:R4*) 4788c9fbc29Smrg echo m88k-motorola-sysv4 4798c9fbc29Smrg exit ;; 4808c9fbc29Smrg m88k:*:3*:R3*) 4818c9fbc29Smrg echo m88k-motorola-sysv3 4828c9fbc29Smrg exit ;; 4838c9fbc29Smrg AViiON:dgux:*:*) 4848c9fbc29Smrg # DG/UX returns AViiON for all architectures 4858c9fbc29Smrg UNAME_PROCESSOR=`/usr/bin/uname -p` 4868c9fbc29Smrg if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] 4878c9fbc29Smrg then 4888c9fbc29Smrg if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ 4898c9fbc29Smrg [ ${TARGET_BINARY_INTERFACE}x = x ] 4908c9fbc29Smrg then 4918c9fbc29Smrg echo m88k-dg-dgux${UNAME_RELEASE} 4928c9fbc29Smrg else 4938c9fbc29Smrg echo m88k-dg-dguxbcs${UNAME_RELEASE} 4948c9fbc29Smrg fi 4958c9fbc29Smrg else 4968c9fbc29Smrg echo i586-dg-dgux${UNAME_RELEASE} 4978c9fbc29Smrg fi 4988c9fbc29Smrg exit ;; 4998c9fbc29Smrg M88*:DolphinOS:*:*) # DolphinOS (SVR3) 5008c9fbc29Smrg echo m88k-dolphin-sysv3 5018c9fbc29Smrg exit ;; 5028c9fbc29Smrg M88*:*:R3*:*) 5038c9fbc29Smrg # Delta 88k system running SVR3 5048c9fbc29Smrg echo m88k-motorola-sysv3 5058c9fbc29Smrg exit ;; 5068c9fbc29Smrg XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) 5078c9fbc29Smrg echo m88k-tektronix-sysv3 5088c9fbc29Smrg exit ;; 5098c9fbc29Smrg Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) 5108c9fbc29Smrg echo m68k-tektronix-bsd 5118c9fbc29Smrg exit ;; 5128c9fbc29Smrg *:IRIX*:*:*) 5138c9fbc29Smrg echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` 5148c9fbc29Smrg exit ;; 5158c9fbc29Smrg ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. 5168c9fbc29Smrg echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id 5178c9fbc29Smrg exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' 5188c9fbc29Smrg i*86:AIX:*:*) 5198c9fbc29Smrg echo i386-ibm-aix 5208c9fbc29Smrg exit ;; 5218c9fbc29Smrg ia64:AIX:*:*) 5228c9fbc29Smrg if [ -x /usr/bin/oslevel ] ; then 5238c9fbc29Smrg IBM_REV=`/usr/bin/oslevel` 5248c9fbc29Smrg else 5258c9fbc29Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 5268c9fbc29Smrg fi 5278c9fbc29Smrg echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} 5288c9fbc29Smrg exit ;; 5298c9fbc29Smrg *:AIX:2:3) 5308c9fbc29Smrg if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then 5318c9fbc29Smrg eval $set_cc_for_build 5328c9fbc29Smrg sed 's/^ //' << EOF >$dummy.c 5338c9fbc29Smrg #include <sys/systemcfg.h> 5348c9fbc29Smrg 5358c9fbc29Smrg main() 5368c9fbc29Smrg { 5378c9fbc29Smrg if (!__power_pc()) 5388c9fbc29Smrg exit(1); 5398c9fbc29Smrg puts("powerpc-ibm-aix3.2.5"); 5408c9fbc29Smrg exit(0); 5418c9fbc29Smrg } 5428c9fbc29SmrgEOF 5438c9fbc29Smrg if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` 5448c9fbc29Smrg then 5458c9fbc29Smrg echo "$SYSTEM_NAME" 5468c9fbc29Smrg else 5478c9fbc29Smrg echo rs6000-ibm-aix3.2.5 5488c9fbc29Smrg fi 5498c9fbc29Smrg elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then 5508c9fbc29Smrg echo rs6000-ibm-aix3.2.4 5518c9fbc29Smrg else 5528c9fbc29Smrg echo rs6000-ibm-aix3.2 5538c9fbc29Smrg fi 5548c9fbc29Smrg exit ;; 5554cd6a3aeSmrg *:AIX:*:[4567]) 5568c9fbc29Smrg IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` 5578c9fbc29Smrg if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then 5588c9fbc29Smrg IBM_ARCH=rs6000 5598c9fbc29Smrg else 5608c9fbc29Smrg IBM_ARCH=powerpc 5618c9fbc29Smrg fi 5628c9fbc29Smrg if [ -x /usr/bin/oslevel ] ; then 5638c9fbc29Smrg IBM_REV=`/usr/bin/oslevel` 5648c9fbc29Smrg else 5658c9fbc29Smrg IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} 5668c9fbc29Smrg fi 5678c9fbc29Smrg echo ${IBM_ARCH}-ibm-aix${IBM_REV} 5688c9fbc29Smrg exit ;; 5698c9fbc29Smrg *:AIX:*:*) 5708c9fbc29Smrg echo rs6000-ibm-aix 5718c9fbc29Smrg exit ;; 5728c9fbc29Smrg ibmrt:4.4BSD:*|romp-ibm:BSD:*) 5738c9fbc29Smrg echo romp-ibm-bsd4.4 5748c9fbc29Smrg exit ;; 5758c9fbc29Smrg ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and 5768c9fbc29Smrg echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to 5778c9fbc29Smrg exit ;; # report: romp-ibm BSD 4.3 5788c9fbc29Smrg *:BOSX:*:*) 5798c9fbc29Smrg echo rs6000-bull-bosx 5808c9fbc29Smrg exit ;; 5818c9fbc29Smrg DPX/2?00:B.O.S.:*:*) 5828c9fbc29Smrg echo m68k-bull-sysv3 5838c9fbc29Smrg exit ;; 5848c9fbc29Smrg 9000/[34]??:4.3bsd:1.*:*) 5858c9fbc29Smrg echo m68k-hp-bsd 5868c9fbc29Smrg exit ;; 5878c9fbc29Smrg hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) 5888c9fbc29Smrg echo m68k-hp-bsd4.4 5898c9fbc29Smrg exit ;; 5908c9fbc29Smrg 9000/[34678]??:HP-UX:*:*) 5918c9fbc29Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 5928c9fbc29Smrg case "${UNAME_MACHINE}" in 5938c9fbc29Smrg 9000/31? ) HP_ARCH=m68000 ;; 5948c9fbc29Smrg 9000/[34]?? ) HP_ARCH=m68k ;; 5958c9fbc29Smrg 9000/[678][0-9][0-9]) 5968c9fbc29Smrg if [ -x /usr/bin/getconf ]; then 5978c9fbc29Smrg sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` 5988c9fbc29Smrg sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` 5998c9fbc29Smrg case "${sc_cpu_version}" in 6008c9fbc29Smrg 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 6018c9fbc29Smrg 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 6028c9fbc29Smrg 532) # CPU_PA_RISC2_0 6038c9fbc29Smrg case "${sc_kernel_bits}" in 6048c9fbc29Smrg 32) HP_ARCH="hppa2.0n" ;; 6058c9fbc29Smrg 64) HP_ARCH="hppa2.0w" ;; 6068c9fbc29Smrg '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 6078c9fbc29Smrg esac ;; 6088c9fbc29Smrg esac 6098c9fbc29Smrg fi 6108c9fbc29Smrg if [ "${HP_ARCH}" = "" ]; then 6118c9fbc29Smrg eval $set_cc_for_build 6128c9fbc29Smrg sed 's/^ //' << EOF >$dummy.c 6138c9fbc29Smrg 6148c9fbc29Smrg #define _HPUX_SOURCE 6158c9fbc29Smrg #include <stdlib.h> 6168c9fbc29Smrg #include <unistd.h> 6178c9fbc29Smrg 6188c9fbc29Smrg int main () 6198c9fbc29Smrg { 6208c9fbc29Smrg #if defined(_SC_KERNEL_BITS) 6218c9fbc29Smrg long bits = sysconf(_SC_KERNEL_BITS); 6228c9fbc29Smrg #endif 6238c9fbc29Smrg long cpu = sysconf (_SC_CPU_VERSION); 6248c9fbc29Smrg 6258c9fbc29Smrg switch (cpu) 6268c9fbc29Smrg { 6278c9fbc29Smrg case CPU_PA_RISC1_0: puts ("hppa1.0"); break; 6288c9fbc29Smrg case CPU_PA_RISC1_1: puts ("hppa1.1"); break; 6298c9fbc29Smrg case CPU_PA_RISC2_0: 6308c9fbc29Smrg #if defined(_SC_KERNEL_BITS) 6318c9fbc29Smrg switch (bits) 6328c9fbc29Smrg { 6338c9fbc29Smrg case 64: puts ("hppa2.0w"); break; 6348c9fbc29Smrg case 32: puts ("hppa2.0n"); break; 6358c9fbc29Smrg default: puts ("hppa2.0"); break; 6368c9fbc29Smrg } break; 6378c9fbc29Smrg #else /* !defined(_SC_KERNEL_BITS) */ 6388c9fbc29Smrg puts ("hppa2.0"); break; 6398c9fbc29Smrg #endif 6408c9fbc29Smrg default: puts ("hppa1.0"); break; 6418c9fbc29Smrg } 6428c9fbc29Smrg exit (0); 6438c9fbc29Smrg } 6448c9fbc29SmrgEOF 6458c9fbc29Smrg (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` 6468c9fbc29Smrg test -z "$HP_ARCH" && HP_ARCH=hppa 6478c9fbc29Smrg fi ;; 6488c9fbc29Smrg esac 6498c9fbc29Smrg if [ ${HP_ARCH} = "hppa2.0w" ] 6508c9fbc29Smrg then 6518c9fbc29Smrg eval $set_cc_for_build 6528c9fbc29Smrg 6538c9fbc29Smrg # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating 6548c9fbc29Smrg # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler 6558c9fbc29Smrg # generating 64-bit code. GNU and HP use different nomenclature: 6568c9fbc29Smrg # 6578c9fbc29Smrg # $ CC_FOR_BUILD=cc ./config.guess 6588c9fbc29Smrg # => hppa2.0w-hp-hpux11.23 6598c9fbc29Smrg # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess 6608c9fbc29Smrg # => hppa64-hp-hpux11.23 6618c9fbc29Smrg 6628c9fbc29Smrg if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | 6634cd6a3aeSmrg grep -q __LP64__ 6648c9fbc29Smrg then 6658c9fbc29Smrg HP_ARCH="hppa2.0w" 6668c9fbc29Smrg else 6678c9fbc29Smrg HP_ARCH="hppa64" 6688c9fbc29Smrg fi 6698c9fbc29Smrg fi 6708c9fbc29Smrg echo ${HP_ARCH}-hp-hpux${HPUX_REV} 6718c9fbc29Smrg exit ;; 6728c9fbc29Smrg ia64:HP-UX:*:*) 6738c9fbc29Smrg HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` 6748c9fbc29Smrg echo ia64-hp-hpux${HPUX_REV} 6758c9fbc29Smrg exit ;; 6768c9fbc29Smrg 3050*:HI-UX:*:*) 6778c9fbc29Smrg eval $set_cc_for_build 6788c9fbc29Smrg sed 's/^ //' << EOF >$dummy.c 6798c9fbc29Smrg #include <unistd.h> 6808c9fbc29Smrg int 6818c9fbc29Smrg main () 6828c9fbc29Smrg { 6838c9fbc29Smrg long cpu = sysconf (_SC_CPU_VERSION); 6848c9fbc29Smrg /* The order matters, because CPU_IS_HP_MC68K erroneously returns 6858c9fbc29Smrg true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct 6868c9fbc29Smrg results, however. */ 6878c9fbc29Smrg if (CPU_IS_PA_RISC (cpu)) 6888c9fbc29Smrg { 6898c9fbc29Smrg switch (cpu) 6908c9fbc29Smrg { 6918c9fbc29Smrg case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; 6928c9fbc29Smrg case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; 6938c9fbc29Smrg case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; 6948c9fbc29Smrg default: puts ("hppa-hitachi-hiuxwe2"); break; 6958c9fbc29Smrg } 6968c9fbc29Smrg } 6978c9fbc29Smrg else if (CPU_IS_HP_MC68K (cpu)) 6988c9fbc29Smrg puts ("m68k-hitachi-hiuxwe2"); 6998c9fbc29Smrg else puts ("unknown-hitachi-hiuxwe2"); 7008c9fbc29Smrg exit (0); 7018c9fbc29Smrg } 7028c9fbc29SmrgEOF 7038c9fbc29Smrg $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && 7048c9fbc29Smrg { echo "$SYSTEM_NAME"; exit; } 7058c9fbc29Smrg echo unknown-hitachi-hiuxwe2 7068c9fbc29Smrg exit ;; 7078c9fbc29Smrg 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) 7088c9fbc29Smrg echo hppa1.1-hp-bsd 7098c9fbc29Smrg exit ;; 7108c9fbc29Smrg 9000/8??:4.3bsd:*:*) 7118c9fbc29Smrg echo hppa1.0-hp-bsd 7128c9fbc29Smrg exit ;; 7138c9fbc29Smrg *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) 7148c9fbc29Smrg echo hppa1.0-hp-mpeix 7158c9fbc29Smrg exit ;; 7168c9fbc29Smrg hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) 7178c9fbc29Smrg echo hppa1.1-hp-osf 7188c9fbc29Smrg exit ;; 7198c9fbc29Smrg hp8??:OSF1:*:*) 7208c9fbc29Smrg echo hppa1.0-hp-osf 7218c9fbc29Smrg exit ;; 7228c9fbc29Smrg i*86:OSF1:*:*) 7238c9fbc29Smrg if [ -x /usr/sbin/sysversion ] ; then 7248c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-osf1mk 7258c9fbc29Smrg else 7268c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-osf1 7278c9fbc29Smrg fi 7288c9fbc29Smrg exit ;; 7298c9fbc29Smrg parisc*:Lites*:*:*) 7308c9fbc29Smrg echo hppa1.1-hp-lites 7318c9fbc29Smrg exit ;; 7328c9fbc29Smrg C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) 7338c9fbc29Smrg echo c1-convex-bsd 7348c9fbc29Smrg exit ;; 7358c9fbc29Smrg C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) 7368c9fbc29Smrg if getsysinfo -f scalar_acc 7378c9fbc29Smrg then echo c32-convex-bsd 7388c9fbc29Smrg else echo c2-convex-bsd 7398c9fbc29Smrg fi 7408c9fbc29Smrg exit ;; 7418c9fbc29Smrg C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) 7428c9fbc29Smrg echo c34-convex-bsd 7438c9fbc29Smrg exit ;; 7448c9fbc29Smrg C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) 7458c9fbc29Smrg echo c38-convex-bsd 7468c9fbc29Smrg exit ;; 7478c9fbc29Smrg C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) 7488c9fbc29Smrg echo c4-convex-bsd 7498c9fbc29Smrg exit ;; 7508c9fbc29Smrg CRAY*Y-MP:*:*:*) 7518c9fbc29Smrg echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 7528c9fbc29Smrg exit ;; 7538c9fbc29Smrg CRAY*[A-Z]90:*:*:*) 7548c9fbc29Smrg echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ 7558c9fbc29Smrg | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ 7568c9fbc29Smrg -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ 7578c9fbc29Smrg -e 's/\.[^.]*$/.X/' 7588c9fbc29Smrg exit ;; 7598c9fbc29Smrg CRAY*TS:*:*:*) 7608c9fbc29Smrg echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 7618c9fbc29Smrg exit ;; 7628c9fbc29Smrg CRAY*T3E:*:*:*) 7638c9fbc29Smrg echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 7648c9fbc29Smrg exit ;; 7658c9fbc29Smrg CRAY*SV1:*:*:*) 7668c9fbc29Smrg echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 7678c9fbc29Smrg exit ;; 7688c9fbc29Smrg *:UNICOS/mp:*:*) 7698c9fbc29Smrg echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 7708c9fbc29Smrg exit ;; 7718c9fbc29Smrg F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) 7728c9fbc29Smrg FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` 7738c9fbc29Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 7748c9fbc29Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` 7758c9fbc29Smrg echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 7768c9fbc29Smrg exit ;; 7778c9fbc29Smrg 5000:UNIX_System_V:4.*:*) 7788c9fbc29Smrg FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` 7798c9fbc29Smrg FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` 7808c9fbc29Smrg echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" 7818c9fbc29Smrg exit ;; 7828c9fbc29Smrg i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) 7838c9fbc29Smrg echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} 7848c9fbc29Smrg exit ;; 7858c9fbc29Smrg sparc*:BSD/OS:*:*) 7868c9fbc29Smrg echo sparc-unknown-bsdi${UNAME_RELEASE} 7878c9fbc29Smrg exit ;; 7888c9fbc29Smrg *:BSD/OS:*:*) 7898c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} 7908c9fbc29Smrg exit ;; 7918c9fbc29Smrg *:FreeBSD:*:*) 7924e411241Smrg case ${UNAME_MACHINE} in 7934e411241Smrg pc98) 7944e411241Smrg echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 7954e411241Smrg amd64) 7964e411241Smrg echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 7974e411241Smrg *) 7984e411241Smrg echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; 7994e411241Smrg esac 8008c9fbc29Smrg exit ;; 8018c9fbc29Smrg i*:CYGWIN*:*) 8028c9fbc29Smrg echo ${UNAME_MACHINE}-pc-cygwin 8038c9fbc29Smrg exit ;; 8044e411241Smrg *:MINGW*:*) 8058c9fbc29Smrg echo ${UNAME_MACHINE}-pc-mingw32 8068c9fbc29Smrg exit ;; 8078c9fbc29Smrg i*:windows32*:*) 8088c9fbc29Smrg # uname -m includes "-pc" on this system. 8098c9fbc29Smrg echo ${UNAME_MACHINE}-mingw32 8108c9fbc29Smrg exit ;; 8118c9fbc29Smrg i*:PW*:*) 8128c9fbc29Smrg echo ${UNAME_MACHINE}-pc-pw32 8138c9fbc29Smrg exit ;; 8144cd6a3aeSmrg *:Interix*:*) 8154e411241Smrg case ${UNAME_MACHINE} in 8164e411241Smrg x86) 8174e411241Smrg echo i586-pc-interix${UNAME_RELEASE} 8184e411241Smrg exit ;; 8194cd6a3aeSmrg authenticamd | genuineintel | EM64T) 8204e411241Smrg echo x86_64-unknown-interix${UNAME_RELEASE} 8214e411241Smrg exit ;; 8224e411241Smrg IA64) 8234e411241Smrg echo ia64-unknown-interix${UNAME_RELEASE} 8244e411241Smrg exit ;; 8254e411241Smrg esac ;; 8268c9fbc29Smrg [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) 8278c9fbc29Smrg echo i${UNAME_MACHINE}-pc-mks 8288c9fbc29Smrg exit ;; 8294cd6a3aeSmrg 8664:Windows_NT:*) 8304cd6a3aeSmrg echo x86_64-pc-mks 8314cd6a3aeSmrg exit ;; 8328c9fbc29Smrg i*:Windows_NT*:* | Pentium*:Windows_NT*:*) 8338c9fbc29Smrg # How do we know it's Interix rather than the generic POSIX subsystem? 8348c9fbc29Smrg # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we 8358c9fbc29Smrg # UNAME_MACHINE based on the output of uname instead of i386? 8368c9fbc29Smrg echo i586-pc-interix 8378c9fbc29Smrg exit ;; 8388c9fbc29Smrg i*:UWIN*:*) 8398c9fbc29Smrg echo ${UNAME_MACHINE}-pc-uwin 8408c9fbc29Smrg exit ;; 8418c9fbc29Smrg amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) 8428c9fbc29Smrg echo x86_64-unknown-cygwin 8438c9fbc29Smrg exit ;; 8448c9fbc29Smrg p*:CYGWIN*:*) 8458c9fbc29Smrg echo powerpcle-unknown-cygwin 8468c9fbc29Smrg exit ;; 8478c9fbc29Smrg prep*:SunOS:5.*:*) 8488c9fbc29Smrg echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` 8498c9fbc29Smrg exit ;; 8508c9fbc29Smrg *:GNU:*:*) 8518c9fbc29Smrg # the GNU system 8528c9fbc29Smrg echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` 8538c9fbc29Smrg exit ;; 8548c9fbc29Smrg *:GNU/*:*:*) 8558c9fbc29Smrg # other systems with GNU libc and userland 8568c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu 8578c9fbc29Smrg exit ;; 8588c9fbc29Smrg i*86:Minix:*:*) 8598c9fbc29Smrg echo ${UNAME_MACHINE}-pc-minix 8608c9fbc29Smrg exit ;; 8614cd6a3aeSmrg alpha:Linux:*:*) 8624cd6a3aeSmrg case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in 8634cd6a3aeSmrg EV5) UNAME_MACHINE=alphaev5 ;; 8644cd6a3aeSmrg EV56) UNAME_MACHINE=alphaev56 ;; 8654cd6a3aeSmrg PCA56) UNAME_MACHINE=alphapca56 ;; 8664cd6a3aeSmrg PCA57) UNAME_MACHINE=alphapca56 ;; 8674cd6a3aeSmrg EV6) UNAME_MACHINE=alphaev6 ;; 8684cd6a3aeSmrg EV67) UNAME_MACHINE=alphaev67 ;; 8694cd6a3aeSmrg EV68*) UNAME_MACHINE=alphaev68 ;; 8704cd6a3aeSmrg esac 8714cd6a3aeSmrg objdump --private-headers /bin/sh | grep -q ld.so.1 8724cd6a3aeSmrg if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi 8734cd6a3aeSmrg echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} 8744cd6a3aeSmrg exit ;; 8758c9fbc29Smrg arm*:Linux:*:*) 8764e411241Smrg eval $set_cc_for_build 8774e411241Smrg if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ 8784e411241Smrg | grep -q __ARM_EABI__ 8794e411241Smrg then 8804e411241Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 8814e411241Smrg else 8824e411241Smrg echo ${UNAME_MACHINE}-unknown-linux-gnueabi 8834e411241Smrg fi 8844e411241Smrg exit ;; 8854e411241Smrg avr32*:Linux:*:*) 8868c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 8878c9fbc29Smrg exit ;; 8888c9fbc29Smrg cris:Linux:*:*) 8898c9fbc29Smrg echo cris-axis-linux-gnu 8908c9fbc29Smrg exit ;; 8918c9fbc29Smrg crisv32:Linux:*:*) 8928c9fbc29Smrg echo crisv32-axis-linux-gnu 8938c9fbc29Smrg exit ;; 8948c9fbc29Smrg frv:Linux:*:*) 8958c9fbc29Smrg echo frv-unknown-linux-gnu 8968c9fbc29Smrg exit ;; 8974cd6a3aeSmrg i*86:Linux:*:*) 8984cd6a3aeSmrg LIBC=gnu 8994cd6a3aeSmrg eval $set_cc_for_build 9004cd6a3aeSmrg sed 's/^ //' << EOF >$dummy.c 9014cd6a3aeSmrg #ifdef __dietlibc__ 9024cd6a3aeSmrg LIBC=dietlibc 9034cd6a3aeSmrg #endif 9044cd6a3aeSmrgEOF 9054cd6a3aeSmrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` 9064cd6a3aeSmrg echo "${UNAME_MACHINE}-pc-linux-${LIBC}" 9074cd6a3aeSmrg exit ;; 9088c9fbc29Smrg ia64:Linux:*:*) 9098c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9108c9fbc29Smrg exit ;; 9118c9fbc29Smrg m32r*:Linux:*:*) 9128c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9138c9fbc29Smrg exit ;; 9148c9fbc29Smrg m68*:Linux:*:*) 9158c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9168c9fbc29Smrg exit ;; 9174cd6a3aeSmrg mips:Linux:*:* | mips64:Linux:*:*) 9188c9fbc29Smrg eval $set_cc_for_build 9198c9fbc29Smrg sed 's/^ //' << EOF >$dummy.c 9208c9fbc29Smrg #undef CPU 9214cd6a3aeSmrg #undef ${UNAME_MACHINE} 9224cd6a3aeSmrg #undef ${UNAME_MACHINE}el 9238c9fbc29Smrg #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 9244cd6a3aeSmrg CPU=${UNAME_MACHINE}el 9258c9fbc29Smrg #else 9268c9fbc29Smrg #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 9274cd6a3aeSmrg CPU=${UNAME_MACHINE} 9288c9fbc29Smrg #else 9298c9fbc29Smrg CPU= 9308c9fbc29Smrg #endif 9318c9fbc29Smrg #endif 9328c9fbc29SmrgEOF 9334cd6a3aeSmrg eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` 9348c9fbc29Smrg test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } 9358c9fbc29Smrg ;; 9368c9fbc29Smrg or32:Linux:*:*) 9378c9fbc29Smrg echo or32-unknown-linux-gnu 9388c9fbc29Smrg exit ;; 9394cd6a3aeSmrg padre:Linux:*:*) 9404cd6a3aeSmrg echo sparc-unknown-linux-gnu 9418c9fbc29Smrg exit ;; 9424cd6a3aeSmrg parisc64:Linux:*:* | hppa64:Linux:*:*) 9434cd6a3aeSmrg echo hppa64-unknown-linux-gnu 9448c9fbc29Smrg exit ;; 9458c9fbc29Smrg parisc:Linux:*:* | hppa:Linux:*:*) 9468c9fbc29Smrg # Look for CPU level 9478c9fbc29Smrg case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in 9488c9fbc29Smrg PA7*) echo hppa1.1-unknown-linux-gnu ;; 9498c9fbc29Smrg PA8*) echo hppa2.0-unknown-linux-gnu ;; 9508c9fbc29Smrg *) echo hppa-unknown-linux-gnu ;; 9518c9fbc29Smrg esac 9528c9fbc29Smrg exit ;; 9534cd6a3aeSmrg ppc64:Linux:*:*) 9544cd6a3aeSmrg echo powerpc64-unknown-linux-gnu 9554cd6a3aeSmrg exit ;; 9564cd6a3aeSmrg ppc:Linux:*:*) 9574cd6a3aeSmrg echo powerpc-unknown-linux-gnu 9588c9fbc29Smrg exit ;; 9598c9fbc29Smrg s390:Linux:*:* | s390x:Linux:*:*) 9608c9fbc29Smrg echo ${UNAME_MACHINE}-ibm-linux 9618c9fbc29Smrg exit ;; 9628c9fbc29Smrg sh64*:Linux:*:*) 9638c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9648c9fbc29Smrg exit ;; 9658c9fbc29Smrg sh*:Linux:*:*) 9668c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9678c9fbc29Smrg exit ;; 9688c9fbc29Smrg sparc:Linux:*:* | sparc64:Linux:*:*) 9698c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9708c9fbc29Smrg exit ;; 9714cd6a3aeSmrg tile*:Linux:*:*) 9724cd6a3aeSmrg echo ${UNAME_MACHINE}-tilera-linux-gnu 9734cd6a3aeSmrg exit ;; 9748c9fbc29Smrg vax:Linux:*:*) 9758c9fbc29Smrg echo ${UNAME_MACHINE}-dec-linux-gnu 9768c9fbc29Smrg exit ;; 9778c9fbc29Smrg x86_64:Linux:*:*) 9788c9fbc29Smrg echo x86_64-unknown-linux-gnu 9798c9fbc29Smrg exit ;; 9804e411241Smrg xtensa*:Linux:*:*) 9814e411241Smrg echo ${UNAME_MACHINE}-unknown-linux-gnu 9824e411241Smrg exit ;; 9838c9fbc29Smrg i*86:DYNIX/ptx:4*:*) 9848c9fbc29Smrg # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. 9858c9fbc29Smrg # earlier versions are messed up and put the nodename in both 9868c9fbc29Smrg # sysname and nodename. 9878c9fbc29Smrg echo i386-sequent-sysv4 9888c9fbc29Smrg exit ;; 9898c9fbc29Smrg i*86:UNIX_SV:4.2MP:2.*) 9908c9fbc29Smrg # Unixware is an offshoot of SVR4, but it has its own version 9918c9fbc29Smrg # number series starting with 2... 9928c9fbc29Smrg # I am not positive that other SVR4 systems won't match this, 9938c9fbc29Smrg # I just have to hope. -- rms. 9948c9fbc29Smrg # Use sysv4.2uw... so that sysv4* matches it. 9958c9fbc29Smrg echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} 9968c9fbc29Smrg exit ;; 9978c9fbc29Smrg i*86:OS/2:*:*) 9988c9fbc29Smrg # If we were able to find `uname', then EMX Unix compatibility 9998c9fbc29Smrg # is probably installed. 10008c9fbc29Smrg echo ${UNAME_MACHINE}-pc-os2-emx 10018c9fbc29Smrg exit ;; 10028c9fbc29Smrg i*86:XTS-300:*:STOP) 10038c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-stop 10048c9fbc29Smrg exit ;; 10058c9fbc29Smrg i*86:atheos:*:*) 10068c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-atheos 10078c9fbc29Smrg exit ;; 10088c9fbc29Smrg i*86:syllable:*:*) 10098c9fbc29Smrg echo ${UNAME_MACHINE}-pc-syllable 10108c9fbc29Smrg exit ;; 10114cd6a3aeSmrg i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) 10128c9fbc29Smrg echo i386-unknown-lynxos${UNAME_RELEASE} 10138c9fbc29Smrg exit ;; 10148c9fbc29Smrg i*86:*DOS:*:*) 10158c9fbc29Smrg echo ${UNAME_MACHINE}-pc-msdosdjgpp 10168c9fbc29Smrg exit ;; 10178c9fbc29Smrg i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) 10188c9fbc29Smrg UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` 10198c9fbc29Smrg if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then 10208c9fbc29Smrg echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} 10218c9fbc29Smrg else 10228c9fbc29Smrg echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} 10238c9fbc29Smrg fi 10248c9fbc29Smrg exit ;; 10258c9fbc29Smrg i*86:*:5:[678]*) 10268c9fbc29Smrg # UnixWare 7.x, OpenUNIX and OpenServer 6. 10278c9fbc29Smrg case `/bin/uname -X | grep "^Machine"` in 10288c9fbc29Smrg *486*) UNAME_MACHINE=i486 ;; 10298c9fbc29Smrg *Pentium) UNAME_MACHINE=i586 ;; 10308c9fbc29Smrg *Pent*|*Celeron) UNAME_MACHINE=i686 ;; 10318c9fbc29Smrg esac 10328c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 10338c9fbc29Smrg exit ;; 10348c9fbc29Smrg i*86:*:3.2:*) 10358c9fbc29Smrg if test -f /usr/options/cb.name; then 10368c9fbc29Smrg UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` 10378c9fbc29Smrg echo ${UNAME_MACHINE}-pc-isc$UNAME_REL 10388c9fbc29Smrg elif /bin/uname -X 2>/dev/null >/dev/null ; then 10398c9fbc29Smrg UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` 10408c9fbc29Smrg (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 10418c9fbc29Smrg (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ 10428c9fbc29Smrg && UNAME_MACHINE=i586 10438c9fbc29Smrg (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ 10448c9fbc29Smrg && UNAME_MACHINE=i686 10458c9fbc29Smrg (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ 10468c9fbc29Smrg && UNAME_MACHINE=i686 10478c9fbc29Smrg echo ${UNAME_MACHINE}-pc-sco$UNAME_REL 10488c9fbc29Smrg else 10498c9fbc29Smrg echo ${UNAME_MACHINE}-pc-sysv32 10508c9fbc29Smrg fi 10518c9fbc29Smrg exit ;; 10528c9fbc29Smrg pc:*:*:*) 10538c9fbc29Smrg # Left here for compatibility: 10548c9fbc29Smrg # uname -m prints for DJGPP always 'pc', but it prints nothing about 10554cd6a3aeSmrg # the processor, so we play safe by assuming i586. 10564cd6a3aeSmrg # Note: whatever this is, it MUST be the same as what config.sub 10574cd6a3aeSmrg # prints for the "djgpp" host, or else GDB configury will decide that 10584cd6a3aeSmrg # this is a cross-build. 10594cd6a3aeSmrg echo i586-pc-msdosdjgpp 10608c9fbc29Smrg exit ;; 10618c9fbc29Smrg Intel:Mach:3*:*) 10628c9fbc29Smrg echo i386-pc-mach3 10638c9fbc29Smrg exit ;; 10648c9fbc29Smrg paragon:*:*:*) 10658c9fbc29Smrg echo i860-intel-osf1 10668c9fbc29Smrg exit ;; 10678c9fbc29Smrg i860:*:4.*:*) # i860-SVR4 10688c9fbc29Smrg if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then 10698c9fbc29Smrg echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 10708c9fbc29Smrg else # Add other i860-SVR4 vendors below as they are discovered. 10718c9fbc29Smrg echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 10728c9fbc29Smrg fi 10738c9fbc29Smrg exit ;; 10748c9fbc29Smrg mini*:CTIX:SYS*5:*) 10758c9fbc29Smrg # "miniframe" 10768c9fbc29Smrg echo m68010-convergent-sysv 10778c9fbc29Smrg exit ;; 10788c9fbc29Smrg mc68k:UNIX:SYSTEM5:3.51m) 10798c9fbc29Smrg echo m68k-convergent-sysv 10808c9fbc29Smrg exit ;; 10818c9fbc29Smrg M680?0:D-NIX:5.3:*) 10828c9fbc29Smrg echo m68k-diab-dnix 10838c9fbc29Smrg exit ;; 10848c9fbc29Smrg M68*:*:R3V[5678]*:*) 10858c9fbc29Smrg test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 10868c9fbc29Smrg 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) 10878c9fbc29Smrg OS_REL='' 10888c9fbc29Smrg test -r /etc/.relid \ 10898c9fbc29Smrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 10908c9fbc29Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 10918c9fbc29Smrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 10928c9fbc29Smrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 10938c9fbc29Smrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 10948c9fbc29Smrg 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) 10958c9fbc29Smrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 10968c9fbc29Smrg && { echo i486-ncr-sysv4; exit; } ;; 10974cd6a3aeSmrg NCR*:*:4.2:* | MPRAS*:*:4.2:*) 10984cd6a3aeSmrg OS_REL='.3' 10994cd6a3aeSmrg test -r /etc/.relid \ 11004cd6a3aeSmrg && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` 11014cd6a3aeSmrg /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ 11024cd6a3aeSmrg && { echo i486-ncr-sysv4.3${OS_REL}; exit; } 11034cd6a3aeSmrg /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ 11044cd6a3aeSmrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } 11054cd6a3aeSmrg /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ 11064cd6a3aeSmrg && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 11078c9fbc29Smrg m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) 11088c9fbc29Smrg echo m68k-unknown-lynxos${UNAME_RELEASE} 11098c9fbc29Smrg exit ;; 11108c9fbc29Smrg mc68030:UNIX_System_V:4.*:*) 11118c9fbc29Smrg echo m68k-atari-sysv4 11128c9fbc29Smrg exit ;; 11138c9fbc29Smrg TSUNAMI:LynxOS:2.*:*) 11148c9fbc29Smrg echo sparc-unknown-lynxos${UNAME_RELEASE} 11158c9fbc29Smrg exit ;; 11168c9fbc29Smrg rs6000:LynxOS:2.*:*) 11178c9fbc29Smrg echo rs6000-unknown-lynxos${UNAME_RELEASE} 11188c9fbc29Smrg exit ;; 11194cd6a3aeSmrg PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) 11208c9fbc29Smrg echo powerpc-unknown-lynxos${UNAME_RELEASE} 11218c9fbc29Smrg exit ;; 11228c9fbc29Smrg SM[BE]S:UNIX_SV:*:*) 11238c9fbc29Smrg echo mips-dde-sysv${UNAME_RELEASE} 11248c9fbc29Smrg exit ;; 11258c9fbc29Smrg RM*:ReliantUNIX-*:*:*) 11268c9fbc29Smrg echo mips-sni-sysv4 11278c9fbc29Smrg exit ;; 11288c9fbc29Smrg RM*:SINIX-*:*:*) 11298c9fbc29Smrg echo mips-sni-sysv4 11308c9fbc29Smrg exit ;; 11318c9fbc29Smrg *:SINIX-*:*:*) 11328c9fbc29Smrg if uname -p 2>/dev/null >/dev/null ; then 11338c9fbc29Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 11348c9fbc29Smrg echo ${UNAME_MACHINE}-sni-sysv4 11358c9fbc29Smrg else 11368c9fbc29Smrg echo ns32k-sni-sysv 11378c9fbc29Smrg fi 11388c9fbc29Smrg exit ;; 11398c9fbc29Smrg PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort 11408c9fbc29Smrg # says <Richard.M.Bartel@ccMail.Census.GOV> 11418c9fbc29Smrg echo i586-unisys-sysv4 11428c9fbc29Smrg exit ;; 11438c9fbc29Smrg *:UNIX_System_V:4*:FTX*) 11448c9fbc29Smrg # From Gerald Hewes <hewes@openmarket.com>. 11458c9fbc29Smrg # How about differentiating between stratus architectures? -djm 11468c9fbc29Smrg echo hppa1.1-stratus-sysv4 11478c9fbc29Smrg exit ;; 11488c9fbc29Smrg *:*:*:FTX*) 11498c9fbc29Smrg # From seanf@swdc.stratus.com. 11508c9fbc29Smrg echo i860-stratus-sysv4 11518c9fbc29Smrg exit ;; 11528c9fbc29Smrg i*86:VOS:*:*) 11538c9fbc29Smrg # From Paul.Green@stratus.com. 11548c9fbc29Smrg echo ${UNAME_MACHINE}-stratus-vos 11558c9fbc29Smrg exit ;; 11568c9fbc29Smrg *:VOS:*:*) 11578c9fbc29Smrg # From Paul.Green@stratus.com. 11588c9fbc29Smrg echo hppa1.1-stratus-vos 11598c9fbc29Smrg exit ;; 11608c9fbc29Smrg mc68*:A/UX:*:*) 11618c9fbc29Smrg echo m68k-apple-aux${UNAME_RELEASE} 11628c9fbc29Smrg exit ;; 11638c9fbc29Smrg news*:NEWS-OS:6*:*) 11648c9fbc29Smrg echo mips-sony-newsos6 11658c9fbc29Smrg exit ;; 11668c9fbc29Smrg R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) 11678c9fbc29Smrg if [ -d /usr/nec ]; then 11688c9fbc29Smrg echo mips-nec-sysv${UNAME_RELEASE} 11698c9fbc29Smrg else 11708c9fbc29Smrg echo mips-unknown-sysv${UNAME_RELEASE} 11718c9fbc29Smrg fi 11728c9fbc29Smrg exit ;; 11738c9fbc29Smrg BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. 11748c9fbc29Smrg echo powerpc-be-beos 11758c9fbc29Smrg exit ;; 11768c9fbc29Smrg BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. 11778c9fbc29Smrg echo powerpc-apple-beos 11788c9fbc29Smrg exit ;; 11798c9fbc29Smrg BePC:BeOS:*:*) # BeOS running on Intel PC compatible. 11808c9fbc29Smrg echo i586-pc-beos 11818c9fbc29Smrg exit ;; 11824cd6a3aeSmrg BePC:Haiku:*:*) # Haiku running on Intel PC compatible. 11834cd6a3aeSmrg echo i586-pc-haiku 11844cd6a3aeSmrg exit ;; 11858c9fbc29Smrg SX-4:SUPER-UX:*:*) 11868c9fbc29Smrg echo sx4-nec-superux${UNAME_RELEASE} 11878c9fbc29Smrg exit ;; 11888c9fbc29Smrg SX-5:SUPER-UX:*:*) 11898c9fbc29Smrg echo sx5-nec-superux${UNAME_RELEASE} 11908c9fbc29Smrg exit ;; 11918c9fbc29Smrg SX-6:SUPER-UX:*:*) 11928c9fbc29Smrg echo sx6-nec-superux${UNAME_RELEASE} 11938c9fbc29Smrg exit ;; 11944e411241Smrg SX-7:SUPER-UX:*:*) 11954e411241Smrg echo sx7-nec-superux${UNAME_RELEASE} 11964e411241Smrg exit ;; 11974e411241Smrg SX-8:SUPER-UX:*:*) 11984e411241Smrg echo sx8-nec-superux${UNAME_RELEASE} 11994e411241Smrg exit ;; 12004e411241Smrg SX-8R:SUPER-UX:*:*) 12014e411241Smrg echo sx8r-nec-superux${UNAME_RELEASE} 12024e411241Smrg exit ;; 12038c9fbc29Smrg Power*:Rhapsody:*:*) 12048c9fbc29Smrg echo powerpc-apple-rhapsody${UNAME_RELEASE} 12058c9fbc29Smrg exit ;; 12068c9fbc29Smrg *:Rhapsody:*:*) 12078c9fbc29Smrg echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} 12088c9fbc29Smrg exit ;; 12098c9fbc29Smrg *:Darwin:*:*) 12108c9fbc29Smrg UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown 12118c9fbc29Smrg case $UNAME_PROCESSOR in 12124cd6a3aeSmrg i386) 12134cd6a3aeSmrg eval $set_cc_for_build 12144cd6a3aeSmrg if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then 12154cd6a3aeSmrg if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ 12164cd6a3aeSmrg (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ 12174cd6a3aeSmrg grep IS_64BIT_ARCH >/dev/null 12184cd6a3aeSmrg then 12194cd6a3aeSmrg UNAME_PROCESSOR="x86_64" 12204cd6a3aeSmrg fi 12214cd6a3aeSmrg fi ;; 12228c9fbc29Smrg unknown) UNAME_PROCESSOR=powerpc ;; 12238c9fbc29Smrg esac 12248c9fbc29Smrg echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} 12258c9fbc29Smrg exit ;; 12268c9fbc29Smrg *:procnto*:*:* | *:QNX:[0123456789]*:*) 12278c9fbc29Smrg UNAME_PROCESSOR=`uname -p` 12288c9fbc29Smrg if test "$UNAME_PROCESSOR" = "x86"; then 12298c9fbc29Smrg UNAME_PROCESSOR=i386 12308c9fbc29Smrg UNAME_MACHINE=pc 12318c9fbc29Smrg fi 12328c9fbc29Smrg echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} 12338c9fbc29Smrg exit ;; 12348c9fbc29Smrg *:QNX:*:4*) 12358c9fbc29Smrg echo i386-pc-qnx 12368c9fbc29Smrg exit ;; 12378c9fbc29Smrg NSE-?:NONSTOP_KERNEL:*:*) 12388c9fbc29Smrg echo nse-tandem-nsk${UNAME_RELEASE} 12398c9fbc29Smrg exit ;; 12408c9fbc29Smrg NSR-?:NONSTOP_KERNEL:*:*) 12418c9fbc29Smrg echo nsr-tandem-nsk${UNAME_RELEASE} 12428c9fbc29Smrg exit ;; 12438c9fbc29Smrg *:NonStop-UX:*:*) 12448c9fbc29Smrg echo mips-compaq-nonstopux 12458c9fbc29Smrg exit ;; 12468c9fbc29Smrg BS2000:POSIX*:*:*) 12478c9fbc29Smrg echo bs2000-siemens-sysv 12488c9fbc29Smrg exit ;; 12498c9fbc29Smrg DS/*:UNIX_System_V:*:*) 12508c9fbc29Smrg echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} 12518c9fbc29Smrg exit ;; 12528c9fbc29Smrg *:Plan9:*:*) 12538c9fbc29Smrg # "uname -m" is not consistent, so use $cputype instead. 386 12548c9fbc29Smrg # is converted to i386 for consistency with other x86 12558c9fbc29Smrg # operating systems. 12568c9fbc29Smrg if test "$cputype" = "386"; then 12578c9fbc29Smrg UNAME_MACHINE=i386 12588c9fbc29Smrg else 12598c9fbc29Smrg UNAME_MACHINE="$cputype" 12608c9fbc29Smrg fi 12618c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-plan9 12628c9fbc29Smrg exit ;; 12638c9fbc29Smrg *:TOPS-10:*:*) 12648c9fbc29Smrg echo pdp10-unknown-tops10 12658c9fbc29Smrg exit ;; 12668c9fbc29Smrg *:TENEX:*:*) 12678c9fbc29Smrg echo pdp10-unknown-tenex 12688c9fbc29Smrg exit ;; 12698c9fbc29Smrg KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) 12708c9fbc29Smrg echo pdp10-dec-tops20 12718c9fbc29Smrg exit ;; 12728c9fbc29Smrg XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) 12738c9fbc29Smrg echo pdp10-xkl-tops20 12748c9fbc29Smrg exit ;; 12758c9fbc29Smrg *:TOPS-20:*:*) 12768c9fbc29Smrg echo pdp10-unknown-tops20 12778c9fbc29Smrg exit ;; 12788c9fbc29Smrg *:ITS:*:*) 12798c9fbc29Smrg echo pdp10-unknown-its 12808c9fbc29Smrg exit ;; 12818c9fbc29Smrg SEI:*:*:SEIUX) 12828c9fbc29Smrg echo mips-sei-seiux${UNAME_RELEASE} 12838c9fbc29Smrg exit ;; 12848c9fbc29Smrg *:DragonFly:*:*) 12858c9fbc29Smrg echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` 12868c9fbc29Smrg exit ;; 12878c9fbc29Smrg *:*VMS:*:*) 12888c9fbc29Smrg UNAME_MACHINE=`(uname -p) 2>/dev/null` 12898c9fbc29Smrg case "${UNAME_MACHINE}" in 12908c9fbc29Smrg A*) echo alpha-dec-vms ; exit ;; 12918c9fbc29Smrg I*) echo ia64-dec-vms ; exit ;; 12928c9fbc29Smrg V*) echo vax-dec-vms ; exit ;; 12938c9fbc29Smrg esac ;; 12948c9fbc29Smrg *:XENIX:*:SysV) 12958c9fbc29Smrg echo i386-pc-xenix 12968c9fbc29Smrg exit ;; 12978c9fbc29Smrg i*86:skyos:*:*) 12988c9fbc29Smrg echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' 12998c9fbc29Smrg exit ;; 13008c9fbc29Smrg i*86:rdos:*:*) 13018c9fbc29Smrg echo ${UNAME_MACHINE}-pc-rdos 13028c9fbc29Smrg exit ;; 13034cd6a3aeSmrg i*86:AROS:*:*) 13044cd6a3aeSmrg echo ${UNAME_MACHINE}-pc-aros 13054cd6a3aeSmrg exit ;; 13068c9fbc29Smrgesac 13078c9fbc29Smrg 13088c9fbc29Smrg#echo '(No uname command or uname output not recognized.)' 1>&2 13098c9fbc29Smrg#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 13108c9fbc29Smrg 13118c9fbc29Smrgeval $set_cc_for_build 13128c9fbc29Smrgcat >$dummy.c <<EOF 13138c9fbc29Smrg#ifdef _SEQUENT_ 13148c9fbc29Smrg# include <sys/types.h> 13158c9fbc29Smrg# include <sys/utsname.h> 13168c9fbc29Smrg#endif 13178c9fbc29Smrgmain () 13188c9fbc29Smrg{ 13198c9fbc29Smrg#if defined (sony) 13208c9fbc29Smrg#if defined (MIPSEB) 13218c9fbc29Smrg /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, 13228c9fbc29Smrg I don't know.... */ 13238c9fbc29Smrg printf ("mips-sony-bsd\n"); exit (0); 13248c9fbc29Smrg#else 13258c9fbc29Smrg#include <sys/param.h> 13268c9fbc29Smrg printf ("m68k-sony-newsos%s\n", 13278c9fbc29Smrg#ifdef NEWSOS4 13288c9fbc29Smrg "4" 13298c9fbc29Smrg#else 13308c9fbc29Smrg "" 13318c9fbc29Smrg#endif 13328c9fbc29Smrg ); exit (0); 13338c9fbc29Smrg#endif 13348c9fbc29Smrg#endif 13358c9fbc29Smrg 13368c9fbc29Smrg#if defined (__arm) && defined (__acorn) && defined (__unix) 13378c9fbc29Smrg printf ("arm-acorn-riscix\n"); exit (0); 13388c9fbc29Smrg#endif 13398c9fbc29Smrg 13408c9fbc29Smrg#if defined (hp300) && !defined (hpux) 13418c9fbc29Smrg printf ("m68k-hp-bsd\n"); exit (0); 13428c9fbc29Smrg#endif 13438c9fbc29Smrg 13448c9fbc29Smrg#if defined (NeXT) 13458c9fbc29Smrg#if !defined (__ARCHITECTURE__) 13468c9fbc29Smrg#define __ARCHITECTURE__ "m68k" 13478c9fbc29Smrg#endif 13488c9fbc29Smrg int version; 13498c9fbc29Smrg version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; 13508c9fbc29Smrg if (version < 4) 13518c9fbc29Smrg printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); 13528c9fbc29Smrg else 13538c9fbc29Smrg printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); 13548c9fbc29Smrg exit (0); 13558c9fbc29Smrg#endif 13568c9fbc29Smrg 13578c9fbc29Smrg#if defined (MULTIMAX) || defined (n16) 13588c9fbc29Smrg#if defined (UMAXV) 13598c9fbc29Smrg printf ("ns32k-encore-sysv\n"); exit (0); 13608c9fbc29Smrg#else 13618c9fbc29Smrg#if defined (CMU) 13628c9fbc29Smrg printf ("ns32k-encore-mach\n"); exit (0); 13638c9fbc29Smrg#else 13648c9fbc29Smrg printf ("ns32k-encore-bsd\n"); exit (0); 13658c9fbc29Smrg#endif 13668c9fbc29Smrg#endif 13678c9fbc29Smrg#endif 13688c9fbc29Smrg 13698c9fbc29Smrg#if defined (__386BSD__) 13708c9fbc29Smrg printf ("i386-pc-bsd\n"); exit (0); 13718c9fbc29Smrg#endif 13728c9fbc29Smrg 13738c9fbc29Smrg#if defined (sequent) 13748c9fbc29Smrg#if defined (i386) 13758c9fbc29Smrg printf ("i386-sequent-dynix\n"); exit (0); 13768c9fbc29Smrg#endif 13778c9fbc29Smrg#if defined (ns32000) 13788c9fbc29Smrg printf ("ns32k-sequent-dynix\n"); exit (0); 13798c9fbc29Smrg#endif 13808c9fbc29Smrg#endif 13818c9fbc29Smrg 13828c9fbc29Smrg#if defined (_SEQUENT_) 13838c9fbc29Smrg struct utsname un; 13848c9fbc29Smrg 13858c9fbc29Smrg uname(&un); 13868c9fbc29Smrg 13878c9fbc29Smrg if (strncmp(un.version, "V2", 2) == 0) { 13888c9fbc29Smrg printf ("i386-sequent-ptx2\n"); exit (0); 13898c9fbc29Smrg } 13908c9fbc29Smrg if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ 13918c9fbc29Smrg printf ("i386-sequent-ptx1\n"); exit (0); 13928c9fbc29Smrg } 13938c9fbc29Smrg printf ("i386-sequent-ptx\n"); exit (0); 13948c9fbc29Smrg 13958c9fbc29Smrg#endif 13968c9fbc29Smrg 13978c9fbc29Smrg#if defined (vax) 13988c9fbc29Smrg# if !defined (ultrix) 13998c9fbc29Smrg# include <sys/param.h> 14008c9fbc29Smrg# if defined (BSD) 14018c9fbc29Smrg# if BSD == 43 14028c9fbc29Smrg printf ("vax-dec-bsd4.3\n"); exit (0); 14038c9fbc29Smrg# else 14048c9fbc29Smrg# if BSD == 199006 14058c9fbc29Smrg printf ("vax-dec-bsd4.3reno\n"); exit (0); 14068c9fbc29Smrg# else 14078c9fbc29Smrg printf ("vax-dec-bsd\n"); exit (0); 14088c9fbc29Smrg# endif 14098c9fbc29Smrg# endif 14108c9fbc29Smrg# else 14118c9fbc29Smrg printf ("vax-dec-bsd\n"); exit (0); 14128c9fbc29Smrg# endif 14138c9fbc29Smrg# else 14148c9fbc29Smrg printf ("vax-dec-ultrix\n"); exit (0); 14158c9fbc29Smrg# endif 14168c9fbc29Smrg#endif 14178c9fbc29Smrg 14188c9fbc29Smrg#if defined (alliant) && defined (i860) 14198c9fbc29Smrg printf ("i860-alliant-bsd\n"); exit (0); 14208c9fbc29Smrg#endif 14218c9fbc29Smrg 14228c9fbc29Smrg exit (1); 14238c9fbc29Smrg} 14248c9fbc29SmrgEOF 14258c9fbc29Smrg 14268c9fbc29Smrg$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && 14278c9fbc29Smrg { echo "$SYSTEM_NAME"; exit; } 14288c9fbc29Smrg 14298c9fbc29Smrg# Apollos put the system type in the environment. 14308c9fbc29Smrg 14318c9fbc29Smrgtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } 14328c9fbc29Smrg 14338c9fbc29Smrg# Convex versions that predate uname can use getsysinfo(1) 14348c9fbc29Smrg 14358c9fbc29Smrgif [ -x /usr/convex/getsysinfo ] 14368c9fbc29Smrgthen 14378c9fbc29Smrg case `getsysinfo -f cpu_type` in 14388c9fbc29Smrg c1*) 14398c9fbc29Smrg echo c1-convex-bsd 14408c9fbc29Smrg exit ;; 14418c9fbc29Smrg c2*) 14428c9fbc29Smrg if getsysinfo -f scalar_acc 14438c9fbc29Smrg then echo c32-convex-bsd 14448c9fbc29Smrg else echo c2-convex-bsd 14458c9fbc29Smrg fi 14468c9fbc29Smrg exit ;; 14478c9fbc29Smrg c34*) 14488c9fbc29Smrg echo c34-convex-bsd 14498c9fbc29Smrg exit ;; 14508c9fbc29Smrg c38*) 14518c9fbc29Smrg echo c38-convex-bsd 14528c9fbc29Smrg exit ;; 14538c9fbc29Smrg c4*) 14548c9fbc29Smrg echo c4-convex-bsd 14558c9fbc29Smrg exit ;; 14568c9fbc29Smrg esac 14578c9fbc29Smrgfi 14588c9fbc29Smrg 14598c9fbc29Smrgcat >&2 <<EOF 14608c9fbc29Smrg$0: unable to guess system type 14618c9fbc29Smrg 14628c9fbc29SmrgThis script, last modified $timestamp, has failed to recognize 14638c9fbc29Smrgthe operating system you are using. It is advised that you 14648c9fbc29Smrgdownload the most up to date version of the config scripts from 14658c9fbc29Smrg 14664e411241Smrg http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD 14678c9fbc29Smrgand 14684e411241Smrg http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD 14698c9fbc29Smrg 14708c9fbc29SmrgIf the version you run ($0) is already up to date, please 14718c9fbc29Smrgsend the following data and any information you think might be 14728c9fbc29Smrgpertinent to <config-patches@gnu.org> in order to provide the needed 14738c9fbc29Smrginformation to handle your system. 14748c9fbc29Smrg 14758c9fbc29Smrgconfig.guess timestamp = $timestamp 14768c9fbc29Smrg 14778c9fbc29Smrguname -m = `(uname -m) 2>/dev/null || echo unknown` 14788c9fbc29Smrguname -r = `(uname -r) 2>/dev/null || echo unknown` 14798c9fbc29Smrguname -s = `(uname -s) 2>/dev/null || echo unknown` 14808c9fbc29Smrguname -v = `(uname -v) 2>/dev/null || echo unknown` 14818c9fbc29Smrg 14828c9fbc29Smrg/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` 14838c9fbc29Smrg/bin/uname -X = `(/bin/uname -X) 2>/dev/null` 14848c9fbc29Smrg 14858c9fbc29Smrghostinfo = `(hostinfo) 2>/dev/null` 14868c9fbc29Smrg/bin/universe = `(/bin/universe) 2>/dev/null` 14878c9fbc29Smrg/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` 14888c9fbc29Smrg/bin/arch = `(/bin/arch) 2>/dev/null` 14898c9fbc29Smrg/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` 14908c9fbc29Smrg/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` 14918c9fbc29Smrg 14928c9fbc29SmrgUNAME_MACHINE = ${UNAME_MACHINE} 14938c9fbc29SmrgUNAME_RELEASE = ${UNAME_RELEASE} 14948c9fbc29SmrgUNAME_SYSTEM = ${UNAME_SYSTEM} 14958c9fbc29SmrgUNAME_VERSION = ${UNAME_VERSION} 14968c9fbc29SmrgEOF 14978c9fbc29Smrg 14988c9fbc29Smrgexit 1 14998c9fbc29Smrg 15008c9fbc29Smrg# Local variables: 15018c9fbc29Smrg# eval: (add-hook 'write-file-hooks 'time-stamp) 15028c9fbc29Smrg# time-stamp-start: "timestamp='" 15038c9fbc29Smrg# time-stamp-format: "%:y-%02m-%02d" 15048c9fbc29Smrg# time-stamp-end: "'" 15058c9fbc29Smrg# End: 1506