Index: doc/FindExec.3 ================================================================== --- doc/FindExec.3 +++ doc/FindExec.3 @@ -11,11 +11,11 @@ Tcl_FindExecutable, Tcl_GetNameOfExecutable \- identify or return the name of the binary file containing the application .SH SYNOPSIS .nf \fB#include \fR .sp -void +const char * \fBTcl_FindExecutable\fR(\fIargv0\fR) .sp const char * \fBTcl_GetNameOfExecutable\fR() .SH ARGUMENTS Index: doc/InitSubSyst.3 ================================================================== --- doc/InitSubSyst.3 +++ doc/InitSubSyst.3 @@ -11,11 +11,11 @@ Tcl_InitSubsystems \- initialize the Tcl library. .SH SYNOPSIS .nf \fB#include \fR .sp -void +const char * \fBTcl_InitSubsystems\fR(\fIvoid\fR) .SH DESCRIPTION .PP The \fBTcl_InitSubsystems\fR procedure initializes the Tcl library. This procedure is typically invoked as the very Index: doc/Panic.3 ================================================================== --- doc/Panic.3 +++ doc/Panic.3 @@ -13,11 +13,11 @@ \fB#include \fR .sp void \fBTcl_Panic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR) .sp -void +const char * \fBTcl_SetPanicProc\fR(\fIpanicProc\fR) .sp void \fBTcl_ConsolePanic\fR(\fIformat\fR, \fIarg\fR, \fIarg\fR, \fI...\fR) .sp Index: generic/tcl.decls ================================================================== --- generic/tcl.decls +++ generic/tcl.decls @@ -530,11 +530,11 @@ declare 143 { void Tcl_Finalize(void) } # Removed in 9.0 (stub entry only) #declare 144 { -# void Tcl_FindExecutable(const char *argv0) +# const char *Tcl_FindExecutable(const char *argv0) #} declare 145 { Tcl_HashEntry *Tcl_FirstHashEntry(Tcl_HashTable *tablePtr, Tcl_HashSearch *searchPtr) } @@ -2516,17 +2516,17 @@ export { void Tcl_StaticPackage(Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc) } export { - void Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc) + const char *Tcl_SetPanicProc(TCL_NORETURN1 Tcl_PanicProc *panicProc) } export { Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc) } export { - void Tcl_FindExecutable(const char *argv0) + const char *Tcl_FindExecutable(const char *argv0) } export { const char *Tcl_InitStubs(Tcl_Interp *interp, const char *version, int exact) } Index: generic/tcl.h ================================================================== --- generic/tcl.h +++ generic/tcl.h @@ -2141,10 +2141,11 @@ const char * Tcl_InitStubs(Tcl_Interp *interp, const char *version, int exact, int magic); const char * TclTomMathInitializeStubs(Tcl_Interp *interp, const char *version, int epoch, int revision); +const char * TclInitStubTable(const char *version); #if defined(_WIN32) TCL_NORETURN1 void Tcl_ConsolePanic(const char *format, ...); #else # define Tcl_ConsolePanic NULL #endif @@ -2177,29 +2178,59 @@ * Public functions that are not accessible via the stubs table. * Tcl_GetMemoryInfo is needed for AOLserver. [Bug 1868171] */ #define Tcl_Main(argc, argv, proc) Tcl_MainEx(argc, argv, proc, \ - ((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp)())) + ((Tcl_SetPanicProc(Tcl_ConsolePanic), Tcl_CreateInterp()))) EXTERN TCL_NORETURN void Tcl_MainEx(int argc, char **argv, Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); EXTERN const char * Tcl_PkgInitStubsCheck(Tcl_Interp *interp, const char *version, int exact); -EXTERN void Tcl_InitSubsystems(void); EXTERN void Tcl_GetMemoryInfo(Tcl_DString *dsPtr); -EXTERN void Tcl_FindExecutable(const char *argv0); -EXTERN void Tcl_SetPanicProc( +EXTERN const char * Tcl_FindExecutable(const char *argv0); +EXTERN const char * Tcl_InitSubsystems(void); +EXTERN const char * Tcl_SetPanicProc( TCL_NORETURN1 Tcl_PanicProc *panicProc); EXTERN void Tcl_StaticPackage(Tcl_Interp *interp, const char *pkgName, Tcl_PackageInitProc *initProc, Tcl_PackageInitProc *safeInitProc); EXTERN Tcl_ExitProc *Tcl_SetExitProc(TCL_NORETURN1 Tcl_ExitProc *proc); #ifdef _WIN32 -EXTERN int TclZipfs_AppHook(int *argc, wchar_t ***argv); +EXTERN const char *TclZipfs_AppHook(int *argc, wchar_t ***argv); #else -EXTERN int TclZipfs_AppHook(int *argc, char ***argv); +EXTERN const char *TclZipfs_AppHook(int *argc, char ***argv); +#endif +extern void TclStubMainEx(int index, int argc, const void *argv, + Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); +extern const char *TclStubStaticPackage(Tcl_Interp *interp, + const char *pkgName, + Tcl_PackageInitProc *initProc, + Tcl_PackageInitProc *safeInitProc); +extern const char *TclStubCall(int flags, void *arg1, void *arg2); +#if defined(_WIN32) && defined(UNICODE) +#ifndef USE_TCL_STUBS +# define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg))) +#endif +# define Tcl_MainEx Tcl_MainExW + EXTERN TCL_NORETURN void Tcl_MainExW(int argc, wchar_t **argv, + Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); +#endif +#ifdef USE_TCL_STUBS +#define Tcl_InitSubsystems() \ + TclInitStubTable(TclStubCall(0, NULL, NULL)) +#define Tcl_FindExecutable(argv0) \ + TclInitStubTable(TclStubCall(1, (void *)argv0, NULL)) +#define Tcl_SetPanicProc(panicProc) \ + TclInitStubTable(TclStubCall(2, (void *)panicProc, NULL)) +#define TclZipfs_AppHook(argcp, argvp) \ + TclInitStubTable(TclStubCall(3, (void *)argcp, (void *)argvp)) +#if !defined(_WIN32) || !defined(UNICODE) +#define Tcl_MainEx(argc, argv, appInitProc, interp) TclStubMainEx(0, argc, argv, appInitProc, interp) +#endif +#define Tcl_MainExW(argc, argv, appInitProc, interp) TclStubMainEx(1, argc, argv, appInitProc, interp) +#define Tcl_StaticPackage TclStubStaticPackage #endif /* *---------------------------------------------------------------------------- * Include the public function declarations that are accessible via the stubs Index: generic/tclDecls.h ================================================================== --- generic/tclDecls.h +++ generic/tclDecls.h @@ -3704,27 +3704,10 @@ #endif /* defined(USE_TCL_STUBS) */ /* !END!: Do not edit above this line. */ -#if defined(USE_TCL_STUBS) -# undef Tcl_CreateInterp -# undef Tcl_Init -# undef Tcl_ObjSetVar2 -# define Tcl_CreateInterp() (tclStubsPtr->tcl_CreateInterp()) -# define Tcl_Init(interp) (tclStubsPtr->tcl_Init(interp)) -# define Tcl_ObjSetVar2(interp, part1, part2, newValue, flags) \ - (tclStubsPtr->tcl_ObjSetVar2(interp, part1, part2, newValue, flags)) -#endif - -#if defined(_WIN32) && defined(UNICODE) -# define Tcl_FindExecutable(arg) ((Tcl_FindExecutable)((const char *)(arg))) -# define Tcl_MainEx Tcl_MainExW - EXTERN TCL_NORETURN void Tcl_MainExW(int argc, wchar_t **argv, - Tcl_AppInitProc *appInitProc, Tcl_Interp *interp); -#endif - #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLIMPORT #define Tcl_PkgPresent(interp, name, version, exact) \ Tcl_PkgPresentEx(interp, name, version, exact, NULL) Index: generic/tclEncoding.c ================================================================== --- generic/tclEncoding.c +++ generic/tclEncoding.c @@ -1395,18 +1395,19 @@ * returned later by [info nameofexecutable]. * *--------------------------------------------------------------------------- */ #undef Tcl_FindExecutable -void +const char * Tcl_FindExecutable( const char *argv0) /* The value of the application's argv[0] * (native). */ { - Tcl_InitSubsystems(); + const char *version = Tcl_InitSubsystems(); TclpSetInitialEncodings(); TclpFindExecutable(argv0); + return version; } /* *--------------------------------------------------------------------------- * Index: generic/tclEvent.c ================================================================== --- generic/tclEvent.c +++ generic/tclEvent.c @@ -1011,11 +1011,20 @@ * Varied, see the respective initialization routines. * *------------------------------------------------------------------------- */ -void +MODULE_SCOPE const TclStubs tclStubs; + +static const struct { + const TclStubs *stubs; + const char version[12]; +} stubInfo = { + &tclStubs, TCL_PATCH_LEVEL +}; + +const char * Tcl_InitSubsystems(void) { if (inExit != 0) { Tcl_Panic("Tcl_InitSubsystems called while exiting"); } @@ -1058,10 +1067,11 @@ subsystemsInitialized = 1; } TclpInitUnlock(); } TclInitNotifier(); + return stubInfo.version; } /* *---------------------------------------------------------------------- * Index: generic/tclPanic.c ================================================================== --- generic/tclPanic.c +++ generic/tclPanic.c @@ -39,16 +39,16 @@ * Sets the panicProc variable. * *---------------------------------------------------------------------- */ -void +const char * Tcl_SetPanicProc( TCL_NORETURN1 Tcl_PanicProc *proc) { panicProc = proc; - Tcl_InitSubsystems(); + return Tcl_InitSubsystems(); } /* *---------------------------------------------------------------------- * ADDED generic/tclStubCall.c Index: generic/tclStubCall.c ================================================================== --- /dev/null +++ generic/tclStubCall.c @@ -0,0 +1,85 @@ +/* + * tclStubCall.c -- + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ + +#include "tclInt.h" +#ifndef _WIN32 +# include +#else +# define dlopen(a,b) (void *)LoadLibraryW(JOIN(L,a)) +# define dlsym(a,b) (void *)GetProcAddress((HMODULE)(a),b) +# define dlerror() "" +#endif + +MODULE_SCOPE void *tclStubsHandle; + +/* + *---------------------------------------------------------------------- + * + * Tcl_InitSubsystems -- + * + * Load the Tcl core dynamically, version "9.0" (or higher, in future versions) + * + * Results: + * Outputs the value of the "version" argument. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + +static const char PROCNAME[][24] = { + "_Tcl_InitSubsystems", + "_Tcl_FindExecutable", + "_Tcl_SetPanicProc", + "_TclZipfs_AppHook" +}; + +MODULE_SCOPE const char * +TclStubCall(int index, void *arg1, void *arg2) +{ + static void *stubFn[] = {NULL,NULL,NULL,NULL}; + static const char *version = NULL; + + if (tclStubsHandle == (void *)-1) { + if (index == 2 && arg1 != NULL) { + ((Tcl_PanicProc *)arg1)("Cannot call %s from stubbed extension\n", PROCNAME[index] + 1); + } else { + fprintf(stderr, "Cannot call %s from stubbed extension\n", PROCNAME[index] + 1); + abort(); + } + } + if (!stubFn[index]) { + if (!tclStubsHandle) { + tclStubsHandle = dlopen(TCL_DLL_FILE, RTLD_NOW|RTLD_LOCAL); + if (!tclStubsHandle) { + if (index == 2 && arg1 != NULL) { + ((Tcl_PanicProc *)arg1)("Cannot find " TCL_DLL_FILE ": %s\n", dlerror()); + } else { + fprintf(stderr, "Cannot find " TCL_DLL_FILE ": %s\n", dlerror()); + abort(); + } + } + } + stubFn[index] = dlsym(tclStubsHandle, PROCNAME[index] + 1); + if (!stubFn[index]) { + stubFn[index] = dlsym(tclStubsHandle, PROCNAME[index]); + } + if (stubFn[index]) { + version = ((const char *(*)(void *,void *))stubFn[index])(arg1, arg2); + } + } + return version; +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ Index: generic/tclStubLib.c ================================================================== --- generic/tclStubLib.c +++ generic/tclStubLib.c @@ -15,15 +15,17 @@ MODULE_SCOPE const TclStubs *tclStubsPtr; MODULE_SCOPE const TclPlatStubs *tclPlatStubsPtr; MODULE_SCOPE const TclIntStubs *tclIntStubsPtr; MODULE_SCOPE const TclIntPlatStubs *tclIntPlatStubsPtr; +MODULE_SCOPE void *tclStubsHandle; const TclStubs *tclStubsPtr = NULL; const TclPlatStubs *tclPlatStubsPtr = NULL; const TclIntStubs *tclIntStubsPtr = NULL; const TclIntPlatStubs *tclIntPlatStubsPtr = NULL; +void *tclStubsHandle = NULL; /* * Use our own ISDIGIT to avoid linking to libc on windows */ @@ -102,10 +104,13 @@ } } if (((exact&0xFF00) < 0x900)) { /* We are running Tcl 8.x */ stubsPtr = (TclStubs *)pkgData; + } + if (tclStubsHandle == NULL) { + tclStubsHandle = (void *) -1; } tclStubsPtr = stubsPtr; if (stubsPtr->hooks) { tclPlatStubsPtr = stubsPtr->hooks->tclPlatStubs; ADDED generic/tclStubLibTbl.c Index: generic/tclStubLibTbl.c ================================================================== --- /dev/null +++ generic/tclStubLibTbl.c @@ -0,0 +1,68 @@ +/* + * tclStubLibTbl.c -- + * + * Stub object that will be statically linked into extensions that want + * to access Tcl. + * + * Copyright (c) 1998-1999 by Scriptics Corporation. + * Copyright (c) 1998 Paul Duffin. + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ + +#include "tclInt.h" + +MODULE_SCOPE void *tclStubsHandle; + +/* + *---------------------------------------------------------------------- + * + * TclInitStubTable -- + * + * Initialize the stub table, using the structure pointed at + * by the "version" argument. + * + * Results: + * Outputs the value of the "version" argument. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ +MODULE_SCOPE const char * +TclInitStubTable( + const char *version) /* points to the version field of a + structure variable. */ +{ + if (version) { + if (tclStubsHandle == NULL) { + /* This can only happen with -DBUILD_STATIC, so simulate + * that the loading of Tcl succeeded, although we didn't + * actually loaded it dynamically */ + tclStubsHandle = (void *)1; + } + tclStubsPtr = ((const TclStubs **) version)[-1]; + + if (tclStubsPtr->hooks) { + tclPlatStubsPtr = tclStubsPtr->hooks->tclPlatStubs; + tclIntStubsPtr = tclStubsPtr->hooks->tclIntStubs; + tclIntPlatStubsPtr = tclStubsPtr->hooks->tclIntPlatStubs; + } else { + tclPlatStubsPtr = NULL; + tclIntStubsPtr = NULL; + tclIntPlatStubsPtr = NULL; + } + } + + return version; +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ ADDED generic/tclStubMainEx.c Index: generic/tclStubMainEx.c ================================================================== --- /dev/null +++ generic/tclStubMainEx.c @@ -0,0 +1,73 @@ +/* + * tclStubMainEx.c -- + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ + +#include "tclInt.h" +#ifndef _WIN32 +# include +#else +# define dlopen(a,b) (void *)LoadLibraryW(JOIN(L,a)) +# define dlsym(a,b) (void *)GetProcAddress((HMODULE)(a),b) +# define dlerror() "" +#endif + +MODULE_SCOPE void *tclStubsHandle; + +/* + *---------------------------------------------------------------------- + * + * Tcl_InitSubsystems -- + * + * Load the Tcl core dynamically, version "9.0" (or higher, in future versions) + * + * Results: + * Outputs the value of the "version" argument. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + +static const char PROCNAME[][24] = { + "_Tcl_MainEx", + "_Tcl_MainExW" +}; + +MODULE_SCOPE void +TclStubMainEx(int index, int argc, const void *argv, + Tcl_AppInitProc *appInitProc, Tcl_Interp *interp) +{ + static void *stubFn[] = {NULL,NULL}; + + if (!stubFn[index]) { + if (tclStubsHandle == (void *)-1) { + fprintf(stderr, "Cannot call %s from stubbed extension\n", PROCNAME[index] + 1); + abort(); + } + if (!tclStubsHandle) { + tclStubsHandle = dlopen(TCL_DLL_FILE, RTLD_NOW|RTLD_LOCAL); + if (!tclStubsHandle) { + tclStubsPtr->tcl_Panic("Cannot find " TCL_DLL_FILE ": %s\n", dlerror()); + } + } + stubFn[index] = dlsym(tclStubsHandle, PROCNAME[index] + 1); + if (!stubFn[index]) { + stubFn[index] = dlsym(tclStubsHandle, PROCNAME[index]); + } + if (stubFn[index]) { + ((void(*)(int, const void *, Tcl_AppInitProc *, Tcl_Interp *))stubFn[index])(argc, argv, appInitProc, interp); + } + } +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ ADDED generic/tclStubStaticPackage.c Index: generic/tclStubStaticPackage.c ================================================================== --- /dev/null +++ generic/tclStubStaticPackage.c @@ -0,0 +1,74 @@ +/* + * tclStubStaticPackage.c -- + * + * See the file "license.terms" for information on usage and redistribution of + * this file, and for a DISCLAIMER OF ALL WARRANTIES. + */ + +#include "tclInt.h" +#ifndef _WIN32 +# include +#else +# define dlopen(a,b) (void *)LoadLibraryW(JOIN(L,a)) +# define dlsym(a,b) (void *)GetProcAddress((HMODULE)(a),b) +# define dlerror() "" +#endif + +MODULE_SCOPE void *tclStubsHandle; + +/* + *---------------------------------------------------------------------- + * + * Tcl_InitSubsystems -- + * + * Load the Tcl core dynamically, version "9.0" (or higher, in future versions) + * + * Results: + * Outputs the value of the "version" argument. + * + * Side effects: + * Sets the stub table pointers. + * + *---------------------------------------------------------------------- + */ + +static const char PROCNAME[] = "_Tcl_StaticPackage"; + +MODULE_SCOPE const char * +TclStubStaticPackage(Tcl_Interp *interp, + const char *pkgName, + Tcl_PackageInitProc *initProc, + Tcl_PackageInitProc *safeInitProc) +{ + static void *stubFn = NULL; + static const char *version = NULL; + + if (tclStubsHandle == (void *)-1) { + fprintf(stderr, "Cannot call %s from stubbed extension\n", PROCNAME + 1); + abort(); + } + if (!stubFn) { + if (!tclStubsHandle) { + tclStubsHandle = dlopen(TCL_DLL_FILE, RTLD_NOW|RTLD_LOCAL); + if (!tclStubsHandle) { + tclStubsPtr->tcl_Panic("Cannot find " TCL_DLL_FILE ": %s\n", dlerror()); + } + } + stubFn = dlsym(tclStubsHandle, PROCNAME + 1); + if (!stubFn) { + stubFn = dlsym(tclStubsHandle, PROCNAME); + } + if (stubFn) { + version = ((const char *(*)(Tcl_Interp *, const char *, Tcl_PackageInitProc *, Tcl_PackageInitProc *))stubFn)(interp, pkgName, initProc, safeInitProc); + } + } + return version; +} + +/* + * Local Variables: + * mode: c + * c-basic-offset: 4 + * fill-column: 78 + * End: + */ Index: generic/tclZipfs.c ================================================================== --- generic/tclZipfs.c +++ generic/tclZipfs.c @@ -4803,11 +4803,11 @@ * Performs the argument munging for the shell * *------------------------------------------------------------------------- */ -int +const char * TclZipfs_AppHook( #ifdef SUPPORT_BUILTIN_ZIP_INSTALL int *argcPtr, /* Pointer to argc */ #else TCL_UNUSED(int *), /*argcPtr*/ @@ -4817,15 +4817,16 @@ #else /* !_WIN32 */ char ***argvPtr) /* Pointer to argv */ #endif /* _WIN32 */ { char *archive; + const char *result; #ifdef _WIN32 - Tcl_FindExecutable(NULL); + result = Tcl_FindExecutable(NULL); #else - Tcl_FindExecutable((*argvPtr)[0]); + result = Tcl_FindExecutable((*argvPtr)[0]); #endif archive = (char *) Tcl_GetNameOfExecutable(); TclZipfs_Init(NULL); /* @@ -4859,11 +4860,11 @@ Tcl_IncrRefCount(vfsInitScript); found = Tcl_FSAccess(vfsInitScript, F_OK); Tcl_DecrRefCount(vfsInitScript); if (found == TCL_OK) { zipfs_literal_tcl_library = ZIPFS_APP_MOUNT "/tcl_library"; - return TCL_OK; + return result; } } #ifdef SUPPORT_BUILTIN_ZIP_INSTALL } else if (*argcPtr > 1) { /* @@ -4892,11 +4893,11 @@ ZIPFS_ZIP_MOUNT "/tcl_library/install.tcl"); Tcl_IncrRefCount(vfsInitScript); if (Tcl_FSAccess(vfsInitScript, F_OK) == 0) { Tcl_SetStartupScript(vfsInitScript, NULL); } - return TCL_OK; + return result; } else if (!TclZipfs_Mount(NULL, ZIPFS_APP_MOUNT, archive, NULL)) { int found; Tcl_Obj *vfsInitScript; TclNewLiteralStringObj(vfsInitScript, ZIPFS_APP_MOUNT "/main.tcl"); @@ -4916,19 +4917,19 @@ Tcl_IncrRefCount(vfsInitScript); found = Tcl_FSAccess(vfsInitScript, F_OK); Tcl_DecrRefCount(vfsInitScript); if (found == TCL_OK) { zipfs_literal_tcl_library = ZIPFS_APP_MOUNT "/tcl_library"; - return TCL_OK; + return result; } } #ifdef _WIN32 Tcl_DStringFree(&ds); #endif /* _WIN32 */ #endif /* SUPPORT_BUILTIN_ZIP_INSTALL */ } - return TCL_OK; + return result; } #ifndef HAVE_ZLIB /* Index: unix/Makefile.in ================================================================== --- unix/Makefile.in +++ unix/Makefile.in @@ -199,10 +199,11 @@ BUILD_DLTEST = @BUILD_DLTEST@ #BUILD_DLTEST = TCL_LIB_FILE = @TCL_LIB_FILE@ #TCL_LIB_FILE = libtcl.a +TCL_PREV_LIB_FILE = @TCL_PREV_LIB_FILE@ # Generic lib name used in rules that apply to tcl and tk LIB_FILE = ${TCL_LIB_FILE} TCL_LIB_FLAG = @TCL_LIB_FLAG@ @@ -344,10 +345,14 @@ bn_s_mp_toom_mul.o bn_s_mp_toom_sqr.o bn_mp_to_radix.o \ bn_mp_ubin_size.o bn_mp_xor.o bn_mp_zero.o bn_s_mp_add.o \ bn_s_mp_mul_digs.o bn_s_mp_sqr.o bn_s_mp_sub.o STUB_LIB_OBJS = tclStubLib.o \ + tclStubCall.o \ + tclStubStaticPackage.o \ + tclStubMainEx.o \ + tclStubLibTbl.o \ tclTomMathStubLib.o \ tclOOStubLib.o \ ${COMPAT_OBJS} UNIX_OBJS = tclUnixChan.o tclUnixEvent.o tclUnixFCmd.o \ @@ -486,10 +491,14 @@ $(GENERIC_DIR)/tclOOMethod.c \ $(GENERIC_DIR)/tclOOStubInit.c STUB_SRCS = \ $(GENERIC_DIR)/tclStubLib.c \ + $(GENERIC_DIR)/tclStubCall.c \ + $(GENERIC_DIR)/tclStubStaticPackage.c \ + $(GENERIC_DIR)/tclStubMainEx.c \ + $(GENERIC_DIR)/tclStubLibTbl.c \ $(GENERIC_DIR)/tclTomMathStubLib.c \ $(GENERIC_DIR)/tclOOStubLib.c TOMMATH_SRCS = \ $(TOMMATH_DIR)/bn_cutoffs.c \ @@ -1907,10 +1916,22 @@ #-------------------------------------------------------------------------- tclStubLib.o: $(GENERIC_DIR)/tclStubLib.c $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD $(GENERIC_DIR)/tclStubLib.c +tclStubCall.o: $(GENERIC_DIR)/tclStubCall.c + $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD -DTCL_DLL_FILE="\"$(TCL_LIB_FILE)\"" $(GENERIC_DIR)/tclStubCall.c + +tclStubStaticPackage.o: $(GENERIC_DIR)/tclStubStaticPackage.c + $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD -DTCL_DLL_FILE="\"$(TCL_LIB_FILE)\"" $(GENERIC_DIR)/tclStubStaticPackage.c + +tclStubMainEx.o: $(GENERIC_DIR)/tclStubMainEx.c + $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD -DTCL_DLL_FILE="\"$(TCL_LIB_FILE)\"" $(GENERIC_DIR)/tclStubMainEx.c + +tclStubLibTbl.o: $(GENERIC_DIR)/tclStubLibTbl.c + $(CC) -c $(STUB_CC_SWITCHES) -DSTATIC_BUILD $(GENERIC_DIR)/tclStubLibTbl.c + tclTomMathStubLib.o: $(GENERIC_DIR)/tclTomMathStubLib.c $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclTomMathStubLib.c tclOOStubLib.o: $(GENERIC_DIR)/tclOOStubLib.c $(CC) -c $(STUB_CC_SWITCHES) $(GENERIC_DIR)/tclOOStubLib.c Index: unix/configure ================================================================== --- unix/configure +++ unix/configure @@ -655,10 +655,11 @@ TCL_STUB_LIB_SPEC TCL_STUB_LIB_FLAG TCL_STUB_LIB_FILE TCL_LIB_SPEC TCL_LIB_FLAG +TCL_PREV_LIB_FILE TCL_LIB_FILE PKG_CFG_ARGS TCL_YEAR TCL_PATCH_LEVEL TCL_MINOR_VERSION @@ -10486,10 +10487,13 @@ TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}" TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" fi +VERSION='8.5' +eval "TCL_PREV_LIB_FILE=libtcl${TCL_SHARED_LIB_SUFFIX}" +eval "TCL_PREV_LIB_FILE=${TCL_PREV_LIB_FILE}" VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" VERSION=${TCL_VERSION} @@ -10540,10 +10544,11 @@ #------------------------------------------------------------------------ # tclConfig.sh refers to this by a different name #------------------------------------------------------------------------ TCL_SHARED_BUILD=${SHARED_BUILD} + Index: unix/configure.ac ================================================================== --- unix/configure.ac +++ unix/configure.ac @@ -937,10 +937,13 @@ TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi TCL_BUILD_LIB_SPEC="-L`pwd | sed -e 's/ /\\\\ /g'` ${TCL_LIB_FLAG}" TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" fi +VERSION='8.5' +eval "TCL_PREV_LIB_FILE=libtcl${TCL_SHARED_LIB_SUFFIX}" +eval "TCL_PREV_LIB_FILE=${TCL_PREV_LIB_FILE}" VERSION='${VERSION}' eval "CFG_TCL_SHARED_LIB_SUFFIX=${TCL_SHARED_LIB_SUFFIX}" eval "CFG_TCL_UNSHARED_LIB_SUFFIX=${TCL_UNSHARED_LIB_SUFFIX}" VERSION=${TCL_VERSION} @@ -1001,10 +1004,11 @@ AC_SUBST(TCL_YEAR) AC_SUBST(PKG_CFG_ARGS) AC_SUBST(TCL_ZIP_FILE) AC_SUBST(TCL_LIB_FILE) +AC_SUBST(TCL_PREV_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) Index: unix/tclAppInit.c ================================================================== --- unix/tclAppInit.c +++ unix/tclAppInit.c @@ -10,12 +10,10 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. */ -#undef BUILD_tcl -#undef STATIC_BUILD #include "tcl.h" #ifdef TCL_TEST extern Tcl_PackageInitProc Tcltest_Init; extern Tcl_PackageInitProc Tcltest_SafeInit; @@ -150,14 +148,14 @@ * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ #ifdef DJGPP - (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, Tcl_NewStringObj("~/tclsh.rc", -1), TCL_GLOBAL_ONLY); #else - (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, Tcl_NewStringObj("~/.tclshrc", -1), TCL_GLOBAL_ONLY); #endif return TCL_OK; } Index: win/Makefile.in ================================================================== --- win/Makefile.in +++ win/Makefile.in @@ -451,10 +451,14 @@ REG_OBJS = tclWinReg.$(OBJEXT) STUB_OBJS = \ tclStubLib.$(OBJEXT) \ + tclStubCall.$(OBJEXT) \ + tclStubStaticPackage.$(OBJEXT) \ + tclStubMainEx.$(OBJEXT) \ + tclStubLibTbl.$(OBJEXT) \ tclTomMathStubLib.$(OBJEXT) \ tclOOStubLib.$(OBJEXT) \ tclWinPanic.$(OBJEXT) TCLSH_OBJS = tclAppInit.$(OBJEXT) @@ -688,10 +692,22 @@ # as DLL objects but none of the symbols should be exported tclStubLib.${OBJEXT}: tclStubLib.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) +tclStubCall.${OBJEXT}: tclStubCall.c + $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD -DTCL_DLL_FILE="\"$(TCL_DLL_FILE)\"" @DEPARG@ $(CC_OBJNAME) + +tclStubStaticPackage.${OBJEXT}: tclStubStaticPackage.c + $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD -DTCL_DLL_FILE="\"$(TCL_DLL_FILE)\"" @DEPARG@ $(CC_OBJNAME) + +tclStubMainEx.${OBJEXT}: tclStubMainEx.c + $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD -DTCL_DLL_FILE="\"$(TCL_DLL_FILE)\"" @DEPARG@ $(CC_OBJNAME) + +tclStubLibTbl.${OBJEXT}: tclStubLibTbl.c + $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) + tclTomMathStubLib.${OBJEXT}: tclTomMathStubLib.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) tclOOStubLib.${OBJEXT}: tclOOStubLib.c $(CC) -c $(CC_SWITCHES) -DSTATIC_BUILD @DEPARG@ $(CC_OBJNAME) Index: win/makefile.vc ================================================================== --- win/makefile.vc +++ win/makefile.vc @@ -421,10 +421,14 @@ TCLOBJS = $(COREOBJS) $(ZLIBOBJS) $(TOMMATHOBJS) $(PLATFORMOBJS) TCLSTUBOBJS = \ $(TMP_DIR)\tclStubLib.obj \ + $(TMP_DIR)\tclStubCall.obj \ + $(TMP_DIR)\tclStubStaticPackage.obj \ + $(TMP_DIR)\tclStubMainEx.obj \ + $(TMP_DIR)\tclStubLibTbl.obj \ $(TMP_DIR)\tclTomMathStubLib.obj \ $(TMP_DIR)\tclOOStubLib.obj \ $(TMP_DIR)\tclWinPanic.obj ### The following paths CANNOT have spaces in them as they appear on @@ -790,23 +794,35 @@ -Fo$@ $? ### The following objects should be built using the stub interfaces $(TMP_DIR)\tclWinReg.obj: $(WIN_DIR)\tclWinReg.c - $(cc32) $(appcflags) /DUSE_TCL_STUBS -Fo$@ $? + $(cc32) $(appcflags_nostubs) /DUSE_TCL_STUBS=1 -Fo$@ $? $(TMP_DIR)\tclWinDde.obj: $(WIN_DIR)\tclWinDde.c - $(cc32) $(appcflags) /DUSE_TCL_STUBS -Fo$@ $? + $(cc32) $(appcflags_nostubs) /DUSE_TCL_STUBS=1 -Fo$@ $? ### The following objects are part of the stub library and should not ### be built as DLL objects. -Zl is used to avoid a dependency on any ### specific C run-time. $(TMP_DIR)\tclStubLib.obj: $(GENERICDIR)\tclStubLib.c $(cc32) $(stubscflags) -Fo$@ $? + +$(TMP_DIR)\tclStubCall.obj: $(GENERICDIR)\tclStubCall.c + $(cc32) $(stubscflags) -DTCL_DLL_FILE="\"tcl$(TCL_VERSION)$(SUFX:t=).dll\"" $(TCL_INCLUDES) -Fo$@ $? + +$(TMP_DIR)\tclStubStaticPackage.obj: $(GENERICDIR)\tclStubStaticPackage.c + $(cc32) $(stubscflags) -DTCL_DLL_FILE="\"tcl$(TCL_VERSION)$(SUFX:t=).dll\"" $(TCL_INCLUDES) -Fo$@ $? + +$(TMP_DIR)\tclStubMainEx.obj: $(GENERICDIR)\tclStubMainEx.c + $(cc32) $(stubscflags) -DTCL_DLL_FILE="\"tcl$(TCL_VERSION)$(SUFX:t=).dll\"" $(TCL_INCLUDES) -Fo$@ $? + +$(TMP_DIR)\tclStubLibTbl.obj: $(GENERICDIR)\tclStubLibTbl.c + $(cc32) $(stubscflags) $(TCL_INCLUDES) -Fo$@ $? $(TMP_DIR)\tclTomMathStubLib.obj: $(GENERICDIR)\tclTomMathStubLib.c $(cc32) $(stubscflags) -Fo$@ $? $(TMP_DIR)\tclOOStubLib.obj: $(GENERICDIR)\tclOOStubLib.c Index: win/rules.vc ================================================================== --- win/rules.vc +++ win/rules.vc @@ -1328,11 +1328,11 @@ !if $(USE_STUBS) # Note we do not define USE_TCL_STUBS even when building tk since some # test targets in tk do not use stubs !if !$(DOING_TCL) -USE_STUBS_DEFS = /DUSE_TCL_STUBS /DUSE_TCLOO_STUBS +USE_STUBS_DEFS = /DUSE_TCL_STUBS=1 /DUSE_TCLOO_STUBS=1 !if $(NEED_TK) USE_STUBS_DEFS = $(USE_STUBS_DEFS) /DUSE_TK_STUBS !endif !endif !endif # USE_STUBS Index: win/tcl.dsp ================================================================== --- win/tcl.dsp +++ win/tcl.dsp @@ -1285,10 +1285,26 @@ # Begin Source File SOURCE=..\generic\tclStubLib.c # End Source File # Begin Source File + +SOURCE=..\generic\tclStubFindExecutable.c +# End Source File +# Begin Source File + +SOURCE=..\generic\tclStubInitSubsystems.c +# End Source File +# Begin Source File + +SOURCE=..\generic\tclStubSetPanicProc.c +# End Source File +# Begin Source File + +SOURCE=..\generic\tclStubLibTbl.c +# End Source File +# Begin Source File SOURCE=..\generic\tclOOStubLib.c # End Source File # Begin Source File Index: win/tclAppInit.c ================================================================== --- win/tclAppInit.c +++ win/tclAppInit.c @@ -205,11 +205,11 @@ * run interactively. Typically the startup file is "~/.apprc" where "app" * is the name of the application. If this line is deleted then no * user-specific startup file will be run under any conditions. */ - (Tcl_ObjSetVar2)(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, + Tcl_ObjSetVar2(interp, Tcl_NewStringObj("tcl_rcFileName", -1), NULL, Tcl_NewStringObj("~/tclshrc.tcl", -1), TCL_GLOBAL_ONLY); return TCL_OK; } /*