Building Tclkit with kitgen on Windows

APN 20100916 Instructions below are somewhat dated. Follow the links in kitgen instead. The caveats below about SDK paths etc. still hold.

APN 20090910

NOTE: Binaries built using the instructions below are available from [L1 ].

Needing the ability to build tclkits on Windows from CVS head on a semi-regular basis, I finally got around to trying Pat Thoyts' instructions from the starkit mailing list [L2 ] to build my own kit. Read that reference first.

There were a couple of things that caused me grief having to do with my environment (Visual Studio 6.0, XP). Hence this page - so others do not go through the same pain. The issues were:

  • Do not have spaces in any directory paths. nmake spits weird error messages with no hint as to the real problem. This was my mistake #1.
  • You need to install the Platform SDK - I used the 2003 SP1 version which I already had. This is required for theme support as Visual Studio 6.0 does not come with the required include files.
  • Do not run setenv.cmd from the Platform SDK. This was my mistake #2. Instead explicitly set INCLUDE env var from the command line as shown below.

Here are the explicit instructions. Note this builds Tclkit Lite as it uses Vlerq and not Mk.

Retrieve the latest version of kitgen and create directories for the Tcl-Tk sources. The 8.6 directory will contain the version-specific source, 8.x will contain the version-independent source. I believe the directory names do not matter.

svn checkout svn:// kitgen
cd kitgen
mkdir 8.6 8.x

Check out the Tcl-Tk sources.

cd 8.6
cvs -z9 -d:pserver:[email protected]:/cvsroot/tcl co tcl
cvs -z9 -d:pserver:[email protected]:/cvsroot/tktoolkit co tk
cd ..

Check out the version-independent stuff - thread, tclvfs, zlib and vqtcl (Vlerq). Note as stated before, we are building with Vlerq so we will land up with Tclkit Lite. If you wanted full Tclkit support, you need Mk and Itcl as well. I have not tried this. In particular, the latest Itcl fails to build with Visual Studio 6.0 because of some max symbol length error.

cd 8.x
cvs -z9 -d:pserver:[email protected]:/cvsroot/tcl co thread
cvs -z9 -d:pserver:[email protected]:/cvsroot/tclvfs co tclvfs
svn co svn:// vqtcl
(for zlib get the tar.gz from equi4 and unpack in 8.x/zlib)
cd ..

Create the makefile

cd 8.6
mkdir win32-ix86
cd win32-i386
echo !include ..\..\ > Makefile

Set up the build environment. Assumes Visual Studio 6.0 is on your path (for vcvars32). Note INCLUDE environment is prefixed with the path to the SDK include directory. Replace the SDK path with wherever it is installed. I used the short name for safety, though the long name may work as well.

set INCLUDE=c:\progra~1\MIC977~1\include;%INCLUDE%

The actual build. This will build tclkit-cli.exe and tclkit-gui.exe, the tclsh and wish versions respectively. kit-cli.exe and kit-gui.exe are temporary exes (I think), do not use them.

nmake VERSION=86

That was it (for me, anyways). For verification, I used tclkit-cli to build the BowWow server which ran without any issues (that's the extent of the testing!)