~ubuntu-branches/ubuntu/quantal/linpsk/quantal

« back to all changes in this revision

Viewing changes to admin/config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Bruce Walker
  • Date: 2002-02-06 11:43:38 UTC
  • Revision ID: james.westby@ubuntu.com-20020206114338-s1xp6su9unkf2kjh
Tags: 0.6.2-3
* Now let's put config.sub and config.guess in the right place :-)
* (closes: #132077)

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
 
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4
 
#   Free Software Foundation, Inc.
 
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 
4
#   2000, 2001, 2002 Free Software Foundation, Inc.
5
5
 
6
 
timestamp='2000-12-02'
 
6
timestamp='2002-01-30'
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
24
24
# configuration script generated by Autoconf, you may include it under
25
25
# the same distribution terms that you use for the rest of that program.
26
26
 
27
 
# Written by Per Bothner <bothner@cygnus.com>.
28
 
# Please send patches to <config-patches@gnu.org>.
 
27
# Originally written by Per Bothner <per@bothner.com>.
 
28
# Please send patches to <config-patches@gnu.org>.  Submit a context
 
29
# diff and a properly formatted ChangeLog entry.
29
30
#
30
31
# This script attempts to guess a canonical system name similar to
31
32
# config.sub.  If it succeeds, it prints the system name on stdout, and
33
34
#
34
35
# The plan is that this can be called by configure scripts if you
35
36
# don't specify an explicit build system type.
36
 
#
37
 
# Only a few systems have been added to this list; please add others
38
 
# (but try to keep the structure clean).
39
 
#
40
37
 
41
38
me=`echo "$0" | sed -e 's,.*/,,'`
42
39
 
48
45
Operation modes:
49
46
  -h, --help         print this help, then exit
50
47
  -t, --time-stamp   print date of last modification, then exit
51
 
 
52
 
Report bugs and patches to <config-patches@gnu.org>.
53
 
 
54
 
Written by Per Bothner.
55
 
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
56
 
Free Software Foundation, Inc.  See the source for copying conditions."
 
48
  -v, --version      print version number, then exit
 
49
 
 
50
Report bugs and patches to <config-patches@gnu.org>."
 
51
 
 
52
version="\
 
53
GNU config.guess ($timestamp)
 
54
 
 
55
Originally written by Per Bothner.
 
56
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
 
57
Free Software Foundation, Inc.
 
58
 
 
59
This is free software; see the source for copying conditions.  There is NO
 
60
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
57
61
 
58
62
help="
59
63
Try \`$me --help' for more information."
61
65
# Parse command line
62
66
while test $# -gt 0 ; do
63
67
  case $1 in
64
 
    --time-stamp | --time* | -t)
 
68
    --time-stamp | --time* | -t )
65
69
       echo "$timestamp" ; exit 0 ;;
 
70
    --version | -v )
 
71
       echo "$version" ; exit 0 ;;
66
72
    --help | --h* | -h )
67
73
       echo "$usage"; exit 0 ;;
68
74
    -- )     # Stop option processing
84
90
 
85
91
 
86
92
dummy=dummy-$$
87
 
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
 
93
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
88
94
 
89
95
# CC_FOR_BUILD -- compiler used by this script.
90
96
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
91
97
# use `HOST_CC' if defined, but it is deprecated.
92
98
 
93
 
case $CC_FOR_BUILD,$HOST_CC,$CC in
94
 
 ,,)    echo "int dummy(){}" > $dummy.c
 
99
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
 
100
 ,,)    echo "int dummy(){}" > $dummy.c ;
95
101
        for c in cc gcc c89 ; do
96
 
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
 
102
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
97
103
          if test $? = 0 ; then
98
 
             CC_FOR_BUILD="$c"; break
99
 
          fi
100
 
        done
101
 
        rm -f $dummy.c $dummy.o
 
104
             CC_FOR_BUILD="$c"; break ;
 
105
          fi ;
 
106
        done ;
 
107
        rm -f $dummy.c $dummy.o $dummy.rel ;
102
108
        if test x"$CC_FOR_BUILD" = x ; then
103
 
          CC_FOR_BUILD=no_compiler_found
 
109
          CC_FOR_BUILD=no_compiler_found ;
104
110
        fi
105
111
        ;;
106
112
 ,,*)   CC_FOR_BUILD=$CC ;;
107
113
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
108
 
esac
 
114
esac'
109
115
 
110
116
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
111
 
# (ghazi@noc.rutgers.edu 8/24/94.)
 
117
# (ghazi@noc.rutgers.edu 1994-08-24)
112
118
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
113
119
        PATH=$PATH:/.attbin ; export PATH
114
120
fi
122
128
 
123
129
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
124
130
    *:NetBSD:*:*)
125
 
        # Netbsd (nbsd) targets should (where applicable) match one or
 
131
        # NetBSD (nbsd) targets should (where applicable) match one or
126
132
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
127
133
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
128
134
        # switched to ELF, *-*-netbsd* would select the old
129
135
        # object file format.  This provides both forward
130
136
        # compatibility and a consistent mechanism for selecting the
131
137
        # object file format.
132
 
        # Determine the machine/vendor (is the vendor relevant).
133
 
        case "${UNAME_MACHINE}" in
134
 
            amiga) machine=m68k-unknown ;;
135
 
            arm32) machine=arm-unknown ;;
136
 
            atari*) machine=m68k-atari ;;
137
 
            sun3*) machine=m68k-sun ;;
138
 
            mac68k) machine=m68k-apple ;;
139
 
            macppc) machine=powerpc-apple ;;
140
 
            hp3[0-9][05]) machine=m68k-hp ;;
141
 
            ibmrt|romp-ibm) machine=romp-ibm ;;
142
 
            *) machine=${UNAME_MACHINE}-unknown ;;
 
138
        #
 
139
        # Note: NetBSD doesn't particularly care about the vendor
 
140
        # portion of the name.  We always set it to "unknown".
 
141
        UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
 
142
            UNAME_MACHINE_ARCH=unknown
 
143
        case "${UNAME_MACHINE_ARCH}" in
 
144
            arm*) machine=arm-unknown ;;
 
145
            sh3el) machine=shl-unknown ;;
 
146
            sh3eb) machine=sh-unknown ;;
 
147
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
143
148
        esac
144
149
        # The Operating System including object format, if it has switched
145
150
        # to ELF recently, or will in the future.
146
 
        case "${UNAME_MACHINE}" in
147
 
            i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
 
151
        case "${UNAME_MACHINE_ARCH}" in
 
152
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 
153
                eval $set_cc_for_build
148
154
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
149
155
                        | grep __ELF__ >/dev/null
150
156
                then
166
172
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
167
173
        echo "${machine}-${os}${release}"
168
174
        exit 0 ;;
 
175
    amiga:OpenBSD:*:*)
 
176
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
177
        exit 0 ;;
 
178
    arc:OpenBSD:*:*)
 
179
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
180
        exit 0 ;;
 
181
    hp300:OpenBSD:*:*)
 
182
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
183
        exit 0 ;;
 
184
    mac68k:OpenBSD:*:*)
 
185
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
186
        exit 0 ;;
 
187
    macppc:OpenBSD:*:*)
 
188
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
189
        exit 0 ;;
 
190
    mvme68k:OpenBSD:*:*)
 
191
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
192
        exit 0 ;;
 
193
    mvme88k:OpenBSD:*:*)
 
194
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
195
        exit 0 ;;
 
196
    mvmeppc:OpenBSD:*:*)
 
197
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
198
        exit 0 ;;
 
199
    pmax:OpenBSD:*:*)
 
200
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
201
        exit 0 ;;
 
202
    sgi:OpenBSD:*:*)
 
203
        echo mipseb-unknown-openbsd${UNAME_RELEASE}
 
204
        exit 0 ;;
 
205
    sun3:OpenBSD:*:*)
 
206
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
207
        exit 0 ;;
 
208
    wgrisc:OpenBSD:*:*)
 
209
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
210
        exit 0 ;;
 
211
    *:OpenBSD:*:*)
 
212
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 
213
        exit 0 ;;
169
214
    alpha:OSF1:*:*)
170
215
        if test $UNAME_RELEASE = "V4.0"; then
171
216
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
199
244
        jsr \$26,exit
200
245
        .end main
201
246
EOF
 
247
        eval $set_cc_for_build
202
248
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
203
249
        if test "$?" = 0 ; then
204
250
                case `./$dummy` in
220
266
                        2-307)
221
267
                                UNAME_MACHINE="alphaev67"
222
268
                                ;;
 
269
                        2-1307)
 
270
                                UNAME_MACHINE="alphaev68"
 
271
                                ;;
223
272
                esac
224
273
        fi
225
274
        rm -f $dummy.s $dummy
237
286
    Amiga*:UNIX_System_V:4.0:*)
238
287
        echo m68k-unknown-sysv4
239
288
        exit 0;;
240
 
    amiga:OpenBSD:*:*)
241
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
242
 
        exit 0 ;;
243
289
    *:[Aa]miga[Oo][Ss]:*:*)
244
290
        echo ${UNAME_MACHINE}-unknown-amigaos
245
291
        exit 0 ;;
246
 
    arc64:OpenBSD:*:*)
247
 
        echo mips64el-unknown-openbsd${UNAME_RELEASE}
248
 
        exit 0 ;;
249
 
    arc:OpenBSD:*:*)
250
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
251
 
        exit 0 ;;
252
 
    hkmips:OpenBSD:*:*)
253
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
254
 
        exit 0 ;;
255
 
    pmax:OpenBSD:*:*)
256
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
257
 
        exit 0 ;;
258
 
    sgi:OpenBSD:*:*)
259
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
260
 
        exit 0 ;;
261
 
    wgrisc:OpenBSD:*:*)
262
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
292
    *:[Mm]orph[Oo][Ss]:*:*)
 
293
        echo ${UNAME_MACHINE}-unknown-morphos
263
294
        exit 0 ;;
264
295
    *:OS/390:*:*)
265
296
        echo i370-ibm-openedition
267
298
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
268
299
        echo arm-acorn-riscix${UNAME_RELEASE}
269
300
        exit 0;;
270
 
    SR2?01:HI-UX/MPP:*:*)
 
301
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
271
302
        echo hppa1.1-hitachi-hiuxmpp
272
303
        exit 0;;
273
304
    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
323
354
    aushp:SunOS:*:*)
324
355
        echo sparc-auspex-sunos${UNAME_RELEASE}
325
356
        exit 0 ;;
326
 
    atari*:OpenBSD:*:*)
327
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
328
 
        exit 0 ;;
329
357
    # The situation for MiNT is a little confusing.  The machine name
330
358
    # can be virtually everything (everything which is not
331
359
    # "atarist" or "atariste" at least should have a processor
352
380
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
353
381
        echo m68k-unknown-mint${UNAME_RELEASE}
354
382
        exit 0 ;;
355
 
    sun3*:OpenBSD:*:*)
356
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
357
 
        exit 0 ;;
358
 
    mac68k:OpenBSD:*:*)
359
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
360
 
        exit 0 ;;
361
 
    mvme68k:OpenBSD:*:*)
362
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
363
 
        exit 0 ;;
364
 
    mvme88k:OpenBSD:*:*)
365
 
        echo m88k-unknown-openbsd${UNAME_RELEASE}
366
 
        exit 0 ;;
367
383
    powerpc:machten:*:*)
368
384
        echo powerpc-apple-machten${UNAME_RELEASE}
369
385
        exit 0 ;;
380
396
        echo clipper-intergraph-clix${UNAME_RELEASE}
381
397
        exit 0 ;;
382
398
    mips:*:*:UMIPS | mips:*:*:RISCos)
 
399
        eval $set_cc_for_build
383
400
        sed 's/^        //' << EOF >$dummy.c
384
401
#ifdef __cplusplus
385
402
#include <stdio.h>  /* for printf() prototype */
403
420
EOF
404
421
        $CC_FOR_BUILD $dummy.c -o $dummy \
405
422
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
406
 
          && rm $dummy.c $dummy && exit 0
 
423
          && rm -f $dummy.c $dummy && exit 0
407
424
        rm -f $dummy.c $dummy
408
425
        echo mips-mips-riscos${UNAME_RELEASE}
409
426
        exit 0 ;;
 
427
    Motorola:PowerMAX_OS:*:*)
 
428
        echo powerpc-motorola-powermax
 
429
        exit 0 ;;
410
430
    Night_Hawk:Power_UNIX:*:*)
411
431
        echo powerpc-harris-powerunix
412
432
        exit 0 ;;
454
474
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
455
475
        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
456
476
        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
457
 
    i?86:AIX:*:*)
 
477
    i*86:AIX:*:*)
458
478
        echo i386-ibm-aix
459
479
        exit 0 ;;
 
480
    ia64:AIX:*:*)
 
481
        if [ -x /usr/bin/oslevel ] ; then
 
482
                IBM_REV=`/usr/bin/oslevel`
 
483
        else
 
484
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 
485
        fi
 
486
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
 
487
        exit 0 ;;
460
488
    *:AIX:2:3)
461
489
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 
490
                eval $set_cc_for_build
462
491
                sed 's/^                //' << EOF >$dummy.c
463
492
                #include <sys/systemcfg.h>
464
493
 
470
499
                        exit(0);
471
500
                        }
472
501
EOF
473
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
 
502
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
474
503
                rm -f $dummy.c $dummy
475
504
                echo rs6000-ibm-aix3.2.5
476
505
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
479
508
                echo rs6000-ibm-aix3.2
480
509
        fi
481
510
        exit 0 ;;
482
 
    *:AIX:*:4)
 
511
    *:AIX:*:[45])
483
512
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
484
 
        if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then
 
513
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
485
514
                IBM_ARCH=rs6000
486
515
        else
487
516
                IBM_ARCH=powerpc
489
518
        if [ -x /usr/bin/oslevel ] ; then
490
519
                IBM_REV=`/usr/bin/oslevel`
491
520
        else
492
 
                IBM_REV=4.${UNAME_RELEASE}
 
521
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
493
522
        fi
494
523
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
495
524
        exit 0 ;;
520
549
            9000/31? )            HP_ARCH=m68000 ;;
521
550
            9000/[34]?? )         HP_ARCH=m68k ;;
522
551
            9000/[678][0-9][0-9])
523
 
              case "${HPUX_REV}" in
524
 
                11.[0-9][0-9])
525
 
                  if [ -x /usr/bin/getconf ]; then
526
 
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 
552
                if [ -x /usr/bin/getconf ]; then
 
553
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
527
554
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
528
555
                    case "${sc_cpu_version}" in
529
556
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
532
559
                        case "${sc_kernel_bits}" in
533
560
                          32) HP_ARCH="hppa2.0n" ;;
534
561
                          64) HP_ARCH="hppa2.0w" ;;
 
562
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
535
563
                        esac ;;
536
564
                    esac
537
 
                  fi ;;
538
 
              esac
539
 
              if [ "${HP_ARCH}" = "" ]; then
540
 
              sed 's/^              //' << EOF >$dummy.c
 
565
                fi
 
566
                if [ "${HP_ARCH}" = "" ]; then
 
567
                    eval $set_cc_for_build
 
568
                    sed 's/^              //' << EOF >$dummy.c
541
569
 
542
570
              #define _HPUX_SOURCE
543
571
              #include <stdlib.h>
570
598
                  exit (0);
571
599
              }
572
600
EOF
573
 
        (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
574
 
        if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
575
 
        rm -f $dummy.c $dummy
576
 
        fi ;;
 
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
 
604
                fi ;;
577
605
        esac
578
606
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
579
607
        exit 0 ;;
 
608
    ia64:HP-UX:*:*)
 
609
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
 
610
        echo ia64-hp-hpux${HPUX_REV}
 
611
        exit 0 ;;
580
612
    3050*:HI-UX:*:*)
 
613
        eval $set_cc_for_build
581
614
        sed 's/^        //' << EOF >$dummy.c
582
615
        #include <unistd.h>
583
616
        int
603
636
          exit (0);
604
637
        }
605
638
EOF
606
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0
 
639
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
607
640
        rm -f $dummy.c $dummy
608
641
        echo unknown-hitachi-hiuxwe2
609
642
        exit 0 ;;
613
646
    9000/8??:4.3bsd:*:*)
614
647
        echo hppa1.0-hp-bsd
615
648
        exit 0 ;;
616
 
    *9??*:MPE/iX:*:*)
 
649
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
617
650
        echo hppa1.0-hp-mpeix
618
651
        exit 0 ;;
619
652
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
622
655
    hp8??:OSF1:*:*)
623
656
        echo hppa1.0-hp-osf
624
657
        exit 0 ;;
625
 
    i?86:OSF1:*:*)
 
658
    i*86:OSF1:*:*)
626
659
        if [ -x /usr/sbin/sysversion ] ; then
627
660
            echo ${UNAME_MACHINE}-unknown-osf1mk
628
661
        else
632
665
    parisc*:Lites*:*:*)
633
666
        echo hppa1.1-hp-lites
634
667
        exit 0 ;;
635
 
    hppa*:OpenBSD:*:*)
636
 
        echo hppa-unknown-openbsd
637
 
        exit 0 ;;
638
668
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
639
669
        echo c1-convex-bsd
640
670
        exit 0 ;;
657
687
        echo xmp-cray-unicos
658
688
        exit 0 ;;
659
689
    CRAY*Y-MP:*:*:*)
660
 
        echo ymp-cray-unicos${UNAME_RELEASE}
 
690
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
661
691
        exit 0 ;;
662
692
    CRAY*[A-Z]90:*:*:*)
663
693
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
664
694
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
665
 
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
 
695
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 
696
              -e 's/\.[^.]*$/.X/'
666
697
        exit 0 ;;
667
698
    CRAY*TS:*:*:*)
668
699
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
679
710
    CRAY-2:*:*:*)
680
711
        echo cray2-cray-unicos
681
712
        exit 0 ;;
682
 
    F300:UNIX_System_V:*:*)
 
713
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
 
714
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
683
715
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
684
716
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
685
 
        echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
717
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
686
718
        exit 0 ;;
687
 
    F301:UNIX_System_V:*:*)
688
 
       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
689
 
       exit 0 ;;
690
 
    hp300:OpenBSD:*:*)
691
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
692
 
        exit 0 ;;
693
 
    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 
719
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
694
720
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
695
721
        exit 0 ;;
696
722
    sparc*:BSD/OS:*:*)
702
728
    *:FreeBSD:*:*)
703
729
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
704
730
        exit 0 ;;
705
 
    *:OpenBSD:*:*)
706
 
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
707
 
        exit 0 ;;
708
731
    i*:CYGWIN*:*)
709
732
        echo ${UNAME_MACHINE}-pc-cygwin
710
733
        exit 0 ;;
714
737
    i*:PW*:*)
715
738
        echo ${UNAME_MACHINE}-pc-pw32
716
739
        exit 0 ;;
 
740
    x86:Interix*:3*)
 
741
        echo i386-pc-interix3
 
742
        exit 0 ;;
717
743
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
718
744
        # How do we know it's Interix rather than the generic POSIX subsystem?
719
745
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
735
761
    i*86:Minix:*:*)
736
762
        echo ${UNAME_MACHINE}-pc-minix
737
763
        exit 0 ;;
738
 
    *:Linux:*:*)
739
 
 
 
764
    arm*:Linux:*:*)
 
765
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
766
        exit 0 ;;
 
767
    ia64:Linux:*:*)
 
768
        echo ${UNAME_MACHINE}-unknown-linux
 
769
        exit 0 ;;
 
770
    m68*:Linux:*:*)
 
771
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
772
        exit 0 ;;
 
773
    mips:Linux:*:*)
 
774
        eval $set_cc_for_build
 
775
        sed 's/^        //' << EOF >$dummy.c
 
776
        #undef CPU
 
777
        #undef mips
 
778
        #undef mipsel
 
779
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 
 
780
        CPU=mipsel 
 
781
        #else
 
782
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 
 
783
        CPU=mips
 
784
        #else
 
785
        CPU=
 
786
        #endif
 
787
        #endif 
 
788
EOF
 
789
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
790
        rm -f $dummy.c
 
791
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
 
792
        ;;
 
793
    ppc:Linux:*:*)
 
794
        echo powerpc-unknown-linux-gnu
 
795
        exit 0 ;;
 
796
    ppc64:Linux:*:*)
 
797
        echo powerpc64-unknown-linux-gnu
 
798
        exit 0 ;;
 
799
    alpha:Linux:*:*)
 
800
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 
801
          EV5)   UNAME_MACHINE=alphaev5 ;;
 
802
          EV56)  UNAME_MACHINE=alphaev56 ;;
 
803
          PCA56) UNAME_MACHINE=alphapca56 ;;
 
804
          PCA57) UNAME_MACHINE=alphapca56 ;;
 
805
          EV6)   UNAME_MACHINE=alphaev6 ;;
 
806
          EV67)  UNAME_MACHINE=alphaev67 ;;
 
807
          EV68*) UNAME_MACHINE=alphaev68 ;;
 
808
        esac
 
809
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 
810
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
 
811
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 
812
        exit 0 ;;
 
813
    parisc:Linux:*:* | hppa:Linux:*:*)
 
814
        # Look for CPU level
 
815
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
 
816
          PA7*) echo hppa1.1-unknown-linux-gnu ;;
 
817
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
 
818
          *)    echo hppa-unknown-linux-gnu ;;
 
819
        esac
 
820
        exit 0 ;;
 
821
    parisc64:Linux:*:* | hppa64:Linux:*:*)
 
822
        echo hppa64-unknown-linux-gnu
 
823
        exit 0 ;;
 
824
    s390:Linux:*:* | s390x:Linux:*:*)
 
825
        echo ${UNAME_MACHINE}-ibm-linux
 
826
        exit 0 ;;
 
827
    sh*:Linux:*:*)
 
828
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
829
        exit 0 ;;
 
830
    sparc:Linux:*:* | sparc64:Linux:*:*)
 
831
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
832
        exit 0 ;;
 
833
    x86_64:Linux:*:*)
 
834
        echo x86_64-unknown-linux-gnu
 
835
        exit 0 ;;
 
836
    i*86:Linux:*:*)
740
837
        # The BFD linker knows what the default object file format is, so
741
838
        # first see if it will tell us. cd to the root directory to prevent
742
839
        # problems with other programs or directories called `ld' in the path.
743
 
        ld_supported_emulations=`cd /; ld --help 2>&1 \
744
 
                         | sed -ne '/supported emulations:/!d
 
840
        # Export LANG=C to prevent ld from outputting information in other
 
841
        # languages.
 
842
        ld_supported_targets=`LANG=C; export LANG; cd /; ld --help 2>&1 \
 
843
                         | sed -ne '/supported targets:/!d
745
844
                                    s/[         ][      ]*/ /g
746
 
                                    s/.*supported emulations: *//
 
845
                                    s/.*supported targets: *//
747
846
                                    s/ .*//
748
847
                                    p'`
749
 
        case "$ld_supported_emulations" in
750
 
          *ia64)
751
 
                echo "${UNAME_MACHINE}-unknown-linux"
752
 
                exit 0
 
848
        case "$ld_supported_targets" in
 
849
          elf32-i386)
 
850
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
753
851
                ;;
754
 
          i?86linux)
 
852
          a.out-i386-linux)
755
853
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
756
 
                exit 0
757
 
                ;;
758
 
          elf_i?86)
759
 
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
760
 
                ;;
761
 
          i?86coff)
 
854
                exit 0 ;;               
 
855
          coff-i386)
762
856
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
763
 
                exit 0
764
 
                ;;
765
 
          sparclinux)
766
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
767
 
                exit 0
768
 
                ;;
769
 
          elf32_sparc)
770
 
                echo "${UNAME_MACHINE}-unknown-linux-gnu"
771
 
                exit 0
772
 
                ;;
773
 
          armlinux)
774
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
775
 
                exit 0
776
 
                ;;
777
 
          elf32arm*)
778
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
779
 
                exit 0
780
 
                ;;
781
 
          armelf_linux*)
782
 
                echo "${UNAME_MACHINE}-unknown-linux-gnu"
783
 
                exit 0
784
 
                ;;
785
 
          m68klinux)
786
 
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
787
 
                exit 0
788
 
                ;;
789
 
          elf32ppc | elf32ppclinux)
790
 
                # Determine Lib Version
791
 
                cat >$dummy.c <<EOF
792
 
#include <features.h>
793
 
#if defined(__GLIBC__)
794
 
extern char __libc_version[];
795
 
extern char __libc_release[];
796
 
#endif
797
 
main(argc, argv)
798
 
     int argc;
799
 
     char *argv[];
800
 
{
801
 
#if defined(__GLIBC__)
802
 
  printf("%s %s\n", __libc_version, __libc_release);
803
 
#else
804
 
  printf("unkown\n");
805
 
#endif
806
 
  return 0;
807
 
}
808
 
EOF
809
 
                LIBC=""
810
 
                $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
811
 
                if test "$?" = 0 ; then
812
 
                        ./$dummy | grep 1\.99 > /dev/null
813
 
                        if test "$?" = 0 ; then
814
 
                                LIBC="libc1"
815
 
                        fi
816
 
                fi
817
 
                rm -f $dummy.c $dummy
818
 
                echo powerpc-unknown-linux-gnu${LIBC}
819
 
                exit 0
820
 
                ;;
821
 
          shelf_linux)
822
 
                echo "${UNAME_MACHINE}-unknown-linux-gnu"
823
 
                exit 0
824
 
                ;;
 
857
                exit 0 ;;
 
858
          "")
 
859
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
 
860
                # one that does not give us useful --help.
 
861
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
 
862
                exit 0 ;;
825
863
        esac
826
 
 
827
 
        if test "${UNAME_MACHINE}" = "alpha" ; then
828
 
                cat <<EOF >$dummy.s
829
 
                        .data
830
 
                \$Lformat:
831
 
                        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
832
 
 
833
 
                        .text
834
 
                        .globl main
835
 
                        .align 4
836
 
                        .ent main
837
 
                main:
838
 
                        .frame \$30,16,\$26,0
839
 
                        ldgp \$29,0(\$27)
840
 
                        .prologue 1
841
 
                        .long 0x47e03d80 # implver \$0
842
 
                        lda \$2,-1
843
 
                        .long 0x47e20c21 # amask \$2,\$1
844
 
                        lda \$16,\$Lformat
845
 
                        mov \$0,\$17
846
 
                        not \$1,\$18
847
 
                        jsr \$26,printf
848
 
                        ldgp \$29,0(\$26)
849
 
                        mov 0,\$16
850
 
                        jsr \$26,exit
851
 
                        .end main
852
 
EOF
853
 
                LIBC=""
854
 
                $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
855
 
                if test "$?" = 0 ; then
856
 
                        case `./$dummy` in
857
 
                        0-0)
858
 
                                UNAME_MACHINE="alpha"
859
 
                                ;;
860
 
                        1-0)
861
 
                                UNAME_MACHINE="alphaev5"
862
 
                                ;;
863
 
                        1-1)
864
 
                                UNAME_MACHINE="alphaev56"
865
 
                                ;;
866
 
                        1-101)
867
 
                                UNAME_MACHINE="alphapca56"
868
 
                                ;;
869
 
                        2-303)
870
 
                                UNAME_MACHINE="alphaev6"
871
 
                                ;;
872
 
                        2-307)
873
 
                                UNAME_MACHINE="alphaev67"
874
 
                                ;;
875
 
                        esac
876
 
 
877
 
                        objdump --private-headers $dummy | \
878
 
                          grep ld.so.1 > /dev/null
879
 
                        if test "$?" = 0 ; then
880
 
                                LIBC="libc1"
881
 
                        fi
882
 
                fi
883
 
                rm -f $dummy.s $dummy
884
 
                echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
885
 
        elif test "${UNAME_MACHINE}" = "mips" ; then
886
 
          cat >$dummy.c <<EOF
887
 
#ifdef __cplusplus
888
 
#include <stdio.h>  /* for printf() prototype */
889
 
        int main (int argc, char *argv[]) {
890
 
#else
891
 
        int main (argc, argv) int argc; char *argv[]; {
892
 
#endif
893
 
#ifdef __MIPSEB__
894
 
  printf ("%s-unknown-linux-gnu\n", argv[1]);
895
 
#endif
896
 
#ifdef __MIPSEL__
897
 
  printf ("%sel-unknown-linux-gnu\n", argv[1]);
898
 
#endif
899
 
  return 0;
900
 
}
901
 
EOF
902
 
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
903
 
          rm -f $dummy.c $dummy
904
 
        elif test "${UNAME_MACHINE}" = "s390"; then
905
 
          echo s390-ibm-linux && exit 0
906
 
        elif test "${UNAME_MACHINE}" = "x86_64"; then
907
 
          echo x86_64-unknown-linux-gnu && exit 0
908
 
        elif test "${UNAME_MACHINE}" = "parisc" -o "${UNAME_MACHINE}" = "hppa"; then
909
 
          # Look for CPU level
910
 
          case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
911
 
            PA7*)
912
 
                echo hppa1.1-unknown-linux-gnu
913
 
                ;;
914
 
            PA8*)
915
 
                echo hppa2.0-unknown-linux-gnu
916
 
                ;;
917
 
            *)
918
 
                echo hppa-unknown-linux-gnu
919
 
                ;;
920
 
          esac
921
 
          exit 0
922
 
        else
923
 
          # Either a pre-BFD a.out linker (linux-gnuoldld)
924
 
          # or one that does not give us useful --help.
925
 
          # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
926
 
          # If ld does not provide *any* "supported emulations:"
927
 
          # that means it is gnuoldld.
928
 
          test -z "$ld_supported_emulations" \
929
 
            && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
930
 
 
931
 
          case "${UNAME_MACHINE}" in
932
 
          i?86)
933
 
            VENDOR=pc;
934
 
            ;;
935
 
          *)
936
 
            VENDOR=unknown;
937
 
            ;;
938
 
          esac
939
 
          # Determine whether the default compiler is a.out or elf
940
 
          cat >$dummy.c <<EOF
941
 
#include <features.h>
942
 
#ifdef __cplusplus
943
 
#include <stdio.h>  /* for printf() prototype */
944
 
        int main (int argc, char *argv[]) {
945
 
#else
946
 
        int main (argc, argv) int argc; char *argv[]; {
947
 
#endif
948
 
#ifdef __ELF__
949
 
# ifdef __GLIBC__
950
 
#  if __GLIBC__ >= 2
951
 
    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
952
 
#  else
953
 
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
954
 
#  endif
955
 
# else
956
 
   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
957
 
# endif
958
 
#else
959
 
  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
960
 
#endif
961
 
  return 0;
962
 
}
963
 
EOF
964
 
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
965
 
          rm -f $dummy.c $dummy
966
 
          test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
967
 
        fi ;;
968
 
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
969
 
# are messed up and put the nodename in both sysname and nodename.
970
 
    i?86:DYNIX/ptx:4*:*)
 
864
        # Determine whether the default compiler is a.out or elf
 
865
        eval $set_cc_for_build
 
866
        sed 's/^        //' << EOF >$dummy.c
 
867
        #include <features.h>
 
868
        #ifdef __ELF__
 
869
        # ifdef __GLIBC__
 
870
        #  if __GLIBC__ >= 2
 
871
        LIBC=gnu
 
872
        #  else
 
873
        LIBC=gnulibc1
 
874
        #  endif
 
875
        # else
 
876
        LIBC=gnulibc1
 
877
        # endif
 
878
        #else
 
879
        #ifdef __INTEL_COMPILER
 
880
        LIBC=gnu
 
881
        #else
 
882
        LIBC=gnuaout
 
883
        #endif
 
884
        #endif
 
885
EOF
 
886
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
887
        rm -f $dummy.c
 
888
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
 
889
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
 
890
        ;;
 
891
    i*86:DYNIX/ptx:4*:*)
 
892
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 
893
        # earlier versions are messed up and put the nodename in both
 
894
        # sysname and nodename.
971
895
        echo i386-sequent-sysv4
972
896
        exit 0 ;;
973
 
    i?86:UNIX_SV:4.2MP:2.*)
 
897
    i*86:UNIX_SV:4.2MP:2.*)
974
898
        # Unixware is an offshoot of SVR4, but it has its own version
975
899
        # number series starting with 2...
976
900
        # I am not positive that other SVR4 systems won't match this,
978
902
        # Use sysv4.2uw... so that sysv4* matches it.
979
903
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
980
904
        exit 0 ;;
981
 
    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
 
905
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
982
906
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
983
907
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
984
908
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
986
910
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
987
911
        fi
988
912
        exit 0 ;;
989
 
    i?86:*:5:7*)
990
 
        # Fixed at (any) Pentium or better
991
 
        UNAME_MACHINE=i586
992
 
        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
993
 
            echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
994
 
        else
995
 
            echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
996
 
        fi
 
913
    i*86:*:5:[78]*)
 
914
        case `/bin/uname -X | grep "^Machine"` in
 
915
            *486*)           UNAME_MACHINE=i486 ;;
 
916
            *Pentium)        UNAME_MACHINE=i586 ;;
 
917
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 
918
        esac
 
919
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
997
920
        exit 0 ;;
998
 
    i?86:*:3.2:*)
 
921
    i*86:*:3.2:*)
999
922
        if test -f /usr/options/cb.name; then
1000
923
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1001
924
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
1013
936
                echo ${UNAME_MACHINE}-pc-sysv32
1014
937
        fi
1015
938
        exit 0 ;;
1016
 
    i?86:*DOS:*:*)
 
939
    i*86:*DOS:*:*)
1017
940
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
1018
941
        exit 0 ;;
1019
942
    pc:*:*:*)
1041
964
        exit 0 ;;
1042
965
    M68*:*:R3V[567]*:*)
1043
966
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1044
 
    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 
967
    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)
1045
968
        OS_REL=''
1046
969
        test -r /etc/.relid \
1047
970
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1052
975
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1053
976
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1054
977
          && echo i486-ncr-sysv4 && exit 0 ;;
1055
 
    m68*:LynxOS:2.*:*)
 
978
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1056
979
        echo m68k-unknown-lynxos${UNAME_RELEASE}
1057
980
        exit 0 ;;
1058
981
    mc68030:UNIX_System_V:4.*:*)
1059
982
        echo m68k-atari-sysv4
1060
983
        exit 0 ;;
1061
 
    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*)
 
984
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1062
985
        echo i386-unknown-lynxos${UNAME_RELEASE}
1063
986
        exit 0 ;;
1064
987
    TSUNAMI:LynxOS:2.*:*)
1065
988
        echo sparc-unknown-lynxos${UNAME_RELEASE}
1066
989
        exit 0 ;;
1067
 
    rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*)
 
990
    rs6000:LynxOS:2.*:*)
1068
991
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
1069
992
        exit 0 ;;
 
993
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
 
994
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
 
995
        exit 0 ;;
1070
996
    SM[BE]S:UNIX_SV:*:*)
1071
997
        echo mips-dde-sysv${UNAME_RELEASE}
1072
998
        exit 0 ;;
1084
1010
                echo ns32k-sni-sysv
1085
1011
        fi
1086
1012
        exit 0 ;;
1087
 
    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1088
 
                           # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1013
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 
1014
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1089
1015
        echo i586-unisys-sysv4
1090
1016
        exit 0 ;;
1091
1017
    *:UNIX_System_V:4*:FTX*)
1097
1023
        # From seanf@swdc.stratus.com.
1098
1024
        echo i860-stratus-sysv4
1099
1025
        exit 0 ;;
 
1026
    *:VOS:*:*)
 
1027
        # From Paul.Green@stratus.com.
 
1028
        echo hppa1.1-stratus-vos
 
1029
        exit 0 ;;
1100
1030
    mc68*:A/UX:*:*)
1101
1031
        echo m68k-apple-aux${UNAME_RELEASE}
1102
1032
        exit 0 ;;
1137
1067
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1138
1068
        if test "${UNAME_MACHINE}" = "x86pc"; then
1139
1069
                UNAME_MACHINE=pc
 
1070
                echo i386-${UNAME_MACHINE}-nto-qnx
 
1071
        else
 
1072
                echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1140
1073
        fi
1141
 
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1142
1074
        exit 0 ;;
1143
1075
    *:QNX:*:4*)
1144
1076
        echo i386-pc-qnx
1145
1077
        exit 0 ;;
1146
 
    NSR-[KW]:NONSTOP_KERNEL:*:*)
 
1078
    NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*)
1147
1079
        echo nsr-tandem-nsk${UNAME_RELEASE}
1148
1080
        exit 0 ;;
1149
1081
    *:NonStop-UX:*:*)
1166
1098
        fi
1167
1099
        echo ${UNAME_MACHINE}-unknown-plan9
1168
1100
        exit 0 ;;
1169
 
    i?86:OS/2:*:*)
 
1101
    i*86:OS/2:*:*)
1170
1102
        # If we were able to find `uname', then EMX Unix compatibility
1171
1103
        # is probably installed.
1172
1104
        echo ${UNAME_MACHINE}-pc-os2-emx
1173
1105
        exit 0 ;;
 
1106
    *:TOPS-10:*:*)
 
1107
        echo pdp10-unknown-tops10
 
1108
        exit 0 ;;
 
1109
    *:TENEX:*:*)
 
1110
        echo pdp10-unknown-tenex
 
1111
        exit 0 ;;
 
1112
    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
 
1113
        echo pdp10-dec-tops20
 
1114
        exit 0 ;;
 
1115
    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
 
1116
        echo pdp10-xkl-tops20
 
1117
        exit 0 ;;
 
1118
    *:TOPS-20:*:*)
 
1119
        echo pdp10-unknown-tops20
 
1120
        exit 0 ;;
 
1121
    *:ITS:*:*)
 
1122
        echo pdp10-unknown-its
 
1123
        exit 0 ;;
 
1124
    i*86:XTS-300:*:STOP)
 
1125
        echo ${UNAME_MACHINE}-unknown-stop
 
1126
        exit 0 ;;
 
1127
    i*86:atheos:*:*)
 
1128
        echo ${UNAME_MACHINE}-unknown-atheos
 
1129
        exit 0 ;;
1174
1130
esac
1175
1131
 
1176
1132
#echo '(No uname command or uname output not recognized.)' 1>&2
1177
1133
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1178
1134
 
 
1135
eval $set_cc_for_build
1179
1136
cat >$dummy.c <<EOF
1180
1137
#ifdef _SEQUENT_
1181
1138
# include <sys/types.h>
1262
1219
#endif
1263
1220
 
1264
1221
#if defined (vax)
1265
 
#if !defined (ultrix)
1266
 
  printf ("vax-dec-bsd\n"); exit (0);
1267
 
#else
1268
 
  printf ("vax-dec-ultrix\n"); exit (0);
1269
 
#endif
 
1222
# if !defined (ultrix)
 
1223
#  include <sys/param.h>
 
1224
#  if defined (BSD)
 
1225
#   if BSD == 43
 
1226
      printf ("vax-dec-bsd4.3\n"); exit (0);
 
1227
#   else
 
1228
#    if BSD == 199006
 
1229
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
 
1230
#    else
 
1231
      printf ("vax-dec-bsd\n"); exit (0);
 
1232
#    endif
 
1233
#   endif
 
1234
#  else
 
1235
    printf ("vax-dec-bsd\n"); exit (0);
 
1236
#  endif
 
1237
# else
 
1238
    printf ("vax-dec-ultrix\n"); exit (0);
 
1239
# endif
1270
1240
#endif
1271
1241
 
1272
1242
#if defined (alliant) && defined (i860)
1277
1247
}
1278
1248
EOF
1279
1249
 
1280
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0
 
1250
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1281
1251
rm -f $dummy.c $dummy
1282
1252
 
1283
1253
# Apollos put the system type in the environment.
1313
1283
cat >&2 <<EOF
1314
1284
$0: unable to guess system type
1315
1285
 
1316
 
The $version version of this script cannot recognize your system type.
1317
 
Please download the most up to date version of the config scripts:
 
1286
This script, last modified $timestamp, has failed to recognize
 
1287
the operating system you are using. It is advised that you
 
1288
download the most up to date version of the config scripts from
1318
1289
 
1319
1290
    ftp://ftp.gnu.org/pub/gnu/config/
1320
1291
 
1323
1294
pertinent to <config-patches@gnu.org> in order to provide the needed
1324
1295
information to handle your system.
1325
1296
 
1326
 
config.guess version = $version
 
1297
config.guess timestamp = $timestamp
1327
1298
 
1328
1299
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1329
1300
uname -r = `(uname -r) 2>/dev/null || echo unknown`