diff options
author | hypnotoad <yoda@etoyoc.com> | 2014-09-04 01:22:20 (GMT) |
---|---|---|
committer | hypnotoad <yoda@etoyoc.com> | 2014-09-04 01:22:20 (GMT) |
commit | 851d7fa7a725585b5edd0beb1c14b01d8649cb6d (patch) | |
tree | 21d339ea33412e67e02b047bdf902e79c0b51d06 | |
parent | e7f5216f0494afb3e7951d3ac5dd9d167ef201fe (diff) | |
download | tcl-851d7fa7a725585b5edd0beb1c14b01d8649cb6d.zip tcl-851d7fa7a725585b5edd0beb1c14b01d8649cb6d.tar.gz tcl-851d7fa7a725585b5edd0beb1c14b01d8649cb6d.tar.bz2 |
Adapted the Unix startup process to ifdef out the KIT specific behaviors.
tclkit is now build as a standalone exectuble.
-rw-r--r-- | unix/Makefile.in | 18 | ||||
-rw-r--r-- | unix/tclAppInit.c | 11 |
2 files changed, 22 insertions, 7 deletions
diff --git a/unix/Makefile.in b/unix/Makefile.in index f9d713d..8f77687 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -285,6 +285,9 @@ ${AC_FLAGS} ${PROTO_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ TCLSH_OBJS = tclAppInit.o +TCLKIT_OBJS = tclKitInit.o + + TCLTEST_OBJS = tclTestInit.o tclTest.o tclTestObj.o tclTestProcBodyObj.o \ tclThreadTest.o tclUnixTest.o @@ -648,19 +651,24 @@ ${TCL_EXE}: ${TCLSH_OBJS} ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} ${CC} ${CFLAGS} ${LDFLAGS} ${TCLSH_OBJS} \ @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \ ${CC_SEARCH_FLAGS} -o ${TCL_EXE} + +# Must be empty so it doesn't conflict with rule for ${TCL_EXE} above +${NATIVE_TCLSH}: null.zip: touch .empty zip null.zip .empty -${TCLKIT_EXE}: ${TCL_EXE} null.zip +${TCLKIT_EXE}: ${TCL_LIB_FILE} ${TCL_STUB_LIB_FILE} null.zip + $(CC) -c $(APP_CC_SWITCHES) \ + -DTCL_KIT $(UNIX_DIR)/tclAppInit.c -o tclKitInit.o + ${CC} ${CFLAGS} ${LDFLAGS} tclKitInit.o \ + @TCL_BUILD_LIB_SPEC@ ${TCL_STUB_LIB_FILE} ${LIBS} @EXTRA_TCLSH_LIBS@ \ + ${CC_SEARCH_FLAGS} -o ${TCLKIT_EXE} PWD=`pwd` cp -f ${TCL_EXE} ${TCLKIT_EXE} cat null.zip >> ${TCLKIT_EXE} cd ${prefix}/lib ; zip -rAq ${PWD}/${TCLKIT_EXE} tcl8 tcl8.6 - -# Must be empty so it doesn't conflict with rule for ${TCL_EXE} above -${NATIVE_TCLSH}: Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in $(SHELL) config.status @@ -1035,7 +1043,7 @@ xtTestInit.o: $(UNIX_DIR)/tclAppInit.c ${TCL_EXE} @if test -f tclAppInit.sav ; then \ mv tclAppInit.sav tclAppInit.o; \ fi; - + # Object files used on all Unix systems: REGHDRS=$(GENERIC_DIR)/regex.h $(GENERIC_DIR)/regguts.h \ diff --git a/unix/tclAppInit.c b/unix/tclAppInit.c index 95dc38e..acd6aa1 100644 --- a/unix/tclAppInit.c +++ b/unix/tclAppInit.c @@ -80,7 +80,12 @@ main( #ifdef TCL_LOCAL_MAIN_HOOK TCL_LOCAL_MAIN_HOOK(&argc, &argv); #endif - +#ifdef TCL_KIT + printf("Running Kit Mode\n"); + /* 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. */ } @@ -108,8 +113,10 @@ int Tcl_AppInit( Tcl_Interp *interp) /* Interpreter for application. */ { +#ifdef TCL_KIT Tcl_Zvfs_Boot(interp); - +#endif + if ((Tcl_Init)(interp) == TCL_ERROR) { return TCL_ERROR; } |