diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-12-11 14:19:48 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-12-11 14:19:48 (GMT) |
commit | bf868c1c56292a44ff5faeef5b348408554cab1a (patch) | |
tree | 3728938b981dd31981452db01614e8c93a4a436e | |
parent | dfeacc8edb1494b531c9bdbe41a83aa89a557198 (diff) | |
download | tcl-bf868c1c56292a44ff5faeef5b348408554cab1a.zip tcl-bf868c1c56292a44ff5faeef5b348408554cab1a.tar.gz tcl-bf868c1c56292a44ff5faeef5b348408554cab1a.tar.bz2 |
Initial implementation of TIP #491. Not tested yet.
-rw-r--r-- | generic/tcl.h | 4 | ||||
-rw-r--r-- | generic/tclInt.h | 4 | ||||
-rw-r--r-- | unix/configure.ac | 6 | ||||
-rw-r--r-- | win/configure.ac | 6 | ||||
-rw-r--r-- | win/rules.vc | 43 | ||||
-rw-r--r-- | win/tcl.rc | 8 | ||||
-rw-r--r-- | win/tclsh.rc | 8 |
7 files changed, 14 insertions, 65 deletions
diff --git a/generic/tcl.h b/generic/tcl.h index a6a8c94..b7d4e90 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -91,6 +91,10 @@ extern "C" { #endif #endif /* !TCL_NO_DEPRECATED */ +#ifndef TCL_THREADS +# define TCL_THREADS 1 +#endif + /* * A special definition used to allow this header file to be included from * windows resource files so that they can obtain version information. diff --git a/generic/tclInt.h b/generic/tclInt.h index ad1d9c6..1fd252f 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -4149,6 +4149,10 @@ typedef const char *TclDTraceStr; } \ } +#if TCL_THREADS && !defined(USE_THREAD_ALLOC) +# define USE_THREAD_ALLOC 1 +#endif + #if defined(PURIFY) /* diff --git a/unix/configure.ac b/unix/configure.ac index e14d85e..5b982e8 100644 --- a/unix/configure.ac +++ b/unix/configure.ac @@ -120,12 +120,6 @@ if test -z "$no_pipe" && test -n "$GCC"; then fi #------------------------------------------------------------------------ -# Threads support -#------------------------------------------------------------------------ - -SC_ENABLE_THREADS - -#------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ diff --git a/win/configure.ac b/win/configure.ac index d03695c..179f151 100644 --- a/win/configure.ac +++ b/win/configure.ac @@ -78,12 +78,6 @@ AC_PROG_MAKE_SET AC_OBJEXT AC_EXEEXT -#-------------------------------------------------------------------- -# Check whether --enable-threads or --disable-threads was given. -#-------------------------------------------------------------------- - -SC_ENABLE_THREADS - #------------------------------------------------------------------------ # Embedded configuration information, encoding to use for the values, TIP #59 #------------------------------------------------------------------------ diff --git a/win/rules.vc b/win/rules.vc index 9b917b6..890618c 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -626,7 +626,6 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg # The following macros are defined by this section based on OPTS
# STATIC_BUILD - 0 -> Tcl is to be built as a shared library
# 1 -> build as a static library and shell
-# TCL_THREADS - legacy but always 1 on Windows since winsock requires it.
# DEBUG - 1 -> debug build, 0 -> release builds
# SYMBOLS - 1 -> generate PDB's, 0 -> no PDB's
# PROFILE - 1 -> generate profiling info, 0 -> no profiling
@@ -648,7 +647,6 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg # Default values for all the above
STATIC_BUILD = 0
-TCL_THREADS = 1
DEBUG = 0
SYMBOLS = 0
PROFILE = 0
@@ -703,15 +701,6 @@ TCL_USE_STATIC_PACKAGES = 1 TCL_USE_STATIC_PACKAGES = 0
!endif
-!if [nmakehlp -f $(OPTS) "nothreads"]
-!message *** Compile explicitly for non-threaded tcl
-TCL_THREADS = 0
-USE_THREAD_ALLOC= 0
-!else
-TCL_THREADS = 1
-USE_THREAD_ALLOC= 1
-!endif
-
!if [nmakehlp -f $(OPTS) "symbols"]
!message *** Doing symbols
DEBUG = 1
@@ -747,12 +736,6 @@ PGO = 0 !message *** Warning: ignoring option "loimpact" - deprecated on modern Windows.
!endif
-# TBD - should get rid of this option
-!if [nmakehlp -f $(OPTS) "thrdalloc"]
-!message *** Doing thrdalloc
-USE_THREAD_ALLOC = 1
-!endif
-
!if [nmakehlp -f $(OPTS) "tclalloc"]
USE_THREAD_ALLOC = 0
!endif
@@ -943,7 +926,6 @@ VERSION = $(DOTVERSION:.=) # different compilers, build configurations etc.,
#
# Naming convention (suffixes):
-# t = full thread support.
# s = static library (as opposed to an import library)
# g = linked to the debug enabled C run-time.
# x = special static build when it links to the dynamic C run-time.
@@ -965,7 +947,7 @@ VERSION = $(DOTVERSION:.=) # PRJSTUBLIB - output path of the generated project stubs library
# RESFILE - output resource file (only if not static build)
-SUFX = tsgx
+SUFX = sgx
!if $(DEBUG)
BUILDDIRTOP = Debug
@@ -984,7 +966,7 @@ BUILDDIRTOP =$(BUILDDIRTOP)_VC$(VCVER) SUFX = $(SUFX:g=)
!endif
-TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
+TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_DynamicStaticX
!if !$(STATIC_BUILD)
TMP_DIRFULL = $(TMP_DIRFULL:Static=)
@@ -1001,11 +983,6 @@ SUFX = $(SUFX:x=) !endif
!endif
-!if !$(TCL_THREADS)
-TMP_DIRFULL = $(TMP_DIRFULL:Threaded=)
-SUFX = $(SUFX:t=)
-!endif
-
!ifndef TMP_DIR
TMP_DIR = $(TMP_DIRFULL)
!ifndef OUT_DIR
@@ -1049,9 +1026,6 @@ TCL_INCLUDES = -I"$(WINDIR)" -I"$(GENERICDIR)" !if $(TCLINSTALL) # Building against an installed Tcl
TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe
-!if !exist("$(TCLSH)") && $(TCL_THREADS)
-TCLSH = $(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe
-!endif
TCLSTUBLIB = $(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib
TCLIMPLIB = $(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib
TCL_LIBRARY = $(_TCLDIR)\lib
@@ -1063,9 +1037,6 @@ TCL_INCLUDES = -I"$(_TCLDIR)\include" !else # Building against Tcl sources
TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe
-!if !exist($(TCLSH)) && $(TCL_THREADS)
-TCLSH = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe
-!endif
TCLSTUBLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib
TCLIMPLIB = $(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib
TCL_LIBRARY = $(_TCLDIR)\library
@@ -1205,11 +1176,8 @@ OPTDEFINES = $(OPTDEFINES) -DTCL_MEM_DEBUG !if $(TCL_COMPILE_DEBUG)
OPTDEFINES = $(OPTDEFINES) -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
!endif
-!if $(TCL_THREADS)
-OPTDEFINES = $(OPTDEFINES) -DTCL_THREADS=1
-!if $(USE_THREAD_ALLOC)
-OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=1
-!endif
+!if $(USE_THREAD_ALLOC)==0
+OPTDEFINES = $(OPTDEFINES) -DUSE_THREAD_ALLOC=0
!endif
!if $(STATIC_BUILD)
OPTDEFINES = $(OPTDEFINES) -DSTATIC_BUILD
@@ -1662,9 +1630,6 @@ TCLNMAKECONFIG = "$(OUT_DIR)\tcl.nmake" !if defined(CORE_MACHINE) && "$(CORE_MACHINE)" != "$(MACHINE)"
!error ERROR: Build target ($(MACHINE)) does not match the Tcl library architecture ($(CORE_MACHINE)).
!endif
-!if defined(CORE_USE_THREAD_ALLOC) && $(CORE_USE_THREAD_ALLOC) != $(USE_THREAD_ALLOC)
-!message WARNING: Value of USE_THREAD_ALLOC ($(USE_THREAD_ALLOC)) does not match its Tcl core value ($(CORE_USE_THREAD_ALLOC)).
-!endif
!if defined(CORE_DEBUG) && $(CORE_DEBUG) != $(DEBUG)
!message WARNING: Value of DEBUG ($(DEBUG)) does not match its Tcl library configuration ($(DEBUG)).
!endif
@@ -7,19 +7,13 @@ // // build-up the name suffix that defines the type of build this is. // -#if TCL_THREADS -#define SUFFIX_THREADS "t" -#else -#define SUFFIX_THREADS "" -#endif - #if DEBUG && !UNCHECKED #define SUFFIX_DEBUG "g" #else #define SUFFIX_DEBUG "" #endif -#define SUFFIX SUFFIX_THREADS SUFFIX_DEBUG +#define SUFFIX SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ diff --git a/win/tclsh.rc b/win/tclsh.rc index 161da50..bd1a4da 100644 --- a/win/tclsh.rc +++ b/win/tclsh.rc @@ -8,12 +8,6 @@ // // build-up the name suffix that defines the type of build this is. // -#if TCL_THREADS -#define SUFFIX_THREADS "t" -#else -#define SUFFIX_THREADS "" -#endif - #if STATIC_BUILD #define SUFFIX_STATIC "s" #else @@ -26,7 +20,7 @@ #define SUFFIX_DEBUG "" #endif -#define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG +#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */ |