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, 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
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, 2005
57
57
Free Software Foundation, Inc.
59
59
This is free software; see the source for copying conditions. There is NO
98
98
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
99
99
# use `HOST_CC' if defined, but it is deprecated.
101
# This shell variable is my proudest work .. or something. --bje
101
# Portable tmp directory creation inspired by the Autoconf team.
103
set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
104
(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
105
|| (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
106
dummy=$tmpdir/dummy ;
107
files="$dummy.c $dummy.o $dummy.rel $dummy" ;
108
trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
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" ;
109
113
case $CC_FOR_BUILD,$HOST_CC,$CC in
110
114
,,) echo "int x;" > $dummy.c ;
111
115
for c in cc gcc c89 c99 ; do
195
197
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
196
198
echo "${machine}-${os}${release}"
201
echo x86_64-unknown-openbsd${UNAME_RELEASE}
198
203
amiga:OpenBSD:*:*)
199
204
echo m68k-unknown-openbsd${UNAME_RELEASE}
202
echo mipsel-unknown-openbsd${UNAME_RELEASE}
207
echo arm-unknown-openbsd${UNAME_RELEASE}
204
209
hp300:OpenBSD:*:*)
205
210
echo m68k-unknown-openbsd${UNAME_RELEASE}
213
echo m88k-unknown-openbsd${UNAME_RELEASE}
207
215
mac68k:OpenBSD:*:*)
208
216
echo m68k-unknown-openbsd${UNAME_RELEASE}
219
227
mvmeppc:OpenBSD:*:*)
220
228
echo powerpc-unknown-openbsd${UNAME_RELEASE}
223
echo mipsel-unknown-openbsd${UNAME_RELEASE}
226
echo mipseb-unknown-openbsd${UNAME_RELEASE}
231
echo mips64-unknown-openbsd${UNAME_RELEASE}
228
233
sun3:OpenBSD:*:*)
229
234
echo m68k-unknown-openbsd${UNAME_RELEASE}
232
echo mipsel-unknown-openbsd${UNAME_RELEASE}
235
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}
238
if test $UNAME_RELEASE = "V4.0"; then
249
case $UNAME_RELEASE in
239
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.
241
295
# A Vn.n version is a released version.
242
296
# A Tn.n version is a released field test version.
243
297
# A Xn.n version is an unreleased experimental baselevel.
244
298
# 1.2 uses "1.2" for uname -r.
245
eval $set_cc_for_build
249
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
256
.frame \$30,16,\$26,0
259
.long 0x47e03d80 # implver \$0
261
.long 0x47e20c21 # amask \$2,\$1
271
$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null
272
if test "$?" = 0 ; then
275
UNAME_MACHINE="alpha"
278
UNAME_MACHINE="alphaev5"
281
UNAME_MACHINE="alphaev56"
284
UNAME_MACHINE="alphapca56"
287
UNAME_MACHINE="alphaev6"
290
UNAME_MACHINE="alphaev67"
293
UNAME_MACHINE="alphaev68"
296
UNAME_MACHINE="alphaev7"
300
rm -f $dummy.s $dummy && rmdir $tmpdir
301
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'`
303
301
Alpha\ *:Windows_NT*:*)
304
302
# How do we know it's Interix rather than the generic POSIX subsystem?
637
645
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
638
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
639
rm -f $dummy.c $dummy && rmdir $tmpdir
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
642
660
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
732
749
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
735
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
738
752
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
741
755
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
758
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
743
760
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
744
761
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
745
762
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
746
763
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
747
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}"
749
771
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
750
772
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
756
778
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
759
# Determine whether the default compiler uses glibc.
760
eval $set_cc_for_build
761
sed 's/^ //' << EOF >$dummy.c
762
#include <features.h>
769
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
770
rm -f $dummy.c && rmdir $tmpdir
771
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
781
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
774
784
echo ${UNAME_MACHINE}-pc-cygwin
801
814
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
804
818
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
821
# other systems with GNU libc and userland
822
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
807
825
echo ${UNAME_MACHINE}-pc-minix
810
828
echo ${UNAME_MACHINE}-unknown-linux-gnu
831
echo cris-axis-linux-gnu
834
echo crisv32-axis-linux-gnu
837
echo frv-unknown-linux-gnu
813
840
echo ${UNAME_MACHINE}-unknown-linux-gnu
843
echo ${UNAME_MACHINE}-unknown-linux-gnu
816
846
echo ${UNAME_MACHINE}-unknown-linux-gnu
1146
1182
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
1149
echo `uname -p`-apple-darwin${UNAME_RELEASE}
1185
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
1186
case $UNAME_PROCESSOR in
1187
*86) UNAME_PROCESSOR=i686 ;;
1188
unknown) UNAME_PROCESSOR=powerpc ;;
1190
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
1151
1192
*:procnto*:*:* | *:QNX:[0123456789]*:*)
1152
1193
UNAME_PROCESSOR=`uname -p`
1201
1245
echo pdp10-unknown-its
1248
echo mips-sei-seiux${UNAME_RELEASE}
1251
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
1254
UNAME_MACHINE=`(uname -p) 2>/dev/null`
1255
case "${UNAME_MACHINE}" in
1256
A*) echo alpha-dec-vms && exit 0 ;;
1257
I*) echo ia64-dec-vms && exit 0 ;;
1258
V*) echo vax-dec-vms && exit 0 ;;
1205
1265
#echo '(No uname command or uname output not recognized.)' 1>&2