D 2010-09-27T22:42:55 L KitCreator P 890c8a1bb48fe00200788bfc0f610416692c0362 U rkeene W 20532 Tclkit Building Made Trivial
KitCreator is a simple build system for creating a Tclkit. It was created to ease creation of Tclkits. If you just want to use Tcl on your platform, it is recommended that you use a pre-existing Tclkit. See also locally built pre-built Tclkits.
A Tclkit is, briefly, a single-file executable that contains Tcl (both the interpreter, and all the resources it requires to operate) and other Tcl-related packages (Tk, Incr Tcl, etc). A tclkit can be used to create a Starpack, which is the Tclkit plus the resources required for your Tcl-based application in a single file. This makes application delivery easy and consistent as it will be a single file that the user runs to use the application. Additionally, since a Tclkit is generic, any Tclkit from any platform can be used as the base for a Starpack. That is, from GNU/Linux you can take the Tclkit for AIX and add your application to produce a native executable for AIX.
KitCreator can be used to cross-compile a Tclkit, however you may need to have a working Tclkit for your native system first. KitCreator can be used to create this local boot-strap Tclkit.
Download:
Some examples:
Details: The general mechanism that enables a Tclkit to operate is a small Tcl initialization routine linked statically to the core libraries needed to operate a Tcl interpreter, the Tcl VFS Layer, and a database-backed (Metakit) Virtual File System that is appended to the end of the executable.
This project brings together all of the required pieces, plus some additional pieces that were found in the original Tclkit:
The source code for these pieces are downloaded, compiled, and linked, and the database containing the appropriate filesystem data is created. What sets this project apart from other similar projects is that:
The top-level "kitcreator" script is very simple. Its only job is to interpret command line arguments, and call the per-project "build.sh" scripts. For the "tcl" project it also finds the appropriate "tclConfig.sh" (and stores this path in TCLCONFIGDIR) to enable subsequent build scripts to find the appropriate Tcl to link against.
The per-project "build.sh" scripts are entirely autonomous. They are responsible for downloading the source code for the appropriate version that will compile and link against the current version of Tcl (user requested version can be found in "TCLVERS", while the actual version must be requested from the "tclConfig.sh" script), compiling it, installing a functional copy into the per-project "inst" directory, and installing anything that needs to be in the Tclkit's VFS root into the per-project "out" directory.
The exception to this is the "kitsh" project. It is the glue that binds all the individual projects together into a single executable. Its build script does not create an "inst" or an "out" directory because it is not a library. Instead, it collects all the other project's "out" directories into a single directory (starpack.vfs), as well a static file (boot.tcl). It then compiles the source code, and then installs the Metakit database containing the VFS onto the resulting executable.
If the "mk4tcl" project fails to build (or is not requested to be built), the rest of the project will be built using zip files instead of Metakit databases.
To create the storage database, one of two Tclkits is used (tried in this order):
Included Packages
Package Name | Package Version | Included When... | Linking Method |
---|---|---|---|
Tk | same as Tcl | Always | Dynamic |
Incr Tcl | 3.4b1 | Always | Dynamic |
starkit | 1.3.2 | Always | Static |
Metakit | 2.4.9.7 | Always | Static |
TclVFS | 20080503 | Always | Static |
PWB | 1.1 | Always | Static |
Rechan | 1.0 | Always | Static |
Zlib | 1.1 | Always | Static |
Thread | 2.6.5 | --enable-threads | Dynamic |
Registry | varies | Building for Win32 | Static |
DDE | varies | Building for Win32 | Static |
http | varies | Always | Static |
opt | varies | Always | Static |
msgcat | varies | Always | Static |
tcltest | varies | Unless MINBUILD | Static |
Tested Platforms
Operating System | CPU Architecture | Tcl Version | Compiler | Cross-compile |
---|---|---|---|---|
Linux 2.6 | x86 | 8.4.19 | gcc 4.1.2 | no |
Linux 2.6 | x86 | 8.5.8 | gcc 4.1.2 | no |
Linux 2.6 | x86 | CVS HEAD | gcc 4.1.2 | no |
Solaris 8 | SPARC | 8.4.19 | gcc 3.4.6 | no |
Solaris 8 | SPARC | 8.5.8 | gcc 3.4.6 | no |
Solaris 10 | SPARC | 8.4.19 | gcc 3.4.3 | no |
Solaris 10 | SPARC | 8.5.8 | gcc 3.4.3 | no |
Solaris 10 | SPARC | 8.4.19 | SunStudio 12 | no |
Solaris 10 | SPARC | 8.5.8 | SunStudio 12 | no |
HP/UX 11iv1 | PA-RISC | 8.4.19 | gcc | no |
HP/UX 11iv1 | PA-RISC | 8.5.8 | gcc | no |
Linux | ARM | 8.4.19 | gcc 4.3.3 | yes |
Windows | x86 | 8.4.19 | mingw32 gcc 3.4.2 | yes |
Windows | x86 | 8.5.8 | mingw32 gcc 3.4.2 | yes |
Versioning Information
Version Numbers
Basic Version Annotation