3 |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
4 |
# 2000, 2001, 2002 Free Software Foundation, Inc. |
# 2000, 2001, 2002 Free Software Foundation, Inc. |
5 |
|
|
6 |
timestamp='2002-05-22' |
timestamp='2002-11-13' |
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 |
88 |
exit 1 |
exit 1 |
89 |
fi |
fi |
90 |
|
|
91 |
|
trap 'exit 1' 1 2 15 |
92 |
|
|
93 |
dummy=dummy-$$ |
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a |
94 |
trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 |
# 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. |
97 |
|
|
|
# CC_FOR_BUILD -- compiler used by this script. |
|
98 |
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still |
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still |
99 |
# use `HOST_CC' if defined, but it is deprecated. |
# use `HOST_CC' if defined, but it is deprecated. |
100 |
|
|
101 |
set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in |
# This shell variable is my proudest work .. or something. --bje |
102 |
,,) echo "int dummy(){}" > $dummy.c ; |
|
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 ; |
109 |
|
case $CC_FOR_BUILD,$HOST_CC,$CC in |
110 |
|
,,) echo "int x;" > $dummy.c ; |
111 |
for c in cc gcc c89 c99 ; do |
for c in cc gcc c89 c99 ; do |
112 |
($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; |
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then |
|
if test $? = 0 ; then |
|
113 |
CC_FOR_BUILD="$c"; break ; |
CC_FOR_BUILD="$c"; break ; |
114 |
fi ; |
fi ; |
115 |
done ; |
done ; |
116 |
rm -f $dummy.c $dummy.o $dummy.rel ; |
rm -f $files ; |
117 |
if test x"$CC_FOR_BUILD" = x ; then |
if test x"$CC_FOR_BUILD" = x ; then |
118 |
CC_FOR_BUILD=no_compiler_found ; |
CC_FOR_BUILD=no_compiler_found ; |
119 |
fi |
fi |
120 |
;; |
;; |
121 |
,,*) CC_FOR_BUILD=$CC ;; |
,,*) CC_FOR_BUILD=$CC ;; |
122 |
,*,*) CC_FOR_BUILD=$HOST_CC ;; |
,*,*) CC_FOR_BUILD=$HOST_CC ;; |
123 |
esac' |
esac ; |
124 |
|
unset files' |
125 |
|
|
126 |
# 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. |
127 |
# (ghazi@noc.rutgers.edu 1994-08-24) |
# (ghazi@noc.rutgers.edu 1994-08-24) |
231 |
# A Tn.n version is a released field test version. |
# A Tn.n version is a released field test version. |
232 |
# A Xn.n version is an unreleased experimental baselevel. |
# A Xn.n version is an unreleased experimental baselevel. |
233 |
# 1.2 uses "1.2" for uname -r. |
# 1.2 uses "1.2" for uname -r. |
234 |
|
eval $set_cc_for_build |
235 |
cat <<EOF >$dummy.s |
cat <<EOF >$dummy.s |
236 |
.data |
.data |
237 |
\$Lformat: |
\$Lformat: |
257 |
jsr \$26,exit |
jsr \$26,exit |
258 |
.end main |
.end main |
259 |
EOF |
EOF |
260 |
eval $set_cc_for_build |
$CC_FOR_BUILD -o $dummy $dummy.s 2>/dev/null |
|
$CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null |
|
261 |
if test "$?" = 0 ; then |
if test "$?" = 0 ; then |
262 |
case `./$dummy` in |
case `$dummy` in |
263 |
0-0) |
0-0) |
264 |
UNAME_MACHINE="alpha" |
UNAME_MACHINE="alpha" |
265 |
;; |
;; |
281 |
2-1307) |
2-1307) |
282 |
UNAME_MACHINE="alphaev68" |
UNAME_MACHINE="alphaev68" |
283 |
;; |
;; |
284 |
|
3-1307) |
285 |
|
UNAME_MACHINE="alphaev7" |
286 |
|
;; |
287 |
esac |
esac |
288 |
fi |
fi |
289 |
rm -f $dummy.s $dummy |
rm -f $dummy.s $dummy && rmdir $tmpdir |
290 |
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
291 |
exit 0 ;; |
exit 0 ;; |
292 |
Alpha\ *:Windows_NT*:*) |
Alpha\ *:Windows_NT*:*) |
327 |
NILE*:*:*:dcosx) |
NILE*:*:*:dcosx) |
328 |
echo pyramid-pyramid-svr4 |
echo pyramid-pyramid-svr4 |
329 |
exit 0 ;; |
exit 0 ;; |
330 |
|
DRS?6000:UNIX_SV:4.2*:7*) |
331 |
|
case `/usr/bin/uname -p` in |
332 |
|
sparc) echo sparc-icl-nx7 && exit 0 ;; |
333 |
|
esac ;; |
334 |
sun4H:SunOS:5.*:*) |
sun4H:SunOS:5.*:*) |
335 |
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
336 |
exit 0 ;; |
exit 0 ;; |
437 |
exit (-1); |
exit (-1); |
438 |
} |
} |
439 |
EOF |
EOF |
440 |
$CC_FOR_BUILD $dummy.c -o $dummy \ |
$CC_FOR_BUILD -o $dummy $dummy.c \ |
441 |
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ |
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ |
442 |
&& rm -f $dummy.c $dummy && exit 0 |
&& rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 |
443 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy && rmdir $tmpdir |
444 |
echo mips-mips-riscos${UNAME_RELEASE} |
echo mips-mips-riscos${UNAME_RELEASE} |
445 |
exit 0 ;; |
exit 0 ;; |
446 |
Motorola:PowerMAX_OS:*:*) |
Motorola:PowerMAX_OS:*:*) |
447 |
echo powerpc-motorola-powermax |
echo powerpc-motorola-powermax |
448 |
exit 0 ;; |
exit 0 ;; |
449 |
Night_Hawk:*:*:PowerMAX_OS) |
Motorola:*:4.3:PL8-*) |
450 |
|
echo powerpc-harris-powermax |
451 |
|
exit 0 ;; |
452 |
|
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) |
453 |
echo powerpc-harris-powermax |
echo powerpc-harris-powermax |
454 |
exit 0 ;; |
exit 0 ;; |
455 |
Night_Hawk:Power_UNIX:*:*) |
Night_Hawk:Power_UNIX:*:*) |
524 |
exit(0); |
exit(0); |
525 |
} |
} |
526 |
EOF |
EOF |
527 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 |
528 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy && rmdir $tmpdir |
529 |
echo rs6000-ibm-aix3.2.5 |
echo rs6000-ibm-aix3.2.5 |
530 |
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then |
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then |
531 |
echo rs6000-ibm-aix3.2.4 |
echo rs6000-ibm-aix3.2.4 |
623 |
exit (0); |
exit (0); |
624 |
} |
} |
625 |
EOF |
EOF |
626 |
(CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` |
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` |
627 |
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi |
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi |
628 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy && rmdir $tmpdir |
629 |
fi ;; |
fi ;; |
630 |
esac |
esac |
631 |
echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
661 |
exit (0); |
exit (0); |
662 |
} |
} |
663 |
EOF |
EOF |
664 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 |
665 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy && rmdir $tmpdir |
666 |
echo unknown-hitachi-hiuxwe2 |
echo unknown-hitachi-hiuxwe2 |
667 |
exit 0 ;; |
exit 0 ;; |
668 |
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) |
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) |
745 |
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
746 |
exit 0 ;; |
exit 0 ;; |
747 |
*:FreeBSD:*:*) |
*:FreeBSD:*:*) |
748 |
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` |
# Determine whether the default compiler uses glibc. |
749 |
|
eval $set_cc_for_build |
750 |
|
sed 's/^ //' << EOF >$dummy.c |
751 |
|
#include <features.h> |
752 |
|
#if __GLIBC__ >= 2 |
753 |
|
LIBC=gnu |
754 |
|
#else |
755 |
|
LIBC= |
756 |
|
#endif |
757 |
|
EOF |
758 |
|
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
759 |
|
rm -f $dummy.c && rmdir $tmpdir |
760 |
|
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} |
761 |
exit 0 ;; |
exit 0 ;; |
762 |
i*:CYGWIN*:*) |
i*:CYGWIN*:*) |
763 |
echo ${UNAME_MACHINE}-pc-cygwin |
echo ${UNAME_MACHINE}-pc-cygwin |
771 |
x86:Interix*:3*) |
x86:Interix*:3*) |
772 |
echo i386-pc-interix3 |
echo i386-pc-interix3 |
773 |
exit 0 ;; |
exit 0 ;; |
774 |
|
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
775 |
|
echo i${UNAME_MACHINE}-pc-mks |
776 |
|
exit 0 ;; |
777 |
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
778 |
# How do we know it's Interix rather than the generic POSIX subsystem? |
# How do we know it's Interix rather than the generic POSIX subsystem? |
779 |
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we |
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we |
821 |
#endif |
#endif |
822 |
EOF |
EOF |
823 |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` |
824 |
rm -f $dummy.c |
rm -f $dummy.c && rmdir $tmpdir |
825 |
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 |
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 |
826 |
;; |
;; |
827 |
ppc:Linux:*:*) |
ppc:Linux:*:*) |
884 |
;; |
;; |
885 |
a.out-i386-linux) |
a.out-i386-linux) |
886 |
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
887 |
exit 0 ;; |
exit 0 ;; |
888 |
coff-i386) |
coff-i386) |
889 |
echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
890 |
exit 0 ;; |
exit 0 ;; |
917 |
#endif |
#endif |
918 |
EOF |
EOF |
919 |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
920 |
rm -f $dummy.c |
rm -f $dummy.c && rmdir $tmpdir |
921 |
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 |
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 |
922 |
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 |
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 |
923 |
;; |
;; |
956 |
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
957 |
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL |
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL |
958 |
elif /bin/uname -X 2>/dev/null >/dev/null ; then |
elif /bin/uname -X 2>/dev/null >/dev/null ; then |
959 |
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` |
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` |
960 |
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 |
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 |
961 |
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ |
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ |
962 |
&& UNAME_MACHINE=i586 |
&& UNAME_MACHINE=i586 |
963 |
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ |
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ |
964 |
&& UNAME_MACHINE=i686 |
&& UNAME_MACHINE=i686 |
965 |
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ |
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ |
966 |
&& UNAME_MACHINE=i686 |
&& UNAME_MACHINE=i686 |
967 |
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL |
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL |
968 |
else |
else |
995 |
# "miniframe" |
# "miniframe" |
996 |
echo m68010-convergent-sysv |
echo m68010-convergent-sysv |
997 |
exit 0 ;; |
exit 0 ;; |
998 |
|
mc68k:UNIX:SYSTEM5:3.51m) |
999 |
|
echo m68k-convergent-sysv |
1000 |
|
exit 0 ;; |
1001 |
|
M680?0:D-NIX:5.3:*) |
1002 |
|
echo m68k-diab-dnix |
1003 |
|
exit 0 ;; |
1004 |
M68*:*:R3V[567]*:*) |
M68*:*:R3V[567]*:*) |
1005 |
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; |
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; |
1006 |
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 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) |
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 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) |
1094 |
SX-5:SUPER-UX:*:*) |
SX-5:SUPER-UX:*:*) |
1095 |
echo sx5-nec-superux${UNAME_RELEASE} |
echo sx5-nec-superux${UNAME_RELEASE} |
1096 |
exit 0 ;; |
exit 0 ;; |
1097 |
|
SX-6:SUPER-UX:*:*) |
1098 |
|
echo sx6-nec-superux${UNAME_RELEASE} |
1099 |
|
exit 0 ;; |
1100 |
Power*:Rhapsody:*:*) |
Power*:Rhapsody:*:*) |
1101 |
echo powerpc-apple-rhapsody${UNAME_RELEASE} |
echo powerpc-apple-rhapsody${UNAME_RELEASE} |
1102 |
exit 0 ;; |
exit 0 ;; |
1117 |
*:QNX:*:4*) |
*:QNX:*:4*) |
1118 |
echo i386-pc-qnx |
echo i386-pc-qnx |
1119 |
exit 0 ;; |
exit 0 ;; |
1120 |
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) |
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) |
1121 |
echo nsr-tandem-nsk${UNAME_RELEASE} |
echo nsr-tandem-nsk${UNAME_RELEASE} |
1122 |
exit 0 ;; |
exit 0 ;; |
1123 |
*:NonStop-UX:*:*) |
*:NonStop-UX:*:*) |
1289 |
} |
} |
1290 |
EOF |
EOF |
1291 |
|
|
1292 |
$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0 |
1293 |
rm -f $dummy.c $dummy |
rm -f $dummy.c $dummy && rmdir $tmpdir |
1294 |
|
|
1295 |
# Apollos put the system type in the environment. |
# Apollos put the system type in the environment. |
1296 |
|
|