summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-08-27 17:44:47 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-08-27 17:44:47 (GMT)
commitcbc322379f8ec1ff728d196347312e8441a3a154 (patch)
tree6d1c6cec0560b90c359e57d9771574bd24c01b09 /win
parentd3e4f0bc9405b86444625dede7f676cb3d709df5 (diff)
parente4c7ef5bdf6375e1860418b1ec92c07f88660cc8 (diff)
downloadtk-cbc322379f8ec1ff728d196347312e8441a3a154.zip
tk-cbc322379f8ec1ff728d196347312e8441a3a154.tar.gz
tk-cbc322379f8ec1ff728d196347312e8441a3a154.tar.bz2
merge trunk
Diffstat (limited to 'win')
-rwxr-xr-xwin/buildall.vc.bat69
-rw-r--r--win/makefile.vc156
-rw-r--r--win/nmakehlp.c10
-rw-r--r--win/rules.vc52
4 files changed, 186 insertions, 101 deletions
diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat
index 58360b9..1400dbb 100755
--- a/win/buildall.vc.bat
+++ b/win/buildall.vc.bat
@@ -23,18 +23,27 @@ goto OPTIONS_DONE
:: reset errorlevel
cd > nul
+:: You might have installed your developer studio to add itself to the
+:: path or have already run vcvars32.bat. Testing these envars proves
+:: cl.exe and friends are in your path.
+::
+if defined VCINSTALLDIR (goto :startBuilding)
+if defined MSDEVDIR (goto :startBuilding)
+if defined MSVCDIR (goto :startBuilding)
+if defined MSSDK (goto :startBuilding)
+if defined WINDOWSSDKDIR (goto :startBuilding)
+
:: We need to run the development environment batch script that comes
-:: with developer studio (v4,5,6,7,etc...) All have it. These paths
-:: might not be correct. You may need to edit these.
+:: with developer studio (v4,5,6,7,etc...) All have it. This path
+:: might not be correct. You should call it yourself prior to running
+:: this batchfile.
::
-if not defined MSDevDir (
- call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat"
- ::call "C:\Program Files\Microsoft Developer Studio\vc\bin\vcvars32.bat"
- ::call c:\dev\devstudio60\vc98\bin\vcvars32.bat
- if errorlevel 1 goto no_vcvars
-)
+call "C:\Program Files\Microsoft Developer Studio\vc98\bin\vcvars32.bat"
+if errorlevel 1 (goto no_vcvars)
+:startBuilding
+echo.
echo Sit back and have a cup of coffee while this grinds through ;)
echo You asked for *everything*, remember?
echo.
@@ -54,6 +63,7 @@ if "%TCLDIR%" == "" set TCLDIR=..\..\tcl
:: Build the normal stuff along with the help file.
::
+<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<<<<<
set OPTS=none
if not %SYMBOLS%.==. set OPTS=symbols
nmake -nologo -f makefile.vc release htmlhelp OPTS=%OPTS% %1
@@ -75,26 +85,43 @@ if errorlevel 1 goto error
:: Build the core and shell for thread support.
::
-set OPTS=threads
-if not %SYMBOLS%.==. set OPTS=symbols,threads
+======= COMMON ANCESTOR content follows ============================
+set OPTS=none
+if not %SYMBOLS%.==. set OPTS=symbols
+nmake -nologo -f makefile.vc release winhelp OPTS=%OPTS% %1
+if errorlevel 1 goto error
+
+:: Build the static core, dlls and shell.
+::
+set OPTS=static
+if not %SYMBOLS%.==. set OPTS=symbols,static
nmake -nologo -f makefile.vc release OPTS=%OPTS% %1
if errorlevel 1 goto error
-:: Build a static, thread support core library (no shell).
+:: Build the special static libraries that use the dynamic runtime.
::
-set OPTS=static,threads
-if not %SYMBOLS%.==. set OPTS=symbols,static,threads
+set OPTS=static,msvcrt
+if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt
nmake -nologo -f makefile.vc core OPTS=%OPTS% %1
if errorlevel 1 goto error
-:: Build the special static libraries the use the dynamic runtime,
-:: but now with thread support.
+:: Build the core and shell for thread support.
+::
+======= MERGED IN content follows ==================================
+>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+set OPTS=threads
+if not %SYMBOLS%.==. set OPTS=symbols,threads
+nmake -nologo -f makefile.vc release OPTS=%OPTS% %1
+if errorlevel 1 goto error
+
+:: Build the static core and shell.
::
set OPTS=static,msvcrt,threads
if not %SYMBOLS%.==. set OPTS=symbols,static,msvcrt,threads
-nmake -nologo -f makefile.vc core OPTS=%OPTS% %1
+nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1
if errorlevel 1 goto error
+set OPTS=
set SYMBOLS=
goto end
@@ -103,16 +130,16 @@ echo *** BOOM! ***
goto end
:no_vcvars
-echo vcvars32.bat not found. You'll need to edit this batch script.
+echo vcvars32.bat was not run prior to this batchfile, nor are the MS tools in your path.
goto out
:help
title buildall.vc.bat help message
echo usage:
-echo %0 : builds Tk for all build types (do this first)
-echo %0 install : installs all the release builds (do this second)
-echo %0 symbols : builds Tk for all debugging build types.
-echo %0 symbols install : install all the debug builds
+echo %0 : builds Tk for all build types (do this first)
+echo %0 install : installs all the release builds (do this second)
+echo %0 symbols : builds Tk for all debugging build types
+echo %0 symbols install : install all the debug builds
echo.
goto out
diff --git a/win/makefile.vc b/win/makefile.vc
index 8557923..584a11b 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -43,22 +43,27 @@ the build instructions.
#
# 3) Targets are:
# release -- Builds the core, the shell. (default)
-# core -- Only builds the core.
+# dlls -- Just builds the windows extensions.
+# shell -- Just builds the shell and the core.
+# core -- Only builds the core [tkXX.(dll|lib)].
# all -- Builds everything.
# test -- Builds and runs the test suite.
# tktest -- Just builds the binaries for the test suite.
# install -- Installs the built binaries and libraries to $(INSTALLDIR)
# as the root of the install tree.
# cwish -- Builds a console version of wish.
-# clean -- Removes the contents of $(TMP_DIR)
-# hose -- Removes the contents of $(TMP_DIR) and $(OUT_DIR)
+# tidy/clean/hose -- varying levels of cleaning.
# genstubs -- Rebuilds the Stubs table and support files (dev only).
# depend -- Generates an accurate set of source dependancies for this
# makefile. Helpful to avoid problems when the sources are
# refreshed and you rebuild, but can "overbuild" when common
# headers like tkInt.h just get small changes.
-# winhelp -- builds the windows .hlp file for Tcl from the troff man
-# files.
+# htmlhelp -- Builds a Windows .chm help file for Tcl and Tk from the
+# troff manual pages found in $(ROOT)\doc. You need to
+# have installed the HTML Help Compiler package from Microsoft
+# to produce the .chm file.
+# winhelp -- Builds the windows .hlp file for Tcl from the troff man
+# files found in $(ROOT)\doc.
#
# 4) Macros usable on the commandline:
# TCLDIR=<path>
@@ -78,19 +83,18 @@ the build instructions.
#
# loimpact = Adds a flag for how NT treats the heap to keep memory
# in use, low. This is said to impact alloc performance.
-# msvcrt = Affects the static option only to switch it from
+# msvcrt = Affects the static option only to switch it from
# using libcmt(d) as the C runtime [by default] to
# msvcrt(d). This is useful for static embedding
# support.
-# nothreads = Turns off full multithreading support.
+# nothreads= Turns off full multithreading support.
# noxp = If you do not have the uxtheme.h header then you
# cannot include support for XP themeing.
# square = Include the demo square widget.
-# static = Builds a static library of the core instead of a
+# static = Builds a static library of the core instead of a
# dll. The shell will be static (and large), as well.
-# staticpkg = Affects the static option only to switch
-# wishXX.exe to have the dde and reg extension linked
-# inside it.
+# staticpkg= Affects the static option only to switch wishXX.exe
+# to have the dde and reg extension linked inside it.
# pdbs = Build detached symbols for release builds.
# profile = Adds profiling hooks. Map file is assumed.
# thrdalloc = Use the thread allocator (shared global free pool)
@@ -102,29 +106,30 @@ the build instructions.
# enabled runtime (msvcrt.dll not msvcrtd.dll
# or libcmt.lib not libcmtd.lib).
#
-# STATS=memdbg,compdbg,none
+# STATS=compdbg,memdbg,none
# Sets optional memory and bytecode compiler debugging code added
# to the core. The default is for none. Any combination of the
# above may be used (comma separated). 'none' will over-ride
# everything to nothing.
#
-# memdbg = Enables the debugging memory allocator.
# compdbg = Enables byte compilation logging.
+# memdbg = Enables the debugging memory allocator.
#
-# CHECKS=nodep,fullwarn,64bit,none
+# CHECKS=64bit,fullwarn,nodep,none
# Sets special macros for checking compatability.
#
-# nodep = Turns off compatability macros to ensure Tk isn't
-# being built with deprecated functions.
+# 64bit = Enable 64bit portability warnings (if available)
# fullwarn = Builds with full compiler and link warnings enabled.
# Very verbose.
-# 64bit = Enable 64bit portability warnings (if available)
+# nodep = Turns off compatability macros to ensure the core
+# isn't being built with deprecated functions.
#
# MACHINE=(ALPHA|AMD64|IA64|IX86)
# Set the machine type used for the compiler, linker, and
# resource compiler. This hook is needed to tell the tools
# when alternate platforms are requested. IX86 is the default
-# when not specified.
+# when not specified. If the CPU environment variable has been
+# set (ie: recent Platform SDK) then MACHINE is set from CPU.
#
# TMP_DIR=<path>
# OUT_DIR=<path>
@@ -177,7 +182,7 @@ Please `cd` to its location first.
!error $(MSG)
!endif
-PROJECT = tk
+PROJECT = tk
!include "rules.vc"
!if $(TCLINSTALL)
@@ -237,7 +242,6 @@ WISHOBJS = \
!if $(TCL_USE_STATIC_PACKAGES)
$(TCLDDELIB) \
$(TCLREGLIB) \
- $(TCLSTUBLIB) \
!endif
$(TMP_DIR)\wish.res
@@ -361,7 +365,7 @@ TKOBJS = \
$(TMP_DIR)\tkVisual.obj \
$(TMP_DIR)\tkStubInit.obj \
$(TMP_DIR)\tkWindow.obj \
- $(TTK_OBJS) \
+ $(TTK_OBJS) \
!if !$(STATIC_BUILD)
$(TMP_DIR)\tk.res
!endif
@@ -402,7 +406,8 @@ TTK_OBJS = \
$(TMP_DIR)\ttkStubInit.obj
TKSTUBOBJS = \
- $(TMP_DIR)\tkStubLib.obj $(TMP_DIR)\ttkStubLib.obj
+ $(TMP_DIR)\tkStubLib.obj \
+ $(TMP_DIR)\ttkStubLib.obj
WINDIR = $(ROOT)\win
@@ -442,7 +447,7 @@ cdebug = $(OPTIMIZATIONS)
cdebug =
!endif
!if $(SYMBOLS)
-cdebug = $(cdebug) -Zi
+cdebug = $(cdebug) -Zi
!endif
!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
@@ -470,15 +475,10 @@ crt = -MT
!endif
BASE_CFLAGS = $(cdebug) $(cflags) $(crt) $(TK_INCLUDES)
-TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
+TK_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES) -DUSE_TCL_STUBS
CON_CFLAGS = $(cdebug) $(cflags) $(crt) -DCONSOLE
WISH_CFLAGS = $(BASE_CFLAGS) $(TK_DEFINES)
-### Stubs files should not be compiled with -GL
-STUB_CFLAGS = $(cflags) $(cdebug:-GL=) $(TK_DEFINES)
-
-!if !$(STATIC_BUILD)
-TK_CFLAGS = $(TK_CFLAGS) -DUSE_TCL_STUBS
-!endif
+STUB_CFLAGS = $(cflags) $(cdebug) $(TK_DEFINES)
#---------------------------------------------------------------------
# Link flags
@@ -516,10 +516,7 @@ dlllflags = $(lflags) -dll
conlflags = $(lflags) -subsystem:console
guilflags = $(lflags) -subsystem:windows
-tcllibs = $(TCLIMPLIB)
-!if !$(STATIC_BUILD)
-tcllibs = $(TCLSTUBLIB) $(tcllibs)
-!endif
+tcllibs = $(TCLSTUBLIB) $(TCLIMPLIB)
baselibs = netapi32.lib kernel32.lib user32.lib advapi32.lib ws2_32.lib
# Avoid 'unresolved external symbol __security_cookie' errors.
@@ -537,7 +534,7 @@ guilibs = $(baselibs) gdi32.lib
#---------------------------------------------------------------------
!if "$(TESTPAT)" != ""
-TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
+TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
!endif
@@ -564,11 +561,7 @@ test-classic: setup $(TKTEST) $(TKLIB) $(CAT32)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
-!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
- $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
-!else
- $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
-!endif
+ $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) | $(CAT32)
test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@@ -579,11 +572,7 @@ test-ttk: setup $(TKTEST) $(TKLIB) $(CAT32)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
-!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
- $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
-!else
- $(DEBUGGER) $(TKTEST) "$(ROOT)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
-!endif
+ $(DEBUGGER) $(TKTEST) "$(ROOT:\=/)/tests/ttk/all.tcl" $(TESTFLAGS) | $(CAT32)
runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@@ -605,7 +594,7 @@ rundemo: setup $(TKTEST) $(TKLIB) $(CAT32)
!else
@set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
!endif
- $(TKTEST) $(ROOT)\library\demos\widget
+ $(TKTEST) $(ROOT:\=/)\library\demos\widget
shell: setup $(WISH)
@set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
@@ -620,6 +609,17 @@ shell: setup $(WISH)
console show
<<
+dbgshell: setup $(WISH)
+ @set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
+ @set TK_LIBRARY=$(TK_LIBRARY:\=/)
+ @set TCLLIBPATH=
+!if $(TCLINSTALL)
+ @set PATH=$(_TCLDIR)\bin;$(PATH)
+!else
+ @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
+!endif
+ windbg $(WISH)
+
setup:
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
@@ -682,9 +682,49 @@ genstubs:
#---------------------------------------------------------------------
-# Regenerate the windows help files.
+# Build the Windows HTML help file.
#---------------------------------------------------------------------
+# NOTE: you can define HHC on the command-line to override this
+!ifndef HHC
+HHC=""%ProgramFiles%\HTML Help Workshop\hhc.exe""
+!endif
+HTMLDIR=$(ROOT)\html
+HTMLBASE=TclTk$(VERSION)
+HHPFILE=$(HTMLDIR)\$(HTMLBASE).hhp
+CHMFILE=$(HTMLDIR)\$(HTMLBASE).chm
+
+htmlhelp: chmsetup $(CHMFILE)
+
+$(CHMFILE): $(DOCDIR)\*
+ @$(TCLSH) $(TOOLSDIR)\tcltk-man2html.tcl
+ @echo Compiling HTML help project
+ @$(HHC) <<$(HHPFILE) >NUL
+[OPTIONS]
+Compatibility=1.1 or later
+Compiled file=$(HTMLBASE).chm
+Display compile progress=no
+Error log file=$(HTMLBASE).log
+Language=0x409 English (United States)
+Title=Tcl/Tk $(DOT_VERSION) Help
+[FILES]
+contents.htm
+docs.css
+Keywords
+TclCmd
+TclLib
+TkCmd
+TkLib
+UserCmd
+<<
+
+chmsetup:
+ @if not exist $(HTMLDIR)\nul mkdir $(HTMLDIR)
+
+#-------------------------------------------------------------------------
+# Build the old-style Windows .hlp file
+#-------------------------------------------------------------------------
+
HLPBASE = $(PROJECT)$(TK_VERSION)
HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp
HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt
@@ -811,11 +851,15 @@ $(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in
@nmakehlp -s << $** >$@
@MACHINE@ $(MACHINE:IX86=X86)
-@TK_WIN_VERSION@ $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION).0.0
+@TK_WIN_VERSION@ $(TK_DOTVERSION).0.0
<<
#---------------------------------------------------------------------
-# Generate the makefile depedancies.
+# Generate the source dependencies. Having dependency rules will
+# improve incremental build accuracy without having to resort to a
+# full rebuild just because some non-global header file like
+# tclCompile.h was changed. These rules aren't needed when building
+# from scratch.
#---------------------------------------------------------------------
depend:
@@ -823,7 +867,7 @@ depend:
@echo Build tclsh first!
!else
set TCL_LIBRARY=$(TCL_LIBRARY)
- $(TCLSH) $(TCLTOOLSDIR)\mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
+ $(TCLSH) $(TCLTOOLSDIR:\=/)/mkdepend.tcl -vc32 -out:"$(OUT_DIR)\depend.mk" \
-passthru:"-DBUILD_tk $(TK_INCLUDES)" $(GENERICDIR),$$(GENERICDIR) \
$(WINDIR),$$(WINDIR) $(TTKDIR),$$(TTKDIR) $(XLIBDIR),$$(XLIBDIR) \
$(BITMAPDIR),$$(BITMAPDIR) @<<
@@ -831,7 +875,6 @@ $(TKOBJS)
<<
!endif
-
#---------------------------------------------------------------------
# Dependency rules
#---------------------------------------------------------------------
@@ -909,8 +952,13 @@ install-binaries:
!if !$(STATIC_BUILD)
@echo creating package index
@type << > $(OUT_DIR)\pkgIndex.tcl
-if {[package vcompare [package provide Tcl] $(TCL_PATCH_LEVEL)] != 0} { return }
-package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
+if {[catch {package present Tcl $(TCL_PATCH_LEVEL)}]} { return }
+if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)]
+ || ([info exists ::argv] && ("-display" in $$::argv)))} {
+ package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk]
+} else {
+ package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
+}
<<
@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\"
!endif
@@ -972,6 +1020,8 @@ clean:
@echo Cleaning $(WINDIR)\versions.vc ...
@if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc
+realclean: hose
+
hose:
@echo Hosing $(OUT_DIR)\* ...
@if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
diff --git a/win/nmakehlp.c b/win/nmakehlp.c
index 2868857..d0edcf0 100644
--- a/win/nmakehlp.c
+++ b/win/nmakehlp.c
@@ -47,7 +47,7 @@ static int CheckForLinkerFeature(const char *option);
static int IsIn(const char *string, const char *substring);
static int SubstituteFile(const char *substs, const char *filename);
static int QualifyPath(const char *path);
-static const char *GetVersionFromFile(const char *filename, const char *match);
+static const char *GetVersionFromFile(const char *filename, const char *match, int numdots);
static DWORD WINAPI ReadFromPipe(LPVOID args);
/* globals */
@@ -153,7 +153,7 @@ main(
&dwWritten, NULL);
return 0;
}
- printf("%s\n", GetVersionFromFile(argv[2], argv[3]));
+ printf("%s\n", GetVersionFromFile(argv[2], argv[3], *(argv[1]+2) - '0'));
return 0;
case 'Q':
if (argc != 3) {
@@ -479,7 +479,8 @@ IsIn(
static const char *
GetVersionFromFile(
const char *filename,
- const char *match)
+ const char *match,
+ int numdots)
{
size_t cbBuffer = 100;
static char szBuffer[100];
@@ -509,7 +510,8 @@ GetVersionFromFile(
*/
q = p;
- while (*q && (isalnum(*q) || *q == '.')) {
+ while (*q && (strchr("0123456789.ab", *q)) && ((!strchr(".ab", *q)
+ && (!strchr("ab", q[-1])) || --numdots))) {
++q;
}
diff --git a/win/rules.vc b/win/rules.vc
index f09e2ea..adc3165 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -218,7 +218,7 @@ DEBUG = 0
SYMBOLS = 0
PROFILE = 0
PGO = 0
-MSVCRT = 0
+MSVCRT = 1
LOIMPACT = 0
TCL_USE_STATIC_PACKAGES = 0
USE_THREAD_ALLOC = 1
@@ -234,9 +234,13 @@ STATIC_BUILD = 0
!message *** Doing msvcrt
MSVCRT = 1
!else
+!if !$(STATIC_BUILD)
+MSVCRT = 1
+!else
MSVCRT = 0
!endif
-!if [nmakehlp -f $(OPTS) "staticpkg"]
+!endif
+!if [nmakehlp -f $(OPTS) "staticpkg"] && $(STATIC_BUILD)
!message *** Doing staticpkg
TCL_USE_STATIC_PACKAGES = 1
!else
@@ -245,6 +249,7 @@ TCL_USE_STATIC_PACKAGES = 0
!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
@@ -298,15 +303,6 @@ UNCHECKED = 0
!endif
!endif
-
-!if !$(STATIC_BUILD)
-# Make sure we don't build overly fat DLLs.
-MSVCRT = 1
-# We shouldn't statically put the extensions inside the shell when dynamic.
-TCL_USE_STATIC_PACKAGES = 0
-!endif
-
-
#----------------------------------------------------------
# Figure-out how to name our intermediate and output directories.
# We wouldn't want different builds to use the same .obj files
@@ -348,10 +344,8 @@ TMP_DIRFULL = .\$(BUILDDIRTOP)\$(PROJECT)_ThreadedDynamicStaticX
TMP_DIRFULL = $(TMP_DIRFULL:Static=)
SUFX = $(SUFX:s=)
EXT = dll
-!if $(MSVCRT)
TMP_DIRFULL = $(TMP_DIRFULL:X=)
SUFX = $(SUFX:x=)
-!endif
!else
TMP_DIRFULL = $(TMP_DIRFULL:Dynamic=)
EXT = lib
@@ -583,19 +577,16 @@ Failed to find tcl.h. The TCLDIR macro does not appear correct.
TCL_VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
-!if $(TCL_VERSION) < 81
-TCL_DOES_STUBS = 0
-!else
-TCL_DOES_STUBS = 1
-!endif
-
!if $(TCLINSTALL)
TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX).exe"
-!if !exist($(TCLSH)) && $(TCL_THREADS)
-TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)t$(SUFX).exe"
+!if !exist($(TCLSH))
+TCLSH = "$(_TCLDIR)\bin\tclsh$(TCL_VERSION)$(SUFX:x=).exe"
!endif
TCLSTUBLIB = "$(_TCLDIR)\lib\tclstub$(TCL_VERSION).lib"
TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX).lib"
+!if !exist($(TCLIMPLIB))
+TCLIMPLIB = "$(_TCLDIR)\lib\tcl$(TCL_VERSION)$(SUFX:x=).lib"
+!endif
TCL_LIBRARY = $(_TCLDIR)\lib
TCLREGLIB = "$(_TCLDIR)\lib\tclreg13$(SUFX:t=).lib"
TCLDDELIB = "$(_TCLDIR)\lib\tcldde14$(SUFX:t=).lib"
@@ -604,11 +595,14 @@ TCLTOOLSDIR = \must\have\tcl\sources\to\build\this\target
TCL_INCLUDES = -I"$(_TCLDIR)\include"
!else
TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX).exe"
-!if !exist($(TCLSH)) && $(TCL_THREADS)
-TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)t$(SUFX).exe"
+!if !exist($(TCLSH))
+TCLSH = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclsh$(TCL_VERSION)$(SUFX:x=).exe"
!endif
TCLSTUBLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclstub$(TCL_VERSION).lib"
TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX).lib"
+!if !exist($(TCLIMPLIB))
+TCLIMPLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcl$(TCL_VERSION)$(SUFX:x=).lib"
+!endif
TCL_LIBRARY = $(_TCLDIR)\library
TCLREGLIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tclreg13$(SUFX:t=).lib"
TCLDDELIB = "$(_TCLDIR)\win\$(BUILDDIRTOP)\tcldde14$(SUFX:t=).lib"
@@ -681,13 +675,25 @@ TK_VERSION = $(TK_MAJOR_VERSION)$(TK_MINOR_VERSION)
!if "$(PROJECT)" != "tk"
!if $(TKINSTALL)
WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX).exe"
+!if !exist($(WISH))
+WISH = "$(_TKDIR)\bin\wish$(TK_VERSION)$(SUFX:x=).exe"
+!endif
TKSTUBLIB = "$(_TKDIR)\lib\tkstub$(TK_VERSION).lib"
TKIMPLIB = "$(_TKDIR)\lib\tk$(TK_VERSION)$(SUFX).lib"
+!if !exist($(TKIMPLIB))
+TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib"
+!endif
TK_INCLUDES = -I"$(_TKDIR)\include"
!else
WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX).exe"
+!if !exist($(WISH))
+WISH = "$(_TKDIR)\win\$(BUILDDIRTOP)\wish$(TCL_VERSION)$(SUFX:x=).exe"
+!endif
TKSTUBLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tkstub$(TCL_VERSION).lib"
TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX).lib"
+!if !exist($(TKIMPLIB))
+TKIMPLIB = "$(_TKDIR)\win\$(BUILDDIRTOP)\tk$(TCL_VERSION)$(SUFX:x=).lib"
+!endif
TK_INCLUDES = -I"$(_TKDIR)\generic" -I"$(_TKDIR)\win" -I"$(_TKDIR)\xlib"
!endif
!endif