[Xapian-discuss] TCL -> Xapian bindings problem?

Michael Schlenker schlenk at uni-oldenburg.de
Sat Oct 23 14:56:59 BST 2004


Olly Betts wrote:

> On Fri, Oct 22, 2004 at 03:56:12PM +0200, Michael Schlenker wrote:
> 
>>Typical convention for Tcl packages not bundled with core Tcl (bundled 
>>with core tcl are msgcat, http, registry, dde), is to install them in a 
>>subdir of $auto_path, the package search path, usually /usr/lib, but 
>>putting them in the Tcl dir (for example /usr/lib/tcl8.4/xapian0.8.3) 
>>works also.
> 
> 
> How do I find the equivalent of "/usr/lib", since Tcl may not be
> installed with prefix /usr?  Especially on Windows!
> 
> http://wiki.tcl.tk/1628 suggests the answer is to use the parent
> directory of $tcl_library - or is there a better way?
> 
There isn't really a better way, sorry to say that.
> 
>>The reason for this is simple, for Tcl you _do not_ have to recompile an 
>>extension just to use a newer core Tcl version, if it uses the TCL_STUBS 
>>interface (i don't know if swig sets this automatically, but it could 
>>be).
> 
> 
> The SWIG generated code contains:
> 
> #ifdef USE_TCL_STUBS
>     if (Tcl_InitStubs(interp, (char*)"8.1", 0) == NULL) {
> 	return TCL_ERROR;
>     }
> #endif
> 
> We don't currently define USE_TCL_STUBS, but we can easily enough.
> 
It would be good as it increases usability of the extension in a number 
of ways.

> 
>>This means if you can compile xapian against a Tcl 8.1 and have the 
>>package it loads into Tcl 8.1, 8.2, 8.3, 8.4 and will load into the 
>>upcoming 8.5 (about six years of binary compatibility).
> 
> 
> I notice you don't mention 8.0.  Does this work with Tcl 8.0?  If not,
> we ought to check for that in configure.
> 
It works with the last 8.0 version (8.0.6), but not with any other 8.0 
version. Tcl version management botched between 8.0 and 8.1 as there are 
rather major changes between these two releases (8.1 introduced unicode 
in all the interfaces..., a major step for a minor release).

Currently the official support status for Tcl is like this:
8.3 -- only commercial support otherwise phased out
8.4 -- current release
8.5 -- in late alpha stage

So older Tcl versions are mainly for legacy systems or embedded systems 
that need a smaller footprint, there are some commercial shells based on 
older Tcl releases left in the wild, but in general there should be no 
problem to require at least the current unicode enabled series starting 
with 8.1. (although 8.1 isn't recommended for usage (rather unstable 
release) it can be used to compile against for stubs compatibility...)

Michael




More information about the Xapian-discuss mailing list