~ubuntu-branches/ubuntu/dapper/openssh/dapper

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2004-10-07 18:03:06 UTC
  • Revision ID: james.westby@ubuntu.com-20041007180306-0l8ii961txetbucx
Tags: 1:3.8.1p1-11ubuntu3
* Nathaniel McCallum:
  - debian/openssh-server.init: pretty initscript
  - debian/control: versioned depend on lsb-base

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-07-23'
 
6
timestamp='2004-01-05'
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
98
98
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
99
99
# use `HOST_CC' if defined, but it is deprecated.
100
100
 
101
 
# This shell variable is my proudest work .. or something. --bje
 
101
# Portable tmp directory creation inspired by the Autoconf team.
102
102
 
103
 
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
104
 
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
105
 
   || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
106
 
dummy=$tmpdir/dummy ;
107
 
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
108
 
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
 
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" ;
109
113
case $CC_FOR_BUILD,$HOST_CC,$CC in
110
114
 ,,)    echo "int x;" > $dummy.c ;
111
115
        for c in cc gcc c89 c99 ; do
112
 
          if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then
 
116
          if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
113
117
             CC_FOR_BUILD="$c"; break ;
114
118
          fi ;
115
119
        done ;
116
 
        rm -f $files ;
117
120
        if test x"$CC_FOR_BUILD" = x ; then
118
121
          CC_FOR_BUILD=no_compiler_found ;
119
122
        fi
120
123
        ;;
121
124
 ,,*)   CC_FOR_BUILD=$CC ;;
122
125
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
123
 
esac ;
124
 
unset files'
 
126
esac ;'
125
127
 
126
128
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
127
129
# (ghazi@noc.rutgers.edu 1994-08-24)
174
176
                fi
175
177
                ;;
176
178
            *)
177
 
                os=netbsd
 
179
                os=netbsd
178
180
                ;;
179
181
        esac
180
182
        # The OS release
181
 
        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
182
195
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
183
196
        # contains redundant information, the shorter form:
184
197
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
208
221
    mvmeppc:OpenBSD:*:*)
209
222
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
210
223
        exit 0 ;;
 
224
    pegasos:OpenBSD:*:*)
 
225
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
226
        exit 0 ;;
211
227
    pmax:OpenBSD:*:*)
212
228
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
213
229
        exit 0 ;;
227
243
        if test $UNAME_RELEASE = "V4.0"; then
228
244
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
229
245
        fi
 
246
        # According to Compaq, /usr/sbin/psrinfo has been available on
 
247
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
 
248
        # covers most systems running today.  This code pipes the CPU
 
249
        # types through head -n 1, so we only detect the type of CPU 0.
 
250
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 
251
        case "$ALPHA_CPU_TYPE" in
 
252
            "EV4 (21064)")
 
253
                UNAME_MACHINE="alpha" ;;
 
254
            "EV4.5 (21064)")
 
255
                UNAME_MACHINE="alpha" ;;
 
256
            "LCA4 (21066/21068)")
 
257
                UNAME_MACHINE="alpha" ;;
 
258
            "EV5 (21164)")
 
259
                UNAME_MACHINE="alphaev5" ;;
 
260
            "EV5.6 (21164A)")
 
261
                UNAME_MACHINE="alphaev56" ;;
 
262
            "EV5.6 (21164PC)")
 
263
                UNAME_MACHINE="alphapca56" ;;
 
264
            "EV5.7 (21164PC)")
 
265
                UNAME_MACHINE="alphapca57" ;;
 
266
            "EV6 (21264)")
 
267
                UNAME_MACHINE="alphaev6" ;;
 
268
            "EV6.7 (21264A)")
 
269
                UNAME_MACHINE="alphaev67" ;;
 
270
            "EV6.8CB (21264C)")
 
271
                UNAME_MACHINE="alphaev68" ;;
 
272
            "EV6.8AL (21264B)")
 
273
                UNAME_MACHINE="alphaev68" ;;
 
274
            "EV6.8CX (21264D)")
 
275
                UNAME_MACHINE="alphaev68" ;;
 
276
            "EV6.9A (21264/EV69A)")
 
277
                UNAME_MACHINE="alphaev69" ;;
 
278
            "EV7 (21364)")
 
279
                UNAME_MACHINE="alphaev7" ;;
 
280
            "EV7.9 (21364A)")
 
281
                UNAME_MACHINE="alphaev79" ;;
 
282
        esac
230
283
        # A Vn.n version is a released version.
231
284
        # A Tn.n version is a released field test version.
232
285
        # A Xn.n version is an unreleased experimental baselevel.
233
286
        # 1.2 uses "1.2" for uname -r.
234
 
        eval $set_cc_for_build
235
 
        cat <<EOF >$dummy.s
236
 
        .data
237
 
\$Lformat:
238
 
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
239
 
 
240
 
        .text
241
 
        .globl main
242
 
        .align 4
243
 
        .ent main
244
 
main:
245
 
        .frame \$30,16,\$26,0
246
 
        ldgp \$29,0(\$27)
247
 
        .prologue 1
248
 
        .long 0x47e03d80 # implver \$0
249
 
        lda \$2,-1
250
 
        .long 0x47e20c21 # amask \$2,\$1
251
 
        lda \$16,\$Lformat
252
 
        mov \$0,\$17
253
 
        not \$1,\$18
254
 
        jsr \$26,printf
255
 
        ldgp \$29,0(\$26)
256
 
        mov 0,\$16
257
 
        jsr \$26,exit
258
 
        .end main
259
 
EOF
260
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
261
 
        if test "$?" = 0 ; then
262
 
                case `$dummy` in
263
 
                        0-0)
264
 
                                UNAME_MACHINE="alpha"
265
 
                                ;;
266
 
                        1-0)
267
 
                                UNAME_MACHINE="alphaev5"
268
 
                                ;;
269
 
                        1-1)
270
 
                                UNAME_MACHINE="alphaev56"
271
 
                                ;;
272
 
                        1-101)
273
 
                                UNAME_MACHINE="alphapca56"
274
 
                                ;;
275
 
                        2-303)
276
 
                                UNAME_MACHINE="alphaev6"
277
 
                                ;;
278
 
                        2-307)
279
 
                                UNAME_MACHINE="alphaev67"
280
 
                                ;;
281
 
                        2-1307)
282
 
                                UNAME_MACHINE="alphaev68"
283
 
                                ;;
284
 
                        3-1307)
285
 
                                UNAME_MACHINE="alphaev7"
286
 
                                ;;
287
 
                esac
288
 
        fi
289
 
        rm -f $dummy.s $dummy && rmdir $tmpdir
290
287
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
291
288
        exit 0 ;;
 
289
    Alpha*:OpenVMS:*:*)
 
290
        echo alpha-hp-vms
 
291
        exit 0 ;;
292
292
    Alpha\ *:Windows_NT*:*)
293
293
        # How do we know it's Interix rather than the generic POSIX subsystem?
294
294
        # Should we change UNAME_MACHINE based on the output of uname instead
310
310
    *:OS/390:*:*)
311
311
        echo i370-ibm-openedition
312
312
        exit 0 ;;
 
313
    *:OS400:*:*)
 
314
        echo powerpc-ibm-os400
 
315
        exit 0 ;;
313
316
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
314
317
        echo arm-acorn-riscix${UNAME_RELEASE}
315
318
        exit 0;;
327
330
    NILE*:*:*:dcosx)
328
331
        echo pyramid-pyramid-svr4
329
332
        exit 0 ;;
 
333
    DRS?6000:unix:4.0:6*)
 
334
        echo sparc-icl-nx6
 
335
        exit 0 ;;
330
336
    DRS?6000:UNIX_SV:4.2*:7*)
331
337
        case `/usr/bin/uname -p` in
332
338
            sparc) echo sparc-icl-nx7 && exit 0 ;;
382
388
    # MiNT.  But MiNT is downward compatible to TOS, so this should
383
389
    # be no problem.
384
390
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
385
 
        echo m68k-atari-mint${UNAME_RELEASE}
 
391
        echo m68k-atari-mint${UNAME_RELEASE}
386
392
        exit 0 ;;
387
393
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
388
394
        echo m68k-atari-mint${UNAME_RELEASE}
389
 
        exit 0 ;;
 
395
        exit 0 ;;
390
396
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
391
 
        echo m68k-atari-mint${UNAME_RELEASE}
 
397
        echo m68k-atari-mint${UNAME_RELEASE}
392
398
        exit 0 ;;
393
399
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
394
 
        echo m68k-milan-mint${UNAME_RELEASE}
395
 
        exit 0 ;;
 
400
        echo m68k-milan-mint${UNAME_RELEASE}
 
401
        exit 0 ;;
396
402
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
397
 
        echo m68k-hades-mint${UNAME_RELEASE}
398
 
        exit 0 ;;
 
403
        echo m68k-hades-mint${UNAME_RELEASE}
 
404
        exit 0 ;;
399
405
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
400
 
        echo m68k-unknown-mint${UNAME_RELEASE}
401
 
        exit 0 ;;
 
406
        echo m68k-unknown-mint${UNAME_RELEASE}
 
407
        exit 0 ;;
402
408
    powerpc:machten:*:*)
403
409
        echo powerpc-apple-machten${UNAME_RELEASE}
404
410
        exit 0 ;;
437
443
          exit (-1);
438
444
        }
439
445
EOF
440
 
        $CC_FOR_BUILD $dummy.c -o $dummy \
 
446
        $CC_FOR_BUILD -o $dummy $dummy.c \
441
447
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
442
 
          && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
443
 
        rm -f $dummy.c $dummy && rmdir $tmpdir
 
448
          && exit 0
444
449
        echo mips-mips-riscos${UNAME_RELEASE}
445
450
        exit 0 ;;
446
451
    Motorola:PowerMAX_OS:*:*)
447
452
        echo powerpc-motorola-powermax
448
453
        exit 0 ;;
449
 
    Night_Hawk:*:*:PowerMAX_OS)
 
454
    Motorola:*:4.3:PL8-*)
 
455
        echo powerpc-harris-powermax
 
456
        exit 0 ;;
 
457
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
450
458
        echo powerpc-harris-powermax
451
459
        exit 0 ;;
452
460
    Night_Hawk:Power_UNIX:*:*)
462
470
        echo m88k-motorola-sysv3
463
471
        exit 0 ;;
464
472
    AViiON:dgux:*:*)
465
 
        # DG/UX returns AViiON for all architectures
466
 
        UNAME_PROCESSOR=`/usr/bin/uname -p`
 
473
        # DG/UX returns AViiON for all architectures
 
474
        UNAME_PROCESSOR=`/usr/bin/uname -p`
467
475
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
468
476
        then
469
477
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
476
484
        else
477
485
            echo i586-dg-dgux${UNAME_RELEASE}
478
486
        fi
479
 
        exit 0 ;;
 
487
        exit 0 ;;
480
488
    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
481
489
        echo m88k-dolphin-sysv3
482
490
        exit 0 ;;
521
529
                        exit(0);
522
530
                        }
523
531
EOF
524
 
                $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
525
 
                rm -f $dummy.c $dummy && rmdir $tmpdir
 
532
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
526
533
                echo rs6000-ibm-aix3.2.5
527
534
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
528
535
                echo rs6000-ibm-aix3.2.4
573
580
            9000/[678][0-9][0-9])
574
581
                if [ -x /usr/bin/getconf ]; then
575
582
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
576
 
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
577
 
                    case "${sc_cpu_version}" in
578
 
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
579
 
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
580
 
                      532)                      # CPU_PA_RISC2_0
581
 
                        case "${sc_kernel_bits}" in
582
 
                          32) HP_ARCH="hppa2.0n" ;;
583
 
                          64) HP_ARCH="hppa2.0w" ;;
 
583
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
 
584
                    case "${sc_cpu_version}" in
 
585
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
 
586
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
 
587
                      532)                      # CPU_PA_RISC2_0
 
588
                        case "${sc_kernel_bits}" in
 
589
                          32) HP_ARCH="hppa2.0n" ;;
 
590
                          64) HP_ARCH="hppa2.0w" ;;
584
591
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
585
 
                        esac ;;
586
 
                    esac
 
592
                        esac ;;
 
593
                    esac
587
594
                fi
588
595
                if [ "${HP_ARCH}" = "" ]; then
589
596
                    eval $set_cc_for_build
590
597
                    sed 's/^              //' << EOF >$dummy.c
591
598
 
592
 
              #define _HPUX_SOURCE
593
 
              #include <stdlib.h>
594
 
              #include <unistd.h>
595
 
 
596
 
              int main ()
597
 
              {
598
 
              #if defined(_SC_KERNEL_BITS)
599
 
                  long bits = sysconf(_SC_KERNEL_BITS);
600
 
              #endif
601
 
                  long cpu  = sysconf (_SC_CPU_VERSION);
602
 
 
603
 
                  switch (cpu)
604
 
                {
605
 
                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
606
 
                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
607
 
                case CPU_PA_RISC2_0:
608
 
              #if defined(_SC_KERNEL_BITS)
609
 
                    switch (bits)
610
 
                        {
611
 
                        case 64: puts ("hppa2.0w"); break;
612
 
                        case 32: puts ("hppa2.0n"); break;
613
 
                        default: puts ("hppa2.0"); break;
614
 
                        } break;
615
 
              #else  /* !defined(_SC_KERNEL_BITS) */
616
 
                    puts ("hppa2.0"); break;
617
 
              #endif
618
 
                default: puts ("hppa1.0"); break;
619
 
                }
620
 
                  exit (0);
621
 
              }
 
599
              #define _HPUX_SOURCE
 
600
              #include <stdlib.h>
 
601
              #include <unistd.h>
 
602
 
 
603
              int main ()
 
604
              {
 
605
              #if defined(_SC_KERNEL_BITS)
 
606
                  long bits = sysconf(_SC_KERNEL_BITS);
 
607
              #endif
 
608
                  long cpu  = sysconf (_SC_CPU_VERSION);
 
609
 
 
610
                  switch (cpu)
 
611
                {
 
612
                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
 
613
                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
 
614
                case CPU_PA_RISC2_0:
 
615
              #if defined(_SC_KERNEL_BITS)
 
616
                    switch (bits)
 
617
                        {
 
618
                        case 64: puts ("hppa2.0w"); break;
 
619
                        case 32: puts ("hppa2.0n"); break;
 
620
                        default: puts ("hppa2.0"); break;
 
621
                        } break;
 
622
              #else  /* !defined(_SC_KERNEL_BITS) */
 
623
                    puts ("hppa2.0"); break;
 
624
              #endif
 
625
                default: puts ("hppa1.0"); break;
 
626
                }
 
627
                  exit (0);
 
628
              }
622
629
EOF
623
 
                    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
624
 
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
625
 
                    rm -f $dummy.c $dummy && rmdir $tmpdir
 
630
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
631
                    test -z "$HP_ARCH" && HP_ARCH=hppa
626
632
                fi ;;
627
633
        esac
 
634
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
635
        then
 
636
            # avoid double evaluation of $set_cc_for_build
 
637
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
638
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 
639
            then
 
640
                HP_ARCH="hppa2.0w"
 
641
            else
 
642
                HP_ARCH="hppa64"
 
643
            fi
 
644
        fi
628
645
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
629
646
        exit 0 ;;
630
647
    ia64:HP-UX:*:*)
658
675
          exit (0);
659
676
        }
660
677
EOF
661
 
        $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
662
 
        rm -f $dummy.c $dummy && rmdir $tmpdir
 
678
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
663
679
        echo unknown-hitachi-hiuxwe2
664
680
        exit 0 ;;
665
681
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
689
705
        exit 0 ;;
690
706
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
691
707
        echo c1-convex-bsd
692
 
        exit 0 ;;
 
708
        exit 0 ;;
693
709
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
694
710
        if getsysinfo -f scalar_acc
695
711
        then echo c32-convex-bsd
696
712
        else echo c2-convex-bsd
697
713
        fi
698
 
        exit 0 ;;
 
714
        exit 0 ;;
699
715
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
700
716
        echo c34-convex-bsd
701
 
        exit 0 ;;
 
717
        exit 0 ;;
702
718
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
703
719
        echo c38-convex-bsd
704
 
        exit 0 ;;
 
720
        exit 0 ;;
705
721
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
706
722
        echo c4-convex-bsd
707
 
        exit 0 ;;
 
723
        exit 0 ;;
708
724
    CRAY*Y-MP:*:*:*)
709
725
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
710
726
        exit 0 ;;
717
733
    CRAY*TS:*:*:*)
718
734
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
719
735
        exit 0 ;;
720
 
    CRAY*T3D:*:*:*)
721
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
722
 
        exit 0 ;;
723
736
    CRAY*T3E:*:*:*)
724
737
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
725
738
        exit 0 ;;
727
740
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
728
741
        exit 0 ;;
729
742
    *:UNICOS/mp:*:*)
730
 
        echo nv1-cray-unicosmp | sed -e 's/\.[^.]*$/.X/'
 
743
        echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
731
744
        exit 0 ;;
732
745
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
733
746
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
734
 
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
735
 
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
736
 
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
747
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
748
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
 
749
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
750
        exit 0 ;;
 
751
    5000:UNIX_System_V:4.*:*)
 
752
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
753
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
 
754
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
737
755
        exit 0 ;;
738
756
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
739
757
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
756
774
        #endif
757
775
EOF
758
776
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
759
 
        rm -f $dummy.c && rmdir $tmpdir
760
 
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
 
777
        # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
 
778
        # FreeBSD's kernel, but not the complete OS.
 
779
        case ${LIBC} in gnu) kernel_only='k' ;; esac
 
780
        echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
761
781
        exit 0 ;;
762
782
    i*:CYGWIN*:*)
763
783
        echo ${UNAME_MACHINE}-pc-cygwin
768
788
    i*:PW*:*)
769
789
        echo ${UNAME_MACHINE}-pc-pw32
770
790
        exit 0 ;;
771
 
    x86:Interix*:3*)
772
 
        echo i386-pc-interix3
 
791
    x86:Interix*:[34]*)
 
792
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
793
        exit 0 ;;
 
794
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
795
        echo i${UNAME_MACHINE}-pc-mks
773
796
        exit 0 ;;
774
797
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
775
798
        # How do we know it's Interix rather than the generic POSIX subsystem?
776
799
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
777
800
        # UNAME_MACHINE based on the output of uname instead of i386?
778
 
        echo i386-pc-interix
 
801
        echo i586-pc-interix
779
802
        exit 0 ;;
780
803
    i*:UWIN*:*)
781
804
        echo ${UNAME_MACHINE}-pc-uwin
787
810
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
788
811
        exit 0 ;;
789
812
    *:GNU:*:*)
 
813
        # the GNU system
790
814
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
791
815
        exit 0 ;;
 
816
    *:GNU/*:*:*)
 
817
        # other systems with GNU libc and userland
 
818
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
819
        exit 0 ;;
792
820
    i*86:Minix:*:*)
793
821
        echo ${UNAME_MACHINE}-pc-minix
794
822
        exit 0 ;;
795
823
    arm*:Linux:*:*)
796
824
        echo ${UNAME_MACHINE}-unknown-linux-gnu
797
825
        exit 0 ;;
 
826
    cris:Linux:*:*)
 
827
        echo cris-axis-linux-gnu
 
828
        exit 0 ;;
798
829
    ia64:Linux:*:*)
799
830
        echo ${UNAME_MACHINE}-unknown-linux-gnu
800
831
        exit 0 ;;
818
849
        #endif
819
850
EOF
820
851
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
821
 
        rm -f $dummy.c && rmdir $tmpdir
822
 
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 
852
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
853
        ;;
 
854
    mips64:Linux:*:*)
 
855
        eval $set_cc_for_build
 
856
        sed 's/^        //' << EOF >$dummy.c
 
857
        #undef CPU
 
858
        #undef mips64
 
859
        #undef mips64el
 
860
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
861
        CPU=mips64el
 
862
        #else
 
863
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
864
        CPU=mips64
 
865
        #else
 
866
        CPU=
 
867
        #endif
 
868
        #endif
 
869
EOF
 
870
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
871
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
823
872
        ;;
824
873
    ppc:Linux:*:*)
825
874
        echo powerpc-unknown-linux-gnu
836
885
          EV6)   UNAME_MACHINE=alphaev6 ;;
837
886
          EV67)  UNAME_MACHINE=alphaev67 ;;
838
887
          EV68*) UNAME_MACHINE=alphaev68 ;;
839
 
        esac
 
888
        esac
840
889
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
841
890
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
842
891
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
855
904
    s390:Linux:*:* | s390x:Linux:*:*)
856
905
        echo ${UNAME_MACHINE}-ibm-linux
857
906
        exit 0 ;;
 
907
    sh64*:Linux:*:*)
 
908
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
909
        exit 0 ;;
858
910
    sh*:Linux:*:*)
859
911
        echo ${UNAME_MACHINE}-unknown-linux-gnu
860
912
        exit 0 ;;
875
927
                                    s/.*supported targets: *//
876
928
                                    s/ .*//
877
929
                                    p'`
878
 
        case "$ld_supported_targets" in
 
930
        case "$ld_supported_targets" in
879
931
          elf32-i386)
880
932
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
881
933
                ;;
912
964
        LIBC=gnuaout
913
965
        #endif
914
966
        #endif
 
967
        #ifdef __dietlibc__
 
968
        LIBC=dietlibc
 
969
        #endif
915
970
EOF
916
971
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
917
 
        rm -f $dummy.c && rmdir $tmpdir
918
972
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
919
973
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
920
974
        ;;
925
979
        echo i386-sequent-sysv4
926
980
        exit 0 ;;
927
981
    i*86:UNIX_SV:4.2MP:2.*)
928
 
        # Unixware is an offshoot of SVR4, but it has its own version
929
 
        # number series starting with 2...
930
 
        # I am not positive that other SVR4 systems won't match this,
 
982
        # Unixware is an offshoot of SVR4, but it has its own version
 
983
        # number series starting with 2...
 
984
        # I am not positive that other SVR4 systems won't match this,
931
985
        # I just have to hope.  -- rms.
932
 
        # Use sysv4.2uw... so that sysv4* matches it.
 
986
        # Use sysv4.2uw... so that sysv4* matches it.
933
987
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
934
988
        exit 0 ;;
 
989
    i*86:OS/2:*:*)
 
990
        # If we were able to find `uname', then EMX Unix compatibility
 
991
        # is probably installed.
 
992
        echo ${UNAME_MACHINE}-pc-os2-emx
 
993
        exit 0 ;;
 
994
    i*86:XTS-300:*:STOP)
 
995
        echo ${UNAME_MACHINE}-unknown-stop
 
996
        exit 0 ;;
 
997
    i*86:atheos:*:*)
 
998
        echo ${UNAME_MACHINE}-unknown-atheos
 
999
        exit 0 ;;
 
1000
        i*86:syllable:*:*)
 
1001
        echo ${UNAME_MACHINE}-pc-syllable
 
1002
        exit 0 ;;
 
1003
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
1004
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
1005
        exit 0 ;;
 
1006
    i*86:*DOS:*:*)
 
1007
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
1008
        exit 0 ;;
935
1009
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
936
1010
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
937
1011
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
966
1040
                echo ${UNAME_MACHINE}-pc-sysv32
967
1041
        fi
968
1042
        exit 0 ;;
969
 
    i*86:*DOS:*:*)
970
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
971
 
        exit 0 ;;
972
1043
    pc:*:*:*)
973
1044
        # Left here for compatibility:
974
 
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
975
 
        # the processor, so we play safe by assuming i386.
 
1045
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
 
1046
        # the processor, so we play safe by assuming i386.
976
1047
        echo i386-pc-msdosdjgpp
977
 
        exit 0 ;;
 
1048
        exit 0 ;;
978
1049
    Intel:Mach:3*:*)
979
1050
        echo i386-pc-mach3
980
1051
        exit 0 ;;
992
1063
        # "miniframe"
993
1064
        echo m68010-convergent-sysv
994
1065
        exit 0 ;;
 
1066
    mc68k:UNIX:SYSTEM5:3.51m)
 
1067
        echo m68k-convergent-sysv
 
1068
        exit 0 ;;
 
1069
    M680?0:D-NIX:5.3:*)
 
1070
        echo m68k-diab-dnix
 
1071
        exit 0 ;;
995
1072
    M68*:*:R3V[567]*:*)
996
1073
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
997
 
    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)
 
1074
    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)
998
1075
        OS_REL=''
999
1076
        test -r /etc/.relid \
1000
1077
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1003
1080
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1004
1081
          && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1005
1082
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1006
 
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1007
 
          && echo i486-ncr-sysv4 && exit 0 ;;
 
1083
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 
1084
          && echo i486-ncr-sysv4 && exit 0 ;;
1008
1085
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1009
1086
        echo m68k-unknown-lynxos${UNAME_RELEASE}
1010
1087
        exit 0 ;;
1011
1088
    mc68030:UNIX_System_V:4.*:*)
1012
1089
        echo m68k-atari-sysv4
1013
1090
        exit 0 ;;
1014
 
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1015
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
1016
 
        exit 0 ;;
1017
1091
    TSUNAMI:LynxOS:2.*:*)
1018
1092
        echo sparc-unknown-lynxos${UNAME_RELEASE}
1019
1093
        exit 0 ;;
1041
1115
        fi
1042
1116
        exit 0 ;;
1043
1117
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1044
 
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1045
 
        echo i586-unisys-sysv4
1046
 
        exit 0 ;;
 
1118
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1119
        echo i586-unisys-sysv4
 
1120
        exit 0 ;;
1047
1121
    *:UNIX_System_V:4*:FTX*)
1048
1122
        # From Gerald Hewes <hewes@openmarket.com>.
1049
1123
        # How about differentiating between stratus architectures? -djm
1065
1139
        exit 0 ;;
1066
1140
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1067
1141
        if [ -d /usr/nec ]; then
1068
 
                echo mips-nec-sysv${UNAME_RELEASE}
 
1142
                echo mips-nec-sysv${UNAME_RELEASE}
1069
1143
        else
1070
 
                echo mips-unknown-sysv${UNAME_RELEASE}
 
1144
                echo mips-unknown-sysv${UNAME_RELEASE}
1071
1145
        fi
1072
 
        exit 0 ;;
 
1146
        exit 0 ;;
1073
1147
    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
1074
1148
        echo powerpc-be-beos
1075
1149
        exit 0 ;;
1085
1159
    SX-5:SUPER-UX:*:*)
1086
1160
        echo sx5-nec-superux${UNAME_RELEASE}
1087
1161
        exit 0 ;;
 
1162
    SX-6:SUPER-UX:*:*)
 
1163
        echo sx6-nec-superux${UNAME_RELEASE}
 
1164
        exit 0 ;;
1088
1165
    Power*:Rhapsody:*:*)
1089
1166
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1090
1167
        exit 0 ;;
1092
1169
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1093
1170
        exit 0 ;;
1094
1171
    *:Darwin:*:*)
1095
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1172
        case `uname -p` in
 
1173
            *86) UNAME_PROCESSOR=i686 ;;
 
1174
            powerpc) UNAME_PROCESSOR=powerpc ;;
 
1175
        esac
 
1176
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1096
1177
        exit 0 ;;
1097
1178
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1098
1179
        UNAME_PROCESSOR=`uname -p`
1105
1186
    *:QNX:*:4*)
1106
1187
        echo i386-pc-qnx
1107
1188
        exit 0 ;;
1108
 
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
 
1189
    NSR-?:NONSTOP_KERNEL:*:*)
1109
1190
        echo nsr-tandem-nsk${UNAME_RELEASE}
1110
1191
        exit 0 ;;
1111
1192
    *:NonStop-UX:*:*)
1128
1209
        fi
1129
1210
        echo ${UNAME_MACHINE}-unknown-plan9
1130
1211
        exit 0 ;;
1131
 
    i*86:OS/2:*:*)
1132
 
        # If we were able to find `uname', then EMX Unix compatibility
1133
 
        # is probably installed.
1134
 
        echo ${UNAME_MACHINE}-pc-os2-emx
1135
 
        exit 0 ;;
1136
1212
    *:TOPS-10:*:*)
1137
1213
        echo pdp10-unknown-tops10
1138
1214
        exit 0 ;;
1151
1227
    *:ITS:*:*)
1152
1228
        echo pdp10-unknown-its
1153
1229
        exit 0 ;;
1154
 
    i*86:XTS-300:*:STOP)
1155
 
        echo ${UNAME_MACHINE}-unknown-stop
 
1230
    SEI:*:*:SEIUX)
 
1231
        echo mips-sei-seiux${UNAME_RELEASE}
1156
1232
        exit 0 ;;
1157
 
    i*86:atheos:*:*)
1158
 
        echo ${UNAME_MACHINE}-unknown-atheos
 
1233
    *:DRAGONFLY:*:*)
 
1234
        echo ${UNAME_MACHINE}-unknown-dragonfly${UNAME_RELEASE}
1159
1235
        exit 0 ;;
1160
1236
esac
1161
1237
 
1179
1255
#include <sys/param.h>
1180
1256
  printf ("m68k-sony-newsos%s\n",
1181
1257
#ifdef NEWSOS4
1182
 
          "4"
 
1258
          "4"
1183
1259
#else
1184
1260
          ""
1185
1261
#endif
1186
 
         ); exit (0);
 
1262
         ); exit (0);
1187
1263
#endif
1188
1264
#endif
1189
1265
 
1277
1353
}
1278
1354
EOF
1279
1355
 
1280
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
1281
 
rm -f $dummy.c $dummy && rmdir $tmpdir
 
1356
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1282
1357
 
1283
1358
# Apollos put the system type in the environment.
1284
1359