~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to buildlib/config.guess

  • Committer: Arch Librarian
  • Date: 2004-09-20 16:56:32 UTC
  • Revision ID: Arch-1:apt@arch.ubuntu.com%apt--MAIN--0--patch-614
Join with aliencode
Author: jgg
Date: 2001-02-20 07:03:16 GMT
Join with aliencode

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
 
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
4
4
#   Free Software Foundation, Inc.
5
 
#
 
5
 
 
6
version='2000-09-27'
 
7
 
6
8
# This file is free software; you can redistribute it and/or modify it
7
9
# under the terms of the GNU General Public License as published by
8
10
# the Free Software Foundation; either version 2 of the License, or
23
25
# the same distribution terms that you use for the rest of that program.
24
26
 
25
27
# Written by Per Bothner <bothner@cygnus.com>.
26
 
# The master version of this file is at the FSF in /home/gd/gnu/lib.
27
 
# Please send patches to the Autoconf mailing list <autoconf@gnu.org>.
 
28
# Please send patches to <config-patches@gnu.org>.
28
29
#
29
30
# This script attempts to guess a canonical system name similar to
30
31
# config.sub.  If it succeeds, it prints the system name on stdout, and
37
38
# (but try to keep the structure clean).
38
39
#
39
40
 
 
41
me=`echo "$0" | sed -e 's,.*/,,'`
 
42
 
 
43
usage="\
 
44
Usage: $0 [OPTION]
 
45
 
 
46
Output the configuration name of this system.
 
47
 
 
48
Operation modes:
 
49
  -h, --help               print this help, then exit
 
50
  -V, --version            print version number, then exit"
 
51
 
 
52
help="
 
53
Try \`$me --help' for more information."
 
54
 
 
55
# Parse command line
 
56
while test $# -gt 0 ; do
 
57
  case "$1" in
 
58
    --version | --vers* | -V )
 
59
       echo "$version" ; exit 0 ;;
 
60
    --help | --h* | -h )
 
61
       echo "$usage"; exit 0 ;;
 
62
    -- )     # Stop option processing
 
63
       shift; break ;;
 
64
    - ) # Use stdin as input.
 
65
       break ;;
 
66
    -* )
 
67
       exec >&2
 
68
       echo "$me: invalid option $1"
 
69
       echo "$help"
 
70
       exit 1 ;;
 
71
    * )
 
72
       break ;;
 
73
  esac
 
74
done
 
75
 
 
76
if test $# != 0; then
 
77
  echo "$me: too many arguments$help" >&2
 
78
  exit 1
 
79
fi
 
80
 
40
81
# Use $HOST_CC if defined. $CC may point to a cross-compiler
41
82
if test x"$CC_FOR_BUILD" = x; then
42
83
  if test x"$HOST_CC" != x; then
68
109
# Note: order is significant - the case branches are not exclusive.
69
110
 
70
111
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 
112
    *:NetBSD:*:*)
 
113
        # Netbsd (nbsd) targets should (where applicable) match one or
 
114
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
 
115
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
 
116
        # switched to ELF, *-*-netbsd* would select the old
 
117
        # object file format.  This provides both forward
 
118
        # compatibility and a consistent mechanism for selecting the
 
119
        # object file format.
 
120
        # Determine the machine/vendor (is the vendor relevant).
 
121
        case "${UNAME_MACHINE}" in
 
122
            amiga) machine=m68k-unknown ;;
 
123
            arm32) machine=arm-unknown ;;
 
124
            atari*) machine=m68k-atari ;;
 
125
            sun3*) machine=m68k-sun ;;
 
126
            mac68k) machine=m68k-apple ;;
 
127
            macppc) machine=powerpc-apple ;;
 
128
            hp3[0-9][05]) machine=m68k-hp ;;
 
129
            ibmrt|romp-ibm) machine=romp-ibm ;;
 
130
            *) machine=${UNAME_MACHINE}-unknown ;;
 
131
        esac
 
132
        # The Operating System including object format.
 
133
        if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 
134
                | grep __ELF__ >/dev/null
 
135
        then
 
136
            # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
 
137
            # Return netbsd for either.  FIX?
 
138
            os=netbsd
 
139
        else
 
140
            os=netbsdelf
 
141
        fi
 
142
        # The OS release
 
143
        release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
144
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
 
145
        # contains redundant information, the shorter form:
 
146
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
 
147
        echo "${machine}-${os}${release}"
 
148
        exit 0 ;;
71
149
    alpha:OSF1:*:*)
72
150
        if test $UNAME_RELEASE = "V4.0"; then
73
151
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
77
155
        # A Xn.n version is an unreleased experimental baselevel.
78
156
        # 1.2 uses "1.2" for uname -r.
79
157
        cat <<EOF >$dummy.s
 
158
        .data
 
159
\$Lformat:
 
160
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
 
161
 
 
162
        .text
80
163
        .globl main
 
164
        .align 4
81
165
        .ent main
82
166
main:
83
 
        .frame \$30,0,\$26,0
84
 
        .prologue 0
85
 
        .long 0x47e03d80 # implver $0
86
 
        lda \$2,259
87
 
        .long 0x47e20c21 # amask $2,$1
88
 
        srl \$1,8,\$2
89
 
        sll \$2,2,\$2
90
 
        sll \$0,3,\$0
91
 
        addl \$1,\$0,\$0
92
 
        addl \$2,\$0,\$0
93
 
        ret \$31,(\$26),1
 
167
        .frame \$30,16,\$26,0
 
168
        ldgp \$29,0(\$27)
 
169
        .prologue 1
 
170
        .long 0x47e03d80 # implver \$0
 
171
        lda \$2,-1
 
172
        .long 0x47e20c21 # amask \$2,\$1
 
173
        lda \$16,\$Lformat
 
174
        mov \$0,\$17
 
175
        not \$1,\$18
 
176
        jsr \$26,printf
 
177
        ldgp \$29,0(\$26)
 
178
        mov 0,\$16
 
179
        jsr \$26,exit
94
180
        .end main
95
181
EOF
96
182
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
97
183
        if test "$?" = 0 ; then
98
 
                ./$dummy
99
 
                case "$?" in
100
 
                        7)
 
184
                case `./$dummy` in
 
185
                        0-0)
101
186
                                UNAME_MACHINE="alpha"
102
187
                                ;;
103
 
                        15)
 
188
                        1-0)
104
189
                                UNAME_MACHINE="alphaev5"
105
190
                                ;;
106
 
                        14)
 
191
                        1-1)
107
192
                                UNAME_MACHINE="alphaev56"
108
193
                                ;;
109
 
                        10)
 
194
                        1-101)
110
195
                                UNAME_MACHINE="alphapca56"
111
196
                                ;;
112
 
                        16)
 
197
                        2-303)
113
198
                                UNAME_MACHINE="alphaev6"
114
199
                                ;;
 
200
                        2-307)
 
201
                                UNAME_MACHINE="alphaev67"
 
202
                                ;;
115
203
                esac
116
204
        fi
117
205
        rm -f $dummy.s $dummy
127
215
        echo alpha-dec-winnt3.5
128
216
        exit 0 ;;
129
217
    Amiga*:UNIX_System_V:4.0:*)
130
 
        echo m68k-cbm-sysv4
 
218
        echo m68k-unknown-sysv4
131
219
        exit 0;;
132
 
    amiga:NetBSD:*:*)
133
 
      echo m68k-cbm-netbsd${UNAME_RELEASE}
134
 
      exit 0 ;;
135
220
    amiga:OpenBSD:*:*)
136
221
        echo m68k-unknown-openbsd${UNAME_RELEASE}
137
222
        exit 0 ;;
156
241
    wgrisc:OpenBSD:*:*)
157
242
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
158
243
        exit 0 ;;
 
244
    *:OS/390:*:*)
 
245
        echo i370-ibm-openedition
 
246
        exit 0 ;;
159
247
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
160
248
        echo arm-acorn-riscix${UNAME_RELEASE}
161
249
        exit 0;;
162
 
    arm32:NetBSD:*:*)
163
 
        echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
164
 
        exit 0 ;;
165
250
    SR2?01:HI-UX/MPP:*:*)
166
251
        echo hppa1.1-hitachi-hiuxmpp
167
252
        exit 0;;
218
303
    aushp:SunOS:*:*)
219
304
        echo sparc-auspex-sunos${UNAME_RELEASE}
220
305
        exit 0 ;;
221
 
    atari*:NetBSD:*:*)
222
 
        echo m68k-atari-netbsd${UNAME_RELEASE}
223
 
        exit 0 ;;
224
306
    atari*:OpenBSD:*:*)
225
307
        echo m68k-unknown-openbsd${UNAME_RELEASE}
226
308
        exit 0 ;;
227
309
    # The situation for MiNT is a little confusing.  The machine name
228
310
    # can be virtually everything (everything which is not
229
 
    # "atarist" or "atariste" at least should have a processor 
 
311
    # "atarist" or "atariste" at least should have a processor
230
312
    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
231
313
    # to the lowercase version "mint" (or "freemint").  Finally
232
314
    # the system name "TOS" denotes a system which is actually not
250
332
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
251
333
        echo m68k-unknown-mint${UNAME_RELEASE}
252
334
        exit 0 ;;
253
 
    sun3*:NetBSD:*:*)
254
 
        echo m68k-sun-netbsd${UNAME_RELEASE}
255
 
        exit 0 ;;
256
335
    sun3*:OpenBSD:*:*)
257
336
        echo m68k-unknown-openbsd${UNAME_RELEASE}
258
337
        exit 0 ;;
259
 
    mac68k:NetBSD:*:*)
260
 
        echo m68k-apple-netbsd${UNAME_RELEASE}
261
 
        exit 0 ;;
262
338
    mac68k:OpenBSD:*:*)
263
339
        echo m68k-unknown-openbsd${UNAME_RELEASE}
264
340
        exit 0 ;;
271
347
    powerpc:machten:*:*)
272
348
        echo powerpc-apple-machten${UNAME_RELEASE}
273
349
        exit 0 ;;
274
 
    macppc:NetBSD:*:*)
275
 
        echo powerpc-apple-netbsd${UNAME_RELEASE}
276
 
        exit 0 ;;
277
350
    RISC*:Mach:*:*)
278
351
        echo mips-dec-mach_bsd4.3
279
352
        exit 0 ;;
289
362
    mips:*:*:UMIPS | mips:*:*:RISCos)
290
363
        sed 's/^        //' << EOF >$dummy.c
291
364
#ifdef __cplusplus
 
365
#include <stdio.h>  /* for printf() prototype */
292
366
        int main (int argc, char *argv[]) {
293
367
#else
294
368
        int main (argc, argv) int argc; char *argv[]; {
328
402
    AViiON:dgux:*:*)
329
403
        # DG/UX returns AViiON for all architectures
330
404
        UNAME_PROCESSOR=`/usr/bin/uname -p`
331
 
        if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then
332
 
        if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
333
 
             -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
 
405
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 
406
        then
 
407
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
 
408
               [ ${TARGET_BINARY_INTERFACE}x = x ]
 
409
            then
334
410
                echo m88k-dg-dgux${UNAME_RELEASE}
335
 
        else
 
411
            else
336
412
                echo m88k-dg-dguxbcs${UNAME_RELEASE}
 
413
            fi
 
414
        else
 
415
            echo i586-dg-dgux${UNAME_RELEASE}
337
416
        fi
338
 
        else echo i586-dg-dgux${UNAME_RELEASE}
339
 
        fi
340
417
        exit 0 ;;
341
418
    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
342
419
        echo m88k-dolphin-sysv3
402
479
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
403
480
        echo romp-ibm-bsd4.4
404
481
        exit 0 ;;
405
 
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC NetBSD and
 
482
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
406
483
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
407
484
        exit 0 ;;                           # report: romp-ibm BSD 4.3
408
485
    *:BOSX:*:*)
423
500
            9000/[34]?? )         HP_ARCH=m68k ;;
424
501
            9000/[678][0-9][0-9])
425
502
              sed 's/^              //' << EOF >$dummy.c
 
503
 
 
504
              #define _HPUX_SOURCE
426
505
              #include <stdlib.h>
427
506
              #include <unistd.h>
428
507
 
453
532
                  exit (0);
454
533
              }
455
534
EOF
456
 
        ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
 
535
        (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
457
536
        rm -f $dummy.c $dummy
458
537
        esac
459
538
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
547
626
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
548
627
        exit 0 ;;
549
628
    CRAY*TS:*:*:*)
550
 
        echo t90-cray-unicos${UNAME_RELEASE}
 
629
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
551
630
        exit 0 ;;
552
631
    CRAY*T3E:*:*:*)
553
 
        echo alpha-cray-unicosmk${UNAME_RELEASE}
 
632
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
633
        exit 0 ;;
 
634
    CRAY*SV1:*:*:*)
 
635
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
554
636
        exit 0 ;;
555
637
    CRAY-2:*:*:*)
556
638
        echo cray2-cray-unicos
563
645
    F301:UNIX_System_V:*:*)
564
646
       echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'`
565
647
       exit 0 ;;
566
 
    hp3[0-9][05]:NetBSD:*:*)
567
 
        echo m68k-hp-netbsd${UNAME_RELEASE}
568
 
        exit 0 ;;
569
648
    hp300:OpenBSD:*:*)
570
649
        echo m68k-unknown-openbsd${UNAME_RELEASE}
571
650
        exit 0 ;;
572
 
    i?86:BSD/386:*:* | i?86:BSD/OS:*:*)
 
651
    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
573
652
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
574
653
        exit 0 ;;
575
654
    sparc*:BSD/OS:*:*)
579
658
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
580
659
        exit 0 ;;
581
660
    *:FreeBSD:*:*)
582
 
        if test -x /usr/bin/objformat; then
583
 
            if test "elf" = "`/usr/bin/objformat`"; then
584
 
                echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'`
585
 
                exit 0
586
 
            fi
587
 
        fi
588
661
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
589
662
        exit 0 ;;
590
 
    *:NetBSD:*:*)
591
 
        echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
592
 
        exit 0 ;;
593
663
    *:OpenBSD:*:*)
594
664
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
595
665
        exit 0 ;;
599
669
    i*:MINGW*:*)
600
670
        echo ${UNAME_MACHINE}-pc-mingw32
601
671
        exit 0 ;;
 
672
    i*:PW*:*)
 
673
        echo ${UNAME_MACHINE}-pc-pw32
 
674
        exit 0 ;;
602
675
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
603
676
        # How do we know it's Interix rather than the generic POSIX subsystem?
604
677
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
617
690
    *:GNU:*:*)
618
691
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
619
692
        exit 0 ;;
 
693
    i*86:Minix:*:*)
 
694
        echo ${UNAME_MACHINE}-pc-minix
 
695
        exit 0 ;;
620
696
    *:Linux:*:*)
621
 
        # uname on the ARM produces all sorts of strangeness, and we need to
622
 
        # filter it out.
623
 
        case "$UNAME_MACHINE" in
624
 
          armv*)                      UNAME_MACHINE=$UNAME_MACHINE ;;
625
 
          arm* | sa110*)              UNAME_MACHINE="arm" ;;
626
 
        esac
627
697
 
628
698
        # The BFD linker knows what the default object file format is, so
629
699
        # first see if it will tell us. cd to the root directory to prevent
636
706
                                    s/ .*//
637
707
                                    p'`
638
708
        case "$ld_supported_emulations" in
639
 
          *ia64)      echo "${UNAME_MACHINE}-unknown-linux"         ; exit 0 ;;
640
 
          i?86linux)  echo "${UNAME_MACHINE}-pc-linux-gnuaout"      ; exit 0 ;;
641
 
          i?86coff)   echo "${UNAME_MACHINE}-pc-linux-gnucoff"      ; exit 0 ;;
642
 
          sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
643
 
          armlinux)   echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
644
 
          m68klinux)  echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;;
 
709
          *ia64)
 
710
                echo "${UNAME_MACHINE}-unknown-linux"
 
711
                exit 0
 
712
                ;;
 
713
          i?86linux)
 
714
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
 
715
                exit 0
 
716
                ;;
 
717
          elf_i?86)
 
718
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 
719
                ;;
 
720
          i?86coff)
 
721
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
 
722
                exit 0
 
723
                ;;
 
724
          sparclinux)
 
725
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
 
726
                exit 0
 
727
                ;;
 
728
          armlinux)
 
729
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
 
730
                exit 0
 
731
                ;;
 
732
          elf32arm*)
 
733
                echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
 
734
                exit 0
 
735
                ;;
 
736
          armelf_linux*)
 
737
                echo "${UNAME_MACHINE}-unknown-linux-gnu"
 
738
                exit 0
 
739
                ;;
 
740
          m68klinux)
 
741
                echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
 
742
                exit 0
 
743
                ;;
645
744
          elf32ppc | elf32ppclinux)
646
745
                # Determine Lib Version
647
746
                cat >$dummy.c <<EOF
669
768
                        if test "$?" = 0 ; then
670
769
                                LIBC="libc1"
671
770
                        fi
672
 
                fi      
 
771
                fi
673
772
                rm -f $dummy.c $dummy
674
 
                echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;;
 
773
                echo powerpc-unknown-linux-gnu${LIBC}
 
774
                exit 0
 
775
                ;;
 
776
          shelf_linux)
 
777
                echo "${UNAME_MACHINE}-unknown-linux-gnu"
 
778
                exit 0
 
779
                ;;
675
780
        esac
676
781
 
677
782
        if test "${UNAME_MACHINE}" = "alpha" ; then
678
 
                sed 's/^        //'  <<EOF >$dummy.s
679
 
                .globl main
680
 
                .ent main
681
 
        main:
682
 
                .frame \$30,0,\$26,0
683
 
                .prologue 0
684
 
                .long 0x47e03d80 # implver $0
685
 
                lda \$2,259
686
 
                .long 0x47e20c21 # amask $2,$1
687
 
                srl \$1,8,\$2
688
 
                sll \$2,2,\$2
689
 
                sll \$0,3,\$0
690
 
                addl \$1,\$0,\$0
691
 
                addl \$2,\$0,\$0
692
 
                ret \$31,(\$26),1
693
 
                .end main
 
783
                cat <<EOF >$dummy.s
 
784
                        .data
 
785
                \$Lformat:
 
786
                        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
 
787
 
 
788
                        .text
 
789
                        .globl main
 
790
                        .align 4
 
791
                        .ent main
 
792
                main:
 
793
                        .frame \$30,16,\$26,0
 
794
                        ldgp \$29,0(\$27)
 
795
                        .prologue 1
 
796
                        .long 0x47e03d80 # implver \$0
 
797
                        lda \$2,-1
 
798
                        .long 0x47e20c21 # amask \$2,\$1
 
799
                        lda \$16,\$Lformat
 
800
                        mov \$0,\$17
 
801
                        not \$1,\$18
 
802
                        jsr \$26,printf
 
803
                        ldgp \$29,0(\$26)
 
804
                        mov 0,\$16
 
805
                        jsr \$26,exit
 
806
                        .end main
694
807
EOF
695
808
                LIBC=""
696
809
                $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
697
810
                if test "$?" = 0 ; then
698
 
                        ./$dummy
699
 
                        case "$?" in
700
 
                        7)
 
811
                        case `./$dummy` in
 
812
                        0-0)
701
813
                                UNAME_MACHINE="alpha"
702
814
                                ;;
703
 
                        15)
 
815
                        1-0)
704
816
                                UNAME_MACHINE="alphaev5"
705
817
                                ;;
706
 
                        14)
 
818
                        1-1)
707
819
                                UNAME_MACHINE="alphaev56"
708
820
                                ;;
709
 
                        10)
 
821
                        1-101)
710
822
                                UNAME_MACHINE="alphapca56"
711
823
                                ;;
712
 
                        16)
 
824
                        2-303)
713
825
                                UNAME_MACHINE="alphaev6"
714
826
                                ;;
 
827
                        2-307)
 
828
                                UNAME_MACHINE="alphaev67"
 
829
                                ;;
715
830
                        esac
716
831
 
717
832
                        objdump --private-headers $dummy | \
725
840
        elif test "${UNAME_MACHINE}" = "mips" ; then
726
841
          cat >$dummy.c <<EOF
727
842
#ifdef __cplusplus
 
843
#include <stdio.h>  /* for printf() prototype */
728
844
        int main (int argc, char *argv[]) {
729
845
#else
730
846
        int main (argc, argv) int argc; char *argv[]; {
740
856
EOF
741
857
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
742
858
          rm -f $dummy.c $dummy
 
859
        elif test "${UNAME_MACHINE}" = "s390"; then
 
860
          echo s390-ibm-linux && exit 0
 
861
        elif test "${UNAME_MACHINE}" = "x86_64"; then
 
862
          echo x86_64-unknown-linux-gnu && exit 0
 
863
        elif test "${UNAME_MACHINE}" = "parisc" -o "${UNAME_MACHINE}" = "hppa"; then
 
864
          # Look for CPU level
 
865
          case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
 
866
            PA7*)
 
867
                echo hppa1.1-unknown-linux-gnu
 
868
                ;;
 
869
            PA8*)
 
870
                echo hppa2.0-unknown-linux-gnu
 
871
                ;;
 
872
            *)
 
873
                echo hppa-unknown-linux-gnu
 
874
                ;;
 
875
          esac
 
876
          exit 0;
743
877
        else
744
878
          # Either a pre-BFD a.out linker (linux-gnuoldld)
745
879
          # or one that does not give us useful --help.
761
895
          cat >$dummy.c <<EOF
762
896
#include <features.h>
763
897
#ifdef __cplusplus
 
898
#include <stdio.h>  /* for printf() prototype */
764
899
        int main (int argc, char *argv[]) {
765
900
#else
766
901
        int main (argc, argv) int argc; char *argv[]; {
783
918
EOF
784
919
          $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
785
920
          rm -f $dummy.c $dummy
 
921
          test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
786
922
        fi ;;
787
923
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
788
924
# are messed up and put the nodename in both sysname and nodename.
798
934
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
799
935
        exit 0 ;;
800
936
    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
 
937
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
801
938
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
802
 
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
 
939
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
803
940
        else
804
 
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
 
941
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
805
942
        fi
806
943
        exit 0 ;;
807
944
    i?86:*:5:7*)
808
 
        UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
809
 
        (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
810
 
        (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) && UNAME_MACHINE=i586
811
 
        (/bin/uname -X|egrep '^Machine.*Pent.*II' >/dev/null) && UNAME_MACHINE=i686
812
 
        (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) && UNAME_MACHINE=i585
813
 
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE}
 
945
        # Fixed at (any) Pentium or better
 
946
        UNAME_MACHINE=i586
 
947
        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
 
948
            echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
 
949
        else
 
950
            echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
 
951
        fi
814
952
        exit 0 ;;
815
953
    i?86:*:3.2:*)
816
954
        if test -f /usr/options/cb.name; then
830
968
                echo ${UNAME_MACHINE}-pc-sysv32
831
969
        fi
832
970
        exit 0 ;;
 
971
    i?86:*DOS:*:*)
 
972
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
973
        exit 0 ;;
833
974
    pc:*:*:*)
 
975
        # Left here for compatibility:
834
976
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
835
977
        # the processor, so we play safe by assuming i386.
836
978
        echo i386-pc-msdosdjgpp
913
1055
    mc68*:A/UX:*:*)
914
1056
        echo m68k-apple-aux${UNAME_RELEASE}
915
1057
        exit 0 ;;
916
 
    news*:NEWS-OS:*:6*)
 
1058
    news*:NEWS-OS:6*:*)
917
1059
        echo mips-sony-newsos6
918
1060
        exit 0 ;;
919
1061
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
944
1086
    *:Rhapsody:*:*)
945
1087
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
946
1088
        exit 0 ;;
 
1089
    *:Darwin:*:*)
 
1090
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1091
        exit 0 ;;
 
1092
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
 
1093
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1094
                UNAME_MACHINE=pc
 
1095
        fi
 
1096
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
 
1097
        exit 0 ;;
 
1098
    *:QNX:*:4*)
 
1099
        echo i386-pc-qnx
 
1100
        exit 0 ;;
 
1101
    NSR-[KW]:NONSTOP_KERNEL:*:*)
 
1102
        echo nsr-tandem-nsk${UNAME_RELEASE}
 
1103
        exit 0 ;;
 
1104
    BS2000:POSIX*:*:*)
 
1105
        echo bs2000-siemens-sysv
 
1106
        exit 0 ;;
 
1107
    DS/*:UNIX_System_V:*:*)
 
1108
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
 
1109
        exit 0 ;;
 
1110
    *:Plan9:*:*)
 
1111
        # "uname -m" is not consistent, so use $cputype instead. 386
 
1112
        # is converted to i386 for consistency with other x86
 
1113
        # operating systems.
 
1114
        if test "$cputype" = "386"; then
 
1115
            UNAME_MACHINE=i386
 
1116
        else
 
1117
            UNAME_MACHINE="$cputype"
 
1118
        fi
 
1119
        echo ${UNAME_MACHINE}-unknown-plan9
 
1120
        exit 0 ;;
947
1121
esac
948
1122
 
949
1123
#echo '(No uname command or uname output not recognized.)' 1>&2
1083
1257
    esac
1084
1258
fi
1085
1259
 
1086
 
#echo '(Unable to guess system type)' 1>&2
 
1260
cat >&2 <<EOF
 
1261
$0: unable to guess system type
 
1262
 
 
1263
The $version version of this script cannot recognize your system type.
 
1264
Please download the most up to date version of the config scripts:
 
1265
 
 
1266
    ftp://ftp.gnu.org/pub/gnu/config/
 
1267
 
 
1268
If the version you run ($0) is already up to date, please
 
1269
send the following data and any information you think might be
 
1270
pertinent to <config-patches@gnu.org> in order to provide the needed
 
1271
information to handle your system.
 
1272
 
 
1273
config.guess version = $version
 
1274
 
 
1275
uname -m = `(uname -m) 2>/dev/null || echo unknown`
 
1276
uname -r = `(uname -r) 2>/dev/null || echo unknown`
 
1277
uname -s = `(uname -s) 2>/dev/null || echo unknown`
 
1278
uname -v = `(uname -v) 2>/dev/null || echo unknown`
 
1279
 
 
1280
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
 
1281
/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
 
1282
 
 
1283
hostinfo               = `(hostinfo) 2>/dev/null`
 
1284
/bin/universe          = `(/bin/universe) 2>/dev/null`
 
1285
/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
 
1286
/bin/arch              = `(/bin/arch) 2>/dev/null`
 
1287
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
 
1288
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
 
1289
 
 
1290
UNAME_MACHINE = ${UNAME_MACHINE}
 
1291
UNAME_RELEASE = ${UNAME_RELEASE}
 
1292
UNAME_SYSTEM  = ${UNAME_SYSTEM}
 
1293
UNAME_VERSION = ${UNAME_VERSION}
 
1294
EOF
1087
1295
 
1088
1296
exit 1
 
1297
 
 
1298
# Local variables:
 
1299
# eval: (add-hook 'write-file-hooks 'time-stamp)
 
1300
# time-stamp-start: "version='"
 
1301
# time-stamp-format: "%:y-%02m-%02d"
 
1302
# time-stamp-end: "'"
 
1303
# End: