~ubuntu-branches/debian/sid/vorbis-tools/sid

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Jesus Climent
  • Date: 2005-04-10 09:22:24 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050410092224-xtukpa3qghghhjje
Tags: 1.0.1-1.3
* Authorized NMU.
* Modified alsa to mention alsa09 (although the device might be nowadays
  alsa, back, since alsa1.0 has been already released). (Closes: #258286)
* Modified the manpage/help message for vorbiscomment to make it a bit more
  userfiendly: Closes: #252531.
* Added oggdec to the long description field, so that it triggers apt-cache
  searches: Closes: #274894.
* Typos in manpages: Closes: #302150.
* Escaped dashes in manpage: Closes: #264365.
* Quiet option is actually with -Q, not -q (Closes: #211289) Reported
  upstream but patched for Debian.
* Change input.wav with inputfile, since we accept flac-formated files:
  Closes: #262509.
* Translation bits:
  * Updated translation hu.po: Closes: #272037.
  * French translation correction: Encodage -> Codage (Closes: #248431).
  * debian/rules: remove .gmo's to avoid clash with uploaded tarball.

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, 2001
4
 
#   Free Software Foundation, Inc.
 
3
#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 
4
#   2000, 2001, 2002, 2003 Free Software Foundation, Inc.
5
5
 
6
 
timestamp='2001-11-08'
 
6
timestamp='2003-10-07'
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
 
# Originally written by Per Bothner <bothner@cygnus.com>.
 
27
# Originally written by Per Bothner <per@bothner.com>.
28
28
# Please send patches to <config-patches@gnu.org>.  Submit a context
29
29
# diff and a properly formatted ChangeLog entry.
30
30
#
88
88
  exit 1
89
89
fi
90
90
 
91
 
 
92
 
dummy=dummy-$$
93
 
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
94
 
 
95
 
# CC_FOR_BUILD -- compiler used by this script.
 
91
trap 'exit 1' 1 2 15
 
92
 
 
93
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 
94
# compiler to aid in system detection is discouraged as it requires
 
95
# temporary files to be created and, as you can see below, it is a
 
96
# headache to deal with in a portable fashion.
 
97
 
96
98
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
97
99
# use `HOST_CC' if defined, but it is deprecated.
98
100
 
99
 
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
100
 
 ,,)    echo "int dummy(){}" > $dummy.c ;
101
 
        for c in cc gcc c89 ; do
102
 
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
103
 
          if test $? = 0 ; then
 
101
# Portable tmp directory creation inspired by the Autoconf team.
 
102
 
 
103
set_cc_for_build='
 
104
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
 
105
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
 
106
: ${TMPDIR=/tmp} ;
 
107
 { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
 
108
 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
 
109
 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
 
110
 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
 
111
dummy=$tmp/dummy ;
 
112
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
 
113
case $CC_FOR_BUILD,$HOST_CC,$CC in
 
114
 ,,)    echo "int x;" > $dummy.c ;
 
115
        for c in cc gcc c89 c99 ; do
 
116
          if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
104
117
             CC_FOR_BUILD="$c"; break ;
105
118
          fi ;
106
119
        done ;
107
 
        rm -f $dummy.c $dummy.o $dummy.rel ;
108
120
        if test x"$CC_FOR_BUILD" = x ; then
109
121
          CC_FOR_BUILD=no_compiler_found ;
110
122
        fi
111
123
        ;;
112
124
 ,,*)   CC_FOR_BUILD=$CC ;;
113
125
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
114
 
esac'
 
126
esac ;'
115
127
 
116
128
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
117
129
# (ghazi@noc.rutgers.edu 1994-08-24)
135
147
        # object file format.  This provides both forward
136
148
        # compatibility and a consistent mechanism for selecting the
137
149
        # object file format.
138
 
        # Determine the machine/vendor (is the vendor relevant).
139
 
        case "${UNAME_MACHINE}" in
140
 
            amiga) machine=m68k-unknown ;;
141
 
            arm32) machine=arm-unknown ;;
142
 
            atari*) machine=m68k-atari ;;
143
 
            sun3*) machine=m68k-sun ;;
144
 
            mac68k) machine=m68k-apple ;;
145
 
            macppc) machine=powerpc-apple ;;
146
 
            hp3[0-9][05]) machine=m68k-hp ;;
147
 
            ibmrt|romp-ibm) machine=romp-ibm ;;
148
 
            sparc*) machine=`uname -p`-unknown ;;
149
 
            *) machine=${UNAME_MACHINE}-unknown ;;
 
150
        #
 
151
        # Note: NetBSD doesn't particularly care about the vendor
 
152
        # portion of the name.  We always set it to "unknown".
 
153
        sysctl="sysctl -n hw.machine_arch"
 
154
        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
 
155
            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
 
156
        case "${UNAME_MACHINE_ARCH}" in
 
157
            armeb) machine=armeb-unknown ;;
 
158
            arm*) machine=arm-unknown ;;
 
159
            sh3el) machine=shl-unknown ;;
 
160
            sh3eb) machine=sh-unknown ;;
 
161
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
150
162
        esac
151
163
        # The Operating System including object format, if it has switched
152
164
        # to ELF recently, or will in the future.
153
 
        case "${UNAME_MACHINE}" in
154
 
            i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
 
165
        case "${UNAME_MACHINE_ARCH}" in
 
166
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
155
167
                eval $set_cc_for_build
156
168
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
157
169
                        | grep __ELF__ >/dev/null
168
180
                ;;
169
181
        esac
170
182
        # The OS release
171
 
        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
172
195
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
173
196
        # contains redundant information, the shorter form:
174
197
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
217
240
        if test $UNAME_RELEASE = "V4.0"; then
218
241
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
219
242
        fi
 
243
        # According to Compaq, /usr/sbin/psrinfo has been available on
 
244
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
 
245
        # covers most systems running today.  This code pipes the CPU
 
246
        # types through head -n 1, so we only detect the type of CPU 0.
 
247
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 
248
        case "$ALPHA_CPU_TYPE" in
 
249
            "EV4 (21064)")
 
250
                UNAME_MACHINE="alpha" ;;
 
251
            "EV4.5 (21064)")
 
252
                UNAME_MACHINE="alpha" ;;
 
253
            "LCA4 (21066/21068)")
 
254
                UNAME_MACHINE="alpha" ;;
 
255
            "EV5 (21164)")
 
256
                UNAME_MACHINE="alphaev5" ;;
 
257
            "EV5.6 (21164A)")
 
258
                UNAME_MACHINE="alphaev56" ;;
 
259
            "EV5.6 (21164PC)")
 
260
                UNAME_MACHINE="alphapca56" ;;
 
261
            "EV5.7 (21164PC)")
 
262
                UNAME_MACHINE="alphapca57" ;;
 
263
            "EV6 (21264)")
 
264
                UNAME_MACHINE="alphaev6" ;;
 
265
            "EV6.7 (21264A)")
 
266
                UNAME_MACHINE="alphaev67" ;;
 
267
            "EV6.8CB (21264C)")
 
268
                UNAME_MACHINE="alphaev68" ;;
 
269
            "EV6.8AL (21264B)")
 
270
                UNAME_MACHINE="alphaev68" ;;
 
271
            "EV6.8CX (21264D)")
 
272
                UNAME_MACHINE="alphaev68" ;;
 
273
            "EV6.9A (21264/EV69A)")
 
274
                UNAME_MACHINE="alphaev69" ;;
 
275
            "EV7 (21364)")
 
276
                UNAME_MACHINE="alphaev7" ;;
 
277
            "EV7.9 (21364A)")
 
278
                UNAME_MACHINE="alphaev79" ;;
 
279
        esac
220
280
        # A Vn.n version is a released version.
221
281
        # A Tn.n version is a released field test version.
222
282
        # A Xn.n version is an unreleased experimental baselevel.
223
283
        # 1.2 uses "1.2" for uname -r.
224
 
        cat <<EOF >$dummy.s
225
 
        .data
226
 
\$Lformat:
227
 
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
228
 
 
229
 
        .text
230
 
        .globl main
231
 
        .align 4
232
 
        .ent main
233
 
main:
234
 
        .frame \$30,16,\$26,0
235
 
        ldgp \$29,0(\$27)
236
 
        .prologue 1
237
 
        .long 0x47e03d80 # implver \$0
238
 
        lda \$2,-1
239
 
        .long 0x47e20c21 # amask \$2,\$1
240
 
        lda \$16,\$Lformat
241
 
        mov \$0,\$17
242
 
        not \$1,\$18
243
 
        jsr \$26,printf
244
 
        ldgp \$29,0(\$26)
245
 
        mov 0,\$16
246
 
        jsr \$26,exit
247
 
        .end main
248
 
EOF
249
 
        eval $set_cc_for_build
250
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
251
 
        if test "$?" = 0 ; then
252
 
                case `./$dummy` in
253
 
                        0-0)
254
 
                                UNAME_MACHINE="alpha"
255
 
                                ;;
256
 
                        1-0)
257
 
                                UNAME_MACHINE="alphaev5"
258
 
                                ;;
259
 
                        1-1)
260
 
                                UNAME_MACHINE="alphaev56"
261
 
                                ;;
262
 
                        1-101)
263
 
                                UNAME_MACHINE="alphapca56"
264
 
                                ;;
265
 
                        2-303)
266
 
                                UNAME_MACHINE="alphaev6"
267
 
                                ;;
268
 
                        2-307)
269
 
                                UNAME_MACHINE="alphaev67"
270
 
                                ;;
271
 
                        2-1307)
272
 
                                UNAME_MACHINE="alphaev68"
273
 
                                ;;
274
 
                esac
275
 
        fi
276
 
        rm -f $dummy.s $dummy
277
284
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
278
285
        exit 0 ;;
 
286
    Alpha*:OpenVMS:*:*)
 
287
        echo alpha-hp-vms
 
288
        exit 0 ;;
279
289
    Alpha\ *:Windows_NT*:*)
280
290
        # How do we know it's Interix rather than the generic POSIX subsystem?
281
291
        # Should we change UNAME_MACHINE based on the output of uname instead
291
301
    *:[Aa]miga[Oo][Ss]:*:*)
292
302
        echo ${UNAME_MACHINE}-unknown-amigaos
293
303
        exit 0 ;;
 
304
    *:[Mm]orph[Oo][Ss]:*:*)
 
305
        echo ${UNAME_MACHINE}-unknown-morphos
 
306
        exit 0 ;;
294
307
    *:OS/390:*:*)
295
308
        echo i370-ibm-openedition
296
309
        exit 0 ;;
311
324
    NILE*:*:*:dcosx)
312
325
        echo pyramid-pyramid-svr4
313
326
        exit 0 ;;
 
327
    DRS?6000:unix:4.0:6*)
 
328
        echo sparc-icl-nx6
 
329
        exit 0 ;;
 
330
    DRS?6000:UNIX_SV:4.2*:7*)
 
331
        case `/usr/bin/uname -p` in
 
332
            sparc) echo sparc-icl-nx7 && exit 0 ;;
 
333
        esac ;;
314
334
    sun4H:SunOS:5.*:*)
315
335
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
316
336
        exit 0 ;;
339
359
        echo m68k-sun-sunos${UNAME_RELEASE}
340
360
        exit 0 ;;
341
361
    sun*:*:4.2BSD:*)
342
 
        UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 
362
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
343
363
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
344
364
        case "`/bin/arch`" in
345
365
            sun3)
417
437
          exit (-1);
418
438
        }
419
439
EOF
420
 
        $CC_FOR_BUILD $dummy.c -o $dummy \
421
 
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
422
 
          && rm -f $dummy.c $dummy && exit 0
423
 
        rm -f $dummy.c $dummy
 
440
        $CC_FOR_BUILD -o $dummy $dummy.c \
 
441
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 
442
          && exit 0
424
443
        echo mips-mips-riscos${UNAME_RELEASE}
425
444
        exit 0 ;;
426
445
    Motorola:PowerMAX_OS:*:*)
427
446
        echo powerpc-motorola-powermax
428
447
        exit 0 ;;
 
448
    Motorola:*:4.3:PL8-*)
 
449
        echo powerpc-harris-powermax
 
450
        exit 0 ;;
 
451
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 
452
        echo powerpc-harris-powermax
 
453
        exit 0 ;;
429
454
    Night_Hawk:Power_UNIX:*:*)
430
455
        echo powerpc-harris-powerunix
431
456
        exit 0 ;;
498
523
                        exit(0);
499
524
                        }
500
525
EOF
501
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
502
 
                rm -f $dummy.c $dummy
 
526
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
503
527
                echo rs6000-ibm-aix3.2.5
504
528
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
505
529
                echo rs6000-ibm-aix3.2.4
508
532
        fi
509
533
        exit 0 ;;
510
534
    *:AIX:*:[45])
511
 
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
 
535
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
512
536
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
513
537
                IBM_ARCH=rs6000
514
538
        else
597
621
                  exit (0);
598
622
              }
599
623
EOF
600
 
                    (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
601
 
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
602
 
                    rm -f $dummy.c $dummy
 
624
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
625
                    test -z "$HP_ARCH" && HP_ARCH=hppa
603
626
                fi ;;
604
627
        esac
 
628
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
629
        then
 
630
            # avoid double evaluation of $set_cc_for_build
 
631
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
632
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 
633
            then
 
634
                HP_ARCH="hppa2.0w"
 
635
            else
 
636
                HP_ARCH="hppa64"
 
637
            fi
 
638
        fi
605
639
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
606
640
        exit 0 ;;
607
641
    ia64:HP-UX:*:*)
635
669
          exit (0);
636
670
        }
637
671
EOF
638
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
639
 
        rm -f $dummy.c $dummy
 
672
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
640
673
        echo unknown-hitachi-hiuxwe2
641
674
        exit 0 ;;
642
675
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
682
715
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
683
716
        echo c4-convex-bsd
684
717
        exit 0 ;;
685
 
    CRAY*X-MP:*:*:*)
686
 
        echo xmp-cray-unicos
687
 
        exit 0 ;;
688
718
    CRAY*Y-MP:*:*:*)
689
719
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
690
720
        exit 0 ;;
697
727
    CRAY*TS:*:*:*)
698
728
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
699
729
        exit 0 ;;
700
 
    CRAY*T3D:*:*:*)
701
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
702
 
        exit 0 ;;
703
730
    CRAY*T3E:*:*:*)
704
731
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
705
732
        exit 0 ;;
706
733
    CRAY*SV1:*:*:*)
707
734
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
708
735
        exit 0 ;;
709
 
    CRAY-2:*:*:*)
710
 
        echo cray2-cray-unicos
711
 
        exit 0 ;;
 
736
    *:UNICOS/mp:*:*)
 
737
        echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
738
        exit 0 ;;
712
739
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
713
740
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
714
741
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
725
752
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
726
753
        exit 0 ;;
727
754
    *:FreeBSD:*:*)
728
 
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
755
        # Determine whether the default compiler uses glibc.
 
756
        eval $set_cc_for_build
 
757
        sed 's/^        //' << EOF >$dummy.c
 
758
        #include <features.h>
 
759
        #if __GLIBC__ >= 2
 
760
        LIBC=gnu
 
761
        #else
 
762
        LIBC=
 
763
        #endif
 
764
EOF
 
765
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
766
        # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
 
767
        # FreeBSD's kernel, but not the complete OS.
 
768
        case ${LIBC} in gnu) kernel_only='k' ;; esac
 
769
        echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
729
770
        exit 0 ;;
730
771
    i*:CYGWIN*:*)
731
772
        echo ${UNAME_MACHINE}-pc-cygwin
736
777
    i*:PW*:*)
737
778
        echo ${UNAME_MACHINE}-pc-pw32
738
779
        exit 0 ;;
 
780
    x86:Interix*:[34]*)
 
781
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
782
        exit 0 ;;
 
783
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
784
        echo i${UNAME_MACHINE}-pc-mks
 
785
        exit 0 ;;
739
786
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
740
787
        # How do we know it's Interix rather than the generic POSIX subsystem?
741
788
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
742
789
        # UNAME_MACHINE based on the output of uname instead of i386?
743
 
        echo i386-pc-interix
 
790
        echo i586-pc-interix
744
791
        exit 0 ;;
745
792
    i*:UWIN*:*)
746
793
        echo ${UNAME_MACHINE}-pc-uwin
752
799
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
753
800
        exit 0 ;;
754
801
    *:GNU:*:*)
 
802
        # the GNU system
755
803
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
756
804
        exit 0 ;;
 
805
    *:GNU/*:*:*)
 
806
        # other systems with GNU libc and userland
 
807
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
808
        exit 0 ;;
757
809
    i*86:Minix:*:*)
758
810
        echo ${UNAME_MACHINE}-pc-minix
759
811
        exit 0 ;;
760
812
    arm*:Linux:*:*)
761
813
        echo ${UNAME_MACHINE}-unknown-linux-gnu
762
814
        exit 0 ;;
 
815
    cris:Linux:*:*)
 
816
        echo cris-axis-linux-gnu
 
817
        exit 0 ;;
763
818
    ia64:Linux:*:*)
764
 
        echo ${UNAME_MACHINE}-unknown-linux
 
819
        echo ${UNAME_MACHINE}-unknown-linux-gnu
765
820
        exit 0 ;;
766
821
    m68*:Linux:*:*)
767
822
        echo ${UNAME_MACHINE}-unknown-linux-gnu
768
823
        exit 0 ;;
769
824
    mips:Linux:*:*)
770
 
        case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
771
 
          big)    echo mips-unknown-linux-gnu && exit 0 ;;
772
 
          little) echo mipsel-unknown-linux-gnu && exit 0 ;;
773
 
        esac
 
825
        eval $set_cc_for_build
 
826
        sed 's/^        //' << EOF >$dummy.c
 
827
        #undef CPU
 
828
        #undef mips
 
829
        #undef mipsel
 
830
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
831
        CPU=mipsel
 
832
        #else
 
833
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
834
        CPU=mips
 
835
        #else
 
836
        CPU=
 
837
        #endif
 
838
        #endif
 
839
EOF
 
840
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
841
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
842
        ;;
 
843
    mips64:Linux:*:*)
 
844
        eval $set_cc_for_build
 
845
        sed 's/^        //' << EOF >$dummy.c
 
846
        #undef CPU
 
847
        #undef mips64
 
848
        #undef mips64el
 
849
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
850
        CPU=mips64el
 
851
        #else
 
852
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
853
        CPU=mips64
 
854
        #else
 
855
        CPU=
 
856
        #endif
 
857
        #endif
 
858
EOF
 
859
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
860
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
774
861
        ;;
775
862
    ppc:Linux:*:*)
776
863
        echo powerpc-unknown-linux-gnu
806
893
    s390:Linux:*:* | s390x:Linux:*:*)
807
894
        echo ${UNAME_MACHINE}-ibm-linux
808
895
        exit 0 ;;
 
896
    sh64*:Linux:*:*)
 
897
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
898
        exit 0 ;;
809
899
    sh*:Linux:*:*)
810
900
        echo ${UNAME_MACHINE}-unknown-linux-gnu
811
901
        exit 0 ;;
819
909
        # The BFD linker knows what the default object file format is, so
820
910
        # first see if it will tell us. cd to the root directory to prevent
821
911
        # problems with other programs or directories called `ld' in the path.
822
 
        ld_supported_targets=`cd /; ld --help 2>&1 \
 
912
        # Set LC_ALL=C to ensure ld outputs messages in English.
 
913
        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
823
914
                         | sed -ne '/supported targets:/!d
824
915
                                    s/[         ][      ]*/ /g
825
916
                                    s/.*supported targets: *//
831
922
                ;;
832
923
          a.out-i386-linux)
833
924
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
834
 
                exit 0 ;;               
 
925
                exit 0 ;;
835
926
          coff-i386)
836
927
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
837
928
                exit 0 ;;
843
934
        esac
844
935
        # Determine whether the default compiler is a.out or elf
845
936
        eval $set_cc_for_build
846
 
        cat >$dummy.c <<EOF
847
 
#include <features.h>
848
 
#ifdef __cplusplus
849
 
#include <stdio.h>  /* for printf() prototype */
850
 
        int main (int argc, char *argv[]) {
851
 
#else
852
 
        int main (argc, argv) int argc; char *argv[]; {
853
 
#endif
854
 
#ifdef __ELF__
855
 
# ifdef __GLIBC__
856
 
#  if __GLIBC__ >= 2
857
 
    printf ("%s-pc-linux-gnu\n", argv[1]);
858
 
#  else
859
 
    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
860
 
#  endif
861
 
# else
862
 
   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
863
 
# endif
864
 
#else
865
 
  printf ("%s-pc-linux-gnuaout\n", argv[1]);
866
 
#endif
867
 
  return 0;
868
 
}
 
937
        sed 's/^        //' << EOF >$dummy.c
 
938
        #include <features.h>
 
939
        #ifdef __ELF__
 
940
        # ifdef __GLIBC__
 
941
        #  if __GLIBC__ >= 2
 
942
        LIBC=gnu
 
943
        #  else
 
944
        LIBC=gnulibc1
 
945
        #  endif
 
946
        # else
 
947
        LIBC=gnulibc1
 
948
        # endif
 
949
        #else
 
950
        #ifdef __INTEL_COMPILER
 
951
        LIBC=gnu
 
952
        #else
 
953
        LIBC=gnuaout
 
954
        #endif
 
955
        #endif
 
956
        #ifdef __dietlibc__
 
957
        LIBC=dietlibc
 
958
        #endif
869
959
EOF
870
 
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
871
 
        rm -f $dummy.c $dummy
 
960
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
961
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
872
962
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
873
963
        ;;
874
964
    i*86:DYNIX/ptx:4*:*)
885
975
        # Use sysv4.2uw... so that sysv4* matches it.
886
976
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
887
977
        exit 0 ;;
 
978
    i*86:OS/2:*:*)
 
979
        # If we were able to find `uname', then EMX Unix compatibility
 
980
        # is probably installed.
 
981
        echo ${UNAME_MACHINE}-pc-os2-emx
 
982
        exit 0 ;;
 
983
    i*86:XTS-300:*:STOP)
 
984
        echo ${UNAME_MACHINE}-unknown-stop
 
985
        exit 0 ;;
 
986
    i*86:atheos:*:*)
 
987
        echo ${UNAME_MACHINE}-unknown-atheos
 
988
        exit 0 ;;
 
989
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
990
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
991
        exit 0 ;;
 
992
    i*86:*DOS:*:*)
 
993
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
994
        exit 0 ;;
888
995
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
889
996
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
890
997
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
906
1013
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
907
1014
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
908
1015
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
909
 
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
910
 
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
911
 
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 
1016
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 
1017
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 
1018
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
912
1019
                        && UNAME_MACHINE=i586
913
 
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 
1020
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
914
1021
                        && UNAME_MACHINE=i686
915
 
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
 
1022
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
916
1023
                        && UNAME_MACHINE=i686
917
1024
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
918
1025
        else
919
1026
                echo ${UNAME_MACHINE}-pc-sysv32
920
1027
        fi
921
1028
        exit 0 ;;
922
 
    i*86:*DOS:*:*)
923
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
924
 
        exit 0 ;;
925
1029
    pc:*:*:*)
926
1030
        # Left here for compatibility:
927
1031
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
945
1049
        # "miniframe"
946
1050
        echo m68010-convergent-sysv
947
1051
        exit 0 ;;
 
1052
    mc68k:UNIX:SYSTEM5:3.51m)
 
1053
        echo m68k-convergent-sysv
 
1054
        exit 0 ;;
 
1055
    M680?0:D-NIX:5.3:*)
 
1056
        echo m68k-diab-dnix
 
1057
        exit 0 ;;
948
1058
    M68*:*:R3V[567]*:*)
949
1059
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
950
 
    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)
 
1060
    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
951
1061
        OS_REL=''
952
1062
        test -r /etc/.relid \
953
1063
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
964
1074
    mc68030:UNIX_System_V:4.*:*)
965
1075
        echo m68k-atari-sysv4
966
1076
        exit 0 ;;
967
 
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
968
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
969
 
        exit 0 ;;
970
1077
    TSUNAMI:LynxOS:2.*:*)
971
1078
        echo sparc-unknown-lynxos${UNAME_RELEASE}
972
1079
        exit 0 ;;
1038
1145
    SX-5:SUPER-UX:*:*)
1039
1146
        echo sx5-nec-superux${UNAME_RELEASE}
1040
1147
        exit 0 ;;
 
1148
    SX-6:SUPER-UX:*:*)
 
1149
        echo sx6-nec-superux${UNAME_RELEASE}
 
1150
        exit 0 ;;
1041
1151
    Power*:Rhapsody:*:*)
1042
1152
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1043
1153
        exit 0 ;;
1045
1155
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1046
1156
        exit 0 ;;
1047
1157
    *:Darwin:*:*)
1048
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1158
        case `uname -p` in
 
1159
            *86) UNAME_PROCESSOR=i686 ;;
 
1160
            powerpc) UNAME_PROCESSOR=powerpc ;;
 
1161
        esac
 
1162
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1049
1163
        exit 0 ;;
1050
1164
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1051
 
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1165
        UNAME_PROCESSOR=`uname -p`
 
1166
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1167
                UNAME_PROCESSOR=i386
1052
1168
                UNAME_MACHINE=pc
1053
1169
        fi
1054
 
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
 
1170
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1055
1171
        exit 0 ;;
1056
1172
    *:QNX:*:4*)
1057
1173
        echo i386-pc-qnx
1058
1174
        exit 0 ;;
1059
 
    NSR-[KW]:NONSTOP_KERNEL:*:*)
 
1175
    NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
1060
1176
        echo nsr-tandem-nsk${UNAME_RELEASE}
1061
1177
        exit 0 ;;
1062
1178
    *:NonStop-UX:*:*)
1079
1195
        fi
1080
1196
        echo ${UNAME_MACHINE}-unknown-plan9
1081
1197
        exit 0 ;;
1082
 
    i*86:OS/2:*:*)
1083
 
        # If we were able to find `uname', then EMX Unix compatibility
1084
 
        # is probably installed.
1085
 
        echo ${UNAME_MACHINE}-pc-os2-emx
1086
 
        exit 0 ;;
1087
1198
    *:TOPS-10:*:*)
1088
1199
        echo pdp10-unknown-tops10
1089
1200
        exit 0 ;;
1102
1213
    *:ITS:*:*)
1103
1214
        echo pdp10-unknown-its
1104
1215
        exit 0 ;;
1105
 
    i*86:XTS-300:*:STOP)
1106
 
        echo ${UNAME_MACHINE}-unknown-stop
1107
 
        exit 0 ;;
1108
 
    i*86:atheos:*:*)
1109
 
        echo ${UNAME_MACHINE}-unknown-atheos
 
1216
    SEI:*:*:SEIUX)
 
1217
        echo mips-sei-seiux${UNAME_RELEASE}
1110
1218
        exit 0 ;;
1111
1219
esac
1112
1220
 
1228
1336
}
1229
1337
EOF
1230
1338
 
1231
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1232
 
rm -f $dummy.c $dummy
 
1339
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1233
1340
 
1234
1341
# Apollos put the system type in the environment.
1235
1342