~ubuntu-branches/debian/sid/c2hs/sid

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Arjan Oosting
  • Date: 2006-12-14 00:06:12 UTC
  • mfrom: (3.1.5 feisty)
  • Revision ID: james.westby@ubuntu.com-20061214000612-s7mds83cxqkgv1bj
Tags: 0.14.5-6
* debian/patches/09_replace-deprecated-withObject: Replace all
  occurrences of 'withObject' with 'with' as the deprecated 'withObject'
  was removed with GHC 6.6. (Closes: #402979)
* Set the urgency to medium as the above bug decreases c2hs usefulness
  with GHC 6.6 dramatically. 

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, 2003 Free Software Foundation, Inc.
 
4
#   2000, 2001, 2002 Free Software Foundation, Inc.
5
5
 
6
 
timestamp='2003-10-07'
 
6
timestamp='2002-03-20'
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
 
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
 
 
 
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.
98
96
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
99
97
# use `HOST_CC' if defined, but it is deprecated.
100
98
 
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 ;
 
99
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
 
100
 ,,)    echo "int dummy(){}" > $dummy.c ;
115
101
        for c in cc gcc c89 c99 ; do
116
 
          if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
 
102
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
 
103
          if test $? = 0 ; then
117
104
             CC_FOR_BUILD="$c"; break ;
118
105
          fi ;
119
106
        done ;
 
107
        rm -f $dummy.c $dummy.o $dummy.rel ;
120
108
        if test x"$CC_FOR_BUILD" = x ; then
121
109
          CC_FOR_BUILD=no_compiler_found ;
122
110
        fi
123
111
        ;;
124
112
 ,,*)   CC_FOR_BUILD=$CC ;;
125
113
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
126
 
esac ;'
 
114
esac'
127
115
 
128
116
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
129
117
# (ghazi@noc.rutgers.edu 1994-08-24)
154
142
        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
155
143
            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
156
144
        case "${UNAME_MACHINE_ARCH}" in
157
 
            armeb) machine=armeb-unknown ;;
158
145
            arm*) machine=arm-unknown ;;
159
146
            sh3el) machine=shl-unknown ;;
160
147
            sh3eb) machine=sh-unknown ;;
180
167
                ;;
181
168
        esac
182
169
        # 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
 
170
        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
195
171
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
196
172
        # contains redundant information, the shorter form:
197
173
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
240
216
        if test $UNAME_RELEASE = "V4.0"; then
241
217
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
242
218
        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
280
219
        # A Vn.n version is a released version.
281
220
        # A Tn.n version is a released field test version.
282
221
        # A Xn.n version is an unreleased experimental baselevel.
283
222
        # 1.2 uses "1.2" for uname -r.
 
223
        cat <<EOF >$dummy.s
 
224
        .data
 
225
\$Lformat:
 
226
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
 
227
 
 
228
        .text
 
229
        .globl main
 
230
        .align 4
 
231
        .ent main
 
232
main:
 
233
        .frame \$30,16,\$26,0
 
234
        ldgp \$29,0(\$27)
 
235
        .prologue 1
 
236
        .long 0x47e03d80 # implver \$0
 
237
        lda \$2,-1
 
238
        .long 0x47e20c21 # amask \$2,\$1
 
239
        lda \$16,\$Lformat
 
240
        mov \$0,\$17
 
241
        not \$1,\$18
 
242
        jsr \$26,printf
 
243
        ldgp \$29,0(\$26)
 
244
        mov 0,\$16
 
245
        jsr \$26,exit
 
246
        .end main
 
247
EOF
 
248
        eval $set_cc_for_build
 
249
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
 
250
        if test "$?" = 0 ; then
 
251
                case `./$dummy` in
 
252
                        0-0)
 
253
                                UNAME_MACHINE="alpha"
 
254
                                ;;
 
255
                        1-0)
 
256
                                UNAME_MACHINE="alphaev5"
 
257
                                ;;
 
258
                        1-1)
 
259
                                UNAME_MACHINE="alphaev56"
 
260
                                ;;
 
261
                        1-101)
 
262
                                UNAME_MACHINE="alphapca56"
 
263
                                ;;
 
264
                        2-303)
 
265
                                UNAME_MACHINE="alphaev6"
 
266
                                ;;
 
267
                        2-307)
 
268
                                UNAME_MACHINE="alphaev67"
 
269
                                ;;
 
270
                        2-1307)
 
271
                                UNAME_MACHINE="alphaev68"
 
272
                                ;;
 
273
                esac
 
274
        fi
 
275
        rm -f $dummy.s $dummy
284
276
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
285
277
        exit 0 ;;
286
 
    Alpha*:OpenVMS:*:*)
287
 
        echo alpha-hp-vms
288
 
        exit 0 ;;
289
278
    Alpha\ *:Windows_NT*:*)
290
279
        # How do we know it's Interix rather than the generic POSIX subsystem?
291
280
        # Should we change UNAME_MACHINE based on the output of uname instead
324
313
    NILE*:*:*:dcosx)
325
314
        echo pyramid-pyramid-svr4
326
315
        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 ;;
334
316
    sun4H:SunOS:5.*:*)
335
317
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
336
318
        exit 0 ;;
437
419
          exit (-1);
438
420
        }
439
421
EOF
440
 
        $CC_FOR_BUILD -o $dummy $dummy.c \
441
 
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
442
 
          && exit 0
 
422
        $CC_FOR_BUILD $dummy.c -o $dummy \
 
423
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 
424
          && rm -f $dummy.c $dummy && exit 0
 
425
        rm -f $dummy.c $dummy
443
426
        echo mips-mips-riscos${UNAME_RELEASE}
444
427
        exit 0 ;;
445
428
    Motorola:PowerMAX_OS:*:*)
446
429
        echo powerpc-motorola-powermax
447
430
        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 ;;
454
431
    Night_Hawk:Power_UNIX:*:*)
455
432
        echo powerpc-harris-powerunix
456
433
        exit 0 ;;
523
500
                        exit(0);
524
501
                        }
525
502
EOF
526
 
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
 
503
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
 
504
                rm -f $dummy.c $dummy
527
505
                echo rs6000-ibm-aix3.2.5
528
506
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
529
507
                echo rs6000-ibm-aix3.2.4
621
599
                  exit (0);
622
600
              }
623
601
EOF
624
 
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
625
 
                    test -z "$HP_ARCH" && HP_ARCH=hppa
 
602
                    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
 
603
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
 
604
                    rm -f $dummy.c $dummy
626
605
                fi ;;
627
606
        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
639
607
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
640
608
        exit 0 ;;
641
609
    ia64:HP-UX:*:*)
669
637
          exit (0);
670
638
        }
671
639
EOF
672
 
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
 
640
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
 
641
        rm -f $dummy.c $dummy
673
642
        echo unknown-hitachi-hiuxwe2
674
643
        exit 0 ;;
675
644
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
727
696
    CRAY*TS:*:*:*)
728
697
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
729
698
        exit 0 ;;
 
699
    CRAY*T3D:*:*:*)
 
700
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
701
        exit 0 ;;
730
702
    CRAY*T3E:*:*:*)
731
703
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
732
704
        exit 0 ;;
733
705
    CRAY*SV1:*:*:*)
734
706
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
735
707
        exit 0 ;;
736
 
    *:UNICOS/mp:*:*)
737
 
        echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
738
 
        exit 0 ;;
739
708
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
740
709
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
741
710
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
752
721
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
753
722
        exit 0 ;;
754
723
    *: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/KFreeBSD 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
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
770
725
        exit 0 ;;
771
726
    i*:CYGWIN*:*)
772
727
        echo ${UNAME_MACHINE}-pc-cygwin
777
732
    i*:PW*:*)
778
733
        echo ${UNAME_MACHINE}-pc-pw32
779
734
        exit 0 ;;
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
 
735
    x86:Interix*:3*)
 
736
        echo i386-pc-interix3
785
737
        exit 0 ;;
786
738
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
787
739
        # How do we know it's Interix rather than the generic POSIX subsystem?
788
740
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
789
741
        # UNAME_MACHINE based on the output of uname instead of i386?
790
 
        echo i586-pc-interix
 
742
        echo i386-pc-interix
791
743
        exit 0 ;;
792
744
    i*:UWIN*:*)
793
745
        echo ${UNAME_MACHINE}-pc-uwin
799
751
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
800
752
        exit 0 ;;
801
753
    *:GNU:*:*)
802
 
        # the GNU system
803
754
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
804
755
        exit 0 ;;
805
 
    *:GNU/*:*:*)
806
 
        # other systems with GNU libc and userland
807
 
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
808
 
        exit 0 ;;
809
756
    i*86:Minix:*:*)
810
757
        echo ${UNAME_MACHINE}-pc-minix
811
758
        exit 0 ;;
812
759
    arm*:Linux:*:*)
813
760
        echo ${UNAME_MACHINE}-unknown-linux-gnu
814
761
        exit 0 ;;
815
 
    cris:Linux:*:*)
816
 
        echo cris-axis-linux-gnu
817
 
        exit 0 ;;
818
762
    ia64:Linux:*:*)
819
763
        echo ${UNAME_MACHINE}-unknown-linux-gnu
820
764
        exit 0 ;;
838
782
        #endif
839
783
EOF
840
784
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
841
 
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
842
 
        ;;
843
 
    mips64:Linux:*:*)
844
 
        eval $set_cc_for_build
845
 
        sed 's/^        //' << EOF >$dummy.c
846
 
        #undef CPU
847
 
        #undef mips64
848
 
        #undef mips64el
849
 
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
850
 
        CPU=mips64el
851
 
        #else
852
 
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
853
 
        CPU=mips64
854
 
        #else
855
 
        CPU=
856
 
        #endif
857
 
        #endif
858
 
EOF
859
 
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
860
 
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
785
        rm -f $dummy.c
 
786
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
861
787
        ;;
862
788
    ppc:Linux:*:*)
863
789
        echo powerpc-unknown-linux-gnu
893
819
    s390:Linux:*:* | s390x:Linux:*:*)
894
820
        echo ${UNAME_MACHINE}-ibm-linux
895
821
        exit 0 ;;
896
 
    sh64*:Linux:*:*)
897
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
898
 
        exit 0 ;;
899
822
    sh*:Linux:*:*)
900
823
        echo ${UNAME_MACHINE}-unknown-linux-gnu
901
824
        exit 0 ;;
922
845
                ;;
923
846
          a.out-i386-linux)
924
847
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
925
 
                exit 0 ;;
 
848
                exit 0 ;;               
926
849
          coff-i386)
927
850
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
928
851
                exit 0 ;;
953
876
        LIBC=gnuaout
954
877
        #endif
955
878
        #endif
956
 
        #ifdef __dietlibc__
957
 
        LIBC=dietlibc
958
 
        #endif
959
879
EOF
960
880
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
881
        rm -f $dummy.c
961
882
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
962
883
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
963
884
        ;;
975
896
        # Use sysv4.2uw... so that sysv4* matches it.
976
897
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
977
898
        exit 0 ;;
978
 
    i*86:OS/2:*:*)
979
 
        # If we were able to find `uname', then EMX Unix compatibility
980
 
        # is probably installed.
981
 
        echo ${UNAME_MACHINE}-pc-os2-emx
982
 
        exit 0 ;;
983
 
    i*86:XTS-300:*:STOP)
984
 
        echo ${UNAME_MACHINE}-unknown-stop
985
 
        exit 0 ;;
986
 
    i*86:atheos:*:*)
987
 
        echo ${UNAME_MACHINE}-unknown-atheos
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
899
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
996
900
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
997
901
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1013
917
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1014
918
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1015
919
        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) \
 
920
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
 
921
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
 
922
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
1019
923
                        && UNAME_MACHINE=i586
1020
 
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
 
924
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
1021
925
                        && UNAME_MACHINE=i686
1022
 
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
 
926
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
1023
927
                        && UNAME_MACHINE=i686
1024
928
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
1025
929
        else
1026
930
                echo ${UNAME_MACHINE}-pc-sysv32
1027
931
        fi
1028
932
        exit 0 ;;
 
933
    i*86:*DOS:*:*)
 
934
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
935
        exit 0 ;;
1029
936
    pc:*:*:*)
1030
937
        # Left here for compatibility:
1031
938
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1049
956
        # "miniframe"
1050
957
        echo m68010-convergent-sysv
1051
958
        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
959
    M68*:*:R3V[567]*:*)
1059
960
        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)
 
961
    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)
1061
962
        OS_REL=''
1062
963
        test -r /etc/.relid \
1063
964
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1074
975
    mc68030:UNIX_System_V:4.*:*)
1075
976
        echo m68k-atari-sysv4
1076
977
        exit 0 ;;
 
978
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
979
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
980
        exit 0 ;;
1077
981
    TSUNAMI:LynxOS:2.*:*)
1078
982
        echo sparc-unknown-lynxos${UNAME_RELEASE}
1079
983
        exit 0 ;;
1145
1049
    SX-5:SUPER-UX:*:*)
1146
1050
        echo sx5-nec-superux${UNAME_RELEASE}
1147
1051
        exit 0 ;;
1148
 
    SX-6:SUPER-UX:*:*)
1149
 
        echo sx6-nec-superux${UNAME_RELEASE}
1150
 
        exit 0 ;;
1151
1052
    Power*:Rhapsody:*:*)
1152
1053
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1153
1054
        exit 0 ;;
1155
1056
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1156
1057
        exit 0 ;;
1157
1058
    *: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}
 
1059
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
1163
1060
        exit 0 ;;
1164
1061
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1165
1062
        UNAME_PROCESSOR=`uname -p`
1172
1069
    *:QNX:*:4*)
1173
1070
        echo i386-pc-qnx
1174
1071
        exit 0 ;;
1175
 
    NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
 
1072
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
1176
1073
        echo nsr-tandem-nsk${UNAME_RELEASE}
1177
1074
        exit 0 ;;
1178
1075
    *:NonStop-UX:*:*)
1195
1092
        fi
1196
1093
        echo ${UNAME_MACHINE}-unknown-plan9
1197
1094
        exit 0 ;;
 
1095
    i*86:OS/2:*:*)
 
1096
        # If we were able to find `uname', then EMX Unix compatibility
 
1097
        # is probably installed.
 
1098
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1099
        exit 0 ;;
1198
1100
    *:TOPS-10:*:*)
1199
1101
        echo pdp10-unknown-tops10
1200
1102
        exit 0 ;;
1213
1115
    *:ITS:*:*)
1214
1116
        echo pdp10-unknown-its
1215
1117
        exit 0 ;;
1216
 
    SEI:*:*:SEIUX)
1217
 
        echo mips-sei-seiux${UNAME_RELEASE}
 
1118
    i*86:XTS-300:*:STOP)
 
1119
        echo ${UNAME_MACHINE}-unknown-stop
 
1120
        exit 0 ;;
 
1121
    i*86:atheos:*:*)
 
1122
        echo ${UNAME_MACHINE}-unknown-atheos
1218
1123
        exit 0 ;;
1219
1124
esac
1220
1125
 
1336
1241
}
1337
1242
EOF
1338
1243
 
1339
 
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
 
1244
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
 
1245
rm -f $dummy.c $dummy
1340
1246
 
1341
1247
# Apollos put the system type in the environment.
1342
1248