summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhypnotoad <yoda@etoyoc.com>2014-09-04 00:30:04 (GMT)
committerhypnotoad <yoda@etoyoc.com>2014-09-04 00:30:04 (GMT)
commite7f5216f0494afb3e7951d3ac5dd9d167ef201fe (patch)
tree6df8a69e026fe9d8665fcfbea754a73fa08815fc
parent28bbbd2dacf43166d1b580dedad78768155daac6 (diff)
downloadtcl-e7f5216f0494afb3e7951d3ac5dd9d167ef201fe.zip
tcl-e7f5216f0494afb3e7951d3ac5dd9d167ef201fe.tar.gz
tcl-e7f5216f0494afb3e7951d3ac5dd9d167ef201fe.tar.bz2
Re-engineered the windows kitbuilding process to produce a standalone
executable (in a similar process as tcltest is made). The kit specific functions of tclAppInit have been wrapped around define macros, and are only active if TCL_KIT is defined. (Which is only done when building the tclkit executable)
-rwxr-xr-xgeneric/tclZipVfs.c3
-rw-r--r--win/Makefile.in14
-rw-r--r--win/tclAppInit.c10
3 files changed, 21 insertions, 6 deletions
diff --git a/generic/tclZipVfs.c b/generic/tclZipVfs.c
index 7baf469..ed2ddcc 100755
--- a/generic/tclZipVfs.c
+++ b/generic/tclZipVfs.c
@@ -1785,7 +1785,10 @@ int Tcl_Zvfs_Boot(Tcl_Interp *interp) {
Tcl_IncrRefCount(vfstklib);
if(Tcl_FSAccess(vfsinitscript,F_OK)==0) {
+ /* Startup script should be set before calling Tcl_AppInit */
Tcl_SetStartupScript(vfsinitscript,NULL);
+ } else {
+ Tcl_SetStartupScript(NULL,NULL);
}
if(Tcl_FSAccess(vfstcllib,F_OK)==0) {
Tcl_SetVar2(interp, "env", "TCL_LIBRARY", Tcl_GetString(vfstcllib), TCL_GLOBAL_ONLY);
diff --git a/win/Makefile.in b/win/Makefile.in
index 0874147..3e44cff 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -392,6 +392,9 @@ STUB_OBJS = \
TCLSH_OBJS = tclAppInit.$(OBJEXT)
+TCLKIT_OBJS = tclKitInit.$(OBJEXT)
+
+
ZLIB_OBJS = \
adler32.$(OBJEXT) \
compress.$(OBJEXT) \
@@ -428,11 +431,13 @@ tclkit: $(TCLKIT)
null.zip:
touch .empty
- zip null.zip .empty
+ zip -q null.zip .empty
-$(TCLKIT): $(TCLSH) null.zip
+$(TCLKIT): $(TCLKIT_OBJS) @LIBRARIES@ $(TCL_STUB_LIB_FILE) tclsh.$(RES) null.zip
+ $(CC) $(CFLAGS) $(TCLKIT_OBJS) $(TCL_LIB_FILE) $(TCL_STUB_LIB_FILE) $(LIBS) \
+ tclsh.$(RES) $(CC_EXENAME) $(LDFLAGS_CONSOLE)
+ @VC_MANIFEST_EMBED_EXE@
PWD=`pwd`
- cp -f $(TCLSH) $(TCLKIT)
cat null.zip >> $(TCLKIT)
cd ${prefix}/lib ; zip -rAq ${PWD}/$(TCLKIT) tcl8 tcl8.6
@@ -499,6 +504,9 @@ testMain.${OBJEXT}: tclAppInit.c
tclMain2.${OBJEXT}: tclMain.c
$(CC) -c $(CC_SWITCHES) -DBUILD_tcl -DTCL_ASCII_MAIN @DEPARG@ $(CC_OBJNAME)
+tclKitInit.$(OBJEXT): tclAppInit.c
+ $(CC) -c $(CC_SWITCHES) -DTCL_KIT @DEPARG@ $(CC_OBJNAME)
+
# TIP #59, embedding of configuration information into the binary library.
#
# Part of Tcl's configuration information are the paths where it was installed
diff --git a/win/tclAppInit.c b/win/tclAppInit.c
index a8eac66..c6b3b44 100644
--- a/win/tclAppInit.c
+++ b/win/tclAppInit.c
@@ -15,7 +15,6 @@
*/
#include "tcl.h"
-#include "tclInt.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
@@ -124,7 +123,11 @@ _tmain(
#ifdef TCL_LOCAL_MAIN_HOOK
TCL_LOCAL_MAIN_HOOK(&argc, &argv);
#endif
-
+#if defined TCL_KIT
+ /* This voodoo ensures that Tcl_Main does not eat the first argument */
+ Tcl_FindExecutable(argv[0]);
+ Tcl_SetStartupScript(Tcl_NewStringObj("/zvfs/main.tcl",-1),NULL);
+#endif
Tcl_Main(argc, argv, TCL_LOCAL_APPINIT);
return 0; /* Needed only to prevent compiler warning. */
}
@@ -152,8 +155,9 @@ int
Tcl_AppInit(
Tcl_Interp *interp) /* Interpreter for application. */
{
+#if defined TCL_KIT
Tcl_Zvfs_Boot(interp);
-
+#endif
if ((Tcl_Init)(interp) == TCL_ERROR) {
return TCL_ERROR;
}