Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions kitsh/buildsrc/kitsh-0.0/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,16 @@ AC_DEFUN(DC_FIND_TCLKIT_LIBS, [
subprojs=""
fi

if test "${proj}" = "vqtcl"; then
if test -n "${projlibfiles}"; then
AC_DEFINE(KIT_INCLUDES_VQTCL, [1], [Specify this if you link against vqtcl])

kc_cv_feature_kit_includes_vqtcl='1'
fi

subprojs=""
fi

if test "${proj}" = "tk"; then
if test "${projlibfilesnostub}" != ""; then
DC_DO_TK
Expand Down
36 changes: 36 additions & 0 deletions kitsh/buildsrc/kitsh-0.0/boot.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,42 @@ proc tclInit {} {
uplevel #0 $s
}
}
"vlerq" {
# use raw Vlerq calls if Mk4tcl is not available
# $::vlerq::starkit_root is set in the init script in kitInit.c
set rootv [vlerq get $::vlerq::starkit_root 0 dirs]
set dname [vlerq get $rootv * name]
set prows [vlerq get $rootv * parent]
foreach r [lsearch -int -all $prows 0] {
if {[lindex $dname $r] eq "lib"} break
}

# glob for a subdir in "lib", then source the specified file inside it
foreach {d f} {
vfs* vfsUtils.tcl vfs* vfslib.tcl vqtcl4* mkclvfs.tcl
} {
foreach z [lsearch -int -all $prows $r] {
if {[string match $d [lindex $dname $z]]} break
}

set files [vlerq get $rootv $z files]
set names [vlerq get $files * name]

set n [lsearch $names $f]
if {$n < 0} { error "$d/$f: cannot find startup script"}

set s [vlerq get $files $n contents]
catch {set s [zlib decompress $s]}
uplevel #0 $s
}

# hack the mkcl info so it will know this mount point as "exe"
set vfs::mkcl::v::rootv(exe) $rootv
set vfs::mkcl::v::dname(exe) $dname
set vfs::mkcl::v::prows(exe) $prows

set vfsHandler [list ::vfs::mkcl::handler exe]
}
}

# mount the executable, i.e. make all runtime files available
Expand Down
8 changes: 7 additions & 1 deletion kitsh/buildsrc/kitsh-0.0/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ dnl Determine which storage mechanism to use
AC_MSG_CHECKING([which Tclkit Storage mechanism to use])

storage_mech="auto"
AC_ARG_ENABLE(kit-storage, AC_HELP_STRING([--enable-kit-storage={zip|mk4|cvfs}], [Specify storage mechanism to use for built-in VFS (default: auto)]), [
AC_ARG_ENABLE(kit-storage, AC_HELP_STRING([--enable-kit-storage={zip|mk4|cvfs|vlerq}], [Specify storage mechanism to use for built-in VFS (default: auto)]), [
AS_CASE(["$enableval"],
mk4, [
storage_mech="mk4"
Expand All @@ -149,6 +149,9 @@ AC_ARG_ENABLE(kit-storage, AC_HELP_STRING([--enable-kit-storage={zip|mk4|cvfs}],
cvfs, [
storage_mech="cvfs"
],
vlerq, [
storage_mech="vlerq"
],
yes, [
# If they just want to enable kit storage, but nothing specifically, do nothing
storage_mech="auto"
Expand Down Expand Up @@ -208,6 +211,9 @@ AS_CASE([$storage_mech],

dnl Set any flags as required
DC_SET_DIR2C_FLAGS
],
vlerq, [
AC_DEFINE([KIT_STORAGE_VLERQ], [1], [Define if you are going to use vlerq for kit storage])
]
)

Expand Down
24 changes: 24 additions & 0 deletions kitsh/buildsrc/kitsh-0.0/installvfs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ if {[string match "*KIT_STORAGE_MK4*" $data]} {
if {[string match "*KIT_STORAGE_CVFS*" $data]} {
set tclKitStorage cvfs
}
if {[string match "*KIT_STORAGE_VLERQ*" $data]} {
set tclKitStorage vlerq
}

# Define procedures
proc copy_file {srcfile destfile} {
Expand Down Expand Up @@ -125,4 +128,25 @@ switch -- $tclKitStorage {
"cvfs" {
file copy $kitfile $outfile
}
"vlerq" {
file copy $kitfile $outfile

if {[catch {
# Try as if a pre-existing Tclkit, or a tclsh
package require vfs::m2m
}]} {
load "" vlerq
load "" vfs

source [file join $vfsdir lib/vfs/vfsUtils.tcl]
source [file join $vfsdir lib/vfs/vfslib.tcl]
source [file join [glob [file join $vfsdir lib vqtcl*]] m2mvfs.tcl]
}

set handle [vfs::m2m::Mount $outfile /kit -nocommit]

recursive_copy $vfsdir /kit

vfs::unmount /kit
}
}
29 changes: 29 additions & 0 deletions kitsh/buildsrc/kitsh-0.0/kitInit.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ Tcl_AppInitProc Zlib_Init;
#ifdef KIT_STORAGE_CVFS
Tcl_AppInitProc Cvfs_data_tcl_Init;
#endif
#ifdef KIT_INCLUDES_VQTCL
Tcl_AppInitProc Vlerq_Init, Vlerq_SafeInit;
#endif
#ifdef TCL_THREADS
Tcl_AppInitProc Thread_Init;
#endif
Expand Down Expand Up @@ -148,6 +151,9 @@ static char *preInitCmd =
#endif
#ifdef KIT_INCLUDES_MK4TCL
"catch { load {} Mk4tcl }\n"
#endif
#ifdef KIT_INCLUDES_VQTCL
"catch { load {} vlerq }\n"
#endif
"load {} tclkit::init\n"
"::tclkit::init::initInterp\n"
Expand Down Expand Up @@ -200,6 +206,26 @@ static char *preInitCmd =
"}\n"
"}\n"
#endif /* KIT_STORAGE_CVFS */
#ifdef KIT_STORAGE_VLERQ
"set ::tclKitStorage \"vlerq\"\n"
"if {![info exists s]} {\n"
"namespace eval ::vlerq {}\n"
"if {[catch {vlerq open " TCLKIT_VFSSOURCE "} ::vlerq::starkit_root]} {\n"
"set n -1\n"
"} else {\n"
"set files [vlerq get $::vlerq::starkit_root 0 dirs 0 files]\n"
"set n [lsearch [vlerq get $files * name] boot.tcl]\n"
"}\n"
"if {$n >= 0} {\n"
"set s [vlerq get $files $n contents]\n"
"if {![string length $s]} { error \"empty boot.tcl\" }\n"
"catch {load {} zlib}\n"
"if {[vlerq get $files $n size] != [string length $s]} {\n"
"set s [zlib decompress $s]\n"
"}\n"
"}\n"
"}\n"
#endif
"if {![info exists s]} {\n"
"set s \"\"\n"
"}\n"
Expand Down Expand Up @@ -353,6 +379,9 @@ static void _Tclkit_Generic_Init(void) {
#ifdef KIT_STORAGE_CVFS
Tcl_StaticPackage(0, "cvfs_data_tcl", Cvfs_data_tcl_Init, NULL);
#endif
#ifdef KIT_INCLUDES_VQTCL
Tcl_StaticPackage(0, "vlerq", Vlerq_Init, Vlerq_SafeInit);
#endif
#ifdef TCL_THREADS
Tcl_StaticPackage(0, "Thread", Thread_Init, NULL);
#endif
Expand Down
51 changes: 51 additions & 0 deletions vqtcl/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#! /usr/bin/env 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

BUILDDIR="$(pwd)/build/vqtcl"
OUTDIR="$(pwd)/out"
INSTDIR="$(pwd)/inst"
OTHERPKGSDIR="$(pwd)/../"
export BUILDDIR OUTDIR INSTDIR OTHERPKGSDIR

# Set configure options for this sub-project
LDFLAGS_ADD="${KC_VQTCL_LDFLAGS_ADD}"
LDFLAGS="${LDFLAGS} ${KC_VQTCL_LDFLAGS}"
CFLAGS="${CFLAGS} ${KC_VQTCL_CFLAGS}"
CPPFLAGS="${CPPFLAGS} ${KC_VQTCL_CPPFLAGS}"
LIBS="${LIBS} ${KC_VQTCL_LIBS}"
export LDFLAGS_ADD LDFLAGS CFLAGS CPPFLAGS LIBS

rm -rf 'build' 'out' 'inst'
mkdir 'out' 'inst' || exit 1

(
cp -rp 'buildsrc' 'build'
cd "${BUILDDIR}" || exit 1

if [ "${KITTARGET}" = "kitdll" ]; then
CFLAGS="${CFLAGS} -fPIC"
export CFLAGS
fi

echo "Running: ./configure --disable-shared --prefix=\"${INSTDIR}\" --exec-prefix=\"${INSTDIR}\" --libdir=\"${INSTDIR}/lib\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
./configure --disable-shared --prefix="${INSTDIR}" --exec-prefix="${INSTDIR}" --libdir="${INSTDIR}/lib" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA} || continue

echo "Running: ${MAKE:-make} install"
${MAKE:-make} install || continue

mkdir "${OUTDIR}/lib" || exit 1
cp -r "${INSTDIR}/lib"/* "${OUTDIR}/lib/"
find "${OUTDIR}" -name '*.a' | xargs rm -f >/dev/null 2>/dev/null
) || exit 1

exit 0
39 changes: 39 additions & 0 deletions vqtcl/buildsrc/vqtcl/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
2009-02-20 patthoyts
* merge: Merged the following changes from the old repository.
- Fixed mkcl for recent change to all branches that propagates errors
from matchin directory functions which was breaking tclkit's based
on vlerq vfs.
- Updated for 8.6 changes. interp->errorLine is now replaced by
Tcl_GetErrorLine and the stubs variables are now const. Use
-ltclstubs for vqtcl.
- Updated the nmake build files for MSCV9 and added a target to run
the test suite. Fixed three tests that had unix expectations to
pass with windows as well.
- Applied patch from kostix to solve problems opening tclkit when
the directory has non-ascii characters in the path. Tcl provides a
utf-8 string and we need to convert it to the external encoding.
- Support release build with symbols under msvc
- For 8.6 - do not define USE_TCL_STUBS for static builds
- add code signing support for Win32, add stdint.h for newer mingw
- stdint.h required. Patched to permit operation on authenticode signed binaries
2009-02-03 jcw
* all: this code was copied from http://www.equi4.com/pub/vq/vqtcl.tgz
2007-01-26 jcw
* vlerq.c: updated to get rid of stdint.h header
2007-01-25 jcw
* all: vlerq update
2007-01-16 jcw
* all: vlerq update
2007-01-02 jcw
* all: vlerq update
2006-12-28 jcw
* all: vlerq and tclconfig updates
2006-12-12 jcw
* all: vlerq update
2006-12-06 jcw
* Added ratcl package and "view" operator, many tweaks, bump to 4.1
* m2mvfs.tcl: updated to 1.8 for sdx wrapping of starpacks
2006-11-15 jcw
* all: Initial 4.0 release
2006-11-05 jcw
* Sources brought under darcs revision control
Loading