From f67b351466fbc8af63d45a45e05338d6e0b94858 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Wed, 9 Dec 2020 09:17:19 +0000 Subject: nmake: OPTS=msvcrt is now the default, even for static builds. Use OPTS=nomsvcrt if you don't want that. Add more comments in win/*.vc files, describing what's going on.^C --- .github/workflows/win-build.yml | 4 ++-- .travis.yml | 16 ++++++++-------- win/buildall.vc.bat | 4 ++-- win/makefile.vc | 23 ++++++++++------------- win/rules.vc | 7 ++++--- win/tcl.dsp | 8 ++++---- 6 files changed, 30 insertions(+), 32 deletions(-) diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 36cdf69..c5b2147 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -12,8 +12,8 @@ jobs: cfgopt: - "" - "OPTS=utfmax" - - "OPTS=nodep" - - "OPTS=static,staticpkg,msvcrt" + - "CHECKS=nodep" + - "OPTS=static" - "OPTS=symbols" - "OPTS=memdbg" # Using powershell means we need to explicitly stop on failure diff --git a/.travis.yml b/.travis.yml index f166e82..c06b489 100644 --- a/.travis.yml +++ b/.travis.yml @@ -248,8 +248,8 @@ jobs: before_install: *vcpreinst install: [] script: - - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest - - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test + - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc all tcltest + - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc test - name: "Windows/MSVC/Static" os: windows compiler: cl @@ -257,8 +257,8 @@ jobs: before_install: *vcpreinst install: [] script: - - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest - - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test + - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static' '-f' makefile.vc all tcltest + - cmd.exe //C vcvarsall.bat x64 '&&' nmake 'OPTS=static' '-f' makefile.vc test - name: "Windows/MSVC/Debug" os: windows compiler: cl @@ -303,8 +303,8 @@ jobs: before_install: *vcpreinst install: [] script: - - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc all tcltest - - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=nodep' '-f' makefile.vc test + - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc all tcltest + - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'CHECKS=nodep' '-f' makefile.vc test - name: "Windows/MSVC-x86/Static" os: windows compiler: cl @@ -312,8 +312,8 @@ jobs: before_install: *vcpreinst install: [] script: - - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc all tcltest - - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static,staticpkg,msvcrt' '-f' makefile.vc test + - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static' '-f' makefile.vc all tcltest + - cmd.exe //C vcvarsall.bat x86 '&&' nmake 'OPTS=static' '-f' makefile.vc test - name: "Windows/MSVC-x86/Debug" os: windows compiler: cl diff --git a/win/buildall.vc.bat b/win/buildall.vc.bat index 3dc14c1..941f27e 100755 --- a/win/buildall.vc.bat +++ b/win/buildall.vc.bat @@ -68,8 +68,8 @@ if errorlevel 1 goto error :: Build the static core and shell. :: -set OPTS=static,staticpkg,msvcrt -if not %SYMBOLS%.==. set OPTS=symbols,static,staticpkg,msvcrt +set OPTS=static +if not %SYMBOLS%.==. set OPTS=symbols,static nmake -nologo -f makefile.vc shell OPTS=%OPTS% %1 if errorlevel 1 goto error diff --git a/win/makefile.vc b/win/makefile.vc index a813f38..f693bf3 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -52,7 +52,7 @@ # turn on the 64-bit compiler, if your SDK has it. # # Basic macros and options usable on the commandline (see rules.vc for more info): -# OPTS=msvcrt,noembed,nothreads,pdbs,profile,static,staticpkg,symbols,thrdalloc,time64bit,unchecked,utfmax,none +# OPTS=msvcrt,noembed,nothreads,pdbs,profile,static,symbols,thrdalloc,time64bit,unchecked,utfmax,none # Sets special options for the core. The default is for none. # Any combination of the above may be used (comma separated). # 'none' will over-ride everything to nothing. @@ -62,28 +62,25 @@ # specified in OPTS, or into the DLL otherwise. If # "noembed" is specified, the scripts are not embedded # but copied to the installation target (as in 8.6). -# 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 +# nomsvcrt = Affects the static option only to switch it from +# using msvcrt(d) as the C runtime [by default] to +# libcmt(d). This is useful for static embedding # support. # none = Overrides all other options to nothing. # nothreads = Turns off full multithreading support (default on). -# pdbs = Produce separate debug symbol files. -# profile = Adds profiling hooks. Map file is assumed. +# pdbs = Produce separate debug symbol files. +# profile = Adds profiling hooks. Map file is assumed. # 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 -# tclshXX.exe to have the dde and registry extension linked -# inside it. -# symbols = Adds symbols for step debugging. +# dll. The shell will be static (and large), and +# have the dde and registry extensions linked inside. +# symbols = Adds symbols for step debugging. # thrdalloc = Use the thread allocator (shared global free pool). # time64bit = Forces a build using 64-bit time_t for 32-bit build # (CRT library should support this). # unchecked = Allows a symbols build to not use the debug # enabled runtime (msvcrt.dll not msvcrtd.dll # or libcmt.lib not libcmtd.lib). -# utfmax = Forces a build allowing 4-byte UTF-8 sequences -# internally. +# utfmax = Forces a build using UTF-32 representation internally. # # STATS=compdbg,memdbg,none # Sets optional memory and bytecode compiler debugging code added diff --git a/win/rules.vc b/win/rules.vc index a0084a4..76d93cd 100644 --- a/win/rules.vc +++ b/win/rules.vc @@ -667,9 +667,10 @@ LINKERFLAGS = $(LINKERFLAGS) -ltcg # MSVCRT - 1 -> link to dynamic C runtime even when building static Tcl build # 0 -> link to static C runtime for static Tcl build. # Does not impact shared Tcl builds (STATIC_BUILD == 0) +# Default: 1 for Tcl 8.7 and up, 0 otherwise. # TCL_USE_STATIC_PACKAGES - 1 -> statically link the registry and dde extensions -# in the Tcl shell. 0 -> keep them as shared libraries -# Does not impact shared Tcl builds. +# in the Tcl and Wish shell. 0 -> keep them as shared libraries. Does +# not impact shared Tcl builds. Implied by STATIC_BUILD since Tcl 8.7. # USE_THREAD_ALLOC - 1 -> Use a shared global free pool for allocation. # 0 -> Use the non-thread allocator. # UNCHECKED - 1 -> when doing a debug build with symbols, use the release @@ -724,7 +725,7 @@ MSVCRT = 0 !if [nmakehlp -f $(OPTS) "msvcrt"] !message *** Doing msvcrt !else -!if $(STATIC_BUILD) +!if "$(TCL_MAJOR_VERSION)" == "8" && "$(TCL_MINOR_VERSION)" < "7" && $(STATIC_BUILD) MSVCRT = 0 !endif !endif diff --git a/win/tcl.dsp b/win/tcl.dsp index dc23f86..750aac9 100644 --- a/win/tcl.dsp +++ b/win/tcl.dsp @@ -76,7 +76,7 @@ CFG=tcl - Win32 Debug Static # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug\tcl_Static" -# PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols,static,staticpkg,msvcrt MSVCDIR=IDE" +# PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols,static MSVCDIR=IDE" # PROP BASE Rebuild_Opt "-a" # PROP BASE Target_File "Debug\tclsh87sg.exe" # PROP BASE Bsc_Name "" @@ -85,7 +85,7 @@ CFG=tcl - Win32 Debug Static # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug\tcl_Static" -# PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols,static,staticpkg,msvcrt MSVCDIR=IDE" +# PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=symbols,static MSVCDIR=IDE" # PROP Rebuild_Opt "-a" # PROP Target_File "Debug\tclsh87sg.exe" # PROP Bsc_Name "" @@ -97,7 +97,7 @@ CFG=tcl - Win32 Debug Static # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release\tcl_Static" -# PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=static,staticpkg,msvcrt MSVCDIR=IDE" +# PROP BASE Cmd_Line "nmake -nologo -f makefile.vc OPTS=static MSVCDIR=IDE" # PROP BASE Rebuild_Opt "-a" # PROP BASE Target_File "Release\tclsh87s.exe" # PROP BASE Bsc_Name "" @@ -106,7 +106,7 @@ CFG=tcl - Win32 Debug Static # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release\tcl_Static" -# PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=static,staticpkg,msvcrt MSVCDIR=IDE" +# PROP Cmd_Line "nmake -nologo -f makefile.vc OPTS=static MSVCDIR=IDE" # PROP Rebuild_Opt "-a" # PROP Target_File "Release\tclsh87s.exe" # PROP Bsc_Name "" -- cgit v0.12