~ubuntu-branches/ubuntu/intrepid/gwenview/intrepid

« back to all changes in this revision

Viewing changes to admin/config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Christopher Martin
  • Date: 2005-04-06 11:33:06 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050406113306-7zovl7z0io5bacpd
Tags: 1.2.0-1
* New upstream release.
  + Fixes crashes when using "Back" to navigate. (Closes: #301811)
* Enable KIPI support.
* Add a doc-base file for the handbook.

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, 2004 Free Software Foundation, Inc.
5
5
 
6
 
timestamp='2001-03-30'
 
6
timestamp='2004-06-24'
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
52
53
GNU config.guess ($timestamp)
53
54
 
54
55
Originally written by Per Bothner.
55
 
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000
 
56
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
56
57
Free Software Foundation, Inc.
57
58
 
58
59
This is free software; see the source for copying conditions.  There is NO
87
88
  exit 1
88
89
fi
89
90
 
90
 
 
91
 
dummy=dummy-$$
92
 
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
93
 
 
94
 
# 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
 
95
98
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
96
99
# use `HOST_CC' if defined, but it is deprecated.
97
100
 
 
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" ;
98
113
case $CC_FOR_BUILD,$HOST_CC,$CC in
99
 
 ,,)    echo "int dummy(){}" > $dummy.c
100
 
        for c in cc gcc c89 ; do
101
 
          ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1
102
 
          if test $? = 0 ; then
103
 
             CC_FOR_BUILD="$c"; break
104
 
          fi
105
 
        done
106
 
        rm -f $dummy.c $dummy.o $dummy.rel
 
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
 
117
             CC_FOR_BUILD="$c"; break ;
 
118
          fi ;
 
119
        done ;
107
120
        if test x"$CC_FOR_BUILD" = x ; then
108
 
          CC_FOR_BUILD=no_compiler_found
 
121
          CC_FOR_BUILD=no_compiler_found ;
109
122
        fi
110
123
        ;;
111
124
 ,,*)   CC_FOR_BUILD=$CC ;;
112
125
 ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
113
 
esac
 
126
esac ;'
114
127
 
115
128
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
116
 
# (ghazi@noc.rutgers.edu 8/24/94.)
 
129
# (ghazi@noc.rutgers.edu 1994-08-24)
117
130
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
118
131
        PATH=$PATH:/.attbin ; export PATH
119
132
fi
127
140
 
128
141
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
129
142
    *:NetBSD:*:*)
130
 
        # Netbsd (nbsd) targets should (where applicable) match one or
 
143
        # NetBSD (nbsd) targets should (where applicable) match one or
131
144
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
132
145
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
133
146
        # switched to ELF, *-*-netbsd* would select the old
134
147
        # object file format.  This provides both forward
135
148
        # compatibility and a consistent mechanism for selecting the
136
149
        # object file format.
137
 
        # Determine the machine/vendor (is the vendor relevant).
138
 
        case "${UNAME_MACHINE}" in
139
 
            amiga) machine=m68k-unknown ;;
140
 
            arm32) machine=arm-unknown ;;
141
 
            atari*) machine=m68k-atari ;;
142
 
            sun3*) machine=m68k-sun ;;
143
 
            mac68k) machine=m68k-apple ;;
144
 
            macppc) machine=powerpc-apple ;;
145
 
            hp3[0-9][05]) machine=m68k-hp ;;
146
 
            ibmrt|romp-ibm) machine=romp-ibm ;;
147
 
            *) 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 ;;
148
162
        esac
149
163
        # The Operating System including object format, if it has switched
150
164
        # to ELF recently, or will in the future.
151
 
        case "${UNAME_MACHINE}" in
152
 
            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)
 
167
                eval $set_cc_for_build
153
168
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
154
169
                        | grep __ELF__ >/dev/null
155
170
                then
165
180
                ;;
166
181
        esac
167
182
        # The OS release
168
 
        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
169
195
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
170
196
        # contains redundant information, the shorter form:
171
197
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
172
198
        echo "${machine}-${os}${release}"
173
199
        exit 0 ;;
 
200
    amd64:OpenBSD:*:*)
 
201
        echo x86_64-unknown-openbsd${UNAME_RELEASE}
 
202
        exit 0 ;;
 
203
    amiga:OpenBSD:*:*)
 
204
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
205
        exit 0 ;;
 
206
    arc:OpenBSD:*:*)
 
207
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
208
        exit 0 ;;
 
209
    cats:OpenBSD:*:*)
 
210
        echo arm-unknown-openbsd${UNAME_RELEASE}
 
211
        exit 0 ;;
 
212
    hp300:OpenBSD:*:*)
 
213
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
214
        exit 0 ;;
 
215
    luna88k:OpenBSD:*:*)
 
216
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
217
        exit 0 ;;
 
218
    mac68k:OpenBSD:*:*)
 
219
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
220
        exit 0 ;;
 
221
    macppc:OpenBSD:*:*)
 
222
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
223
        exit 0 ;;
 
224
    mvme68k:OpenBSD:*:*)
 
225
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
226
        exit 0 ;;
 
227
    mvme88k:OpenBSD:*:*)
 
228
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
229
        exit 0 ;;
 
230
    mvmeppc:OpenBSD:*:*)
 
231
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
232
        exit 0 ;;
 
233
    pmax:OpenBSD:*:*)
 
234
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
235
        exit 0 ;;
 
236
    sgi:OpenBSD:*:*)
 
237
        echo mipseb-unknown-openbsd${UNAME_RELEASE}
 
238
        exit 0 ;;
 
239
    sun3:OpenBSD:*:*)
 
240
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
241
        exit 0 ;;
 
242
    wgrisc:OpenBSD:*:*)
 
243
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
244
        exit 0 ;;
 
245
    *:OpenBSD:*:*)
 
246
        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
 
247
        exit 0 ;;
 
248
    *:ekkoBSD:*:*)
 
249
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
 
250
        exit 0 ;;
 
251
    macppc:MirBSD:*:*)
 
252
        echo powerppc-unknown-mirbsd${UNAME_RELEASE}
 
253
        exit 0 ;;
 
254
    *:MirBSD:*:*)
 
255
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
 
256
        exit 0 ;;
174
257
    alpha:OSF1:*:*)
175
 
        if test $UNAME_RELEASE = "V4.0"; then
 
258
        case $UNAME_RELEASE in
 
259
        *4.0)
176
260
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
177
 
        fi
 
261
                ;;
 
262
        *5.*)
 
263
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 
264
                ;;
 
265
        esac
 
266
        # According to Compaq, /usr/sbin/psrinfo has been available on
 
267
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
 
268
        # covers most systems running today.  This code pipes the CPU
 
269
        # types through head -n 1, so we only detect the type of CPU 0.
 
270
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
 
271
        case "$ALPHA_CPU_TYPE" in
 
272
            "EV4 (21064)")
 
273
                UNAME_MACHINE="alpha" ;;
 
274
            "EV4.5 (21064)")
 
275
                UNAME_MACHINE="alpha" ;;
 
276
            "LCA4 (21066/21068)")
 
277
                UNAME_MACHINE="alpha" ;;
 
278
            "EV5 (21164)")
 
279
                UNAME_MACHINE="alphaev5" ;;
 
280
            "EV5.6 (21164A)")
 
281
                UNAME_MACHINE="alphaev56" ;;
 
282
            "EV5.6 (21164PC)")
 
283
                UNAME_MACHINE="alphapca56" ;;
 
284
            "EV5.7 (21164PC)")
 
285
                UNAME_MACHINE="alphapca57" ;;
 
286
            "EV6 (21264)")
 
287
                UNAME_MACHINE="alphaev6" ;;
 
288
            "EV6.7 (21264A)")
 
289
                UNAME_MACHINE="alphaev67" ;;
 
290
            "EV6.8CB (21264C)")
 
291
                UNAME_MACHINE="alphaev68" ;;
 
292
            "EV6.8AL (21264B)")
 
293
                UNAME_MACHINE="alphaev68" ;;
 
294
            "EV6.8CX (21264D)")
 
295
                UNAME_MACHINE="alphaev68" ;;
 
296
            "EV6.9A (21264/EV69A)")
 
297
                UNAME_MACHINE="alphaev69" ;;
 
298
            "EV7 (21364)")
 
299
                UNAME_MACHINE="alphaev7" ;;
 
300
            "EV7.9 (21364A)")
 
301
                UNAME_MACHINE="alphaev79" ;;
 
302
        esac
 
303
        # A Pn.n version is a patched version.
178
304
        # A Vn.n version is a released version.
179
305
        # A Tn.n version is a released field test version.
180
306
        # A Xn.n version is an unreleased experimental baselevel.
181
307
        # 1.2 uses "1.2" for uname -r.
182
 
        cat <<EOF >$dummy.s
183
 
        .data
184
 
\$Lformat:
185
 
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
186
 
 
187
 
        .text
188
 
        .globl main
189
 
        .align 4
190
 
        .ent main
191
 
main:
192
 
        .frame \$30,16,\$26,0
193
 
        ldgp \$29,0(\$27)
194
 
        .prologue 1
195
 
        .long 0x47e03d80 # implver \$0
196
 
        lda \$2,-1
197
 
        .long 0x47e20c21 # amask \$2,\$1
198
 
        lda \$16,\$Lformat
199
 
        mov \$0,\$17
200
 
        not \$1,\$18
201
 
        jsr \$26,printf
202
 
        ldgp \$29,0(\$26)
203
 
        mov 0,\$16
204
 
        jsr \$26,exit
205
 
        .end main
206
 
EOF
207
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
208
 
        if test "$?" = 0 ; then
209
 
                case `./$dummy` in
210
 
                        0-0)
211
 
                                UNAME_MACHINE="alpha"
212
 
                                ;;
213
 
                        1-0)
214
 
                                UNAME_MACHINE="alphaev5"
215
 
                                ;;
216
 
                        1-1)
217
 
                                UNAME_MACHINE="alphaev56"
218
 
                                ;;
219
 
                        1-101)
220
 
                                UNAME_MACHINE="alphapca56"
221
 
                                ;;
222
 
                        2-303)
223
 
                                UNAME_MACHINE="alphaev6"
224
 
                                ;;
225
 
                        2-307)
226
 
                                UNAME_MACHINE="alphaev67"
227
 
                                ;;
228
 
                esac
229
 
        fi
230
 
        rm -f $dummy.s $dummy
231
 
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
 
308
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
232
309
        exit 0 ;;
233
310
    Alpha\ *:Windows_NT*:*)
234
311
        # How do we know it's Interix rather than the generic POSIX subsystem?
242
319
    Amiga*:UNIX_System_V:4.0:*)
243
320
        echo m68k-unknown-sysv4
244
321
        exit 0;;
245
 
    amiga:OpenBSD:*:*)
246
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
247
 
        exit 0 ;;
248
322
    *:[Aa]miga[Oo][Ss]:*:*)
249
323
        echo ${UNAME_MACHINE}-unknown-amigaos
250
324
        exit 0 ;;
251
 
    arc64:OpenBSD:*:*)
252
 
        echo mips64el-unknown-openbsd${UNAME_RELEASE}
253
 
        exit 0 ;;
254
 
    arc:OpenBSD:*:*)
255
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
256
 
        exit 0 ;;
257
 
    hkmips:OpenBSD:*:*)
258
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
259
 
        exit 0 ;;
260
 
    pmax:OpenBSD:*:*)
261
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
262
 
        exit 0 ;;
263
 
    sgi:OpenBSD:*:*)
264
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
265
 
        exit 0 ;;
266
 
    wgrisc:OpenBSD:*:*)
267
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
325
    *:[Mm]orph[Oo][Ss]:*:*)
 
326
        echo ${UNAME_MACHINE}-unknown-morphos
268
327
        exit 0 ;;
269
328
    *:OS/390:*:*)
270
329
        echo i370-ibm-openedition
271
330
        exit 0 ;;
 
331
    *:OS400:*:*)
 
332
        echo powerpc-ibm-os400
 
333
        exit 0 ;;
272
334
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
273
335
        echo arm-acorn-riscix${UNAME_RELEASE}
274
336
        exit 0;;
286
348
    NILE*:*:*:dcosx)
287
349
        echo pyramid-pyramid-svr4
288
350
        exit 0 ;;
 
351
    DRS?6000:unix:4.0:6*)
 
352
        echo sparc-icl-nx6
 
353
        exit 0 ;;
 
354
    DRS?6000:UNIX_SV:4.2*:7*)
 
355
        case `/usr/bin/uname -p` in
 
356
            sparc) echo sparc-icl-nx7 && exit 0 ;;
 
357
        esac ;;
289
358
    sun4H:SunOS:5.*:*)
290
359
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
291
360
        exit 0 ;;
314
383
        echo m68k-sun-sunos${UNAME_RELEASE}
315
384
        exit 0 ;;
316
385
    sun*:*:4.2BSD:*)
317
 
        UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 
386
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
318
387
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
319
388
        case "`/bin/arch`" in
320
389
            sun3)
328
397
    aushp:SunOS:*:*)
329
398
        echo sparc-auspex-sunos${UNAME_RELEASE}
330
399
        exit 0 ;;
331
 
    atari*:OpenBSD:*:*)
332
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
333
 
        exit 0 ;;
334
400
    # The situation for MiNT is a little confusing.  The machine name
335
401
    # can be virtually everything (everything which is not
336
402
    # "atarist" or "atariste" at least should have a processor
357
423
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
358
424
        echo m68k-unknown-mint${UNAME_RELEASE}
359
425
        exit 0 ;;
360
 
    sun3*:OpenBSD:*:*)
361
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
362
 
        exit 0 ;;
363
 
    mac68k:OpenBSD:*:*)
364
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
365
 
        exit 0 ;;
366
 
    mvme68k:OpenBSD:*:*)
367
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
368
 
        exit 0 ;;
369
 
    mvme88k:OpenBSD:*:*)
370
 
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
426
    m68k:machten:*:*)
 
427
        echo m68k-apple-machten${UNAME_RELEASE}
371
428
        exit 0 ;;
372
429
    powerpc:machten:*:*)
373
430
        echo powerpc-apple-machten${UNAME_RELEASE}
385
442
        echo clipper-intergraph-clix${UNAME_RELEASE}
386
443
        exit 0 ;;
387
444
    mips:*:*:UMIPS | mips:*:*:RISCos)
 
445
        eval $set_cc_for_build
388
446
        sed 's/^        //' << EOF >$dummy.c
389
447
#ifdef __cplusplus
390
448
#include <stdio.h>  /* for printf() prototype */
406
464
          exit (-1);
407
465
        }
408
466
EOF
409
 
        $CC_FOR_BUILD $dummy.c -o $dummy \
410
 
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
411
 
          && rm -f $dummy.c $dummy && exit 0
412
 
        rm -f $dummy.c $dummy
 
467
        $CC_FOR_BUILD -o $dummy $dummy.c \
 
468
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 
469
          && exit 0
413
470
        echo mips-mips-riscos${UNAME_RELEASE}
414
471
        exit 0 ;;
 
472
    Motorola:PowerMAX_OS:*:*)
 
473
        echo powerpc-motorola-powermax
 
474
        exit 0 ;;
 
475
    Motorola:*:4.3:PL8-*)
 
476
        echo powerpc-harris-powermax
 
477
        exit 0 ;;
 
478
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 
479
        echo powerpc-harris-powermax
 
480
        exit 0 ;;
415
481
    Night_Hawk:Power_UNIX:*:*)
416
482
        echo powerpc-harris-powerunix
417
483
        exit 0 ;;
459
525
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
460
526
        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
461
527
        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
462
 
    i?86:AIX:*:*)
 
528
    i*86:AIX:*:*)
463
529
        echo i386-ibm-aix
464
530
        exit 0 ;;
465
531
    ia64:AIX:*:*)
472
538
        exit 0 ;;
473
539
    *:AIX:2:3)
474
540
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 
541
                eval $set_cc_for_build
475
542
                sed 's/^                //' << EOF >$dummy.c
476
543
                #include <sys/systemcfg.h>
477
544
 
483
550
                        exit(0);
484
551
                        }
485
552
EOF
486
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
487
 
                rm -f $dummy.c $dummy
 
553
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
488
554
                echo rs6000-ibm-aix3.2.5
489
555
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
490
556
                echo rs6000-ibm-aix3.2.4
493
559
        fi
494
560
        exit 0 ;;
495
561
    *:AIX:*:[45])
496
 
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
 
562
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
497
563
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
498
564
                IBM_ARCH=rs6000
499
565
        else
533
599
            9000/31? )            HP_ARCH=m68000 ;;
534
600
            9000/[34]?? )         HP_ARCH=m68k ;;
535
601
            9000/[678][0-9][0-9])
536
 
              case "${HPUX_REV}" in
537
 
                11.[0-9][0-9])
538
 
                  if [ -x /usr/bin/getconf ]; then
539
 
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 
602
                if [ -x /usr/bin/getconf ]; then
 
603
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
540
604
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
541
605
                    case "${sc_cpu_version}" in
542
606
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
545
609
                        case "${sc_kernel_bits}" in
546
610
                          32) HP_ARCH="hppa2.0n" ;;
547
611
                          64) HP_ARCH="hppa2.0w" ;;
 
612
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
548
613
                        esac ;;
549
614
                    esac
550
 
                  fi ;;
551
 
              esac
552
 
              if [ "${HP_ARCH}" = "" ]; then
553
 
              sed 's/^              //' << EOF >$dummy.c
 
615
                fi
 
616
                if [ "${HP_ARCH}" = "" ]; then
 
617
                    eval $set_cc_for_build
 
618
                    sed 's/^              //' << EOF >$dummy.c
554
619
 
555
620
              #define _HPUX_SOURCE
556
621
              #include <stdlib.h>
583
648
                  exit (0);
584
649
              }
585
650
EOF
586
 
        (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
587
 
        if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
588
 
        rm -f $dummy.c $dummy
589
 
        fi ;;
 
651
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
652
                    test -z "$HP_ARCH" && HP_ARCH=hppa
 
653
                fi ;;
590
654
        esac
 
655
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
656
        then
 
657
            # avoid double evaluation of $set_cc_for_build
 
658
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
659
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 
660
            then
 
661
                HP_ARCH="hppa2.0w"
 
662
            else
 
663
                HP_ARCH="hppa64"
 
664
            fi
 
665
        fi
591
666
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
592
667
        exit 0 ;;
593
668
    ia64:HP-UX:*:*)
595
670
        echo ia64-hp-hpux${HPUX_REV}
596
671
        exit 0 ;;
597
672
    3050*:HI-UX:*:*)
 
673
        eval $set_cc_for_build
598
674
        sed 's/^        //' << EOF >$dummy.c
599
675
        #include <unistd.h>
600
676
        int
620
696
          exit (0);
621
697
        }
622
698
EOF
623
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
624
 
        rm -f $dummy.c $dummy
 
699
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
625
700
        echo unknown-hitachi-hiuxwe2
626
701
        exit 0 ;;
627
702
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
630
705
    9000/8??:4.3bsd:*:*)
631
706
        echo hppa1.0-hp-bsd
632
707
        exit 0 ;;
633
 
    *9??*:MPE/iX:*:*)
 
708
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
634
709
        echo hppa1.0-hp-mpeix
635
710
        exit 0 ;;
636
711
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
639
714
    hp8??:OSF1:*:*)
640
715
        echo hppa1.0-hp-osf
641
716
        exit 0 ;;
642
 
    i?86:OSF1:*:*)
 
717
    i*86:OSF1:*:*)
643
718
        if [ -x /usr/sbin/sysversion ] ; then
644
719
            echo ${UNAME_MACHINE}-unknown-osf1mk
645
720
        else
649
724
    parisc*:Lites*:*:*)
650
725
        echo hppa1.1-hp-lites
651
726
        exit 0 ;;
652
 
    hppa*:OpenBSD:*:*)
653
 
        echo hppa-unknown-openbsd
654
 
        exit 0 ;;
655
727
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
656
728
        echo c1-convex-bsd
657
729
        exit 0 ;;
670
742
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
671
743
        echo c4-convex-bsd
672
744
        exit 0 ;;
673
 
    CRAY*X-MP:*:*:*)
674
 
        echo xmp-cray-unicos
675
 
        exit 0 ;;
676
745
    CRAY*Y-MP:*:*:*)
677
 
        echo ymp-cray-unicos${UNAME_RELEASE}
 
746
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
678
747
        exit 0 ;;
679
748
    CRAY*[A-Z]90:*:*:*)
680
749
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
681
750
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
682
 
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
 
751
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 
752
              -e 's/\.[^.]*$/.X/'
683
753
        exit 0 ;;
684
754
    CRAY*TS:*:*:*)
685
755
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
686
756
        exit 0 ;;
687
 
    CRAY*T3D:*:*:*)
688
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
689
 
        exit 0 ;;
690
757
    CRAY*T3E:*:*:*)
691
758
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
692
759
        exit 0 ;;
693
760
    CRAY*SV1:*:*:*)
694
761
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
695
762
        exit 0 ;;
696
 
    CRAY-2:*:*:*)
697
 
        echo cray2-cray-unicos
698
 
        exit 0 ;;
 
763
    *:UNICOS/mp:*:*)
 
764
        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
765
        exit 0 ;;
699
766
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
700
767
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
701
768
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
702
769
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
703
770
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
704
771
        exit 0 ;;
705
 
    hp300:OpenBSD:*:*)
706
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
772
    5000:UNIX_System_V:4.*:*)
 
773
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
774
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
 
775
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
707
776
        exit 0 ;;
708
 
    i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
 
777
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
709
778
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
710
779
        exit 0 ;;
711
780
    sparc*:BSD/OS:*:*)
717
786
    *:FreeBSD:*:*)
718
787
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
719
788
        exit 0 ;;
720
 
    *:OpenBSD:*:*)
721
 
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
722
 
        exit 0 ;;
723
789
    i*:CYGWIN*:*)
724
790
        echo ${UNAME_MACHINE}-pc-cygwin
725
791
        exit 0 ;;
729
795
    i*:PW*:*)
730
796
        echo ${UNAME_MACHINE}-pc-pw32
731
797
        exit 0 ;;
 
798
    x86:Interix*:[34]*)
 
799
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
800
        exit 0 ;;
 
801
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
802
        echo i${UNAME_MACHINE}-pc-mks
 
803
        exit 0 ;;
732
804
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
733
805
        # How do we know it's Interix rather than the generic POSIX subsystem?
734
806
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
735
807
        # UNAME_MACHINE based on the output of uname instead of i386?
736
 
        echo i386-pc-interix
 
808
        echo i586-pc-interix
737
809
        exit 0 ;;
738
810
    i*:UWIN*:*)
739
811
        echo ${UNAME_MACHINE}-pc-uwin
745
817
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
746
818
        exit 0 ;;
747
819
    *:GNU:*:*)
 
820
        # the GNU system
748
821
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
749
822
        exit 0 ;;
 
823
    *:GNU/*:*:*)
 
824
        # other systems with GNU libc and userland
 
825
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
826
        exit 0 ;;
750
827
    i*86:Minix:*:*)
751
828
        echo ${UNAME_MACHINE}-pc-minix
752
829
        exit 0 ;;
753
830
    arm*:Linux:*:*)
754
831
        echo ${UNAME_MACHINE}-unknown-linux-gnu
755
832
        exit 0 ;;
 
833
    cris:Linux:*:*)
 
834
        echo cris-axis-linux-gnu
 
835
        exit 0 ;;
756
836
    ia64:Linux:*:*)
757
 
        echo ${UNAME_MACHINE}-unknown-linux
 
837
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
838
        exit 0 ;;
 
839
    m32r*:Linux:*:*)
 
840
        echo ${UNAME_MACHINE}-unknown-linux-gnu
758
841
        exit 0 ;;
759
842
    m68*:Linux:*:*)
760
843
        echo ${UNAME_MACHINE}-unknown-linux-gnu
761
844
        exit 0 ;;
762
845
    mips:Linux:*:*)
763
 
        cat >$dummy.c <<EOF
764
 
#ifdef __cplusplus
765
 
#include <stdio.h>  /* for printf() prototype */
766
 
int main (int argc, char *argv[]) {
767
 
#else
768
 
int main (argc, argv) int argc; char *argv[]; {
769
 
#endif
770
 
#ifdef __MIPSEB__
771
 
  printf ("%s-unknown-linux-gnu\n", argv[1]);
772
 
#endif
773
 
#ifdef __MIPSEL__
774
 
  printf ("%sel-unknown-linux-gnu\n", argv[1]);
775
 
#endif
776
 
  return 0;
777
 
}
778
 
EOF
779
 
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
780
 
        rm -f $dummy.c $dummy
 
846
        eval $set_cc_for_build
 
847
        sed 's/^        //' << EOF >$dummy.c
 
848
        #undef CPU
 
849
        #undef mips
 
850
        #undef mipsel
 
851
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
852
        CPU=mipsel
 
853
        #else
 
854
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
855
        CPU=mips
 
856
        #else
 
857
        CPU=
 
858
        #endif
 
859
        #endif
 
860
EOF
 
861
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
862
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
863
        ;;
 
864
    mips64:Linux:*:*)
 
865
        eval $set_cc_for_build
 
866
        sed 's/^        //' << EOF >$dummy.c
 
867
        #undef CPU
 
868
        #undef mips64
 
869
        #undef mips64el
 
870
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
871
        CPU=mips64el
 
872
        #else
 
873
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
874
        CPU=mips64
 
875
        #else
 
876
        CPU=
 
877
        #endif
 
878
        #endif
 
879
EOF
 
880
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
881
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
781
882
        ;;
782
883
    ppc:Linux:*:*)
783
 
        # Determine Lib Version
784
 
        cat >$dummy.c <<EOF
785
 
#include <features.h>
786
 
#if defined(__GLIBC__)
787
 
extern char __libc_version[];
788
 
extern char __libc_release[];
789
 
#endif
790
 
main(argc, argv)
791
 
     int argc;
792
 
     char *argv[];
793
 
{
794
 
#if defined(__GLIBC__)
795
 
  printf("%s %s\n", __libc_version, __libc_release);
796
 
#else
797
 
  printf("unknown\n");
798
 
#endif
799
 
  return 0;
800
 
}
801
 
EOF
802
 
        LIBC=""
803
 
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
804
 
        if test "$?" = 0 ; then
805
 
                ./$dummy | grep 1\.99 > /dev/null
806
 
                if test "$?" = 0 ; then LIBC="libc1" ; fi
807
 
        fi
808
 
        rm -f $dummy.c $dummy
809
 
        echo powerpc-unknown-linux-gnu${LIBC}
 
884
        echo powerpc-unknown-linux-gnu
 
885
        exit 0 ;;
 
886
    ppc64:Linux:*:*)
 
887
        echo powerpc64-unknown-linux-gnu
810
888
        exit 0 ;;
811
889
    alpha:Linux:*:*)
812
 
        cat <<EOF >$dummy.s
813
 
          .data
814
 
          \$Lformat:
815
 
                .byte 37,100,45,37,120,10,0     # "%d-%x\n"
816
 
           .text
817
 
                .globl main
818
 
                .align 4
819
 
                .ent main
820
 
            main:
821
 
                .frame \$30,16,\$26,0
822
 
                ldgp \$29,0(\$27)
823
 
                .prologue 1
824
 
                .long 0x47e03d80 # implver \$0
825
 
                lda \$2,-1
826
 
                .long 0x47e20c21 # amask \$2,\$1
827
 
                lda \$16,\$Lformat
828
 
                mov \$0,\$17
829
 
                not \$1,\$18
830
 
                jsr \$26,printf
831
 
                ldgp \$29,0(\$26)
832
 
                mov 0,\$16
833
 
                jsr \$26,exit
834
 
                .end main
835
 
EOF
836
 
        LIBC=""
837
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
838
 
        if test "$?" = 0 ; then
839
 
                case `./$dummy` in
840
 
                0-0)    UNAME_MACHINE="alpha" ;;
841
 
                1-0)    UNAME_MACHINE="alphaev5" ;;
842
 
                1-1)    UNAME_MACHINE="alphaev56" ;;
843
 
                1-101)  UNAME_MACHINE="alphapca56" ;;
844
 
                2-303)  UNAME_MACHINE="alphaev6" ;;
845
 
                2-307)  UNAME_MACHINE="alphaev67" ;;
846
 
                esac
847
 
                objdump --private-headers $dummy | \
848
 
                  grep ld.so.1 > /dev/null
849
 
                if test "$?" = 0 ; then
850
 
                        LIBC="libc1"
851
 
                fi
852
 
        fi
853
 
        rm -f $dummy.s $dummy
 
890
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
 
891
          EV5)   UNAME_MACHINE=alphaev5 ;;
 
892
          EV56)  UNAME_MACHINE=alphaev56 ;;
 
893
          PCA56) UNAME_MACHINE=alphapca56 ;;
 
894
          PCA57) UNAME_MACHINE=alphapca56 ;;
 
895
          EV6)   UNAME_MACHINE=alphaev6 ;;
 
896
          EV67)  UNAME_MACHINE=alphaev67 ;;
 
897
          EV68*) UNAME_MACHINE=alphaev68 ;;
 
898
        esac
 
899
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
 
900
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
854
901
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
855
902
        exit 0 ;;
856
903
    parisc:Linux:*:* | hppa:Linux:*:*)
867
914
    s390:Linux:*:* | s390x:Linux:*:*)
868
915
        echo ${UNAME_MACHINE}-ibm-linux
869
916
        exit 0 ;;
 
917
    sh64*:Linux:*:*)
 
918
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
919
        exit 0 ;;
870
920
    sh*:Linux:*:*)
871
921
        echo ${UNAME_MACHINE}-unknown-linux-gnu
872
922
        exit 0 ;;
876
926
    x86_64:Linux:*:*)
877
927
        echo x86_64-unknown-linux-gnu
878
928
        exit 0 ;;
879
 
    i?86:Linux:*:*)
 
929
    i*86:Linux:*:*)
880
930
        # The BFD linker knows what the default object file format is, so
881
931
        # first see if it will tell us. cd to the root directory to prevent
882
932
        # problems with other programs or directories called `ld' in the path.
883
 
        ld_supported_emulations=`cd /; ld --help 2>&1 \
884
 
                         | sed -ne '/supported emulations:/!d
 
933
        # Set LC_ALL=C to ensure ld outputs messages in English.
 
934
        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
 
935
                         | sed -ne '/supported targets:/!d
885
936
                                    s/[         ][      ]*/ /g
886
 
                                    s/.*supported emulations: *//
 
937
                                    s/.*supported targets: *//
887
938
                                    s/ .*//
888
939
                                    p'`
889
 
        case "$ld_supported_emulations" in
890
 
          i?86linux)
 
940
        case "$ld_supported_targets" in
 
941
          elf32-i386)
 
942
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
 
943
                ;;
 
944
          a.out-i386-linux)
891
945
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
892
 
                exit 0
893
 
                ;;
894
 
          elf_i?86)
895
 
                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
896
 
                ;;
897
 
          i?86coff)
 
946
                exit 0 ;;
 
947
          coff-i386)
898
948
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
899
 
                exit 0
900
 
                ;;
901
 
        esac
902
 
        # Either a pre-BFD a.out linker (linux-gnuoldld)
903
 
        # or one that does not give us useful --help.
904
 
        # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
905
 
        # If ld does not provide *any* "supported emulations:"
906
 
        # that means it is gnuoldld.
907
 
        test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
908
 
        case "${UNAME_MACHINE}" in
909
 
        i?86)
910
 
          VENDOR=pc;
911
 
          ;;
912
 
        *)
913
 
          VENDOR=unknown;
914
 
          ;;
 
949
                exit 0 ;;
 
950
          "")
 
951
                # Either a pre-BFD a.out linker (linux-gnuoldld) or
 
952
                # one that does not give us useful --help.
 
953
                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
 
954
                exit 0 ;;
915
955
        esac
916
956
        # Determine whether the default compiler is a.out or elf
917
 
        cat >$dummy.c <<EOF
918
 
#include <features.h>
919
 
#ifdef __cplusplus
920
 
#include <stdio.h>  /* for printf() prototype */
921
 
        int main (int argc, char *argv[]) {
922
 
#else
923
 
        int main (argc, argv) int argc; char *argv[]; {
924
 
#endif
925
 
#ifdef __ELF__
926
 
# ifdef __GLIBC__
927
 
#  if __GLIBC__ >= 2
928
 
    printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
929
 
#  else
930
 
    printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
931
 
#  endif
932
 
# else
933
 
   printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
934
 
# endif
935
 
#else
936
 
  printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
937
 
#endif
938
 
  return 0;
939
 
}
 
957
        eval $set_cc_for_build
 
958
        sed 's/^        //' << EOF >$dummy.c
 
959
        #include <features.h>
 
960
        #ifdef __ELF__
 
961
        # ifdef __GLIBC__
 
962
        #  if __GLIBC__ >= 2
 
963
        LIBC=gnu
 
964
        #  else
 
965
        LIBC=gnulibc1
 
966
        #  endif
 
967
        # else
 
968
        LIBC=gnulibc1
 
969
        # endif
 
970
        #else
 
971
        #ifdef __INTEL_COMPILER
 
972
        LIBC=gnu
 
973
        #else
 
974
        LIBC=gnuaout
 
975
        #endif
 
976
        #endif
 
977
        #ifdef __dietlibc__
 
978
        LIBC=dietlibc
 
979
        #endif
940
980
EOF
941
 
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
942
 
        rm -f $dummy.c $dummy
 
981
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
982
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
943
983
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
944
984
        ;;
945
 
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
946
 
# are messed up and put the nodename in both sysname and nodename.
947
 
    i?86:DYNIX/ptx:4*:*)
 
985
    i*86:DYNIX/ptx:4*:*)
 
986
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
 
987
        # earlier versions are messed up and put the nodename in both
 
988
        # sysname and nodename.
948
989
        echo i386-sequent-sysv4
949
990
        exit 0 ;;
950
 
    i?86:UNIX_SV:4.2MP:2.*)
 
991
    i*86:UNIX_SV:4.2MP:2.*)
951
992
        # Unixware is an offshoot of SVR4, but it has its own version
952
993
        # number series starting with 2...
953
994
        # I am not positive that other SVR4 systems won't match this,
955
996
        # Use sysv4.2uw... so that sysv4* matches it.
956
997
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
957
998
        exit 0 ;;
958
 
    i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*)
 
999
    i*86:OS/2:*:*)
 
1000
        # If we were able to find `uname', then EMX Unix compatibility
 
1001
        # is probably installed.
 
1002
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1003
        exit 0 ;;
 
1004
    i*86:XTS-300:*:STOP)
 
1005
        echo ${UNAME_MACHINE}-unknown-stop
 
1006
        exit 0 ;;
 
1007
    i*86:atheos:*:*)
 
1008
        echo ${UNAME_MACHINE}-unknown-atheos
 
1009
        exit 0 ;;
 
1010
        i*86:syllable:*:*)
 
1011
        echo ${UNAME_MACHINE}-pc-syllable
 
1012
        exit 0 ;;
 
1013
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
1014
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
1015
        exit 0 ;;
 
1016
    i*86:*DOS:*:*)
 
1017
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
1018
        exit 0 ;;
 
1019
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
959
1020
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
960
1021
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
961
1022
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
963
1024
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
964
1025
        fi
965
1026
        exit 0 ;;
966
 
    i?86:*:5:7*)
967
 
        # Fixed at (any) Pentium or better
968
 
        UNAME_MACHINE=i586
969
 
        if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then
970
 
            echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION}
971
 
        else
972
 
            echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE}
973
 
        fi
 
1027
    i*86:*:5:[78]*)
 
1028
        case `/bin/uname -X | grep "^Machine"` in
 
1029
            *486*)           UNAME_MACHINE=i486 ;;
 
1030
            *Pentium)        UNAME_MACHINE=i586 ;;
 
1031
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
 
1032
        esac
 
1033
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
974
1034
        exit 0 ;;
975
 
    i?86:*:3.2:*)
 
1035
    i*86:*:3.2:*)
976
1036
        if test -f /usr/options/cb.name; then
977
1037
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
978
1038
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
979
1039
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
980
 
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
981
 
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
982
 
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 
1040
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 
1041
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 
1042
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
983
1043
                        && UNAME_MACHINE=i586
984
 
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 
1044
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
985
1045
                        && UNAME_MACHINE=i686
986
 
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
 
1046
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
987
1047
                        && UNAME_MACHINE=i686
988
1048
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
989
1049
        else
990
1050
                echo ${UNAME_MACHINE}-pc-sysv32
991
1051
        fi
992
1052
        exit 0 ;;
993
 
    i?86:*DOS:*:*)
994
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
995
 
        exit 0 ;;
996
1053
    pc:*:*:*)
997
1054
        # Left here for compatibility:
998
1055
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1016
1073
        # "miniframe"
1017
1074
        echo m68010-convergent-sysv
1018
1075
        exit 0 ;;
1019
 
    M68*:*:R3V[567]*:*)
 
1076
    mc68k:UNIX:SYSTEM5:3.51m)
 
1077
        echo m68k-convergent-sysv
 
1078
        exit 0 ;;
 
1079
    M680?0:D-NIX:5.3:*)
 
1080
        echo m68k-diab-dnix
 
1081
        exit 0 ;;
 
1082
    M68*:*:R3V[5678]*:*)
1020
1083
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
1021
 
    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 
1084
    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)
1022
1085
        OS_REL=''
1023
1086
        test -r /etc/.relid \
1024
1087
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1035
1098
    mc68030:UNIX_System_V:4.*:*)
1036
1099
        echo m68k-atari-sysv4
1037
1100
        exit 0 ;;
1038
 
    i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:* | i?86:LynxOS:4.0*:*)
1039
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
1040
 
        exit 0 ;;
1041
1101
    TSUNAMI:LynxOS:2.*:*)
1042
1102
        echo sparc-unknown-lynxos${UNAME_RELEASE}
1043
1103
        exit 0 ;;
1064
1124
                echo ns32k-sni-sysv
1065
1125
        fi
1066
1126
        exit 0 ;;
1067
 
    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1068
 
                           # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1127
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 
1128
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1069
1129
        echo i586-unisys-sysv4
1070
1130
        exit 0 ;;
1071
1131
    *:UNIX_System_V:4*:FTX*)
1077
1137
        # From seanf@swdc.stratus.com.
1078
1138
        echo i860-stratus-sysv4
1079
1139
        exit 0 ;;
 
1140
    *:VOS:*:*)
 
1141
        # From Paul.Green@stratus.com.
 
1142
        echo hppa1.1-stratus-vos
 
1143
        exit 0 ;;
1080
1144
    mc68*:A/UX:*:*)
1081
1145
        echo m68k-apple-aux${UNAME_RELEASE}
1082
1146
        exit 0 ;;
1105
1169
    SX-5:SUPER-UX:*:*)
1106
1170
        echo sx5-nec-superux${UNAME_RELEASE}
1107
1171
        exit 0 ;;
 
1172
    SX-6:SUPER-UX:*:*)
 
1173
        echo sx6-nec-superux${UNAME_RELEASE}
 
1174
        exit 0 ;;
1108
1175
    Power*:Rhapsody:*:*)
1109
1176
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1110
1177
        exit 0 ;;
1112
1179
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1113
1180
        exit 0 ;;
1114
1181
    *:Darwin:*:*)
1115
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1182
        case `uname -p` in
 
1183
            *86) UNAME_PROCESSOR=i686 ;;
 
1184
            powerpc) UNAME_PROCESSOR=powerpc ;;
 
1185
        esac
 
1186
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1116
1187
        exit 0 ;;
1117
1188
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1118
 
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1189
        UNAME_PROCESSOR=`uname -p`
 
1190
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1191
                UNAME_PROCESSOR=i386
1119
1192
                UNAME_MACHINE=pc
1120
1193
        fi
1121
 
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
 
1194
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1122
1195
        exit 0 ;;
1123
1196
    *:QNX:*:4*)
1124
1197
        echo i386-pc-qnx
1125
1198
        exit 0 ;;
1126
 
    NSR-[KW]:NONSTOP_KERNEL:*:*)
 
1199
    NSR-?:NONSTOP_KERNEL:*:*)
1127
1200
        echo nsr-tandem-nsk${UNAME_RELEASE}
1128
1201
        exit 0 ;;
1129
1202
    *:NonStop-UX:*:*)
1146
1219
        fi
1147
1220
        echo ${UNAME_MACHINE}-unknown-plan9
1148
1221
        exit 0 ;;
1149
 
    i?86:OS/2:*:*)
1150
 
        # If we were able to find `uname', then EMX Unix compatibility
1151
 
        # is probably installed.
1152
 
        echo ${UNAME_MACHINE}-pc-os2-emx
1153
 
        exit 0 ;;
1154
1222
    *:TOPS-10:*:*)
1155
1223
        echo pdp10-unknown-tops10
1156
1224
        exit 0 ;;
1169
1237
    *:ITS:*:*)
1170
1238
        echo pdp10-unknown-its
1171
1239
        exit 0 ;;
 
1240
    SEI:*:*:SEIUX)
 
1241
        echo mips-sei-seiux${UNAME_RELEASE}
 
1242
        exit 0 ;;
 
1243
    *:DragonFly:*:*)
 
1244
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
1245
        exit 0 ;;
 
1246
    *:*VMS:*:*)
 
1247
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
 
1248
        case "${UNAME_MACHINE}" in
 
1249
            A*) echo alpha-dec-vms && exit 0 ;;
 
1250
            I*) echo ia64-dec-vms && exit 0 ;;
 
1251
            V*) echo vax-dec-vms && exit 0 ;;
 
1252
        esac
1172
1253
esac
1173
1254
 
1174
1255
#echo '(No uname command or uname output not recognized.)' 1>&2
1175
1256
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1176
1257
 
 
1258
eval $set_cc_for_build
1177
1259
cat >$dummy.c <<EOF
1178
1260
#ifdef _SEQUENT_
1179
1261
# include <sys/types.h>
1288
1370
}
1289
1371
EOF
1290
1372
 
1291
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1292
 
rm -f $dummy.c $dummy
 
1373
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1293
1374
 
1294
1375
# Apollos put the system type in the environment.
1295
1376