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-08-03 '
7+ timestamp=' 2007-05-17 '
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 ; } ;
@@ -160,6 +161,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
160161 arm* ) machine=arm-unknown ;;
161162 sh3el) machine=shl-unknown ;;
162163 sh3eb) machine=sh-unknown ;;
164+ sh5el) machine=sh5le-unknown ;;
163165 * ) machine=${UNAME_MACHINE_ARCH} -unknown ;;
164166 esac
165167 # The Operating System including object format, if it has switched
@@ -206,8 +208,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
206208 * :ekkoBSD:* :* )
207209 echo ${UNAME_MACHINE} -unknown-ekkobsd${UNAME_RELEASE}
208210 exit ;;
211+ * :SolidBSD:* :* )
212+ echo ${UNAME_MACHINE} -unknown-solidbsd${UNAME_RELEASE}
213+ exit ;;
209214 macppc:MirBSD:* :* )
210- echo powerppc -unknown-mirbsd${UNAME_RELEASE}
215+ echo powerpc -unknown-mirbsd${UNAME_RELEASE}
211216 exit ;;
212217 * :MirBSD:* :* )
213218 echo ${UNAME_MACHINE} -unknown-mirbsd${UNAME_RELEASE}
@@ -325,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
325330 sun4* :SunOS:5.* :* | tadpole* :SunOS:5.* :* )
326331 echo sparc-sun-solaris2` echo ${UNAME_RELEASE} | sed -e ' s/[^.]*//' `
327332 exit ;;
328- i86pc:SunOS:5.* :* )
333+ i86pc:SunOS:5.* :* | ix86xen:SunOS:5. * : * )
329334 echo i386-pc-solaris2` echo ${UNAME_RELEASE} | sed -e ' s/[^.]*//' `
330335 exit ;;
331336 sun4* :SunOS:6* :* )
@@ -764,12 +769,19 @@ EOF
764769 echo ${UNAME_MACHINE} -unknown-bsdi${UNAME_RELEASE}
765770 exit ;;
766771 * :FreeBSD:* :* )
767- echo ${UNAME_MACHINE} -unknown-freebsd` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' `
772+ case ${UNAME_MACHINE} in
773+ pc98)
774+ echo i386-unknown-freebsd` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' ` ;;
775+ amd64)
776+ echo x86_64-unknown-freebsd` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' ` ;;
777+ * )
778+ echo ${UNAME_MACHINE} -unknown-freebsd` echo ${UNAME_RELEASE} | sed -e ' s/[-(].*//' ` ;;
779+ esac
768780 exit ;;
769781 i* :CYGWIN* :* )
770782 echo ${UNAME_MACHINE} -pc-cygwin
771783 exit ;;
772- i * :MINGW* :* )
784+ * :MINGW* :* )
773785 echo ${UNAME_MACHINE} -pc-mingw32
774786 exit ;;
775787 i* :windows32* :* )
779791 i* :PW* :* )
780792 echo ${UNAME_MACHINE} -pc-pw32
781793 exit ;;
782- x86:Interix* :[34]* )
783- echo i586-pc-interix${UNAME_RELEASE} | sed -e ' s/\..*//'
784- exit ;;
794+ * :Interix* :[3456]* )
795+ case ${UNAME_MACHINE} in
796+ x86)
797+ echo i586-pc-interix${UNAME_RELEASE}
798+ exit ;;
799+ EM64T | authenticamd)
800+ echo x86_64-unknown-interix${UNAME_RELEASE}
801+ exit ;;
802+ esac ;;
785803 [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:* )
786804 echo i${UNAME_MACHINE} -pc-mks
787805 exit ;;
817835 arm* :Linux:* :* )
818836 echo ${UNAME_MACHINE} -unknown-linux-gnu
819837 exit ;;
838+ avr32* :Linux:* :* )
839+ echo ${UNAME_MACHINE} -unknown-linux-gnu
840+ exit ;;
820841 cris:Linux:* :* )
821842 echo cris-axis-linux-gnu
822843 exit ;;
851872 #endif
852873 #endif
853874EOF
854- eval ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | grep ^CPU=`
875+ eval " ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | sed -n '
876+ /^CPU/{
877+ s: ::g
878+ p
879+ }' ` "
855880 test x" ${CPU} " ! = x && { echo " ${CPU} -unknown-linux-gnu" ; exit ; }
856881 ;;
857882 mips64:Linux:* :* )
870895 #endif
871896 #endif
872897EOF
873- eval ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | grep ^CPU=`
898+ eval " ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | sed -n '
899+ /^CPU/{
900+ s: ::g
901+ p
902+ }' ` "
874903 test x" ${CPU} " ! = x && { echo " ${CPU} -unknown-linux-gnu" ; exit ; }
875904 ;;
876905 or32:Linux:* :* )
919948 sparc:Linux:* :* | sparc64:Linux:* :* )
920949 echo ${UNAME_MACHINE} -unknown-linux-gnu
921950 exit ;;
951+ vax:Linux:* :* )
952+ echo ${UNAME_MACHINE} -dec-linux-gnu
953+ exit ;;
922954 x86_64:Linux:* :* )
923955 echo x86_64-unknown-linux-gnu
924956 exit ;;
957+ xtensa:Linux:* :* )
958+ echo xtensa-unknown-linux-gnu
959+ exit ;;
925960 i* 86:Linux:* :* )
926961 # The BFD linker knows what the default object file format is, so
927962 # first see if it will tell us. cd to the root directory to prevent
964999 LIBC=gnulibc1
9651000 # endif
9661001 #else
967- #ifdef __INTEL_COMPILER
1002+ #if defined( __INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
9681003 LIBC=gnu
9691004 #else
9701005 LIBC=gnuaout
@@ -974,7 +1009,11 @@ EOF
9741009 LIBC=dietlibc
9751010 #endif
9761011EOF
977- eval ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | grep ^LIBC=`
1012+ eval " ` $CC_FOR_BUILD -E $dummy .c 2> /dev/null | sed -n '
1013+ /^LIBC/{
1014+ s: ::g
1015+ p
1016+ }' ` "
9781017 test x" ${LIBC} " ! = x && {
9791018 echo " ${UNAME_MACHINE} -pc-linux-${LIBC} "
9801019 exit
@@ -1176,6 +1215,15 @@ EOF
11761215 SX-6:SUPER-UX:* :* )
11771216 echo sx6-nec-superux${UNAME_RELEASE}
11781217 exit ;;
1218+ SX-7:SUPER-UX:* :* )
1219+ echo sx7-nec-superux${UNAME_RELEASE}
1220+ exit ;;
1221+ SX-8:SUPER-UX:* :* )
1222+ echo sx8-nec-superux${UNAME_RELEASE}
1223+ exit ;;
1224+ SX-8R:SUPER-UX:* :* )
1225+ echo sx8r-nec-superux${UNAME_RELEASE}
1226+ exit ;;
11791227 Power* :Rhapsody:* :* )
11801228 echo powerpc-apple-rhapsody${UNAME_RELEASE}
11811229 exit ;;
@@ -1185,7 +1233,6 @@ EOF
11851233 * :Darwin:* :* )
11861234 UNAME_PROCESSOR=` uname -p` || UNAME_PROCESSOR=unknown
11871235 case $UNAME_PROCESSOR in
1188- * 86) UNAME_PROCESSOR=i686 ;;
11891236 unknown) UNAME_PROCESSOR=powerpc ;;
11901237 esac
11911238 echo ${UNAME_PROCESSOR} -apple-darwin${UNAME_RELEASE}
@@ -1264,6 +1311,9 @@ EOF
12641311 i* 86:skyos:* :* )
12651312 echo ${UNAME_MACHINE} -pc-skyos` echo ${UNAME_RELEASE} ` | sed -e ' s/ .*$//'
12661313 exit ;;
1314+ i* 86:rdos:* :* )
1315+ echo ${UNAME_MACHINE} -pc-rdos
1316+ exit ;;
12671317esac
12681318
12691319# echo '(No uname command or uname output not recognized.)' 1>&2
0 commit comments