"Fossies" - the Fresh Open Source Software Archive

Member "scanssh-2.1/config.guess" (19 Feb 2005, 42565 Bytes) of package /linux/privat/old/scanssh-2.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #! /bin/sh
    2 # Attempt to guess a canonical system name.
    3 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
    4 #   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    5 
    6 timestamp='2004-06-11'
    7 
    8 # This file is free software; you can redistribute it and/or modify it
    9 # under the terms of the GNU General Public License as published by
   10 # the Free Software Foundation; either version 2 of the License, or
   11 # (at your option) any later version.
   12 #
   13 # This program is distributed in the hope that it will be useful, but
   14 # WITHOUT ANY WARRANTY; without even the implied warranty of
   15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   16 # General Public License for more details.
   17 #
   18 # You should have received a copy of the GNU General Public License
   19 # along with this program; if not, write to the Free Software
   20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
   21 #
   22 # As a special exception to the GNU General Public License, if you
   23 # distribute this file as part of a program that contains a
   24 # configuration script generated by Autoconf, you may include it under
   25 # the same distribution terms that you use for the rest of that program.
   26 
   27 # Originally written by Per Bothner <per@bothner.com>.
   28 # Please send patches to <config-patches@gnu.org>.  Submit a context
   29 # diff and a properly formatted ChangeLog entry.
   30 #
   31 # This script attempts to guess a canonical system name similar to
   32 # config.sub.  If it succeeds, it prints the system name on stdout, and
   33 # exits with 0.  Otherwise, it exits with 1.
   34 #
   35 # The plan is that this can be called by configure scripts if you
   36 # don't specify an explicit build system type.
   37 
   38 me=`echo "$0" | sed -e 's,.*/,,'`
   39 
   40 usage="\
   41 Usage: $0 [OPTION]
   42 
   43 Output the configuration name of the system \`$me' is run on.
   44 
   45 Operation modes:
   46   -h, --help         print this help, then exit
   47   -t, --time-stamp   print date of last modification, then exit
   48   -v, --version      print version number, then exit
   49 
   50 Report bugs and patches to <config-patches@gnu.org>."
   51 
   52 version="\
   53 GNU config.guess ($timestamp)
   54 
   55 Originally written by Per Bothner.
   56 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
   57 Free Software Foundation, Inc.
   58 
   59 This is free software; see the source for copying conditions.  There is NO
   60 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
   61 
   62 help="
   63 Try \`$me --help' for more information."
   64 
   65 # Parse command line
   66 while test $# -gt 0 ; do
   67   case $1 in
   68     --time-stamp | --time* | -t )
   69        echo "$timestamp" ; exit 0 ;;
   70     --version | -v )
   71        echo "$version" ; exit 0 ;;
   72     --help | --h* | -h )
   73        echo "$usage"; exit 0 ;;
   74     -- )     # Stop option processing
   75        shift; break ;;
   76     - ) # Use stdin as input.
   77        break ;;
   78     -* )
   79        echo "$me: invalid option $1$help" >&2
   80        exit 1 ;;
   81     * )
   82        break ;;
   83   esac
   84 done
   85 
   86 if test $# != 0; then
   87   echo "$me: too many arguments$help" >&2
   88   exit 1
   89 fi
   90 
   91 trap 'exit 1' 1 2 15
   92 
   93 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
   94 # compiler to aid in system detection is discouraged as it requires
   95 # temporary files to be created and, as you can see below, it is a
   96 # headache to deal with in a portable fashion.
   97 
   98 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
   99 # use `HOST_CC' if defined, but it is deprecated.
  100 
  101 # Portable tmp directory creation inspired by the Autoconf team.
  102 
  103 set_cc_for_build='
  104 trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
  105 trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
  106 : ${TMPDIR=/tmp} ;
  107  { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
  108  { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
  109  { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
  110  { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
  111 dummy=$tmp/dummy ;
  112 tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
  113 case $CC_FOR_BUILD,$HOST_CC,$CC in
  114  ,,)    echo "int x;" > $dummy.c ;
  115     for c in cc gcc c89 c99 ; do
  116       if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
  117          CC_FOR_BUILD="$c"; break ;
  118       fi ;
  119     done ;
  120     if test x"$CC_FOR_BUILD" = x ; then
  121       CC_FOR_BUILD=no_compiler_found ;
  122     fi
  123     ;;
  124  ,,*)   CC_FOR_BUILD=$CC ;;
  125  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
  126 esac ;'
  127 
  128 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
  129 # (ghazi@noc.rutgers.edu 1994-08-24)
  130 if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
  131     PATH=$PATH:/.attbin ; export PATH
  132 fi
  133 
  134 UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
  135 UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
  136 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
  137 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
  138 
  139 # Note: order is significant - the case branches are not exclusive.
  140 
  141 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
  142     *:NetBSD:*:*)
  143     # NetBSD (nbsd) targets should (where applicable) match one or
  144     # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
  145     # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
  146     # switched to ELF, *-*-netbsd* would select the old
  147     # object file format.  This provides both forward
  148     # compatibility and a consistent mechanism for selecting the
  149     # object file format.
  150     #
  151     # Note: NetBSD doesn't particularly care about the vendor
  152     # portion of the name.  We always set it to "unknown".
  153     sysctl="sysctl -n hw.machine_arch"
  154     UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
  155         /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
  156     case "${UNAME_MACHINE_ARCH}" in
  157         armeb) machine=armeb-unknown ;;
  158         arm*) machine=arm-unknown ;;
  159         sh3el) machine=shl-unknown ;;
  160         sh3eb) machine=sh-unknown ;;
  161         *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
  162     esac
  163     # The Operating System including object format, if it has switched
  164     # to ELF recently, or will in the future.
  165     case "${UNAME_MACHINE_ARCH}" in
  166         arm*|i386|m68k|ns32k|sh3*|sparc|vax)
  167         eval $set_cc_for_build
  168         if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
  169             | grep __ELF__ >/dev/null
  170         then
  171             # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
  172             # Return netbsd for either.  FIX?
  173             os=netbsd
  174         else
  175             os=netbsdelf
  176         fi
  177         ;;
  178         *)
  179             os=netbsd
  180         ;;
  181     esac
  182     # The OS release
  183     # Debian GNU/NetBSD machines have a different userland, and
  184     # thus, need a distinct triplet. However, they do not need
  185     # kernel version information, so it can be replaced with a
  186     # suitable tag, in the style of linux-gnu.
  187     case "${UNAME_VERSION}" in
  188         Debian*)
  189         release='-gnu'
  190         ;;
  191         *)
  192         release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
  193         ;;
  194     esac
  195     # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
  196     # contains redundant information, the shorter form:
  197     # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
  198     echo "${machine}-${os}${release}"
  199     exit 0 ;;
  200     amd64:OpenBSD:*:*)
  201     echo x86_64-unknown-openbsd${UNAME_RELEASE}
  202     exit 0 ;;
  203     *:OpenBSD:*:*)
  204     UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
  205     echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
  206     exit 0 ;;
  207     *:ekkoBSD:*:*)
  208     echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
  209     exit 0 ;;
  210     macppc:MirBSD:*:*)
  211     echo powerppc-unknown-mirbsd${UNAME_RELEASE}
  212     exit 0 ;;
  213     *:MirBSD:*:*)
  214     echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
  215     exit 0 ;;
  216     alpha:OSF1:*:*)
  217     case $UNAME_RELEASE in
  218     *4.0)
  219         UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
  220         ;;
  221     *5.*)
  222             UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
  223         ;;
  224     esac
  225     # According to Compaq, /usr/sbin/psrinfo has been available on
  226     # OSF/1 and Tru64 systems produced since 1995.  I hope that
  227     # covers most systems running today.  This code pipes the CPU
  228     # types through head -n 1, so we only detect the type of CPU 0.
  229     ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
  230     case "$ALPHA_CPU_TYPE" in
  231         "EV4 (21064)")
  232         UNAME_MACHINE="alpha" ;;
  233         "EV4.5 (21064)")
  234         UNAME_MACHINE="alpha" ;;
  235         "LCA4 (21066/21068)")
  236         UNAME_MACHINE="alpha" ;;
  237         "EV5 (21164)")
  238         UNAME_MACHINE="alphaev5" ;;
  239         "EV5.6 (21164A)")
  240         UNAME_MACHINE="alphaev56" ;;
  241         "EV5.6 (21164PC)")
  242         UNAME_MACHINE="alphapca56" ;;
  243         "EV5.7 (21164PC)")
  244         UNAME_MACHINE="alphapca57" ;;
  245         "EV6 (21264)")
  246         UNAME_MACHINE="alphaev6" ;;
  247         "EV6.7 (21264A)")
  248         UNAME_MACHINE="alphaev67" ;;
  249         "EV6.8CB (21264C)")
  250         UNAME_MACHINE="alphaev68" ;;
  251         "EV6.8AL (21264B)")
  252         UNAME_MACHINE="alphaev68" ;;
  253         "EV6.8CX (21264D)")
  254         UNAME_MACHINE="alphaev68" ;;
  255         "EV6.9A (21264/EV69A)")
  256         UNAME_MACHINE="alphaev69" ;;
  257         "EV7 (21364)")
  258         UNAME_MACHINE="alphaev7" ;;
  259         "EV7.9 (21364A)")
  260         UNAME_MACHINE="alphaev79" ;;
  261     esac
  262     # A Pn.n version is a patched version.
  263     # A Vn.n version is a released version.
  264     # A Tn.n version is a released field test version.
  265     # A Xn.n version is an unreleased experimental baselevel.
  266     # 1.2 uses "1.2" for uname -r.
  267     echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  268     exit 0 ;;
  269     Alpha*:OpenVMS:*:*)
  270     echo alpha-hp-vms
  271     exit 0 ;;
  272     Alpha\ *:Windows_NT*:*)
  273     # How do we know it's Interix rather than the generic POSIX subsystem?
  274     # Should we change UNAME_MACHINE based on the output of uname instead
  275     # of the specific Alpha model?
  276     echo alpha-pc-interix
  277     exit 0 ;;
  278     21064:Windows_NT:50:3)
  279     echo alpha-dec-winnt3.5
  280     exit 0 ;;
  281     Amiga*:UNIX_System_V:4.0:*)
  282     echo m68k-unknown-sysv4
  283     exit 0;;
  284     *:[Aa]miga[Oo][Ss]:*:*)
  285     echo ${UNAME_MACHINE}-unknown-amigaos
  286     exit 0 ;;
  287     *:[Mm]orph[Oo][Ss]:*:*)
  288     echo ${UNAME_MACHINE}-unknown-morphos
  289     exit 0 ;;
  290     *:OS/390:*:*)
  291     echo i370-ibm-openedition
  292     exit 0 ;;
  293     *:OS400:*:*)
  294         echo powerpc-ibm-os400
  295     exit 0 ;;
  296     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
  297     echo arm-acorn-riscix${UNAME_RELEASE}
  298     exit 0;;
  299     SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
  300     echo hppa1.1-hitachi-hiuxmpp
  301     exit 0;;
  302     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
  303     # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
  304     if test "`(/bin/universe) 2>/dev/null`" = att ; then
  305         echo pyramid-pyramid-sysv3
  306     else
  307         echo pyramid-pyramid-bsd
  308     fi
  309     exit 0 ;;
  310     NILE*:*:*:dcosx)
  311     echo pyramid-pyramid-svr4
  312     exit 0 ;;
  313     DRS?6000:unix:4.0:6*)
  314     echo sparc-icl-nx6
  315     exit 0 ;;
  316     DRS?6000:UNIX_SV:4.2*:7*)
  317     case `/usr/bin/uname -p` in
  318         sparc) echo sparc-icl-nx7 && exit 0 ;;
  319     esac ;;
  320     sun4H:SunOS:5.*:*)
  321     echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  322     exit 0 ;;
  323     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
  324     echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  325     exit 0 ;;
  326     i86pc:SunOS:5.*:*)
  327     echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  328     exit 0 ;;
  329     sun4*:SunOS:6*:*)
  330     # According to config.sub, this is the proper way to canonicalize
  331     # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
  332     # it's likely to be more like Solaris than SunOS4.
  333     echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  334     exit 0 ;;
  335     sun4*:SunOS:*:*)
  336     case "`/usr/bin/arch -k`" in
  337         Series*|S4*)
  338         UNAME_RELEASE=`uname -v`
  339         ;;
  340     esac
  341     # Japanese Language versions have a version number like `4.1.3-JL'.
  342     echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
  343     exit 0 ;;
  344     sun3*:SunOS:*:*)
  345     echo m68k-sun-sunos${UNAME_RELEASE}
  346     exit 0 ;;
  347     sun*:*:4.2BSD:*)
  348     UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
  349     test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
  350     case "`/bin/arch`" in
  351         sun3)
  352         echo m68k-sun-sunos${UNAME_RELEASE}
  353         ;;
  354         sun4)
  355         echo sparc-sun-sunos${UNAME_RELEASE}
  356         ;;
  357     esac
  358     exit 0 ;;
  359     aushp:SunOS:*:*)
  360     echo sparc-auspex-sunos${UNAME_RELEASE}
  361     exit 0 ;;
  362     # The situation for MiNT is a little confusing.  The machine name
  363     # can be virtually everything (everything which is not
  364     # "atarist" or "atariste" at least should have a processor
  365     # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
  366     # to the lowercase version "mint" (or "freemint").  Finally
  367     # the system name "TOS" denotes a system which is actually not
  368     # MiNT.  But MiNT is downward compatible to TOS, so this should
  369     # be no problem.
  370     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
  371         echo m68k-atari-mint${UNAME_RELEASE}
  372     exit 0 ;;
  373     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
  374     echo m68k-atari-mint${UNAME_RELEASE}
  375         exit 0 ;;
  376     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
  377         echo m68k-atari-mint${UNAME_RELEASE}
  378     exit 0 ;;
  379     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
  380         echo m68k-milan-mint${UNAME_RELEASE}
  381         exit 0 ;;
  382     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
  383         echo m68k-hades-mint${UNAME_RELEASE}
  384         exit 0 ;;
  385     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
  386         echo m68k-unknown-mint${UNAME_RELEASE}
  387         exit 0 ;;
  388     m68k:machten:*:*)
  389     echo m68k-apple-machten${UNAME_RELEASE}
  390     exit 0 ;;
  391     powerpc:machten:*:*)
  392     echo powerpc-apple-machten${UNAME_RELEASE}
  393     exit 0 ;;
  394     RISC*:Mach:*:*)
  395     echo mips-dec-mach_bsd4.3
  396     exit 0 ;;
  397     RISC*:ULTRIX:*:*)
  398     echo mips-dec-ultrix${UNAME_RELEASE}
  399     exit 0 ;;
  400     VAX*:ULTRIX*:*:*)
  401     echo vax-dec-ultrix${UNAME_RELEASE}
  402     exit 0 ;;
  403     2020:CLIX:*:* | 2430:CLIX:*:*)
  404     echo clipper-intergraph-clix${UNAME_RELEASE}
  405     exit 0 ;;
  406     mips:*:*:UMIPS | mips:*:*:RISCos)
  407     eval $set_cc_for_build
  408     sed 's/^    //' << EOF >$dummy.c
  409 #ifdef __cplusplus
  410 #include <stdio.h>  /* for printf() prototype */
  411     int main (int argc, char *argv[]) {
  412 #else
  413     int main (argc, argv) int argc; char *argv[]; {
  414 #endif
  415     #if defined (host_mips) && defined (MIPSEB)
  416     #if defined (SYSTYPE_SYSV)
  417       printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
  418     #endif
  419     #if defined (SYSTYPE_SVR4)
  420       printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
  421     #endif
  422     #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
  423       printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
  424     #endif
  425     #endif
  426       exit (-1);
  427     }
  428 EOF
  429     $CC_FOR_BUILD -o $dummy $dummy.c \
  430       && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
  431       && exit 0
  432     echo mips-mips-riscos${UNAME_RELEASE}
  433     exit 0 ;;
  434     Motorola:PowerMAX_OS:*:*)
  435     echo powerpc-motorola-powermax
  436     exit 0 ;;
  437     Motorola:*:4.3:PL8-*)
  438     echo powerpc-harris-powermax
  439     exit 0 ;;
  440     Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
  441     echo powerpc-harris-powermax
  442     exit 0 ;;
  443     Night_Hawk:Power_UNIX:*:*)
  444     echo powerpc-harris-powerunix
  445     exit 0 ;;
  446     m88k:CX/UX:7*:*)
  447     echo m88k-harris-cxux7
  448     exit 0 ;;
  449     m88k:*:4*:R4*)
  450     echo m88k-motorola-sysv4
  451     exit 0 ;;
  452     m88k:*:3*:R3*)
  453     echo m88k-motorola-sysv3
  454     exit 0 ;;
  455     AViiON:dgux:*:*)
  456         # DG/UX returns AViiON for all architectures
  457         UNAME_PROCESSOR=`/usr/bin/uname -p`
  458     if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
  459     then
  460         if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
  461            [ ${TARGET_BINARY_INTERFACE}x = x ]
  462         then
  463         echo m88k-dg-dgux${UNAME_RELEASE}
  464         else
  465         echo m88k-dg-dguxbcs${UNAME_RELEASE}
  466         fi
  467     else
  468         echo i586-dg-dgux${UNAME_RELEASE}
  469     fi
  470     exit 0 ;;
  471     M88*:DolphinOS:*:*) # DolphinOS (SVR3)
  472     echo m88k-dolphin-sysv3
  473     exit 0 ;;
  474     M88*:*:R3*:*)
  475     # Delta 88k system running SVR3
  476     echo m88k-motorola-sysv3
  477     exit 0 ;;
  478     XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
  479     echo m88k-tektronix-sysv3
  480     exit 0 ;;
  481     Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
  482     echo m68k-tektronix-bsd
  483     exit 0 ;;
  484     *:IRIX*:*:*)
  485     echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
  486     exit 0 ;;
  487     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
  488     echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
  489     exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
  490     i*86:AIX:*:*)
  491     echo i386-ibm-aix
  492     exit 0 ;;
  493     ia64:AIX:*:*)
  494     if [ -x /usr/bin/oslevel ] ; then
  495         IBM_REV=`/usr/bin/oslevel`
  496     else
  497         IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  498     fi
  499     echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
  500     exit 0 ;;
  501     *:AIX:2:3)
  502     if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
  503         eval $set_cc_for_build
  504         sed 's/^        //' << EOF >$dummy.c
  505         #include <sys/systemcfg.h>
  506 
  507         main()
  508             {
  509             if (!__power_pc())
  510                 exit(1);
  511             puts("powerpc-ibm-aix3.2.5");
  512             exit(0);
  513             }
  514 EOF
  515         $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
  516         echo rs6000-ibm-aix3.2.5
  517     elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
  518         echo rs6000-ibm-aix3.2.4
  519     else
  520         echo rs6000-ibm-aix3.2
  521     fi
  522     exit 0 ;;
  523     *:AIX:*:[45])
  524     IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
  525     if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
  526         IBM_ARCH=rs6000
  527     else
  528         IBM_ARCH=powerpc
  529     fi
  530     if [ -x /usr/bin/oslevel ] ; then
  531         IBM_REV=`/usr/bin/oslevel`
  532     else
  533         IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
  534     fi
  535     echo ${IBM_ARCH}-ibm-aix${IBM_REV}
  536     exit 0 ;;
  537     *:AIX:*:*)
  538     echo rs6000-ibm-aix
  539     exit 0 ;;
  540     ibmrt:4.4BSD:*|romp-ibm:BSD:*)
  541     echo romp-ibm-bsd4.4
  542     exit 0 ;;
  543     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
  544     echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
  545     exit 0 ;;                           # report: romp-ibm BSD 4.3
  546     *:BOSX:*:*)
  547     echo rs6000-bull-bosx
  548     exit 0 ;;
  549     DPX/2?00:B.O.S.:*:*)
  550     echo m68k-bull-sysv3
  551     exit 0 ;;
  552     9000/[34]??:4.3bsd:1.*:*)
  553     echo m68k-hp-bsd
  554     exit 0 ;;
  555     hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
  556     echo m68k-hp-bsd4.4
  557     exit 0 ;;
  558     9000/[34678]??:HP-UX:*:*)
  559     HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  560     case "${UNAME_MACHINE}" in
  561         9000/31? )            HP_ARCH=m68000 ;;
  562         9000/[34]?? )         HP_ARCH=m68k ;;
  563         9000/[678][0-9][0-9])
  564         if [ -x /usr/bin/getconf ]; then
  565             sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
  566                     sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
  567                     case "${sc_cpu_version}" in
  568                       523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
  569                       528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
  570                       532)                      # CPU_PA_RISC2_0
  571                         case "${sc_kernel_bits}" in
  572                           32) HP_ARCH="hppa2.0n" ;;
  573                           64) HP_ARCH="hppa2.0w" ;;
  574               '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
  575                         esac ;;
  576                     esac
  577         fi
  578         if [ "${HP_ARCH}" = "" ]; then
  579             eval $set_cc_for_build
  580             sed 's/^              //' << EOF >$dummy.c
  581 
  582               #define _HPUX_SOURCE
  583               #include <stdlib.h>
  584               #include <unistd.h>
  585 
  586               int main ()
  587               {
  588               #if defined(_SC_KERNEL_BITS)
  589                   long bits = sysconf(_SC_KERNEL_BITS);
  590               #endif
  591                   long cpu  = sysconf (_SC_CPU_VERSION);
  592 
  593                   switch (cpu)
  594                 {
  595                 case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
  596                 case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
  597                 case CPU_PA_RISC2_0:
  598               #if defined(_SC_KERNEL_BITS)
  599                     switch (bits)
  600                     {
  601                     case 64: puts ("hppa2.0w"); break;
  602                     case 32: puts ("hppa2.0n"); break;
  603                     default: puts ("hppa2.0"); break;
  604                     } break;
  605               #else  /* !defined(_SC_KERNEL_BITS) */
  606                     puts ("hppa2.0"); break;
  607               #endif
  608                 default: puts ("hppa1.0"); break;
  609                 }
  610                   exit (0);
  611               }
  612 EOF
  613             (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
  614             test -z "$HP_ARCH" && HP_ARCH=hppa
  615         fi ;;
  616     esac
  617     if [ ${HP_ARCH} = "hppa2.0w" ]
  618     then
  619         # avoid double evaluation of $set_cc_for_build
  620         test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
  621         if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
  622         then
  623         HP_ARCH="hppa2.0w"
  624         else
  625         HP_ARCH="hppa64"
  626         fi
  627     fi
  628     echo ${HP_ARCH}-hp-hpux${HPUX_REV}
  629     exit 0 ;;
  630     ia64:HP-UX:*:*)
  631     HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
  632     echo ia64-hp-hpux${HPUX_REV}
  633     exit 0 ;;
  634     3050*:HI-UX:*:*)
  635     eval $set_cc_for_build
  636     sed 's/^    //' << EOF >$dummy.c
  637     #include <unistd.h>
  638     int
  639     main ()
  640     {
  641       long cpu = sysconf (_SC_CPU_VERSION);
  642       /* The order matters, because CPU_IS_HP_MC68K erroneously returns
  643          true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
  644          results, however.  */
  645       if (CPU_IS_PA_RISC (cpu))
  646         {
  647           switch (cpu)
  648         {
  649           case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
  650           case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
  651           case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
  652           default: puts ("hppa-hitachi-hiuxwe2"); break;
  653         }
  654         }
  655       else if (CPU_IS_HP_MC68K (cpu))
  656         puts ("m68k-hitachi-hiuxwe2");
  657       else puts ("unknown-hitachi-hiuxwe2");
  658       exit (0);
  659     }
  660 EOF
  661     $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
  662     echo unknown-hitachi-hiuxwe2
  663     exit 0 ;;
  664     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
  665     echo hppa1.1-hp-bsd
  666     exit 0 ;;
  667     9000/8??:4.3bsd:*:*)
  668     echo hppa1.0-hp-bsd
  669     exit 0 ;;
  670     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
  671     echo hppa1.0-hp-mpeix
  672     exit 0 ;;
  673     hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
  674     echo hppa1.1-hp-osf
  675     exit 0 ;;
  676     hp8??:OSF1:*:*)
  677     echo hppa1.0-hp-osf
  678     exit 0 ;;
  679     i*86:OSF1:*:*)
  680     if [ -x /usr/sbin/sysversion ] ; then
  681         echo ${UNAME_MACHINE}-unknown-osf1mk
  682     else
  683         echo ${UNAME_MACHINE}-unknown-osf1
  684     fi
  685     exit 0 ;;
  686     parisc*:Lites*:*:*)
  687     echo hppa1.1-hp-lites
  688     exit 0 ;;
  689     C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
  690     echo c1-convex-bsd
  691         exit 0 ;;
  692     C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
  693     if getsysinfo -f scalar_acc
  694     then echo c32-convex-bsd
  695     else echo c2-convex-bsd
  696     fi
  697         exit 0 ;;
  698     C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
  699     echo c34-convex-bsd
  700         exit 0 ;;
  701     C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
  702     echo c38-convex-bsd
  703         exit 0 ;;
  704     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
  705     echo c4-convex-bsd
  706         exit 0 ;;
  707     CRAY*Y-MP:*:*:*)
  708     echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  709     exit 0 ;;
  710     CRAY*[A-Z]90:*:*:*)
  711     echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
  712     | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
  713           -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
  714           -e 's/\.[^.]*$/.X/'
  715     exit 0 ;;
  716     CRAY*TS:*:*:*)
  717     echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  718     exit 0 ;;
  719     CRAY*T3E:*:*:*)
  720     echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  721     exit 0 ;;
  722     CRAY*SV1:*:*:*)
  723     echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  724     exit 0 ;;
  725     *:UNICOS/mp:*:*)
  726     echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
  727     exit 0 ;;
  728     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
  729     FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
  730         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  731         FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
  732         echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  733         exit 0 ;;
  734     5000:UNIX_System_V:4.*:*)
  735         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
  736         FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
  737         echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
  738     exit 0 ;;
  739     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
  740     echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
  741     exit 0 ;;
  742     sparc*:BSD/OS:*:*)
  743     echo sparc-unknown-bsdi${UNAME_RELEASE}
  744     exit 0 ;;
  745     *:BSD/OS:*:*)
  746     echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
  747     exit 0 ;;
  748     *:FreeBSD:*:*)
  749     # Determine whether the default compiler uses glibc.
  750     eval $set_cc_for_build
  751     sed 's/^    //' << EOF >$dummy.c
  752     #include <features.h>
  753     #if __GLIBC__ >= 2
  754     LIBC=gnu
  755     #else
  756     LIBC=
  757     #endif
  758 EOF
  759     eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
  760     # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
  761     # FreeBSD's kernel, but not the complete OS.
  762     case ${LIBC} in gnu) kernel_only='k' ;; esac
  763     echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
  764     exit 0 ;;
  765     i*:CYGWIN*:*)
  766     echo ${UNAME_MACHINE}-pc-cygwin
  767     exit 0 ;;
  768     i*:MINGW*:*)
  769     echo ${UNAME_MACHINE}-pc-mingw32
  770     exit 0 ;;
  771     i*:PW*:*)
  772     echo ${UNAME_MACHINE}-pc-pw32
  773     exit 0 ;;
  774     x86:Interix*:[34]*)
  775     echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
  776     exit 0 ;;
  777     [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
  778     echo i${UNAME_MACHINE}-pc-mks
  779     exit 0 ;;
  780     i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
  781     # How do we know it's Interix rather than the generic POSIX subsystem?
  782     # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
  783     # UNAME_MACHINE based on the output of uname instead of i386?
  784     echo i586-pc-interix
  785     exit 0 ;;
  786     i*:UWIN*:*)
  787     echo ${UNAME_MACHINE}-pc-uwin
  788     exit 0 ;;
  789     p*:CYGWIN*:*)
  790     echo powerpcle-unknown-cygwin
  791     exit 0 ;;
  792     prep*:SunOS:5.*:*)
  793     echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
  794     exit 0 ;;
  795     *:GNU:*:*)
  796     # the GNU system
  797     echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
  798     exit 0 ;;
  799     *:GNU/*:*:*)
  800     # other systems with GNU libc and userland
  801     echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
  802     exit 0 ;;
  803     i*86:Minix:*:*)
  804     echo ${UNAME_MACHINE}-pc-minix
  805     exit 0 ;;
  806     arm*:Linux:*:*)
  807     echo ${UNAME_MACHINE}-unknown-linux-gnu
  808     exit 0 ;;
  809     cris:Linux:*:*)
  810     echo cris-axis-linux-gnu
  811     exit 0 ;;
  812     ia64:Linux:*:*)
  813     echo ${UNAME_MACHINE}-unknown-linux-gnu
  814     exit 0 ;;
  815     m32r*:Linux:*:*)
  816     echo ${UNAME_MACHINE}-unknown-linux-gnu
  817     exit 0 ;;
  818     m68*:Linux:*:*)
  819     echo ${UNAME_MACHINE}-unknown-linux-gnu
  820     exit 0 ;;
  821     mips:Linux:*:*)
  822     eval $set_cc_for_build
  823     sed 's/^    //' << EOF >$dummy.c
  824     #undef CPU
  825     #undef mips
  826     #undef mipsel
  827     #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  828     CPU=mipsel
  829     #else
  830     #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  831     CPU=mips
  832     #else
  833     CPU=
  834     #endif
  835     #endif
  836 EOF
  837     eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
  838     test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
  839     ;;
  840     mips64:Linux:*:*)
  841     eval $set_cc_for_build
  842     sed 's/^    //' << EOF >$dummy.c
  843     #undef CPU
  844     #undef mips64
  845     #undef mips64el
  846     #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
  847     CPU=mips64el
  848     #else
  849     #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
  850     CPU=mips64
  851     #else
  852     CPU=
  853     #endif
  854     #endif
  855 EOF
  856     eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
  857     test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
  858     ;;
  859     ppc:Linux:*:*)
  860     echo powerpc-unknown-linux-gnu
  861     exit 0 ;;
  862     ppc64:Linux:*:*)
  863     echo powerpc64-unknown-linux-gnu
  864     exit 0 ;;
  865     alpha:Linux:*:*)
  866     case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
  867       EV5)   UNAME_MACHINE=alphaev5 ;;
  868       EV56)  UNAME_MACHINE=alphaev56 ;;
  869       PCA56) UNAME_MACHINE=alphapca56 ;;
  870       PCA57) UNAME_MACHINE=alphapca56 ;;
  871       EV6)   UNAME_MACHINE=alphaev6 ;;
  872       EV67)  UNAME_MACHINE=alphaev67 ;;
  873       EV68*) UNAME_MACHINE=alphaev68 ;;
  874         esac
  875     objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
  876     if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
  877     echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
  878     exit 0 ;;
  879     parisc:Linux:*:* | hppa:Linux:*:*)
  880     # Look for CPU level
  881     case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
  882       PA7*) echo hppa1.1-unknown-linux-gnu ;;
  883       PA8*) echo hppa2.0-unknown-linux-gnu ;;
  884       *)    echo hppa-unknown-linux-gnu ;;
  885     esac
  886     exit 0 ;;
  887     parisc64:Linux:*:* | hppa64:Linux:*:*)
  888     echo hppa64-unknown-linux-gnu
  889     exit 0 ;;
  890     s390:Linux:*:* | s390x:Linux:*:*)
  891     echo ${UNAME_MACHINE}-ibm-linux
  892     exit 0 ;;
  893     sh64*:Linux:*:*)
  894         echo ${UNAME_MACHINE}-unknown-linux-gnu
  895     exit 0 ;;
  896     sh*:Linux:*:*)
  897     echo ${UNAME_MACHINE}-unknown-linux-gnu
  898     exit 0 ;;
  899     sparc:Linux:*:* | sparc64:Linux:*:*)
  900     echo ${UNAME_MACHINE}-unknown-linux-gnu
  901     exit 0 ;;
  902     x86_64:Linux:*:*)
  903     echo x86_64-unknown-linux-gnu
  904     exit 0 ;;
  905     i*86:Linux:*:*)
  906     # The BFD linker knows what the default object file format is, so
  907     # first see if it will tell us. cd to the root directory to prevent
  908     # problems with other programs or directories called `ld' in the path.
  909     # Set LC_ALL=C to ensure ld outputs messages in English.
  910     ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
  911              | sed -ne '/supported targets:/!d
  912                     s/[     ][  ]*/ /g
  913                     s/.*supported targets: *//
  914                     s/ .*//
  915                     p'`
  916         case "$ld_supported_targets" in
  917       elf32-i386)
  918         TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
  919         ;;
  920       a.out-i386-linux)
  921         echo "${UNAME_MACHINE}-pc-linux-gnuaout"
  922         exit 0 ;;
  923       coff-i386)
  924         echo "${UNAME_MACHINE}-pc-linux-gnucoff"
  925         exit 0 ;;
  926       "")
  927         # Either a pre-BFD a.out linker (linux-gnuoldld) or
  928         # one that does not give us useful --help.
  929         echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
  930         exit 0 ;;
  931     esac
  932     # Determine whether the default compiler is a.out or elf
  933     eval $set_cc_for_build
  934     sed 's/^    //' << EOF >$dummy.c
  935     #include <features.h>
  936     #ifdef __ELF__
  937     # ifdef __GLIBC__
  938     #  if __GLIBC__ >= 2
  939     LIBC=gnu
  940     #  else
  941     LIBC=gnulibc1
  942     #  endif
  943     # else
  944     LIBC=gnulibc1
  945     # endif
  946     #else
  947     #ifdef __INTEL_COMPILER
  948     LIBC=gnu
  949     #else
  950     LIBC=gnuaout
  951     #endif
  952     #endif
  953     #ifdef __dietlibc__
  954     LIBC=dietlibc
  955     #endif
  956 EOF
  957     eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
  958     test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
  959     test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
  960     ;;
  961     i*86:DYNIX/ptx:4*:*)
  962     # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
  963     # earlier versions are messed up and put the nodename in both
  964     # sysname and nodename.
  965     echo i386-sequent-sysv4
  966     exit 0 ;;
  967     i*86:UNIX_SV:4.2MP:2.*)
  968         # Unixware is an offshoot of SVR4, but it has its own version
  969         # number series starting with 2...
  970         # I am not positive that other SVR4 systems won't match this,
  971     # I just have to hope.  -- rms.
  972         # Use sysv4.2uw... so that sysv4* matches it.
  973     echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
  974     exit 0 ;;
  975     i*86:OS/2:*:*)
  976     # If we were able to find `uname', then EMX Unix compatibility
  977     # is probably installed.
  978     echo ${UNAME_MACHINE}-pc-os2-emx
  979     exit 0 ;;
  980     i*86:XTS-300:*:STOP)
  981     echo ${UNAME_MACHINE}-unknown-stop
  982     exit 0 ;;
  983     i*86:atheos:*:*)
  984     echo ${UNAME_MACHINE}-unknown-atheos
  985     exit 0 ;;
  986     i*86:syllable:*:*)
  987     echo ${UNAME_MACHINE}-pc-syllable
  988     exit 0 ;;
  989     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
  990     echo i386-unknown-lynxos${UNAME_RELEASE}
  991     exit 0 ;;
  992     i*86:*DOS:*:*)
  993     echo ${UNAME_MACHINE}-pc-msdosdjgpp
  994     exit 0 ;;
  995     i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
  996     UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
  997     if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
  998         echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
  999     else
 1000         echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 1001     fi
 1002     exit 0 ;;
 1003     i*86:*:5:[78]*)
 1004     case `/bin/uname -X | grep "^Machine"` in
 1005         *486*)       UNAME_MACHINE=i486 ;;
 1006         *Pentium)        UNAME_MACHINE=i586 ;;
 1007         *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 1008     esac
 1009     echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 1010     exit 0 ;;
 1011     i*86:*:3.2:*)
 1012     if test -f /usr/options/cb.name; then
 1013         UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
 1014         echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 1015     elif /bin/uname -X 2>/dev/null >/dev/null ; then
 1016         UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 1017         (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 1018         (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
 1019             && UNAME_MACHINE=i586
 1020         (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
 1021             && UNAME_MACHINE=i686
 1022         (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 1023             && UNAME_MACHINE=i686
 1024         echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 1025     else
 1026         echo ${UNAME_MACHINE}-pc-sysv32
 1027     fi
 1028     exit 0 ;;
 1029     pc:*:*:*)
 1030     # Left here for compatibility:
 1031         # uname -m prints for DJGPP always 'pc', but it prints nothing about
 1032         # the processor, so we play safe by assuming i386.
 1033     echo i386-pc-msdosdjgpp
 1034         exit 0 ;;
 1035     Intel:Mach:3*:*)
 1036     echo i386-pc-mach3
 1037     exit 0 ;;
 1038     paragon:*:*:*)
 1039     echo i860-intel-osf1
 1040     exit 0 ;;
 1041     i860:*:4.*:*) # i860-SVR4
 1042     if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
 1043       echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 1044     else # Add other i860-SVR4 vendors below as they are discovered.
 1045       echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 1046     fi
 1047     exit 0 ;;
 1048     mini*:CTIX:SYS*5:*)
 1049     # "miniframe"
 1050     echo m68010-convergent-sysv
 1051     exit 0 ;;
 1052     mc68k:UNIX:SYSTEM5:3.51m)
 1053     echo m68k-convergent-sysv
 1054     exit 0 ;;
 1055     M680?0:D-NIX:5.3:*)
 1056     echo m68k-diab-dnix
 1057     exit 0 ;;
 1058     M68*:*:R3V[5678]*:*)
 1059     test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
 1060     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)
 1061     OS_REL=''
 1062     test -r /etc/.relid \
 1063     && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
 1064     /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 1065       && echo i486-ncr-sysv4.3${OS_REL} && exit 0
 1066     /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
 1067       && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
 1068     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
 1069         /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 1070           && echo i486-ncr-sysv4 && exit 0 ;;
 1071     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
 1072     echo m68k-unknown-lynxos${UNAME_RELEASE}
 1073     exit 0 ;;
 1074     mc68030:UNIX_System_V:4.*:*)
 1075     echo m68k-atari-sysv4
 1076     exit 0 ;;
 1077     TSUNAMI:LynxOS:2.*:*)
 1078     echo sparc-unknown-lynxos${UNAME_RELEASE}
 1079     exit 0 ;;
 1080     rs6000:LynxOS:2.*:*)
 1081     echo rs6000-unknown-lynxos${UNAME_RELEASE}
 1082     exit 0 ;;
 1083     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 1084     echo powerpc-unknown-lynxos${UNAME_RELEASE}
 1085     exit 0 ;;
 1086     SM[BE]S:UNIX_SV:*:*)
 1087     echo mips-dde-sysv${UNAME_RELEASE}
 1088     exit 0 ;;
 1089     RM*:ReliantUNIX-*:*:*)
 1090     echo mips-sni-sysv4
 1091     exit 0 ;;
 1092     RM*:SINIX-*:*:*)
 1093     echo mips-sni-sysv4
 1094     exit 0 ;;
 1095     *:SINIX-*:*:*)
 1096     if uname -p 2>/dev/null >/dev/null ; then
 1097         UNAME_MACHINE=`(uname -p) 2>/dev/null`
 1098         echo ${UNAME_MACHINE}-sni-sysv4
 1099     else
 1100         echo ns32k-sni-sysv
 1101     fi
 1102     exit 0 ;;
 1103     PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 1104                       # says <Richard.M.Bartel@ccMail.Census.GOV>
 1105         echo i586-unisys-sysv4
 1106         exit 0 ;;
 1107     *:UNIX_System_V:4*:FTX*)
 1108     # From Gerald Hewes <hewes@openmarket.com>.
 1109     # How about differentiating between stratus architectures? -djm
 1110     echo hppa1.1-stratus-sysv4
 1111     exit 0 ;;
 1112     *:*:*:FTX*)
 1113     # From seanf@swdc.stratus.com.
 1114     echo i860-stratus-sysv4
 1115     exit 0 ;;
 1116     *:VOS:*:*)
 1117     # From Paul.Green@stratus.com.
 1118     echo hppa1.1-stratus-vos
 1119     exit 0 ;;
 1120     mc68*:A/UX:*:*)
 1121     echo m68k-apple-aux${UNAME_RELEASE}
 1122     exit 0 ;;
 1123     news*:NEWS-OS:6*:*)
 1124     echo mips-sony-newsos6
 1125     exit 0 ;;
 1126     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
 1127     if [ -d /usr/nec ]; then
 1128             echo mips-nec-sysv${UNAME_RELEASE}
 1129     else
 1130             echo mips-unknown-sysv${UNAME_RELEASE}
 1131     fi
 1132         exit 0 ;;
 1133     BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
 1134     echo powerpc-be-beos
 1135     exit 0 ;;
 1136     BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
 1137     echo powerpc-apple-beos
 1138     exit 0 ;;
 1139     BePC:BeOS:*:*)  # BeOS running on Intel PC compatible.
 1140     echo i586-pc-beos
 1141     exit 0 ;;
 1142     SX-4:SUPER-UX:*:*)
 1143     echo sx4-nec-superux${UNAME_RELEASE}
 1144     exit 0 ;;
 1145     SX-5:SUPER-UX:*:*)
 1146     echo sx5-nec-superux${UNAME_RELEASE}
 1147     exit 0 ;;
 1148     SX-6:SUPER-UX:*:*)
 1149     echo sx6-nec-superux${UNAME_RELEASE}
 1150     exit 0 ;;
 1151     Power*:Rhapsody:*:*)
 1152     echo powerpc-apple-rhapsody${UNAME_RELEASE}
 1153     exit 0 ;;
 1154     *:Rhapsody:*:*)
 1155     echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
 1156     exit 0 ;;
 1157     *:Darwin:*:*)
 1158     case `uname -p` in
 1159         *86) UNAME_PROCESSOR=i686 ;;
 1160         powerpc) UNAME_PROCESSOR=powerpc ;;
 1161     esac
 1162     echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 1163     exit 0 ;;
 1164     *:procnto*:*:* | *:QNX:[0123456789]*:*)
 1165     UNAME_PROCESSOR=`uname -p`
 1166     if test "$UNAME_PROCESSOR" = "x86"; then
 1167         UNAME_PROCESSOR=i386
 1168         UNAME_MACHINE=pc
 1169     fi
 1170     echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
 1171     exit 0 ;;
 1172     *:QNX:*:4*)
 1173     echo i386-pc-qnx
 1174     exit 0 ;;
 1175     NSR-?:NONSTOP_KERNEL:*:*)
 1176     echo nsr-tandem-nsk${UNAME_RELEASE}
 1177     exit 0 ;;
 1178     *:NonStop-UX:*:*)
 1179     echo mips-compaq-nonstopux
 1180     exit 0 ;;
 1181     BS2000:POSIX*:*:*)
 1182     echo bs2000-siemens-sysv
 1183     exit 0 ;;
 1184     DS/*:UNIX_System_V:*:*)
 1185     echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
 1186     exit 0 ;;
 1187     *:Plan9:*:*)
 1188     # "uname -m" is not consistent, so use $cputype instead. 386
 1189     # is converted to i386 for consistency with other x86
 1190     # operating systems.
 1191     if test "$cputype" = "386"; then
 1192         UNAME_MACHINE=i386
 1193     else
 1194         UNAME_MACHINE="$cputype"
 1195     fi
 1196     echo ${UNAME_MACHINE}-unknown-plan9
 1197     exit 0 ;;
 1198     *:TOPS-10:*:*)
 1199     echo pdp10-unknown-tops10
 1200     exit 0 ;;
 1201     *:TENEX:*:*)
 1202     echo pdp10-unknown-tenex
 1203     exit 0 ;;
 1204     KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 1205     echo pdp10-dec-tops20
 1206     exit 0 ;;
 1207     XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 1208     echo pdp10-xkl-tops20
 1209     exit 0 ;;
 1210     *:TOPS-20:*:*)
 1211     echo pdp10-unknown-tops20
 1212     exit 0 ;;
 1213     *:ITS:*:*)
 1214     echo pdp10-unknown-its
 1215     exit 0 ;;
 1216     SEI:*:*:SEIUX)
 1217         echo mips-sei-seiux${UNAME_RELEASE}
 1218     exit 0 ;;
 1219     *:DragonFly:*:*)
 1220     echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 1221     exit 0 ;;
 1222 esac
 1223 
 1224 #echo '(No uname command or uname output not recognized.)' 1>&2
 1225 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
 1226 
 1227 eval $set_cc_for_build
 1228 cat >$dummy.c <<EOF
 1229 #ifdef _SEQUENT_
 1230 # include <sys/types.h>
 1231 # include <sys/utsname.h>
 1232 #endif
 1233 main ()
 1234 {
 1235 #if defined (sony)
 1236 #if defined (MIPSEB)
 1237   /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
 1238      I don't know....  */
 1239   printf ("mips-sony-bsd\n"); exit (0);
 1240 #else
 1241 #include <sys/param.h>
 1242   printf ("m68k-sony-newsos%s\n",
 1243 #ifdef NEWSOS4
 1244           "4"
 1245 #else
 1246       ""
 1247 #endif
 1248          ); exit (0);
 1249 #endif
 1250 #endif
 1251 
 1252 #if defined (__arm) && defined (__acorn) && defined (__unix)
 1253   printf ("arm-acorn-riscix"); exit (0);
 1254 #endif
 1255 
 1256 #if defined (hp300) && !defined (hpux)
 1257   printf ("m68k-hp-bsd\n"); exit (0);
 1258 #endif
 1259 
 1260 #if defined (NeXT)
 1261 #if !defined (__ARCHITECTURE__)
 1262 #define __ARCHITECTURE__ "m68k"
 1263 #endif
 1264   int version;
 1265   version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
 1266   if (version < 4)
 1267     printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
 1268   else
 1269     printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
 1270   exit (0);
 1271 #endif
 1272 
 1273 #if defined (MULTIMAX) || defined (n16)
 1274 #if defined (UMAXV)
 1275   printf ("ns32k-encore-sysv\n"); exit (0);
 1276 #else
 1277 #if defined (CMU)
 1278   printf ("ns32k-encore-mach\n"); exit (0);
 1279 #else
 1280   printf ("ns32k-encore-bsd\n"); exit (0);
 1281 #endif
 1282 #endif
 1283 #endif
 1284 
 1285 #if defined (__386BSD__)
 1286   printf ("i386-pc-bsd\n"); exit (0);
 1287 #endif
 1288 
 1289 #if defined (sequent)
 1290 #if defined (i386)
 1291   printf ("i386-sequent-dynix\n"); exit (0);
 1292 #endif
 1293 #if defined (ns32000)
 1294   printf ("ns32k-sequent-dynix\n"); exit (0);
 1295 #endif
 1296 #endif
 1297 
 1298 #if defined (_SEQUENT_)
 1299     struct utsname un;
 1300 
 1301     uname(&un);
 1302 
 1303     if (strncmp(un.version, "V2", 2) == 0) {
 1304     printf ("i386-sequent-ptx2\n"); exit (0);
 1305     }
 1306     if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
 1307     printf ("i386-sequent-ptx1\n"); exit (0);
 1308     }
 1309     printf ("i386-sequent-ptx\n"); exit (0);
 1310 
 1311 #endif
 1312 
 1313 #if defined (vax)
 1314 # if !defined (ultrix)
 1315 #  include <sys/param.h>
 1316 #  if defined (BSD)
 1317 #   if BSD == 43
 1318       printf ("vax-dec-bsd4.3\n"); exit (0);
 1319 #   else
 1320 #    if BSD == 199006
 1321       printf ("vax-dec-bsd4.3reno\n"); exit (0);
 1322 #    else
 1323       printf ("vax-dec-bsd\n"); exit (0);
 1324 #    endif
 1325 #   endif
 1326 #  else
 1327     printf ("vax-dec-bsd\n"); exit (0);
 1328 #  endif
 1329 # else
 1330     printf ("vax-dec-ultrix\n"); exit (0);
 1331 # endif
 1332 #endif
 1333 
 1334 #if defined (alliant) && defined (i860)
 1335   printf ("i860-alliant-bsd\n"); exit (0);
 1336 #endif
 1337 
 1338   exit (1);
 1339 }
 1340 EOF
 1341 
 1342 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
 1343 
 1344 # Apollos put the system type in the environment.
 1345 
 1346 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
 1347 
 1348 # Convex versions that predate uname can use getsysinfo(1)
 1349 
 1350 if [ -x /usr/convex/getsysinfo ]
 1351 then
 1352     case `getsysinfo -f cpu_type` in
 1353     c1*)
 1354     echo c1-convex-bsd
 1355     exit 0 ;;
 1356     c2*)
 1357     if getsysinfo -f scalar_acc
 1358     then echo c32-convex-bsd
 1359     else echo c2-convex-bsd
 1360     fi
 1361     exit 0 ;;
 1362     c34*)
 1363     echo c34-convex-bsd
 1364     exit 0 ;;
 1365     c38*)
 1366     echo c38-convex-bsd
 1367     exit 0 ;;
 1368     c4*)
 1369     echo c4-convex-bsd
 1370     exit 0 ;;
 1371     esac
 1372 fi
 1373 
 1374 cat >&2 <<EOF
 1375 $0: unable to guess system type
 1376 
 1377 This script, last modified $timestamp, has failed to recognize
 1378 the operating system you are using. It is advised that you
 1379 download the most up to date version of the config scripts from
 1380 
 1381     ftp://ftp.gnu.org/pub/gnu/config/
 1382 
 1383 If the version you run ($0) is already up to date, please
 1384 send the following data and any information you think might be
 1385 pertinent to <config-patches@gnu.org> in order to provide the needed
 1386 information to handle your system.
 1387 
 1388 config.guess timestamp = $timestamp
 1389 
 1390 uname -m = `(uname -m) 2>/dev/null || echo unknown`
 1391 uname -r = `(uname -r) 2>/dev/null || echo unknown`
 1392 uname -s = `(uname -s) 2>/dev/null || echo unknown`
 1393 uname -v = `(uname -v) 2>/dev/null || echo unknown`
 1394 
 1395 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
 1396 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
 1397 
 1398 hostinfo               = `(hostinfo) 2>/dev/null`
 1399 /bin/universe          = `(/bin/universe) 2>/dev/null`
 1400 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
 1401 /bin/arch              = `(/bin/arch) 2>/dev/null`
 1402 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 1403 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 1404 
 1405 UNAME_MACHINE = ${UNAME_MACHINE}
 1406 UNAME_RELEASE = ${UNAME_RELEASE}
 1407 UNAME_SYSTEM  = ${UNAME_SYSTEM}
 1408 UNAME_VERSION = ${UNAME_VERSION}
 1409 EOF
 1410 
 1411 exit 1
 1412 
 1413 # Local variables:
 1414 # eval: (add-hook 'write-file-hooks 'time-stamp)
 1415 # time-stamp-start: "timestamp='"
 1416 # time-stamp-format: "%:y-%02m-%02d"
 1417 # time-stamp-end: "'"
 1418 # End: