summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-04 16:29:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-01-04 16:29:09 (GMT)
commit6b899da180db3e0433c34694a5a3ae8cb1e9a533 (patch)
tree6f4a8942c04524f9f18543f6259a2d4ac76d0d2a /win
parent5e0992037e4e7df10b147f202093e029c8414e75 (diff)
parenta1db76f0763b340c0338edbf4cf087c881bf8b8d (diff)
downloadtcl-6b899da180db3e0433c34694a5a3ae8cb1e9a533.zip
tcl-6b899da180db3e0433c34694a5a3ae8cb1e9a533.tar.gz
tcl-6b899da180db3e0433c34694a5a3ae8cb1e9a533.tar.bz2
Fix [https://core.tcl-lang.org/tk/info/1ca3c8d9da|1ca3c8d9da]: nmake build with OPTS=static
Diffstat (limited to 'win')
-rw-r--r--win/makefile.vc8
-rw-r--r--win/rules.vc2
-rw-r--r--win/tcltest.rc75
3 files changed, 82 insertions, 3 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 3883999..4d31e09 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -221,7 +221,7 @@ TCLREGLIB = $(OUT_DIR)\$(TCLREGLIBNAME)
TCLDDELIBNAME = $(PROJECT)9dde$(DDEVERSION)$(SUFX:t=).$(EXT)
TCLDDELIB = $(OUT_DIR)\$(TCLDDELIBNAME)
-TCLTEST = $(OUT_DIR)\$(PROJECT)test.exe
+TCLTEST = $(OUT_DIR)\$(PROJECT)test$(VERSION)$(SUFX:t=).exe
TCLTESTRAW = $(TCLTEST:.exe=-raw.exe)
TCLSHOBJS = \
@@ -238,7 +238,8 @@ TCLTESTOBJS = \
!if !$(STATIC_BUILD)
$(OUT_DIR)\tommath.lib \
!endif
- $(TMP_DIR)\testMain.obj
+ $(TMP_DIR)\testMain.obj \
+ $(TMP_DIR)\tcltest.res
COREOBJS = \
$(TMP_DIR)\regcomp.obj \
@@ -582,6 +583,7 @@ $(TCLSTUBLIB): $(TCLSTUBOBJS)
$(TCLSH): $(TCLSHOBJS) $(TCLSTUBLIB) $(TCLIMPLIB)
$(CONEXECMD) -stack:2300000 $**
+ copy $(TMP_DIR)\tclsh.exe.manifest $(TCLSH).manifest
$(_VC_MANIFEST_EMBED_EXE)
!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD)
$(COPY) $@ $(TCLSHRAW)
@@ -590,6 +592,7 @@ $(TCLSH): $(TCLSHOBJS) $(TCLSTUBLIB) $(TCLIMPLIB)
$(TCLTEST): $(TCLTESTOBJS) $(TCLSTUBLIB) $(TCLIMPLIB)
$(CONEXECMD) -stack:2300000 $**
+ copy $(TMP_DIR)\tclsh.exe.manifest $(TCLTEST).manifest
$(_VC_MANIFEST_EMBED_EXE)
!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD)
$(COPY) $@ $(TCLTESTRAW)
@@ -1018,6 +1021,7 @@ $<
$(TMP_DIR)\tclsh.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tclsh.rc
+$(TMP_DIR)\tcltest.res: $(TMP_DIR)\tclsh.exe.manifest $(WIN_DIR)\tcltest.rc
#---------------------------------------------------------------------
# Installation.
diff --git a/win/rules.vc b/win/rules.vc
index 4ee70ff..7880d2a 100644
--- a/win/rules.vc
+++ b/win/rules.vc
@@ -1624,7 +1624,7 @@ DLLCMD = $(link32) $(dlllflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs)
CONEXECMD = $(link32) $(conlflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs)
GUIEXECMD = $(link32) $(guilflags) -out:$@ $(baselibs) $(tcllibs) $(tklibs)
RESCMD = $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TMP_DIR)" \
- $(TCL_INCLUDES) \
+ $(TCL_INCLUDES) /DSTATIC_BUILD=$(STATIC_BUILD) \
/DDEBUG=$(DEBUG) -d UNCHECKED=$(UNCHECKED) \
/DCOMMAVERSION=$(RCCOMMAVERSION) \
/DDOTVERSION=\"$(DOTVERSION)\" \
diff --git a/win/tcltest.rc b/win/tcltest.rc
new file mode 100644
index 0000000..847a250
--- /dev/null
+++ b/win/tcltest.rc
@@ -0,0 +1,75 @@
+//
+// Version Resource Script
+//
+
+#include <winver.h>
+#include <tcl.h>
+
+//
+// build-up the name suffix that defines the type of build this is.
+//
+#if STATIC_BUILD
+#define SUFFIX_STATIC "s"
+#else
+#define SUFFIX_STATIC ""
+#endif
+
+#if DEBUG && !UNCHECKED
+#define SUFFIX_DEBUG "g"
+#else
+#define SUFFIX_DEBUG ""
+#endif
+
+#define SUFFIX SUFFIX_STATIC SUFFIX_DEBUG
+
+
+LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
+ PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
+ FILEFLAGSMASK 0x3fL
+#ifdef DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_APP
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "Tcltest Application\0"
+ VALUE "OriginalFilename", "tcltest" STRINGIFY(TCL_MAJOR_VERSION) STRINGIFY(TCL_MINOR_VERSION) SUFFIX ".exe\0"
+ VALUE "FileVersion", TCL_PATCH_LEVEL
+ VALUE "LegalCopyright", "Copyright \251 1987-2022 Regents of the University of California and other parties\0"
+ VALUE "ProductName", "Tcl " TCL_VERSION " for Windows\0"
+ VALUE "ProductVersion", TCL_PATCH_LEVEL
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+//
+// Icon
+//
+
+tclsh ICON DISCARDABLE "tclsh.ico"
+
+//
+// This is needed for Windows 8.1 onwards.
+//
+
+#ifndef RT_MANIFEST
+#define RT_MANIFEST 24
+#endif
+#ifndef CREATEPROCESS_MANIFEST_RESOURCE_ID
+#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
+#endif
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "tclsh.exe.manifest"