ADDED kitdll/build.sh Index: kitdll/build.sh ================================================================== --- /dev/null +++ kitdll/build.sh @@ -0,0 +1,67 @@ +#! /bin/bash + +if [ ! -f 'build.sh' ]; then + echo 'ERROR: This script must be run from the directory it is in' >&2 + + exit 1 +fi +if [ -z "${TCLVERS}" ]; then + echo 'ERROR: The TCLVERS environment variable is not set' >&2 + + exit 1 +fi + +KITDLLVERS="0.0" +BUILDDIR="$(pwd)/build/kitdll-${KITDLLVERS}" +OUTDIR="$(pwd)/out" +INSTDIR="$(pwd)/inst" +OTHERPKGSDIR="$(pwd)/../" +export KITDLLVERS BUILDDIR OUTDIR INSTDIR OTHERPKGSDIR + +rm -rf 'build' 'out' 'inst' +mkdir 'out' 'inst' || exit 1 + +( + cp -r 'buildsrc' 'build' + cd "${BUILDDIR}" || exit 1 + + # 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}" + + break + fi + done + + # Cleanup, just incase the incoming directory was not pre-cleaned + ${MAKE:-make} distclean >/dev/null 2>/dev/null + + echo "Running: ./configure --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}" + ./configure --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} + + echo "Running: ${MAKE:-make}" + ${MAKE:-make} TCLSH_NATIVE="${TCLSH_NATIVE}" || exit 1 + + # Strip the KitDLL of debugging symbols, if possible + "${STRIP:-strip}" -g libtcl.* >/dev/null 2>/dev/null + + # Create VFS directory + mkdir "starpack.vfs" + mkdir "starpack.vfs/lib" + + ## Copy in required built directories + cp -r "${OTHERPKGSDIR}"/tcl/out/* 'starpack.vfs/' + cp -r "${OTHERPKGSDIR}"/tclvfs/out/* 'starpack.vfs/' + cp -r "${OTHERPKGSDIR}"/thread/out/* 'starpack.vfs/' + + ## 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/' + + exit 0 +) || exit 1 + +exit 0 Index: kitdll/buildsrc/kitdll-0.0/Makefile.in ================================================================== --- kitdll/buildsrc/kitdll-0.0/Makefile.in +++ kitdll/buildsrc/kitdll-0.0/Makefile.in @@ -4,24 +4,25 @@ LDFLAGS = @LDFLAGS@ SHOBJLDFLAGS = @SHOBJLDFLAGS@ LIBS = @LIBS@ STATICLIBS = @TCL_LIB_SPEC@ ../../../tclvfs/inst/lib/vfs1.3/libvfs1.3.a OBJS = vfs_kitdll_data_tcl.o kitInit.o rechan.o pwb.o +TCLSH_NATIVE = tclsh # Default target all: libtcl.@SHOBJEXT@ # Build targets ## VFS Build vfs_kitdll_data_tcl.o: vfs_kitdll_data_tcl.c vfs_kitdll_data_tcl.c: dir2c.tcl starpack.vfs vfs_kitdll_data.c - ./dir2c.tcl tcl starpack.vfs > vfs_kitdll_data_tcl.c + "$(TCLSH_NATIVE)" dir2c.tcl tcl starpack.vfs > vfs_kitdll_data_tcl.c ## Tclkit Build kitInit.o: kitInit.c vfs_kitdll.tcl.h vfs_kitdll.tcl.h: vfs_kitdll.tcl - ./stringify.tcl vfs_kitdll.tcl > vfs_kitdll.tcl.h + "$(TCLSH_NATIVE)" ./stringify.tcl vfs_kitdll.tcl > vfs_kitdll.tcl.h ## Extensions rechan.o: rechan.c pwb.o: pwb.c @@ -29,11 +30,11 @@ libtcl.@SHOBJEXT@: $(OBJS) $(CC) $(CPPFLAGS) $(CFLAGS) -o libtcl.so $(OBJS) $(LDFLAGS) $(SHOBJLDFLAGS) -Wl,--whole-archive $(STATICLIBS) -Wl,--no-whole-archive $(LIBS) # Test driver tclsh.o: tclsh.c -tclsh: tclsh.o +tclsh: tclsh.o libtcl.@SHOBJEXT@ $(CC) $(CPPFLAGS) $(CFLAGS) -o tclsh tclsh.o -L. -ltcl -Wl,-R,`pwd` # Cleanup routeines clean: rm -f libtcl.so