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

Olly Betts olly at survex.com
Fri Oct 22 19:39:12 BST 2004


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?

> 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.

> 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.

Cheers,
    Olly



More information about the Xapian-discuss mailing list