[Xapian-devel] setup.py
Olly Betts
olly at survex.com
Wed May 4 03:48:15 BST 2005
A few thoughts:
> #!/usr/bin/env python
> # setup file for xapian
>
> import os, sys
> from distutils.core import setup, Extension
>
> XAPIAN_BASE = ""
> try:
> XAPIAN_BASE = os.environ['XAPIAN_BASE']
> except KeyError:
> print "warning: XAPIAN_BASE not set, use xapian-config
> to determine it"
>
> # please do not change the lines below
> EXTRA_LDFLAGS = (
> "-v -Wl,--enable-runtime-pseudo-reloc "
> "-L%(xapianbase)s/lib -lstdc++ "
> "-lxapianqueryparser -lxapian "
> % {'xapianbase': XAPIAN_BASE}).split()
Needing to pass --enable-runtime-pseudo-reloc is a win32 specific
oddity, and I suspect passing it elsewhere will cause errors. But we
can just add that on in the win32 case below.
Also -lxapianqueryparser is no longer required - just using
`xapian-config --libs` will sort that out and eliminate the need for
XAPIAN_BASE here.
The option -lstdc++ is GCC specific - currently there shouldn't be any
problem with building the bindings with other C++ compilers.
Poking around inside the python libraries, it looks like they should
notice this is C++ code and link with g++, so I wonder why you needed
this.
By not using libtool to build the glue library, we force installing of
the Xapian library itself before the bindings can be built. That's not
a problem if you're just using Xapian, but annoying if you're developing
Xapian. So for UNIX, I think it's probably better to stick to the current
approach.
> [snip]
> DATA_FILES = []
> if sys.platform == "win32":
> df = (
> "%(xapianbase)s/bin/libxapianqueryparser-5.dll "
> "%(xapianbase)s/bin/libxapian-5.dll "
> % {'xapianbase': XAPIAN_BASE}).split()
We can't go hard coding the library versioning information here or it
will get out of step (also, only libxapian is now needed).
Also the "split()" approach will cause problems if XAPIAN_BASE contains
spaces which is pretty common on Windows (it'll be the case if Xapian
is installed in "Program Files").
> [snip]
Cheers,
Olly
More information about the Xapian-devel
mailing list