[Xapian-devel] Available backends in xapian.h

Francesco Garosi franz.g at tin.it
Tue May 10 00:42:25 BST 2005


Hi Olly,

you definitely did more magic than I did in my tests, as I only relied on
sys.platform and the documentation. I agree with you, the use of distutils
should produce more reliable results on all platforms. And finally, when
I was testing, I also introduced an extra (possibly empty) variable similar
to PYTHON_LIBS in configure.ac as you did... slowly, but I'm learning.

It looks like the new entries in xapian-bindings/configure.ac work, except
for a little glitch at line 144: I think it should read

	    PYTHON_LIBS="`$PYTHON -c 'import os,sys;print "-L" + os.path.join(sys.prefix,"libs").replace(os.sep,"/"),"-lpython"+sys.version[[:3]].replace(".","")'`"
;;

(ie. doubling the square brackets). I also used "+" instead of "," for the
-L parameter, but it shouldn't be necessary, it just makes the output more
similar to others. However in my opinion the reference to cygwin should
be removed: cygwin ships with its own Python (guess what, in that version
os.pathsep is actually ":"! ;-) ), and this could confuse the toolchain.

I also added more double quotes in xapian-bindings/python/Makefile.am, namely
at line 44: probably this escaped inadvertently your attention... so it
should read:

	PYTHONPATH=".$(PYTHON_PATHSEP).libs" $(PYTHON) -c "import xapian"

so that the semicolon does not confuse sh anymore. Apart from that, all
works in xapian-bindings (i didn't test the installation though), provided
the PATH trick I described before. The bindings were built with a non-installed
build tree, so it should also be easier when Xapian is installed.

One only last (possible?) glitch: in xapian-core/configure.ac:690 I had
to force the suppression of a warning with -Wno-unused (wasn't it there
before?), as in queryparser.lemony:465 I get a "warning: unused parameter
'state'". I don't think you want to change the function definition, but
maybe there is some less invasive way to remove the warning. My line in
xapian-core/configure.ac now reads:

	*) AM_CXXFLAGS="$AM_CXXFLAGS -Werror -Wno-unused" ;;

After these changes I re-bootstrapped the SVN distribution and built xapian-core
and xapian-bindings. I still have some small problems with xapian-applications
(although Omega builds fine), but they are probably unrelated to these updates.

>Adding 'xapian-config --libdir' may be the answer, but we need to decide
>if it should report "where the library is now" or "where the library is
>or will be installed".

I think that it could depend on which xapian-config is invoked... for instance,
as you do for other things just there (referring to xapian-config.in):

	# check if this is an uninstalled xapian-config
	if test -n "$builddir" -a -f "${builddir}Makefile" ; then
	    libs="@abs_builddir@/.libs"
	else
	    libs="@libdir@"
	fi
    echo "$libs"

if .libs goes in @abs_builddir at . I know I'm too lazy, and always build in
the source directory.

>Isn't mingw ABI compatible with MSVC? That was my understanding...

They *should* be compatible. As far as I know that MinGW's ".a" and MSVC's
".lib" archives are somewhat different, hence the need to build a libpython23.a
from python23.dll for use with MinGW. This is a static linker issue, I guess.
Both compilers should produce object files with the same format, even though
someone reports them to be incompatible at least for some versions of each.
I never tried to build anything mixing MSVC's ".obj" files and MinGW's ".o"
objects though... I think I'll save it for a rainy day.

Thank you again for the great work...

Cheers,

F.






More information about the Xapian-devel mailing list