melunko@917: #! /bin/sh melunko@917: # Attempt to guess a canonical system name. melunko@917: # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, melunko@917: # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, melunko@917: # Inc. melunko@917: melunko@917: timestamp='2007-03-06' melunko@917: melunko@917: # This file is free software; you can redistribute it and/or modify it melunko@917: # under the terms of the GNU General Public License as published by melunko@917: # the Free Software Foundation; either version 2 of the License, or melunko@917: # (at your option) any later version. melunko@917: # melunko@917: # This program is distributed in the hope that it will be useful, but melunko@917: # WITHOUT ANY WARRANTY; without even the implied warranty of melunko@917: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU melunko@917: # General Public License for more details. melunko@917: # melunko@917: # You should have received a copy of the GNU General Public License melunko@917: # along with this program; if not, write to the Free Software melunko@917: # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA melunko@917: # 02110-1301, USA. melunko@917: # melunko@917: # As a special exception to the GNU General Public License, if you melunko@917: # distribute this file as part of a program that contains a melunko@917: # configuration script generated by Autoconf, you may include it under melunko@917: # the same distribution terms that you use for the rest of that program. melunko@917: melunko@917: melunko@917: # Originally written by Per Bothner . melunko@917: # Please send patches to . Submit a context melunko@917: # diff and a properly formatted ChangeLog entry. melunko@917: # melunko@917: # This script attempts to guess a canonical system name similar to melunko@917: # config.sub. If it succeeds, it prints the system name on stdout, and melunko@917: # exits with 0. Otherwise, it exits with 1. melunko@917: # melunko@917: # The plan is that this can be called by configure scripts if you melunko@917: # don't specify an explicit build system type. melunko@917: melunko@917: me=`echo "$0" | sed -e 's,.*/,,'` melunko@917: melunko@917: usage="\ melunko@917: Usage: $0 [OPTION] melunko@917: melunko@917: Output the configuration name of the system \`$me' is run on. melunko@917: melunko@917: Operation modes: melunko@917: -h, --help print this help, then exit melunko@917: -t, --time-stamp print date of last modification, then exit melunko@917: -v, --version print version number, then exit melunko@917: melunko@917: Report bugs and patches to ." melunko@917: melunko@917: version="\ melunko@917: GNU config.guess ($timestamp) melunko@917: melunko@917: Originally written by Per Bothner. melunko@917: Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 melunko@917: Free Software Foundation, Inc. melunko@917: melunko@917: This is free software; see the source for copying conditions. There is NO melunko@917: warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." melunko@917: melunko@917: help=" melunko@917: Try \`$me --help' for more information." melunko@917: melunko@917: # Parse command line melunko@917: while test $# -gt 0 ; do melunko@917: case $1 in melunko@917: --time-stamp | --time* | -t ) melunko@917: echo "$timestamp" ; exit ;; melunko@917: --version | -v ) melunko@917: echo "$version" ; exit ;; melunko@917: --help | --h* | -h ) melunko@917: echo "$usage"; exit ;; melunko@917: -- ) # Stop option processing melunko@917: shift; break ;; melunko@917: - ) # Use stdin as input. melunko@917: break ;; melunko@917: -* ) melunko@917: echo "$me: invalid option $1$help" >&2 melunko@917: exit 1 ;; melunko@917: * ) melunko@917: break ;; melunko@917: esac melunko@917: done melunko@917: melunko@917: if test $# != 0; then melunko@917: echo "$me: too many arguments$help" >&2 melunko@917: exit 1 melunko@917: fi melunko@917: melunko@917: trap 'exit 1' 1 2 15 melunko@917: melunko@917: # CC_FOR_BUILD -- compiler used by this script. Note that the use of a melunko@917: # compiler to aid in system detection is discouraged as it requires melunko@917: # temporary files to be created and, as you can see below, it is a melunko@917: # headache to deal with in a portable fashion. melunko@917: melunko@917: # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still melunko@917: # use `HOST_CC' if defined, but it is deprecated. melunko@917: melunko@917: # Portable tmp directory creation inspired by the Autoconf team. melunko@917: melunko@917: set_cc_for_build=' melunko@917: trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; melunko@917: trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; melunko@917: : ${TMPDIR=/tmp} ; melunko@917: { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || melunko@917: { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || melunko@917: { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || melunko@917: { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; melunko@917: dummy=$tmp/dummy ; melunko@917: tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; melunko@917: case $CC_FOR_BUILD,$HOST_CC,$CC in melunko@917: ,,) echo "int x;" > $dummy.c ; melunko@917: for c in cc gcc c89 c99 ; do melunko@917: if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then melunko@917: CC_FOR_BUILD="$c"; break ; melunko@917: fi ; melunko@917: done ; melunko@917: if test x"$CC_FOR_BUILD" = x ; then melunko@917: CC_FOR_BUILD=no_compiler_found ; melunko@917: fi melunko@917: ;; melunko@917: ,,*) CC_FOR_BUILD=$CC ;; melunko@917: ,*,*) CC_FOR_BUILD=$HOST_CC ;; melunko@917: esac ; set_cc_for_build= ;' melunko@917: melunko@917: # This is needed to find uname on a Pyramid OSx when run in the BSD universe. melunko@917: # (ghazi@noc.rutgers.edu 1994-08-24) melunko@917: if (test -f /.attbin/uname) >/dev/null 2>&1 ; then melunko@917: PATH=$PATH:/.attbin ; export PATH melunko@917: fi melunko@917: melunko@917: UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown melunko@917: UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown melunko@917: UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown melunko@917: UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown melunko@917: melunko@917: # Note: order is significant - the case branches are not exclusive. melunko@917: melunko@917: case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in melunko@917: *:NetBSD:*:*) melunko@917: # NetBSD (nbsd) targets should (where applicable) match one or melunko@917: # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, melunko@917: # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently melunko@917: # switched to ELF, *-*-netbsd* would select the old melunko@917: # object file format. This provides both forward melunko@917: # compatibility and a consistent mechanism for selecting the melunko@917: # object file format. melunko@917: # melunko@917: # Note: NetBSD doesn't particularly care about the vendor melunko@917: # portion of the name. We always set it to "unknown". melunko@917: sysctl="sysctl -n hw.machine_arch" melunko@917: UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ melunko@917: /usr/sbin/$sysctl 2>/dev/null || echo unknown)` melunko@917: case "${UNAME_MACHINE_ARCH}" in melunko@917: armeb) machine=armeb-unknown ;; melunko@917: arm*) machine=arm-unknown ;; melunko@917: sh3el) machine=shl-unknown ;; melunko@917: sh3eb) machine=sh-unknown ;; melunko@917: sh5el) machine=sh5le-unknown ;; melunko@917: *) machine=${UNAME_MACHINE_ARCH}-unknown ;; melunko@917: esac melunko@917: # The Operating System including object format, if it has switched melunko@917: # to ELF recently, or will in the future. melunko@917: case "${UNAME_MACHINE_ARCH}" in melunko@917: arm*|i386|m68k|ns32k|sh3*|sparc|vax) melunko@917: eval $set_cc_for_build melunko@917: if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ melunko@917: | grep __ELF__ >/dev/null melunko@917: then melunko@917: # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). melunko@917: # Return netbsd for either. FIX? melunko@917: os=netbsd melunko@917: else melunko@917: os=netbsdelf melunko@917: fi melunko@917: ;; melunko@917: *) melunko@917: os=netbsd melunko@917: ;; melunko@917: esac melunko@917: # The OS release melunko@917: # Debian GNU/NetBSD machines have a different userland, and melunko@917: # thus, need a distinct triplet. However, they do not need melunko@917: # kernel version information, so it can be replaced with a melunko@917: # suitable tag, in the style of linux-gnu. melunko@917: case "${UNAME_VERSION}" in melunko@917: Debian*) melunko@917: release='-gnu' melunko@917: ;; melunko@917: *) melunko@917: release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` melunko@917: ;; melunko@917: esac melunko@917: # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: melunko@917: # contains redundant information, the shorter form: melunko@917: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. melunko@917: echo "${machine}-${os}${release}" melunko@917: exit ;; melunko@917: *:OpenBSD:*:*) melunko@917: UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` melunko@917: echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:ekkoBSD:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:SolidBSD:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} melunko@917: exit ;; melunko@917: macppc:MirBSD:*:*) melunko@917: echo powerpc-unknown-mirbsd${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:MirBSD:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} melunko@917: exit ;; melunko@917: alpha:OSF1:*:*) melunko@917: case $UNAME_RELEASE in melunko@917: *4.0) melunko@917: UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` melunko@917: ;; melunko@917: *5.*) melunko@917: UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` melunko@917: ;; melunko@917: esac melunko@917: # According to Compaq, /usr/sbin/psrinfo has been available on melunko@917: # OSF/1 and Tru64 systems produced since 1995. I hope that melunko@917: # covers most systems running today. This code pipes the CPU melunko@917: # types through head -n 1, so we only detect the type of CPU 0. melunko@917: ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` melunko@917: case "$ALPHA_CPU_TYPE" in melunko@917: "EV4 (21064)") melunko@917: UNAME_MACHINE="alpha" ;; melunko@917: "EV4.5 (21064)") melunko@917: UNAME_MACHINE="alpha" ;; melunko@917: "LCA4 (21066/21068)") melunko@917: UNAME_MACHINE="alpha" ;; melunko@917: "EV5 (21164)") melunko@917: UNAME_MACHINE="alphaev5" ;; melunko@917: "EV5.6 (21164A)") melunko@917: UNAME_MACHINE="alphaev56" ;; melunko@917: "EV5.6 (21164PC)") melunko@917: UNAME_MACHINE="alphapca56" ;; melunko@917: "EV5.7 (21164PC)") melunko@917: UNAME_MACHINE="alphapca57" ;; melunko@917: "EV6 (21264)") melunko@917: UNAME_MACHINE="alphaev6" ;; melunko@917: "EV6.7 (21264A)") melunko@917: UNAME_MACHINE="alphaev67" ;; melunko@917: "EV6.8CB (21264C)") melunko@917: UNAME_MACHINE="alphaev68" ;; melunko@917: "EV6.8AL (21264B)") melunko@917: UNAME_MACHINE="alphaev68" ;; melunko@917: "EV6.8CX (21264D)") melunko@917: UNAME_MACHINE="alphaev68" ;; melunko@917: "EV6.9A (21264/EV69A)") melunko@917: UNAME_MACHINE="alphaev69" ;; melunko@917: "EV7 (21364)") melunko@917: UNAME_MACHINE="alphaev7" ;; melunko@917: "EV7.9 (21364A)") melunko@917: UNAME_MACHINE="alphaev79" ;; melunko@917: esac melunko@917: # A Pn.n version is a patched version. melunko@917: # A Vn.n version is a released version. melunko@917: # A Tn.n version is a released field test version. melunko@917: # A Xn.n version is an unreleased experimental baselevel. melunko@917: # 1.2 uses "1.2" for uname -r. melunko@917: echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` melunko@917: exit ;; melunko@917: Alpha\ *:Windows_NT*:*) melunko@917: # How do we know it's Interix rather than the generic POSIX subsystem? melunko@917: # Should we change UNAME_MACHINE based on the output of uname instead melunko@917: # of the specific Alpha model? melunko@917: echo alpha-pc-interix melunko@917: exit ;; melunko@917: 21064:Windows_NT:50:3) melunko@917: echo alpha-dec-winnt3.5 melunko@917: exit ;; melunko@917: Amiga*:UNIX_System_V:4.0:*) melunko@917: echo m68k-unknown-sysv4 melunko@917: exit ;; melunko@917: *:[Aa]miga[Oo][Ss]:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-amigaos melunko@917: exit ;; melunko@917: *:[Mm]orph[Oo][Ss]:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-morphos melunko@917: exit ;; melunko@917: *:OS/390:*:*) melunko@917: echo i370-ibm-openedition melunko@917: exit ;; melunko@917: *:z/VM:*:*) melunko@917: echo s390-ibm-zvmoe melunko@917: exit ;; melunko@917: *:OS400:*:*) melunko@917: echo powerpc-ibm-os400 melunko@917: exit ;; melunko@917: arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) melunko@917: echo arm-acorn-riscix${UNAME_RELEASE} melunko@917: exit ;; melunko@917: arm:riscos:*:*|arm:RISCOS:*:*) melunko@917: echo arm-unknown-riscos melunko@917: exit ;; melunko@917: SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) melunko@917: echo hppa1.1-hitachi-hiuxmpp melunko@917: exit ;; melunko@917: Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) melunko@917: # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. melunko@917: if test "`(/bin/universe) 2>/dev/null`" = att ; then melunko@917: echo pyramid-pyramid-sysv3 melunko@917: else melunko@917: echo pyramid-pyramid-bsd melunko@917: fi melunko@917: exit ;; melunko@917: NILE*:*:*:dcosx) melunko@917: echo pyramid-pyramid-svr4 melunko@917: exit ;; melunko@917: DRS?6000:unix:4.0:6*) melunko@917: echo sparc-icl-nx6 melunko@917: exit ;; melunko@917: DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) melunko@917: case `/usr/bin/uname -p` in melunko@917: sparc) echo sparc-icl-nx7; exit ;; melunko@917: esac ;; melunko@917: sun4H:SunOS:5.*:*) melunko@917: echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` melunko@917: exit ;; melunko@917: sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) melunko@917: echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` melunko@917: exit ;; melunko@917: i86pc:SunOS:5.*:*) melunko@917: echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` melunko@917: exit ;; melunko@917: sun4*:SunOS:6*:*) melunko@917: # According to config.sub, this is the proper way to canonicalize melunko@917: # SunOS6. Hard to guess exactly what SunOS6 will be like, but melunko@917: # it's likely to be more like Solaris than SunOS4. melunko@917: echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` melunko@917: exit ;; melunko@917: sun4*:SunOS:*:*) melunko@917: case "`/usr/bin/arch -k`" in melunko@917: Series*|S4*) melunko@917: UNAME_RELEASE=`uname -v` melunko@917: ;; melunko@917: esac melunko@917: # Japanese Language versions have a version number like `4.1.3-JL'. melunko@917: echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` melunko@917: exit ;; melunko@917: sun3*:SunOS:*:*) melunko@917: echo m68k-sun-sunos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: sun*:*:4.2BSD:*) melunko@917: UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` melunko@917: test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 melunko@917: case "`/bin/arch`" in melunko@917: sun3) melunko@917: echo m68k-sun-sunos${UNAME_RELEASE} melunko@917: ;; melunko@917: sun4) melunko@917: echo sparc-sun-sunos${UNAME_RELEASE} melunko@917: ;; melunko@917: esac melunko@917: exit ;; melunko@917: aushp:SunOS:*:*) melunko@917: echo sparc-auspex-sunos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: # The situation for MiNT is a little confusing. The machine name melunko@917: # can be virtually everything (everything which is not melunko@917: # "atarist" or "atariste" at least should have a processor melunko@917: # > m68000). The system name ranges from "MiNT" over "FreeMiNT" melunko@917: # to the lowercase version "mint" (or "freemint"). Finally melunko@917: # the system name "TOS" denotes a system which is actually not melunko@917: # MiNT. But MiNT is downward compatible to TOS, so this should melunko@917: # be no problem. melunko@917: atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) melunko@917: echo m68k-atari-mint${UNAME_RELEASE} melunko@917: exit ;; melunko@917: atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) melunko@917: echo m68k-atari-mint${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) melunko@917: echo m68k-atari-mint${UNAME_RELEASE} melunko@917: exit ;; melunko@917: milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) melunko@917: echo m68k-milan-mint${UNAME_RELEASE} melunko@917: exit ;; melunko@917: hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) melunko@917: echo m68k-hades-mint${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) melunko@917: echo m68k-unknown-mint${UNAME_RELEASE} melunko@917: exit ;; melunko@917: m68k:machten:*:*) melunko@917: echo m68k-apple-machten${UNAME_RELEASE} melunko@917: exit ;; melunko@917: powerpc:machten:*:*) melunko@917: echo powerpc-apple-machten${UNAME_RELEASE} melunko@917: exit ;; melunko@917: RISC*:Mach:*:*) melunko@917: echo mips-dec-mach_bsd4.3 melunko@917: exit ;; melunko@917: RISC*:ULTRIX:*:*) melunko@917: echo mips-dec-ultrix${UNAME_RELEASE} melunko@917: exit ;; melunko@917: VAX*:ULTRIX*:*:*) melunko@917: echo vax-dec-ultrix${UNAME_RELEASE} melunko@917: exit ;; melunko@917: 2020:CLIX:*:* | 2430:CLIX:*:*) melunko@917: echo clipper-intergraph-clix${UNAME_RELEASE} melunko@917: exit ;; melunko@917: mips:*:*:UMIPS | mips:*:*:RISCos) melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: #ifdef __cplusplus melunko@917: #include /* for printf() prototype */ melunko@917: int main (int argc, char *argv[]) { melunko@917: #else melunko@917: int main (argc, argv) int argc; char *argv[]; { melunko@917: #endif melunko@917: #if defined (host_mips) && defined (MIPSEB) melunko@917: #if defined (SYSTYPE_SYSV) melunko@917: printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); melunko@917: #endif melunko@917: #if defined (SYSTYPE_SVR4) melunko@917: printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); melunko@917: #endif melunko@917: #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) melunko@917: printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); melunko@917: #endif melunko@917: #endif melunko@917: exit (-1); melunko@917: } melunko@917: EOF melunko@917: $CC_FOR_BUILD -o $dummy $dummy.c && melunko@917: dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && melunko@917: SYSTEM_NAME=`$dummy $dummyarg` && melunko@917: { echo "$SYSTEM_NAME"; exit; } melunko@917: echo mips-mips-riscos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: Motorola:PowerMAX_OS:*:*) melunko@917: echo powerpc-motorola-powermax melunko@917: exit ;; melunko@917: Motorola:*:4.3:PL8-*) melunko@917: echo powerpc-harris-powermax melunko@917: exit ;; melunko@917: Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) melunko@917: echo powerpc-harris-powermax melunko@917: exit ;; melunko@917: Night_Hawk:Power_UNIX:*:*) melunko@917: echo powerpc-harris-powerunix melunko@917: exit ;; melunko@917: m88k:CX/UX:7*:*) melunko@917: echo m88k-harris-cxux7 melunko@917: exit ;; melunko@917: m88k:*:4*:R4*) melunko@917: echo m88k-motorola-sysv4 melunko@917: exit ;; melunko@917: m88k:*:3*:R3*) melunko@917: echo m88k-motorola-sysv3 melunko@917: exit ;; melunko@917: AViiON:dgux:*:*) melunko@917: # DG/UX returns AViiON for all architectures melunko@917: UNAME_PROCESSOR=`/usr/bin/uname -p` melunko@917: if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] melunko@917: then melunko@917: if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ melunko@917: [ ${TARGET_BINARY_INTERFACE}x = x ] melunko@917: then melunko@917: echo m88k-dg-dgux${UNAME_RELEASE} melunko@917: else melunko@917: echo m88k-dg-dguxbcs${UNAME_RELEASE} melunko@917: fi melunko@917: else melunko@917: echo i586-dg-dgux${UNAME_RELEASE} melunko@917: fi melunko@917: exit ;; melunko@917: M88*:DolphinOS:*:*) # DolphinOS (SVR3) melunko@917: echo m88k-dolphin-sysv3 melunko@917: exit ;; melunko@917: M88*:*:R3*:*) melunko@917: # Delta 88k system running SVR3 melunko@917: echo m88k-motorola-sysv3 melunko@917: exit ;; melunko@917: XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) melunko@917: echo m88k-tektronix-sysv3 melunko@917: exit ;; melunko@917: Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) melunko@917: echo m68k-tektronix-bsd melunko@917: exit ;; melunko@917: *:IRIX*:*:*) melunko@917: echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` melunko@917: exit ;; melunko@917: ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. melunko@917: echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id melunko@917: exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' melunko@917: i*86:AIX:*:*) melunko@917: echo i386-ibm-aix melunko@917: exit ;; melunko@917: ia64:AIX:*:*) melunko@917: if [ -x /usr/bin/oslevel ] ; then melunko@917: IBM_REV=`/usr/bin/oslevel` melunko@917: else melunko@917: IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} melunko@917: fi melunko@917: echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} melunko@917: exit ;; melunko@917: *:AIX:2:3) melunko@917: if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: #include melunko@917: melunko@917: main() melunko@917: { melunko@917: if (!__power_pc()) melunko@917: exit(1); melunko@917: puts("powerpc-ibm-aix3.2.5"); melunko@917: exit(0); melunko@917: } melunko@917: EOF melunko@917: if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` melunko@917: then melunko@917: echo "$SYSTEM_NAME" melunko@917: else melunko@917: echo rs6000-ibm-aix3.2.5 melunko@917: fi melunko@917: elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then melunko@917: echo rs6000-ibm-aix3.2.4 melunko@917: else melunko@917: echo rs6000-ibm-aix3.2 melunko@917: fi melunko@917: exit ;; melunko@917: *:AIX:*:[45]) melunko@917: IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` melunko@917: if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then melunko@917: IBM_ARCH=rs6000 melunko@917: else melunko@917: IBM_ARCH=powerpc melunko@917: fi melunko@917: if [ -x /usr/bin/oslevel ] ; then melunko@917: IBM_REV=`/usr/bin/oslevel` melunko@917: else melunko@917: IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} melunko@917: fi melunko@917: echo ${IBM_ARCH}-ibm-aix${IBM_REV} melunko@917: exit ;; melunko@917: *:AIX:*:*) melunko@917: echo rs6000-ibm-aix melunko@917: exit ;; melunko@917: ibmrt:4.4BSD:*|romp-ibm:BSD:*) melunko@917: echo romp-ibm-bsd4.4 melunko@917: exit ;; melunko@917: ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and melunko@917: echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to melunko@917: exit ;; # report: romp-ibm BSD 4.3 melunko@917: *:BOSX:*:*) melunko@917: echo rs6000-bull-bosx melunko@917: exit ;; melunko@917: DPX/2?00:B.O.S.:*:*) melunko@917: echo m68k-bull-sysv3 melunko@917: exit ;; melunko@917: 9000/[34]??:4.3bsd:1.*:*) melunko@917: echo m68k-hp-bsd melunko@917: exit ;; melunko@917: hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) melunko@917: echo m68k-hp-bsd4.4 melunko@917: exit ;; melunko@917: 9000/[34678]??:HP-UX:*:*) melunko@917: HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` melunko@917: case "${UNAME_MACHINE}" in melunko@917: 9000/31? ) HP_ARCH=m68000 ;; melunko@917: 9000/[34]?? ) HP_ARCH=m68k ;; melunko@917: 9000/[678][0-9][0-9]) melunko@917: if [ -x /usr/bin/getconf ]; then melunko@917: sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` melunko@917: sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` melunko@917: case "${sc_cpu_version}" in melunko@917: 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 melunko@917: 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 melunko@917: 532) # CPU_PA_RISC2_0 melunko@917: case "${sc_kernel_bits}" in melunko@917: 32) HP_ARCH="hppa2.0n" ;; melunko@917: 64) HP_ARCH="hppa2.0w" ;; melunko@917: '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 melunko@917: esac ;; melunko@917: esac melunko@917: fi melunko@917: if [ "${HP_ARCH}" = "" ]; then melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: melunko@917: #define _HPUX_SOURCE melunko@917: #include melunko@917: #include melunko@917: melunko@917: int main () melunko@917: { melunko@917: #if defined(_SC_KERNEL_BITS) melunko@917: long bits = sysconf(_SC_KERNEL_BITS); melunko@917: #endif melunko@917: long cpu = sysconf (_SC_CPU_VERSION); melunko@917: melunko@917: switch (cpu) melunko@917: { melunko@917: case CPU_PA_RISC1_0: puts ("hppa1.0"); break; melunko@917: case CPU_PA_RISC1_1: puts ("hppa1.1"); break; melunko@917: case CPU_PA_RISC2_0: melunko@917: #if defined(_SC_KERNEL_BITS) melunko@917: switch (bits) melunko@917: { melunko@917: case 64: puts ("hppa2.0w"); break; melunko@917: case 32: puts ("hppa2.0n"); break; melunko@917: default: puts ("hppa2.0"); break; melunko@917: } break; melunko@917: #else /* !defined(_SC_KERNEL_BITS) */ melunko@917: puts ("hppa2.0"); break; melunko@917: #endif melunko@917: default: puts ("hppa1.0"); break; melunko@917: } melunko@917: exit (0); melunko@917: } melunko@917: EOF melunko@917: (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` melunko@917: test -z "$HP_ARCH" && HP_ARCH=hppa melunko@917: fi ;; melunko@917: esac melunko@917: if [ ${HP_ARCH} = "hppa2.0w" ] melunko@917: then melunko@917: eval $set_cc_for_build melunko@917: melunko@917: # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating melunko@917: # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler melunko@917: # generating 64-bit code. GNU and HP use different nomenclature: melunko@917: # melunko@917: # $ CC_FOR_BUILD=cc ./config.guess melunko@917: # => hppa2.0w-hp-hpux11.23 melunko@917: # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess melunko@917: # => hppa64-hp-hpux11.23 melunko@917: melunko@917: if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | melunko@917: grep __LP64__ >/dev/null melunko@917: then melunko@917: HP_ARCH="hppa2.0w" melunko@917: else melunko@917: HP_ARCH="hppa64" melunko@917: fi melunko@917: fi melunko@917: echo ${HP_ARCH}-hp-hpux${HPUX_REV} melunko@917: exit ;; melunko@917: ia64:HP-UX:*:*) melunko@917: HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` melunko@917: echo ia64-hp-hpux${HPUX_REV} melunko@917: exit ;; melunko@917: 3050*:HI-UX:*:*) melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: #include melunko@917: int melunko@917: main () melunko@917: { melunko@917: long cpu = sysconf (_SC_CPU_VERSION); melunko@917: /* The order matters, because CPU_IS_HP_MC68K erroneously returns melunko@917: true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct melunko@917: results, however. */ melunko@917: if (CPU_IS_PA_RISC (cpu)) melunko@917: { melunko@917: switch (cpu) melunko@917: { melunko@917: case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; melunko@917: case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; melunko@917: case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; melunko@917: default: puts ("hppa-hitachi-hiuxwe2"); break; melunko@917: } melunko@917: } melunko@917: else if (CPU_IS_HP_MC68K (cpu)) melunko@917: puts ("m68k-hitachi-hiuxwe2"); melunko@917: else puts ("unknown-hitachi-hiuxwe2"); melunko@917: exit (0); melunko@917: } melunko@917: EOF melunko@917: $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && melunko@917: { echo "$SYSTEM_NAME"; exit; } melunko@917: echo unknown-hitachi-hiuxwe2 melunko@917: exit ;; melunko@917: 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) melunko@917: echo hppa1.1-hp-bsd melunko@917: exit ;; melunko@917: 9000/8??:4.3bsd:*:*) melunko@917: echo hppa1.0-hp-bsd melunko@917: exit ;; melunko@917: *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) melunko@917: echo hppa1.0-hp-mpeix melunko@917: exit ;; melunko@917: hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) melunko@917: echo hppa1.1-hp-osf melunko@917: exit ;; melunko@917: hp8??:OSF1:*:*) melunko@917: echo hppa1.0-hp-osf melunko@917: exit ;; melunko@917: i*86:OSF1:*:*) melunko@917: if [ -x /usr/sbin/sysversion ] ; then melunko@917: echo ${UNAME_MACHINE}-unknown-osf1mk melunko@917: else melunko@917: echo ${UNAME_MACHINE}-unknown-osf1 melunko@917: fi melunko@917: exit ;; melunko@917: parisc*:Lites*:*:*) melunko@917: echo hppa1.1-hp-lites melunko@917: exit ;; melunko@917: C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) melunko@917: echo c1-convex-bsd melunko@917: exit ;; melunko@917: C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) melunko@917: if getsysinfo -f scalar_acc melunko@917: then echo c32-convex-bsd melunko@917: else echo c2-convex-bsd melunko@917: fi melunko@917: exit ;; melunko@917: C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) melunko@917: echo c34-convex-bsd melunko@917: exit ;; melunko@917: C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) melunko@917: echo c38-convex-bsd melunko@917: exit ;; melunko@917: C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) melunko@917: echo c4-convex-bsd melunko@917: exit ;; melunko@917: CRAY*Y-MP:*:*:*) melunko@917: echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' melunko@917: exit ;; melunko@917: CRAY*[A-Z]90:*:*:*) melunko@917: echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ melunko@917: | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ melunko@917: -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ melunko@917: -e 's/\.[^.]*$/.X/' melunko@917: exit ;; melunko@917: CRAY*TS:*:*:*) melunko@917: echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' melunko@917: exit ;; melunko@917: CRAY*T3E:*:*:*) melunko@917: echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' melunko@917: exit ;; melunko@917: CRAY*SV1:*:*:*) melunko@917: echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' melunko@917: exit ;; melunko@917: *:UNICOS/mp:*:*) melunko@917: echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' melunko@917: exit ;; melunko@917: F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) melunko@917: FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` melunko@917: FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` melunko@917: FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` melunko@917: echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" melunko@917: exit ;; melunko@917: 5000:UNIX_System_V:4.*:*) melunko@917: FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` melunko@917: FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` melunko@917: echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" melunko@917: exit ;; melunko@917: i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) melunko@917: echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} melunko@917: exit ;; melunko@917: sparc*:BSD/OS:*:*) melunko@917: echo sparc-unknown-bsdi${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:BSD/OS:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:FreeBSD:*:*) melunko@917: case ${UNAME_MACHINE} in melunko@917: pc98) melunko@917: echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; melunko@917: amd64) melunko@917: echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; melunko@917: *) melunko@917: echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; melunko@917: esac melunko@917: exit ;; melunko@917: i*:CYGWIN*:*) melunko@917: echo ${UNAME_MACHINE}-pc-cygwin melunko@917: exit ;; melunko@917: *:MINGW*:*) melunko@917: echo ${UNAME_MACHINE}-pc-mingw32 melunko@917: exit ;; melunko@917: i*:windows32*:*) melunko@917: # uname -m includes "-pc" on this system. melunko@917: echo ${UNAME_MACHINE}-mingw32 melunko@917: exit ;; melunko@917: i*:PW*:*) melunko@917: echo ${UNAME_MACHINE}-pc-pw32 melunko@917: exit ;; melunko@917: *:Interix*:[3456]*) melunko@917: case ${UNAME_MACHINE} in melunko@917: x86) melunko@917: echo i586-pc-interix${UNAME_RELEASE} melunko@917: exit ;; melunko@917: EM64T | authenticamd) melunko@917: echo x86_64-unknown-interix${UNAME_RELEASE} melunko@917: exit ;; melunko@917: esac ;; melunko@917: [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) melunko@917: echo i${UNAME_MACHINE}-pc-mks melunko@917: exit ;; melunko@917: i*:Windows_NT*:* | Pentium*:Windows_NT*:*) melunko@917: # How do we know it's Interix rather than the generic POSIX subsystem? melunko@917: # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we melunko@917: # UNAME_MACHINE based on the output of uname instead of i386? melunko@917: echo i586-pc-interix melunko@917: exit ;; melunko@917: i*:UWIN*:*) melunko@917: echo ${UNAME_MACHINE}-pc-uwin melunko@917: exit ;; melunko@917: amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) melunko@917: echo x86_64-unknown-cygwin melunko@917: exit ;; melunko@917: p*:CYGWIN*:*) melunko@917: echo powerpcle-unknown-cygwin melunko@917: exit ;; melunko@917: prep*:SunOS:5.*:*) melunko@917: echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` melunko@917: exit ;; melunko@917: *:GNU:*:*) melunko@917: # the GNU system melunko@917: echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` melunko@917: exit ;; melunko@917: *:GNU/*:*:*) melunko@917: # other systems with GNU libc and userland melunko@917: echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu melunko@917: exit ;; melunko@917: i*86:Minix:*:*) melunko@917: echo ${UNAME_MACHINE}-pc-minix melunko@917: exit ;; melunko@917: arm*:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: avr32*:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: cris:Linux:*:*) melunko@917: echo cris-axis-linux-gnu melunko@917: exit ;; melunko@917: crisv32:Linux:*:*) melunko@917: echo crisv32-axis-linux-gnu melunko@917: exit ;; melunko@917: frv:Linux:*:*) melunko@917: echo frv-unknown-linux-gnu melunko@917: exit ;; melunko@917: ia64:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: m32r*:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: m68*:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: mips:Linux:*:*) melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: #undef CPU melunko@917: #undef mips melunko@917: #undef mipsel melunko@917: #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) melunko@917: CPU=mipsel melunko@917: #else melunko@917: #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) melunko@917: CPU=mips melunko@917: #else melunko@917: CPU= melunko@917: #endif melunko@917: #endif melunko@917: EOF melunko@917: eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' melunko@917: /^CPU/{ melunko@917: s: ::g melunko@917: p melunko@917: }'`" melunko@917: test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } melunko@917: ;; melunko@917: mips64:Linux:*:*) melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: #undef CPU melunko@917: #undef mips64 melunko@917: #undef mips64el melunko@917: #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) melunko@917: CPU=mips64el melunko@917: #else melunko@917: #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) melunko@917: CPU=mips64 melunko@917: #else melunko@917: CPU= melunko@917: #endif melunko@917: #endif melunko@917: EOF melunko@917: eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' melunko@917: /^CPU/{ melunko@917: s: ::g melunko@917: p melunko@917: }'`" melunko@917: test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } melunko@917: ;; melunko@917: or32:Linux:*:*) melunko@917: echo or32-unknown-linux-gnu melunko@917: exit ;; melunko@917: ppc:Linux:*:*) melunko@917: echo powerpc-unknown-linux-gnu melunko@917: exit ;; melunko@917: ppc64:Linux:*:*) melunko@917: echo powerpc64-unknown-linux-gnu melunko@917: exit ;; melunko@917: alpha:Linux:*:*) melunko@917: case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in melunko@917: EV5) UNAME_MACHINE=alphaev5 ;; melunko@917: EV56) UNAME_MACHINE=alphaev56 ;; melunko@917: PCA56) UNAME_MACHINE=alphapca56 ;; melunko@917: PCA57) UNAME_MACHINE=alphapca56 ;; melunko@917: EV6) UNAME_MACHINE=alphaev6 ;; melunko@917: EV67) UNAME_MACHINE=alphaev67 ;; melunko@917: EV68*) UNAME_MACHINE=alphaev68 ;; melunko@917: esac melunko@917: objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null melunko@917: if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} melunko@917: exit ;; melunko@917: parisc:Linux:*:* | hppa:Linux:*:*) melunko@917: # Look for CPU level melunko@917: case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in melunko@917: PA7*) echo hppa1.1-unknown-linux-gnu ;; melunko@917: PA8*) echo hppa2.0-unknown-linux-gnu ;; melunko@917: *) echo hppa-unknown-linux-gnu ;; melunko@917: esac melunko@917: exit ;; melunko@917: parisc64:Linux:*:* | hppa64:Linux:*:*) melunko@917: echo hppa64-unknown-linux-gnu melunko@917: exit ;; melunko@917: s390:Linux:*:* | s390x:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-ibm-linux melunko@917: exit ;; melunko@917: sh64*:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: sh*:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: sparc:Linux:*:* | sparc64:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-linux-gnu melunko@917: exit ;; melunko@917: vax:Linux:*:*) melunko@917: echo ${UNAME_MACHINE}-dec-linux-gnu melunko@917: exit ;; melunko@917: x86_64:Linux:*:*) melunko@917: echo x86_64-unknown-linux-gnu melunko@917: exit ;; melunko@917: xtensa:Linux:*:*) melunko@917: echo xtensa-unknown-linux-gnu melunko@917: exit ;; melunko@917: i*86:Linux:*:*) melunko@917: # The BFD linker knows what the default object file format is, so melunko@917: # first see if it will tell us. cd to the root directory to prevent melunko@917: # problems with other programs or directories called `ld' in the path. melunko@917: # Set LC_ALL=C to ensure ld outputs messages in English. melunko@917: ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ melunko@917: | sed -ne '/supported targets:/!d melunko@917: s/[ ][ ]*/ /g melunko@917: s/.*supported targets: *// melunko@917: s/ .*// melunko@917: p'` melunko@917: case "$ld_supported_targets" in melunko@917: elf32-i386) melunko@917: TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" melunko@917: ;; melunko@917: a.out-i386-linux) melunko@917: echo "${UNAME_MACHINE}-pc-linux-gnuaout" melunko@917: exit ;; melunko@917: coff-i386) melunko@917: echo "${UNAME_MACHINE}-pc-linux-gnucoff" melunko@917: exit ;; melunko@917: "") melunko@917: # Either a pre-BFD a.out linker (linux-gnuoldld) or melunko@917: # one that does not give us useful --help. melunko@917: echo "${UNAME_MACHINE}-pc-linux-gnuoldld" melunko@917: exit ;; melunko@917: esac melunko@917: # Determine whether the default compiler is a.out or elf melunko@917: eval $set_cc_for_build melunko@917: sed 's/^ //' << EOF >$dummy.c melunko@917: #include melunko@917: #ifdef __ELF__ melunko@917: # ifdef __GLIBC__ melunko@917: # if __GLIBC__ >= 2 melunko@917: LIBC=gnu melunko@917: # else melunko@917: LIBC=gnulibc1 melunko@917: # endif melunko@917: # else melunko@917: LIBC=gnulibc1 melunko@917: # endif melunko@917: #else melunko@917: #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) melunko@917: LIBC=gnu melunko@917: #else melunko@917: LIBC=gnuaout melunko@917: #endif melunko@917: #endif melunko@917: #ifdef __dietlibc__ melunko@917: LIBC=dietlibc melunko@917: #endif melunko@917: EOF melunko@917: eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' melunko@917: /^LIBC/{ melunko@917: s: ::g melunko@917: p melunko@917: }'`" melunko@917: test x"${LIBC}" != x && { melunko@917: echo "${UNAME_MACHINE}-pc-linux-${LIBC}" melunko@917: exit melunko@917: } melunko@917: test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } melunko@917: ;; melunko@917: i*86:DYNIX/ptx:4*:*) melunko@917: # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. melunko@917: # earlier versions are messed up and put the nodename in both melunko@917: # sysname and nodename. melunko@917: echo i386-sequent-sysv4 melunko@917: exit ;; melunko@917: i*86:UNIX_SV:4.2MP:2.*) melunko@917: # Unixware is an offshoot of SVR4, but it has its own version melunko@917: # number series starting with 2... melunko@917: # I am not positive that other SVR4 systems won't match this, melunko@917: # I just have to hope. -- rms. melunko@917: # Use sysv4.2uw... so that sysv4* matches it. melunko@917: echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} melunko@917: exit ;; melunko@917: i*86:OS/2:*:*) melunko@917: # If we were able to find `uname', then EMX Unix compatibility melunko@917: # is probably installed. melunko@917: echo ${UNAME_MACHINE}-pc-os2-emx melunko@917: exit ;; melunko@917: i*86:XTS-300:*:STOP) melunko@917: echo ${UNAME_MACHINE}-unknown-stop melunko@917: exit ;; melunko@917: i*86:atheos:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-atheos melunko@917: exit ;; melunko@917: i*86:syllable:*:*) melunko@917: echo ${UNAME_MACHINE}-pc-syllable melunko@917: exit ;; melunko@917: i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) melunko@917: echo i386-unknown-lynxos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: i*86:*DOS:*:*) melunko@917: echo ${UNAME_MACHINE}-pc-msdosdjgpp melunko@917: exit ;; melunko@917: i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) melunko@917: UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` melunko@917: if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then melunko@917: echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} melunko@917: else melunko@917: echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} melunko@917: fi melunko@917: exit ;; melunko@917: i*86:*:5:[678]*) melunko@917: # UnixWare 7.x, OpenUNIX and OpenServer 6. melunko@917: case `/bin/uname -X | grep "^Machine"` in melunko@917: *486*) UNAME_MACHINE=i486 ;; melunko@917: *Pentium) UNAME_MACHINE=i586 ;; melunko@917: *Pent*|*Celeron) UNAME_MACHINE=i686 ;; melunko@917: esac melunko@917: echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} melunko@917: exit ;; melunko@917: i*86:*:3.2:*) melunko@917: if test -f /usr/options/cb.name; then melunko@917: UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then melunko@917: UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` melunko@917: (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 melunko@917: (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ melunko@917: && UNAME_MACHINE=i586 melunko@917: (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ melunko@917: && UNAME_MACHINE=i686 melunko@917: (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ melunko@917: && UNAME_MACHINE=i686 melunko@917: echo ${UNAME_MACHINE}-pc-sco$UNAME_REL melunko@917: else melunko@917: echo ${UNAME_MACHINE}-pc-sysv32 melunko@917: fi melunko@917: exit ;; melunko@917: pc:*:*:*) melunko@917: # Left here for compatibility: melunko@917: # uname -m prints for DJGPP always 'pc', but it prints nothing about melunko@917: # the processor, so we play safe by assuming i386. melunko@917: echo i386-pc-msdosdjgpp melunko@917: exit ;; melunko@917: Intel:Mach:3*:*) melunko@917: echo i386-pc-mach3 melunko@917: exit ;; melunko@917: paragon:*:*:*) melunko@917: echo i860-intel-osf1 melunko@917: exit ;; melunko@917: i860:*:4.*:*) # i860-SVR4 melunko@917: if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then melunko@917: echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 melunko@917: else # Add other i860-SVR4 vendors below as they are discovered. melunko@917: echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 melunko@917: fi melunko@917: exit ;; melunko@917: mini*:CTIX:SYS*5:*) melunko@917: # "miniframe" melunko@917: echo m68010-convergent-sysv melunko@917: exit ;; melunko@917: mc68k:UNIX:SYSTEM5:3.51m) melunko@917: echo m68k-convergent-sysv melunko@917: exit ;; melunko@917: M680?0:D-NIX:5.3:*) melunko@917: echo m68k-diab-dnix melunko@917: exit ;; melunko@917: M68*:*:R3V[5678]*:*) melunko@917: test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; melunko@917: 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) melunko@917: OS_REL='' melunko@917: test -r /etc/.relid \ melunko@917: && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` melunko@917: /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ melunko@917: && { echo i486-ncr-sysv4.3${OS_REL}; exit; } melunko@917: /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ melunko@917: && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; melunko@917: 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) melunko@917: /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ melunko@917: && { echo i486-ncr-sysv4; exit; } ;; melunko@917: m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) melunko@917: echo m68k-unknown-lynxos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: mc68030:UNIX_System_V:4.*:*) melunko@917: echo m68k-atari-sysv4 melunko@917: exit ;; melunko@917: TSUNAMI:LynxOS:2.*:*) melunko@917: echo sparc-unknown-lynxos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: rs6000:LynxOS:2.*:*) melunko@917: echo rs6000-unknown-lynxos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) melunko@917: echo powerpc-unknown-lynxos${UNAME_RELEASE} melunko@917: exit ;; melunko@917: SM[BE]S:UNIX_SV:*:*) melunko@917: echo mips-dde-sysv${UNAME_RELEASE} melunko@917: exit ;; melunko@917: RM*:ReliantUNIX-*:*:*) melunko@917: echo mips-sni-sysv4 melunko@917: exit ;; melunko@917: RM*:SINIX-*:*:*) melunko@917: echo mips-sni-sysv4 melunko@917: exit ;; melunko@917: *:SINIX-*:*:*) melunko@917: if uname -p 2>/dev/null >/dev/null ; then melunko@917: UNAME_MACHINE=`(uname -p) 2>/dev/null` melunko@917: echo ${UNAME_MACHINE}-sni-sysv4 melunko@917: else melunko@917: echo ns32k-sni-sysv melunko@917: fi melunko@917: exit ;; melunko@917: PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort melunko@917: # says melunko@917: echo i586-unisys-sysv4 melunko@917: exit ;; melunko@917: *:UNIX_System_V:4*:FTX*) melunko@917: # From Gerald Hewes . melunko@917: # How about differentiating between stratus architectures? -djm melunko@917: echo hppa1.1-stratus-sysv4 melunko@917: exit ;; melunko@917: *:*:*:FTX*) melunko@917: # From seanf@swdc.stratus.com. melunko@917: echo i860-stratus-sysv4 melunko@917: exit ;; melunko@917: i*86:VOS:*:*) melunko@917: # From Paul.Green@stratus.com. melunko@917: echo ${UNAME_MACHINE}-stratus-vos melunko@917: exit ;; melunko@917: *:VOS:*:*) melunko@917: # From Paul.Green@stratus.com. melunko@917: echo hppa1.1-stratus-vos melunko@917: exit ;; melunko@917: mc68*:A/UX:*:*) melunko@917: echo m68k-apple-aux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: news*:NEWS-OS:6*:*) melunko@917: echo mips-sony-newsos6 melunko@917: exit ;; melunko@917: R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) melunko@917: if [ -d /usr/nec ]; then melunko@917: echo mips-nec-sysv${UNAME_RELEASE} melunko@917: else melunko@917: echo mips-unknown-sysv${UNAME_RELEASE} melunko@917: fi melunko@917: exit ;; melunko@917: BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. melunko@917: echo powerpc-be-beos melunko@917: exit ;; melunko@917: BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. melunko@917: echo powerpc-apple-beos melunko@917: exit ;; melunko@917: BePC:BeOS:*:*) # BeOS running on Intel PC compatible. melunko@917: echo i586-pc-beos melunko@917: exit ;; melunko@917: SX-4:SUPER-UX:*:*) melunko@917: echo sx4-nec-superux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: SX-5:SUPER-UX:*:*) melunko@917: echo sx5-nec-superux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: SX-6:SUPER-UX:*:*) melunko@917: echo sx6-nec-superux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: SX-7:SUPER-UX:*:*) melunko@917: echo sx7-nec-superux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: SX-8:SUPER-UX:*:*) melunko@917: echo sx8-nec-superux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: SX-8R:SUPER-UX:*:*) melunko@917: echo sx8r-nec-superux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: Power*:Rhapsody:*:*) melunko@917: echo powerpc-apple-rhapsody${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:Rhapsody:*:*) melunko@917: echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:Darwin:*:*) melunko@917: UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown melunko@917: case $UNAME_PROCESSOR in melunko@917: unknown) UNAME_PROCESSOR=powerpc ;; melunko@917: esac melunko@917: echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:procnto*:*:* | *:QNX:[0123456789]*:*) melunko@917: UNAME_PROCESSOR=`uname -p` melunko@917: if test "$UNAME_PROCESSOR" = "x86"; then melunko@917: UNAME_PROCESSOR=i386 melunko@917: UNAME_MACHINE=pc melunko@917: fi melunko@917: echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:QNX:*:4*) melunko@917: echo i386-pc-qnx melunko@917: exit ;; melunko@917: NSE-?:NONSTOP_KERNEL:*:*) melunko@917: echo nse-tandem-nsk${UNAME_RELEASE} melunko@917: exit ;; melunko@917: NSR-?:NONSTOP_KERNEL:*:*) melunko@917: echo nsr-tandem-nsk${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:NonStop-UX:*:*) melunko@917: echo mips-compaq-nonstopux melunko@917: exit ;; melunko@917: BS2000:POSIX*:*:*) melunko@917: echo bs2000-siemens-sysv melunko@917: exit ;; melunko@917: DS/*:UNIX_System_V:*:*) melunko@917: echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:Plan9:*:*) melunko@917: # "uname -m" is not consistent, so use $cputype instead. 386 melunko@917: # is converted to i386 for consistency with other x86 melunko@917: # operating systems. melunko@917: if test "$cputype" = "386"; then melunko@917: UNAME_MACHINE=i386 melunko@917: else melunko@917: UNAME_MACHINE="$cputype" melunko@917: fi melunko@917: echo ${UNAME_MACHINE}-unknown-plan9 melunko@917: exit ;; melunko@917: *:TOPS-10:*:*) melunko@917: echo pdp10-unknown-tops10 melunko@917: exit ;; melunko@917: *:TENEX:*:*) melunko@917: echo pdp10-unknown-tenex melunko@917: exit ;; melunko@917: KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) melunko@917: echo pdp10-dec-tops20 melunko@917: exit ;; melunko@917: XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) melunko@917: echo pdp10-xkl-tops20 melunko@917: exit ;; melunko@917: *:TOPS-20:*:*) melunko@917: echo pdp10-unknown-tops20 melunko@917: exit ;; melunko@917: *:ITS:*:*) melunko@917: echo pdp10-unknown-its melunko@917: exit ;; melunko@917: SEI:*:*:SEIUX) melunko@917: echo mips-sei-seiux${UNAME_RELEASE} melunko@917: exit ;; melunko@917: *:DragonFly:*:*) melunko@917: echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` melunko@917: exit ;; melunko@917: *:*VMS:*:*) melunko@917: UNAME_MACHINE=`(uname -p) 2>/dev/null` melunko@917: case "${UNAME_MACHINE}" in melunko@917: A*) echo alpha-dec-vms ; exit ;; melunko@917: I*) echo ia64-dec-vms ; exit ;; melunko@917: V*) echo vax-dec-vms ; exit ;; melunko@917: esac ;; melunko@917: *:XENIX:*:SysV) melunko@917: echo i386-pc-xenix melunko@917: exit ;; melunko@917: i*86:skyos:*:*) melunko@917: echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' melunko@917: exit ;; melunko@917: i*86:rdos:*:*) melunko@917: echo ${UNAME_MACHINE}-pc-rdos melunko@917: exit ;; melunko@917: esac melunko@917: melunko@917: #echo '(No uname command or uname output not recognized.)' 1>&2 melunko@917: #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 melunko@917: melunko@917: eval $set_cc_for_build melunko@917: cat >$dummy.c < melunko@917: # include melunko@917: #endif melunko@917: main () melunko@917: { melunko@917: #if defined (sony) melunko@917: #if defined (MIPSEB) melunko@917: /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, melunko@917: I don't know.... */ melunko@917: printf ("mips-sony-bsd\n"); exit (0); melunko@917: #else melunko@917: #include melunko@917: printf ("m68k-sony-newsos%s\n", melunko@917: #ifdef NEWSOS4 melunko@917: "4" melunko@917: #else melunko@917: "" melunko@917: #endif melunko@917: ); exit (0); melunko@917: #endif melunko@917: #endif melunko@917: melunko@917: #if defined (__arm) && defined (__acorn) && defined (__unix) melunko@917: printf ("arm-acorn-riscix\n"); exit (0); melunko@917: #endif melunko@917: melunko@917: #if defined (hp300) && !defined (hpux) melunko@917: printf ("m68k-hp-bsd\n"); exit (0); melunko@917: #endif melunko@917: melunko@917: #if defined (NeXT) melunko@917: #if !defined (__ARCHITECTURE__) melunko@917: #define __ARCHITECTURE__ "m68k" melunko@917: #endif melunko@917: int version; melunko@917: version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; melunko@917: if (version < 4) melunko@917: printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); melunko@917: else melunko@917: printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); melunko@917: exit (0); melunko@917: #endif melunko@917: melunko@917: #if defined (MULTIMAX) || defined (n16) melunko@917: #if defined (UMAXV) melunko@917: printf ("ns32k-encore-sysv\n"); exit (0); melunko@917: #else melunko@917: #if defined (CMU) melunko@917: printf ("ns32k-encore-mach\n"); exit (0); melunko@917: #else melunko@917: printf ("ns32k-encore-bsd\n"); exit (0); melunko@917: #endif melunko@917: #endif melunko@917: #endif melunko@917: melunko@917: #if defined (__386BSD__) melunko@917: printf ("i386-pc-bsd\n"); exit (0); melunko@917: #endif melunko@917: melunko@917: #if defined (sequent) melunko@917: #if defined (i386) melunko@917: printf ("i386-sequent-dynix\n"); exit (0); melunko@917: #endif melunko@917: #if defined (ns32000) melunko@917: printf ("ns32k-sequent-dynix\n"); exit (0); melunko@917: #endif melunko@917: #endif melunko@917: melunko@917: #if defined (_SEQUENT_) melunko@917: struct utsname un; melunko@917: melunko@917: uname(&un); melunko@917: melunko@917: if (strncmp(un.version, "V2", 2) == 0) { melunko@917: printf ("i386-sequent-ptx2\n"); exit (0); melunko@917: } melunko@917: if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ melunko@917: printf ("i386-sequent-ptx1\n"); exit (0); melunko@917: } melunko@917: printf ("i386-sequent-ptx\n"); exit (0); melunko@917: melunko@917: #endif melunko@917: melunko@917: #if defined (vax) melunko@917: # if !defined (ultrix) melunko@917: # include melunko@917: # if defined (BSD) melunko@917: # if BSD == 43 melunko@917: printf ("vax-dec-bsd4.3\n"); exit (0); melunko@917: # else melunko@917: # if BSD == 199006 melunko@917: printf ("vax-dec-bsd4.3reno\n"); exit (0); melunko@917: # else melunko@917: printf ("vax-dec-bsd\n"); exit (0); melunko@917: # endif melunko@917: # endif melunko@917: # else melunko@917: printf ("vax-dec-bsd\n"); exit (0); melunko@917: # endif melunko@917: # else melunko@917: printf ("vax-dec-ultrix\n"); exit (0); melunko@917: # endif melunko@917: #endif melunko@917: melunko@917: #if defined (alliant) && defined (i860) melunko@917: printf ("i860-alliant-bsd\n"); exit (0); melunko@917: #endif melunko@917: melunko@917: exit (1); melunko@917: } melunko@917: EOF melunko@917: melunko@917: $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && melunko@917: { echo "$SYSTEM_NAME"; exit; } melunko@917: melunko@917: # Apollos put the system type in the environment. melunko@917: melunko@917: test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } melunko@917: melunko@917: # Convex versions that predate uname can use getsysinfo(1) melunko@917: melunko@917: if [ -x /usr/convex/getsysinfo ] melunko@917: then melunko@917: case `getsysinfo -f cpu_type` in melunko@917: c1*) melunko@917: echo c1-convex-bsd melunko@917: exit ;; melunko@917: c2*) melunko@917: if getsysinfo -f scalar_acc melunko@917: then echo c32-convex-bsd melunko@917: else echo c2-convex-bsd melunko@917: fi melunko@917: exit ;; melunko@917: c34*) melunko@917: echo c34-convex-bsd melunko@917: exit ;; melunko@917: c38*) melunko@917: echo c38-convex-bsd melunko@917: exit ;; melunko@917: c4*) melunko@917: echo c4-convex-bsd melunko@917: exit ;; melunko@917: esac melunko@917: fi melunko@917: melunko@917: cat >&2 < in order to provide the needed melunko@917: information to handle your system. melunko@917: melunko@917: config.guess timestamp = $timestamp melunko@917: melunko@917: uname -m = `(uname -m) 2>/dev/null || echo unknown` melunko@917: uname -r = `(uname -r) 2>/dev/null || echo unknown` melunko@917: uname -s = `(uname -s) 2>/dev/null || echo unknown` melunko@917: uname -v = `(uname -v) 2>/dev/null || echo unknown` melunko@917: melunko@917: /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` melunko@917: /bin/uname -X = `(/bin/uname -X) 2>/dev/null` melunko@917: melunko@917: hostinfo = `(hostinfo) 2>/dev/null` melunko@917: /bin/universe = `(/bin/universe) 2>/dev/null` melunko@917: /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` melunko@917: /bin/arch = `(/bin/arch) 2>/dev/null` melunko@917: /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` melunko@917: /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` melunko@917: melunko@917: UNAME_MACHINE = ${UNAME_MACHINE} melunko@917: UNAME_RELEASE = ${UNAME_RELEASE} melunko@917: UNAME_SYSTEM = ${UNAME_SYSTEM} melunko@917: UNAME_VERSION = ${UNAME_VERSION} melunko@917: EOF melunko@917: melunko@917: exit 1 melunko@917: melunko@917: # Local variables: melunko@917: # eval: (add-hook 'write-file-hooks 'time-stamp) melunko@917: # time-stamp-start: "timestamp='" melunko@917: # time-stamp-format: "%:y-%02m-%02d" melunko@917: # time-stamp-end: "'" melunko@917: # End: