diff options
Diffstat (limited to 'unix')
-rw-r--r--[-rwxr-xr-x] | unix/Makefile.in | 0 | ||||
-rwxr-xr-x | unix/configure | 44 | ||||
-rw-r--r--[-rwxr-xr-x] | unix/configure.in | 14 | ||||
-rw-r--r--[-rwxr-xr-x] | unix/tcl.m4 | 0 | ||||
-rw-r--r-- | unix/tclUnixCompat.c | 7 | ||||
-rw-r--r--[-rwxr-xr-x] | unix/tclUnixFile.c | 0 | ||||
-rw-r--r--[-rwxr-xr-x] | unix/tclUnixPort.h | 0 |
7 files changed, 62 insertions, 3 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in index aa771cc..aa771cc 100755..100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in diff --git a/unix/configure b/unix/configure index b933912..1a0d882 100755 --- a/unix/configure +++ b/unix/configure @@ -9324,6 +9324,48 @@ fi echo "$ac_t""$tcl_ok" 1>&6 #-------------------------------------------------------------------- +# The check below checks whether the cpuid instruction is usable. +#-------------------------------------------------------------------- + +echo $ac_n "checking whether the cpuid instruction is usable""... $ac_c" 1>&6 +echo "configure:9332: checking whether the cpuid instruction is usable" >&5 +if eval "test \"`echo '$''{'tcl_cv_cpuid'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext <<EOF +#line 9338 "configure" +#include "confdefs.h" + +int main() { + + int index,ax,bx,cx,dx; + __asm__ __volatile__ ("cpuid":\ + "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (index)); + +; return 0; } +EOF +if { (eval echo configure:9349: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + tcl_cv_cpuid=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + tcl_cv_cpuid=no +fi +rm -f conftest* +fi + +echo "$ac_t""$tcl_cv_cpuid" 1>&6 +if test $tcl_cv_cpuid = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_CPUID 1 +EOF + +fi + +#-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- @@ -9352,7 +9394,7 @@ if test "`uname -s`" = "Darwin" ; then if test "`uname -s`" = "Darwin" ; then echo $ac_n "checking how to package libraries""... $ac_c" 1>&6 -echo "configure:9356: checking how to package libraries" >&5 +echo "configure:9398: checking how to package libraries" >&5 # Check whether --enable-framework or --disable-framework was given. if test "${enable_framework+set}" = set; then enableval="$enable_framework" diff --git a/unix/configure.in b/unix/configure.in index fbf9f41..c04c735 100755..100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -566,6 +566,20 @@ fi AC_MSG_RESULT([$tcl_ok]) #-------------------------------------------------------------------- +# The check below checks whether the cpuid instruction is usable. +#-------------------------------------------------------------------- + +AC_CACHE_CHECK([whether the cpuid instruction is usable], tcl_cv_cpuid, [ + AC_TRY_LINK(, [ + int index,ax,bx,cx,dx; + __asm__ __volatile__ ("cpuid":\ + "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) : "a" (index)); + ], tcl_cv_cpuid=yes, tcl_cv_cpuid=no)]) +if test $tcl_cv_cpuid = yes; then + AC_DEFINE(HAVE_CPUID) +fi + +#-------------------------------------------------------------------- # The statements below define a collection of symbols related to # building libtcl as a shared library instead of a static library. #-------------------------------------------------------------------- diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 2391a41..2391a41 100755..100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 diff --git a/unix/tclUnixCompat.c b/unix/tclUnixCompat.c index 16e7a61..aad3d76 100644 --- a/unix/tclUnixCompat.c +++ b/unix/tclUnixCompat.c @@ -692,8 +692,11 @@ TclWinCPUID( { int status = TCL_ERROR; - /* There is no reason this couldn't be implemented on UNIX as well */ - return status; +#ifdef HAVE_CPUID + __asm__ __volatile__ ("cpuid":\ + "=a" (regsPtr[0]), "=b" (regsPtr[1]), "=c" (regsPtr[2]), "=d" (regsPtr[3]) : "a" (index)); + status = TCL_OK; +#endif return status; } /* diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 4ba2e47..4ba2e47 100755..100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 9426697..9426697 100755..100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h |