Index: kitdll/build.sh ================================================================== --- kitdll/build.sh +++ kitdll/build.sh @@ -71,10 +71,32 @@ ## Rename the "vfs" package directory to what "boot.tcl" expects mv 'starpack.vfs/lib'/vfs* 'starpack.vfs/lib/vfs' ## Install "boot.tcl" cp 'boot.tcl' 'starpack.vfs/' + + # Include extra objects as required + ## Initialize list of extra objects + EXTRA_OBJS="" + + ## Figure out if zlib compiled (if not, the system zlib will be used and we + ## will need to have that present) + ZLIBDIR="$(cd "${OTHERPKGSDIR}/zlib/inst" 2>/dev/null && pwd)" + export ZLIBDIR + if [ -n "${ZLIBDIR}" -a -f "${ZLIBDIR}/lib/libz.a" ]; then + EXTRA_OBJS="${EXTRA_OBJS} ${ZLIBDIR}/lib/libz.a" + fi + + ## Tk Resources (needed for Win32 support) + TKDIR="$(cd "${OTHERPKGSDIR}/tk/inst" && pwd)" + TKRSRC="${TKDIR}/lib/tkbase.res.o" + if [ -n "${TKDIR}" -a -f "${TKRSRC}" ]; then + EXTRA_OBJS="${EXTRA_OBJS} ${TKRSRC}" + fi + + ## Export to the environment, to be picked up by the "configure" script + export EXTRA_OBJS # Build KitDLL echo "Running: ./configure --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}" ./configure --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} Index: kitdll/buildsrc/kitdll-0.0/Makefile.in ================================================================== --- kitdll/buildsrc/kitdll-0.0/Makefile.in +++ kitdll/buildsrc/kitdll-0.0/Makefile.in @@ -5,10 +5,11 @@ LDFLAGS = @LDFLAGS@ SHOBJLDFLAGS = @SHOBJLDFLAGS@ LIBS = @LIBS@ STATICLIBS = @ARCHS@ OBJS = vfs_kitdll_data_tcl.o kitInit.o rechan.o pwb.o +EXTRA_OBJS = @EXTRA_OBJS@ TCLSH_NATIVE = tclsh # Default target all: libtclkit.@SHOBJEXT@ @@ -26,21 +27,21 @@ ## Extensions rechan.o: rechan.c pwb.o: pwb.c ## DLL Build -libtclkit.@SHOBJEXT@: $(OBJS) - $(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit.@SHOBJEXT@ $(OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) -Wl,--whole-archive $(STATICLIBS) -Wl,--no-whole-archive $(LIBS) +libtclkit.@SHOBJEXT@: $(OBJS) $(EXTRA_OBJS) + $(CC) $(CPPFLAGS) $(CFLAGS) -o libtclkit.@SHOBJEXT@ $(OBJS) $(EXTRA_OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) -Wl,--whole-archive $(STATICLIBS) -Wl,--no-whole-archive $(LIBS) # Test driver tclsh.o: tclsh.c -tclsh: tclsh.o libtclkit.@SHOBJEXT@ - $(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o -L. -ltclkit -Wl,-R,`pwd` +tclsh: tclsh.o $(EXTRA_OBJS) libtclkit.@SHOBJEXT@ + $(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o $(EXTRA_OBJS) -L. -ltclkit -Wl,-R,`pwd` wish.o: wish.c -wish: wish.o libtclkit.@SHOBJEXT@ - $(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o -L. -ltclkit -Wl,-R,`pwd` +wish: wish.o $(EXTRA_OBJS) libtclkit.@SHOBJEXT@ + $(CC) $(CPPFLAGS) $(CFLAGS) $(WISH_CFLAGS) -o wish wish.o $(EXTRA_OBJS) -L. -ltclkit -Wl,-R,`pwd` # Cleanup routeines clean: rm -f libtclkit.@SHOBJEXT@ rm -f $(OBJS) Index: kitdll/buildsrc/kitdll-0.0/configure.ac ================================================================== --- kitdll/buildsrc/kitdll-0.0/configure.ac +++ kitdll/buildsrc/kitdll-0.0/configure.ac @@ -28,10 +28,13 @@ AC_CHECK_FUNCS(Tcl_GetEncodingNameFromEnvironment Tcl_SetSystemEncoding) LIBS="${SAVE_LIBS}" dnl Find required libs DC_FIND_TCLKIT_LIBS + +dnl Find extra objects we need to link as a part of "libtclkit" +AC_SUBST(EXTRA_OBJS) dnl Check for optional headers AC_HEADER_STDC AC_CHECK_HEADERS(unistd.h string.h strings.h)