~ubuntu-branches/ubuntu/edgy/tilp/edgy

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Julien BLACHE
  • Date: 2004-05-22 21:12:03 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040522211203-awg2cuw03guyvyz9
Tags: 6.72-2
* debian/control
  + Build-Depends: libticables3 (>= 3.8.4-1).

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-03-20'
 
6
timestamp='2004-03-12'
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
# 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 ;
101
115
        for c in cc gcc c89 c99 ; do
102
 
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
103
 
          if test $? = 0 ; then
 
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)
142
154
        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
143
155
            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
144
156
        case "${UNAME_MACHINE_ARCH}" in
 
157
            armeb) machine=armeb-unknown ;;
145
158
            arm*) machine=arm-unknown ;;
146
159
            sh3el) machine=shl-unknown ;;
147
160
            sh3eb) machine=sh-unknown ;;
167
180
                ;;
168
181
        esac
169
182
        # The OS release
170
 
        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
171
195
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
172
196
        # contains redundant information, the shorter form:
173
197
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
174
198
        echo "${machine}-${os}${release}"
175
199
        exit 0 ;;
 
200
    amd64:OpenBSD:*:*)
 
201
        echo x86_64-unknown-openbsd${UNAME_RELEASE}
 
202
        exit 0 ;;
176
203
    amiga:OpenBSD:*:*)
177
204
        echo m68k-unknown-openbsd${UNAME_RELEASE}
178
205
        exit 0 ;;
179
206
    arc:OpenBSD:*:*)
180
207
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
181
208
        exit 0 ;;
 
209
    cats:OpenBSD:*:*)
 
210
        echo arm-unknown-openbsd${UNAME_RELEASE}
 
211
        exit 0 ;;
182
212
    hp300:OpenBSD:*:*)
183
213
        echo m68k-unknown-openbsd${UNAME_RELEASE}
184
214
        exit 0 ;;
197
227
    mvmeppc:OpenBSD:*:*)
198
228
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
199
229
        exit 0 ;;
 
230
    pegasos:OpenBSD:*:*)
 
231
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
232
        exit 0 ;;
200
233
    pmax:OpenBSD:*:*)
201
234
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
202
235
        exit 0 ;;
212
245
    *:OpenBSD:*:*)
213
246
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
214
247
        exit 0 ;;
 
248
    *:ekkoBSD:*:*)
 
249
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
 
250
        exit 0 ;;
 
251
    macppc:MirBSD:*:*)
 
252
        echo powerppc-unknown-mirbsd${UNAME_RELEASE}
 
253
        exit 0 ;;
 
254
    *:MirBSD:*:*)
 
255
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
 
256
        exit 0 ;;
215
257
    alpha:OSF1:*:*)
216
 
        if test $UNAME_RELEASE = "V4.0"; then
 
258
        case $UNAME_RELEASE in
 
259
        *4.0)
217
260
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
218
 
        fi
 
261
                ;;
 
262
        *5.*)
 
263
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 
264
                ;;
 
265
        esac
 
266
        # According to Compaq, /usr/sbin/psrinfo has been available on
 
267
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
 
268
        # covers most systems running today.  This code pipes the CPU
 
269
        # types through head -n 1, so we only detect the type of CPU 0.
 
270
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 
271
        case "$ALPHA_CPU_TYPE" in
 
272
            "EV4 (21064)")
 
273
                UNAME_MACHINE="alpha" ;;
 
274
            "EV4.5 (21064)")
 
275
                UNAME_MACHINE="alpha" ;;
 
276
            "LCA4 (21066/21068)")
 
277
                UNAME_MACHINE="alpha" ;;
 
278
            "EV5 (21164)")
 
279
                UNAME_MACHINE="alphaev5" ;;
 
280
            "EV5.6 (21164A)")
 
281
                UNAME_MACHINE="alphaev56" ;;
 
282
            "EV5.6 (21164PC)")
 
283
                UNAME_MACHINE="alphapca56" ;;
 
284
            "EV5.7 (21164PC)")
 
285
                UNAME_MACHINE="alphapca57" ;;
 
286
            "EV6 (21264)")
 
287
                UNAME_MACHINE="alphaev6" ;;
 
288
            "EV6.7 (21264A)")
 
289
                UNAME_MACHINE="alphaev67" ;;
 
290
            "EV6.8CB (21264C)")
 
291
                UNAME_MACHINE="alphaev68" ;;
 
292
            "EV6.8AL (21264B)")
 
293
                UNAME_MACHINE="alphaev68" ;;
 
294
            "EV6.8CX (21264D)")
 
295
                UNAME_MACHINE="alphaev68" ;;
 
296
            "EV6.9A (21264/EV69A)")
 
297
                UNAME_MACHINE="alphaev69" ;;
 
298
            "EV7 (21364)")
 
299
                UNAME_MACHINE="alphaev7" ;;
 
300
            "EV7.9 (21364A)")
 
301
                UNAME_MACHINE="alphaev79" ;;
 
302
        esac
 
303
        # A Pn.n version is a patched version.
219
304
        # A Vn.n version is a released version.
220
305
        # A Tn.n version is a released field test version.
221
306
        # A Xn.n version is an unreleased experimental baselevel.
222
307
        # 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
276
 
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 
308
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 
309
        exit 0 ;;
 
310
    Alpha*:OpenVMS:*:*)
 
311
        echo alpha-hp-vms
277
312
        exit 0 ;;
278
313
    Alpha\ *:Windows_NT*:*)
279
314
        # How do we know it's Interix rather than the generic POSIX subsystem?
296
331
    *:OS/390:*:*)
297
332
        echo i370-ibm-openedition
298
333
        exit 0 ;;
 
334
    *:OS400:*:*)
 
335
        echo powerpc-ibm-os400
 
336
        exit 0 ;;
299
337
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
300
338
        echo arm-acorn-riscix${UNAME_RELEASE}
301
339
        exit 0;;
313
351
    NILE*:*:*:dcosx)
314
352
        echo pyramid-pyramid-svr4
315
353
        exit 0 ;;
 
354
    DRS?6000:unix:4.0:6*)
 
355
        echo sparc-icl-nx6
 
356
        exit 0 ;;
 
357
    DRS?6000:UNIX_SV:4.2*:7*)
 
358
        case `/usr/bin/uname -p` in
 
359
            sparc) echo sparc-icl-nx7 && exit 0 ;;
 
360
        esac ;;
316
361
    sun4H:SunOS:5.*:*)
317
362
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
318
363
        exit 0 ;;
381
426
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
382
427
        echo m68k-unknown-mint${UNAME_RELEASE}
383
428
        exit 0 ;;
 
429
    m68k:machten:*:*)
 
430
        echo m68k-apple-machten${UNAME_RELEASE}
 
431
        exit 0 ;;
384
432
    powerpc:machten:*:*)
385
433
        echo powerpc-apple-machten${UNAME_RELEASE}
386
434
        exit 0 ;;
419
467
          exit (-1);
420
468
        }
421
469
EOF
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
 
470
        $CC_FOR_BUILD -o $dummy $dummy.c \
 
471
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 
472
          && exit 0
426
473
        echo mips-mips-riscos${UNAME_RELEASE}
427
474
        exit 0 ;;
428
475
    Motorola:PowerMAX_OS:*:*)
429
476
        echo powerpc-motorola-powermax
430
477
        exit 0 ;;
 
478
    Motorola:*:4.3:PL8-*)
 
479
        echo powerpc-harris-powermax
 
480
        exit 0 ;;
 
481
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 
482
        echo powerpc-harris-powermax
 
483
        exit 0 ;;
431
484
    Night_Hawk:Power_UNIX:*:*)
432
485
        echo powerpc-harris-powerunix
433
486
        exit 0 ;;
500
553
                        exit(0);
501
554
                        }
502
555
EOF
503
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
504
 
                rm -f $dummy.c $dummy
 
556
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
505
557
                echo rs6000-ibm-aix3.2.5
506
558
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
507
559
                echo rs6000-ibm-aix3.2.4
599
651
                  exit (0);
600
652
              }
601
653
EOF
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
 
654
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
655
                    test -z "$HP_ARCH" && HP_ARCH=hppa
605
656
                fi ;;
606
657
        esac
 
658
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
659
        then
 
660
            # avoid double evaluation of $set_cc_for_build
 
661
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
662
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 
663
            then
 
664
                HP_ARCH="hppa2.0w"
 
665
            else
 
666
                HP_ARCH="hppa64"
 
667
            fi
 
668
        fi
607
669
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
608
670
        exit 0 ;;
609
671
    ia64:HP-UX:*:*)
637
699
          exit (0);
638
700
        }
639
701
EOF
640
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
641
 
        rm -f $dummy.c $dummy
 
702
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
642
703
        echo unknown-hitachi-hiuxwe2
643
704
        exit 0 ;;
644
705
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
696
757
    CRAY*TS:*:*:*)
697
758
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
698
759
        exit 0 ;;
699
 
    CRAY*T3D:*:*:*)
700
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
701
 
        exit 0 ;;
702
760
    CRAY*T3E:*:*:*)
703
761
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
704
762
        exit 0 ;;
705
763
    CRAY*SV1:*:*:*)
706
764
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
707
765
        exit 0 ;;
 
766
    *:UNICOS/mp:*:*)
 
767
        echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
768
        exit 0 ;;
708
769
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
709
770
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
710
771
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
711
772
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
712
773
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
713
774
        exit 0 ;;
 
775
    5000:UNIX_System_V:4.*:*)
 
776
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
777
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
 
778
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
779
        exit 0 ;;
714
780
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
715
781
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
716
782
        exit 0 ;;
721
787
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
722
788
        exit 0 ;;
723
789
    *:FreeBSD:*:*)
724
 
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
790
        # Determine whether the default compiler uses glibc.
 
791
        eval $set_cc_for_build
 
792
        sed 's/^        //' << EOF >$dummy.c
 
793
        #include <features.h>
 
794
        #if __GLIBC__ >= 2
 
795
        LIBC=gnu
 
796
        #else
 
797
        LIBC=
 
798
        #endif
 
799
EOF
 
800
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
801
        # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
 
802
        # FreeBSD's kernel, but not the complete OS.
 
803
        case ${LIBC} in gnu) kernel_only='k' ;; esac
 
804
        echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
725
805
        exit 0 ;;
726
806
    i*:CYGWIN*:*)
727
807
        echo ${UNAME_MACHINE}-pc-cygwin
732
812
    i*:PW*:*)
733
813
        echo ${UNAME_MACHINE}-pc-pw32
734
814
        exit 0 ;;
735
 
    x86:Interix*:3*)
736
 
        echo i386-pc-interix3
 
815
    x86:Interix*:[34]*)
 
816
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
817
        exit 0 ;;
 
818
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
819
        echo i${UNAME_MACHINE}-pc-mks
737
820
        exit 0 ;;
738
821
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
739
822
        # How do we know it's Interix rather than the generic POSIX subsystem?
740
823
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
741
824
        # UNAME_MACHINE based on the output of uname instead of i386?
742
 
        echo i386-pc-interix
 
825
        echo i586-pc-interix
743
826
        exit 0 ;;
744
827
    i*:UWIN*:*)
745
828
        echo ${UNAME_MACHINE}-pc-uwin
751
834
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
752
835
        exit 0 ;;
753
836
    *:GNU:*:*)
 
837
        # the GNU system
754
838
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
755
839
        exit 0 ;;
 
840
    *:GNU/*:*:*)
 
841
        # other systems with GNU libc and userland
 
842
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
843
        exit 0 ;;
756
844
    i*86:Minix:*:*)
757
845
        echo ${UNAME_MACHINE}-pc-minix
758
846
        exit 0 ;;
759
847
    arm*:Linux:*:*)
760
848
        echo ${UNAME_MACHINE}-unknown-linux-gnu
761
849
        exit 0 ;;
 
850
    cris:Linux:*:*)
 
851
        echo cris-axis-linux-gnu
 
852
        exit 0 ;;
762
853
    ia64:Linux:*:*)
763
854
        echo ${UNAME_MACHINE}-unknown-linux-gnu
764
855
        exit 0 ;;
 
856
    m32r*:Linux:*:*)
 
857
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
858
        exit 0 ;;
765
859
    m68*:Linux:*:*)
766
860
        echo ${UNAME_MACHINE}-unknown-linux-gnu
767
861
        exit 0 ;;
782
876
        #endif
783
877
EOF
784
878
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
785
 
        rm -f $dummy.c
786
 
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 
879
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
880
        ;;
 
881
    mips64:Linux:*:*)
 
882
        eval $set_cc_for_build
 
883
        sed 's/^        //' << EOF >$dummy.c
 
884
        #undef CPU
 
885
        #undef mips64
 
886
        #undef mips64el
 
887
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
888
        CPU=mips64el
 
889
        #else
 
890
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
891
        CPU=mips64
 
892
        #else
 
893
        CPU=
 
894
        #endif
 
895
        #endif
 
896
EOF
 
897
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
898
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
787
899
        ;;
788
900
    ppc:Linux:*:*)
789
901
        echo powerpc-unknown-linux-gnu
819
931
    s390:Linux:*:* | s390x:Linux:*:*)
820
932
        echo ${UNAME_MACHINE}-ibm-linux
821
933
        exit 0 ;;
 
934
    sh64*:Linux:*:*)
 
935
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
936
        exit 0 ;;
822
937
    sh*:Linux:*:*)
823
938
        echo ${UNAME_MACHINE}-unknown-linux-gnu
824
939
        exit 0 ;;
845
960
                ;;
846
961
          a.out-i386-linux)
847
962
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
848
 
                exit 0 ;;               
 
963
                exit 0 ;;
849
964
          coff-i386)
850
965
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
851
966
                exit 0 ;;
876
991
        LIBC=gnuaout
877
992
        #endif
878
993
        #endif
 
994
        #ifdef __dietlibc__
 
995
        LIBC=dietlibc
 
996
        #endif
879
997
EOF
880
998
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
881
 
        rm -f $dummy.c
882
999
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
883
1000
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
884
1001
        ;;
896
1013
        # Use sysv4.2uw... so that sysv4* matches it.
897
1014
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
898
1015
        exit 0 ;;
 
1016
    i*86:OS/2:*:*)
 
1017
        # If we were able to find `uname', then EMX Unix compatibility
 
1018
        # is probably installed.
 
1019
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1020
        exit 0 ;;
 
1021
    i*86:XTS-300:*:STOP)
 
1022
        echo ${UNAME_MACHINE}-unknown-stop
 
1023
        exit 0 ;;
 
1024
    i*86:atheos:*:*)
 
1025
        echo ${UNAME_MACHINE}-unknown-atheos
 
1026
        exit 0 ;;
 
1027
        i*86:syllable:*:*)
 
1028
        echo ${UNAME_MACHINE}-pc-syllable
 
1029
        exit 0 ;;
 
1030
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
1031
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
1032
        exit 0 ;;
 
1033
    i*86:*DOS:*:*)
 
1034
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
1035
        exit 0 ;;
899
1036
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
900
1037
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
901
1038
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
917
1054
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
918
1055
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
919
1056
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
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) \
 
1057
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 
1058
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 
1059
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
923
1060
                        && UNAME_MACHINE=i586
924
 
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 
1061
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
925
1062
                        && UNAME_MACHINE=i686
926
 
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
 
1063
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
927
1064
                        && UNAME_MACHINE=i686
928
1065
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
929
1066
        else
930
1067
                echo ${UNAME_MACHINE}-pc-sysv32
931
1068
        fi
932
1069
        exit 0 ;;
933
 
    i*86:*DOS:*:*)
934
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
935
 
        exit 0 ;;
936
1070
    pc:*:*:*)
937
1071
        # Left here for compatibility:
938
1072
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
956
1090
        # "miniframe"
957
1091
        echo m68010-convergent-sysv
958
1092
        exit 0 ;;
 
1093
    mc68k:UNIX:SYSTEM5:3.51m)
 
1094
        echo m68k-convergent-sysv
 
1095
        exit 0 ;;
 
1096
    M680?0:D-NIX:5.3:*)
 
1097
        echo m68k-diab-dnix
 
1098
        exit 0 ;;
959
1099
    M68*:*:R3V[567]*:*)
960
1100
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 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)
 
1101
    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)
962
1102
        OS_REL=''
963
1103
        test -r /etc/.relid \
964
1104
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
975
1115
    mc68030:UNIX_System_V:4.*:*)
976
1116
        echo m68k-atari-sysv4
977
1117
        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 ;;
981
1118
    TSUNAMI:LynxOS:2.*:*)
982
1119
        echo sparc-unknown-lynxos${UNAME_RELEASE}
983
1120
        exit 0 ;;
1049
1186
    SX-5:SUPER-UX:*:*)
1050
1187
        echo sx5-nec-superux${UNAME_RELEASE}
1051
1188
        exit 0 ;;
 
1189
    SX-6:SUPER-UX:*:*)
 
1190
        echo sx6-nec-superux${UNAME_RELEASE}
 
1191
        exit 0 ;;
1052
1192
    Power*:Rhapsody:*:*)
1053
1193
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1054
1194
        exit 0 ;;
1056
1196
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1057
1197
        exit 0 ;;
1058
1198
    *:Darwin:*:*)
1059
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1199
        case `uname -p` in
 
1200
            *86) UNAME_PROCESSOR=i686 ;;
 
1201
            powerpc) UNAME_PROCESSOR=powerpc ;;
 
1202
        esac
 
1203
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1060
1204
        exit 0 ;;
1061
1205
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1062
1206
        UNAME_PROCESSOR=`uname -p`
1069
1213
    *:QNX:*:4*)
1070
1214
        echo i386-pc-qnx
1071
1215
        exit 0 ;;
1072
 
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
 
1216
    NSR-?:NONSTOP_KERNEL:*:*)
1073
1217
        echo nsr-tandem-nsk${UNAME_RELEASE}
1074
1218
        exit 0 ;;
1075
1219
    *:NonStop-UX:*:*)
1092
1236
        fi
1093
1237
        echo ${UNAME_MACHINE}-unknown-plan9
1094
1238
        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 ;;
1100
1239
    *:TOPS-10:*:*)
1101
1240
        echo pdp10-unknown-tops10
1102
1241
        exit 0 ;;
1115
1254
    *:ITS:*:*)
1116
1255
        echo pdp10-unknown-its
1117
1256
        exit 0 ;;
1118
 
    i*86:XTS-300:*:STOP)
1119
 
        echo ${UNAME_MACHINE}-unknown-stop
 
1257
    SEI:*:*:SEIUX)
 
1258
        echo mips-sei-seiux${UNAME_RELEASE}
1120
1259
        exit 0 ;;
1121
 
    i*86:atheos:*:*)
1122
 
        echo ${UNAME_MACHINE}-unknown-atheos
 
1260
    *:DragonFly:*:*)
 
1261
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1123
1262
        exit 0 ;;
1124
1263
esac
1125
1264
 
1241
1380
}
1242
1381
EOF
1243
1382
 
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
 
1383
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1246
1384
 
1247
1385
# Apollos put the system type in the environment.
1248
1386