/[ascend]/trunk/base/autotools/config/config.guess
ViewVC logotype

Diff of /trunk/base/autotools/config/config.guess

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/base/unixAC213/config/config.guess revision 133 by aw0a, Sat Nov 13 20:52:45 2004 UTC trunk/base/autotools/config/config.guess revision 134 by johnpye, Wed Dec 21 04:37:33 2005 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2  # Attempt to guess a canonical system name.  # Attempt to guess a canonical system name.
3  #   Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.  #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4  #  #   2000, 2001, 2002 Free Software Foundation, Inc.
5    
6    timestamp='2002-03-20'
7    
8  # This file is free software; you can redistribute it and/or modify it  # 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  # under the terms of the GNU General Public License as published by
10  # the Free Software Foundation; either version 2 of the License, or  # the Free Software Foundation; either version 2 of the License, or
# Line 21  Line 24 
24  # configuration script generated by Autoconf, you may include it under  # configuration script generated by Autoconf, you may include it under
25  # the same distribution terms that you use for the rest of that program.  # the same distribution terms that you use for the rest of that program.
26    
27  # Written by Per Bothner <bothner@cygnus.com>.  #####################################################################
28  # The master version of this file is at the FSF in /home/gd/gnu/lib.  # This file contains changes for Apache, clearly marked below.
29    # These changes are hereby donated to the public domain.
30    #####################################################################
31    
32    # Originally written by Per Bothner <per@bothner.com>.
33    # Please send patches to <config-patches@gnu.org>.  Submit a context
34    # diff and a properly formatted ChangeLog entry.
35  #  #
36  # This script attempts to guess a canonical system name similar to  # This script attempts to guess a canonical system name similar to
37  # config.sub.  If it succeeds, it prints the system name on stdout, and  # config.sub.  If it succeeds, it prints the system name on stdout, and
38  # exits with 0.  Otherwise, it exits with 1.  # exits with 0.  Otherwise, it exits with 1.
39  #  #
40  # The plan is that this can be called by configure scripts if you  # The plan is that this can be called by configure scripts if you
41  # don't specify an explicit system type (host/target name).  # don't specify an explicit build system type.
42  #  
43  # Only a few systems have been added to this list; please add others  me=`echo "$0" | sed -e 's,.*/,,'`
44  # (but try to keep the structure clean).  
45  #  usage="\
46    Usage: $0 [OPTION]
47    
48    Output the configuration name of the system \`$me' is run on.
49    
50    Operation modes:
51      -h, --help         print this help, then exit
52      -t, --time-stamp   print date of last modification, then exit
53      -v, --version      print version number, then exit
54    
55    Report bugs and patches to <config-patches@gnu.org>."
56    
57    version="\
58    GNU config.guess ($timestamp)
59    
60    Originally written by Per Bothner.
61    Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
62    Free Software Foundation, Inc.
63    
64    This is free software; see the source for copying conditions.  There is NO
65    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
66    
67    help="
68    Try \`$me --help' for more information."
69    
70    # Parse command line
71    while test $# -gt 0 ; do
72      case $1 in
73        --time-stamp | --time* | -t )
74           echo "$timestamp" ; exit 0 ;;
75        --version | -v )
76           echo "$version" ; exit 0 ;;
77        --help | --h* | -h )
78           echo "$usage"; exit 0 ;;
79        -- )     # Stop option processing
80           shift; break ;;
81        - ) # Use stdin as input.
82           break ;;
83        -* )
84           echo "$me: invalid option $1$help" >&2
85           exit 1 ;;
86        * )
87           break ;;
88      esac
89    done
90    
91    if test $# != 0; then
92      echo "$me: too many arguments$help" >&2
93      exit 1
94    fi
95    
96    
97    dummy=dummy-$$
98    trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
99    
100    # CC_FOR_BUILD -- compiler used by this script.
101    # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
102    # use `HOST_CC' if defined, but it is deprecated.
103    
104    set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
105     ,,)    echo "int dummy(){}" > $dummy.c ;
106        for c in cc gcc c89 c99 ; do
107          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
108          if test $? = 0 ; then
109             CC_FOR_BUILD="$c"; break ;
110          fi ;
111        done ;
112        rm -f $dummy.c $dummy.o $dummy.rel ;
113        if test x"$CC_FOR_BUILD" = x ; then
114          CC_FOR_BUILD=no_compiler_found ;
115        fi
116        ;;
117     ,,*)   CC_FOR_BUILD=$CC ;;
118     ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
119    esac'
120    
121  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.  # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
122  # (ghazi@noc.rutgers.edu 8/24/94.)  # (ghazi@noc.rutgers.edu 1994-08-24)
123  if (test -f /.attbin/uname) >/dev/null 2>&1 ; then  if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
124      PATH=$PATH:/.attbin ; export PATH      PATH=$PATH:/.attbin ; export PATH
125  fi  fi
126    
127  UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown  UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
128  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown  UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
129  UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown  UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
130  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown  UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
131    
 trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15  
   
132  # Note: order is significant - the case branches are not exclusive.  # Note: order is significant - the case branches are not exclusive.
133    
134  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
135        *:NetBSD:*:*)
136        # NetBSD (nbsd) targets should (where applicable) match one or
137        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
138        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
139        # switched to ELF, *-*-netbsd* would select the old
140        # object file format.  This provides both forward
141        # compatibility and a consistent mechanism for selecting the
142        # object file format.
143        #
144        # Note: NetBSD doesn't particularly care about the vendor
145        # portion of the name.  We always set it to "unknown".
146        sysctl="sysctl -n hw.machine_arch"
147        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
148            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
149        case "${UNAME_MACHINE_ARCH}" in
150            arm*) machine=arm-unknown ;;
151            sh3el) machine=shl-unknown ;;
152            sh3eb) machine=sh-unknown ;;
153            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
154        esac
155        # The Operating System including object format, if it has switched
156        # to ELF recently, or will in the future.
157        case "${UNAME_MACHINE_ARCH}" in
158            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
159            eval $set_cc_for_build
160            if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
161                | grep __ELF__ >/dev/null
162            then
163                # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
164                # Return netbsd for either.  FIX?
165                os=netbsd
166            else
167                os=netbsdelf
168            fi
169            ;;
170            *)
171                os=netbsd
172            ;;
173        esac
174        # The OS release
175        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
176        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
177        # contains redundant information, the shorter form:
178        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
179        echo "${machine}-${os}${release}"
180        exit 0 ;;
181        amiga:OpenBSD:*:*)
182        echo m68k-unknown-openbsd${UNAME_RELEASE}
183        exit 0 ;;
184        arc:OpenBSD:*:*)
185        echo mipsel-unknown-openbsd${UNAME_RELEASE}
186        exit 0 ;;
187        hp300:OpenBSD:*:*)
188        echo m68k-unknown-openbsd${UNAME_RELEASE}
189        exit 0 ;;
190        mac68k:OpenBSD:*:*)
191        echo m68k-unknown-openbsd${UNAME_RELEASE}
192        exit 0 ;;
193        macppc:OpenBSD:*:*)
194        echo powerpc-unknown-openbsd${UNAME_RELEASE}
195        exit 0 ;;
196        mvme68k:OpenBSD:*:*)
197        echo m68k-unknown-openbsd${UNAME_RELEASE}
198        exit 0 ;;
199        mvme88k:OpenBSD:*:*)
200        echo m88k-unknown-openbsd${UNAME_RELEASE}
201        exit 0 ;;
202        mvmeppc:OpenBSD:*:*)
203        echo powerpc-unknown-openbsd${UNAME_RELEASE}
204        exit 0 ;;
205        pmax:OpenBSD:*:*)
206        echo mipsel-unknown-openbsd${UNAME_RELEASE}
207        exit 0 ;;
208        sgi:OpenBSD:*:*)
209        echo mipseb-unknown-openbsd${UNAME_RELEASE}
210        exit 0 ;;
211        sun3:OpenBSD:*:*)
212        echo m68k-unknown-openbsd${UNAME_RELEASE}
213        exit 0 ;;
214        wgrisc:OpenBSD:*:*)
215        echo mipsel-unknown-openbsd${UNAME_RELEASE}
216        exit 0 ;;
217        *:OpenBSD:*:*)
218        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
219        exit 0 ;;
220      alpha:OSF1:*:*)      alpha:OSF1:*:*)
221        if test $UNAME_RELEASE = "V4.0"; then
222            UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
223        fi
224      # A Vn.n version is a released version.      # A Vn.n version is a released version.
225      # A Tn.n version is a released field test version.      # A Tn.n version is a released field test version.
226      # A Xn.n version is an unreleased experimental baselevel.      # A Xn.n version is an unreleased experimental baselevel.
227      # 1.2 uses "1.2" for uname -r.      # 1.2 uses "1.2" for uname -r.
228      echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//'`      cat <<EOF >$dummy.s
229        .data
230    \$Lformat:
231        .byte 37,100,45,37,120,10,0 # "%d-%x\n"
232    
233        .text
234        .globl main
235        .align 4
236        .ent main
237    main:
238        .frame \$30,16,\$26,0
239        ldgp \$29,0(\$27)
240        .prologue 1
241        .long 0x47e03d80 # implver \$0
242        lda \$2,-1
243        .long 0x47e20c21 # amask \$2,\$1
244        lda \$16,\$Lformat
245        mov \$0,\$17
246        not \$1,\$18
247        jsr \$26,printf
248        ldgp \$29,0(\$26)
249        mov 0,\$16
250        jsr \$26,exit
251        .end main
252    EOF
253        eval $set_cc_for_build
254        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
255        if test "$?" = 0 ; then
256            case `./$dummy` in
257                0-0)
258                    UNAME_MACHINE="alpha"
259                    ;;
260                1-0)
261                    UNAME_MACHINE="alphaev5"
262                    ;;
263                1-1)
264                    UNAME_MACHINE="alphaev56"
265                    ;;
266                1-101)
267                    UNAME_MACHINE="alphapca56"
268                    ;;
269                2-303)
270                    UNAME_MACHINE="alphaev6"
271                    ;;
272                2-307)
273                    UNAME_MACHINE="alphaev67"
274                    ;;
275                2-1307)
276                    UNAME_MACHINE="alphaev68"
277                    ;;
278            esac
279        fi
280        rm -f $dummy.s $dummy
281        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
282        exit 0 ;;
283        Alpha\ *:Windows_NT*:*)
284        # How do we know it's Interix rather than the generic POSIX subsystem?
285        # Should we change UNAME_MACHINE based on the output of uname instead
286        # of the specific Alpha model?
287        echo alpha-pc-interix
288      exit 0 ;;      exit 0 ;;
289      21064:Windows_NT:50:3)      21064:Windows_NT:50:3)
290      echo alpha-dec-winnt3.5      echo alpha-dec-winnt3.5
291      exit 0 ;;      exit 0 ;;
292      Amiga*:UNIX_System_V:4.0:*)      Amiga*:UNIX_System_V:4.0:*)
293      echo m68k-cbm-sysv4      echo m68k-unknown-sysv4
294      exit 0;;      exit 0;;
295      amiga:NetBSD:*:*)      *:[Aa]miga[Oo][Ss]:*:*)
296        echo m68k-cbm-netbsd${UNAME_RELEASE}      echo ${UNAME_MACHINE}-unknown-amigaos
297        exit 0 ;;      exit 0 ;;
298      amiga:OpenBSD:*:*)      *:[Mm]orph[Oo][Ss]:*:*)
299        echo m68k-cbm-openbsd${UNAME_RELEASE}      echo ${UNAME_MACHINE}-unknown-morphos
300        exit 0 ;;      exit 0 ;;
301    #########################
302    # Apache changes
303    #
304    #   *:OS/390:*:*)
305    #      echo i370-ibm-openedition
306    #      exit 0 ;;
307        *:OS390:*:* | *:OS/390:*:*)
308           echo s390-ibm-os390
309           exit 0 ;;
310        *:OS400:*:* | *:OS/400:*:*)
311           echo as400-ibm-os400
312           exit 0 ;;
313        *:OS/2:*:*)
314           echo "i386-pc-os2_emx"
315           exit 0;;
316    #
317    # end Apache changes
318    #########################
319        *:OS/390:*:*)
320        echo i370-ibm-openedition
321        exit 0 ;;
322      arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)      arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
323      echo arm-acorn-riscix${UNAME_RELEASE}      echo arm-acorn-riscix${UNAME_RELEASE}
324      exit 0;;      exit 0;;
325      Pyramid*:OSx*:*:*|MIS*:OSx*:*:*)      SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
326        echo hppa1.1-hitachi-hiuxmpp
327        exit 0;;
328        Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
329      # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.      # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
330      if test "`(/bin/universe) 2>/dev/null`" = att ; then      if test "`(/bin/universe) 2>/dev/null`" = att ; then
331          echo pyramid-pyramid-sysv3          echo pyramid-pyramid-sysv3
# Line 81  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ Line 333  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
333          echo pyramid-pyramid-bsd          echo pyramid-pyramid-bsd
334      fi      fi
335      exit 0 ;;      exit 0 ;;
336      NILE:*:*:dcosx)      NILE*:*:*:dcosx)
337      echo pyramid-pyramid-svr4      echo pyramid-pyramid-svr4
338      exit 0 ;;      exit 0 ;;
339        sun4H:SunOS:5.*:*)
340        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
341        exit 0 ;;
342      sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)      sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
343      echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`      echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
344      exit 0 ;;      exit 0 ;;
# Line 108  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ Line 363  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
363      sun3*:SunOS:*:*)      sun3*:SunOS:*:*)
364      echo m68k-sun-sunos${UNAME_RELEASE}      echo m68k-sun-sunos${UNAME_RELEASE}
365      exit 0 ;;      exit 0 ;;
366        sun*:*:4.2BSD:*)
367        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
368        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
369        case "`/bin/arch`" in
370            sun3)
371            echo m68k-sun-sunos${UNAME_RELEASE}
372            ;;
373            sun4)
374            echo sparc-sun-sunos${UNAME_RELEASE}
375            ;;
376        esac
377        exit 0 ;;
378      aushp:SunOS:*:*)      aushp:SunOS:*:*)
379      echo sparc-auspex-sunos${UNAME_RELEASE}      echo sparc-auspex-sunos${UNAME_RELEASE}
380      exit 0 ;;      exit 0 ;;
381      atari*:NetBSD:*:*)      # The situation for MiNT is a little confusing.  The machine name
382      echo m68k-atari-netbsd${UNAME_RELEASE}      # can be virtually everything (everything which is not
383      exit 0 ;;      # "atarist" or "atariste" at least should have a processor
384      atari*:OpenBSD:*:*)      # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
385      echo m68k-atari-openbsd${UNAME_RELEASE}      # to the lowercase version "mint" (or "freemint").  Finally
386      exit 0 ;;      # the system name "TOS" denotes a system which is actually not
387      sun3*:NetBSD:*:*)      # MiNT.  But MiNT is downward compatible to TOS, so this should
388      echo m68k-sun-netbsd${UNAME_RELEASE}      # be no problem.
389        atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
390            echo m68k-atari-mint${UNAME_RELEASE}
391      exit 0 ;;      exit 0 ;;
392      sun3*:OpenBSD:*:*)      atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
393      echo m68k-sun-openbsd${UNAME_RELEASE}      echo m68k-atari-mint${UNAME_RELEASE}
394      exit 0 ;;          exit 0 ;;
395      mac68k:NetBSD:*:*)      *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
396      echo m68k-apple-netbsd${UNAME_RELEASE}          echo m68k-atari-mint${UNAME_RELEASE}
     exit 0 ;;  
     mac68k:OpenBSD:*:*)  
     echo m68k-apple-openbsd${UNAME_RELEASE}  
397      exit 0 ;;      exit 0 ;;
398        milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
399            echo m68k-milan-mint${UNAME_RELEASE}
400            exit 0 ;;
401        hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
402            echo m68k-hades-mint${UNAME_RELEASE}
403            exit 0 ;;
404        *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
405            echo m68k-unknown-mint${UNAME_RELEASE}
406            exit 0 ;;
407      powerpc:machten:*:*)      powerpc:machten:*:*)
408      echo powerpc-apple-machten${UNAME_RELEASE}      echo powerpc-apple-machten${UNAME_RELEASE}
409      exit 0 ;;      exit 0 ;;
# Line 141  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ Line 416  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
416      VAX*:ULTRIX*:*:*)      VAX*:ULTRIX*:*:*)
417      echo vax-dec-ultrix${UNAME_RELEASE}      echo vax-dec-ultrix${UNAME_RELEASE}
418      exit 0 ;;      exit 0 ;;
419        2020:CLIX:*:* | 2430:CLIX:*:*)
420        echo clipper-intergraph-clix${UNAME_RELEASE}
421        exit 0 ;;
422      mips:*:*:UMIPS | mips:*:*:RISCos)      mips:*:*:UMIPS | mips:*:*:RISCos)
423      sed 's/^    //' << EOF >dummy.c      eval $set_cc_for_build
424      int main (argc, argv) int argc; char **argv; {      sed 's/^    //' << EOF >$dummy.c
425    #ifdef __cplusplus
426    #include <stdio.h>  /* for printf() prototype */
427        int main (int argc, char *argv[]) {
428    #else
429        int main (argc, argv) int argc; char *argv[]; {
430    #endif
431      #if defined (host_mips) && defined (MIPSEB)      #if defined (host_mips) && defined (MIPSEB)
432      #if defined (SYSTYPE_SYSV)      #if defined (SYSTYPE_SYSV)
433        printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);        printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
# Line 158  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$ Line 442  case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
442        exit (-1);        exit (-1);
443      }      }
444  EOF  EOF
445      ${CC-cc} dummy.c -o dummy \      $CC_FOR_BUILD $dummy.c -o $dummy \
446        && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \        && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
447        && rm dummy.c dummy && exit 0        && rm -f $dummy.c $dummy && exit 0
448      rm -f dummy.c dummy      rm -f $dummy.c $dummy
449      echo mips-mips-riscos${UNAME_RELEASE}      echo mips-mips-riscos${UNAME_RELEASE}
450      exit 0 ;;      exit 0 ;;
451        Motorola:PowerMAX_OS:*:*)
452        echo powerpc-motorola-powermax
453        exit 0 ;;
454      Night_Hawk:Power_UNIX:*:*)      Night_Hawk:Power_UNIX:*:*)
455      echo powerpc-harris-powerunix      echo powerpc-harris-powerunix
456      exit 0 ;;      exit 0 ;;
# Line 179  EOF Line 466  EOF
466      AViiON:dgux:*:*)      AViiON:dgux:*:*)
467          # DG/UX returns AViiON for all architectures          # DG/UX returns AViiON for all architectures
468          UNAME_PROCESSOR=`/usr/bin/uname -p`          UNAME_PROCESSOR=`/usr/bin/uname -p`
469          if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then      if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
470      if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \      then
471           -o ${TARGET_BINARY_INTERFACE}x = x ] ; then          if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
472               [ ${TARGET_BINARY_INTERFACE}x = x ]
473            then
474          echo m88k-dg-dgux${UNAME_RELEASE}          echo m88k-dg-dgux${UNAME_RELEASE}
475      else          else
476          echo m88k-dg-dguxbcs${UNAME_RELEASE}          echo m88k-dg-dguxbcs${UNAME_RELEASE}
477            fi
478        else
479            echo i586-dg-dgux${UNAME_RELEASE}
480      fi      fi
         else echo i586-dg-dgux${UNAME_RELEASE}  
         fi  
481      exit 0 ;;      exit 0 ;;
482      M88*:DolphinOS:*:*) # DolphinOS (SVR3)      M88*:DolphinOS:*:*) # DolphinOS (SVR3)
483      echo m88k-dolphin-sysv3      echo m88k-dolphin-sysv3
# Line 208  EOF Line 498  EOF
498      ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.      ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
499      echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id      echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
500      exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '      exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
501      i?86:AIX:*:*)      i*86:AIX:*:*)
502      echo i386-ibm-aix      echo i386-ibm-aix
503      exit 0 ;;      exit 0 ;;
504        ia64:AIX:*:*)
505        if [ -x /usr/bin/oslevel ] ; then
506            IBM_REV=`/usr/bin/oslevel`
507        else
508            IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
509        fi
510        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
511        exit 0 ;;
512      *:AIX:2:3)      *:AIX:2:3)
513      if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then      if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
514          sed 's/^        //' << EOF >dummy.c          eval $set_cc_for_build
515            sed 's/^        //' << EOF >$dummy.c
516          #include <sys/systemcfg.h>          #include <sys/systemcfg.h>
517    
518          main()          main()
# Line 224  EOF Line 523  EOF
523              exit(0);              exit(0);
524              }              }
525  EOF  EOF
526          ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0          $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
527          rm -f dummy.c dummy          rm -f $dummy.c $dummy
528          echo rs6000-ibm-aix3.2.5          echo rs6000-ibm-aix3.2.5
529      elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then      elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
530          echo rs6000-ibm-aix3.2.4          echo rs6000-ibm-aix3.2.4
# Line 233  EOF Line 532  EOF
532          echo rs6000-ibm-aix3.2          echo rs6000-ibm-aix3.2
533      fi      fi
534      exit 0 ;;      exit 0 ;;
535      *:AIX:*:4)      *:AIX:*:[45])
536      if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then      IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
537        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
538          IBM_ARCH=rs6000          IBM_ARCH=rs6000
539      else      else
540          IBM_ARCH=powerpc          IBM_ARCH=powerpc
# Line 242  EOF Line 542  EOF
542      if [ -x /usr/bin/oslevel ] ; then      if [ -x /usr/bin/oslevel ] ; then
543          IBM_REV=`/usr/bin/oslevel`          IBM_REV=`/usr/bin/oslevel`
544      else      else
545          IBM_REV=4.${UNAME_RELEASE}          IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
546      fi      fi
547      echo ${IBM_ARCH}-ibm-aix${IBM_REV}      echo ${IBM_ARCH}-ibm-aix${IBM_REV}
548      exit 0 ;;      exit 0 ;;
# Line 252  EOF Line 552  EOF
552      ibmrt:4.4BSD:*|romp-ibm:BSD:*)      ibmrt:4.4BSD:*|romp-ibm:BSD:*)
553      echo romp-ibm-bsd4.4      echo romp-ibm-bsd4.4
554      exit 0 ;;      exit 0 ;;
555      ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and      ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
556      echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to      echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
557      exit 0 ;;                           # report: romp-ibm BSD 4.3      exit 0 ;;                           # report: romp-ibm BSD 4.3
558      *:BOSX:*:*)      *:BOSX:*:*)
# Line 267  EOF Line 567  EOF
567      hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)      hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
568      echo m68k-hp-bsd4.4      echo m68k-hp-bsd4.4
569      exit 0 ;;      exit 0 ;;
570      9000/[3478]??:HP-UX:*:*)      9000/[34678]??:HP-UX:*:*)
571        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
572      case "${UNAME_MACHINE}" in      case "${UNAME_MACHINE}" in
573          9000/31? )            HP_ARCH=m68000 ;;          9000/31? )            HP_ARCH=m68000 ;;
574          9000/[34]?? )         HP_ARCH=m68k ;;          9000/[34]?? )         HP_ARCH=m68k ;;
575          9000/7?? | 9000/8?[1679] ) HP_ARCH=hppa1.1 ;;          9000/[678][0-9][0-9])
576          9000/8?? )            HP_ARCH=hppa1.0 ;;          if [ -x /usr/bin/getconf ]; then
577                sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
578                        sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
579                        case "${sc_cpu_version}" in
580                          523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
581                          528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
582                          532)                      # CPU_PA_RISC2_0
583                            case "${sc_kernel_bits}" in
584                              32) HP_ARCH="hppa2.0n" ;;
585                              64) HP_ARCH="hppa2.0w" ;;
586                  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
587                            esac ;;
588                        esac
589            fi
590            if [ "${HP_ARCH}" = "" ]; then
591                eval $set_cc_for_build
592                sed 's/^              //' << EOF >$dummy.c
593    
594                  #define _HPUX_SOURCE
595                  #include <stdlib.h>
596                  #include <unistd.h>
597    
598                  int main ()
599                  {
600                  #if defined(_SC_KERNEL_BITS)
601                      long bits = sysconf(_SC_KERNEL_BITS);
602                  #endif
603                      long cpu  = sysconf (_SC_CPU_VERSION);
604    
605                      switch (cpu)
606                    {
607                    case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
608                    case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
609                    case CPU_PA_RISC2_0:
610                  #if defined(_SC_KERNEL_BITS)
611                        switch (bits)
612                        {
613                        case 64: puts ("hppa2.0w"); break;
614                        case 32: puts ("hppa2.0n"); break;
615                        default: puts ("hppa2.0"); break;
616                        } break;
617                  #else  /* !defined(_SC_KERNEL_BITS) */
618                        puts ("hppa2.0"); break;
619                  #endif
620                    default: puts ("hppa1.0"); break;
621                    }
622                      exit (0);
623                  }
624    EOF
625                (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
626                if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
627                rm -f $dummy.c $dummy
628            fi ;;
629      esac      esac
     HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`  
630      echo ${HP_ARCH}-hp-hpux${HPUX_REV}      echo ${HP_ARCH}-hp-hpux${HPUX_REV}
631      exit 0 ;;      exit 0 ;;
632        ia64:HP-UX:*:*)
633        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
634        echo ia64-hp-hpux${HPUX_REV}
635        exit 0 ;;
636      3050*:HI-UX:*:*)      3050*:HI-UX:*:*)
637      sed 's/^    //' << EOF >dummy.c      eval $set_cc_for_build
638        sed 's/^    //' << EOF >$dummy.c
639      #include <unistd.h>      #include <unistd.h>
640      int      int
641      main ()      main ()
# Line 303  EOF Line 660  EOF
660        exit (0);        exit (0);
661      }      }
662  EOF  EOF
663      ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0      $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
664      rm -f dummy.c dummy      rm -f $dummy.c $dummy
665      echo unknown-hitachi-hiuxwe2      echo unknown-hitachi-hiuxwe2
666      exit 0 ;;      exit 0 ;;
667      9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )      9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
# Line 313  EOF Line 670  EOF
670      9000/8??:4.3bsd:*:*)      9000/8??:4.3bsd:*:*)
671      echo hppa1.0-hp-bsd      echo hppa1.0-hp-bsd
672      exit 0 ;;      exit 0 ;;
673        *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
674        echo hppa1.0-hp-mpeix
675        exit 0 ;;
676      hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )      hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
677      echo hppa1.1-hp-osf      echo hppa1.1-hp-osf
678      exit 0 ;;      exit 0 ;;
679      hp8??:OSF1:*:*)      hp8??:OSF1:*:*)
680      echo hppa1.0-hp-osf      echo hppa1.0-hp-osf
681      exit 0 ;;      exit 0 ;;
682      i?86:OSF1:*:*)      i*86:OSF1:*:*)
683      if [ -x /usr/sbin/sysversion ] ; then      if [ -x /usr/sbin/sysversion ] ; then
684          echo ${UNAME_MACHINE}-unknown-osf1mk          echo ${UNAME_MACHINE}-unknown-osf1mk
685      else      else
# Line 347  EOF Line 707  EOF
707      C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)      C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
708      echo c4-convex-bsd      echo c4-convex-bsd
709          exit 0 ;;          exit 0 ;;
     CRAY*X-MP:*:*:*)  
     echo xmp-cray-unicos  
         exit 0 ;;  
710      CRAY*Y-MP:*:*:*)      CRAY*Y-MP:*:*:*)
711      echo ymp-cray-unicos${UNAME_RELEASE}      echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
712      exit 0 ;;      exit 0 ;;
713      CRAY*[A-Z]90:*:*:*)      CRAY*[A-Z]90:*:*:*)
714      echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \      echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
715      | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \      | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
716            -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/            -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
717              -e 's/\.[^.]*$/.X/'
718      exit 0 ;;      exit 0 ;;
719      CRAY*TS:*:*:*)      CRAY*TS:*:*:*)
720      echo t90-cray-unicos${UNAME_RELEASE}      echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
721      exit 0 ;;      exit 0 ;;
722      CRAY-2:*:*:*)      CRAY*T3D:*:*:*)
723      echo cray2-cray-unicos      echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
724          exit 0 ;;      exit 0 ;;
725      F300:UNIX_System_V:*:*)      CRAY*T3E:*:*:*)
726          FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'`      echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
727        exit 0 ;;
728        CRAY*SV1:*:*:*)
729        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
730        exit 0 ;;
731        F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
732        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
733            FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
734          FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`          FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
735          echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"          echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
736          exit 0 ;;          exit 0 ;;
737      F301:UNIX_System_V:*:*)      i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
738         echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`      echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
        exit 0 ;;  
     hp3[0-9][05]:NetBSD:*:*)  
     echo m68k-hp-netbsd${UNAME_RELEASE}  
739      exit 0 ;;      exit 0 ;;
740      hp3[0-9][05]:OpenBSD:*:*)      sparc*:BSD/OS:*:*)
741      echo m68k-hp-openbsd${UNAME_RELEASE}      echo sparc-unknown-bsdi${UNAME_RELEASE}
742      exit 0 ;;      exit 0 ;;
743      i?86:BSD/386:*:* | *:BSD/OS:*:*)      *:BSD/OS:*:*)
744      echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}      echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
745      exit 0 ;;      exit 0 ;;
746      *:FreeBSD:*:*)      *:FreeBSD:*:*)
747      echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`      echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
748      exit 0 ;;      exit 0 ;;
749      *:NetBSD:*:*)      i*:CYGWIN*:*)
750      echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`      echo ${UNAME_MACHINE}-pc-cygwin
751      exit 0 ;;      exit 0 ;;
752      *:OpenBSD:*:*)      i*:MINGW*:*)
753      echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`      echo ${UNAME_MACHINE}-pc-mingw32
754      exit 0 ;;      exit 0 ;;
755      i*:CYGWIN*:*)      i*:PW*:*)
756      echo i386-pc-cygwin32      echo ${UNAME_MACHINE}-pc-pw32
757        exit 0 ;;
758        x86:Interix*:3*)
759        echo i386-pc-interix3
760        exit 0 ;;
761        i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
762        # How do we know it's Interix rather than the generic POSIX subsystem?
763        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
764        # UNAME_MACHINE based on the output of uname instead of i386?
765        echo i386-pc-interix
766        exit 0 ;;
767        i*:UWIN*:*)
768        echo ${UNAME_MACHINE}-pc-uwin
769      exit 0 ;;      exit 0 ;;
770      p*:CYGWIN*:*)      p*:CYGWIN*:*)
771      echo powerpcle-unknown-cygwin32      echo powerpcle-unknown-cygwin
772      exit 0 ;;      exit 0 ;;
773      prep*:SunOS:5.*:*)      prep*:SunOS:5.*:*)
774      echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`      echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
775      exit 0 ;;      exit 0 ;;
776      *:GNU:*:*)      *:GNU:*:*)
777      echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`      echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
778        exit 0 ;;
779        i*86:Minix:*:*)
780        echo ${UNAME_MACHINE}-pc-minix
781        exit 0 ;;
782        arm*:Linux:*:*)
783        echo ${UNAME_MACHINE}-unknown-linux-gnu
784        exit 0 ;;
785        ia64:Linux:*:*)
786        echo ${UNAME_MACHINE}-unknown-linux-gnu
787        exit 0 ;;
788        m68*:Linux:*:*)
789        echo ${UNAME_MACHINE}-unknown-linux-gnu
790        exit 0 ;;
791        mips:Linux:*:*)
792        eval $set_cc_for_build
793        sed 's/^    //' << EOF >$dummy.c
794        #undef CPU
795        #undef mips
796        #undef mipsel
797        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
798        CPU=mipsel
799        #else
800        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
801        CPU=mips
802        #else
803        CPU=
804        #endif
805        #endif
806    EOF
807        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
808        rm -f $dummy.c
809        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
810        ;;
811        ppc:Linux:*:*)
812        echo powerpc-unknown-linux-gnu
813        exit 0 ;;
814        ppc64:Linux:*:*)
815        echo powerpc64-unknown-linux-gnu
816        exit 0 ;;
817        alpha:Linux:*:*)
818        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
819          EV5)   UNAME_MACHINE=alphaev5 ;;
820          EV56)  UNAME_MACHINE=alphaev56 ;;
821          PCA56) UNAME_MACHINE=alphapca56 ;;
822          PCA57) UNAME_MACHINE=alphapca56 ;;
823          EV6)   UNAME_MACHINE=alphaev6 ;;
824          EV67)  UNAME_MACHINE=alphaev67 ;;
825          EV68*) UNAME_MACHINE=alphaev68 ;;
826            esac
827        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
828        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
829        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
830        exit 0 ;;
831        parisc:Linux:*:* | hppa:Linux:*:*)
832        # Look for CPU level
833        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
834          PA7*) echo hppa1.1-unknown-linux-gnu ;;
835          PA8*) echo hppa2.0-unknown-linux-gnu ;;
836          *)    echo hppa-unknown-linux-gnu ;;
837        esac
838        exit 0 ;;
839        parisc64:Linux:*:* | hppa64:Linux:*:*)
840        echo hppa64-unknown-linux-gnu
841        exit 0 ;;
842        s390:Linux:*:* | s390x:Linux:*:*)
843        echo ${UNAME_MACHINE}-ibm-linux
844        exit 0 ;;
845        sh*:Linux:*:*)
846        echo ${UNAME_MACHINE}-unknown-linux-gnu
847        exit 0 ;;
848        sparc:Linux:*:* | sparc64:Linux:*:*)
849        echo ${UNAME_MACHINE}-unknown-linux-gnu
850      exit 0 ;;      exit 0 ;;
851      *:Linux:*:*)      x86_64:Linux:*:*)
852        echo x86_64-unknown-linux-gnu
853        exit 0 ;;
854        i*86:Linux:*:*)
855      # The BFD linker knows what the default object file format is, so      # The BFD linker knows what the default object file format is, so
856      # first see if it will tell us.      # first see if it will tell us. cd to the root directory to prevent
857      ld_help_string=`ld --help 2>&1`      # problems with other programs or directories called `ld' in the path.
858      if echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf_i.86"; then      # Set LC_ALL=C to ensure ld outputs messages in English.
859        echo "${UNAME_MACHINE}-pc-linux-gnu" ; exit 0      ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
860      elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86linux"; then               | sed -ne '/supported targets:/!d
861        echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0                      s/[     ][  ]*/ /g
862      elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: i.86coff"; then                      s/.*supported targets: *//
863        echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0                      s/ .*//
864      elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68kelf"; then                      p'`
865        echo "${UNAME_MACHINE}-unknown-linux-gnu" ; exit 0          case "$ld_supported_targets" in
866      elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: m68klinux"; then        elf32-i386)
867        echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0          TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
868      elif echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations: elf32ppc"; then          ;;
869        echo "powerpc-unknown-linux-gnu" ; exit 0        a.out-i386-linux)
870      elif test "${UNAME_MACHINE}" = "alpha" ; then          echo "${UNAME_MACHINE}-pc-linux-gnuaout"
871        echo alpha-unknown-linux-gnu ; exit 0          exit 0 ;;      
872      elif test "${UNAME_MACHINE}" = "sparc" ; then        coff-i386)
873        echo sparc-unknown-linux-gnu ; exit 0          echo "${UNAME_MACHINE}-pc-linux-gnucoff"
874      else          exit 0 ;;
875        # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not give us        "")
876        # useful --help.  Gcc wants to distinguish between linux-gnuoldld and linux-gnuaout.          # Either a pre-BFD a.out linker (linux-gnuoldld) or
877        test ! -d /usr/lib/ldscripts/. \          # one that does not give us useful --help.
878          && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0          echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
879        # Determine whether the default compiler is a.out or elf          exit 0 ;;
880        cat >dummy.c <<EOF      esac
881  main(argc, argv)      # Determine whether the default compiler is a.out or elf
882  int argc;      eval $set_cc_for_build
883  char *argv[];      sed 's/^    //' << EOF >$dummy.c
884  {      #include <features.h>
885  #ifdef __ELF__      #ifdef __ELF__
886    printf ("%s-pc-linux-gnu\n", argv[1]);      # ifdef __GLIBC__
887  #else      #  if __GLIBC__ >= 2
888    printf ("%s-pc-linux-gnuaout\n", argv[1]);      LIBC=gnu
889  #endif      #  else
890    return 0;      LIBC=gnulibc1
891  }      #  endif
892        # else
893        LIBC=gnulibc1
894        # endif
895        #else
896        #ifdef __INTEL_COMPILER
897        LIBC=gnu
898        #else
899        LIBC=gnuaout
900        #endif
901        #endif
902  EOF  EOF
903        ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0      eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
904        rm -f dummy.c dummy      rm -f $dummy.c
905      fi ;;      test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
906  # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions      test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
907  # are messed up and put the nodename in both sysname and nodename.      ;;
908      i?86:DYNIX/ptx:4*:*)      i*86:DYNIX/ptx:4*:*)
909        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
910        # earlier versions are messed up and put the nodename in both
911        # sysname and nodename.
912      echo i386-sequent-sysv4      echo i386-sequent-sysv4
913      exit 0 ;;      exit 0 ;;
914      i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)      i*86:UNIX_SV:4.2MP:2.*)
915            # Unixware is an offshoot of SVR4, but it has its own version
916            # number series starting with 2...
917            # I am not positive that other SVR4 systems won't match this,
918        # I just have to hope.  -- rms.
919            # Use sysv4.2uw... so that sysv4* matches it.
920        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
921        exit 0 ;;
922        i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
923        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
924      if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then      if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
925          echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}          echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
926      else      else
927          echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}          echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
928      fi      fi
929      exit 0 ;;      exit 0 ;;
930      i?86:*:3.2:*)      i*86:*:5:[78]*)
931        case `/bin/uname -X | grep "^Machine"` in
932            *486*)       UNAME_MACHINE=i486 ;;
933            *Pentium)        UNAME_MACHINE=i586 ;;
934            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
935        esac
936        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
937        exit 0 ;;
938        i*86:*:3.2:*)
939      if test -f /usr/options/cb.name; then      if test -f /usr/options/cb.name; then
940          UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`          UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
941          echo ${UNAME_MACHINE}-pc-isc$UNAME_REL          echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
# Line 465  EOF Line 944  EOF
944          (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486          (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
945          (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \          (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
946              && UNAME_MACHINE=i586              && UNAME_MACHINE=i586
947            (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
948                && UNAME_MACHINE=i686
949            (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
950                && UNAME_MACHINE=i686
951          echo ${UNAME_MACHINE}-pc-sco$UNAME_REL          echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
952      else      else
953          echo ${UNAME_MACHINE}-pc-sysv32          echo ${UNAME_MACHINE}-pc-sysv32
954      fi      fi
955      exit 0 ;;      exit 0 ;;
956        i*86:*DOS:*:*)
957        echo ${UNAME_MACHINE}-pc-msdosdjgpp
958        exit 0 ;;
959        pc:*:*:*)
960        # Left here for compatibility:
961            # uname -m prints for DJGPP always 'pc', but it prints nothing about
962            # the processor, so we play safe by assuming i386.
963        echo i386-pc-msdosdjgpp
964            exit 0 ;;
965      Intel:Mach:3*:*)      Intel:Mach:3*:*)
966      echo i386-pc-mach3      echo i386-pc-mach3
967      exit 0 ;;      exit 0 ;;
# Line 489  EOF Line 981  EOF
981      exit 0 ;;      exit 0 ;;
982      M68*:*:R3V[567]*:*)      M68*:*:R3V[567]*:*)
983      test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;      test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
984      3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)      3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
985      OS_REL=''      OS_REL=''
986      test -r /etc/.relid \      test -r /etc/.relid \
987      && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`      && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
# Line 500  EOF Line 992  EOF
992      3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)      3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
993          /bin/uname -p 2>/dev/null | grep 86 >/dev/null \          /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
994            && echo i486-ncr-sysv4 && exit 0 ;;            && echo i486-ncr-sysv4 && exit 0 ;;
995      m68*:LynxOS:2.*:*)      m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
996      echo m68k-unknown-lynxos${UNAME_RELEASE}      echo m68k-unknown-lynxos${UNAME_RELEASE}
997      exit 0 ;;      exit 0 ;;
998      mc68030:UNIX_System_V:4.*:*)      mc68030:UNIX_System_V:4.*:*)
999      echo m68k-atari-sysv4      echo m68k-atari-sysv4
1000      exit 0 ;;      exit 0 ;;
1001      i?86:LynxOS:2.*:*)      i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1002      echo i386-unknown-lynxos${UNAME_RELEASE}      echo i386-unknown-lynxos${UNAME_RELEASE}
1003      exit 0 ;;      exit 0 ;;
1004      TSUNAMI:LynxOS:2.*:*)      TSUNAMI:LynxOS:2.*:*)
1005      echo sparc-unknown-lynxos${UNAME_RELEASE}      echo sparc-unknown-lynxos${UNAME_RELEASE}
1006      exit 0 ;;      exit 0 ;;
1007      rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)      rs6000:LynxOS:2.*:*)
1008      echo rs6000-unknown-lynxos${UNAME_RELEASE}      echo rs6000-unknown-lynxos${UNAME_RELEASE}
1009      exit 0 ;;      exit 0 ;;
1010        PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
1011        echo powerpc-unknown-lynxos${UNAME_RELEASE}
1012        exit 0 ;;
1013      SM[BE]S:UNIX_SV:*:*)      SM[BE]S:UNIX_SV:*:*)
1014      echo mips-dde-sysv${UNAME_RELEASE}      echo mips-dde-sysv${UNAME_RELEASE}
1015      exit 0 ;;      exit 0 ;;
1016        RM*:ReliantUNIX-*:*:*)
1017        echo mips-sni-sysv4
1018        exit 0 ;;
1019      RM*:SINIX-*:*:*)      RM*:SINIX-*:*:*)
1020      echo mips-sni-sysv4      echo mips-sni-sysv4
1021      exit 0 ;;      exit 0 ;;
# Line 529  EOF Line 1027  EOF
1027          echo ns32k-sni-sysv          echo ns32k-sni-sysv
1028      fi      fi
1029      exit 0 ;;      exit 0 ;;
1030        PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1031                          # says <Richard.M.Bartel@ccMail.Census.GOV>
1032            echo i586-unisys-sysv4
1033            exit 0 ;;
1034      *:UNIX_System_V:4*:FTX*)      *:UNIX_System_V:4*:FTX*)
1035      # From Gerald Hewes <hewes@openmarket.com>.      # From Gerald Hewes <hewes@openmarket.com>.
1036      # How about differentiating between stratus architectures? -djm      # How about differentiating between stratus architectures? -djm
# Line 538  EOF Line 1040  EOF
1040      # From seanf@swdc.stratus.com.      # From seanf@swdc.stratus.com.
1041      echo i860-stratus-sysv4      echo i860-stratus-sysv4
1042      exit 0 ;;      exit 0 ;;
1043        *:VOS:*:*)
1044        # From Paul.Green@stratus.com.
1045        echo hppa1.1-stratus-vos
1046        exit 0 ;;
1047      mc68*:A/UX:*:*)      mc68*:A/UX:*:*)
1048      echo m68k-apple-aux${UNAME_RELEASE}      echo m68k-apple-aux${UNAME_RELEASE}
1049      exit 0 ;;      exit 0 ;;
1050      R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:*)      news*:NEWS-OS:6*:*)
1051        echo mips-sony-newsos6
1052        exit 0 ;;
1053        R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1054      if [ -d /usr/nec ]; then      if [ -d /usr/nec ]; then
1055              echo mips-nec-sysv${UNAME_RELEASE}              echo mips-nec-sysv${UNAME_RELEASE}
1056      else      else
1057              echo mips-unknown-sysv${UNAME_RELEASE}              echo mips-unknown-sysv${UNAME_RELEASE}
1058      fi      fi
1059          exit 0 ;;          exit 0 ;;
1060      PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort      BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1061                             # says <Richard.M.Bartel@ccMail.Census.GOV>      echo powerpc-be-beos
1062          echo i586-unisys-sysv4      exit 0 ;;
1063          exit 0 ;;      BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1064        echo powerpc-apple-beos
1065        exit 0 ;;
1066        BePC:BeOS:*:*)  # BeOS running on Intel PC compatible.
1067        echo i586-pc-beos
1068        exit 0 ;;
1069        SX-4:SUPER-UX:*:*)
1070        echo sx4-nec-superux${UNAME_RELEASE}
1071        exit 0 ;;
1072        SX-5:SUPER-UX:*:*)
1073        echo sx5-nec-superux${UNAME_RELEASE}
1074        exit 0 ;;
1075        Power*:Rhapsody:*:*)
1076        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1077        exit 0 ;;
1078        *:Rhapsody:*:*)
1079        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1080        exit 0 ;;
1081        *:Darwin:*:*)
1082        echo `uname -p`-apple-darwin${UNAME_RELEASE}
1083        exit 0 ;;
1084        *:procnto*:*:* | *:QNX:[0123456789]*:*)
1085        UNAME_PROCESSOR=`uname -p`
1086        if test "$UNAME_PROCESSOR" = "x86"; then
1087            UNAME_PROCESSOR=i386
1088            UNAME_MACHINE=pc
1089        fi
1090        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1091        exit 0 ;;
1092        *:QNX:*:4*)
1093        echo i386-pc-qnx
1094        exit 0 ;;
1095        NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
1096        echo nsr-tandem-nsk${UNAME_RELEASE}
1097        exit 0 ;;
1098        *:NonStop-UX:*:*)
1099        echo mips-compaq-nonstopux
1100        exit 0 ;;
1101        BS2000:POSIX*:*:*)
1102        echo bs2000-siemens-sysv
1103        exit 0 ;;
1104        DS/*:UNIX_System_V:*:*)
1105        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1106        exit 0 ;;
1107        *:Plan9:*:*)
1108        # "uname -m" is not consistent, so use $cputype instead. 386
1109        # is converted to i386 for consistency with other x86
1110        # operating systems.
1111        if test "$cputype" = "386"; then
1112            UNAME_MACHINE=i386
1113        else
1114            UNAME_MACHINE="$cputype"
1115        fi
1116        echo ${UNAME_MACHINE}-unknown-plan9
1117        exit 0 ;;
1118        i*86:OS/2:*:*)
1119        # If we were able to find `uname', then EMX Unix compatibility
1120        # is probably installed.
1121        echo ${UNAME_MACHINE}-pc-os2-emx
1122        exit 0 ;;
1123        *:TOPS-10:*:*)
1124        echo pdp10-unknown-tops10
1125        exit 0 ;;
1126        *:TENEX:*:*)
1127        echo pdp10-unknown-tenex
1128        exit 0 ;;
1129        KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1130        echo pdp10-dec-tops20
1131        exit 0 ;;
1132        XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1133        echo pdp10-xkl-tops20
1134        exit 0 ;;
1135        *:TOPS-20:*:*)
1136        echo pdp10-unknown-tops20
1137        exit 0 ;;
1138        *:ITS:*:*)
1139        echo pdp10-unknown-its
1140        exit 0 ;;
1141        i*86:XTS-300:*:STOP)
1142        echo ${UNAME_MACHINE}-unknown-stop
1143        exit 0 ;;
1144        i*86:atheos:*:*)
1145        echo ${UNAME_MACHINE}-unknown-atheos
1146        exit 0 ;;
1147  esac  esac
1148    
1149  #echo '(No uname command or uname output not recognized.)' 1>&2  #echo '(No uname command or uname output not recognized.)' 1>&2
1150  #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2  #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1151    
1152  cat >dummy.c <<EOF  eval $set_cc_for_build
1153    cat >$dummy.c <<EOF
1154  #ifdef _SEQUENT_  #ifdef _SEQUENT_
1155  # include <sys/types.h>  # include <sys/types.h>
1156  # include <sys/utsname.h>  # include <sys/utsname.h>
# Line 595  main () Line 1188  main ()
1188  #endif  #endif
1189    int version;    int version;
1190    version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;    version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1191    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);    if (version < 4)
1192        printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1193      else
1194        printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1195    exit (0);    exit (0);
1196  #endif  #endif
1197    
# Line 640  main () Line 1236  main ()
1236  #endif  #endif
1237    
1238  #if defined (vax)  #if defined (vax)
1239  #if !defined (ultrix)  # if !defined (ultrix)
1240    printf ("vax-dec-bsd\n"); exit (0);  #  include <sys/param.h>
1241  #else  #  if defined (BSD)
1242    printf ("vax-dec-ultrix\n"); exit (0);  #   if BSD == 43
1243  #endif        printf ("vax-dec-bsd4.3\n"); exit (0);
1244    #   else
1245    #    if BSD == 199006
1246          printf ("vax-dec-bsd4.3reno\n"); exit (0);
1247    #    else
1248          printf ("vax-dec-bsd\n"); exit (0);
1249    #    endif
1250    #   endif
1251    #  else
1252        printf ("vax-dec-bsd\n"); exit (0);
1253    #  endif
1254    # else
1255        printf ("vax-dec-ultrix\n"); exit (0);
1256    # endif
1257  #endif  #endif
1258    
1259  #if defined (alliant) && defined (i860)  #if defined (alliant) && defined (i860)
# Line 655  main () Line 1264  main ()
1264  }  }
1265  EOF  EOF
1266    
1267  ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0  $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1268  rm -f dummy.c dummy  rm -f $dummy.c $dummy
1269    
1270  # Apollos put the system type in the environment.  # Apollos put the system type in the environment.
1271    
# Line 688  then Line 1297  then
1297      esac      esac
1298  fi  fi
1299    
1300  #echo '(Unable to guess system type)' 1>&2  cat >&2 <<EOF
1301    $0: unable to guess system type
1302    
1303    This script, last modified $timestamp, has failed to recognize
1304    the operating system you are using. It is advised that you
1305    download the most up to date version of the config scripts from
1306    
1307        ftp://ftp.gnu.org/pub/gnu/config/
1308    
1309    If the version you run ($0) is already up to date, please
1310    send the following data and any information you think might be
1311    pertinent to <config-patches@gnu.org> in order to provide the needed
1312    information to handle your system.
1313    
1314    config.guess timestamp = $timestamp
1315    
1316    uname -m = `(uname -m) 2>/dev/null || echo unknown`
1317    uname -r = `(uname -r) 2>/dev/null || echo unknown`
1318    uname -s = `(uname -s) 2>/dev/null || echo unknown`
1319    uname -v = `(uname -v) 2>/dev/null || echo unknown`
1320    
1321    /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1322    /bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
1323    
1324    hostinfo               = `(hostinfo) 2>/dev/null`
1325    /bin/universe          = `(/bin/universe) 2>/dev/null`
1326    /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
1327    /bin/arch              = `(/bin/arch) 2>/dev/null`
1328    /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1329    /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1330    
1331    UNAME_MACHINE = ${UNAME_MACHINE}
1332    UNAME_RELEASE = ${UNAME_RELEASE}
1333    UNAME_SYSTEM  = ${UNAME_SYSTEM}
1334    UNAME_VERSION = ${UNAME_VERSION}
1335    EOF
1336    
1337  exit 1  exit 1
1338    
1339    # Local variables:
1340    # eval: (add-hook 'write-file-hooks 'time-stamp)
1341    # time-stamp-start: "timestamp='"
1342    # time-stamp-format: "%:y-%02m-%02d"
1343    # time-stamp-end: "'"
1344    # End:

Legend:
Removed from v.133  
changed lines
  Added in v.134

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22