TEA(ish)

TEA(ish): a TEA-like Build System for Tcl Extensions
Login

TEA(ish): a TEA-like Build System for Tcl Extensions

This is the home of TEA(ish), a Tcl extension-builder tool in a vein of the TEA (Tcl Extension Architecture), also known as tclconfig. The primary difference from TEA is that teaish uses Steve Bennett's Autosetup instead of the GNU Autotools, and was it was born in the effort of porting SQLite's TEA build to Autosetup.

This project started out using the name "TEA port to Autosetup" because it intended to be a more or less straight port of TEA to autosetup. It has since gone in a slightly different direction, not because of any perceived flaws with TEA but because my ambitions for porting 4k+ lines of tea.m4 and friends have mysteriously disappeared.

The goal here is not to outright replace TEA but to provide an alternative implementation which (1) is based on Autosetup and (2) has close to feature-parity with that build, taking this opportunity to drop some of the historical cruft from that build. e.g. there is currently no intent to support Tcl versions older than 8.5, nor are there specific plans to support exotic platforms.

Collaborators are welcome! If interested, please get in touch. A willingness to use the Fossil SCM is a must (this is not hosted on github). Some moderate level of Tcl-fu is required, but nothing advanced. Familiarity with Autosetup is a plus.

Current Status

Let's call it beta. It can (./configure && make test install) the SQLite TEA extension (a copy of which is included in teaish's canonical source repository) but has yet to be tested with any other real-world Tcl extensions.

Summary of working features:

Platform Portability

Autosetup runs on most POSIX-style systems. It does not work from a conventional Windows console.

Teaish has been seen to work on:

It is regularly tested with both GNU Make and BSD Make.

Download

If you're reading this on the canonical site, you can download a recent build from here, then:

$ tar xzf teaish-TIMESTAMP-HASH.tar.gz

(The HASH part of the name corresponds to its check-in version.)

With that you can build Tcl extensions with this framework and build them using one of the following approaches:

From the directory containing the teaish-format extension:

$ /path/to/teaish/configure ...
$ make test

If you do not have tcl installed at the system level, or want to use a custom build, you may want to use the --with-tcl=/installation/prefix flag. Teaish requires a Tcl installation which has a tclConfig.sh.

From some arbitrary directory:

$ /path/to/teaish/configure --teaish-extension-dir=/path/to/extension
$ make test

Or copy the extension's files to the teaish dir and simply:

$ ./configure ...
$ make test

Cloning this Repository

This repository uses the Fossil SCM. The full tree contains lots of stuff which the downloadable distribution does not, though, for "historical reasons."

It can be cloned and used like:

$ fossil clone https://fossil.wanderinghorse.net/r/teaish
$ cd teaish/example/hello
$ ../../configure --with-tcl=/install/prefix/for/your/tcl
#            e.g. --with-tcl=$HOME/tcl/v9
#            If you have a system-level tcl, it can use that.
$ make test
$ make distclean

To demonstrate an out-of-tree build, starting from where the previous example leaves of:

$ mkdir ../x
$ cd ../x
$ ../../configure \
    --with-tcl=/install/prefix/for/your/tcl \
    --teaish-extension-dir=../hello
$ make

Authoring, Building, and Testing Extensions

See doc/extensions.md.

Source Tree Structure

This tree's structure is essentially a hand-built copy of what SQLite's canonical build generates when it creates an "autoconf build"2 - a trimmed-down build process when includes only pre-generated files so that it does not rely on Tcl (whereas the canonical build has a strong dependency on Tcl for code generation and running tests). SQLite's developers do not actually use this build - it is provided as a convenience for downstream users, and SQLite's web server logs suggest that more than 80% of SQLite source code downloads are of this variant of the build.

The directories are as follows:

Notable TODOs

In no particular order...

License

2025 April 5

The author disclaims copyright to this source code. In place of a legal notice, here is a blessing:


  1. ^ Admittedly somewhat to my surprise. However, installing an extension on Haiku requires a workaround documented in ./doc/extensions.md#install.
  2. ^ "autoconf" is currently a misnomer - SQLite's so-called autoconf build is, since version 3.49.0, driven by Autosetup but the name autoconf is retained to avoid breaking countless amounts of documentation and downstream build/packaging automation. The autoconf/tea directory is driven by autoconf/automake, but the whole point of this project is to "fix that" ;).