30
32
# exits with 0. Otherwise, it exits with 1.
32
34
# The plan is that this can be called by configure scripts if you
33
# don't specify an explicit system type (host/target name).
35
# Only a few systems have been added to this list; please add others
36
# (but try to keep the structure clean).
39
# Use $HOST_CC if defined. $CC may point to a cross-compiler
40
if test x"$CC_FOR_BUILD" = x; then
41
if test x"$HOST_CC" != x; then
42
CC_FOR_BUILD="$HOST_CC"
44
if test x"$CC" != x; then
35
# don't specify an explicit build system type.
37
me=`echo "$0" | sed -e 's,.*/,,'`
42
Output the configuration name of the system \`$me' is run on.
45
-h, --help print this help, then exit
46
-t, --time-stamp print date of last modification, then exit
47
-v, --version print version number, then exit
49
Report bugs and patches to <config-patches@gnu.org>."
52
GNU config.guess ($timestamp)
54
Originally written by Per Bothner.
55
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
56
Free Software Foundation, Inc.
58
This is free software; see the source for copying conditions. There is NO
59
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
62
Try \`$me --help' for more information."
65
while test $# -gt 0 ; do
67
--time-stamp | --time* | -t )
68
echo "$timestamp" ; exit 0 ;;
70
echo "$version" ; exit 0 ;;
72
echo "$usage"; exit 0 ;;
73
-- ) # Stop option processing
75
- ) # Use stdin as input.
78
echo "$me: invalid option $1$help" >&2
86
echo "$me: too many arguments$help" >&2
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
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
96
# 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
CC_FOR_BUILD="$c"; break ;
106
rm -f $dummy.c $dummy.o $dummy.rel ;
107
if test x"$CC_FOR_BUILD" = x ; then
108
CC_FOR_BUILD=no_compiler_found ;
111
,,*) CC_FOR_BUILD=$CC ;;
112
,*,*) CC_FOR_BUILD=$HOST_CC ;;
53
115
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
54
# (ghazi@noc.rutgers.edu 8/24/94.)
116
# (ghazi@noc.rutgers.edu 1994-08-24)
55
117
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
56
118
PATH=$PATH:/.attbin ; export PATH
59
121
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
60
122
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
61
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
123
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
62
124
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
65
trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15
67
126
# Note: order is significant - the case branches are not exclusive.
69
128
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
87
146
ibmrt|romp-ibm) machine=romp-ibm ;;
88
147
*) machine=${UNAME_MACHINE}-unknown ;;
90
# The Operating System including object format.
91
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
92
| grep __ELF__ >/dev/null
94
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
95
# Return netbsd for either. FIX?
149
# The Operating System including object format, if it has switched
150
# 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)
153
eval $set_cc_for_build
154
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
155
| grep __ELF__ >/dev/null
157
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
158
# Return netbsd for either. FIX?
101
169
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
102
170
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
646
757
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
760
echo ${UNAME_MACHINE}-pc-minix
763
echo ${UNAME_MACHINE}-unknown-linux-gnu
766
echo ${UNAME_MACHINE}-unknown-linux
769
echo ${UNAME_MACHINE}-unknown-linux-gnu
772
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
773
big) echo mips-unknown-linux-gnu && exit 0 ;;
774
little) echo mipsel-unknown-linux-gnu && exit 0 ;;
778
echo powerpc-unknown-linux-gnu
781
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
782
EV5) UNAME_MACHINE=alphaev5 ;;
783
EV56) UNAME_MACHINE=alphaev56 ;;
784
PCA56) UNAME_MACHINE=alphapca56 ;;
785
PCA57) UNAME_MACHINE=alphapca56 ;;
786
EV6) UNAME_MACHINE=alphaev6 ;;
787
EV67) UNAME_MACHINE=alphaev67 ;;
788
EV68*) UNAME_MACHINE=alphaev67 ;;
790
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
791
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
792
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
794
parisc:Linux:*:* | hppa:Linux:*:*)
796
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
797
PA7*) echo hppa1.1-unknown-linux-gnu ;;
798
PA8*) echo hppa2.0-unknown-linux-gnu ;;
799
*) echo hppa-unknown-linux-gnu ;;
802
parisc64:Linux:*:* | hppa64:Linux:*:*)
803
echo hppa64-unknown-linux-gnu
805
s390:Linux:*:* | s390x:Linux:*:*)
806
echo ${UNAME_MACHINE}-ibm-linux
809
echo ${UNAME_MACHINE}-unknown-linux-gnu
811
sparc:Linux:*:* | sparc64:Linux:*:*)
812
echo ${UNAME_MACHINE}-unknown-linux-gnu
815
echo x86_64-unknown-linux-gnu
650
818
# The BFD linker knows what the default object file format is, so
651
819
# first see if it will tell us. cd to the root directory to prevent
652
820
# problems with other programs or directories called `ld' in the path.
653
ld_help_string=`cd /; ld --help 2>&1`
654
ld_supported_emulations=`echo $ld_help_string \
655
| sed -ne '/supported emulations:/!d
821
ld_supported_targets=`cd /; ld --help 2>&1 \
822
| sed -ne '/supported targets:/!d
657
s/.*supported emulations: *//
824
s/.*supported targets: *//
660
case "$ld_supported_emulations" in
662
echo "${UNAME_MACHINE}-unknown-linux"
827
case "$ld_supported_targets" in
829
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
666
832
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
670
echo "${UNAME_MACHINE}-pc-linux"
674
835
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
678
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
682
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
686
echo "${UNAME_MACHINE}-unknown-linux-gnuoldld"
690
echo "${UNAME_MACHINE}-unknown-linux-gnu"
694
echo "${UNAME_MACHINE}-unknown-linux-gnuaout"
697
elf32ppc | elf32ppclinux)
698
# Determine Lib Version
700
#include <features.h>
701
#if defined(__GLIBC__)
702
extern char __libc_version[];
703
extern char __libc_release[];
709
#if defined(__GLIBC__)
710
printf("%s %s\n", __libc_version, __libc_release);
718
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null
719
if test "$?" = 0 ; then
720
./$dummy | grep 1\.99 > /dev/null
721
if test "$?" = 0 ; then
725
rm -f $dummy.c $dummy
726
echo powerpc-unknown-linux-gnu${LIBC}
838
# Either a pre-BFD a.out linker (linux-gnuoldld) or
839
# one that does not give us useful --help.
840
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
731
if test "${UNAME_MACHINE}" = "alpha" ; then
735
.byte 37,100,45,37,120,10,0 # "%d-%x\n"
742
.frame \$30,16,\$26,0
745
.long 0x47e03d80 # implver \$0
747
.long 0x47e20c21 # amask \$2,\$1
758
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
759
if test "$?" = 0 ; then
762
UNAME_MACHINE="alpha"
765
UNAME_MACHINE="alphaev5"
768
UNAME_MACHINE="alphaev56"
771
UNAME_MACHINE="alphapca56"
774
UNAME_MACHINE="alphaev6"
777
UNAME_MACHINE="alphaev67"
781
objdump --private-headers $dummy | \
782
grep ld.so.1 > /dev/null
783
if test "$?" = 0 ; then
787
rm -f $dummy.s $dummy
788
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0
789
elif test "${UNAME_MACHINE}" = "mips" ; then
792
#include <stdio.h> /* for printf() prototype */
793
int main (int argc, char *argv[]) {
795
int main (argc, argv) int argc; char *argv[]; {
798
printf ("%s-unknown-linux-gnu\n", argv[1]);
801
printf ("%sel-unknown-linux-gnu\n", argv[1]);
806
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
807
rm -f $dummy.c $dummy
808
elif test "${UNAME_MACHINE}" = "s390"; then
809
echo s390-ibm-linux && exit 0
811
# Either a pre-BFD a.out linker (linux-gnuoldld)
812
# or one that does not give us useful --help.
813
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout.
814
# If ld does not provide *any* "supported emulations:"
815
# that means it is gnuoldld.
816
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
817
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
819
case "${UNAME_MACHINE}" in
827
# Determine whether the default compiler is a.out or elf
843
# Determine whether the default compiler is a.out or elf
829
845
#include <features.h>
830
846
#ifdef __cplusplus
831
847
#include <stdio.h> /* for printf() prototype */
837
853
# ifdef __GLIBC__
838
854
# if __GLIBC__ >= 2
839
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]);
855
printf ("%s-pc-linux-gnu\n", argv[1]);
841
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
857
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
844
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]);
860
printf ("%s-pc-linux-gnulibc1\n", argv[1]);
847
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]);
863
printf ("%s-pc-linux-gnuaout\n", argv[1]);
852
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0
853
rm -f $dummy.c $dummy
855
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
856
# are messed up and put the nodename in both sysname and nodename.
868
eval $set_cc_for_build
869
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
870
rm -f $dummy.c $dummy
871
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
874
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
875
# earlier versions are messed up and put the nodename in both
876
# sysname and nodename.
858
877
echo i386-sequent-sysv4
860
i?86:UNIX_SV:4.2MP:2.*)
879
i*86:UNIX_SV:4.2MP:2.*)
861
880
# Unixware is an offshoot of SVR4, but it has its own version
862
881
# number series starting with 2...
863
882
# I am not positive that other SVR4 systems won't match this,
1181
#echo '(Unable to guess system type)' 1>&2
1254
$0: unable to guess system type
1256
This script, last modified $timestamp, has failed to recognize
1257
the operating system you are using. It is advised that you
1258
download the most up to date version of the config scripts from
1260
ftp://ftp.gnu.org/pub/gnu/config/
1262
If the version you run ($0) is already up to date, please
1263
send the following data and any information you think might be
1264
pertinent to <config-patches@gnu.org> in order to provide the needed
1265
information to handle your system.
1267
config.guess timestamp = $timestamp
1269
uname -m = `(uname -m) 2>/dev/null || echo unknown`
1270
uname -r = `(uname -r) 2>/dev/null || echo unknown`
1271
uname -s = `(uname -s) 2>/dev/null || echo unknown`
1272
uname -v = `(uname -v) 2>/dev/null || echo unknown`
1274
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
1275
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
1277
hostinfo = `(hostinfo) 2>/dev/null`
1278
/bin/universe = `(/bin/universe) 2>/dev/null`
1279
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
1280
/bin/arch = `(/bin/arch) 2>/dev/null`
1281
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
1282
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
1284
UNAME_MACHINE = ${UNAME_MACHINE}
1285
UNAME_RELEASE = ${UNAME_RELEASE}
1286
UNAME_SYSTEM = ${UNAME_SYSTEM}
1287
UNAME_VERSION = ${UNAME_VERSION}
1293
# eval: (add-hook 'write-file-hooks 'time-stamp)
1294
# time-stamp-start: "timestamp='"
1295
# time-stamp-format: "%:y-%02m-%02d"
1296
# time-stamp-end: "'"