1 |
#! /bin/sh |
#! /bin/sh |
2 |
# Attempt to guess a canonical system name. |
# Attempt to guess a canonical system name. |
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, 2003 Free Software Foundation, Inc. |
5 |
|
|
6 |
timestamp='2002-03-20' |
timestamp='2003-05-19' |
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 |
# Portable tmp directory creation inspired by the Autoconf team. |
102 |
,,) echo "int dummy(){}" > $dummy.c ; |
|
103 |
|
set_cc_for_build=' |
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 ; |
106 |
|
: ${TMPDIR=/tmp} ; |
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 |
|
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
110 |
|
dummy=$tmp/dummy ; |
111 |
|
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; |
112 |
|
case $CC_FOR_BUILD,$HOST_CC,$CC in |
113 |
|
,,) echo "int x;" > $dummy.c ; |
114 |
for c in cc gcc c89 c99 ; do |
for c in cc gcc c89 c99 ; do |
115 |
($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 |
|
116 |
CC_FOR_BUILD="$c"; break ; |
CC_FOR_BUILD="$c"; break ; |
117 |
fi ; |
fi ; |
118 |
done ; |
done ; |
|
rm -f $dummy.c $dummy.o $dummy.rel ; |
|
119 |
if test x"$CC_FOR_BUILD" = x ; then |
if test x"$CC_FOR_BUILD" = x ; then |
120 |
CC_FOR_BUILD=no_compiler_found ; |
CC_FOR_BUILD=no_compiler_found ; |
121 |
fi |
fi |
122 |
;; |
;; |
123 |
,,*) CC_FOR_BUILD=$CC ;; |
,,*) CC_FOR_BUILD=$CC ;; |
124 |
,*,*) CC_FOR_BUILD=$HOST_CC ;; |
,*,*) CC_FOR_BUILD=$HOST_CC ;; |
125 |
esac' |
esac ;' |
126 |
|
|
127 |
# 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. |
128 |
# (ghazi@noc.rutgers.edu 1994-08-24) |
# (ghazi@noc.rutgers.edu 1994-08-24) |
153 |
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ |
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ |
154 |
/usr/sbin/$sysctl 2>/dev/null || echo unknown)` |
/usr/sbin/$sysctl 2>/dev/null || echo unknown)` |
155 |
case "${UNAME_MACHINE_ARCH}" in |
case "${UNAME_MACHINE_ARCH}" in |
156 |
|
armeb) machine=armeb-unknown ;; |
157 |
arm*) machine=arm-unknown ;; |
arm*) machine=arm-unknown ;; |
158 |
sh3el) machine=shl-unknown ;; |
sh3el) machine=shl-unknown ;; |
159 |
sh3eb) machine=sh-unknown ;; |
sh3eb) machine=sh-unknown ;; |
179 |
;; |
;; |
180 |
esac |
esac |
181 |
# The OS release |
# The OS release |
182 |
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` |
# Debian GNU/NetBSD machines have a different userland, and |
183 |
|
# thus, need a distinct triplet. However, they do not need |
184 |
|
# kernel version information, so it can be replaced with a |
185 |
|
# suitable tag, in the style of linux-gnu. |
186 |
|
case "${UNAME_VERSION}" in |
187 |
|
Debian*) |
188 |
|
release='-gnu' |
189 |
|
;; |
190 |
|
*) |
191 |
|
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` |
192 |
|
;; |
193 |
|
esac |
194 |
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: |
195 |
# contains redundant information, the shorter form: |
# contains redundant information, the shorter form: |
196 |
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. |
239 |
if test $UNAME_RELEASE = "V4.0"; then |
if test $UNAME_RELEASE = "V4.0"; then |
240 |
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
241 |
fi |
fi |
242 |
|
# According to Compaq, /usr/sbin/psrinfo has been available on |
243 |
|
# OSF/1 and Tru64 systems produced since 1995. I hope that |
244 |
|
# covers most systems running today. This code pipes the CPU |
245 |
|
# types through head -n 1, so we only detect the type of CPU 0. |
246 |
|
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` |
247 |
|
case "$ALPHA_CPU_TYPE" in |
248 |
|
"EV4 (21064)") |
249 |
|
UNAME_MACHINE="alpha" ;; |
250 |
|
"EV4.5 (21064)") |
251 |
|
UNAME_MACHINE="alpha" ;; |
252 |
|
"LCA4 (21066/21068)") |
253 |
|
UNAME_MACHINE="alpha" ;; |
254 |
|
"EV5 (21164)") |
255 |
|
UNAME_MACHINE="alphaev5" ;; |
256 |
|
"EV5.6 (21164A)") |
257 |
|
UNAME_MACHINE="alphaev56" ;; |
258 |
|
"EV5.6 (21164PC)") |
259 |
|
UNAME_MACHINE="alphapca56" ;; |
260 |
|
"EV5.7 (21164PC)") |
261 |
|
UNAME_MACHINE="alphapca57" ;; |
262 |
|
"EV6 (21264)") |
263 |
|
UNAME_MACHINE="alphaev6" ;; |
264 |
|
"EV6.7 (21264A)") |
265 |
|
UNAME_MACHINE="alphaev67" ;; |
266 |
|
"EV6.8CB (21264C)") |
267 |
|
UNAME_MACHINE="alphaev68" ;; |
268 |
|
"EV6.8AL (21264B)") |
269 |
|
UNAME_MACHINE="alphaev68" ;; |
270 |
|
"EV6.8CX (21264D)") |
271 |
|
UNAME_MACHINE="alphaev68" ;; |
272 |
|
"EV6.9A (21264/EV69A)") |
273 |
|
UNAME_MACHINE="alphaev69" ;; |
274 |
|
"EV7 (21364)") |
275 |
|
UNAME_MACHINE="alphaev7" ;; |
276 |
|
"EV7.9 (21364A)") |
277 |
|
UNAME_MACHINE="alphaev79" ;; |
278 |
|
esac |
279 |
# A Vn.n version is a released version. |
# A Vn.n version is a released version. |
280 |
# A Tn.n version is a released field test version. |
# A Tn.n version is a released field test version. |
281 |
# A Xn.n version is an unreleased experimental baselevel. |
# A Xn.n version is an unreleased experimental baselevel. |
282 |
# 1.2 uses "1.2" for uname -r. |
# 1.2 uses "1.2" for uname -r. |
|
cat <<EOF >$dummy.s |
|
|
.data |
|
|
\$Lformat: |
|
|
.byte 37,100,45,37,120,10,0 # "%d-%x\n" |
|
|
|
|
|
.text |
|
|
.globl main |
|
|
.align 4 |
|
|
.ent main |
|
|
main: |
|
|
.frame \$30,16,\$26,0 |
|
|
ldgp \$29,0(\$27) |
|
|
.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 |
|
|
eval $set_cc_for_build |
|
|
$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" |
|
|
;; |
|
|
2-1307) |
|
|
UNAME_MACHINE="alphaev68" |
|
|
;; |
|
|
esac |
|
|
fi |
|
|
rm -f $dummy.s $dummy |
|
283 |
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'` |
284 |
exit 0 ;; |
exit 0 ;; |
285 |
Alpha\ *:Windows_NT*:*) |
Alpha\ *:Windows_NT*:*) |
320 |
NILE*:*:*:dcosx) |
NILE*:*:*:dcosx) |
321 |
echo pyramid-pyramid-svr4 |
echo pyramid-pyramid-svr4 |
322 |
exit 0 ;; |
exit 0 ;; |
323 |
|
DRS?6000:UNIX_SV:4.2*:7*) |
324 |
|
case `/usr/bin/uname -p` in |
325 |
|
sparc) echo sparc-icl-nx7 && exit 0 ;; |
326 |
|
esac ;; |
327 |
sun4H:SunOS:5.*:*) |
sun4H:SunOS:5.*:*) |
328 |
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` |
329 |
exit 0 ;; |
exit 0 ;; |
430 |
exit (-1); |
exit (-1); |
431 |
} |
} |
432 |
EOF |
EOF |
433 |
$CC_FOR_BUILD $dummy.c -o $dummy \ |
$CC_FOR_BUILD -o $dummy $dummy.c \ |
434 |
&& ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ |
&& $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ |
435 |
&& rm -f $dummy.c $dummy && exit 0 |
&& exit 0 |
|
rm -f $dummy.c $dummy |
|
436 |
echo mips-mips-riscos${UNAME_RELEASE} |
echo mips-mips-riscos${UNAME_RELEASE} |
437 |
exit 0 ;; |
exit 0 ;; |
438 |
Motorola:PowerMAX_OS:*:*) |
Motorola:PowerMAX_OS:*:*) |
439 |
echo powerpc-motorola-powermax |
echo powerpc-motorola-powermax |
440 |
exit 0 ;; |
exit 0 ;; |
441 |
|
Motorola:*:4.3:PL8-*) |
442 |
|
echo powerpc-harris-powermax |
443 |
|
exit 0 ;; |
444 |
|
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) |
445 |
|
echo powerpc-harris-powermax |
446 |
|
exit 0 ;; |
447 |
Night_Hawk:Power_UNIX:*:*) |
Night_Hawk:Power_UNIX:*:*) |
448 |
echo powerpc-harris-powerunix |
echo powerpc-harris-powerunix |
449 |
exit 0 ;; |
exit 0 ;; |
516 |
exit(0); |
exit(0); |
517 |
} |
} |
518 |
EOF |
EOF |
519 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 |
|
rm -f $dummy.c $dummy |
|
520 |
echo rs6000-ibm-aix3.2.5 |
echo rs6000-ibm-aix3.2.5 |
521 |
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then |
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then |
522 |
echo rs6000-ibm-aix3.2.4 |
echo rs6000-ibm-aix3.2.4 |
614 |
exit (0); |
exit (0); |
615 |
} |
} |
616 |
EOF |
EOF |
617 |
(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` |
618 |
if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi |
test -z "$HP_ARCH" && HP_ARCH=hppa |
|
rm -f $dummy.c $dummy |
|
619 |
fi ;; |
fi ;; |
620 |
esac |
esac |
621 |
|
if [ ${HP_ARCH} = "hppa2.0w" ] |
622 |
|
then |
623 |
|
# avoid double evaluation of $set_cc_for_build |
624 |
|
test -n "$CC_FOR_BUILD" || eval $set_cc_for_build |
625 |
|
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null |
626 |
|
then |
627 |
|
HP_ARCH="hppa2.0w" |
628 |
|
else |
629 |
|
HP_ARCH="hppa64" |
630 |
|
fi |
631 |
|
fi |
632 |
echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
echo ${HP_ARCH}-hp-hpux${HPUX_REV} |
633 |
exit 0 ;; |
exit 0 ;; |
634 |
ia64:HP-UX:*:*) |
ia64:HP-UX:*:*) |
662 |
exit (0); |
exit (0); |
663 |
} |
} |
664 |
EOF |
EOF |
665 |
$CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 |
$CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 |
|
rm -f $dummy.c $dummy |
|
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:*:* ) |
720 |
CRAY*TS:*:*:*) |
CRAY*TS:*:*:*) |
721 |
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
722 |
exit 0 ;; |
exit 0 ;; |
|
CRAY*T3D:*:*:*) |
|
|
echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
|
|
exit 0 ;; |
|
723 |
CRAY*T3E:*:*:*) |
CRAY*T3E:*:*:*) |
724 |
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
725 |
exit 0 ;; |
exit 0 ;; |
726 |
CRAY*SV1:*:*:*) |
CRAY*SV1:*:*:*) |
727 |
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
728 |
exit 0 ;; |
exit 0 ;; |
729 |
|
*:UNICOS/mp:*:*) |
730 |
|
echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' |
731 |
|
exit 0 ;; |
732 |
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) |
733 |
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` |
734 |
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` |
744 |
*:BSD/OS:*:*) |
*:BSD/OS:*:*) |
745 |
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
746 |
exit 0 ;; |
exit 0 ;; |
747 |
*:FreeBSD:*:*) |
*:FreeBSD:*:*|*:GNU/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 |
|
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} |
760 |
exit 0 ;; |
exit 0 ;; |
761 |
i*:CYGWIN*:*) |
i*:CYGWIN*:*) |
762 |
echo ${UNAME_MACHINE}-pc-cygwin |
echo ${UNAME_MACHINE}-pc-cygwin |
768 |
echo ${UNAME_MACHINE}-pc-pw32 |
echo ${UNAME_MACHINE}-pc-pw32 |
769 |
exit 0 ;; |
exit 0 ;; |
770 |
x86:Interix*:3*) |
x86:Interix*:3*) |
771 |
echo i386-pc-interix3 |
echo i586-pc-interix3 |
772 |
|
exit 0 ;; |
773 |
|
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
774 |
|
echo i${UNAME_MACHINE}-pc-mks |
775 |
exit 0 ;; |
exit 0 ;; |
776 |
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
i*:Windows_NT*:* | Pentium*:Windows_NT*:*) |
777 |
# 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? |
778 |
# 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 |
779 |
# UNAME_MACHINE based on the output of uname instead of i386? |
# UNAME_MACHINE based on the output of uname instead of i386? |
780 |
echo i386-pc-interix |
echo i586-pc-interix |
781 |
exit 0 ;; |
exit 0 ;; |
782 |
i*:UWIN*:*) |
i*:UWIN*:*) |
783 |
echo ${UNAME_MACHINE}-pc-uwin |
echo ${UNAME_MACHINE}-pc-uwin |
797 |
arm*:Linux:*:*) |
arm*:Linux:*:*) |
798 |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
799 |
exit 0 ;; |
exit 0 ;; |
800 |
|
cris:Linux:*:*) |
801 |
|
echo cris-axis-linux-gnu |
802 |
|
exit 0 ;; |
803 |
ia64:Linux:*:*) |
ia64:Linux:*:*) |
804 |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
805 |
exit 0 ;; |
exit 0 ;; |
823 |
#endif |
#endif |
824 |
EOF |
EOF |
825 |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` |
826 |
rm -f $dummy.c |
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 |
827 |
test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 |
;; |
828 |
|
mips64:Linux:*:*) |
829 |
|
eval $set_cc_for_build |
830 |
|
sed 's/^ //' << EOF >$dummy.c |
831 |
|
#undef CPU |
832 |
|
#undef mips64 |
833 |
|
#undef mips64el |
834 |
|
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) |
835 |
|
CPU=mips64el |
836 |
|
#else |
837 |
|
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) |
838 |
|
CPU=mips64 |
839 |
|
#else |
840 |
|
CPU= |
841 |
|
#endif |
842 |
|
#endif |
843 |
|
EOF |
844 |
|
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` |
845 |
|
test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 |
846 |
;; |
;; |
847 |
ppc:Linux:*:*) |
ppc:Linux:*:*) |
848 |
echo powerpc-unknown-linux-gnu |
echo powerpc-unknown-linux-gnu |
904 |
;; |
;; |
905 |
a.out-i386-linux) |
a.out-i386-linux) |
906 |
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
echo "${UNAME_MACHINE}-pc-linux-gnuaout" |
907 |
exit 0 ;; |
exit 0 ;; |
908 |
coff-i386) |
coff-i386) |
909 |
echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
echo "${UNAME_MACHINE}-pc-linux-gnucoff" |
910 |
exit 0 ;; |
exit 0 ;; |
937 |
#endif |
#endif |
938 |
EOF |
EOF |
939 |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
|
rm -f $dummy.c |
|
940 |
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 |
test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 |
941 |
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 |
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 |
942 |
;; |
;; |
954 |
# Use sysv4.2uw... so that sysv4* matches it. |
# Use sysv4.2uw... so that sysv4* matches it. |
955 |
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} |
956 |
exit 0 ;; |
exit 0 ;; |
957 |
|
i*86:OS/2:*:*) |
958 |
|
# If we were able to find `uname', then EMX Unix compatibility |
959 |
|
# is probably installed. |
960 |
|
echo ${UNAME_MACHINE}-pc-os2-emx |
961 |
|
exit 0 ;; |
962 |
|
i*86:XTS-300:*:STOP) |
963 |
|
echo ${UNAME_MACHINE}-unknown-stop |
964 |
|
exit 0 ;; |
965 |
|
i*86:atheos:*:*) |
966 |
|
echo ${UNAME_MACHINE}-unknown-atheos |
967 |
|
exit 0 ;; |
968 |
|
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) |
969 |
|
echo i386-unknown-lynxos${UNAME_RELEASE} |
970 |
|
exit 0 ;; |
971 |
|
i*86:*DOS:*:*) |
972 |
|
echo ${UNAME_MACHINE}-pc-msdosdjgpp |
973 |
|
exit 0 ;; |
974 |
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) |
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) |
975 |
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` |
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` |
976 |
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then |
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then |
992 |
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` |
993 |
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL |
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL |
994 |
elif /bin/uname -X 2>/dev/null >/dev/null ; then |
elif /bin/uname -X 2>/dev/null >/dev/null ; then |
995 |
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` |
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` |
996 |
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 |
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 |
997 |
(/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ |
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ |
998 |
&& UNAME_MACHINE=i586 |
&& UNAME_MACHINE=i586 |
999 |
(/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ |
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ |
1000 |
&& UNAME_MACHINE=i686 |
&& UNAME_MACHINE=i686 |
1001 |
(/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ |
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ |
1002 |
&& UNAME_MACHINE=i686 |
&& UNAME_MACHINE=i686 |
1003 |
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL |
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL |
1004 |
else |
else |
1005 |
echo ${UNAME_MACHINE}-pc-sysv32 |
echo ${UNAME_MACHINE}-pc-sysv32 |
1006 |
fi |
fi |
1007 |
exit 0 ;; |
exit 0 ;; |
|
i*86:*DOS:*:*) |
|
|
echo ${UNAME_MACHINE}-pc-msdosdjgpp |
|
|
exit 0 ;; |
|
1008 |
pc:*:*:*) |
pc:*:*:*) |
1009 |
# Left here for compatibility: |
# Left here for compatibility: |
1010 |
# uname -m prints for DJGPP always 'pc', but it prints nothing about |
# uname -m prints for DJGPP always 'pc', but it prints nothing about |
1028 |
# "miniframe" |
# "miniframe" |
1029 |
echo m68010-convergent-sysv |
echo m68010-convergent-sysv |
1030 |
exit 0 ;; |
exit 0 ;; |
1031 |
|
mc68k:UNIX:SYSTEM5:3.51m) |
1032 |
|
echo m68k-convergent-sysv |
1033 |
|
exit 0 ;; |
1034 |
|
M680?0:D-NIX:5.3:*) |
1035 |
|
echo m68k-diab-dnix |
1036 |
|
exit 0 ;; |
1037 |
M68*:*:R3V[567]*:*) |
M68*:*:R3V[567]*:*) |
1038 |
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; |
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; |
1039 |
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) |
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 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) |
1040 |
OS_REL='' |
OS_REL='' |
1041 |
test -r /etc/.relid \ |
test -r /etc/.relid \ |
1042 |
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` |
1053 |
mc68030:UNIX_System_V:4.*:*) |
mc68030:UNIX_System_V:4.*:*) |
1054 |
echo m68k-atari-sysv4 |
echo m68k-atari-sysv4 |
1055 |
exit 0 ;; |
exit 0 ;; |
|
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) |
|
|
echo i386-unknown-lynxos${UNAME_RELEASE} |
|
|
exit 0 ;; |
|
1056 |
TSUNAMI:LynxOS:2.*:*) |
TSUNAMI:LynxOS:2.*:*) |
1057 |
echo sparc-unknown-lynxos${UNAME_RELEASE} |
echo sparc-unknown-lynxos${UNAME_RELEASE} |
1058 |
exit 0 ;; |
exit 0 ;; |
1124 |
SX-5:SUPER-UX:*:*) |
SX-5:SUPER-UX:*:*) |
1125 |
echo sx5-nec-superux${UNAME_RELEASE} |
echo sx5-nec-superux${UNAME_RELEASE} |
1126 |
exit 0 ;; |
exit 0 ;; |
1127 |
|
SX-6:SUPER-UX:*:*) |
1128 |
|
echo sx6-nec-superux${UNAME_RELEASE} |
1129 |
|
exit 0 ;; |
1130 |
Power*:Rhapsody:*:*) |
Power*:Rhapsody:*:*) |
1131 |
echo powerpc-apple-rhapsody${UNAME_RELEASE} |
echo powerpc-apple-rhapsody${UNAME_RELEASE} |
1132 |
exit 0 ;; |
exit 0 ;; |
1134 |
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} |
1135 |
exit 0 ;; |
exit 0 ;; |
1136 |
*:Darwin:*:*) |
*:Darwin:*:*) |
1137 |
echo `uname -p`-apple-darwin${UNAME_RELEASE} |
case `uname -p` in |
1138 |
|
*86) UNAME_PROCESSOR=i686 ;; |
1139 |
|
powerpc) UNAME_PROCESSOR=powerpc ;; |
1140 |
|
esac |
1141 |
|
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} |
1142 |
exit 0 ;; |
exit 0 ;; |
1143 |
*:procnto*:*:* | *:QNX:[0123456789]*:*) |
*:procnto*:*:* | *:QNX:[0123456789]*:*) |
1144 |
UNAME_PROCESSOR=`uname -p` |
UNAME_PROCESSOR=`uname -p` |
1151 |
*:QNX:*:4*) |
*:QNX:*:4*) |
1152 |
echo i386-pc-qnx |
echo i386-pc-qnx |
1153 |
exit 0 ;; |
exit 0 ;; |
1154 |
NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) |
NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*) |
1155 |
echo nsr-tandem-nsk${UNAME_RELEASE} |
echo nsr-tandem-nsk${UNAME_RELEASE} |
1156 |
exit 0 ;; |
exit 0 ;; |
1157 |
*:NonStop-UX:*:*) |
*:NonStop-UX:*:*) |
1174 |
fi |
fi |
1175 |
echo ${UNAME_MACHINE}-unknown-plan9 |
echo ${UNAME_MACHINE}-unknown-plan9 |
1176 |
exit 0 ;; |
exit 0 ;; |
|
i*86:OS/2:*:*) |
|
|
# If we were able to find `uname', then EMX Unix compatibility |
|
|
# is probably installed. |
|
|
echo ${UNAME_MACHINE}-pc-os2-emx |
|
|
exit 0 ;; |
|
1177 |
*:TOPS-10:*:*) |
*:TOPS-10:*:*) |
1178 |
echo pdp10-unknown-tops10 |
echo pdp10-unknown-tops10 |
1179 |
exit 0 ;; |
exit 0 ;; |
1192 |
*:ITS:*:*) |
*:ITS:*:*) |
1193 |
echo pdp10-unknown-its |
echo pdp10-unknown-its |
1194 |
exit 0 ;; |
exit 0 ;; |
|
i*86:XTS-300:*:STOP) |
|
|
echo ${UNAME_MACHINE}-unknown-stop |
|
|
exit 0 ;; |
|
|
i*86:atheos:*:*) |
|
|
echo ${UNAME_MACHINE}-unknown-atheos |
|
|
exit 0 ;; |
|
1195 |
esac |
esac |
1196 |
|
|
1197 |
#echo '(No uname command or uname output not recognized.)' 1>&2 |
#echo '(No uname command or uname output not recognized.)' 1>&2 |
1312 |
} |
} |
1313 |
EOF |
EOF |
1314 |
|
|
1315 |
$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 && exit 0 |
|
rm -f $dummy.c $dummy |
|
1316 |
|
|
1317 |
# Apollos put the system type in the environment. |
# Apollos put the system type in the environment. |
1318 |
|
|