| 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, 2003, 2004, 2005 Free Software Foundation, Inc. |
# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, |
| 5 |
|
# Inc. |
| 6 |
|
|
| 7 |
timestamp='2005-12-23' |
timestamp='2006-07-02' |
| 8 |
|
|
| 9 |
# 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 |
| 10 |
# under the terms of the GNU General Public License as published by |
# under the terms of the GNU General Public License as published by |
| 107 |
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; |
| 108 |
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; |
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; |
| 109 |
: ${TMPDIR=/tmp} ; |
: ${TMPDIR=/tmp} ; |
| 110 |
{ tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || |
| 111 |
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || |
| 112 |
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || |
| 113 |
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; |
| 224 |
*:ekkoBSD:*:*) |
*:ekkoBSD:*:*) |
| 225 |
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} |
| 226 |
exit ;; |
exit ;; |
| 227 |
|
*:SolidBSD:*:*) |
| 228 |
|
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} |
| 229 |
|
exit ;; |
| 230 |
macppc:MirBSD:*:*) |
macppc:MirBSD:*:*) |
| 231 |
echo powerppc-unknown-mirbsd${UNAME_RELEASE} |
echo powerpc-unknown-mirbsd${UNAME_RELEASE} |
| 232 |
exit ;; |
exit ;; |
| 233 |
*:MirBSD:*:*) |
*:MirBSD:*:*) |
| 234 |
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} |
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} |
| 788 |
case ${UNAME_MACHINE} in |
case ${UNAME_MACHINE} in |
| 789 |
pc98) |
pc98) |
| 790 |
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 791 |
|
amd64) |
| 792 |
|
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 793 |
*) |
*) |
| 794 |
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; |
| 795 |
esac |
esac |
| 807 |
i*:PW*:*) |
i*:PW*:*) |
| 808 |
echo ${UNAME_MACHINE}-pc-pw32 |
echo ${UNAME_MACHINE}-pc-pw32 |
| 809 |
exit ;; |
exit ;; |
| 810 |
x86:Interix*:[345]*) |
x86:Interix*:[3456]*) |
| 811 |
echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' |
echo i586-pc-interix${UNAME_RELEASE} |
| 812 |
|
exit ;; |
| 813 |
|
EM64T:Interix*:[3456]*) |
| 814 |
|
echo x86_64-unknown-interix${UNAME_RELEASE} |
| 815 |
exit ;; |
exit ;; |
| 816 |
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) |
| 817 |
echo i${UNAME_MACHINE}-pc-mks |
echo i${UNAME_MACHINE}-pc-mks |
| 848 |
arm*:Linux:*:*) |
arm*:Linux:*:*) |
| 849 |
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 850 |
exit ;; |
exit ;; |
| 851 |
|
avr32*:Linux:*:*) |
| 852 |
|
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 853 |
|
exit ;; |
| 854 |
cris:Linux:*:*) |
cris:Linux:*:*) |
| 855 |
echo cris-axis-linux-${LIBC} |
echo cris-axis-linux-${LIBC} |
| 856 |
exit ;; |
exit ;; |
| 885 |
#endif |
#endif |
| 886 |
#endif |
#endif |
| 887 |
EOF |
EOF |
| 888 |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' |
| 889 |
|
/^CPU/{ |
| 890 |
|
s: ::g |
| 891 |
|
p |
| 892 |
|
}'`" |
| 893 |
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
| 894 |
;; |
;; |
| 895 |
mips64:Linux:*:*) |
mips64:Linux:*:*) |
| 908 |
#endif |
#endif |
| 909 |
#endif |
#endif |
| 910 |
EOF |
EOF |
| 911 |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^CPU/{s: ::g;p;}'`" |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' |
| 912 |
|
/^CPU/{ |
| 913 |
|
s: ::g |
| 914 |
|
p |
| 915 |
|
}'`" |
| 916 |
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } |
| 917 |
;; |
;; |
| 918 |
or32:Linux:*:*) |
or32:Linux:*:*) |
| 953 |
echo ${UNAME_MACHINE}-ibm-linux |
echo ${UNAME_MACHINE}-ibm-linux |
| 954 |
exit ;; |
exit ;; |
| 955 |
sh64*:Linux:*:*) |
sh64*:Linux:*:*) |
| 956 |
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 957 |
exit ;; |
exit ;; |
| 958 |
sh*:Linux:*:*) |
sh*:Linux:*:*) |
| 959 |
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
echo ${UNAME_MACHINE}-unknown-linux-${LIBC} |
| 1011 |
LIBC=gnulibc1 |
LIBC=gnulibc1 |
| 1012 |
# endif |
# endif |
| 1013 |
#else |
#else |
| 1014 |
#if defined(__INTEL_COMPILER) || defined(__PGI) |
#if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) |
| 1015 |
LIBC=gnu |
LIBC=gnu |
| 1016 |
#else |
#else |
| 1017 |
LIBC=gnuaout |
LIBC=gnuaout |
| 1021 |
LIBC=dietlibc |
LIBC=dietlibc |
| 1022 |
#endif |
#endif |
| 1023 |
EOF |
EOF |
| 1024 |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '/^LIBC/{s: ::g;p;}'`" |
eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' |
| 1025 |
|
/^LIBC/{ |
| 1026 |
|
s: ::g |
| 1027 |
|
p |
| 1028 |
|
}'`" |
| 1029 |
test x"${LIBC}" != x && { |
test x"${LIBC}" != x && { |
| 1030 |
echo "${UNAME_MACHINE}-pc-linux-${LIBC}" |
echo "${UNAME_MACHINE}-pc-linux-${LIBC}" |
| 1031 |
exit |
exit |