[Xapian-discuss] Failing to build PHP Bindings OSX 10.6

Olly Betts olly at survex.com
Wed Dec 22 04:20:22 GMT 2010

On Thu, Dec 16, 2010 at 10:08:36PM +0000, Olly Betts wrote:
> On Thu, Dec 16, 2010 at 09:54:04PM +0000, James Aylett wrote:
> > Olly & Richard, could configure could check this situation by importing
> > xapian/version.h and checking XAPIAN_VERSION, major_version or something?
> > configure will check the version of xapian-config, but that's not quite the
> > same if your include paths get contaminated?
> I don't think configure easily can - this issue only emerges in the Makefile
> when the full compile command line is assembled, so we'd have to duplicate
> the information on how that is assembled in configure, which seems rather
> brittle.
> I think you'd have to put the information from xapian-config --version in
> to config.h, then put some preprocessor magic into the code which gets
> compiled to complain if that doesn't match what you get from <xapian.h>.

More thoughts on this...

What you actually want to verify is that the headers you compile against
(and ideally the library that you link against too) are those which
xapian-config told you about.

Checking the version doesn't actually achieve that - it has both false
positives and false negatives:

* You can install the same version of Xapian in two different locations
  (this can matter even for release builds since libtool will include
  the linked to path as an rpath if it isn't in the default dynamic
  linker search path, so you can get a binary which has different
  behaviour if you remove or upgrade one of the installation depending
  which gets linked to).

* You might configure your package and then upgrade the Xapian version
  which it was configured against, and then a version check would then
  fail, which is unhelpful.

I think what you really want to be checking is that the paths match,
which I don't see a good way to do.


More information about the Xapian-discuss mailing list