11#! /bin/sh
22# Attempt to guess a canonical system name.
33# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4- # 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4+ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
5+ # Inc.
56
6- timestamp=' 2005-06-30 '
7+ timestamp=' 2006-07-02 '
78
89# This file is free software; you can redistribute it and/or modify it
910# under the terms of the GNU General Public License as published by
@@ -106,7 +107,7 @@ set_cc_for_build='
106107trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
107108trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
108109: ${TMPDIR=/tmp} ;
109- { tmp=`(umask 077 && mktemp -d-q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
110111 { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
111112 { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
112113 { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
@@ -125,7 +126,7 @@ case $CC_FOR_BUILD,$HOST_CC,$CC in
125126;;
126127 ,,*) CC_FOR_BUILD=$CC ;;
127128 ,*,*) CC_FOR_BUILD=$HOST_CC ;;
128- esac ;'
129+ esac ; set_cc_for_build= ; '
129130
130131# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
131132# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -206,8 +207,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
206207* :ekkoBSD:* :* )
207208echo ${UNAME_MACHINE} -unknown-ekkobsd${UNAME_RELEASE}
208209exit ;;
210+ * :SolidBSD:* :* )
211+ echo ${UNAME_MACHINE} -unknown-solidbsd${UNAME_RELEASE}
212+ exit ;;
209213 macppc:MirBSD:* :* )
210- echo powerppc -unknown-mirbsd${UNAME_RELEASE}
214+ echo powerpc -unknown-mirbsd${UNAME_RELEASE}
211215exit ;;
212216* :MirBSD:* :* )
213217echo ${UNAME_MACHINE} -unknown-mirbsd${UNAME_RELEASE}
623627esac
624628if [${HP_ARCH} = " hppa2.0w" ]
625629then
626- # avoid double evaluation of $set_cc_for_build
627- test -n" $CC_FOR_BUILD " || eval $set_cc_for_build
630+ eval $set_cc_for_build
628631
629632# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
630633# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
765768echo ${UNAME_MACHINE} -unknown-bsdi${UNAME_RELEASE}
766769exit ;;
767770* :FreeBSD:* :* )
768- echo ${UNAME_MACHINE} -unknown-freebsd` echo${UNAME_RELEASE} | sed -e' s/[-(].*//' `
771+ case ${UNAME_MACHINE} in
772+ pc98)
773+ echo i386-unknown-freebsd` echo${UNAME_RELEASE} | sed -e' s/[-(].*//' ` ;;
774+ amd64)
775+ echo x86_64-unknown-freebsd` echo${UNAME_RELEASE} | sed -e' s/[-(].*//' ` ;;
776+ * )
777+ echo ${UNAME_MACHINE} -unknown-freebsd` echo${UNAME_RELEASE} | sed -e' s/[-(].*//' ` ;;
778+ esac
769779exit ;;
770780 i* :CYGWIN* :* )
771781echo ${UNAME_MACHINE} -pc-cygwin
780790 i* :PW* :* )
781791echo ${UNAME_MACHINE} -pc-pw32
782792exit ;;
783- x86:Interix* :[34]* )
784- echo i586-pc-interix${UNAME_RELEASE} | sed -e' s/\..*//'
793+ x86:Interix* :[3456]* )
794+ echo i586-pc-interix${UNAME_RELEASE}
795+ exit ;;
796+ EM64T:Interix* :[3456]* )
797+ echo x86_64-unknown-interix${UNAME_RELEASE}
785798exit ;;
786799 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:* )
787800echo i${UNAME_MACHINE} -pc-mks
795808 i* :UWIN* :* )
796809echo ${UNAME_MACHINE} -pc-uwin
797810exit ;;
798- amd64:CYGWIN* :* :* )
811+ amd64:CYGWIN* :* :* | x86_64:CYGWIN * : * : * )
799812echo x86_64-unknown-cygwin
800813exit ;;
801814 p* :CYGWIN* :* )
818831 arm* :Linux:* :* )
819832echo ${UNAME_MACHINE} -unknown-linux-gnu
820833exit ;;
834+ avr32* :Linux:* :* )
835+ echo ${UNAME_MACHINE} -unknown-linux-gnu
836+ exit ;;
821837 cris:Linux:* :* )
822838echo cris-axis-linux-gnu
823839exit ;;
852868#endif
853869#endif
854870EOF
855- eval ` $CC_FOR_BUILD -E$dummy .c2> /dev/null| grep ^CPU=`
871+ eval " ` $CC_FOR_BUILD -E$dummy .c2> /dev/null| sed -n'
872+ /^CPU/{
873+ s: ::g
874+ p
875+ }' ` "
856876test x" ${CPU} " ! = x&& {echo " ${CPU} -unknown-linux-gnu" ; exit ; }
857877;;
858878 mips64:Linux:* :* )
871891#endif
872892#endif
873893EOF
874- eval ` $CC_FOR_BUILD -E$dummy .c2> /dev/null| grep ^CPU=`
894+ eval " ` $CC_FOR_BUILD -E$dummy .c2> /dev/null| sed -n'
895+ /^CPU/{
896+ s: ::g
897+ p
898+ }' ` "
875899test x" ${CPU} " ! = x&& {echo " ${CPU} -unknown-linux-gnu" ; exit ; }
876900;;
901+ or32:Linux:* :* )
902+ echo or32-unknown-linux-gnu
903+ exit ;;
877904 ppc:Linux:* :* )
878905echo powerpc-unknown-linux-gnu
879906exit ;;
917944 sparc:Linux:* :* | sparc64:Linux:* :* )
918945echo ${UNAME_MACHINE} -unknown-linux-gnu
919946exit ;;
947+ vax:Linux:* :* )
948+ echo ${UNAME_MACHINE} -dec-linux-gnu
949+ exit ;;
920950 x86_64:Linux:* :* )
921951echo x86_64-unknown-linux-gnu
922952exit ;;
962992LIBC=gnulibc1
963993# endif
964994#else
965- #ifdef __INTEL_COMPILER
995+ #if defined( __INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
966996LIBC=gnu
967997#else
968998LIBC=gnuaout
@@ -972,7 +1002,11 @@ EOF
9721002LIBC=dietlibc
9731003#endif
9741004EOF
975- eval ` $CC_FOR_BUILD -E$dummy .c2> /dev/null| grep ^LIBC=`
1005+ eval " ` $CC_FOR_BUILD -E$dummy .c2> /dev/null| sed -n'
1006+ /^LIBC/{
1007+ s: ::g
1008+ p
1009+ }' ` "
9761010test x" ${LIBC} " ! = x&& {
9771011echo " ${UNAME_MACHINE} -pc-linux-${LIBC} "
9781012exit
@@ -1183,7 +1217,6 @@ EOF
11831217* :Darwin:* :* )
11841218UNAME_PROCESSOR=` uname -p` || UNAME_PROCESSOR=unknown
11851219case $UNAME_PROCESSOR in
1186- * 86) UNAME_PROCESSOR=i686 ;;
11871220 unknown) UNAME_PROCESSOR=powerpc ;;
11881221esac
11891222echo ${UNAME_PROCESSOR} -apple-darwin${UNAME_RELEASE}
@@ -1262,6 +1295,9 @@ EOF
12621295 i* 86:skyos:* :* )
12631296echo ${UNAME_MACHINE} -pc-skyos` echo${UNAME_RELEASE} ` | sed -e' s/ .*$//'
12641297exit ;;
1298+ i* 86:rdos:* :* )
1299+ echo ${UNAME_MACHINE} -pc-rdos
1300+ exit ;;
12651301esac
12661302
12671303# echo '(No uname command or uname output not recognized.)' 1>&2