2
2
# Attempt to guess a canonical system name.
3
3
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4
# 2000, 2001, 2002 Free Software Foundation, Inc.
4
# 2000, 2001, 2002, 2003, 2004 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
53
53
GNU config.guess ($timestamp)
55
55
Originally written by Per Bothner.
56
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
56
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
57
57
Free Software Foundation, Inc.
59
59
This is free software; see the source for copying conditions. There is NO
93
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
95
# CC_FOR_BUILD -- compiler used by this script.
93
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
94
# compiler to aid in system detection is discouraged as it requires
95
# temporary files to be created and, as you can see below, it is a
96
# headache to deal with in a portable fashion.
96
98
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
97
99
# use `HOST_CC' if defined, but it is deprecated.
99
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
100
,,) echo "int dummy(){}" > $dummy.c ;
101
# Portable tmp directory creation inspired by the Autoconf team.
104
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
105
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
107
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
108
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
109
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
110
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
112
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
113
case $CC_FOR_BUILD,$HOST_CC,$CC in
114
,,) echo "int x;" > $dummy.c ;
101
115
for c in cc gcc c89 c99 ; do
102
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
103
if test $? = 0 ; then
116
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
104
117
CC_FOR_BUILD="$c"; break ;
107
rm -f $dummy.c $dummy.o $dummy.rel ;
108
120
if test x"$CC_FOR_BUILD" = x ; then
109
121
CC_FOR_BUILD=no_compiler_found ;
112
124
,,*) CC_FOR_BUILD=$CC ;;
113
125
,*,*) CC_FOR_BUILD=$HOST_CC ;;
116
128
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
117
129
# (ghazi@noc.rutgers.edu 1994-08-24)
170
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
183
# Debian GNU/NetBSD machines have a different userland, and
184
# thus, need a distinct triplet. However, they do not need
185
# kernel version information, so it can be replaced with a
186
# suitable tag, in the style of linux-gnu.
187
case "${UNAME_VERSION}" in
192
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
171
195
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
172
196
# contains redundant information, the shorter form:
173
197
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
174
198
echo "${machine}-${os}${release}"
201
echo x86_64-unknown-openbsd${UNAME_RELEASE}
176
203
amiga:OpenBSD:*:*)
177
204
echo m68k-unknown-openbsd${UNAME_RELEASE}
180
echo mipsel-unknown-openbsd${UNAME_RELEASE}
207
echo arm-unknown-openbsd${UNAME_RELEASE}
182
209
hp300:OpenBSD:*:*)
183
210
echo m68k-unknown-openbsd${UNAME_RELEASE}
213
echo m88k-unknown-openbsd${UNAME_RELEASE}
185
215
mac68k:OpenBSD:*:*)
186
216
echo m68k-unknown-openbsd${UNAME_RELEASE}
197
227
mvmeppc:OpenBSD:*:*)
198
228
echo powerpc-unknown-openbsd${UNAME_RELEASE}
201
echo mipsel-unknown-openbsd${UNAME_RELEASE}
204
echo mipseb-unknown-openbsd${UNAME_RELEASE}
231
echo mips64-unknown-openbsd${UNAME_RELEASE}
206
233
sun3:OpenBSD:*:*)
207
234
echo m68k-unknown-openbsd${UNAME_RELEASE}
210
echo mipsel-unknown-openbsd${UNAME_RELEASE}
213
237
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
240
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
243
echo powerppc-unknown-mirbsd${UNAME_RELEASE}
246
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
216
if test $UNAME_RELEASE = "V4.0"; then
249
case $UNAME_RELEASE in
217
251
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
254
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
257
# According to Compaq, /usr/sbin/psrinfo has been available on
258
# OSF/1 and Tru64 systems produced since 1995. I hope that
259
# covers most systems running today. This code pipes the CPU
260
# types through head -n 1, so we only detect the type of CPU 0.
261
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
262
case "$ALPHA_CPU_TYPE" in
264
UNAME_MACHINE="alpha" ;;
266
UNAME_MACHINE="alpha" ;;
267
"LCA4 (21066/21068)")
268
UNAME_MACHINE="alpha" ;;
270
UNAME_MACHINE="alphaev5" ;;
272
UNAME_MACHINE="alphaev56" ;;
274
UNAME_MACHINE="alphapca56" ;;
276
UNAME_MACHINE="alphapca57" ;;
278
UNAME_MACHINE="alphaev6" ;;
280
UNAME_MACHINE="alphaev67" ;;
282
UNAME_MACHINE="alphaev68" ;;
284
UNAME_MACHINE="alphaev68" ;;
286
UNAME_MACHINE="alphaev68" ;;
287
"EV6.9A (21264/EV69A)")
288
UNAME_MACHINE="alphaev69" ;;
290
UNAME_MACHINE="alphaev7" ;;
292
UNAME_MACHINE="alphaev79" ;;
294
# A Pn.n version is a patched version.
219
295
# A Vn.n version is a released version.
220
296
# A Tn.n version is a released field test version.
221
297
# A Xn.n version is an unreleased experimental baselevel.
222
298
# 1.2 uses "1.2" for uname -r.
226
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
233
.frame \$30,16,\$26,0
236
.long 0x47e03d80 # implver \$0
238
.long 0x47e20c21 # amask \$2,\$1
248
eval $set_cc_for_build
249
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
250
if test "$?" = 0 ; then
253
UNAME_MACHINE="alpha"
256
UNAME_MACHINE="alphaev5"
259
UNAME_MACHINE="alphaev56"
262
UNAME_MACHINE="alphapca56"
265
UNAME_MACHINE="alphaev6"
268
UNAME_MACHINE="alphaev67"
271
UNAME_MACHINE="alphaev68"
275
rm -f $dummy.s $dummy
276
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
299
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
278
301
Alpha\ *:Windows_NT*:*)
279
302
# How do we know it's Interix rather than the generic POSIX subsystem?
422
$CC_FOR_BUILD $dummy.c -o $dummy \
423
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
424
&& rm -f $dummy.c $dummy && exit 0
425
rm -f $dummy.c $dummy
461
$CC_FOR_BUILD -o $dummy $dummy.c \
462
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
426
464
echo mips-mips-riscos${UNAME_RELEASE}
428
466
Motorola:PowerMAX_OS:*:*)
429
467
echo powerpc-motorola-powermax
469
Motorola:*:4.3:PL8-*)
470
echo powerpc-harris-powermax
472
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
473
echo powerpc-harris-powermax
431
475
Night_Hawk:Power_UNIX:*:*)
432
476
echo powerpc-harris-powerunix
602
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
603
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
604
rm -f $dummy.c $dummy
645
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
646
test -z "$HP_ARCH" && HP_ARCH=hppa
649
if [ ${HP_ARCH} = "hppa2.0w" ]
651
# avoid double evaluation of $set_cc_for_build
652
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
653
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
607
660
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
697
749
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
700
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
703
752
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
706
755
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
758
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
708
760
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
709
761
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
710
762
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
711
763
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
712
764
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
766
5000:UNIX_System_V:4.*:*)
767
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
768
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
769
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
714
771
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
715
772
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
733
790
echo ${UNAME_MACHINE}-pc-pw32
736
echo i386-pc-interix3
793
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
795
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
796
echo i${UNAME_MACHINE}-pc-mks
738
798
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
739
799
# How do we know it's Interix rather than the generic POSIX subsystem?
740
800
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
741
801
# UNAME_MACHINE based on the output of uname instead of i386?
745
805
echo ${UNAME_MACHINE}-pc-uwin
751
811
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
754
815
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
818
# other systems with GNU libc and userland
819
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
757
822
echo ${UNAME_MACHINE}-pc-minix
760
825
echo ${UNAME_MACHINE}-unknown-linux-gnu
828
echo cris-axis-linux-gnu
831
echo crisv32-axis-linux-gnu
834
echo frv-unknown-linux-gnu
763
837
echo ${UNAME_MACHINE}-unknown-linux-gnu
840
echo ${UNAME_MACHINE}-unknown-linux-gnu
766
843
echo ${UNAME_MACHINE}-unknown-linux-gnu
784
861
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
786
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
862
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
865
eval $set_cc_for_build
866
sed 's/^ //' << EOF >$dummy.c
870
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
873
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
880
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
881
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
789
884
echo powerpc-unknown-linux-gnu
896
996
# Use sysv4.2uw... so that sysv4* matches it.
897
997
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
1000
# If we were able to find `uname', then EMX Unix compatibility
1001
# is probably installed.
1002
echo ${UNAME_MACHINE}-pc-os2-emx
1004
i*86:XTS-300:*:STOP)
1005
echo ${UNAME_MACHINE}-unknown-stop
1008
echo ${UNAME_MACHINE}-unknown-atheos
1011
echo ${UNAME_MACHINE}-pc-syllable
1013
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
1014
echo i386-unknown-lynxos${UNAME_RELEASE}
1017
echo ${UNAME_MACHINE}-pc-msdosdjgpp
899
1019
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
900
1020
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
901
1021
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
917
1037
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
918
1038
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
919
1039
elif /bin/uname -X 2>/dev/null >/dev/null ; then
920
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
921
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
922
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
1040
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
1041
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
1042
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
923
1043
&& UNAME_MACHINE=i586
924
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
1044
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
925
1045
&& UNAME_MACHINE=i686
926
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
1046
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
927
1047
&& UNAME_MACHINE=i686
928
1048
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
930
1050
echo ${UNAME_MACHINE}-pc-sysv32
934
echo ${UNAME_MACHINE}-pc-msdosdjgpp
937
1054
# Left here for compatibility:
938
1055
# uname -m prints for DJGPP always 'pc', but it prints nothing about
957
1074
echo m68010-convergent-sysv
1076
mc68k:UNIX:SYSTEM5:3.51m)
1077
echo m68k-convergent-sysv
1082
M68*:*:R3V[5678]*:*)
960
1083
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
961
3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
1084
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
963
1086
test -r /etc/.relid \
964
1087
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
1056
1179
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1059
echo `uname -p`-apple-darwin${UNAME_RELEASE}
1182
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1183
case $UNAME_PROCESSOR in
1184
*86) UNAME_PROCESSOR=i686 ;;
1185
unknown) UNAME_PROCESSOR=powerpc ;;
1187
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1061
1189
*:procnto*:*:* | *:QNX:[0123456789]*:*)
1062
1190
UNAME_PROCESSOR=`uname -p`
1116
1239
echo pdp10-unknown-its
1118
i*86:XTS-300:*:STOP)
1119
echo ${UNAME_MACHINE}-unknown-stop
1122
echo ${UNAME_MACHINE}-unknown-atheos
1242
echo mips-sei-seiux${UNAME_RELEASE}
1245
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1248
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1249
case "${UNAME_MACHINE}" in
1250
A*) echo alpha-dec-vms && exit 0 ;;
1251
I*) echo ia64-dec-vms && exit 0 ;;
1252
V*) echo vax-dec-vms && exit 0 ;;