Here you can read my notes on building your own custom version of dqkit (threaded tclkit with butteries included) on Windows, because I faced some difficulties while doing so, and I hope this might help others.

I was working with dqkit-20060505 source tarball, so just download it and unpack to some location on your hard drive. For compilation you will need mingw toolchain, which in my case consisted of the following:

  • binutils-2.17.50-20060824-1
  • gcc-core-3.4.5-20060117-1
  • gcc-g++-3.4.5-20060117-1
  • mingw-runtime-3.10
  • w32api-3.7

Also you will need either msys or cygwin, while in the case of the latter you will most probably need your mingw/bin in path before cygwin/bin. Before you start, copy your msys/bin/sh.exe as msys/bin/bash.exe and your mingw/bin/gcc.exe as mingw/bin/cc.exe. Also you will need some version of Tcl, either ActiveState's or cygwin's will suffice.

Current cygwin bash.exe (version 3.1.17 in my case) has a slight change in syntax which uncovered old bug in tcl.m4 which now renders most tcl-extension-related configure scripts unusable. You will need to run this script to patch all errors:

Place this script into your dqkit-20060505 directory and execute as "tclsh patch-relid.tcl".

Also you will now need to make these fixes by hand:

  • In dqkit-20060505 tarball there is a horrible typo that renders starkits unusable:
    in kit/lib/vfs/pkgIndex.tcl change
    "ifneeded starkit 1.0" to
    "ifneeded starkit 1.3.1".
  • If you are using cygwin you will need to edit file src/tk-8.5.0/win/Makefile.in, changing
    "winhelp: $(TCL_SRC_DIR_NATIVE)" to
    "winhelp: $(TCL_SRC_DIR)" and
    "$(MAN2TCL): $(TCL_SRC_DIR_NATIVE)" to
    "$(MAN2TCL): $(TCL_SRC_DIR)", otherwise tk won't compile.
  • If you are using msys you will need to edit file src/sqlite-2.8.8/configure, find the line
    "  *cygwin* ) CYGWIN=yes;;", and add line with
    "   *mingw* ) CYGWIN=yes;;" either before or after it, otherwise sqlite won't configure correctly (this is a very dirty fix, but it will suffice).

Now you can apply your local fixes that customize dqkit in any way you want. Start your bash shell, go into your dqkit-20060505 directory, and type these commands:

  • export NOUPX=1 (if you don't have upx somewhere on your path)
  • export NOEXPECT=1 (I couldn't figure out how to compile expect using msys or cygwin yet)
  • gen/common.sh

If everything goes well you'll now have all variants of dqkit compiled successfully!