~ubuntu-branches/ubuntu/gutsy/trickle/gutsy

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Robert Lemmen
  • Date: 2003-10-23 00:53:35 UTC
  • Revision ID: james.westby@ubuntu.com-20031023005335-madily9tgs8mguai
Tags: 1.06-4
rebuild again since i386 was missed (darn)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#! /bin/sh
2
2
# Attempt to guess a canonical system name.
3
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
 
#   2000, 2001, 2002 Free Software Foundation, Inc.
 
4
#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
5
 
6
 
timestamp='2002-02-19'
 
6
timestamp='2003-07-02'
7
7
 
8
8
# This file is free software; you can redistribute it and/or modify it
9
9
# under the terms of the GNU General Public License as published by
88
88
  exit 1
89
89
fi
90
90
 
91
 
 
92
 
dummy=dummy-$$
93
 
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
94
 
 
95
 
# CC_FOR_BUILD -- compiler used by this script.
 
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
 
96
98
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
97
99
# use `HOST_CC' if defined, but it is deprecated.
98
100
 
99
 
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
100
 
 ,,)    echo "int dummy(){}" > $dummy.c ;
101
 
        for c in cc gcc c89 ; do
102
 
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
103
 
          if test $? = 0 ; then
 
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
104
117
             CC_FOR_BUILD="$c"; break ;
105
118
          fi ;
106
119
        done ;
107
 
        rm -f $dummy.c $dummy.o $dummy.rel ;
108
120
        if test x"$CC_FOR_BUILD" = x ; then
109
121
          CC_FOR_BUILD=no_compiler_found ;
110
122
        fi
111
123
        ;;
112
124
 ,,*)   CC_FOR_BUILD=$CC ;;
113
125
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
114
 
esac'
 
126
esac ;'
115
127
 
116
128
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
117
129
# (ghazi@noc.rutgers.edu 1994-08-24)
138
150
        #
139
151
        # Note: NetBSD doesn't particularly care about the vendor
140
152
        # portion of the name.  We always set it to "unknown".
141
 
        UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
142
 
            UNAME_MACHINE_ARCH=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)`
143
156
        case "${UNAME_MACHINE_ARCH}" in
 
157
            armeb) machine=armeb-unknown ;;
144
158
            arm*) machine=arm-unknown ;;
145
159
            sh3el) machine=shl-unknown ;;
146
160
            sh3eb) machine=sh-unknown ;;
166
180
                ;;
167
181
        esac
168
182
        # The OS release
169
 
        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
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
170
195
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
171
196
        # contains redundant information, the shorter form:
172
197
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
215
240
        if test $UNAME_RELEASE = "V4.0"; then
216
241
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
217
242
        fi
 
243
        # According to Compaq, /usr/sbin/psrinfo has been available on
 
244
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
 
245
        # covers most systems running today.  This code pipes the CPU
 
246
        # types through head -n 1, so we only detect the type of CPU 0.
 
247
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 
248
        case "$ALPHA_CPU_TYPE" in
 
249
            "EV4 (21064)")
 
250
                UNAME_MACHINE="alpha" ;;
 
251
            "EV4.5 (21064)")
 
252
                UNAME_MACHINE="alpha" ;;
 
253
            "LCA4 (21066/21068)")
 
254
                UNAME_MACHINE="alpha" ;;
 
255
            "EV5 (21164)")
 
256
                UNAME_MACHINE="alphaev5" ;;
 
257
            "EV5.6 (21164A)")
 
258
                UNAME_MACHINE="alphaev56" ;;
 
259
            "EV5.6 (21164PC)")
 
260
                UNAME_MACHINE="alphapca56" ;;
 
261
            "EV5.7 (21164PC)")
 
262
                UNAME_MACHINE="alphapca57" ;;
 
263
            "EV6 (21264)")
 
264
                UNAME_MACHINE="alphaev6" ;;
 
265
            "EV6.7 (21264A)")
 
266
                UNAME_MACHINE="alphaev67" ;;
 
267
            "EV6.8CB (21264C)")
 
268
                UNAME_MACHINE="alphaev68" ;;
 
269
            "EV6.8AL (21264B)")
 
270
                UNAME_MACHINE="alphaev68" ;;
 
271
            "EV6.8CX (21264D)")
 
272
                UNAME_MACHINE="alphaev68" ;;
 
273
            "EV6.9A (21264/EV69A)")
 
274
                UNAME_MACHINE="alphaev69" ;;
 
275
            "EV7 (21364)")
 
276
                UNAME_MACHINE="alphaev7" ;;
 
277
            "EV7.9 (21364A)")
 
278
                UNAME_MACHINE="alphaev79" ;;
 
279
        esac
218
280
        # A Vn.n version is a released version.
219
281
        # A Tn.n version is a released field test version.
220
282
        # A Xn.n version is an unreleased experimental baselevel.
221
283
        # 1.2 uses "1.2" for uname -r.
222
 
        cat <<EOF >$dummy.s
223
 
        .data
224
 
\$Lformat:
225
 
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
226
 
 
227
 
        .text
228
 
        .globl main
229
 
        .align 4
230
 
        .ent main
231
 
main:
232
 
        .frame \$30,16,\$26,0
233
 
        ldgp \$29,0(\$27)
234
 
        .prologue 1
235
 
        .long 0x47e03d80 # implver \$0
236
 
        lda \$2,-1
237
 
        .long 0x47e20c21 # amask \$2,\$1
238
 
        lda \$16,\$Lformat
239
 
        mov \$0,\$17
240
 
        not \$1,\$18
241
 
        jsr \$26,printf
242
 
        ldgp \$29,0(\$26)
243
 
        mov 0,\$16
244
 
        jsr \$26,exit
245
 
        .end main
246
 
EOF
247
 
        eval $set_cc_for_build
248
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
249
 
        if test "$?" = 0 ; then
250
 
                case `./$dummy` in
251
 
                        0-0)
252
 
                                UNAME_MACHINE="alpha"
253
 
                                ;;
254
 
                        1-0)
255
 
                                UNAME_MACHINE="alphaev5"
256
 
                                ;;
257
 
                        1-1)
258
 
                                UNAME_MACHINE="alphaev56"
259
 
                                ;;
260
 
                        1-101)
261
 
                                UNAME_MACHINE="alphapca56"
262
 
                                ;;
263
 
                        2-303)
264
 
                                UNAME_MACHINE="alphaev6"
265
 
                                ;;
266
 
                        2-307)
267
 
                                UNAME_MACHINE="alphaev67"
268
 
                                ;;
269
 
                        2-1307)
270
 
                                UNAME_MACHINE="alphaev68"
271
 
                                ;;
272
 
                esac
273
 
        fi
274
 
        rm -f $dummy.s $dummy
275
284
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
276
285
        exit 0 ;;
 
286
    Alpha*:OpenVMS:*:*)
 
287
        echo alpha-hp-vms
 
288
        exit 0 ;;
277
289
    Alpha\ *:Windows_NT*:*)
278
290
        # How do we know it's Interix rather than the generic POSIX subsystem?
279
291
        # Should we change UNAME_MACHINE based on the output of uname instead
312
324
    NILE*:*:*:dcosx)
313
325
        echo pyramid-pyramid-svr4
314
326
        exit 0 ;;
 
327
    DRS?6000:unix:4.0:6*)
 
328
        echo sparc-icl-nx6
 
329
        exit 0 ;;
 
330
    DRS?6000:UNIX_SV:4.2*:7*)
 
331
        case `/usr/bin/uname -p` in
 
332
            sparc) echo sparc-icl-nx7 && exit 0 ;;
 
333
        esac ;;
315
334
    sun4H:SunOS:5.*:*)
316
335
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
317
336
        exit 0 ;;
418
437
          exit (-1);
419
438
        }
420
439
EOF
421
 
        $CC_FOR_BUILD $dummy.c -o $dummy \
422
 
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
423
 
          && rm -f $dummy.c $dummy && exit 0
424
 
        rm -f $dummy.c $dummy
 
440
        $CC_FOR_BUILD -o $dummy $dummy.c \
 
441
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 
442
          && exit 0
425
443
        echo mips-mips-riscos${UNAME_RELEASE}
426
444
        exit 0 ;;
427
445
    Motorola:PowerMAX_OS:*:*)
428
446
        echo powerpc-motorola-powermax
429
447
        exit 0 ;;
 
448
    Motorola:*:4.3:PL8-*)
 
449
        echo powerpc-harris-powermax
 
450
        exit 0 ;;
 
451
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 
452
        echo powerpc-harris-powermax
 
453
        exit 0 ;;
430
454
    Night_Hawk:Power_UNIX:*:*)
431
455
        echo powerpc-harris-powerunix
432
456
        exit 0 ;;
499
523
                        exit(0);
500
524
                        }
501
525
EOF
502
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
503
 
                rm -f $dummy.c $dummy
 
526
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
504
527
                echo rs6000-ibm-aix3.2.5
505
528
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
506
529
                echo rs6000-ibm-aix3.2.4
598
621
                  exit (0);
599
622
              }
600
623
EOF
601
 
                    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
602
 
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
603
 
                    rm -f $dummy.c $dummy
 
624
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
625
                    test -z "$HP_ARCH" && HP_ARCH=hppa
604
626
                fi ;;
605
627
        esac
 
628
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
629
        then
 
630
            # avoid double evaluation of $set_cc_for_build
 
631
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
632
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 
633
            then
 
634
                HP_ARCH="hppa2.0w"
 
635
            else
 
636
                HP_ARCH="hppa64"
 
637
            fi
 
638
        fi
606
639
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
607
640
        exit 0 ;;
608
641
    ia64:HP-UX:*:*)
636
669
          exit (0);
637
670
        }
638
671
EOF
639
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
640
 
        rm -f $dummy.c $dummy
 
672
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
641
673
        echo unknown-hitachi-hiuxwe2
642
674
        exit 0 ;;
643
675
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
695
727
    CRAY*TS:*:*:*)
696
728
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
697
729
        exit 0 ;;
698
 
    CRAY*T3D:*:*:*)
699
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
700
 
        exit 0 ;;
701
730
    CRAY*T3E:*:*:*)
702
731
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
703
732
        exit 0 ;;
704
733
    CRAY*SV1:*:*:*)
705
734
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
706
735
        exit 0 ;;
 
736
    *:UNICOS/mp:*:*)
 
737
        echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' 
 
738
        exit 0 ;;
707
739
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
708
740
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
709
741
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
719
751
    *:BSD/OS:*:*)
720
752
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
721
753
        exit 0 ;;
722
 
    *:FreeBSD:*:*)
723
 
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
754
    *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
 
755
        # Determine whether the default compiler uses glibc.
 
756
        eval $set_cc_for_build
 
757
        sed 's/^        //' << EOF >$dummy.c
 
758
        #include <features.h>
 
759
        #if __GLIBC__ >= 2
 
760
        LIBC=gnu
 
761
        #else
 
762
        LIBC=
 
763
        #endif
 
764
EOF
 
765
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
766
        # GNU/FreeBSD systems have a "k" prefix to indicate we are using
 
767
        # FreeBSD's kernel, but not the complete OS.
 
768
        case ${LIBC} in gnu) kernel_only='k' ;; esac
 
769
        echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
724
770
        exit 0 ;;
725
771
    i*:CYGWIN*:*)
726
772
        echo ${UNAME_MACHINE}-pc-cygwin
731
777
    i*:PW*:*)
732
778
        echo ${UNAME_MACHINE}-pc-pw32
733
779
        exit 0 ;;
734
 
    x86:Interix*:3*)
735
 
        echo i386-pc-interix3
 
780
    x86:Interix*:[34]*)
 
781
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
782
        exit 0 ;;
 
783
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
784
        echo i${UNAME_MACHINE}-pc-mks
736
785
        exit 0 ;;
737
786
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
738
787
        # How do we know it's Interix rather than the generic POSIX subsystem?
739
788
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
740
789
        # UNAME_MACHINE based on the output of uname instead of i386?
741
 
        echo i386-pc-interix
 
790
        echo i586-pc-interix
742
791
        exit 0 ;;
743
792
    i*:UWIN*:*)
744
793
        echo ${UNAME_MACHINE}-pc-uwin
758
807
    arm*:Linux:*:*)
759
808
        echo ${UNAME_MACHINE}-unknown-linux-gnu
760
809
        exit 0 ;;
 
810
    cris:Linux:*:*)
 
811
        echo cris-axis-linux-gnu
 
812
        exit 0 ;;
761
813
    ia64:Linux:*:*)
762
 
        echo ${UNAME_MACHINE}-unknown-linux
 
814
        echo ${UNAME_MACHINE}-unknown-linux-gnu
763
815
        exit 0 ;;
764
816
    m68*:Linux:*:*)
765
817
        echo ${UNAME_MACHINE}-unknown-linux-gnu
770
822
        #undef CPU
771
823
        #undef mips
772
824
        #undef mipsel
773
 
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 
774
 
        CPU=mipsel 
 
825
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
826
        CPU=mipsel
775
827
        #else
776
 
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 
 
828
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
777
829
        CPU=mips
778
830
        #else
779
831
        CPU=
780
832
        #endif
781
 
        #endif 
782
 
EOF
783
 
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
784
 
        rm -f $dummy.c
785
 
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 
833
        #endif
 
834
EOF
 
835
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
836
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
837
        ;;
 
838
    mips64:Linux:*:*)
 
839
        eval $set_cc_for_build
 
840
        sed 's/^        //' << EOF >$dummy.c
 
841
        #undef CPU
 
842
        #undef mips64
 
843
        #undef mips64el
 
844
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
845
        CPU=mips64el
 
846
        #else
 
847
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
848
        CPU=mips64
 
849
        #else
 
850
        CPU=
 
851
        #endif
 
852
        #endif
 
853
EOF
 
854
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
855
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
786
856
        ;;
787
857
    ppc:Linux:*:*)
788
858
        echo powerpc-unknown-linux-gnu
818
888
    s390:Linux:*:* | s390x:Linux:*:*)
819
889
        echo ${UNAME_MACHINE}-ibm-linux
820
890
        exit 0 ;;
 
891
    sh64*:Linux:*:*)
 
892
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
893
        exit 0 ;;
821
894
    sh*:Linux:*:*)
822
895
        echo ${UNAME_MACHINE}-unknown-linux-gnu
823
896
        exit 0 ;;
844
917
                ;;
845
918
          a.out-i386-linux)
846
919
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
847
 
                exit 0 ;;               
 
920
                exit 0 ;;
848
921
          coff-i386)
849
922
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
850
923
                exit 0 ;;
877
950
        #endif
878
951
EOF
879
952
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
880
 
        rm -f $dummy.c
881
953
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
882
954
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
883
955
        ;;
895
967
        # Use sysv4.2uw... so that sysv4* matches it.
896
968
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
897
969
        exit 0 ;;
 
970
    i*86:OS/2:*:*)
 
971
        # If we were able to find `uname', then EMX Unix compatibility
 
972
        # is probably installed.
 
973
        echo ${UNAME_MACHINE}-pc-os2-emx
 
974
        exit 0 ;;
 
975
    i*86:XTS-300:*:STOP)
 
976
        echo ${UNAME_MACHINE}-unknown-stop
 
977
        exit 0 ;;
 
978
    i*86:atheos:*:*)
 
979
        echo ${UNAME_MACHINE}-unknown-atheos
 
980
        exit 0 ;;
 
981
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
982
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
983
        exit 0 ;;
 
984
    i*86:*DOS:*:*)
 
985
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
986
        exit 0 ;;
898
987
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
899
988
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
900
989
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
916
1005
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
917
1006
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
918
1007
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
919
 
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
920
 
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
921
 
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 
1008
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 
1009
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 
1010
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
922
1011
                        && UNAME_MACHINE=i586
923
 
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 
1012
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
924
1013
                        && UNAME_MACHINE=i686
925
 
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
 
1014
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
926
1015
                        && UNAME_MACHINE=i686
927
1016
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
928
1017
        else
929
1018
                echo ${UNAME_MACHINE}-pc-sysv32
930
1019
        fi
931
1020
        exit 0 ;;
932
 
    i*86:*DOS:*:*)
933
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
934
 
        exit 0 ;;
935
1021
    pc:*:*:*)
936
1022
        # Left here for compatibility:
937
1023
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
955
1041
        # "miniframe"
956
1042
        echo m68010-convergent-sysv
957
1043
        exit 0 ;;
 
1044
    mc68k:UNIX:SYSTEM5:3.51m)
 
1045
        echo m68k-convergent-sysv
 
1046
        exit 0 ;;
 
1047
    M680?0:D-NIX:5.3:*)
 
1048
        echo m68k-diab-dnix
 
1049
        exit 0 ;;
958
1050
    M68*:*:R3V[567]*:*)
959
1051
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
960
 
    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)
 
1052
    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 | 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)
961
1053
        OS_REL=''
962
1054
        test -r /etc/.relid \
963
1055
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
974
1066
    mc68030:UNIX_System_V:4.*:*)
975
1067
        echo m68k-atari-sysv4
976
1068
        exit 0 ;;
977
 
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
978
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
979
 
        exit 0 ;;
980
1069
    TSUNAMI:LynxOS:2.*:*)
981
1070
        echo sparc-unknown-lynxos${UNAME_RELEASE}
982
1071
        exit 0 ;;
1048
1137
    SX-5:SUPER-UX:*:*)
1049
1138
        echo sx5-nec-superux${UNAME_RELEASE}
1050
1139
        exit 0 ;;
 
1140
    SX-6:SUPER-UX:*:*)
 
1141
        echo sx6-nec-superux${UNAME_RELEASE}
 
1142
        exit 0 ;;
1051
1143
    Power*:Rhapsody:*:*)
1052
1144
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1053
1145
        exit 0 ;;
1055
1147
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1056
1148
        exit 0 ;;
1057
1149
    *:Darwin:*:*)
1058
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1150
        case `uname -p` in
 
1151
            *86) UNAME_PROCESSOR=i686 ;;
 
1152
            powerpc) UNAME_PROCESSOR=powerpc ;;
 
1153
        esac
 
1154
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1059
1155
        exit 0 ;;
1060
1156
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1061
 
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1157
        UNAME_PROCESSOR=`uname -p`
 
1158
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1159
                UNAME_PROCESSOR=i386
1062
1160
                UNAME_MACHINE=pc
1063
 
                echo i386-${UNAME_MACHINE}-nto-qnx
1064
 
        else
1065
 
                echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1066
1161
        fi
 
1162
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1067
1163
        exit 0 ;;
1068
1164
    *:QNX:*:4*)
1069
1165
        echo i386-pc-qnx
1070
1166
        exit 0 ;;
1071
 
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
 
1167
    NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
1072
1168
        echo nsr-tandem-nsk${UNAME_RELEASE}
1073
1169
        exit 0 ;;
1074
1170
    *:NonStop-UX:*:*)
1091
1187
        fi
1092
1188
        echo ${UNAME_MACHINE}-unknown-plan9
1093
1189
        exit 0 ;;
1094
 
    i*86:OS/2:*:*)
1095
 
        # If we were able to find `uname', then EMX Unix compatibility
1096
 
        # is probably installed.
1097
 
        echo ${UNAME_MACHINE}-pc-os2-emx
1098
 
        exit 0 ;;
1099
1190
    *:TOPS-10:*:*)
1100
1191
        echo pdp10-unknown-tops10
1101
1192
        exit 0 ;;
1114
1205
    *:ITS:*:*)
1115
1206
        echo pdp10-unknown-its
1116
1207
        exit 0 ;;
1117
 
    i*86:XTS-300:*:STOP)
1118
 
        echo ${UNAME_MACHINE}-unknown-stop
1119
 
        exit 0 ;;
1120
 
    i*86:atheos:*:*)
1121
 
        echo ${UNAME_MACHINE}-unknown-atheos
 
1208
    SEI:*:*:SEIUX)
 
1209
        echo mips-sei-seiux${UNAME_RELEASE}
1122
1210
        exit 0 ;;
1123
1211
esac
1124
1212
 
1240
1328
}
1241
1329
EOF
1242
1330
 
1243
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1244
 
rm -f $dummy.c $dummy
 
1331
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1245
1332
 
1246
1333
# Apollos put the system type in the environment.
1247
1334