Version 17 of Converting your Tcl extension to TEA2

Updated 2003-07-07 01:02:23

Purpose:

Provide a developer with tips, suggestions and warnings regarding implementing a Tcl extension using the TEA 2000 guidelines.


Why bother?

See the TEA philosophy [L1 ].


Where is TEA2 documented?

See link above. (Note: The link above describes TEA 1 -- barely.)

TEA2 isn't really documented in the conventional sense of the term. There are extensive comments in tcl.m4, and the sampleextension Makefile.in gives a mostly-accurate blow-by-blow of what's going on, but other than that it's mostly folklore and bits gleaned from the Wiki.


What needs to be done to move a TEA1 extension to TEA2?

The easiest thing to do is compare your current extension with the sampleextension, as the differences are not major. SC_ macros are now all TEA_, and you should actually be able to remove code from your configure.in and Makefile.in.


What needs to be done to move a non-TEA extension to TEA2?

That really depends on what you start with, but TEA2 isn't so complex that looking at the sample shouldn't be mostly (if not fully) self-explanatory. There is a wealth of TEA2 extensions out there (sampleextension, tktable, itcl, tkdnd, tclx, expect, ...) which handle just about every possible build case.


What tools are available to help with TEA2?

In a c.l.t. posting [L2 ] Donal Fellows mentioned teapot [L3 ], the TEA extension help mate a script helping to create the configure.in , aclocal.m4 and Makefile.in for a TEA2 compliant extension.

DKF - Good. Someone noticed... :^)


What do you do when TEA2 changes or is fixed? Can you update your extension automatically?

Usually all that is required is simply copying the updated tclconfig/tcl.m4 (which is really all the macros in TEA2) and rerunning autoconf for your project.

Vince Why not bundle tclconfig/tcl.m4 with Tcl (and have Tcl install it too), then, so all this copying isn't necessary?... How does one find out if changes have been made? What is the definitive source of the correct 'tclconfig/tcl.m4'?


On what platforms can one use TEA2 - does it work on MacOS, MacOS X, VMS, Unix, Microsoft Windows, etc.?

All modern platforms are supported. This does not include VMS or MacOS 8/9, but TEA2 should correctly support OS X, Unix/Linux, and Windows (including 64-bit and CE).


Can it build/install into paths containing spaces?

Yes it can, but the paths have to be quoted correctly and some peculiarities may happen. To install in C:/Program Files one has to invoke configure like this:

 ./configure --prefix="C:/Program\ Files"

Configure seems to look for a site script in C:/Program\ which is obviously incorrect, but has no negative consequences if no site script is used.


On Microsoft Windows, does the Mingw 3.x based compilers work with TEA2?

The latest mingw compiler should work with TEA2 on Windows for "regular" Windows platforms. The proper SDKs and Microsoft compilers are required for Windows 64-bit and Windows/CE.

Other TEA pages on this Wiki list dozens of bugs in TEA (on all platforms). Is it really worth using?


[ Category Porting | ]