3 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
4 |
# Free Software Foundation, Inc. |
# Free Software Foundation, Inc. |
5 |
|
|
6 |
timestamp='2001-04-20' |
timestamp='2001-07-09' |
7 |
|
|
8 |
# This file is free software; you can redistribute it and/or modify it |
# This file is free software; you can redistribute it and/or modify it |
9 |
# under the terms of the GNU General Public License as published by |
# under the terms of the GNU General Public License as published by |
52 |
GNU config.guess ($timestamp) |
GNU config.guess ($timestamp) |
53 |
|
|
54 |
Originally written by Per Bothner. |
Originally written by Per Bothner. |
55 |
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000 |
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 |
56 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
57 |
|
|
58 |
This is free software; see the source for copying conditions. There is NO |
This is free software; see the source for copying conditions. There is NO |
95 |
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still |
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still |
96 |
# use `HOST_CC' if defined, but it is deprecated. |
# use `HOST_CC' if defined, but it is deprecated. |
97 |
|
|
98 |
case $CC_FOR_BUILD,$HOST_CC,$CC in |
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in |
99 |
,,) echo "int dummy(){}" > $dummy.c |
,,) echo "int dummy(){}" > $dummy.c ; |
100 |
for c in cc gcc c89 ; do |
for c in cc gcc c89 ; do |
101 |
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 |
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; |
102 |
if test $? = 0 ; then |
if test $? = 0 ; then |
103 |
CC_FOR_BUILD="$c"; break |
CC_FOR_BUILD="$c"; break ; |
104 |
fi |
fi ; |
105 |
done |
done ; |
106 |
rm -f $dummy.c $dummy.o $dummy.rel |
rm -f $dummy.c $dummy.o $dummy.rel ; |
107 |
if test x"$CC_FOR_BUILD" = x ; then |
if test x"$CC_FOR_BUILD" = x ; then |
108 |
CC_FOR_BUILD=no_compiler_found |
CC_FOR_BUILD=no_compiler_found ; |
109 |
fi |
fi |
110 |
;; |
;; |
111 |
,,*) CC_FOR_BUILD=$CC ;; |
,,*) CC_FOR_BUILD=$CC ;; |
112 |
,*,*) CC_FOR_BUILD=$HOST_CC ;; |
,*,*) CC_FOR_BUILD=$HOST_CC ;; |
113 |
esac |
esac' |
114 |
|
|
115 |
# This is needed to find uname on a Pyramid OSx when run in the BSD universe. |
# This is needed to find uname on a Pyramid OSx when run in the BSD universe. |
116 |
# (ghazi@noc.rutgers.edu 8/24/94.) |
# (ghazi@noc.rutgers.edu 1994-08-24) |
117 |
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then |
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then |
118 |
PATH=$PATH:/.attbin ; export PATH |
PATH=$PATH:/.attbin ; export PATH |
119 |
fi |
fi |
150 |
# to ELF recently, or will in the future. |
# to ELF recently, or will in the future. |
151 |
case "${UNAME_MACHINE}" in |
case "${UNAME_MACHINE}" in |
152 |
i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) |
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 \ |
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ |
155 |
| grep __ELF__ >/dev/null |
| grep __ELF__ >/dev/null |
156 |
then |
then |
205 |
jsr \$26,exit |
jsr \$26,exit |
206 |
.end main |
.end main |
207 |
EOF |
EOF |
208 |
|
eval $set_cc_for_build |
209 |
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null |
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null |
210 |
if test "$?" = 0 ; then |
if test "$?" = 0 ; then |
211 |
case `./$dummy` in |
case `./$dummy` in |
408 |
exit (-1); |
exit (-1); |
409 |
} |
} |
410 |
EOF |
EOF |
411 |
|
eval $set_cc_for_build |
412 |
$CC_FOR_BUILD $dummy.c -o $dummy \ |
$CC_FOR_BUILD $dummy.c -o $dummy \ |
413 |
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ |
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ |
414 |
&& rm -f $dummy.c $dummy && exit 0 |
&& rm -f $dummy.c $dummy && exit 0 |
489 |
exit(0); |
exit(0); |
490 |
} |
} |
491 |
EOF |
EOF |
492 |
|
eval $set_cc_for_build |
493 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
494 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy |
495 |
echo rs6000-ibm-aix3.2.5 |
echo rs6000-ibm-aix3.2.5 |
590 |
exit (0); |
exit (0); |
591 |
} |
} |
592 |
EOF |
EOF |
593 |
|
eval $set_cc_for_build |
594 |
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` |
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` |
595 |
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi |
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi |
596 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy |
628 |
exit (0); |
exit (0); |
629 |
} |
} |
630 |
EOF |
EOF |
631 |
|
eval $set_cc_for_build |
632 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
633 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy |
634 |
echo unknown-hitachi-hiuxwe2 |
echo unknown-hitachi-hiuxwe2 |
639 |
9000/8??:4.3bsd:*:*) |
9000/8??:4.3bsd:*:*) |
640 |
echo hppa1.0-hp-bsd |
echo hppa1.0-hp-bsd |
641 |
exit 0 ;; |
exit 0 ;; |
642 |
*9??*:MPE/iX:*:*) |
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) |
643 |
echo hppa1.0-hp-mpeix |
echo hppa1.0-hp-mpeix |
644 |
exit 0 ;; |
exit 0 ;; |
645 |
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) |
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) |
769 |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
770 |
exit 0 ;; |
exit 0 ;; |
771 |
mips:Linux:*:*) |
mips:Linux:*:*) |
772 |
cat >$dummy.c <<EOF |
case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in |
773 |
#ifdef __cplusplus |
big) echo mips-unknown-linux-gnu && exit 0 ;; |
774 |
#include <stdio.h> /* for printf() prototype */ |
little) echo mipsel-unknown-linux-gnu && exit 0 ;; |
775 |
int main (int argc, char *argv[]) { |
esac |
|
#else |
|
|
int main (argc, argv) int argc; char *argv[]; { |
|
|
#endif |
|
|
#ifdef __MIPSEB__ |
|
|
printf ("%s-unknown-linux-gnu\n", argv[1]); |
|
|
#endif |
|
|
#ifdef __MIPSEL__ |
|
|
printf ("%sel-unknown-linux-gnu\n", argv[1]); |
|
|
#endif |
|
|
return 0; |
|
|
} |
|
|
EOF |
|
|
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 |
|
|
rm -f $dummy.c $dummy |
|
776 |
;; |
;; |
777 |
ppc:Linux:*:*) |
ppc:Linux:*:*) |
778 |
# Determine Lib Version |
echo powerpc-unknown-linux-gnu |
|
cat >$dummy.c <<EOF |
|
|
#include <features.h> |
|
|
#if defined(__GLIBC__) |
|
|
extern char __libc_version[]; |
|
|
extern char __libc_release[]; |
|
|
#endif |
|
|
main(argc, argv) |
|
|
int argc; |
|
|
char *argv[]; |
|
|
{ |
|
|
#if defined(__GLIBC__) |
|
|
printf("%s %s\n", __libc_version, __libc_release); |
|
|
#else |
|
|
printf("unknown\n"); |
|
|
#endif |
|
|
return 0; |
|
|
} |
|
|
EOF |
|
|
LIBC="" |
|
|
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null |
|
|
if test "$?" = 0 ; then |
|
|
./$dummy | grep 1\.99 > /dev/null |
|
|
if test "$?" = 0 ; then LIBC="libc1" ; fi |
|
|
fi |
|
|
rm -f $dummy.c $dummy |
|
|
echo powerpc-unknown-linux-gnu${LIBC} |
|
779 |
exit 0 ;; |
exit 0 ;; |
780 |
alpha:Linux:*:*) |
alpha:Linux:*:*) |
781 |
cat <<EOF >$dummy.s |
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in |
782 |
.data |
EV5) UNAME_MACHINE=alphaev5 ;; |
783 |
\$Lformat: |
EV56) UNAME_MACHINE=alphaev56 ;; |
784 |
.byte 37,100,45,37,120,10,0 # "%d-%x\n" |
PCA56) UNAME_MACHINE=alphapca56 ;; |
785 |
.text |
PCA57) UNAME_MACHINE=alphapca56 ;; |
786 |
.globl main |
EV6) UNAME_MACHINE=alphaev6 ;; |
787 |
.align 4 |
EV67) UNAME_MACHINE=alphaev67 ;; |
788 |
.ent main |
EV68*) UNAME_MACHINE=alphaev67 ;; |
789 |
main: |
esac |
790 |
.frame \$30,16,\$26,0 |
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null |
791 |
ldgp \$29,0(\$27) |
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi |
|
.prologue 1 |
|
|
.long 0x47e03d80 # implver \$0 |
|
|
lda \$2,-1 |
|
|
.long 0x47e20c21 # amask \$2,\$1 |
|
|
lda \$16,\$Lformat |
|
|
mov \$0,\$17 |
|
|
not \$1,\$18 |
|
|
jsr \$26,printf |
|
|
ldgp \$29,0(\$26) |
|
|
mov 0,\$16 |
|
|
jsr \$26,exit |
|
|
.end main |
|
|
EOF |
|
|
LIBC="" |
|
|
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null |
|
|
if test "$?" = 0 ; then |
|
|
case `./$dummy` in |
|
|
0-0) UNAME_MACHINE="alpha" ;; |
|
|
1-0) UNAME_MACHINE="alphaev5" ;; |
|
|
1-1) UNAME_MACHINE="alphaev56" ;; |
|
|
1-101) UNAME_MACHINE="alphapca56" ;; |
|
|
2-303) UNAME_MACHINE="alphaev6" ;; |
|
|
2-307) UNAME_MACHINE="alphaev67" ;; |
|
|
esac |
|
|
objdump --private-headers $dummy | \ |
|
|
grep ld.so.1 > /dev/null |
|
|
if test "$?" = 0 ; then |
|
|
LIBC="libc1" |
|
|
fi |
|
|
fi |
|
|
rm -f $dummy.s $dummy |
|
792 |
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} |
793 |
exit 0 ;; |
exit 0 ;; |
794 |
parisc:Linux:*:* | hppa:Linux:*:*) |
parisc:Linux:*:* | hppa:Linux:*:*) |
818 |
# The BFD linker knows what the default object file format is, so |
# The BFD linker knows what the default object file format is, so |
819 |
# first see if it will tell us. cd to the root directory to prevent |
# first see if it will tell us. cd to the root directory to prevent |
820 |
# problems with other programs or directories called `ld' in the path. |
# problems with other programs or directories called `ld' in the path. |
821 |
ld_supported_emulations=`cd /; ld --help 2>&1 \ |
ld_supported_targets=`cd /; ld --help 2>&1 \ |
822 |
| sed -ne '/supported emulations:/!d |
| sed -ne '/supported targets:/!d |
823 |
s/[ ][ ]*/ /g |
s/[ ][ ]*/ /g |
824 |
s/.*supported emulations: *// |
s/.*supported targets: *// |
825 |
s/ .*// |
s/ .*// |
826 |
p'` |
p'` |
827 |
case "$ld_supported_emulations" in |
case "$ld_supported_targets" in |
828 |
i*86linux) |
elf32-i386) |
|
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
|
|
exit 0 |
|
|
;; |
|
|
elf_i*86) |
|
829 |
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" |
TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" |
830 |
;; |
;; |
831 |
i*86coff) |
a.out-i386-linux) |
832 |
|
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
833 |
|
exit 0 ;; |
834 |
|
coff-i386) |
835 |
echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
836 |
exit 0 |
exit 0 ;; |
837 |
;; |
"") |
838 |
esac |
# Either a pre-BFD a.out linker (linux-gnuoldld) or |
839 |
# Either a pre-BFD a.out linker (linux-gnuoldld) |
# one that does not give us useful --help. |
840 |
# or one that does not give us useful --help. |
echo "${UNAME_MACHINE}-pc-linux-gnuoldld" |
841 |
# GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. |
exit 0 ;; |
|
# If ld does not provide *any* "supported emulations:" |
|
|
# that means it is gnuoldld. |
|
|
test -z "$ld_supported_emulations" && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 |
|
|
case "${UNAME_MACHINE}" in |
|
|
i*86) |
|
|
VENDOR=pc; |
|
|
;; |
|
|
*) |
|
|
VENDOR=unknown; |
|
|
;; |
|
842 |
esac |
esac |
843 |
# Determine whether the default compiler is a.out or elf |
# Determine whether the default compiler is a.out or elf |
844 |
cat >$dummy.c <<EOF |
cat >$dummy.c <<EOF |
852 |
#ifdef __ELF__ |
#ifdef __ELF__ |
853 |
# ifdef __GLIBC__ |
# ifdef __GLIBC__ |
854 |
# if __GLIBC__ >= 2 |
# if __GLIBC__ >= 2 |
855 |
printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); |
printf ("%s-pc-linux-gnu\n", argv[1]); |
856 |
# else |
# else |
857 |
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); |
printf ("%s-pc-linux-gnulibc1\n", argv[1]); |
858 |
# endif |
# endif |
859 |
# else |
# else |
860 |
printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); |
printf ("%s-pc-linux-gnulibc1\n", argv[1]); |
861 |
# endif |
# endif |
862 |
#else |
#else |
863 |
printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); |
printf ("%s-pc-linux-gnuaout\n", argv[1]); |
864 |
#endif |
#endif |
865 |
return 0; |
return 0; |
866 |
} |
} |
867 |
EOF |
EOF |
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 |
$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 |
rm -f $dummy.c $dummy |
871 |
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 |
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 |
872 |
;; |
;; |
|
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions |
|
|
# are messed up and put the nodename in both sysname and nodename. |
|
873 |
i*86:DYNIX/ptx:4*:*) |
i*86:DYNIX/ptx:4*:*) |
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. |
877 |
echo i386-sequent-sysv4 |
echo i386-sequent-sysv4 |
878 |
exit 0 ;; |
exit 0 ;; |
879 |
i*86:UNIX_SV:4.2MP:2.*) |
i*86:UNIX_SV:4.2MP:2.*) |
892 |
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} |
893 |
fi |
fi |
894 |
exit 0 ;; |
exit 0 ;; |
895 |
i*86:*:5:7*) |
i*86:*:5:[78]*) |
896 |
# Fixed at (any) Pentium or better |
case `/bin/uname -X | grep "^Machine"` in |
897 |
UNAME_MACHINE=i586 |
*486*) UNAME_MACHINE=i486 ;; |
898 |
if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then |
*Pentium) UNAME_MACHINE=i586 ;; |
899 |
echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} |
*Pent*|*Celeron) UNAME_MACHINE=i686 ;; |
900 |
else |
esac |
901 |
echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} |
|
fi |
|
902 |
exit 0 ;; |
exit 0 ;; |
903 |
i*86:*:3.2:*) |
i*86:*:3.2:*) |
904 |
if test -f /usr/options/cb.name; then |
if test -f /usr/options/cb.name; then |
1216 |
} |
} |
1217 |
EOF |
EOF |
1218 |
|
|
1219 |
|
eval $set_cc_for_build |
1220 |
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
1221 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy |
1222 |
|
|