BUILD = $(MAKEDIR)\build
!if $V == 84
-PARTS = vqtcl zlib vfs
+PARTS = vqtcl vfs
OPTS = static,msvcrt
X = sx
!ifndef KITOPTS
LIBS = user32.lib gdi32.lib comdlg32.lib comctl32.lib \
shell32.lib imm32.lib advapi32.lib
!else
-PARTS = vqtcl zlib vfs threaddyn
+PARTS = vqtcl vfs threaddyn
OPTS = static,msvcrt,threads
X = tsx
!ifndef KITOPTS
LIBS = user32.lib gdi32.lib ws2_32.lib
!endif
+!if $V < 86
+PARTS = $(PARTS) zlib
+LIBS = $(BUILD)\lib\zlib.lib $(LIBS)
+!endif
+
!if $(SYMBOLS)
X = $(X:x=gx)
OPTS = $(OPTS),symbols
#-------------------------------------------------------------------------
CLIOBJS = $(BUILD)\pwb.obj $(BUILD)\rechan.obj \
- $(BUILD)\zlib.obj $(BUILD)\tclAppInit.obj $(BUILD)\tclkitsh.res
+ $(BUILD)\tclAppInit.obj $(BUILD)\tclkitsh.res
GUIOBJS = $(BUILD)\pwb.obj $(BUILD)\rechan.obj \
- $(BUILD)\zlib.obj $(BUILD)\winMain.obj $(BUILD)\tclkit.res
+ $(BUILD)\winMain.obj $(BUILD)\tclkit.res
+
+!if $V < 86
+CLIOBJS = $(CLIOBJS) $(BUILD)\zlib.obj
+GUIOBJS = $(GUIOBJS) $(BUILD)\zlib.obj
+!endif
+
+#-------------------------------------------------------------------------
#all: lite heavy
lite: tclkit-cli tclkit-gui
@$(COPY) kit-cli.exe $@
-@$(UPXCOMP)
kit-cli.exe -init- ../../setupvfs.tcl $(KITOPTS) $@ cli
+ $@ <<
+puts "version : Tcl [info patchlevel] $$tcl_platform(osVersion) $$tcl_platform(machine)"
+foreach pkg {starkit rechan registry dde} {package require $$pkg}
+interp create slave
+slave eval {
+ foreach pkg {starkit rechan registry dde} {package require $$pkg}
+}
+<<
+
tclkit-gui.exe: kit-gui.exe tidy
@$(COPY) kit-gui.exe $@
@$(CC) $(CFLAGS) -I$(BUILD)/include -DKIT_LITE -DSTATIC_BUILD \
-c ../../kitInit.c -Fo$(BUILD)/kitInit.obj
@$(LINK) $(LDFLAGS) -subsystem:console -out:$@ $(CLIOBJS) \
- $(BUILD)\kitInit.obj $(BUILD)\vfs.obj \
+ $(BUILD)\kitInit.obj \
+ $(BUILD)\lib\vfs1.4\vfs1*.lib \
$(BUILD)\lib\vqtcl4.1\vqtcl4*.lib \
- $(BUILD)\lib\zlib.lib \
$(BUILD)\lib\tcl$V*.lib \
$(BUILD)\lib\tcldde1*.lib \
$(BUILD)\lib\tclreg1*.lib $(LIBS)
@$(CC) $(CFLAGS) -I$(BUILD)/include -DKIT_LITE -DKIT_INCLUDES_TK \
-c ../../kitInit.c -Fo$(BUILD)/kitInit.obj
@$(LINK) $(LDFLAGS) -subsystem:windows -out:$@ $(GUIOBJS) \
- $(BUILD)\kitInit.obj $(BUILD)\vfs.obj \
+ $(BUILD)\kitInit.obj \
+ $(BUILD)\lib\vfs1.4\vfs1*.lib \
$(BUILD)\lib\vqtcl4.1\vqtcl4*.lib \
- $(BUILD)\lib\zlib.lib \
$(BUILD)\lib\tcl$V*.lib \
$(BUILD)\lib\tk$V*.lib \
$(BUILD)\lib\tcldde1*.lib \
@$(COPY) kitsh.exe $@
-@$(UPXCOMP)
kitsh.exe -init- ../../setupvfs.tcl $(KITOPTS) $@ cli
+ $@ <<
+puts "version : Tcl [info patchlevel] $$tcl_platform(osVersion) $$tcl_platform(machine)"
+foreach pkg {starkit rechan registry dde} {package require $$pkg}
+interp create slave
+slave eval {
+ foreach pkg {starkit rechan registry dde} {package require $$pkg}
+}
+<<
tclkit.exe: kitsh.exe kit.exe tidy
@$(COPY) kit.exe $@
kitsh.exe -init- ../../setupvfs.tcl $(KITOPTS) $@ gui
kitsh.exe: setup tcl mk itcl $(PARTS:vqtcl=) files $(CLIOBJS)
- $(CC) $(CFLAGS) -I$(BUILD)/include -DSTATIC_BUILD \
+ @$(CC) $(CFLAGS) -I$(BUILD)/include -DSTATIC_BUILD \
-DKIT_INCLUDES_ITCL -c ../../kitInit.c -Fo$(BUILD)/kitInit.obj
$(LINK) $(LDFLAGS) -subsystem:console -out:$@ $(CLIOBJS) \
- $(BUILD)\kitInit.obj $(BUILD)\vfs.obj \
+ $(BUILD)\kitInit.obj \
$(BUILD)\mk4tcl.obj $(BUILD)\mk4too.obj \
+ $(BUILD)\lib\vfs1.4\vfs1*.lib \
$(BUILD)\lib\mk4vc*.lib \
$(BUILD)\lib\itcl3.4\itcl3*.lib \
- $(BUILD)\lib\zlib.lib \
$(BUILD)\lib\tcl$V*.lib \
$(BUILD)\lib\tcldde1*.lib \
$(BUILD)\lib\tclreg1*.lib $(LIBS)
$(_VC_MANIFEST_EMBED_EXE)
kit.exe: setup tcl tk mk itcl $(PARTS:vqtcl=) files $(GUIOBJS)
- $(CC) $(CFLAGS) -I$(BUILD)/include -DSTATIC_BUILD \
+ @$(CC) $(CFLAGS) -I$(BUILD)/include -DSTATIC_BUILD \
-DKIT_INCLUDES_ITCL -DKIT_INCLUDES_TK \
-c ../../kitInit.c -Fo$(BUILD)/kitInit.obj
- $(LINK) $(LDFLAGS) -subsystem:windows -out:$@ $(GUIOBJS) \
- $(BUILD)\kitInit.obj $(BUILD)\vfs.obj \
+ @$(LINK) $(LDFLAGS) -subsystem:windows -out:$@ $(GUIOBJS) \
+ $(BUILD)\kitInit.obj \
$(BUILD)\mk4tcl.obj $(BUILD)\mk4too.obj \
+ $(BUILD)\lib\vfs1.4\vfs1*.lib \
$(BUILD)\lib\mk4vc*.lib \
$(BUILD)\lib\itcl3.4\itcl3*.lib \
- $(BUILD)\lib\zlib.lib \
$(BUILD)\lib\tcl$V*.lib \
$(BUILD)\lib\tk$V*.lib \
$(BUILD)\lib\tcldde1*.lib \
INSTALLDIR=$(BUILD) OPTS=$(OPTS) TMP_DIR=$(BUILD)\thread \
OUT_DIR=$(BUILD)\thread all install
-vfs: $(BUILD)\vfs.obj
+vfs: $(BUILD)\lib\vfs1.4\vfs14$(X:t=).lib
$(BUILD)\vfs.obj:
$(CC) $(CFLAGS) -DSTATIC_BUILD -I..\tcl\generic -I..\tcl\win \
-I..\..\8.x\tclvfs\generic -c ..\..\8.x\tclvfs\generic\vfs.c \
-Fo$(BUILD)\vfs.obj
- $(CPY) ..\..\8.x\tclvfs\library $(BUILD)\lib\vfs1.3^\
+ $(CPY) ..\..\8.x\tclvfs\library $(BUILD)\lib\vfs1.4^\
+
+$(BUILD)\lib\vfs1.4\vfs14$(X:t=).lib:
+ pushd ..\..\8.x\tclvfs\win & $(MAKE) -f Makefile.vc \
+ INSTALLDIR=$(BUILD) TCLDIR=$(BUILD)\..\..\tcl \
+ OPTS=$(OPTS) TMP_DIR=$(BUILD)\vfs \
+ OUT_DIR=$(BUILD)\vfs all install-binaries install-libraries
zlib: $(BUILD)\lib\zlib.lib
$(BUILD)\lib\zlib.lib:
#include <tcl.h>
#endif
+/* define this to use the zlib package */
+#ifndef KIT_INCLUDES_ZLIB
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
+#define KIT_INCLUDES_ZLIB 1
+#else
+#define KIT_INCLUDES_ZLIB 0
+#endif
+#endif
+
#include <string.h>
#ifdef _WIN32
#endif
/* defined in tclInt.h */
+#if 10 * TCL_MAJOR_VERSION + TCL_MINOR_VERSION < 86
extern Tcl_Obj* TclGetStartupScriptPath();
extern void TclSetStartupScriptPath(Tcl_Obj*);
+#define Tcl_GetStartupScript(encPtr) TclGetStartupScriptPath()
+#define Tcl_SetStartupScript(path,enc) TclSetStartupScriptPath(path)
+#endif
extern char* TclSetPreInitScript (char*);
-Tcl_AppInitProc Pwb_Init, Rechan_Init, Vfs_Init, Zlib_Init;
+Tcl_AppInitProc Pwb_Init, Rechan_Init, Vfs_Init;
#ifdef KIT_LITE
Tcl_AppInitProc Vlerq_Init, Vlerq_SafeInit;
#else
#ifdef TCL_THREADS
Tcl_AppInitProc Thread_Init;
#endif
+#if KIT_INCLUDES_ZLIB
+Tcl_AppInitProc Zlib_Init;
+#endif
#ifdef KIT_INCLUDES_ITCL
Tcl_AppInitProc Itcl_Init;
#endif
"rename tclKitInit {}\n"
"load {} tclkitpath\n"
/*"puts \"appInit: [encoding system] $::tcl::kitpath\"\n"*/
+#if KIT_INCLUDES_ZLIB
"catch {load {} zlib}\n"
+#endif
#ifdef KIT_LITE
"load {} vlerq\n"
"namespace eval ::vlerq {}\n"
Tcl_StaticPackage(0, "tclkitpath", TclKitPath_Init, NULL);
Tcl_StaticPackage(0, "rechan", Rechan_Init, NULL);
Tcl_StaticPackage(0, "vfs", Vfs_Init, NULL);
+#if KIT_INCLUDES_ZLIB
Tcl_StaticPackage(0, "zlib", Zlib_Init, NULL);
+#endif
#ifdef TCL_THREADS
Tcl_StaticPackage(0, "Thread", Thread_Init, Thread_SafeInit);
#endif
/* messy because TclSetStartupScriptPath is called slightly too late */
if (Tcl_EvalEx(interp, initScript, -1, TCL_EVAL_GLOBAL) == TCL_OK) {
- Tcl_Obj* path = TclGetStartupScriptPath();
- TclSetStartupScriptPath(Tcl_GetObjResult(interp));
+ const char *encoding = NULL;
+ Tcl_Obj* path = Tcl_GetStartupScript(&encoding);
+ Tcl_SetStartupScript(Tcl_GetObjResult(interp), encoding);
if (path == NULL) {
Tcl_Eval(interp, "incr argc -1; set argv [lrange $argv 1 end]");
}