diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2017-10-03 08:06:30 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2017-10-03 08:06:30 (GMT) |
commit | f5c6b072469892af03a919e8c941e0426baead1f (patch) | |
tree | 9173711655b36f89c5c41d8e879fef582c92b159 | |
parent | 35256f809ed60c7d2fe088246d90c8841686dc76 (diff) | |
download | tcl-f5c6b072469892af03a919e8c941e0426baead1f.zip tcl-f5c6b072469892af03a919e8c941e0426baead1f.tar.gz tcl-f5c6b072469892af03a919e8c941e0426baead1f.tar.bz2 |
Remove use of any macros used in rules.vc from rules-ext.vc
Added USE_WIDECHAR_API to control usage of Windows wide API's.
-rw-r--r-- | win/makefile.vc | 2 | ||||
-rw-r--r-- | win/rules-ext.vc | 36 | ||||
-rw-r--r-- | win/rules.vc | 15 |
3 files changed, 35 insertions, 18 deletions
diff --git a/win/makefile.vc b/win/makefile.vc index 9bd91f5..7a3de6e 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -673,6 +673,7 @@ CORE_MACHINE = $(MACHINE) CORE_DEBUG = $(DEBUG)
CORE_TCL_THREADS = $(TCL_THREADS)
CORE_USE_THREAD_ALLOC = $(USE_THREAD_ALLOC)
+CORE_USE_WIDECHAR_API = $(USE_WIDECHAR_API)
<<
#---------------------------------------------------------------------
@@ -947,6 +948,7 @@ install-libraries: tclConfig tcl-nmake install-msgs install-tzdata @$(CPY) "$(OUT_DIR)\tclConfig.sh" "$(LIB_INSTALL_DIR)\"
@$(CPY) "$(WINDIR)\tclooConfig.sh" "$(LIB_INSTALL_DIR)\"
@$(CPY) "$(WINDIR)\rules.vc" "$(LIB_INSTALL_DIR)\nmake\"
+ @$(CPY) "$(WINDIR)\rules-ext.vc" "$(LIB_INSTALL_DIR)\nmake\"
@$(CPY) "$(WINDIR)\nmakehlp.c" "$(LIB_INSTALL_DIR)\nmake\"
@$(CPY) "$(OUT_DIR)\tcl.nmake" "$(LIB_INSTALL_DIR)\nmake\"
@echo Installing library http1.0 directory
diff --git a/win/rules-ext.vc b/win/rules-ext.vc index 2a8943b..094bc32 100644 --- a/win/rules-ext.vc +++ b/win/rules-ext.vc @@ -1,38 +1,40 @@ # This file should only be included in makefiles for Tcl extensions, # NOT in the makefile for Tcl itself. + +!ifndef _RULES_EXT_VC + !if "$(PROJECT)" == "tcl" !error The rules-ext.vc file is not intended for Tcl itself. !endif # First locate the Tcl directory that we are working with. -!ifndef TCLDIR +!ifdef TCLDIR + +_RULESDIR = $(TCLDIR:/=\) + +!else # If an installation path is specified, that is also the Tcl directory. # Also, tk never builds against an installed Tcl, it needs Tcl sources !if defined(INSTALLDIR) && "$(PROJECT)" != "tk" -TCLDIR=$(INSTALLDIR) +_RULESDIR=$(INSTALLDIR:/=\) !else -TCLDIR = ../../tcl +_RULESDIR = ..\..\tcl !endif !endif # ifndef TCLDIR -# _TCLDIR = Windows native path format of TCLDIR -_TCLDIR = $(TCLDIR:/=\) - # Now look for the rules.vc file under the Tcl root -!if exist("$(_TCLDIR)\lib\nmake\rules.vc") # Building against installed Tcl -_RULESDIR = $(_TCLDIR)\lib\nmake -!elseif exist("$(_TCLDIR)\win\rules.vc") # Building against Tcl sources -_RULESDIR = $(_TCLDIR)\win +!if exist("$(_RULESDIR)\lib\nmake\rules.vc") # Building against installed Tcl +_RULESDIR = $(_RULESDIR)\lib\nmake +!elseif exist("$(_RULESDIR)\win\rules.vc") # Building against Tcl sources +_RULESDIR = $(_RULESDIR)\win !else # If we have not located Tcl's rules file, most likely we are compiling # against an older version of Tcl and so must use our own support files. _RULESDIR = . !endif -_RULES_VC = $(_RULESDIR)\rules.vc - !if "$(_RULESDIR)" != "." # Potentially using Tcl's support files. Need to compare the versions. # We extract version numbers using the nmakehlp program. For this @@ -41,10 +43,10 @@ _RULES_VC = $(_RULESDIR)\rules.vc !endif !if [echo TCL_RULES_MAJOR = \> versions.vc] \ - && [nmakehlp -V "$(_RULES_VC)" RULES_VERSION_MAJOR >> versions.vc] + && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc] !endif !if [echo TCL_RULES_MINOR = \>> versions.vc] \ - && [nmakehlp -V "$(_RULES_VC)" RULES_VERSION_MINOR >> versions.vc] + && [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MINOR >> versions.vc] !endif !if [echo OUR_RULES_MAJOR = \>> versions.vc] \ @@ -55,7 +57,6 @@ _RULES_VC = $(_RULESDIR)\rules.vc !endif !include versions.vc # We have a newer version of the support files, use them -!message V $(TCL_RULES_MAJOR) $(TCL_RULES_MINOR) $(OUR_RULES_MAJOR) $(OUR_RULES_MINOR) !if ($(TCL_RULES_MAJOR) != $(OUR_RULES_MAJOR)) || ($(TCL_RULES_MINOR) < $(OUR_RULES_MINOR)) _RULESDIR = . !endif @@ -64,11 +65,12 @@ _RULESDIR = . # Get rid of our internal defines before calling rules.vc -!undef _TCLDIR !undef TCL_RULES_MAJOR !undef TCL_RULES_MINOR !undef OUR_RULES_MAJOR !undef OUR_RULES_MINOR !message *** Using $(_RULESDIR)\rules.vc -#!include "$(_RULESDIR)\rules.vc" +!include "$(_RULESDIR)\rules.vc" + +!endif # _RULES_EXT_VC
\ No newline at end of file diff --git a/win/rules.vc b/win/rules.vc index 6846a32..399796f 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -1092,8 +1092,21 @@ OPTDEFINES = $(OPTDEFINES) -DNO_STRTOI64 # _ATL_XP_TARGETING - Newer SDK's need this to build for XP
COMPILERFLAGS = /D_ATL_XP_TARGETING
-# UNICODE - Use the wide char Windows API. Tcl 8.5 does not define this.
+
+# Following is primarily for the benefit of extensions. Tcl 8.5 builds
+# Tcl without /DUNICODE, while 8.6 builds with it defined. When building
+# an extension, it is advisable (but not mandated) to use the same Windows
+# API as the Tcl build. This is accordingly defaulted below. A particular
+# extension can override this by pre-definining USE_WIDECHAR_API.
+!ifndef USE_WIDECHAR_API
!if $(TCL_VERSION) > 85
+USE_WIDECHAR_API = 1
+!else
+USE_WIDECHAR_API = 0
+!endif
+!endif
+
+!if $(USE_WIDECHAR_API)
COMPILERFLAGS = $(COMPILERFLAGS) /DUNICODE /D_UNICODE
!endif
|