2
2
# Attempt to guess a canonical system name.
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
4
# Free Software Foundation, Inc.
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
# 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
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
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
22
23
# As a special exception to the GNU General Public License, if you
23
24
# distribute this file as part of a program that contains a
24
25
# configuration script generated by Autoconf, you may include it under
25
26
# the same distribution terms that you use for the rest of that program.
27
# Written by Per Bothner <bothner@cygnus.com>.
28
# Please send patches to <config-patches@gnu.org>.
29
# Originally written by Per Bothner <per@bothner.com>.
30
# Please send patches to <config-patches@gnu.org>. Submit a context
31
# diff and a properly formatted ChangeLog entry.
30
33
# This script attempts to guess a canonical system name similar to
31
34
# config.sub. If it succeeds, it prints the system name on stdout, and
52
55
GNU config.guess ($timestamp)
54
57
Originally written by Per Bothner.
55
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
58
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
56
59
Free Software Foundation, Inc.
58
61
This is free software; see the source for copying conditions. There is NO
92
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
94
# CC_FOR_BUILD -- compiler used by this script.
95
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
96
# compiler to aid in system detection is discouraged as it requires
97
# temporary files to be created and, as you can see below, it is a
98
# headache to deal with in a portable fashion.
95
100
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
96
101
# use `HOST_CC' if defined, but it is deprecated.
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
103
# Portable tmp directory creation inspired by the Autoconf team.
106
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
109
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
114
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
115
case $CC_FOR_BUILD,$HOST_CC,$CC in
116
,,) echo "int x;" > $dummy.c ;
117
for c in cc gcc c89 c99 ; do
118
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
103
119
CC_FOR_BUILD="$c"; break ;
106
rm -f $dummy.c $dummy.o $dummy.rel ;
107
122
if test x"$CC_FOR_BUILD" = x ; then
108
123
CC_FOR_BUILD=no_compiler_found ;
111
126
,,*) CC_FOR_BUILD=$CC ;;
112
127
,*,*) CC_FOR_BUILD=$HOST_CC ;;
115
130
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
116
131
# (ghazi@noc.rutgers.edu 1994-08-24)
128
143
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
130
# Netbsd (nbsd) targets should (where applicable) match one or
145
# NetBSD (nbsd) targets should (where applicable) match one or
131
146
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
132
147
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
133
148
# switched to ELF, *-*-netbsd* would select the old
134
149
# object file format. This provides both forward
135
150
# compatibility and a consistent mechanism for selecting the
136
151
# 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 ;;
153
# Note: NetBSD doesn't particularly care about the vendor
154
# portion of the name. We always set it to "unknown".
155
sysctl="sysctl -n hw.machine_arch"
156
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
157
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
158
case "${UNAME_MACHINE_ARCH}" in
159
armeb) machine=armeb-unknown ;;
160
arm*) machine=arm-unknown ;;
161
sh3el) machine=shl-unknown ;;
162
sh3eb) machine=sh-unknown ;;
163
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
149
165
# The Operating System including object format, if it has switched
150
166
# 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)
167
case "${UNAME_MACHINE_ARCH}" in
168
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
153
169
eval $set_cc_for_build
154
170
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
155
171
| grep __ELF__ >/dev/null
169
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
185
# Debian GNU/NetBSD machines have a different userland, and
186
# thus, need a distinct triplet. However, they do not need
187
# kernel version information, so it can be replaced with a
188
# suitable tag, in the style of linux-gnu.
189
case "${UNAME_VERSION}" in
194
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
170
197
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
171
198
# contains redundant information, the shorter form:
172
199
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
173
200
echo "${machine}-${os}${release}"
203
echo x86_64-unknown-openbsd${UNAME_RELEASE}
206
echo m68k-unknown-openbsd${UNAME_RELEASE}
209
echo arm-unknown-openbsd${UNAME_RELEASE}
212
echo m68k-unknown-openbsd${UNAME_RELEASE}
215
echo m88k-unknown-openbsd${UNAME_RELEASE}
218
echo m68k-unknown-openbsd${UNAME_RELEASE}
221
echo powerpc-unknown-openbsd${UNAME_RELEASE}
224
echo m68k-unknown-openbsd${UNAME_RELEASE}
227
echo m88k-unknown-openbsd${UNAME_RELEASE}
230
echo powerpc-unknown-openbsd${UNAME_RELEASE}
233
echo mips64-unknown-openbsd${UNAME_RELEASE}
236
echo m68k-unknown-openbsd${UNAME_RELEASE}
239
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
242
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
245
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
248
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
176
if test $UNAME_RELEASE = "V4.0"; then
251
case $UNAME_RELEASE in
177
253
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
256
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
259
# According to Compaq, /usr/sbin/psrinfo has been available on
260
# OSF/1 and Tru64 systems produced since 1995. I hope that
261
# covers most systems running today. This code pipes the CPU
262
# types through head -n 1, so we only detect the type of CPU 0.
263
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
264
case "$ALPHA_CPU_TYPE" in
266
UNAME_MACHINE="alpha" ;;
268
UNAME_MACHINE="alpha" ;;
269
"LCA4 (21066/21068)")
270
UNAME_MACHINE="alpha" ;;
272
UNAME_MACHINE="alphaev5" ;;
274
UNAME_MACHINE="alphaev56" ;;
276
UNAME_MACHINE="alphapca56" ;;
278
UNAME_MACHINE="alphapca57" ;;
280
UNAME_MACHINE="alphaev6" ;;
282
UNAME_MACHINE="alphaev67" ;;
284
UNAME_MACHINE="alphaev68" ;;
286
UNAME_MACHINE="alphaev68" ;;
288
UNAME_MACHINE="alphaev68" ;;
289
"EV6.9A (21264/EV69A)")
290
UNAME_MACHINE="alphaev69" ;;
292
UNAME_MACHINE="alphaev7" ;;
294
UNAME_MACHINE="alphaev79" ;;
296
# A Pn.n version is a patched version.
179
297
# A Vn.n version is a released version.
180
298
# A Tn.n version is a released field test version.
181
299
# A Xn.n version is an unreleased experimental baselevel.
182
300
# 1.2 uses "1.2" for uname -r.
186
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
193
.frame \$30,16,\$26,0
196
.long 0x47e03d80 # implver \$0
198
.long 0x47e20c21 # amask \$2,\$1
208
eval $set_cc_for_build
209
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
210
if test "$?" = 0 ; then
213
UNAME_MACHINE="alpha"
216
UNAME_MACHINE="alphaev5"
219
UNAME_MACHINE="alphaev56"
222
UNAME_MACHINE="alphapca56"
225
UNAME_MACHINE="alphaev6"
228
UNAME_MACHINE="alphaev67"
231
UNAME_MACHINE="alphaev68"
235
rm -f $dummy.s $dummy
236
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
301
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
238
303
Alpha\ *:Windows_NT*:*)
239
304
# How do we know it's Interix rather than the generic POSIX subsystem?
240
305
# Should we change UNAME_MACHINE based on the output of uname instead
241
306
# of the specific Alpha model?
242
307
echo alpha-pc-interix
244
309
21064:Windows_NT:50:3)
245
310
echo alpha-dec-winnt3.5
247
312
Amiga*:UNIX_System_V:4.0:*)
248
313
echo m68k-unknown-sysv4
251
echo m68k-unknown-openbsd${UNAME_RELEASE}
253
315
*:[Aa]miga[Oo][Ss]:*:*)
254
316
echo ${UNAME_MACHINE}-unknown-amigaos
257
echo mips64el-unknown-openbsd${UNAME_RELEASE}
260
echo mipsel-unknown-openbsd${UNAME_RELEASE}
263
echo mips-unknown-openbsd${UNAME_RELEASE}
266
echo mipsel-unknown-openbsd${UNAME_RELEASE}
269
echo mips-unknown-openbsd${UNAME_RELEASE}
272
echo mipsel-unknown-openbsd${UNAME_RELEASE}
318
*:[Mm]orph[Oo][Ss]:*:*)
319
echo ${UNAME_MACHINE}-unknown-morphos
275
322
echo i370-ibm-openedition
328
echo powerpc-ibm-os400
277
330
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
278
331
echo arm-acorn-riscix${UNAME_RELEASE}
333
arm:riscos:*:*|arm:RISCOS:*:*)
334
echo arm-unknown-riscos
280
336
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
281
337
echo hppa1.1-hitachi-hiuxmpp
283
339
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
284
340
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
285
341
if test "`(/bin/universe) 2>/dev/null`" = att ; then
350
407
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
351
408
echo m68k-atari-mint${UNAME_RELEASE}
353
410
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
354
411
echo m68k-atari-mint${UNAME_RELEASE}
356
413
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
357
414
echo m68k-atari-mint${UNAME_RELEASE}
359
416
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
360
417
echo m68k-milan-mint${UNAME_RELEASE}
362
419
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
363
420
echo m68k-hades-mint${UNAME_RELEASE}
365
422
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
366
423
echo m68k-unknown-mint${UNAME_RELEASE}
369
echo m68k-unknown-openbsd${UNAME_RELEASE}
372
echo m68k-unknown-openbsd${UNAME_RELEASE}
375
echo m68k-unknown-openbsd${UNAME_RELEASE}
378
echo m88k-unknown-openbsd${UNAME_RELEASE}
426
echo m68k-apple-machten${UNAME_RELEASE}
380
428
powerpc:machten:*:*)
381
429
echo powerpc-apple-machten${UNAME_RELEASE}
384
432
echo mips-dec-mach_bsd4.3
386
434
RISC*:ULTRIX:*:*)
387
435
echo mips-dec-ultrix${UNAME_RELEASE}
389
437
VAX*:ULTRIX*:*:*)
390
438
echo vax-dec-ultrix${UNAME_RELEASE}
392
440
2020:CLIX:*:* | 2430:CLIX:*:*)
393
441
echo clipper-intergraph-clix${UNAME_RELEASE}
395
443
mips:*:*:UMIPS | mips:*:*:RISCos)
396
444
eval $set_cc_for_build
397
445
sed 's/^ //' << EOF >$dummy.c
418
$CC_FOR_BUILD $dummy.c -o $dummy \
419
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
420
&& rm -f $dummy.c $dummy && exit 0
421
rm -f $dummy.c $dummy
466
$CC_FOR_BUILD -o $dummy $dummy.c &&
467
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
468
SYSTEM_NAME=`$dummy $dummyarg` &&
469
{ echo "$SYSTEM_NAME"; exit; }
422
470
echo mips-mips-riscos${UNAME_RELEASE}
424
472
Motorola:PowerMAX_OS:*:*)
425
473
echo powerpc-motorola-powermax
475
Motorola:*:4.3:PL8-*)
476
echo powerpc-harris-powermax
478
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
479
echo powerpc-harris-powermax
427
481
Night_Hawk:Power_UNIX:*:*)
428
482
echo powerpc-harris-powerunix
431
485
echo m88k-harris-cxux7
434
488
echo m88k-motorola-sysv4
437
491
echo m88k-motorola-sysv3
440
494
# DG/UX returns AViiON for all architectures
441
495
UNAME_PROCESSOR=`/usr/bin/uname -p`
518
575
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
520
577
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
523
580
echo rs6000-ibm-aix
525
582
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
526
583
echo romp-ibm-bsd4.4
528
585
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
529
586
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
530
exit 0 ;; # report: romp-ibm BSD 4.3
587
exit ;; # report: romp-ibm BSD 4.3
532
589
echo rs6000-bull-bosx
534
591
DPX/2?00:B.O.S.:*:*)
535
592
echo m68k-bull-sysv3
537
594
9000/[34]??:4.3bsd:1.*:*)
540
597
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
541
598
echo m68k-hp-bsd4.4
543
600
9000/[34678]??:HP-UX:*:*)
544
601
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
545
602
case "${UNAME_MACHINE}" in
546
603
9000/31? ) HP_ARCH=m68000 ;;
547
604
9000/[34]?? ) HP_ARCH=m68k ;;
548
605
9000/[678][0-9][0-9])
549
case "${HPUX_REV}" in
551
if [ -x /usr/bin/getconf ]; then
552
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
606
if [ -x /usr/bin/getconf ]; then
607
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
553
608
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
554
609
case "${sc_cpu_version}" in
555
610
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
600
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
601
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
602
rm -f $dummy.c $dummy
655
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
656
test -z "$HP_ARCH" && HP_ARCH=hppa
659
if [ ${HP_ARCH} = "hppa2.0w" ]
661
# avoid double evaluation of $set_cc_for_build
662
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
664
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
665
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
666
# generating 64-bit code. GNU and HP use different nomenclature:
668
# $ CC_FOR_BUILD=cc ./config.guess
669
# => hppa2.0w-hp-hpux11.23
670
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
671
# => hppa64-hp-hpux11.23
673
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
674
grep __LP64__ >/dev/null
605
681
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
608
684
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
609
685
echo ia64-hp-hpux${HPUX_REV}
612
688
eval $set_cc_for_build
613
689
sed 's/^ //' << EOF >$dummy.c
638
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
639
rm -f $dummy.c $dummy
714
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
715
{ echo "$SYSTEM_NAME"; exit; }
640
716
echo unknown-hitachi-hiuxwe2
642
718
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
643
719
echo hppa1.1-hp-bsd
645
721
9000/8??:4.3bsd:*:*)
646
722
echo hppa1.0-hp-bsd
648
724
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
649
725
echo hppa1.0-hp-mpeix
651
727
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
652
728
echo hppa1.1-hp-osf
655
731
echo hppa1.0-hp-osf
658
734
if [ -x /usr/sbin/sysversion ] ; then
659
735
echo ${UNAME_MACHINE}-unknown-osf1mk
661
737
echo ${UNAME_MACHINE}-unknown-osf1
664
740
parisc*:Lites*:*:*)
665
741
echo hppa1.1-hp-lites
668
echo hppa-unknown-openbsd
670
743
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
671
744
echo c1-convex-bsd
673
746
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
674
747
if getsysinfo -f scalar_acc
675
748
then echo c32-convex-bsd
676
749
else echo c2-convex-bsd
679
752
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
680
753
echo c34-convex-bsd
682
755
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
683
756
echo c38-convex-bsd
685
758
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
686
759
echo c4-convex-bsd
692
762
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
694
764
CRAY*[A-Z]90:*:*:*)
695
765
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
696
766
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
697
767
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
698
768
-e 's/\.[^.]*$/.X/'
701
771
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
704
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
707
774
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
710
777
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
713
echo cray2-cray-unicos
780
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
715
782
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
716
783
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
717
784
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
718
785
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
719
786
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
722
echo m68k-unknown-openbsd${UNAME_RELEASE}
788
5000:UNIX_System_V:4.*:*)
789
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
790
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
791
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
724
793
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
725
794
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
727
796
sparc*:BSD/OS:*:*)
728
797
echo sparc-unknown-bsdi${UNAME_RELEASE}
731
800
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
734
803
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
737
echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
740
806
echo ${UNAME_MACHINE}-pc-cygwin
808
i*:MINGW*:* | i*:windows32*:*)
743
809
echo ${UNAME_MACHINE}-pc-mingw32
746
812
echo ${UNAME_MACHINE}-pc-pw32
815
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
817
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
818
echo i${UNAME_MACHINE}-pc-mks
748
820
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
749
821
# How do we know it's Interix rather than the generic POSIX subsystem?
750
822
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
751
823
# UNAME_MACHINE based on the output of uname instead of i386?
755
827
echo ${UNAME_MACHINE}-pc-uwin
830
echo x86_64-unknown-cygwin
758
833
echo powerpcle-unknown-cygwin
760
835
prep*:SunOS:5.*:*)
761
836
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
764
840
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
843
# other systems with GNU libc and userland
844
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
767
847
echo ${UNAME_MACHINE}-pc-minix
770
850
echo ${UNAME_MACHINE}-unknown-linux-gnu
853
echo cris-axis-linux-gnu
856
echo crisv32-axis-linux-gnu
859
echo frv-unknown-linux-gnu
773
echo ${UNAME_MACHINE}-unknown-linux
862
echo ${UNAME_MACHINE}-unknown-linux-gnu
865
echo ${UNAME_MACHINE}-unknown-linux-gnu
776
868
echo ${UNAME_MACHINE}-unknown-linux-gnu
779
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
780
big) echo mips-unknown-linux-gnu && exit 0 ;;
781
little) echo mipsel-unknown-linux-gnu && exit 0 ;;
871
eval $set_cc_for_build
872
sed 's/^ //' << EOF >$dummy.c
876
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
879
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
886
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
887
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
890
eval $set_cc_for_build
891
sed 's/^ //' << EOF >$dummy.c
895
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
898
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
905
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
906
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
785
909
echo powerpc-unknown-linux-gnu
788
912
echo powerpc64-unknown-linux-gnu
791
915
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
792
916
EV5) UNAME_MACHINE=alphaev5 ;;
808
932
PA8*) echo hppa2.0-unknown-linux-gnu ;;
809
933
*) echo hppa-unknown-linux-gnu ;;
812
936
parisc64:Linux:*:* | hppa64:Linux:*:*)
813
937
echo hppa64-unknown-linux-gnu
815
939
s390:Linux:*:* | s390x:Linux:*:*)
816
940
echo ${UNAME_MACHINE}-ibm-linux
943
echo ${UNAME_MACHINE}-unknown-linux-gnu
819
946
echo ${UNAME_MACHINE}-unknown-linux-gnu
821
948
sparc:Linux:*:* | sparc64:Linux:*:*)
822
949
echo ${UNAME_MACHINE}-unknown-linux-gnu
824
951
x86_64:Linux:*:*)
825
952
echo x86_64-unknown-linux-gnu
828
955
# The BFD linker knows what the default object file format is, so
829
956
# first see if it will tell us. cd to the root directory to prevent
830
957
# problems with other programs or directories called `ld' in the path.
831
ld_supported_targets=`cd /; ld --help 2>&1 \
958
# Set LC_ALL=C to ensure ld outputs messages in English.
959
ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
832
960
| sed -ne '/supported targets:/!d
834
962
s/.*supported targets: *//
841
969
a.out-i386-linux)
842
970
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
845
973
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
848
976
# Either a pre-BFD a.out linker (linux-gnuoldld) or
849
977
# one that does not give us useful --help.
850
978
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
853
981
# Determine whether the default compiler is a.out or elf
854
982
eval $set_cc_for_build
856
#include <features.h>
858
#include <stdio.h> /* for printf() prototype */
859
int main (int argc, char *argv[]) {
861
int main (argc, argv) int argc; char *argv[]; {
866
printf ("%s-pc-linux-gnu\n", argv[1]);
868
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
871
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
874
printf ("%s-pc-linux-gnuaout\n", argv[1]);
983
sed 's/^ //' << EOF >$dummy.c
984
#include <features.h>
996
#ifdef __INTEL_COMPILER
879
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
880
rm -f $dummy.c $dummy
881
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
1006
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
1007
test x"${LIBC}" != x && {
1008
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
1011
test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
883
1013
i*86:DYNIX/ptx:4*:*)
884
1014
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
885
1015
# earlier versions are messed up and put the nodename in both
886
1016
# sysname and nodename.
887
1017
echo i386-sequent-sysv4
889
1019
i*86:UNIX_SV:4.2MP:2.*)
890
1020
# Unixware is an offshoot of SVR4, but it has its own version
891
1021
# number series starting with 2...
902
1052
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
1056
# UnixWare 7.x, OpenUNIX and OpenServer 6.
906
1057
case `/bin/uname -X | grep "^Machine"` in
907
1058
*486*) UNAME_MACHINE=i486 ;;
908
1059
*Pentium) UNAME_MACHINE=i586 ;;
909
1060
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
911
1062
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
914
1065
if test -f /usr/options/cb.name; then
915
1066
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
916
1067
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
917
1068
elif /bin/uname -X 2>/dev/null >/dev/null ; then
918
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
919
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
920
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
1069
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1070
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1071
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
921
1072
&& UNAME_MACHINE=i586
922
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
1073
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
923
1074
&& UNAME_MACHINE=i686
924
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
1075
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
925
1076
&& UNAME_MACHINE=i686
926
1077
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
928
1079
echo ${UNAME_MACHINE}-pc-sysv32
932
echo ${UNAME_MACHINE}-pc-msdosdjgpp
935
1083
# Left here for compatibility:
936
1084
# uname -m prints for DJGPP always 'pc', but it prints nothing about
937
1085
# the processor, so we play safe by assuming i386.
938
1086
echo i386-pc-msdosdjgpp
940
1088
Intel:Mach:3*:*)
941
1089
echo i386-pc-mach3
944
1092
echo i860-intel-osf1
946
1094
i860:*:4.*:*) # i860-SVR4
947
1095
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
948
1096
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
949
1097
else # Add other i860-SVR4 vendors below as they are discovered.
950
1098
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
953
1101
mini*:CTIX:SYS*5:*)
955
1103
echo m68010-convergent-sysv
958
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
959
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
1105
mc68k:UNIX:SYSTEM5:3.51m)
1106
echo m68k-convergent-sysv
1111
M68*:*:R3V[5678]*:*)
1112
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
1113
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 | S7501*:*:4.0:3.0)
961
1115
test -r /etc/.relid \
962
1116
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
963
1117
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
964
&& echo i486-ncr-sysv4.3${OS_REL} && exit 0
1118
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
965
1119
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
966
&& echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
1120
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
967
1121
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
968
1122
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
969
&& echo i486-ncr-sysv4 && exit 0 ;;
1123
&& { echo i486-ncr-sysv4; exit; } ;;
970
1124
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
971
1125
echo m68k-unknown-lynxos${UNAME_RELEASE}
973
1127
mc68030:UNIX_System_V:4.*:*)
974
1128
echo m68k-atari-sysv4
976
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
977
echo i386-unknown-lynxos${UNAME_RELEASE}
979
1130
TSUNAMI:LynxOS:2.*:*)
980
1131
echo sparc-unknown-lynxos${UNAME_RELEASE}
982
1133
rs6000:LynxOS:2.*:*)
983
1134
echo rs6000-unknown-lynxos${UNAME_RELEASE}
985
1136
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
986
1137
echo powerpc-unknown-lynxos${UNAME_RELEASE}
988
1139
SM[BE]S:UNIX_SV:*:*)
989
1140
echo mips-dde-sysv${UNAME_RELEASE}
991
1142
RM*:ReliantUNIX-*:*:*)
992
1143
echo mips-sni-sysv4
994
1145
RM*:SINIX-*:*:*)
995
1146
echo mips-sni-sysv4
998
1149
if uname -p 2>/dev/null >/dev/null ; then
999
1150
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1002
1153
echo ns32k-sni-sysv
1005
1156
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
1006
1157
# says <Richard.M.Bartel@ccMail.Census.GOV>
1007
1158
echo i586-unisys-sysv4
1009
1160
*:UNIX_System_V:4*:FTX*)
1010
1161
# From Gerald Hewes <hewes@openmarket.com>.
1011
1162
# How about differentiating between stratus architectures? -djm
1012
1163
echo hppa1.1-stratus-sysv4
1015
1166
# From seanf@swdc.stratus.com.
1016
1167
echo i860-stratus-sysv4
1170
# From Paul.Green@stratus.com.
1171
echo ${UNAME_MACHINE}-stratus-vos
1019
1174
# From Paul.Green@stratus.com.
1020
1175
echo hppa1.1-stratus-vos
1022
1177
mc68*:A/UX:*:*)
1023
1178
echo m68k-apple-aux${UNAME_RELEASE}
1025
1180
news*:NEWS-OS:6*:*)
1026
1181
echo mips-sony-newsos6
1028
1183
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
1029
1184
if [ -d /usr/nec ]; then
1030
1185
echo mips-nec-sysv${UNAME_RELEASE}
1032
1187
echo mips-unknown-sysv${UNAME_RELEASE}
1035
1190
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
1036
1191
echo powerpc-be-beos
1038
1193
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
1039
1194
echo powerpc-apple-beos
1041
1196
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
1042
1197
echo i586-pc-beos
1044
1199
SX-4:SUPER-UX:*:*)
1045
1200
echo sx4-nec-superux${UNAME_RELEASE}
1047
1202
SX-5:SUPER-UX:*:*)
1048
1203
echo sx5-nec-superux${UNAME_RELEASE}
1206
echo sx6-nec-superux${UNAME_RELEASE}
1050
1208
Power*:Rhapsody:*:*)
1051
1209
echo powerpc-apple-rhapsody${UNAME_RELEASE}
1053
1211
*:Rhapsody:*:*)
1054
1212
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1057
echo `uname -p`-apple-darwin${UNAME_RELEASE}
1215
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1216
case $UNAME_PROCESSOR in
1217
*86) UNAME_PROCESSOR=i686 ;;
1218
unknown) UNAME_PROCESSOR=powerpc ;;
1220
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1059
1222
*:procnto*:*:* | *:QNX:[0123456789]*:*)
1060
if test "${UNAME_MACHINE}" = "x86pc"; then
1223
UNAME_PROCESSOR=`uname -p`
1224
if test "$UNAME_PROCESSOR" = "x86"; then
1225
UNAME_PROCESSOR=i386
1061
1226
UNAME_MACHINE=pc
1063
echo `uname -p`-${UNAME_MACHINE}-nto-qnx
1228
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
1066
1231
echo i386-pc-qnx
1068
NSR-[KW]:NONSTOP_KERNEL:*:*)
1233
NSE-?:NONSTOP_KERNEL:*:*)
1234
echo nse-tandem-nsk${UNAME_RELEASE}
1236
NSR-?:NONSTOP_KERNEL:*:*)
1069
1237
echo nsr-tandem-nsk${UNAME_RELEASE}
1071
1239
*:NonStop-UX:*:*)
1072
1240
echo mips-compaq-nonstopux
1074
1242
BS2000:POSIX*:*:*)
1075
1243
echo bs2000-siemens-sysv
1077
1245
DS/*:UNIX_System_V:*:*)
1078
1246
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
1081
1249
# "uname -m" is not consistent, so use $cputype instead. 386
1082
1250
# is converted to i386 for consistency with other x86
1087
1255
UNAME_MACHINE="$cputype"
1089
1257
echo ${UNAME_MACHINE}-unknown-plan9
1092
# If we were able to find `uname', then EMX Unix compatibility
1093
# is probably installed.
1094
echo ${UNAME_MACHINE}-pc-os2-emx
1097
1260
echo pdp10-unknown-tops10
1100
1263
echo pdp10-unknown-tenex
1102
1265
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
1103
1266
echo pdp10-dec-tops20
1105
1268
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
1106
1269
echo pdp10-xkl-tops20
1109
1272
echo pdp10-unknown-tops20
1112
1275
echo pdp10-unknown-its
1114
i*86:XTS-300:*:STOP)
1115
echo ${UNAME_MACHINE}-unknown-stop
1118
echo ${UNAME_MACHINE}-unknown-atheos
1278
echo mips-sei-seiux${UNAME_RELEASE}
1281
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1284
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1285
case "${UNAME_MACHINE}" in
1286
A*) echo alpha-dec-vms ; exit ;;
1287
I*) echo ia64-dec-vms ; exit ;;
1288
V*) echo vax-dec-vms ; exit ;;
1294
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
1122
1298
#echo '(No uname command or uname output not recognized.)' 1>&2