[Xapian-discuss] Re: Problem with bindings and MinGW

Olly Betts olly at survex.com
Wed Mar 30 00:03:05 BST 2005


On Tue, Mar 29, 2005 at 09:51:54PM +0200, franz.g at tin.it wrote:
> The only problem with the bindings is that they are built with SWIG, and
> I really do not know it... otherwise I'd be glad to try to contribute a
> patch that directly affects the interface files, in order to always disable
> remote backend support on native MinGW.

The best approach is probably for xapian-core's configure to substitute
"#define XAPIAN_HAS_REMOTE_BACKEND" and similar into xapian/version.h
and then xapian-bindings can check this (and so can other software which
wants to support such optional features, yet still build in their
absence).

I'd wondered providing such defines ages ago, but people don't generally
bother disabling backends unless they're building for a small platform,
in which case they're not likely to be using the bindings.  But since
then we've started to disable the remote backend automatically where we
don't have the system calls it uses, so this can now happen out of the
box - as you've found.

> There are some other problems, however, with the xapian-bindings configure
> script and generated makefiles, at least for Python: in fact, it assumes
> that Python is installed "the UNIX way", that is it assumes that libraries
> are in $PYTHON_PREFIX/lib/python2.3 and so on. That is why I actually submitted
> a "setup.py" file for Python, which "incidentally" allows building on all
> Python supported platforms.

But it doesn't, does it?  Your setup.py works on UNIX and has special
case code for WIN32.  Python also supports Mac OS 9, MSDOS, and OS/2
and Xapian wouldn't be hard to port to these platforms (I've actually
built Xapian for MSDOS using a linux hosted DJGPP cross-compiler!)
But each of platforms is going to need special case code.

> However I realize that this is not the Xapian distribution style, that
> tries to possibly build bindings for all available languages at once.

That's not really a problem if we're allowed to require MSYS (ports of
various UNIX tools), and you're going to need that to build xapian-core.
Now configure could fairly easily generate a suitable setup.py if that
helps.  But it's not clear to me that it does, really.  If setup.py
needs special code for WIN32, then we could just put that code into
configure.ac and/or python/Makefile.am...

Or does setup.py help in the case of building an installer package
for Windows?

It would be nice to have pre-built installer packages for Windows.
We can probably even automatically cross-build them on Linux (I do this
for another of my projects - you can run innosetup's command line
compiler under wine using xvfb to fake an X display).

Cheers,
    Olly



More information about the Xapian-discuss mailing list