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, 2003 Free Software Foundation, Inc. |
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
5 |
|
|
6 |
timestamp='2003-01-10' |
timestamp='2003-07-02' |
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 |
106 |
: ${TMPDIR=/tmp} ; |
: ${TMPDIR=/tmp} ; |
107 |
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
{ 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) ; } || |
{ 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 ; } ; |
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
111 |
dummy=$tmp/dummy ; |
dummy=$tmp/dummy ; |
112 |
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; |
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; |
236 |
*:OpenBSD:*:*) |
*:OpenBSD:*:*) |
237 |
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} |
238 |
exit 0 ;; |
exit 0 ;; |
|
*:MicroBSD:*:*) |
|
|
echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE} |
|
|
exit 0 ;; |
|
239 |
alpha:OSF1:*:*) |
alpha:OSF1:*:*) |
240 |
if test $UNAME_RELEASE = "V4.0"; then |
if test $UNAME_RELEASE = "V4.0"; then |
241 |
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` |
242 |
fi |
fi |
243 |
|
# According to Compaq, /usr/sbin/psrinfo has been available on |
244 |
|
# OSF/1 and Tru64 systems produced since 1995. I hope that |
245 |
|
# covers most systems running today. This code pipes the CPU |
246 |
|
# types through head -n 1, so we only detect the type of CPU 0. |
247 |
|
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` |
248 |
|
case "$ALPHA_CPU_TYPE" in |
249 |
|
"EV4 (21064)") |
250 |
|
UNAME_MACHINE="alpha" ;; |
251 |
|
"EV4.5 (21064)") |
252 |
|
UNAME_MACHINE="alpha" ;; |
253 |
|
"LCA4 (21066/21068)") |
254 |
|
UNAME_MACHINE="alpha" ;; |
255 |
|
"EV5 (21164)") |
256 |
|
UNAME_MACHINE="alphaev5" ;; |
257 |
|
"EV5.6 (21164A)") |
258 |
|
UNAME_MACHINE="alphaev56" ;; |
259 |
|
"EV5.6 (21164PC)") |
260 |
|
UNAME_MACHINE="alphapca56" ;; |
261 |
|
"EV5.7 (21164PC)") |
262 |
|
UNAME_MACHINE="alphapca57" ;; |
263 |
|
"EV6 (21264)") |
264 |
|
UNAME_MACHINE="alphaev6" ;; |
265 |
|
"EV6.7 (21264A)") |
266 |
|
UNAME_MACHINE="alphaev67" ;; |
267 |
|
"EV6.8CB (21264C)") |
268 |
|
UNAME_MACHINE="alphaev68" ;; |
269 |
|
"EV6.8AL (21264B)") |
270 |
|
UNAME_MACHINE="alphaev68" ;; |
271 |
|
"EV6.8CX (21264D)") |
272 |
|
UNAME_MACHINE="alphaev68" ;; |
273 |
|
"EV6.9A (21264/EV69A)") |
274 |
|
UNAME_MACHINE="alphaev69" ;; |
275 |
|
"EV7 (21364)") |
276 |
|
UNAME_MACHINE="alphaev7" ;; |
277 |
|
"EV7.9 (21364A)") |
278 |
|
UNAME_MACHINE="alphaev79" ;; |
279 |
|
esac |
280 |
# A Vn.n version is a released version. |
# A Vn.n version is a released version. |
281 |
# A Tn.n version is a released field test version. |
# A Tn.n version is a released field test version. |
282 |
# A Xn.n version is an unreleased experimental baselevel. |
# A Xn.n version is an unreleased experimental baselevel. |
283 |
# 1.2 uses "1.2" for uname -r. |
# 1.2 uses "1.2" for uname -r. |
|
eval $set_cc_for_build |
|
|
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 |
|
|
$CC_FOR_BUILD -o $dummy $dummy.s 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" |
|
|
;; |
|
|
3-1307) |
|
|
UNAME_MACHINE="alphaev7" |
|
|
;; |
|
|
esac |
|
|
fi |
|
284 |
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'` |
285 |
exit 0 ;; |
exit 0 ;; |
286 |
|
Alpha*:OpenVMS:*:*) |
287 |
|
echo alpha-hp-vms |
288 |
|
exit 0 ;; |
289 |
Alpha\ *:Windows_NT*:*) |
Alpha\ *:Windows_NT*:*) |
290 |
# 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? |
291 |
# Should we change UNAME_MACHINE based on the output of uname instead |
# Should we change UNAME_MACHINE based on the output of uname instead |
324 |
NILE*:*:*:dcosx) |
NILE*:*:*:dcosx) |
325 |
echo pyramid-pyramid-svr4 |
echo pyramid-pyramid-svr4 |
326 |
exit 0 ;; |
exit 0 ;; |
327 |
|
DRS?6000:unix:4.0:6*) |
328 |
|
echo sparc-icl-nx6 |
329 |
|
exit 0 ;; |
330 |
DRS?6000:UNIX_SV:4.2*:7*) |
DRS?6000:UNIX_SV:4.2*:7*) |
331 |
case `/usr/bin/uname -p` in |
case `/usr/bin/uname -p` in |
332 |
sparc) echo sparc-icl-nx7 && exit 0 ;; |
sparc) echo sparc-icl-nx7 && exit 0 ;; |
751 |
*:BSD/OS:*:*) |
*:BSD/OS:*:*) |
752 |
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} |
753 |
exit 0 ;; |
exit 0 ;; |
754 |
*:FreeBSD:*:*) |
*:FreeBSD:*:*|*:GNU/FreeBSD:*:*) |
755 |
# Determine whether the default compiler uses glibc. |
# Determine whether the default compiler uses glibc. |
756 |
eval $set_cc_for_build |
eval $set_cc_for_build |
757 |
sed 's/^ //' << EOF >$dummy.c |
sed 's/^ //' << EOF >$dummy.c |
763 |
#endif |
#endif |
764 |
EOF |
EOF |
765 |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` |
766 |
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} |
# GNU/FreeBSD systems have a "k" prefix to indicate we are using |
767 |
|
# FreeBSD's kernel, but not the complete OS. |
768 |
|
case ${LIBC} in gnu) kernel_only='k' ;; esac |
769 |
|
echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} |
770 |
exit 0 ;; |
exit 0 ;; |
771 |
i*:CYGWIN*:*) |
i*:CYGWIN*:*) |
772 |
echo ${UNAME_MACHINE}-pc-cygwin |
echo ${UNAME_MACHINE}-pc-cygwin |
777 |
i*:PW*:*) |
i*:PW*:*) |
778 |
echo ${UNAME_MACHINE}-pc-pw32 |
echo ${UNAME_MACHINE}-pc-pw32 |
779 |
exit 0 ;; |
exit 0 ;; |
780 |
x86:Interix*:3*) |
x86:Interix*:[34]*) |
781 |
echo i586-pc-interix3 |
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' |
782 |
exit 0 ;; |
exit 0 ;; |
783 |
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
784 |
echo i${UNAME_MACHINE}-pc-mks |
echo i${UNAME_MACHINE}-pc-mks |
807 |
arm*:Linux:*:*) |
arm*:Linux:*:*) |
808 |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
809 |
exit 0 ;; |
exit 0 ;; |
810 |
|
cris:Linux:*:*) |
811 |
|
echo cris-axis-linux-gnu |
812 |
|
exit 0 ;; |
813 |
ia64:Linux:*:*) |
ia64:Linux:*:*) |
814 |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
815 |
exit 0 ;; |
exit 0 ;; |
888 |
s390:Linux:*:* | s390x:Linux:*:*) |
s390:Linux:*:* | s390x:Linux:*:*) |
889 |
echo ${UNAME_MACHINE}-ibm-linux |
echo ${UNAME_MACHINE}-ibm-linux |
890 |
exit 0 ;; |
exit 0 ;; |
891 |
|
sh64*:Linux:*:*) |
892 |
|
echo ${UNAME_MACHINE}-unknown-linux-gnu |
893 |
|
exit 0 ;; |
894 |
sh*:Linux:*:*) |
sh*:Linux:*:*) |
895 |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
echo ${UNAME_MACHINE}-unknown-linux-gnu |
896 |
exit 0 ;; |
exit 0 ;; |
1049 |
exit 0 ;; |
exit 0 ;; |
1050 |
M68*:*:R3V[567]*:*) |
M68*:*:R3V[567]*:*) |
1051 |
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; |
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; |
1052 |
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) |
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) |
1053 |
OS_REL='' |
OS_REL='' |
1054 |
test -r /etc/.relid \ |
test -r /etc/.relid \ |
1055 |
&& 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` |
1205 |
*:ITS:*:*) |
*:ITS:*:*) |
1206 |
echo pdp10-unknown-its |
echo pdp10-unknown-its |
1207 |
exit 0 ;; |
exit 0 ;; |
1208 |
|
SEI:*:*:SEIUX) |
1209 |
|
echo mips-sei-seiux${UNAME_RELEASE} |
1210 |
|
exit 0 ;; |
1211 |
esac |
esac |
1212 |
|
|
1213 |
#echo '(No uname command or uname output not recognized.)' 1>&2 |
#echo '(No uname command or uname output not recognized.)' 1>&2 |