~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-10-11 16:10:27 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20041011161027-icyjbji8ujym633o
Tags: 1:4.2.0a-10ubuntu2
Use ntp.ubuntulinux.org instead of pool.ntp.org

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-06-29'
 
6
timestamp='2004-03-12'
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
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
 
98
 
set_cc_for_build='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
 
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
103
117
             CC_FOR_BUILD="$c"; break ;
104
118
          fi ;
105
119
        done ;
106
 
        rm -f $dummy.c $dummy.o $dummy.rel ;
107
120
        if test x"$CC_FOR_BUILD" = x ; then
108
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
129
# (ghazi@noc.rutgers.edu 1994-08-24)
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)
153
167
                eval $set_cc_for_build
154
168
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
155
169
                        | grep __ELF__ >/dev/null
166
180
                ;;
167
181
        esac
168
182
        # The OS release
169
 
        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
170
195
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
171
196
        # contains redundant information, the shorter form:
172
197
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
173
198
        echo "${machine}-${os}${release}"
174
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
    mac68k:OpenBSD:*:*)
 
216
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
217
        exit 0 ;;
 
218
    macppc:OpenBSD:*:*)
 
219
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
220
        exit 0 ;;
 
221
    mvme68k:OpenBSD:*:*)
 
222
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
223
        exit 0 ;;
 
224
    mvme88k:OpenBSD:*:*)
 
225
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
226
        exit 0 ;;
 
227
    mvmeppc:OpenBSD:*:*)
 
228
        echo powerpc-unknown-openbsd${UNAME_RELEASE}
 
229
        exit 0 ;;
 
230
    pegasos: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 ;;
175
257
    alpha:OSF1:*:*)
176
 
        if test $UNAME_RELEASE = "V4.0"; then
 
258
        case $UNAME_RELEASE in
 
259
        *4.0)
177
260
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
178
 
        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.
179
304
        # A Vn.n version is a released version.
180
305
        # A Tn.n version is a released field test version.
181
306
        # A Xn.n version is an unreleased experimental baselevel.
182
307
        # 1.2 uses "1.2" for uname -r.
183
 
        cat <<EOF >$dummy.s
184
 
        .data
185
 
\$Lformat:
186
 
        .byte 37,100,45,37,120,10,0     # "%d-%x\n"
187
 
 
188
 
        .text
189
 
        .globl main
190
 
        .align 4
191
 
        .ent main
192
 
main:
193
 
        .frame \$30,16,\$26,0
194
 
        ldgp \$29,0(\$27)
195
 
        .prologue 1
196
 
        .long 0x47e03d80 # implver \$0
197
 
        lda \$2,-1
198
 
        .long 0x47e20c21 # amask \$2,\$1
199
 
        lda \$16,\$Lformat
200
 
        mov \$0,\$17
201
 
        not \$1,\$18
202
 
        jsr \$26,printf
203
 
        ldgp \$29,0(\$26)
204
 
        mov 0,\$16
205
 
        jsr \$26,exit
206
 
        .end main
207
 
EOF
208
 
        eval $set_cc_for_build
209
 
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
210
 
        if test "$?" = 0 ; then
211
 
                case `./$dummy` in
212
 
                        0-0)
213
 
                                UNAME_MACHINE="alpha"
214
 
                                ;;
215
 
                        1-0)
216
 
                                UNAME_MACHINE="alphaev5"
217
 
                                ;;
218
 
                        1-1)
219
 
                                UNAME_MACHINE="alphaev56"
220
 
                                ;;
221
 
                        1-101)
222
 
                                UNAME_MACHINE="alphapca56"
223
 
                                ;;
224
 
                        2-303)
225
 
                                UNAME_MACHINE="alphaev6"
226
 
                                ;;
227
 
                        2-307)
228
 
                                UNAME_MACHINE="alphaev67"
229
 
                                ;;
230
 
                esac
231
 
        fi
232
 
        rm -f $dummy.s $dummy
233
 
        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'`
 
309
        exit 0 ;;
 
310
    Alpha*:OpenVMS:*:*)
 
311
        echo alpha-hp-vms
234
312
        exit 0 ;;
235
313
    Alpha\ *:Windows_NT*:*)
236
314
        # How do we know it's Interix rather than the generic POSIX subsystem?
244
322
    Amiga*:UNIX_System_V:4.0:*)
245
323
        echo m68k-unknown-sysv4
246
324
        exit 0;;
247
 
    amiga:OpenBSD:*:*)
248
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
249
 
        exit 0 ;;
250
325
    *:[Aa]miga[Oo][Ss]:*:*)
251
326
        echo ${UNAME_MACHINE}-unknown-amigaos
252
327
        exit 0 ;;
253
 
    arc64:OpenBSD:*:*)
254
 
        echo mips64el-unknown-openbsd${UNAME_RELEASE}
255
 
        exit 0 ;;
256
 
    arc:OpenBSD:*:*)
257
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
258
 
        exit 0 ;;
259
 
    hkmips:OpenBSD:*:*)
260
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
261
 
        exit 0 ;;
262
 
    pmax:OpenBSD:*:*)
263
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
264
 
        exit 0 ;;
265
 
    sgi:OpenBSD:*:*)
266
 
        echo mips-unknown-openbsd${UNAME_RELEASE}
267
 
        exit 0 ;;
268
 
    wgrisc:OpenBSD:*:*)
269
 
        echo mipsel-unknown-openbsd${UNAME_RELEASE}
 
328
    *:[Mm]orph[Oo][Ss]:*:*)
 
329
        echo ${UNAME_MACHINE}-unknown-morphos
270
330
        exit 0 ;;
271
331
    *:OS/390:*:*)
272
332
        echo i370-ibm-openedition
273
333
        exit 0 ;;
 
334
    *:OS400:*:*)
 
335
        echo powerpc-ibm-os400
 
336
        exit 0 ;;
274
337
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
275
338
        echo arm-acorn-riscix${UNAME_RELEASE}
276
339
        exit 0;;
288
351
    NILE*:*:*:dcosx)
289
352
        echo pyramid-pyramid-svr4
290
353
        exit 0 ;;
 
354
    DRS?6000:unix:4.0:6*)
 
355
        echo sparc-icl-nx6
 
356
        exit 0 ;;
 
357
    DRS?6000:UNIX_SV:4.2*:7*)
 
358
        case `/usr/bin/uname -p` in
 
359
            sparc) echo sparc-icl-nx7 && exit 0 ;;
 
360
        esac ;;
291
361
    sun4H:SunOS:5.*:*)
292
362
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
293
363
        exit 0 ;;
316
386
        echo m68k-sun-sunos${UNAME_RELEASE}
317
387
        exit 0 ;;
318
388
    sun*:*:4.2BSD:*)
319
 
        UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
 
389
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
320
390
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
321
391
        case "`/bin/arch`" in
322
392
            sun3)
330
400
    aushp:SunOS:*:*)
331
401
        echo sparc-auspex-sunos${UNAME_RELEASE}
332
402
        exit 0 ;;
333
 
    atari*:OpenBSD:*:*)
334
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
335
 
        exit 0 ;;
336
403
    # The situation for MiNT is a little confusing.  The machine name
337
404
    # can be virtually everything (everything which is not
338
405
    # "atarist" or "atariste" at least should have a processor
359
426
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
360
427
        echo m68k-unknown-mint${UNAME_RELEASE}
361
428
        exit 0 ;;
362
 
    sun3*:OpenBSD:*:*)
363
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
364
 
        exit 0 ;;
365
 
    mac68k:OpenBSD:*:*)
366
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
367
 
        exit 0 ;;
368
 
    mvme68k:OpenBSD:*:*)
369
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
370
 
        exit 0 ;;
371
 
    mvme88k:OpenBSD:*:*)
372
 
        echo m88k-unknown-openbsd${UNAME_RELEASE}
 
429
    m68k:machten:*:*)
 
430
        echo m68k-apple-machten${UNAME_RELEASE}
373
431
        exit 0 ;;
374
432
    powerpc:machten:*:*)
375
433
        echo powerpc-apple-machten${UNAME_RELEASE}
387
445
        echo clipper-intergraph-clix${UNAME_RELEASE}
388
446
        exit 0 ;;
389
447
    mips:*:*:UMIPS | mips:*:*:RISCos)
 
448
        eval $set_cc_for_build
390
449
        sed 's/^        //' << EOF >$dummy.c
391
450
#ifdef __cplusplus
392
451
#include <stdio.h>  /* for printf() prototype */
408
467
          exit (-1);
409
468
        }
410
469
EOF
411
 
        eval $set_cc_for_build
412
 
        $CC_FOR_BUILD $dummy.c -o $dummy \
413
 
          && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
414
 
          && rm -f $dummy.c $dummy && exit 0
415
 
        rm -f $dummy.c $dummy
 
470
        $CC_FOR_BUILD -o $dummy $dummy.c \
 
471
          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
 
472
          && exit 0
416
473
        echo mips-mips-riscos${UNAME_RELEASE}
417
474
        exit 0 ;;
418
475
    Motorola:PowerMAX_OS:*:*)
419
476
        echo powerpc-motorola-powermax
420
477
        exit 0 ;;
 
478
    Motorola:*:4.3:PL8-*)
 
479
        echo powerpc-harris-powermax
 
480
        exit 0 ;;
 
481
    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
 
482
        echo powerpc-harris-powermax
 
483
        exit 0 ;;
421
484
    Night_Hawk:Power_UNIX:*:*)
422
485
        echo powerpc-harris-powerunix
423
486
        exit 0 ;;
478
541
        exit 0 ;;
479
542
    *:AIX:2:3)
480
543
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
 
544
                eval $set_cc_for_build
481
545
                sed 's/^                //' << EOF >$dummy.c
482
546
                #include <sys/systemcfg.h>
483
547
 
489
553
                        exit(0);
490
554
                        }
491
555
EOF
492
 
                eval $set_cc_for_build
493
 
                $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
494
 
                rm -f $dummy.c $dummy
 
556
                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
495
557
                echo rs6000-ibm-aix3.2.5
496
558
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
497
559
                echo rs6000-ibm-aix3.2.4
500
562
        fi
501
563
        exit 0 ;;
502
564
    *:AIX:*:[45])
503
 
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
 
565
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
504
566
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
505
567
                IBM_ARCH=rs6000
506
568
        else
540
602
            9000/31? )            HP_ARCH=m68000 ;;
541
603
            9000/[34]?? )         HP_ARCH=m68k ;;
542
604
            9000/[678][0-9][0-9])
543
 
              case "${HPUX_REV}" in
544
 
                11.[0-9][0-9])
545
 
                  if [ -x /usr/bin/getconf ]; then
546
 
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
 
605
                if [ -x /usr/bin/getconf ]; then
 
606
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
547
607
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
548
608
                    case "${sc_cpu_version}" in
549
609
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
552
612
                        case "${sc_kernel_bits}" in
553
613
                          32) HP_ARCH="hppa2.0n" ;;
554
614
                          64) HP_ARCH="hppa2.0w" ;;
 
615
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
555
616
                        esac ;;
556
617
                    esac
557
 
                  fi ;;
558
 
              esac
559
 
              if [ "${HP_ARCH}" = "" ]; then
560
 
              sed 's/^              //' << EOF >$dummy.c
 
618
                fi
 
619
                if [ "${HP_ARCH}" = "" ]; then
 
620
                    eval $set_cc_for_build
 
621
                    sed 's/^              //' << EOF >$dummy.c
561
622
 
562
623
              #define _HPUX_SOURCE
563
624
              #include <stdlib.h>
590
651
                  exit (0);
591
652
              }
592
653
EOF
593
 
        eval $set_cc_for_build
594
 
        (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
595
 
        if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
596
 
        rm -f $dummy.c $dummy
597
 
        fi ;;
 
654
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
655
                    test -z "$HP_ARCH" && HP_ARCH=hppa
 
656
                fi ;;
598
657
        esac
 
658
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
659
        then
 
660
            # avoid double evaluation of $set_cc_for_build
 
661
            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
 
662
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
 
663
            then
 
664
                HP_ARCH="hppa2.0w"
 
665
            else
 
666
                HP_ARCH="hppa64"
 
667
            fi
 
668
        fi
599
669
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
600
670
        exit 0 ;;
601
671
    ia64:HP-UX:*:*)
603
673
        echo ia64-hp-hpux${HPUX_REV}
604
674
        exit 0 ;;
605
675
    3050*:HI-UX:*:*)
 
676
        eval $set_cc_for_build
606
677
        sed 's/^        //' << EOF >$dummy.c
607
678
        #include <unistd.h>
608
679
        int
628
699
          exit (0);
629
700
        }
630
701
EOF
631
 
        eval $set_cc_for_build
632
 
        $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
633
 
        rm -f $dummy.c $dummy
 
702
        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
634
703
        echo unknown-hitachi-hiuxwe2
635
704
        exit 0 ;;
636
705
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
639
708
    9000/8??:4.3bsd:*:*)
640
709
        echo hppa1.0-hp-bsd
641
710
        exit 0 ;;
642
 
    *9??*:MPE/iX:*:*)
 
711
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
643
712
        echo hppa1.0-hp-mpeix
644
713
        exit 0 ;;
645
714
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
658
727
    parisc*:Lites*:*:*)
659
728
        echo hppa1.1-hp-lites
660
729
        exit 0 ;;
661
 
    hppa*:OpenBSD:*:*)
662
 
        echo hppa-unknown-openbsd
663
 
        exit 0 ;;
664
730
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
665
731
        echo c1-convex-bsd
666
732
        exit 0 ;;
679
745
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
680
746
        echo c4-convex-bsd
681
747
        exit 0 ;;
682
 
    CRAY*X-MP:*:*:*)
683
 
        echo xmp-cray-unicos
684
 
        exit 0 ;;
685
748
    CRAY*Y-MP:*:*:*)
686
 
        echo ymp-cray-unicos${UNAME_RELEASE}
 
749
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
687
750
        exit 0 ;;
688
751
    CRAY*[A-Z]90:*:*:*)
689
752
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
690
753
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
691
 
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
 
754
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
 
755
              -e 's/\.[^.]*$/.X/'
692
756
        exit 0 ;;
693
757
    CRAY*TS:*:*:*)
694
758
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
695
759
        exit 0 ;;
696
 
    CRAY*T3D:*:*:*)
697
 
        echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
698
 
        exit 0 ;;
699
760
    CRAY*T3E:*:*:*)
700
761
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
701
762
        exit 0 ;;
702
763
    CRAY*SV1:*:*:*)
703
764
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
704
765
        exit 0 ;;
705
 
    CRAY-2:*:*:*)
706
 
        echo cray2-cray-unicos
707
 
        exit 0 ;;
 
766
    *:UNICOS/mp:*:*)
 
767
        echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
768
        exit 0 ;;
708
769
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
709
770
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
710
771
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
711
772
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
712
773
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
713
774
        exit 0 ;;
714
 
    hp300:OpenBSD:*:*)
715
 
        echo m68k-unknown-openbsd${UNAME_RELEASE}
 
775
    5000:UNIX_System_V:4.*:*)
 
776
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
 
777
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
 
778
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
716
779
        exit 0 ;;
717
780
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
718
781
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
724
787
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
725
788
        exit 0 ;;
726
789
    *:FreeBSD:*:*)
727
 
        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
728
 
        exit 0 ;;
729
 
    *:OpenBSD:*:*)
730
 
        echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
790
        # Determine whether the default compiler uses glibc.
 
791
        eval $set_cc_for_build
 
792
        sed 's/^        //' << EOF >$dummy.c
 
793
        #include <features.h>
 
794
        #if __GLIBC__ >= 2
 
795
        LIBC=gnu
 
796
        #else
 
797
        LIBC=
 
798
        #endif
 
799
EOF
 
800
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
801
        # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
 
802
        # FreeBSD's kernel, but not the complete OS.
 
803
        case ${LIBC} in gnu) kernel_only='k' ;; esac
 
804
        echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
731
805
        exit 0 ;;
732
806
    i*:CYGWIN*:*)
733
807
        echo ${UNAME_MACHINE}-pc-cygwin
738
812
    i*:PW*:*)
739
813
        echo ${UNAME_MACHINE}-pc-pw32
740
814
        exit 0 ;;
 
815
    x86:Interix*:[34]*)
 
816
        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
 
817
        exit 0 ;;
 
818
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
 
819
        echo i${UNAME_MACHINE}-pc-mks
 
820
        exit 0 ;;
741
821
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
742
822
        # How do we know it's Interix rather than the generic POSIX subsystem?
743
823
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
744
824
        # UNAME_MACHINE based on the output of uname instead of i386?
745
 
        echo i386-pc-interix
 
825
        echo i586-pc-interix
746
826
        exit 0 ;;
747
827
    i*:UWIN*:*)
748
828
        echo ${UNAME_MACHINE}-pc-uwin
754
834
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
755
835
        exit 0 ;;
756
836
    *:GNU:*:*)
 
837
        # the GNU system
757
838
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
758
839
        exit 0 ;;
 
840
    *:GNU/*:*:*)
 
841
        # other systems with GNU libc and userland
 
842
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
843
        exit 0 ;;
759
844
    i*86:Minix:*:*)
760
845
        echo ${UNAME_MACHINE}-pc-minix
761
846
        exit 0 ;;
762
847
    arm*:Linux:*:*)
763
848
        echo ${UNAME_MACHINE}-unknown-linux-gnu
764
849
        exit 0 ;;
 
850
    cris:Linux:*:*)
 
851
        echo cris-axis-linux-gnu
 
852
        exit 0 ;;
765
853
    ia64:Linux:*:*)
766
 
        echo ${UNAME_MACHINE}-unknown-linux
 
854
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
855
        exit 0 ;;
 
856
    m32r*:Linux:*:*)
 
857
        echo ${UNAME_MACHINE}-unknown-linux-gnu
767
858
        exit 0 ;;
768
859
    m68*:Linux:*:*)
769
860
        echo ${UNAME_MACHINE}-unknown-linux-gnu
770
861
        exit 0 ;;
771
862
    mips:Linux:*:*)
772
 
        case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
773
 
          big)    echo mips-unknown-linux-gnu && exit 0 ;;
774
 
          little) echo mipsel-unknown-linux-gnu && exit 0 ;;
775
 
        esac
 
863
        eval $set_cc_for_build
 
864
        sed 's/^        //' << EOF >$dummy.c
 
865
        #undef CPU
 
866
        #undef mips
 
867
        #undef mipsel
 
868
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
869
        CPU=mipsel
 
870
        #else
 
871
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
872
        CPU=mips
 
873
        #else
 
874
        CPU=
 
875
        #endif
 
876
        #endif
 
877
EOF
 
878
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
879
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
 
880
        ;;
 
881
    mips64:Linux:*:*)
 
882
        eval $set_cc_for_build
 
883
        sed 's/^        //' << EOF >$dummy.c
 
884
        #undef CPU
 
885
        #undef mips64
 
886
        #undef mips64el
 
887
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
 
888
        CPU=mips64el
 
889
        #else
 
890
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
 
891
        CPU=mips64
 
892
        #else
 
893
        CPU=
 
894
        #endif
 
895
        #endif
 
896
EOF
 
897
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
 
898
        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
776
899
        ;;
777
900
    ppc:Linux:*:*)
778
901
        echo powerpc-unknown-linux-gnu
779
902
        exit 0 ;;
 
903
    ppc64:Linux:*:*)
 
904
        echo powerpc64-unknown-linux-gnu
 
905
        exit 0 ;;
780
906
    alpha:Linux:*:*)
781
907
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
782
908
          EV5)   UNAME_MACHINE=alphaev5 ;;
785
911
          PCA57) UNAME_MACHINE=alphapca56 ;;
786
912
          EV6)   UNAME_MACHINE=alphaev6 ;;
787
913
          EV67)  UNAME_MACHINE=alphaev67 ;;
788
 
          EV68*) UNAME_MACHINE=alphaev67 ;;
 
914
          EV68*) UNAME_MACHINE=alphaev68 ;;
789
915
        esac
790
916
        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
791
917
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
805
931
    s390:Linux:*:* | s390x:Linux:*:*)
806
932
        echo ${UNAME_MACHINE}-ibm-linux
807
933
        exit 0 ;;
 
934
    sh64*:Linux:*:*)
 
935
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
936
        exit 0 ;;
808
937
    sh*:Linux:*:*)
809
938
        echo ${UNAME_MACHINE}-unknown-linux-gnu
810
939
        exit 0 ;;
818
947
        # The BFD linker knows what the default object file format is, so
819
948
        # first see if it will tell us. cd to the root directory to prevent
820
949
        # problems with other programs or directories called `ld' in the path.
821
 
        ld_supported_targets=`cd /; ld --help 2>&1 \
 
950
        # Set LC_ALL=C to ensure ld outputs messages in English.
 
951
        ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
822
952
                         | sed -ne '/supported targets:/!d
823
953
                                    s/[         ][      ]*/ /g
824
954
                                    s/.*supported targets: *//
830
960
                ;;
831
961
          a.out-i386-linux)
832
962
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
833
 
                exit 0 ;;               
 
963
                exit 0 ;;
834
964
          coff-i386)
835
965
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
836
966
                exit 0 ;;
841
971
                exit 0 ;;
842
972
        esac
843
973
        # Determine whether the default compiler is a.out or elf
844
 
        cat >$dummy.c <<EOF
845
 
#include <features.h>
846
 
#ifdef __cplusplus
847
 
#include <stdio.h>  /* for printf() prototype */
848
 
        int main (int argc, char *argv[]) {
849
 
#else
850
 
        int main (argc, argv) int argc; char *argv[]; {
851
 
#endif
852
 
#ifdef __ELF__
853
 
# ifdef __GLIBC__
854
 
#  if __GLIBC__ >= 2
855
 
    printf ("%s-pc-linux-gnu\n", argv[1]);
856
 
#  else
857
 
    printf ("%s-pc-linux-gnulibc1\n", argv[1]);
858
 
#  endif
859
 
# else
860
 
   printf ("%s-pc-linux-gnulibc1\n", argv[1]);
861
 
# endif
862
 
#else
863
 
  printf ("%s-pc-linux-gnuaout\n", argv[1]);
864
 
#endif
865
 
  return 0;
866
 
}
 
974
        eval $set_cc_for_build
 
975
        sed 's/^        //' << EOF >$dummy.c
 
976
        #include <features.h>
 
977
        #ifdef __ELF__
 
978
        # ifdef __GLIBC__
 
979
        #  if __GLIBC__ >= 2
 
980
        LIBC=gnu
 
981
        #  else
 
982
        LIBC=gnulibc1
 
983
        #  endif
 
984
        # else
 
985
        LIBC=gnulibc1
 
986
        # endif
 
987
        #else
 
988
        #ifdef __INTEL_COMPILER
 
989
        LIBC=gnu
 
990
        #else
 
991
        LIBC=gnuaout
 
992
        #endif
 
993
        #endif
 
994
        #ifdef __dietlibc__
 
995
        LIBC=dietlibc
 
996
        #endif
867
997
EOF
868
 
        eval $set_cc_for_build
869
 
        $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
870
 
        rm -f $dummy.c $dummy
 
998
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
 
999
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
871
1000
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
872
1001
        ;;
873
1002
    i*86:DYNIX/ptx:4*:*)
884
1013
        # Use sysv4.2uw... so that sysv4* matches it.
885
1014
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
886
1015
        exit 0 ;;
 
1016
    i*86:OS/2:*:*)
 
1017
        # If we were able to find `uname', then EMX Unix compatibility
 
1018
        # is probably installed.
 
1019
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1020
        exit 0 ;;
 
1021
    i*86:XTS-300:*:STOP)
 
1022
        echo ${UNAME_MACHINE}-unknown-stop
 
1023
        exit 0 ;;
 
1024
    i*86:atheos:*:*)
 
1025
        echo ${UNAME_MACHINE}-unknown-atheos
 
1026
        exit 0 ;;
 
1027
        i*86:syllable:*:*)
 
1028
        echo ${UNAME_MACHINE}-pc-syllable
 
1029
        exit 0 ;;
 
1030
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
 
1031
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
1032
        exit 0 ;;
 
1033
    i*86:*DOS:*:*)
 
1034
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
1035
        exit 0 ;;
887
1036
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
888
1037
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
889
1038
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
905
1054
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
906
1055
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
907
1056
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
908
 
                UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
909
 
                (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
910
 
                (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
 
1057
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
 
1058
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
 
1059
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
911
1060
                        && UNAME_MACHINE=i586
912
 
                (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
 
1061
                (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
913
1062
                        && UNAME_MACHINE=i686
914
 
                (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
 
1063
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
915
1064
                        && UNAME_MACHINE=i686
916
1065
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
917
1066
        else
918
1067
                echo ${UNAME_MACHINE}-pc-sysv32
919
1068
        fi
920
1069
        exit 0 ;;
921
 
    i*86:*DOS:*:*)
922
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
923
 
        exit 0 ;;
924
1070
    pc:*:*:*)
925
1071
        # Left here for compatibility:
926
1072
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
944
1090
        # "miniframe"
945
1091
        echo m68010-convergent-sysv
946
1092
        exit 0 ;;
 
1093
    mc68k:UNIX:SYSTEM5:3.51m)
 
1094
        echo m68k-convergent-sysv
 
1095
        exit 0 ;;
 
1096
    M680?0:D-NIX:5.3:*)
 
1097
        echo m68k-diab-dnix
 
1098
        exit 0 ;;
947
1099
    M68*:*:R3V[567]*:*)
948
1100
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
949
 
    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
 
1101
    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)
950
1102
        OS_REL=''
951
1103
        test -r /etc/.relid \
952
1104
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
963
1115
    mc68030:UNIX_System_V:4.*:*)
964
1116
        echo m68k-atari-sysv4
965
1117
        exit 0 ;;
966
 
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
967
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
968
 
        exit 0 ;;
969
1118
    TSUNAMI:LynxOS:2.*:*)
970
1119
        echo sparc-unknown-lynxos${UNAME_RELEASE}
971
1120
        exit 0 ;;
992
1141
                echo ns32k-sni-sysv
993
1142
        fi
994
1143
        exit 0 ;;
995
 
    PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
996
 
                           # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1144
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 
1145
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
997
1146
        echo i586-unisys-sysv4
998
1147
        exit 0 ;;
999
1148
    *:UNIX_System_V:4*:FTX*)
1005
1154
        # From seanf@swdc.stratus.com.
1006
1155
        echo i860-stratus-sysv4
1007
1156
        exit 0 ;;
 
1157
    *:VOS:*:*)
 
1158
        # From Paul.Green@stratus.com.
 
1159
        echo hppa1.1-stratus-vos
 
1160
        exit 0 ;;
1008
1161
    mc68*:A/UX:*:*)
1009
1162
        echo m68k-apple-aux${UNAME_RELEASE}
1010
1163
        exit 0 ;;
1033
1186
    SX-5:SUPER-UX:*:*)
1034
1187
        echo sx5-nec-superux${UNAME_RELEASE}
1035
1188
        exit 0 ;;
 
1189
    SX-6:SUPER-UX:*:*)
 
1190
        echo sx6-nec-superux${UNAME_RELEASE}
 
1191
        exit 0 ;;
1036
1192
    Power*:Rhapsody:*:*)
1037
1193
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
1038
1194
        exit 0 ;;
1040
1196
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1041
1197
        exit 0 ;;
1042
1198
    *:Darwin:*:*)
1043
 
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
 
1199
        case `uname -p` in
 
1200
            *86) UNAME_PROCESSOR=i686 ;;
 
1201
            powerpc) UNAME_PROCESSOR=powerpc ;;
 
1202
        esac
 
1203
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1044
1204
        exit 0 ;;
1045
1205
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1046
 
        if test "${UNAME_MACHINE}" = "x86pc"; then
 
1206
        UNAME_PROCESSOR=`uname -p`
 
1207
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1208
                UNAME_PROCESSOR=i386
1047
1209
                UNAME_MACHINE=pc
1048
1210
        fi
1049
 
        echo `uname -p`-${UNAME_MACHINE}-nto-qnx
 
1211
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1050
1212
        exit 0 ;;
1051
1213
    *:QNX:*:4*)
1052
1214
        echo i386-pc-qnx
1053
1215
        exit 0 ;;
1054
 
    NSR-[KW]:NONSTOP_KERNEL:*:*)
 
1216
    NSR-?:NONSTOP_KERNEL:*:*)
1055
1217
        echo nsr-tandem-nsk${UNAME_RELEASE}
1056
1218
        exit 0 ;;
1057
1219
    *:NonStop-UX:*:*)
1074
1236
        fi
1075
1237
        echo ${UNAME_MACHINE}-unknown-plan9
1076
1238
        exit 0 ;;
1077
 
    i*86:OS/2:*:*)
1078
 
        # If we were able to find `uname', then EMX Unix compatibility
1079
 
        # is probably installed.
1080
 
        echo ${UNAME_MACHINE}-pc-os2-emx
1081
 
        exit 0 ;;
1082
1239
    *:TOPS-10:*:*)
1083
1240
        echo pdp10-unknown-tops10
1084
1241
        exit 0 ;;
1097
1254
    *:ITS:*:*)
1098
1255
        echo pdp10-unknown-its
1099
1256
        exit 0 ;;
 
1257
    SEI:*:*:SEIUX)
 
1258
        echo mips-sei-seiux${UNAME_RELEASE}
 
1259
        exit 0 ;;
 
1260
    *:DragonFly:*:*)
 
1261
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
1262
        exit 0 ;;
1100
1263
esac
1101
1264
 
1102
1265
#echo '(No uname command or uname output not recognized.)' 1>&2
1103
1266
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1104
1267
 
 
1268
eval $set_cc_for_build
1105
1269
cat >$dummy.c <<EOF
1106
1270
#ifdef _SEQUENT_
1107
1271
# include <sys/types.h>
1216
1380
}
1217
1381
EOF
1218
1382
 
1219
 
eval $set_cc_for_build
1220
 
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
1221
 
rm -f $dummy.c $dummy
 
1383
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
1222
1384
 
1223
1385
# Apollos put the system type in the environment.
1224
1386