~vcs-imports/zsh/git-mirror

« back to all changes in this revision

Viewing changes to config.guess

  • Committer: Peter Stephenson
  • Date: 2018-05-29 08:47:04 UTC
  • Revision ID: git-v1:d5e840672983f90598c377035d10fe4fae52f5d4
42865: update config.guess and config.sub.

Copied unmodified from latest GNU distribution.

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,
4
 
#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
5
 
#   Free Software Foundation, Inc.
 
3
#   Copyright 1992-2018 Free Software Foundation, Inc.
6
4
 
7
 
timestamp='2009-11-20'
 
5
timestamp='2018-05-19'
8
6
 
9
7
# This file is free software; you can redistribute it and/or modify it
10
8
# under the terms of the GNU General Public License as published by
11
 
# the Free Software Foundation; either version 2 of the License, or
 
9
# the Free Software Foundation; either version 3 of the License, or
12
10
# (at your option) any later version.
13
11
#
14
12
# This program is distributed in the hope that it will be useful, but
17
15
# General Public License for more details.
18
16
#
19
17
# You should have received a copy of the GNU General Public License
20
 
# along with this program; if not, write to the Free Software
21
 
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22
 
# 02110-1301, USA.
 
18
# along with this program; if not, see <https://www.gnu.org/licenses/>.
23
19
#
24
20
# As a special exception to the GNU General Public License, if you
25
21
# distribute this file as part of a program that contains a
26
22
# configuration script generated by Autoconf, you may include it under
27
 
# the same distribution terms that you use for the rest of that program.
28
 
 
29
 
 
30
 
# Originally written by Per Bothner.  Please send patches (context
31
 
# diff format) to <config-patches@gnu.org> and include a ChangeLog
32
 
# entry.
 
23
# the same distribution terms that you use for the rest of that
 
24
# program.  This Exception is an additional permission under section 7
 
25
# of the GNU General Public License, version 3 ("GPLv3").
33
26
#
34
 
# This script attempts to guess a canonical system name similar to
35
 
# config.sub.  If it succeeds, it prints the system name on stdout, and
36
 
# exits with 0.  Otherwise, it exits with 1.
 
27
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
37
28
#
38
29
# You can get the latest version of this script from:
39
 
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
30
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 
31
#
 
32
# Please send patches to <config-patches@gnu.org>.
 
33
 
40
34
 
41
35
me=`echo "$0" | sed -e 's,.*/,,'`
42
36
 
45
39
 
46
40
Output the configuration name of the system \`$me' is run on.
47
41
 
48
 
Operation modes:
 
42
Options:
49
43
  -h, --help         print this help, then exit
50
44
  -t, --time-stamp   print date of last modification, then exit
51
45
  -v, --version      print version number, then exit
56
50
GNU config.guess ($timestamp)
57
51
 
58
52
Originally written by Per Bothner.
59
 
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
60
 
2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
53
Copyright 1992-2018 Free Software Foundation, Inc.
61
54
 
62
55
This is free software; see the source for copying conditions.  There is NO
63
56
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
113
106
 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114
107
dummy=$tmp/dummy ;
115
108
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
116
 
case $CC_FOR_BUILD,$HOST_CC,$CC in
117
 
 ,,)    echo "int x;" > $dummy.c ;
 
109
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
 
110
 ,,)    echo "int x;" > "$dummy.c" ;
118
111
        for c in cc gcc c89 c99 ; do
119
 
          if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
 
112
          if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
120
113
             CC_FOR_BUILD="$c"; break ;
121
114
          fi ;
122
115
        done ;
139
132
UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
140
133
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
141
134
 
 
135
case "$UNAME_SYSTEM" in
 
136
Linux|GNU|GNU/*)
 
137
        # If the system lacks a compiler, then just pick glibc.
 
138
        # We could probably try harder.
 
139
        LIBC=gnu
 
140
 
 
141
        eval "$set_cc_for_build"
 
142
        cat <<-EOF > "$dummy.c"
 
143
        #include <features.h>
 
144
        #if defined(__UCLIBC__)
 
145
        LIBC=uclibc
 
146
        #elif defined(__dietlibc__)
 
147
        LIBC=dietlibc
 
148
        #else
 
149
        LIBC=gnu
 
150
        #endif
 
151
        EOF
 
152
        eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
 
153
 
 
154
        # If ldd exists, use it to detect musl libc.
 
155
        if command -v ldd >/dev/null && \
 
156
                ldd --version 2>&1 | grep -q ^musl
 
157
        then
 
158
            LIBC=musl
 
159
        fi
 
160
        ;;
 
161
esac
 
162
 
142
163
# Note: order is significant - the case branches are not exclusive.
143
164
 
144
 
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 
165
case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
145
166
    *:NetBSD:*:*)
146
167
        # NetBSD (nbsd) targets should (where applicable) match one or
147
 
        # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
 
168
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
148
169
        # *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
149
170
        # switched to ELF, *-*-netbsd* would select the old
150
171
        # object file format.  This provides both forward
154
175
        # Note: NetBSD doesn't particularly care about the vendor
155
176
        # portion of the name.  We always set it to "unknown".
156
177
        sysctl="sysctl -n hw.machine_arch"
157
 
        UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
158
 
            /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
159
 
        case "${UNAME_MACHINE_ARCH}" in
 
178
        UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
 
179
            "/sbin/$sysctl" 2>/dev/null || \
 
180
            "/usr/sbin/$sysctl" 2>/dev/null || \
 
181
            echo unknown)`
 
182
        case "$UNAME_MACHINE_ARCH" in
160
183
            armeb) machine=armeb-unknown ;;
161
184
            arm*) machine=arm-unknown ;;
162
185
            sh3el) machine=shl-unknown ;;
163
186
            sh3eb) machine=sh-unknown ;;
164
187
            sh5el) machine=sh5le-unknown ;;
165
 
            *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 
188
            earmv*)
 
189
                arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
 
190
                endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
 
191
                machine="${arch}${endian}"-unknown
 
192
                ;;
 
193
            *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
166
194
        esac
167
195
        # The Operating System including object format, if it has switched
168
 
        # to ELF recently, or will in the future.
169
 
        case "${UNAME_MACHINE_ARCH}" in
 
196
        # to ELF recently (or will in the future) and ABI.
 
197
        case "$UNAME_MACHINE_ARCH" in
 
198
            earm*)
 
199
                os=netbsdelf
 
200
                ;;
170
201
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
171
 
                eval $set_cc_for_build
 
202
                eval "$set_cc_for_build"
172
203
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
173
204
                        | grep -q __ELF__
174
205
                then
180
211
                fi
181
212
                ;;
182
213
            *)
183
 
                os=netbsd
 
214
                os=netbsd
 
215
                ;;
 
216
        esac
 
217
        # Determine ABI tags.
 
218
        case "$UNAME_MACHINE_ARCH" in
 
219
            earm*)
 
220
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
 
221
                abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
184
222
                ;;
185
223
        esac
186
224
        # The OS release
188
226
        # thus, need a distinct triplet. However, they do not need
189
227
        # kernel version information, so it can be replaced with a
190
228
        # suitable tag, in the style of linux-gnu.
191
 
        case "${UNAME_VERSION}" in
 
229
        case "$UNAME_VERSION" in
192
230
            Debian*)
193
231
                release='-gnu'
194
232
                ;;
195
233
            *)
196
 
                release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
 
234
                release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
197
235
                ;;
198
236
        esac
199
237
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
200
238
        # contains redundant information, the shorter form:
201
239
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
202
 
        echo "${machine}-${os}${release}"
 
240
        echo "$machine-${os}${release}${abi-}"
 
241
        exit ;;
 
242
    *:Bitrig:*:*)
 
243
        UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
 
244
        echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
203
245
        exit ;;
204
246
    *:OpenBSD:*:*)
205
247
        UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
206
 
        echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
 
248
        echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
 
249
        exit ;;
 
250
    *:LibertyBSD:*:*)
 
251
        UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
 
252
        echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
 
253
        exit ;;
 
254
    *:MidnightBSD:*:*)
 
255
        echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
207
256
        exit ;;
208
257
    *:ekkoBSD:*:*)
209
 
        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
 
258
        echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
210
259
        exit ;;
211
260
    *:SolidBSD:*:*)
212
 
        echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
 
261
        echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
213
262
        exit ;;
214
263
    macppc:MirBSD:*:*)
215
 
        echo powerpc-unknown-mirbsd${UNAME_RELEASE}
 
264
        echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
216
265
        exit ;;
217
266
    *:MirBSD:*:*)
218
 
        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
219
 
        exit ;;
 
267
        echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
 
268
        exit ;;
 
269
    *:Sortix:*:*)
 
270
        echo "$UNAME_MACHINE"-unknown-sortix
 
271
        exit ;;
 
272
    *:Redox:*:*)
 
273
        echo "$UNAME_MACHINE"-unknown-redox
 
274
        exit ;;
 
275
    mips:OSF1:*.*)
 
276
        echo mips-dec-osf1
 
277
        exit ;;
220
278
    alpha:OSF1:*:*)
221
279
        case $UNAME_RELEASE in
222
280
        *4.0)
223
281
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
224
282
                ;;
225
283
        *5.*)
226
 
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
 
284
                UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
227
285
                ;;
228
286
        esac
229
287
        # According to Compaq, /usr/sbin/psrinfo has been available on
233
291
        ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
234
292
        case "$ALPHA_CPU_TYPE" in
235
293
            "EV4 (21064)")
236
 
                UNAME_MACHINE="alpha" ;;
 
294
                UNAME_MACHINE=alpha ;;
237
295
            "EV4.5 (21064)")
238
 
                UNAME_MACHINE="alpha" ;;
 
296
                UNAME_MACHINE=alpha ;;
239
297
            "LCA4 (21066/21068)")
240
 
                UNAME_MACHINE="alpha" ;;
 
298
                UNAME_MACHINE=alpha ;;
241
299
            "EV5 (21164)")
242
 
                UNAME_MACHINE="alphaev5" ;;
 
300
                UNAME_MACHINE=alphaev5 ;;
243
301
            "EV5.6 (21164A)")
244
 
                UNAME_MACHINE="alphaev56" ;;
 
302
                UNAME_MACHINE=alphaev56 ;;
245
303
            "EV5.6 (21164PC)")
246
 
                UNAME_MACHINE="alphapca56" ;;
 
304
                UNAME_MACHINE=alphapca56 ;;
247
305
            "EV5.7 (21164PC)")
248
 
                UNAME_MACHINE="alphapca57" ;;
 
306
                UNAME_MACHINE=alphapca57 ;;
249
307
            "EV6 (21264)")
250
 
                UNAME_MACHINE="alphaev6" ;;
 
308
                UNAME_MACHINE=alphaev6 ;;
251
309
            "EV6.7 (21264A)")
252
 
                UNAME_MACHINE="alphaev67" ;;
 
310
                UNAME_MACHINE=alphaev67 ;;
253
311
            "EV6.8CB (21264C)")
254
 
                UNAME_MACHINE="alphaev68" ;;
 
312
                UNAME_MACHINE=alphaev68 ;;
255
313
            "EV6.8AL (21264B)")
256
 
                UNAME_MACHINE="alphaev68" ;;
 
314
                UNAME_MACHINE=alphaev68 ;;
257
315
            "EV6.8CX (21264D)")
258
 
                UNAME_MACHINE="alphaev68" ;;
 
316
                UNAME_MACHINE=alphaev68 ;;
259
317
            "EV6.9A (21264/EV69A)")
260
 
                UNAME_MACHINE="alphaev69" ;;
 
318
                UNAME_MACHINE=alphaev69 ;;
261
319
            "EV7 (21364)")
262
 
                UNAME_MACHINE="alphaev7" ;;
 
320
                UNAME_MACHINE=alphaev7 ;;
263
321
            "EV7.9 (21364A)")
264
 
                UNAME_MACHINE="alphaev79" ;;
 
322
                UNAME_MACHINE=alphaev79 ;;
265
323
        esac
266
324
        # A Pn.n version is a patched version.
267
325
        # A Vn.n version is a released version.
268
326
        # A Tn.n version is a released field test version.
269
327
        # A Xn.n version is an unreleased experimental baselevel.
270
328
        # 1.2 uses "1.2" for uname -r.
271
 
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
272
 
        exit ;;
273
 
    Alpha\ *:Windows_NT*:*)
274
 
        # How do we know it's Interix rather than the generic POSIX subsystem?
275
 
        # Should we change UNAME_MACHINE based on the output of uname instead
276
 
        # of the specific Alpha model?
277
 
        echo alpha-pc-interix
278
 
        exit ;;
279
 
    21064:Windows_NT:50:3)
280
 
        echo alpha-dec-winnt3.5
281
 
        exit ;;
 
329
        echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
 
330
        # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
 
331
        exitcode=$?
 
332
        trap '' 0
 
333
        exit $exitcode ;;
282
334
    Amiga*:UNIX_System_V:4.0:*)
283
335
        echo m68k-unknown-sysv4
284
336
        exit ;;
285
337
    *:[Aa]miga[Oo][Ss]:*:*)
286
 
        echo ${UNAME_MACHINE}-unknown-amigaos
 
338
        echo "$UNAME_MACHINE"-unknown-amigaos
287
339
        exit ;;
288
340
    *:[Mm]orph[Oo][Ss]:*:*)
289
 
        echo ${UNAME_MACHINE}-unknown-morphos
 
341
        echo "$UNAME_MACHINE"-unknown-morphos
290
342
        exit ;;
291
343
    *:OS/390:*:*)
292
344
        echo i370-ibm-openedition
295
347
        echo s390-ibm-zvmoe
296
348
        exit ;;
297
349
    *:OS400:*:*)
298
 
        echo powerpc-ibm-os400
 
350
        echo powerpc-ibm-os400
299
351
        exit ;;
300
352
    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
301
 
        echo arm-acorn-riscix${UNAME_RELEASE}
 
353
        echo arm-acorn-riscix"$UNAME_RELEASE"
302
354
        exit ;;
303
 
    arm:riscos:*:*|arm:RISCOS:*:*)
 
355
    arm*:riscos:*:*|arm*:RISCOS:*:*)
304
356
        echo arm-unknown-riscos
305
357
        exit ;;
306
358
    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
325
377
            sparc) echo sparc-icl-nx7; exit ;;
326
378
        esac ;;
327
379
    s390x:SunOS:*:*)
328
 
        echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
380
        echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
329
381
        exit ;;
330
382
    sun4H:SunOS:5.*:*)
331
 
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
383
        echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
332
384
        exit ;;
333
385
    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
334
 
        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
386
        echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
335
387
        exit ;;
336
388
    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
337
 
        echo i386-pc-auroraux${UNAME_RELEASE}
 
389
        echo i386-pc-auroraux"$UNAME_RELEASE"
338
390
        exit ;;
339
391
    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
340
 
        eval $set_cc_for_build
341
 
        SUN_ARCH="i386"
 
392
        eval "$set_cc_for_build"
 
393
        SUN_ARCH=i386
342
394
        # If there is a compiler, see if it is configured for 64-bit objects.
343
395
        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
344
396
        # This test works for both compilers.
345
 
        if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
 
397
        if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
346
398
            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
347
 
                (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
 
399
                (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
348
400
                grep IS_64BIT_ARCH >/dev/null
349
401
            then
350
 
                SUN_ARCH="x86_64"
 
402
                SUN_ARCH=x86_64
351
403
            fi
352
404
        fi
353
 
        echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
405
        echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
354
406
        exit ;;
355
407
    sun4*:SunOS:6*:*)
356
408
        # According to config.sub, this is the proper way to canonicalize
357
409
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
358
410
        # it's likely to be more like Solaris than SunOS4.
359
 
        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
411
        echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
360
412
        exit ;;
361
413
    sun4*:SunOS:*:*)
362
414
        case "`/usr/bin/arch -k`" in
365
417
                ;;
366
418
        esac
367
419
        # Japanese Language versions have a version number like `4.1.3-JL'.
368
 
        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
 
420
        echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
369
421
        exit ;;
370
422
    sun3*:SunOS:*:*)
371
 
        echo m68k-sun-sunos${UNAME_RELEASE}
 
423
        echo m68k-sun-sunos"$UNAME_RELEASE"
372
424
        exit ;;
373
425
    sun*:*:4.2BSD:*)
374
426
        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
375
 
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
 
427
        test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
376
428
        case "`/bin/arch`" in
377
429
            sun3)
378
 
                echo m68k-sun-sunos${UNAME_RELEASE}
 
430
                echo m68k-sun-sunos"$UNAME_RELEASE"
379
431
                ;;
380
432
            sun4)
381
 
                echo sparc-sun-sunos${UNAME_RELEASE}
 
433
                echo sparc-sun-sunos"$UNAME_RELEASE"
382
434
                ;;
383
435
        esac
384
436
        exit ;;
385
437
    aushp:SunOS:*:*)
386
 
        echo sparc-auspex-sunos${UNAME_RELEASE}
 
438
        echo sparc-auspex-sunos"$UNAME_RELEASE"
387
439
        exit ;;
388
440
    # The situation for MiNT is a little confusing.  The machine name
389
441
    # can be virtually everything (everything which is not
394
446
    # MiNT.  But MiNT is downward compatible to TOS, so this should
395
447
    # be no problem.
396
448
    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
397
 
        echo m68k-atari-mint${UNAME_RELEASE}
 
449
        echo m68k-atari-mint"$UNAME_RELEASE"
398
450
        exit ;;
399
451
    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
400
 
        echo m68k-atari-mint${UNAME_RELEASE}
401
 
        exit ;;
 
452
        echo m68k-atari-mint"$UNAME_RELEASE"
 
453
        exit ;;
402
454
    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
403
 
        echo m68k-atari-mint${UNAME_RELEASE}
 
455
        echo m68k-atari-mint"$UNAME_RELEASE"
404
456
        exit ;;
405
457
    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
406
 
        echo m68k-milan-mint${UNAME_RELEASE}
407
 
        exit ;;
 
458
        echo m68k-milan-mint"$UNAME_RELEASE"
 
459
        exit ;;
408
460
    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
409
 
        echo m68k-hades-mint${UNAME_RELEASE}
410
 
        exit ;;
 
461
        echo m68k-hades-mint"$UNAME_RELEASE"
 
462
        exit ;;
411
463
    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
412
 
        echo m68k-unknown-mint${UNAME_RELEASE}
413
 
        exit ;;
 
464
        echo m68k-unknown-mint"$UNAME_RELEASE"
 
465
        exit ;;
414
466
    m68k:machten:*:*)
415
 
        echo m68k-apple-machten${UNAME_RELEASE}
 
467
        echo m68k-apple-machten"$UNAME_RELEASE"
416
468
        exit ;;
417
469
    powerpc:machten:*:*)
418
 
        echo powerpc-apple-machten${UNAME_RELEASE}
 
470
        echo powerpc-apple-machten"$UNAME_RELEASE"
419
471
        exit ;;
420
472
    RISC*:Mach:*:*)
421
473
        echo mips-dec-mach_bsd4.3
422
474
        exit ;;
423
475
    RISC*:ULTRIX:*:*)
424
 
        echo mips-dec-ultrix${UNAME_RELEASE}
 
476
        echo mips-dec-ultrix"$UNAME_RELEASE"
425
477
        exit ;;
426
478
    VAX*:ULTRIX*:*:*)
427
 
        echo vax-dec-ultrix${UNAME_RELEASE}
 
479
        echo vax-dec-ultrix"$UNAME_RELEASE"
428
480
        exit ;;
429
481
    2020:CLIX:*:* | 2430:CLIX:*:*)
430
 
        echo clipper-intergraph-clix${UNAME_RELEASE}
 
482
        echo clipper-intergraph-clix"$UNAME_RELEASE"
431
483
        exit ;;
432
484
    mips:*:*:UMIPS | mips:*:*:RISCos)
433
 
        eval $set_cc_for_build
434
 
        sed 's/^        //' << EOF >$dummy.c
 
485
        eval "$set_cc_for_build"
 
486
        sed 's/^        //' << EOF > "$dummy.c"
435
487
#ifdef __cplusplus
436
488
#include <stdio.h>  /* for printf() prototype */
437
489
        int main (int argc, char *argv[]) {
440
492
#endif
441
493
        #if defined (host_mips) && defined (MIPSEB)
442
494
        #if defined (SYSTYPE_SYSV)
443
 
          printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
 
495
          printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
444
496
        #endif
445
497
        #if defined (SYSTYPE_SVR4)
446
 
          printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
 
498
          printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
447
499
        #endif
448
500
        #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
449
 
          printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
 
501
          printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
450
502
        #endif
451
503
        #endif
452
504
          exit (-1);
453
505
        }
454
506
EOF
455
 
        $CC_FOR_BUILD -o $dummy $dummy.c &&
456
 
          dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
457
 
          SYSTEM_NAME=`$dummy $dummyarg` &&
 
507
        $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
 
508
          dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
 
509
          SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
458
510
            { echo "$SYSTEM_NAME"; exit; }
459
 
        echo mips-mips-riscos${UNAME_RELEASE}
 
511
        echo mips-mips-riscos"$UNAME_RELEASE"
460
512
        exit ;;
461
513
    Motorola:PowerMAX_OS:*:*)
462
514
        echo powerpc-motorola-powermax
480
532
        echo m88k-motorola-sysv3
481
533
        exit ;;
482
534
    AViiON:dgux:*:*)
483
 
        # DG/UX returns AViiON for all architectures
484
 
        UNAME_PROCESSOR=`/usr/bin/uname -p`
485
 
        if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
 
535
        # DG/UX returns AViiON for all architectures
 
536
        UNAME_PROCESSOR=`/usr/bin/uname -p`
 
537
        if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
486
538
        then
487
 
            if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
488
 
               [ ${TARGET_BINARY_INTERFACE}x = x ]
 
539
            if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
 
540
               [ "$TARGET_BINARY_INTERFACE"x = x ]
489
541
            then
490
 
                echo m88k-dg-dgux${UNAME_RELEASE}
 
542
                echo m88k-dg-dgux"$UNAME_RELEASE"
491
543
            else
492
 
                echo m88k-dg-dguxbcs${UNAME_RELEASE}
 
544
                echo m88k-dg-dguxbcs"$UNAME_RELEASE"
493
545
            fi
494
546
        else
495
 
            echo i586-dg-dgux${UNAME_RELEASE}
 
547
            echo i586-dg-dgux"$UNAME_RELEASE"
496
548
        fi
497
 
        exit ;;
 
549
        exit ;;
498
550
    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
499
551
        echo m88k-dolphin-sysv3
500
552
        exit ;;
509
561
        echo m68k-tektronix-bsd
510
562
        exit ;;
511
563
    *:IRIX*:*:*)
512
 
        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
 
564
        echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
513
565
        exit ;;
514
566
    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
515
567
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
521
573
        if [ -x /usr/bin/oslevel ] ; then
522
574
                IBM_REV=`/usr/bin/oslevel`
523
575
        else
524
 
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 
576
                IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
525
577
        fi
526
 
        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
 
578
        echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
527
579
        exit ;;
528
580
    *:AIX:2:3)
529
581
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
530
 
                eval $set_cc_for_build
531
 
                sed 's/^                //' << EOF >$dummy.c
 
582
                eval "$set_cc_for_build"
 
583
                sed 's/^                //' << EOF > "$dummy.c"
532
584
                #include <sys/systemcfg.h>
533
585
 
534
586
                main()
539
591
                        exit(0);
540
592
                        }
541
593
EOF
542
 
                if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
 
594
                if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
543
595
                then
544
596
                        echo "$SYSTEM_NAME"
545
597
                else
551
603
                echo rs6000-ibm-aix3.2
552
604
        fi
553
605
        exit ;;
554
 
    *:AIX:*:[456])
 
606
    *:AIX:*:[4567])
555
607
        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
556
 
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
 
608
        if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
557
609
                IBM_ARCH=rs6000
558
610
        else
559
611
                IBM_ARCH=powerpc
560
612
        fi
561
 
        if [ -x /usr/bin/oslevel ] ; then
562
 
                IBM_REV=`/usr/bin/oslevel`
 
613
        if [ -x /usr/bin/lslpp ] ; then
 
614
                IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
 
615
                           awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
563
616
        else
564
 
                IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
 
617
                IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
565
618
        fi
566
 
        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
 
619
        echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
567
620
        exit ;;
568
621
    *:AIX:*:*)
569
622
        echo rs6000-ibm-aix
570
623
        exit ;;
571
 
    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
 
624
    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
572
625
        echo romp-ibm-bsd4.4
573
626
        exit ;;
574
627
    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
575
 
        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
 
628
        echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
576
629
        exit ;;                             # report: romp-ibm BSD 4.3
577
630
    *:BOSX:*:*)
578
631
        echo rs6000-bull-bosx
587
640
        echo m68k-hp-bsd4.4
588
641
        exit ;;
589
642
    9000/[34678]??:HP-UX:*:*)
590
 
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
591
 
        case "${UNAME_MACHINE}" in
592
 
            9000/31? )            HP_ARCH=m68000 ;;
593
 
            9000/[34]?? )         HP_ARCH=m68k ;;
 
643
        HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
 
644
        case "$UNAME_MACHINE" in
 
645
            9000/31?)            HP_ARCH=m68000 ;;
 
646
            9000/[34]??)         HP_ARCH=m68k ;;
594
647
            9000/[678][0-9][0-9])
595
648
                if [ -x /usr/bin/getconf ]; then
596
649
                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
597
 
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
598
 
                    case "${sc_cpu_version}" in
599
 
                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
600
 
                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
601
 
                      532)                      # CPU_PA_RISC2_0
602
 
                        case "${sc_kernel_bits}" in
603
 
                          32) HP_ARCH="hppa2.0n" ;;
604
 
                          64) HP_ARCH="hppa2.0w" ;;
605
 
                          '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
606
 
                        esac ;;
607
 
                    esac
 
650
                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
 
651
                    case "$sc_cpu_version" in
 
652
                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
 
653
                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
 
654
                      532)                      # CPU_PA_RISC2_0
 
655
                        case "$sc_kernel_bits" in
 
656
                          32) HP_ARCH=hppa2.0n ;;
 
657
                          64) HP_ARCH=hppa2.0w ;;
 
658
                          '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
 
659
                        esac ;;
 
660
                    esac
608
661
                fi
609
 
                if [ "${HP_ARCH}" = "" ]; then
610
 
                    eval $set_cc_for_build
611
 
                    sed 's/^              //' << EOF >$dummy.c
612
 
 
613
 
              #define _HPUX_SOURCE
614
 
              #include <stdlib.h>
615
 
              #include <unistd.h>
616
 
 
617
 
              int main ()
618
 
              {
619
 
              #if defined(_SC_KERNEL_BITS)
620
 
                  long bits = sysconf(_SC_KERNEL_BITS);
621
 
              #endif
622
 
                  long cpu  = sysconf (_SC_CPU_VERSION);
623
 
 
624
 
                  switch (cpu)
625
 
                {
626
 
                case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
627
 
                case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
628
 
                case CPU_PA_RISC2_0:
629
 
              #if defined(_SC_KERNEL_BITS)
630
 
                    switch (bits)
631
 
                        {
632
 
                        case 64: puts ("hppa2.0w"); break;
633
 
                        case 32: puts ("hppa2.0n"); break;
634
 
                        default: puts ("hppa2.0"); break;
635
 
                        } break;
636
 
              #else  /* !defined(_SC_KERNEL_BITS) */
637
 
                    puts ("hppa2.0"); break;
638
 
              #endif
639
 
                default: puts ("hppa1.0"); break;
640
 
                }
641
 
                  exit (0);
642
 
              }
 
662
                if [ "$HP_ARCH" = "" ]; then
 
663
                    eval "$set_cc_for_build"
 
664
                    sed 's/^            //' << EOF > "$dummy.c"
 
665
 
 
666
                #define _HPUX_SOURCE
 
667
                #include <stdlib.h>
 
668
                #include <unistd.h>
 
669
 
 
670
                int main ()
 
671
                {
 
672
                #if defined(_SC_KERNEL_BITS)
 
673
                    long bits = sysconf(_SC_KERNEL_BITS);
 
674
                #endif
 
675
                    long cpu  = sysconf (_SC_CPU_VERSION);
 
676
 
 
677
                    switch (cpu)
 
678
                        {
 
679
                        case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
 
680
                        case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
 
681
                        case CPU_PA_RISC2_0:
 
682
                #if defined(_SC_KERNEL_BITS)
 
683
                            switch (bits)
 
684
                                {
 
685
                                case 64: puts ("hppa2.0w"); break;
 
686
                                case 32: puts ("hppa2.0n"); break;
 
687
                                default: puts ("hppa2.0"); break;
 
688
                                } break;
 
689
                #else  /* !defined(_SC_KERNEL_BITS) */
 
690
                            puts ("hppa2.0"); break;
 
691
                #endif
 
692
                        default: puts ("hppa1.0"); break;
 
693
                        }
 
694
                    exit (0);
 
695
                }
643
696
EOF
644
 
                    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
 
697
                    (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
645
698
                    test -z "$HP_ARCH" && HP_ARCH=hppa
646
699
                fi ;;
647
700
        esac
648
 
        if [ ${HP_ARCH} = "hppa2.0w" ]
 
701
        if [ "$HP_ARCH" = hppa2.0w ]
649
702
        then
650
 
            eval $set_cc_for_build
 
703
            eval "$set_cc_for_build"
651
704
 
652
705
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
653
706
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
658
711
            # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
659
712
            # => hppa64-hp-hpux11.23
660
713
 
661
 
            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
 
714
            if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
662
715
                grep -q __LP64__
663
716
            then
664
 
                HP_ARCH="hppa2.0w"
 
717
                HP_ARCH=hppa2.0w
665
718
            else
666
 
                HP_ARCH="hppa64"
 
719
                HP_ARCH=hppa64
667
720
            fi
668
721
        fi
669
 
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
 
722
        echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
670
723
        exit ;;
671
724
    ia64:HP-UX:*:*)
672
 
        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
673
 
        echo ia64-hp-hpux${HPUX_REV}
 
725
        HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
 
726
        echo ia64-hp-hpux"$HPUX_REV"
674
727
        exit ;;
675
728
    3050*:HI-UX:*:*)
676
 
        eval $set_cc_for_build
677
 
        sed 's/^        //' << EOF >$dummy.c
 
729
        eval "$set_cc_for_build"
 
730
        sed 's/^        //' << EOF > "$dummy.c"
678
731
        #include <unistd.h>
679
732
        int
680
733
        main ()
699
752
          exit (0);
700
753
        }
701
754
EOF
702
 
        $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
 
755
        $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
703
756
                { echo "$SYSTEM_NAME"; exit; }
704
757
        echo unknown-hitachi-hiuxwe2
705
758
        exit ;;
706
 
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
 
759
    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
707
760
        echo hppa1.1-hp-bsd
708
761
        exit ;;
709
762
    9000/8??:4.3bsd:*:*)
712
765
    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
713
766
        echo hppa1.0-hp-mpeix
714
767
        exit ;;
715
 
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
 
768
    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
716
769
        echo hppa1.1-hp-osf
717
770
        exit ;;
718
771
    hp8??:OSF1:*:*)
720
773
        exit ;;
721
774
    i*86:OSF1:*:*)
722
775
        if [ -x /usr/sbin/sysversion ] ; then
723
 
            echo ${UNAME_MACHINE}-unknown-osf1mk
 
776
            echo "$UNAME_MACHINE"-unknown-osf1mk
724
777
        else
725
 
            echo ${UNAME_MACHINE}-unknown-osf1
 
778
            echo "$UNAME_MACHINE"-unknown-osf1
726
779
        fi
727
780
        exit ;;
728
781
    parisc*:Lites*:*:*)
730
783
        exit ;;
731
784
    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
732
785
        echo c1-convex-bsd
733
 
        exit ;;
 
786
        exit ;;
734
787
    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
735
788
        if getsysinfo -f scalar_acc
736
789
        then echo c32-convex-bsd
737
790
        else echo c2-convex-bsd
738
791
        fi
739
 
        exit ;;
 
792
        exit ;;
740
793
    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
741
794
        echo c34-convex-bsd
742
 
        exit ;;
 
795
        exit ;;
743
796
    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
744
797
        echo c38-convex-bsd
745
 
        exit ;;
 
798
        exit ;;
746
799
    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
747
800
        echo c4-convex-bsd
748
 
        exit ;;
 
801
        exit ;;
749
802
    CRAY*Y-MP:*:*:*)
750
 
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
803
        echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
751
804
        exit ;;
752
805
    CRAY*[A-Z]90:*:*:*)
753
 
        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
 
806
        echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
754
807
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
755
808
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
756
809
              -e 's/\.[^.]*$/.X/'
757
810
        exit ;;
758
811
    CRAY*TS:*:*:*)
759
 
        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
812
        echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
760
813
        exit ;;
761
814
    CRAY*T3E:*:*:*)
762
 
        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
815
        echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
763
816
        exit ;;
764
817
    CRAY*SV1:*:*:*)
765
 
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
818
        echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
766
819
        exit ;;
767
820
    *:UNICOS/mp:*:*)
768
 
        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
 
821
        echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
769
822
        exit ;;
770
823
    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
771
 
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
772
 
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
773
 
        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
774
 
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
775
 
        exit ;;
 
824
        FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
 
825
        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
 
826
        FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
 
827
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
828
        exit ;;
776
829
    5000:UNIX_System_V:4.*:*)
777
 
        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
778
 
        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
779
 
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
 
830
        FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
 
831
        FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
 
832
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
780
833
        exit ;;
781
834
    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
782
 
        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
 
835
        echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
783
836
        exit ;;
784
837
    sparc*:BSD/OS:*:*)
785
 
        echo sparc-unknown-bsdi${UNAME_RELEASE}
 
838
        echo sparc-unknown-bsdi"$UNAME_RELEASE"
786
839
        exit ;;
787
840
    *:BSD/OS:*:*)
788
 
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
 
841
        echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
789
842
        exit ;;
790
843
    *:FreeBSD:*:*)
791
 
        case ${UNAME_MACHINE} in
792
 
            pc98)
793
 
                echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 
844
        UNAME_PROCESSOR=`/usr/bin/uname -p`
 
845
        case "$UNAME_PROCESSOR" in
794
846
            amd64)
795
 
                echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
796
 
            *)
797
 
                echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
 
847
                UNAME_PROCESSOR=x86_64 ;;
 
848
            i386)
 
849
                UNAME_PROCESSOR=i586 ;;
798
850
        esac
 
851
        echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
799
852
        exit ;;
800
853
    i*:CYGWIN*:*)
801
 
        echo ${UNAME_MACHINE}-pc-cygwin
 
854
        echo "$UNAME_MACHINE"-pc-cygwin
 
855
        exit ;;
 
856
    *:MINGW64*:*)
 
857
        echo "$UNAME_MACHINE"-pc-mingw64
802
858
        exit ;;
803
859
    *:MINGW*:*)
804
 
        echo ${UNAME_MACHINE}-pc-mingw32
 
860
        echo "$UNAME_MACHINE"-pc-mingw32
805
861
        exit ;;
806
 
    i*:windows32*:*)
807
 
        # uname -m includes "-pc" on this system.
808
 
        echo ${UNAME_MACHINE}-mingw32
 
862
    *:MSYS*:*)
 
863
        echo "$UNAME_MACHINE"-pc-msys
809
864
        exit ;;
810
865
    i*:PW*:*)
811
 
        echo ${UNAME_MACHINE}-pc-pw32
 
866
        echo "$UNAME_MACHINE"-pc-pw32
812
867
        exit ;;
813
868
    *:Interix*:*)
814
 
        case ${UNAME_MACHINE} in
 
869
        case "$UNAME_MACHINE" in
815
870
            x86)
816
 
                echo i586-pc-interix${UNAME_RELEASE}
 
871
                echo i586-pc-interix"$UNAME_RELEASE"
817
872
                exit ;;
818
873
            authenticamd | genuineintel | EM64T)
819
 
                echo x86_64-unknown-interix${UNAME_RELEASE}
 
874
                echo x86_64-unknown-interix"$UNAME_RELEASE"
820
875
                exit ;;
821
876
            IA64)
822
 
                echo ia64-unknown-interix${UNAME_RELEASE}
 
877
                echo ia64-unknown-interix"$UNAME_RELEASE"
823
878
                exit ;;
824
879
        esac ;;
825
 
    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
826
 
        echo i${UNAME_MACHINE}-pc-mks
827
 
        exit ;;
828
 
    8664:Windows_NT:*)
829
 
        echo x86_64-pc-mks
830
 
        exit ;;
831
 
    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
832
 
        # How do we know it's Interix rather than the generic POSIX subsystem?
833
 
        # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
834
 
        # UNAME_MACHINE based on the output of uname instead of i386?
835
 
        echo i586-pc-interix
836
 
        exit ;;
837
880
    i*:UWIN*:*)
838
 
        echo ${UNAME_MACHINE}-pc-uwin
 
881
        echo "$UNAME_MACHINE"-pc-uwin
839
882
        exit ;;
840
883
    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
841
884
        echo x86_64-unknown-cygwin
842
885
        exit ;;
843
 
    p*:CYGWIN*:*)
844
 
        echo powerpcle-unknown-cygwin
845
 
        exit ;;
846
886
    prep*:SunOS:5.*:*)
847
 
        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
 
887
        echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
848
888
        exit ;;
849
889
    *:GNU:*:*)
850
890
        # the GNU system
851
 
        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 
891
        echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
852
892
        exit ;;
853
893
    *:GNU/*:*:*)
854
894
        # other systems with GNU libc and userland
855
 
        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
 
895
        echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
856
896
        exit ;;
857
897
    i*86:Minix:*:*)
858
 
        echo ${UNAME_MACHINE}-pc-minix
 
898
        echo "$UNAME_MACHINE"-pc-minix
 
899
        exit ;;
 
900
    aarch64:Linux:*:*)
 
901
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 
902
        exit ;;
 
903
    aarch64_be:Linux:*:*)
 
904
        UNAME_MACHINE=aarch64_be
 
905
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
859
906
        exit ;;
860
907
    alpha:Linux:*:*)
861
908
        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
866
913
          EV6)   UNAME_MACHINE=alphaev6 ;;
867
914
          EV67)  UNAME_MACHINE=alphaev67 ;;
868
915
          EV68*) UNAME_MACHINE=alphaev68 ;;
869
 
        esac
 
916
        esac
870
917
        objdump --private-headers /bin/sh | grep -q ld.so.1
871
 
        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
872
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
 
918
        if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
 
919
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 
920
        exit ;;
 
921
    arc:Linux:*:* | arceb:Linux:*:*)
 
922
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
873
923
        exit ;;
874
924
    arm*:Linux:*:*)
875
 
        eval $set_cc_for_build
 
925
        eval "$set_cc_for_build"
876
926
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
877
927
            | grep -q __ARM_EABI__
878
928
        then
879
 
            echo ${UNAME_MACHINE}-unknown-linux-gnu
 
929
            echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
880
930
        else
881
 
            echo ${UNAME_MACHINE}-unknown-linux-gnueabi
 
931
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 
932
                | grep -q __ARM_PCS_VFP
 
933
            then
 
934
                echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
 
935
            else
 
936
                echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
 
937
            fi
882
938
        fi
883
939
        exit ;;
884
940
    avr32*:Linux:*:*)
885
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
941
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
886
942
        exit ;;
887
943
    cris:Linux:*:*)
888
 
        echo cris-axis-linux-gnu
 
944
        echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
889
945
        exit ;;
890
946
    crisv32:Linux:*:*)
891
 
        echo crisv32-axis-linux-gnu
 
947
        echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
 
948
        exit ;;
 
949
    e2k:Linux:*:*)
 
950
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
892
951
        exit ;;
893
952
    frv:Linux:*:*)
894
 
        echo frv-unknown-linux-gnu
 
953
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 
954
        exit ;;
 
955
    hexagon:Linux:*:*)
 
956
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
895
957
        exit ;;
896
958
    i*86:Linux:*:*)
897
 
        LIBC=gnu
898
 
        eval $set_cc_for_build
899
 
        sed 's/^        //' << EOF >$dummy.c
900
 
        #ifdef __dietlibc__
901
 
        LIBC=dietlibc
902
 
        #endif
903
 
EOF
904
 
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
905
 
        echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
 
959
        echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
906
960
        exit ;;
907
961
    ia64:Linux:*:*)
908
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
962
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 
963
        exit ;;
 
964
    k1om:Linux:*:*)
 
965
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
909
966
        exit ;;
910
967
    m32r*:Linux:*:*)
911
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
968
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
912
969
        exit ;;
913
970
    m68*:Linux:*:*)
914
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
971
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
915
972
        exit ;;
916
973
    mips:Linux:*:* | mips64:Linux:*:*)
917
 
        eval $set_cc_for_build
918
 
        sed 's/^        //' << EOF >$dummy.c
 
974
        eval "$set_cc_for_build"
 
975
        sed 's/^        //' << EOF > "$dummy.c"
919
976
        #undef CPU
920
977
        #undef ${UNAME_MACHINE}
921
978
        #undef ${UNAME_MACHINE}el
929
986
        #endif
930
987
        #endif
931
988
EOF
932
 
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
933
 
        test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
 
989
        eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
 
990
        test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
934
991
        ;;
935
 
    or32:Linux:*:*)
936
 
        echo or32-unknown-linux-gnu
 
992
    mips64el:Linux:*:*)
 
993
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 
994
        exit ;;
 
995
    openrisc*:Linux:*:*)
 
996
        echo or1k-unknown-linux-"$LIBC"
 
997
        exit ;;
 
998
    or32:Linux:*:* | or1k*:Linux:*:*)
 
999
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
937
1000
        exit ;;
938
1001
    padre:Linux:*:*)
939
 
        echo sparc-unknown-linux-gnu
 
1002
        echo sparc-unknown-linux-"$LIBC"
940
1003
        exit ;;
941
1004
    parisc64:Linux:*:* | hppa64:Linux:*:*)
942
 
        echo hppa64-unknown-linux-gnu
 
1005
        echo hppa64-unknown-linux-"$LIBC"
943
1006
        exit ;;
944
1007
    parisc:Linux:*:* | hppa:Linux:*:*)
945
1008
        # Look for CPU level
946
1009
        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
947
 
          PA7*) echo hppa1.1-unknown-linux-gnu ;;
948
 
          PA8*) echo hppa2.0-unknown-linux-gnu ;;
949
 
          *)    echo hppa-unknown-linux-gnu ;;
 
1010
          PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
 
1011
          PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
 
1012
          *)    echo hppa-unknown-linux-"$LIBC" ;;
950
1013
        esac
951
1014
        exit ;;
952
1015
    ppc64:Linux:*:*)
953
 
        echo powerpc64-unknown-linux-gnu
 
1016
        echo powerpc64-unknown-linux-"$LIBC"
954
1017
        exit ;;
955
1018
    ppc:Linux:*:*)
956
 
        echo powerpc-unknown-linux-gnu
 
1019
        echo powerpc-unknown-linux-"$LIBC"
 
1020
        exit ;;
 
1021
    ppc64le:Linux:*:*)
 
1022
        echo powerpc64le-unknown-linux-"$LIBC"
 
1023
        exit ;;
 
1024
    ppcle:Linux:*:*)
 
1025
        echo powerpcle-unknown-linux-"$LIBC"
 
1026
        exit ;;
 
1027
    riscv32:Linux:*:* | riscv64:Linux:*:*)
 
1028
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
957
1029
        exit ;;
958
1030
    s390:Linux:*:* | s390x:Linux:*:*)
959
 
        echo ${UNAME_MACHINE}-ibm-linux
 
1031
        echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
960
1032
        exit ;;
961
1033
    sh64*:Linux:*:*)
962
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
1034
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
963
1035
        exit ;;
964
1036
    sh*:Linux:*:*)
965
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
1037
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
966
1038
        exit ;;
967
1039
    sparc:Linux:*:* | sparc64:Linux:*:*)
968
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
1040
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
 
1041
        exit ;;
 
1042
    tile*:Linux:*:*)
 
1043
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
969
1044
        exit ;;
970
1045
    vax:Linux:*:*)
971
 
        echo ${UNAME_MACHINE}-dec-linux-gnu
 
1046
        echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
972
1047
        exit ;;
973
1048
    x86_64:Linux:*:*)
974
 
        echo x86_64-unknown-linux-gnu
 
1049
        echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
975
1050
        exit ;;
976
1051
    xtensa*:Linux:*:*)
977
 
        echo ${UNAME_MACHINE}-unknown-linux-gnu
 
1052
        echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
978
1053
        exit ;;
979
1054
    i*86:DYNIX/ptx:4*:*)
980
1055
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
983
1058
        echo i386-sequent-sysv4
984
1059
        exit ;;
985
1060
    i*86:UNIX_SV:4.2MP:2.*)
986
 
        # Unixware is an offshoot of SVR4, but it has its own version
987
 
        # number series starting with 2...
988
 
        # I am not positive that other SVR4 systems won't match this,
 
1061
        # Unixware is an offshoot of SVR4, but it has its own version
 
1062
        # number series starting with 2...
 
1063
        # I am not positive that other SVR4 systems won't match this,
989
1064
        # I just have to hope.  -- rms.
990
 
        # Use sysv4.2uw... so that sysv4* matches it.
991
 
        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
 
1065
        # Use sysv4.2uw... so that sysv4* matches it.
 
1066
        echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
992
1067
        exit ;;
993
1068
    i*86:OS/2:*:*)
994
1069
        # If we were able to find `uname', then EMX Unix compatibility
995
1070
        # is probably installed.
996
 
        echo ${UNAME_MACHINE}-pc-os2-emx
 
1071
        echo "$UNAME_MACHINE"-pc-os2-emx
997
1072
        exit ;;
998
1073
    i*86:XTS-300:*:STOP)
999
 
        echo ${UNAME_MACHINE}-unknown-stop
 
1074
        echo "$UNAME_MACHINE"-unknown-stop
1000
1075
        exit ;;
1001
1076
    i*86:atheos:*:*)
1002
 
        echo ${UNAME_MACHINE}-unknown-atheos
 
1077
        echo "$UNAME_MACHINE"-unknown-atheos
1003
1078
        exit ;;
1004
1079
    i*86:syllable:*:*)
1005
 
        echo ${UNAME_MACHINE}-pc-syllable
 
1080
        echo "$UNAME_MACHINE"-pc-syllable
1006
1081
        exit ;;
1007
1082
    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
1008
 
        echo i386-unknown-lynxos${UNAME_RELEASE}
 
1083
        echo i386-unknown-lynxos"$UNAME_RELEASE"
1009
1084
        exit ;;
1010
1085
    i*86:*DOS:*:*)
1011
 
        echo ${UNAME_MACHINE}-pc-msdosdjgpp
 
1086
        echo "$UNAME_MACHINE"-pc-msdosdjgpp
1012
1087
        exit ;;
1013
 
    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
1014
 
        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
 
1088
    i*86:*:4.*:*)
 
1089
        UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
1015
1090
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
1016
 
                echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
 
1091
                echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
1017
1092
        else
1018
 
                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
 
1093
                echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
1019
1094
        fi
1020
1095
        exit ;;
1021
1096
    i*86:*:5:[678]*)
1022
 
        # UnixWare 7.x, OpenUNIX and OpenServer 6.
 
1097
        # UnixWare 7.x, OpenUNIX and OpenServer 6.
1023
1098
        case `/bin/uname -X | grep "^Machine"` in
1024
1099
            *486*)           UNAME_MACHINE=i486 ;;
1025
1100
            *Pentium)        UNAME_MACHINE=i586 ;;
1026
1101
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
1027
1102
        esac
1028
 
        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
 
1103
        echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
1029
1104
        exit ;;
1030
1105
    i*86:*:3.2:*)
1031
1106
        if test -f /usr/options/cb.name; then
1032
1107
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
1033
 
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
 
1108
                echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
1034
1109
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
1035
1110
                UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1036
1111
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1040
1115
                        && UNAME_MACHINE=i686
1041
1116
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
1042
1117
                        && UNAME_MACHINE=i686
1043
 
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
 
1118
                echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
1044
1119
        else
1045
 
                echo ${UNAME_MACHINE}-pc-sysv32
 
1120
                echo "$UNAME_MACHINE"-pc-sysv32
1046
1121
        fi
1047
1122
        exit ;;
1048
1123
    pc:*:*:*)
1049
1124
        # Left here for compatibility:
1050
 
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
1051
 
        # the processor, so we play safe by assuming i586.
 
1125
        # uname -m prints for DJGPP always 'pc', but it prints nothing about
 
1126
        # the processor, so we play safe by assuming i586.
1052
1127
        # Note: whatever this is, it MUST be the same as what config.sub
1053
 
        # prints for the "djgpp" host, or else GDB configury will decide that
 
1128
        # prints for the "djgpp" host, or else GDB configure will decide that
1054
1129
        # this is a cross-build.
1055
1130
        echo i586-pc-msdosdjgpp
1056
 
        exit ;;
 
1131
        exit ;;
1057
1132
    Intel:Mach:3*:*)
1058
1133
        echo i386-pc-mach3
1059
1134
        exit ;;
1062
1137
        exit ;;
1063
1138
    i860:*:4.*:*) # i860-SVR4
1064
1139
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
1065
 
          echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
 
1140
          echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
1066
1141
        else # Add other i860-SVR4 vendors below as they are discovered.
1067
 
          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
 
1142
          echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
1068
1143
        fi
1069
1144
        exit ;;
1070
1145
    mini*:CTIX:SYS*5:*)
1084
1159
        test -r /etc/.relid \
1085
1160
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1086
1161
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1087
 
          && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 
1162
          && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1088
1163
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1089
 
          && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
 
1164
          && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1090
1165
    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
1091
 
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1092
 
          && { echo i486-ncr-sysv4; exit; } ;;
 
1166
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
 
1167
          && { echo i486-ncr-sysv4; exit; } ;;
1093
1168
    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
1094
1169
        OS_REL='.3'
1095
1170
        test -r /etc/.relid \
1096
1171
            && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1097
1172
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
1098
 
            && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
 
1173
            && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
1099
1174
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
1100
 
            && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
 
1175
            && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
1101
1176
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
1102
 
            && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
 
1177
            && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
1103
1178
    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
1104
 
        echo m68k-unknown-lynxos${UNAME_RELEASE}
 
1179
        echo m68k-unknown-lynxos"$UNAME_RELEASE"
1105
1180
        exit ;;
1106
1181
    mc68030:UNIX_System_V:4.*:*)
1107
1182
        echo m68k-atari-sysv4
1108
1183
        exit ;;
1109
1184
    TSUNAMI:LynxOS:2.*:*)
1110
 
        echo sparc-unknown-lynxos${UNAME_RELEASE}
 
1185
        echo sparc-unknown-lynxos"$UNAME_RELEASE"
1111
1186
        exit ;;
1112
1187
    rs6000:LynxOS:2.*:*)
1113
 
        echo rs6000-unknown-lynxos${UNAME_RELEASE}
 
1188
        echo rs6000-unknown-lynxos"$UNAME_RELEASE"
1114
1189
        exit ;;
1115
1190
    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
1116
 
        echo powerpc-unknown-lynxos${UNAME_RELEASE}
 
1191
        echo powerpc-unknown-lynxos"$UNAME_RELEASE"
1117
1192
        exit ;;
1118
1193
    SM[BE]S:UNIX_SV:*:*)
1119
 
        echo mips-dde-sysv${UNAME_RELEASE}
 
1194
        echo mips-dde-sysv"$UNAME_RELEASE"
1120
1195
        exit ;;
1121
1196
    RM*:ReliantUNIX-*:*:*)
1122
1197
        echo mips-sni-sysv4
1127
1202
    *:SINIX-*:*:*)
1128
1203
        if uname -p 2>/dev/null >/dev/null ; then
1129
1204
                UNAME_MACHINE=`(uname -p) 2>/dev/null`
1130
 
                echo ${UNAME_MACHINE}-sni-sysv4
 
1205
                echo "$UNAME_MACHINE"-sni-sysv4
1131
1206
        else
1132
1207
                echo ns32k-sni-sysv
1133
1208
        fi
1134
1209
        exit ;;
1135
 
    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1136
 
                      # says <Richard.M.Bartel@ccMail.Census.GOV>
1137
 
        echo i586-unisys-sysv4
1138
 
        exit ;;
 
1210
    PENTIUM:*:4.0*:*)   # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
 
1211
                        # says <Richard.M.Bartel@ccMail.Census.GOV>
 
1212
        echo i586-unisys-sysv4
 
1213
        exit ;;
1139
1214
    *:UNIX_System_V:4*:FTX*)
1140
1215
        # From Gerald Hewes <hewes@openmarket.com>.
1141
1216
        # How about differentiating between stratus architectures? -djm
1147
1222
        exit ;;
1148
1223
    i*86:VOS:*:*)
1149
1224
        # From Paul.Green@stratus.com.
1150
 
        echo ${UNAME_MACHINE}-stratus-vos
 
1225
        echo "$UNAME_MACHINE"-stratus-vos
1151
1226
        exit ;;
1152
1227
    *:VOS:*:*)
1153
1228
        # From Paul.Green@stratus.com.
1154
1229
        echo hppa1.1-stratus-vos
1155
1230
        exit ;;
1156
1231
    mc68*:A/UX:*:*)
1157
 
        echo m68k-apple-aux${UNAME_RELEASE}
 
1232
        echo m68k-apple-aux"$UNAME_RELEASE"
1158
1233
        exit ;;
1159
1234
    news*:NEWS-OS:6*:*)
1160
1235
        echo mips-sony-newsos6
1161
1236
        exit ;;
1162
1237
    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1163
1238
        if [ -d /usr/nec ]; then
1164
 
                echo mips-nec-sysv${UNAME_RELEASE}
 
1239
                echo mips-nec-sysv"$UNAME_RELEASE"
1165
1240
        else
1166
 
                echo mips-unknown-sysv${UNAME_RELEASE}
 
1241
                echo mips-unknown-sysv"$UNAME_RELEASE"
1167
1242
        fi
1168
 
        exit ;;
 
1243
        exit ;;
1169
1244
    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
1170
1245
        echo powerpc-be-beos
1171
1246
        exit ;;
1178
1253
    BePC:Haiku:*:*)     # Haiku running on Intel PC compatible.
1179
1254
        echo i586-pc-haiku
1180
1255
        exit ;;
 
1256
    x86_64:Haiku:*:*)
 
1257
        echo x86_64-unknown-haiku
 
1258
        exit ;;
1181
1259
    SX-4:SUPER-UX:*:*)
1182
 
        echo sx4-nec-superux${UNAME_RELEASE}
 
1260
        echo sx4-nec-superux"$UNAME_RELEASE"
1183
1261
        exit ;;
1184
1262
    SX-5:SUPER-UX:*:*)
1185
 
        echo sx5-nec-superux${UNAME_RELEASE}
 
1263
        echo sx5-nec-superux"$UNAME_RELEASE"
1186
1264
        exit ;;
1187
1265
    SX-6:SUPER-UX:*:*)
1188
 
        echo sx6-nec-superux${UNAME_RELEASE}
 
1266
        echo sx6-nec-superux"$UNAME_RELEASE"
1189
1267
        exit ;;
1190
1268
    SX-7:SUPER-UX:*:*)
1191
 
        echo sx7-nec-superux${UNAME_RELEASE}
 
1269
        echo sx7-nec-superux"$UNAME_RELEASE"
1192
1270
        exit ;;
1193
1271
    SX-8:SUPER-UX:*:*)
1194
 
        echo sx8-nec-superux${UNAME_RELEASE}
 
1272
        echo sx8-nec-superux"$UNAME_RELEASE"
1195
1273
        exit ;;
1196
1274
    SX-8R:SUPER-UX:*:*)
1197
 
        echo sx8r-nec-superux${UNAME_RELEASE}
 
1275
        echo sx8r-nec-superux"$UNAME_RELEASE"
 
1276
        exit ;;
 
1277
    SX-ACE:SUPER-UX:*:*)
 
1278
        echo sxace-nec-superux"$UNAME_RELEASE"
1198
1279
        exit ;;
1199
1280
    Power*:Rhapsody:*:*)
1200
 
        echo powerpc-apple-rhapsody${UNAME_RELEASE}
 
1281
        echo powerpc-apple-rhapsody"$UNAME_RELEASE"
1201
1282
        exit ;;
1202
1283
    *:Rhapsody:*:*)
1203
 
        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
 
1284
        echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
1204
1285
        exit ;;
1205
1286
    *:Darwin:*:*)
1206
1287
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1207
 
        case $UNAME_PROCESSOR in
1208
 
            i386)
1209
 
                eval $set_cc_for_build
1210
 
                if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
1211
 
                  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
1212
 
                      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
1213
 
                      grep IS_64BIT_ARCH >/dev/null
1214
 
                  then
1215
 
                      UNAME_PROCESSOR="x86_64"
1216
 
                  fi
1217
 
                fi ;;
1218
 
            unknown) UNAME_PROCESSOR=powerpc ;;
1219
 
        esac
1220
 
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 
1288
        eval "$set_cc_for_build"
 
1289
        if test "$UNAME_PROCESSOR" = unknown ; then
 
1290
            UNAME_PROCESSOR=powerpc
 
1291
        fi
 
1292
        if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
 
1293
            if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
 
1294
                if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
 
1295
                       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
 
1296
                       grep IS_64BIT_ARCH >/dev/null
 
1297
                then
 
1298
                    case $UNAME_PROCESSOR in
 
1299
                        i386) UNAME_PROCESSOR=x86_64 ;;
 
1300
                        powerpc) UNAME_PROCESSOR=powerpc64 ;;
 
1301
                    esac
 
1302
                fi
 
1303
                # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
 
1304
                if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
 
1305
                       (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
 
1306
                       grep IS_PPC >/dev/null
 
1307
                then
 
1308
                    UNAME_PROCESSOR=powerpc
 
1309
                fi
 
1310
            fi
 
1311
        elif test "$UNAME_PROCESSOR" = i386 ; then
 
1312
            # Avoid executing cc on OS X 10.9, as it ships with a stub
 
1313
            # that puts up a graphical alert prompting to install
 
1314
            # developer tools.  Any system running Mac OS X 10.7 or
 
1315
            # later (Darwin 11 and later) is required to have a 64-bit
 
1316
            # processor. This is not true of the ARM version of Darwin
 
1317
            # that Apple uses in portable devices.
 
1318
            UNAME_PROCESSOR=x86_64
 
1319
        fi
 
1320
        echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
1221
1321
        exit ;;
1222
1322
    *:procnto*:*:* | *:QNX:[0123456789]*:*)
1223
1323
        UNAME_PROCESSOR=`uname -p`
1224
 
        if test "$UNAME_PROCESSOR" = "x86"; then
 
1324
        if test "$UNAME_PROCESSOR" = x86; then
1225
1325
                UNAME_PROCESSOR=i386
1226
1326
                UNAME_MACHINE=pc
1227
1327
        fi
1228
 
        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
 
1328
        echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
1229
1329
        exit ;;
1230
1330
    *:QNX:*:4*)
1231
1331
        echo i386-pc-qnx
1232
1332
        exit ;;
1233
 
    NSE-?:NONSTOP_KERNEL:*:*)
1234
 
        echo nse-tandem-nsk${UNAME_RELEASE}
1235
 
        exit ;;
1236
 
    NSR-?:NONSTOP_KERNEL:*:*)
1237
 
        echo nsr-tandem-nsk${UNAME_RELEASE}
 
1333
    NEO-*:NONSTOP_KERNEL:*:*)
 
1334
        echo neo-tandem-nsk"$UNAME_RELEASE"
 
1335
        exit ;;
 
1336
    NSE-*:NONSTOP_KERNEL:*:*)
 
1337
        echo nse-tandem-nsk"$UNAME_RELEASE"
 
1338
        exit ;;
 
1339
    NSR-*:NONSTOP_KERNEL:*:*)
 
1340
        echo nsr-tandem-nsk"$UNAME_RELEASE"
 
1341
        exit ;;
 
1342
    NSV-*:NONSTOP_KERNEL:*:*)
 
1343
        echo nsv-tandem-nsk"$UNAME_RELEASE"
 
1344
        exit ;;
 
1345
    NSX-*:NONSTOP_KERNEL:*:*)
 
1346
        echo nsx-tandem-nsk"$UNAME_RELEASE"
1238
1347
        exit ;;
1239
1348
    *:NonStop-UX:*:*)
1240
1349
        echo mips-compaq-nonstopux
1243
1352
        echo bs2000-siemens-sysv
1244
1353
        exit ;;
1245
1354
    DS/*:UNIX_System_V:*:*)
1246
 
        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
 
1355
        echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
1247
1356
        exit ;;
1248
1357
    *:Plan9:*:*)
1249
1358
        # "uname -m" is not consistent, so use $cputype instead. 386
1250
1359
        # is converted to i386 for consistency with other x86
1251
1360
        # operating systems.
1252
 
        if test "$cputype" = "386"; then
 
1361
        if test "$cputype" = 386; then
1253
1362
            UNAME_MACHINE=i386
1254
1363
        else
1255
1364
            UNAME_MACHINE="$cputype"
1256
1365
        fi
1257
 
        echo ${UNAME_MACHINE}-unknown-plan9
 
1366
        echo "$UNAME_MACHINE"-unknown-plan9
1258
1367
        exit ;;
1259
1368
    *:TOPS-10:*:*)
1260
1369
        echo pdp10-unknown-tops10
1275
1384
        echo pdp10-unknown-its
1276
1385
        exit ;;
1277
1386
    SEI:*:*:SEIUX)
1278
 
        echo mips-sei-seiux${UNAME_RELEASE}
 
1387
        echo mips-sei-seiux"$UNAME_RELEASE"
1279
1388
        exit ;;
1280
1389
    *:DragonFly:*:*)
1281
 
        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
 
1390
        echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
1282
1391
        exit ;;
1283
1392
    *:*VMS:*:*)
1284
 
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
1285
 
        case "${UNAME_MACHINE}" in
 
1393
        UNAME_MACHINE=`(uname -p) 2>/dev/null`
 
1394
        case "$UNAME_MACHINE" in
1286
1395
            A*) echo alpha-dec-vms ; exit ;;
1287
1396
            I*) echo ia64-dec-vms ; exit ;;
1288
1397
            V*) echo vax-dec-vms ; exit ;;
1291
1400
        echo i386-pc-xenix
1292
1401
        exit ;;
1293
1402
    i*86:skyos:*:*)
1294
 
        echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
 
1403
        echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
1295
1404
        exit ;;
1296
1405
    i*86:rdos:*:*)
1297
 
        echo ${UNAME_MACHINE}-pc-rdos
 
1406
        echo "$UNAME_MACHINE"-pc-rdos
1298
1407
        exit ;;
1299
1408
    i*86:AROS:*:*)
1300
 
        echo ${UNAME_MACHINE}-pc-aros
 
1409
        echo "$UNAME_MACHINE"-pc-aros
 
1410
        exit ;;
 
1411
    x86_64:VMkernel:*:*)
 
1412
        echo "$UNAME_MACHINE"-unknown-esx
 
1413
        exit ;;
 
1414
    amd64:Isilon\ OneFS:*:*)
 
1415
        echo x86_64-unknown-onefs
1301
1416
        exit ;;
1302
1417
esac
1303
1418
 
1304
 
#echo '(No uname command or uname output not recognized.)' 1>&2
1305
 
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
1306
 
 
1307
 
eval $set_cc_for_build
1308
 
cat >$dummy.c <<EOF
1309
 
#ifdef _SEQUENT_
1310
 
# include <sys/types.h>
1311
 
# include <sys/utsname.h>
1312
 
#endif
1313
 
main ()
1314
 
{
1315
 
#if defined (sony)
1316
 
#if defined (MIPSEB)
1317
 
  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
1318
 
     I don't know....  */
1319
 
  printf ("mips-sony-bsd\n"); exit (0);
1320
 
#else
1321
 
#include <sys/param.h>
1322
 
  printf ("m68k-sony-newsos%s\n",
1323
 
#ifdef NEWSOS4
1324
 
          "4"
1325
 
#else
1326
 
          ""
1327
 
#endif
1328
 
         ); exit (0);
1329
 
#endif
1330
 
#endif
1331
 
 
1332
 
#if defined (__arm) && defined (__acorn) && defined (__unix)
1333
 
  printf ("arm-acorn-riscix\n"); exit (0);
1334
 
#endif
1335
 
 
1336
 
#if defined (hp300) && !defined (hpux)
1337
 
  printf ("m68k-hp-bsd\n"); exit (0);
1338
 
#endif
1339
 
 
1340
 
#if defined (NeXT)
1341
 
#if !defined (__ARCHITECTURE__)
1342
 
#define __ARCHITECTURE__ "m68k"
1343
 
#endif
1344
 
  int version;
1345
 
  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
1346
 
  if (version < 4)
1347
 
    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
1348
 
  else
1349
 
    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
1350
 
  exit (0);
1351
 
#endif
1352
 
 
1353
 
#if defined (MULTIMAX) || defined (n16)
1354
 
#if defined (UMAXV)
1355
 
  printf ("ns32k-encore-sysv\n"); exit (0);
1356
 
#else
1357
 
#if defined (CMU)
1358
 
  printf ("ns32k-encore-mach\n"); exit (0);
1359
 
#else
1360
 
  printf ("ns32k-encore-bsd\n"); exit (0);
1361
 
#endif
1362
 
#endif
1363
 
#endif
1364
 
 
1365
 
#if defined (__386BSD__)
1366
 
  printf ("i386-pc-bsd\n"); exit (0);
1367
 
#endif
1368
 
 
1369
 
#if defined (sequent)
1370
 
#if defined (i386)
1371
 
  printf ("i386-sequent-dynix\n"); exit (0);
1372
 
#endif
1373
 
#if defined (ns32000)
1374
 
  printf ("ns32k-sequent-dynix\n"); exit (0);
1375
 
#endif
1376
 
#endif
1377
 
 
1378
 
#if defined (_SEQUENT_)
1379
 
    struct utsname un;
1380
 
 
1381
 
    uname(&un);
1382
 
 
1383
 
    if (strncmp(un.version, "V2", 2) == 0) {
1384
 
        printf ("i386-sequent-ptx2\n"); exit (0);
1385
 
    }
1386
 
    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
1387
 
        printf ("i386-sequent-ptx1\n"); exit (0);
1388
 
    }
1389
 
    printf ("i386-sequent-ptx\n"); exit (0);
1390
 
 
1391
 
#endif
1392
 
 
1393
 
#if defined (vax)
1394
 
# if !defined (ultrix)
1395
 
#  include <sys/param.h>
1396
 
#  if defined (BSD)
1397
 
#   if BSD == 43
1398
 
      printf ("vax-dec-bsd4.3\n"); exit (0);
1399
 
#   else
1400
 
#    if BSD == 199006
1401
 
      printf ("vax-dec-bsd4.3reno\n"); exit (0);
1402
 
#    else
1403
 
      printf ("vax-dec-bsd\n"); exit (0);
1404
 
#    endif
1405
 
#   endif
1406
 
#  else
1407
 
    printf ("vax-dec-bsd\n"); exit (0);
1408
 
#  endif
1409
 
# else
1410
 
    printf ("vax-dec-ultrix\n"); exit (0);
1411
 
# endif
1412
 
#endif
1413
 
 
1414
 
#if defined (alliant) && defined (i860)
1415
 
  printf ("i860-alliant-bsd\n"); exit (0);
1416
 
#endif
1417
 
 
1418
 
  exit (1);
1419
 
}
 
1419
echo "$0: unable to guess system type" >&2
 
1420
 
 
1421
case "$UNAME_MACHINE:$UNAME_SYSTEM" in
 
1422
    mips:Linux | mips64:Linux)
 
1423
        # If we got here on MIPS GNU/Linux, output extra information.
 
1424
        cat >&2 <<EOF
 
1425
 
 
1426
NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
 
1427
the system type. Please install a C compiler and try again.
1420
1428
EOF
1421
 
 
1422
 
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
1423
 
        { echo "$SYSTEM_NAME"; exit; }
1424
 
 
1425
 
# Apollos put the system type in the environment.
1426
 
 
1427
 
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
1428
 
 
1429
 
# Convex versions that predate uname can use getsysinfo(1)
1430
 
 
1431
 
if [ -x /usr/convex/getsysinfo ]
1432
 
then
1433
 
    case `getsysinfo -f cpu_type` in
1434
 
    c1*)
1435
 
        echo c1-convex-bsd
1436
 
        exit ;;
1437
 
    c2*)
1438
 
        if getsysinfo -f scalar_acc
1439
 
        then echo c32-convex-bsd
1440
 
        else echo c2-convex-bsd
1441
 
        fi
1442
 
        exit ;;
1443
 
    c34*)
1444
 
        echo c34-convex-bsd
1445
 
        exit ;;
1446
 
    c38*)
1447
 
        echo c38-convex-bsd
1448
 
        exit ;;
1449
 
    c4*)
1450
 
        echo c4-convex-bsd
1451
 
        exit ;;
1452
 
    esac
1453
 
fi
 
1429
        ;;
 
1430
esac
1454
1431
 
1455
1432
cat >&2 <<EOF
1456
 
$0: unable to guess system type
1457
 
 
1458
 
This script, last modified $timestamp, has failed to recognize
1459
 
the operating system you are using. It is advised that you
1460
 
download the most up to date version of the config scripts from
1461
 
 
1462
 
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
 
1433
 
 
1434
This script (version $timestamp), has failed to recognize the
 
1435
operating system you are using. If your script is old, overwrite *all*
 
1436
copies of config.guess and config.sub with the latest versions from:
 
1437
 
 
1438
  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
1463
1439
and
1464
 
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
 
1440
  https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
1465
1441
 
1466
 
If the version you run ($0) is already up to date, please
1467
 
send the following data and any information you think might be
1468
 
pertinent to <config-patches@gnu.org> in order to provide the needed
1469
 
information to handle your system.
 
1442
If $0 has already been updated, send the following data and any
 
1443
information you think might be pertinent to config-patches@gnu.org to
 
1444
provide the necessary information to handle your system.
1470
1445
 
1471
1446
config.guess timestamp = $timestamp
1472
1447
 
1485
1460
/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
1486
1461
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1487
1462
 
1488
 
UNAME_MACHINE = ${UNAME_MACHINE}
1489
 
UNAME_RELEASE = ${UNAME_RELEASE}
1490
 
UNAME_SYSTEM  = ${UNAME_SYSTEM}
1491
 
UNAME_VERSION = ${UNAME_VERSION}
 
1463
UNAME_MACHINE = "$UNAME_MACHINE"
 
1464
UNAME_RELEASE = "$UNAME_RELEASE"
 
1465
UNAME_SYSTEM  = "$UNAME_SYSTEM"
 
1466
UNAME_VERSION = "$UNAME_VERSION"
1492
1467
EOF
1493
1468
 
1494
1469
exit 1
1495
1470
 
1496
1471
# Local variables:
1497
 
# eval: (add-hook 'write-file-hooks 'time-stamp)
 
1472
# eval: (add-hook 'before-save-hook 'time-stamp)
1498
1473
# time-stamp-start: "timestamp='"
1499
1474
# time-stamp-format: "%:y-%02m-%02d"
1500
1475
# time-stamp-end: "'"