Index: kitdll/build.sh ================================================================== --- kitdll/build.sh +++ kitdll/build.sh @@ -22,10 +22,33 @@ mkdir 'out' 'inst' || exit 1 ( cp -r 'buildsrc' 'build' cd "${BUILDDIR}" || exit 1 + + # Fix up archives that Tcl gets wrong + for archive in ../../../tcl/inst/lib/dde*/tcldde*.a ../../../tcl/inst/lib/reg*/tclreg*.a; do + if [ ! -f "${archive}" ]; then + continue + fi + + rm -rf __TEMP__ + ( + mkdir __TEMP__ || exit 1 + cd __TEMP__ + + ## Patch archive name + archive="../${archive}" + + "${AR:-ar}" x "${archive}" || exit 1 + + rm -f "${archive}" + + "${AR:-ar}" cr "${archive}" *.o || exit 1 + "${RANLIB:-ranlib}" "${archive}" || true + ) + done # Determine how we invoke a Tcl interpreter for testsh in "${TCLSH_NATIVE:-false}" "${TCLKIT:-tclkit}"; do if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then TCLSH_NATIVE="${testsh}" Index: kitdll/buildsrc/kitdll-0.0/Makefile.in ================================================================== --- kitdll/buildsrc/kitdll-0.0/Makefile.in +++ kitdll/buildsrc/kitdll-0.0/Makefile.in @@ -2,11 +2,11 @@ CFLAGS = @CFLAGS@ @SHOBJFLAGS@ -Wall CPPFLAGS = @CPPFLAGS@ @DEFS@ -DKITDLL_MAKE_LOADABLE=1 LDFLAGS = @LDFLAGS@ SHOBJLDFLAGS = @SHOBJLDFLAGS@ LIBS = @LIBS@ -STATICLIBS = @TCL_LIB_SPEC@ @ARCHS@ +STATICLIBS = @ARCHS@ OBJS = vfs_kitdll_data_tcl.o kitInit.o rechan.o pwb.o TCLSH_NATIVE = tclsh # Default target all: libtcl.@SHOBJEXT@ @@ -26,20 +26,20 @@ rechan.o: rechan.c pwb.o: pwb.c ## DLL Build libtcl.@SHOBJEXT@: $(OBJS) - $(CC) $(CPPFLAGS) $(CFLAGS) -o libtcl.so $(OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) -Wl,--whole-archive $(STATICLIBS) -Wl,--no-whole-archive $(LIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) -o libtcl.@SHOBJEXT@ $(OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) -Wl,--whole-archive $(STATICLIBS) -Wl,--no-whole-archive $(LIBS) # Test driver tclsh.o: tclsh.c tclsh: tclsh.o libtcl.@SHOBJEXT@ $(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o -L. -ltcl -Wl,-R,`pwd` # Cleanup routeines clean: - rm -f libtcl.so + rm -f libtcl.@SHOBJEXT@ rm -f $(OBJS) rm -f vfs_kitdll_data_tcl.c rm -f vfs_kitdll.tcl.h rm -f tclsh.o tclsh Index: kitdll/buildsrc/kitdll-0.0/aclocal.m4 ================================================================== --- kitdll/buildsrc/kitdll-0.0/aclocal.m4 +++ kitdll/buildsrc/kitdll-0.0/aclocal.m4 @@ -76,11 +76,11 @@ SHOBJEXT="sl" ;; mingw*) SHOBJEXT="dll" SHOBJFLAGS="-mno-cygwin -mms-bitfields -DPIC" - SHOBJLDFLAGS='-shared -Wl,--dll -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a' + SHOBJLDFLAGS='-shared -Wl,--dll -Wl,--enable-auto-image-base -Wl,--output-def,$[@].def,--out-implib,$[@].a -Wl,--export-all-symbols -Wl,--add-stdcall-alias' ;; esac ]) AC_DEFUN(DC_DO_TCL, [ @@ -217,19 +217,23 @@ ]) AC_DEFUN(DC_FIND_TCLKIT_LIBS, [ DC_SETUP_TCL_PLAT_DEFS - for proj in tclvfs; do + for proj in tcl tclvfs; do AC_MSG_CHECKING([for libraries required for ${proj}]) libdir="../../../${proj}/inst" libfiles="`find "${libdir}" -name '*.a' 2>/dev/null | tr "\n" ' '`" libfilesnostub="`find "${libdir}" -name '*.a' 2>/dev/null | grep -v 'stub' | tr "\n" ' '`" + + if test "$proj" = "tcl"; then + libfiles="${libfilesnostub}" + fi ARCHS="${ARCHS} ${libfiles}" AC_MSG_RESULT([${libfiles}]) done AC_SUBST(ARCHS) ]) Index: kitdll/buildsrc/kitdll-0.0/kitInit.c ================================================================== --- kitdll/buildsrc/kitdll-0.0/kitInit.c +++ kitdll/buildsrc/kitdll-0.0/kitInit.c @@ -11,10 +11,16 @@ Tcl_AppInitProc Vfs_Init, Rechan_Init; Tcl_AppInitProc Vfs_kitdll_data_tcl_Init; #ifdef KIT_INCLUDES_PWB Tcl_AppInitProc Pwb_Init; #endif +#ifdef TCL_THREADS +Tcl_AppInitProc Thread_Init; +#endif +#ifdef _WIN32 +Tcl_AppInitProc Dde_Init, Registry_Init; +#endif static char *preInitCmd = "proc tclKitInit {} {\n" "rename tclKitInit {}\n" "load {} tclkit::init\n" @@ -27,10 +33,14 @@ "set s [read $f]\n" "close $f\n" "::tclkit::init::initInterp\n" "rename ::tclkit::init::initInterp {}\n" "uplevel #0 $s\n" +#ifdef _WIN32 + "catch {load {} dde}\n" + "catch {load {} registry}\n" +#endif /* _WIN32 */ "}\n" "tclKitInit"; static int tclkit_init_initinterp(ClientData cd, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { #ifdef _WIN32 @@ -68,12 +78,19 @@ Tcl_StaticPackage(0, "tclkit::init", Tclkit_init_Init, NULL); Tcl_StaticPackage(0, "rechan", Rechan_Init, NULL); Tcl_StaticPackage(0, "vfs", Vfs_Init, NULL); Tcl_StaticPackage(0, "vfs_kitdll_data_tcl", Vfs_kitdll_data_tcl_Init, NULL); #ifdef KIT_INCLUDES_PWB - Tcl_StaticPackage(0, "pwb", Pwb_Init, NULL); -#endif + Tcl_StaticPackage(0, "pwb", Pwb_Init, NULL); +#endif +#ifdef TCL_THREADS + Tcl_StaticPackage(0, "Thread", Thread_Init, NULL); +#endif +#ifdef _WIN32 + Tcl_StaticPackage(0, "dde", Dde_Init, NULL); + Tcl_StaticPackage(0, "registry", Registry_Init, NULL); +#endif TclSetPreInitScript(preInitCmd); return; }