diff options
-rw-r--r-- | generic/tclTest.c | 6 | ||||
-rw-r--r-- | tests/env.test | 2 | ||||
-rwxr-xr-x | win/configure | 12 | ||||
-rw-r--r-- | win/rules.vc | 20 | ||||
-rw-r--r-- | win/tcl.m4 | 9 | ||||
-rw-r--r-- | win/tclWin32Dll.c | 6 | ||||
-rw-r--r-- | win/tclWinInit.c | 42 |
7 files changed, 42 insertions, 55 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c index 91239a9..b8f2d28 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -330,7 +330,7 @@ static Tcl_NRPostProc NREUnwind_callback; static Tcl_ObjCmdProc TestNREUnwind; static Tcl_ObjCmdProc TestNRELevels; static Tcl_ObjCmdProc TestInterpResolverCmd; -#if defined(HAVE_CPUID) || defined(_WIN32) +#if defined(HAVE_CPUID) static Tcl_ObjCmdProc TestcpuidCmd; #endif @@ -613,7 +613,7 @@ Tcltest_Init( NULL, NULL); Tcl_CreateCommand(interp, "testexitmainloop", TestexitmainloopCmd, NULL, NULL); -#if defined(HAVE_CPUID) || defined(_WIN32) +#if defined(HAVE_CPUID) Tcl_CreateObjCommand(interp, "testcpuid", TestcpuidCmd, NULL, NULL); #endif @@ -7068,7 +7068,7 @@ TestGetIntForIndexCmd( -#if defined(HAVE_CPUID) || defined(_WIN32) +#if defined(HAVE_CPUID) /* *---------------------------------------------------------------------- * diff --git a/tests/env.test b/tests/env.test index 5250ac8..9eacd5d 100644 --- a/tests/env.test +++ b/tests/env.test @@ -106,7 +106,7 @@ variable keep { __CF_USER_TEXT_ENCODING SECURITYSESSIONID LANG WINDIR TERM CommonProgramFiles CommonProgramFiles(x86) ProgramFiles ProgramFiles(x86) CommonProgramW6432 ProgramW6432 - WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR + WINECONFIGDIR WINEDATADIR WINEDLLDIR0 WINEHOMEDIR PROCESSOR_ARCHITECTURE } variable printenvScript [makeFile [string map [list @keep@ [list $keep]] { diff --git a/win/configure b/win/configure index 2c3bc57..4d9e8d3 100755 --- a/win/configure +++ b/win/configure @@ -4466,10 +4466,15 @@ printf "%s\n" "using shared flags" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 printf "%s\n" " Using 64-bit $MACHINE mode" >&6; } ;; + arm64) + MACHINE="ARM64" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using ARM64 $MACHINE mode" >&5 +printf "%s\n" " Using ARM64 $MACHINE mode" >&6; } + ;; ia64) MACHINE="IA64" - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using 64-bit $MACHINE mode" >&5 -printf "%s\n" " Using 64-bit $MACHINE mode" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Using IA64 $MACHINE mode" >&5 +printf "%s\n" " Using IA64 $MACHINE mode" >&6; } ;; *) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4539,6 +4544,9 @@ printf "%s\n" "using shared flags" >&6; } amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build ;; + arm64) + MACHINE="ARM64" + ;; ia64) MACHINE="IA64" ;; diff --git a/win/rules.vc b/win/rules.vc index 8a91b58..2f01de0 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -24,7 +24,7 @@ _RULES_VC = 1 # For modifications that are not backward-compatible, you *must* change
# the major version.
RULES_VERSION_MAJOR = 1
-RULES_VERSION_MINOR = 9
+RULES_VERSION_MINOR = 10
# The PROJECT macro must be defined by parent makefile.
!if "$(PROJECT)" == ""
@@ -411,8 +411,8 @@ _INSTALLDIR=$(_INSTALLDIR)\lib # compiler version 1200. This is kept only for legacy reasons as it
# does not make sense for recent Microsoft compilers. Only used for
# output directory names.
-# ARCH - set to IX86 or AMD64 depending on 32- or 64-bit target
-# NATIVE_ARCH - set to IX86 or AMD64 for the host machine
+# ARCH - set to IX86, ARM64 or AMD64 depending on 32- or 64-bit target
+# NATIVE_ARCH - set to IX86, ARM64 or AMD64 for the host machine
# MACHINE - same as $(ARCH) - legacy
# _VC_MANIFEST_EMBED_{DLL,EXE} - commands for embedding a manifest if needed
@@ -435,6 +435,8 @@ VCVER=0 && ![echo ARCH=IX86 >> vercl.x] \
&& ![echo $(_HASH)elif defined(_M_AMD64) >> vercl.x] \
&& ![echo ARCH=AMD64 >> vercl.x] \
+ && ![echo $(_HASH)elif defined(_M_ARM64) >> vercl.x] \
+ && ![echo ARCH=ARM64 >> vercl.x] \
&& ![echo $(_HASH)endif >> vercl.x] \
&& ![$(cc32) -nologo -TC -P vercl.x 2>NUL]
!include vercl.i
@@ -459,6 +461,9 @@ VCVER = $(VCVERSION) !if "$(MACHINE)" == "x86"
!undef MACHINE
MACHINE = IX86
+!elseif "$(MACHINE)" == "arm64"
+!undef MACHINE
+MACHINE = ARM64
!elseif "$(MACHINE)" == "x64"
!undef MACHINE
MACHINE = AMD64
@@ -475,6 +480,8 @@ MACHINE=$(ARCH) # the Tcl platform::identify command
!if "$(MACHINE)" == "AMD64"
PLATFORM_IDENTIFY = win32-x86_64
+!elseif "$(MACHINE)" == "ARM64"
+PLATFORM_IDENTIFY = win32-arm
!else
PLATFORM_IDENTIFY = win32-ix86
!endif
@@ -490,6 +497,8 @@ MULTIPLATFORM_INSTALL = 0 !if ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i x86]
NATIVE_ARCH=IX86
+!elseif ![reg query HKLM\Hardware\Description\System\CentralProcessor\0 /v Identifier | findstr /i ARM | findstr /i 64-bit]
+NATIVE_ARCH=ARM64
!else
NATIVE_ARCH=AMD64
!endif
@@ -1476,6 +1485,11 @@ carch = /D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE carch =
!endif
+# cpuid is only available on intel machines
+!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "AMD64"
+carch = $(carch) /DHAVE_CPUID=1
+!endif
+
!if $(DEBUG)
# Turn warnings into errors
cwarn = $(cwarn) -WX
@@ -735,9 +735,13 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ MACHINE="AMD64" ; # assume AMD64 as default 64-bit build AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) ;; + arm64) + MACHINE="ARM64" + AC_MSG_RESULT([ Using ARM64 $MACHINE mode]) + ;; ia64) MACHINE="IA64" - AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) + AC_MSG_RESULT([ Using IA64 $MACHINE mode]) ;; *) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ @@ -789,6 +793,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ amd64|x64|yes) MACHINE="AMD64" ; # assume AMD64 as default 64-bit build ;; + arm64) + MACHINE="ARM64" + ;; ia64) MACHINE="IA64" ;; diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c index 752bf8e..2d4ae48 100644 --- a/win/tclWin32Dll.c +++ b/win/tclWin32Dll.c @@ -437,12 +437,12 @@ TclWinCPUID( { int status = TCL_ERROR; -#if defined(HAVE_INTRIN_H) && defined(_WIN64) +#if defined(HAVE_INTRIN_H) && defined(_WIN64) && defined(HAVE_CPUID) __cpuid((int *)regsPtr, index); status = TCL_OK; -#elif defined(__GNUC__) +#elif defined(__GNUC__) && defined(HAVE_CPUID) # if defined(_WIN64) /* * Execute the CPUID instruction with the given index, and store results @@ -558,7 +558,7 @@ TclWinCPUID( status = registration.status; # endif /* !_WIN64 */ -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) && defined(HAVE_CPUID) # if defined(_WIN64) __cpuid(regsPtr, index); diff --git a/win/tclWinInit.c b/win/tclWinInit.c index a6ff036..64b3b5a 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -36,48 +36,6 @@ typedef struct { } OemId; /* - * The following macros are missing from some versions of winnt.h. - */ - -#ifndef PROCESSOR_ARCHITECTURE_INTEL -#define PROCESSOR_ARCHITECTURE_INTEL 0 -#endif -#ifndef PROCESSOR_ARCHITECTURE_MIPS -#define PROCESSOR_ARCHITECTURE_MIPS 1 -#endif -#ifndef PROCESSOR_ARCHITECTURE_ALPHA -#define PROCESSOR_ARCHITECTURE_ALPHA 2 -#endif -#ifndef PROCESSOR_ARCHITECTURE_PPC -#define PROCESSOR_ARCHITECTURE_PPC 3 -#endif -#ifndef PROCESSOR_ARCHITECTURE_SHX -#define PROCESSOR_ARCHITECTURE_SHX 4 -#endif -#ifndef PROCESSOR_ARCHITECTURE_ARM -#define PROCESSOR_ARCHITECTURE_ARM 5 -#endif -#ifndef PROCESSOR_ARCHITECTURE_IA64 -#define PROCESSOR_ARCHITECTURE_IA64 6 -#endif -#ifndef PROCESSOR_ARCHITECTURE_ALPHA64 -#define PROCESSOR_ARCHITECTURE_ALPHA64 7 -#endif -#ifndef PROCESSOR_ARCHITECTURE_MSIL -#define PROCESSOR_ARCHITECTURE_MSIL 8 -#endif -#ifndef PROCESSOR_ARCHITECTURE_AMD64 -#define PROCESSOR_ARCHITECTURE_AMD64 9 -#endif -#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 -#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 -#endif -#ifndef PROCESSOR_ARCHITECTURE_UNKNOWN -#define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF -#endif - - -/* * The following arrays contain the human readable strings for the * processor values. */ |