[Xapian-discuss] PHP bindings on a Mac

Richard Boulton richard@lemurconsulting.com
Wed, 26 May 2004 14:02:24 +0100


rm@fabula.de wrote:
> Well, the easiest thing is: just put config.sub into the tarball. This file
> can be easily distributed without any problems (it just 'canonicalize' the
> configuration type). Since it doesn't depend on any local settings it's 
> easy to distribute.

It's not that simple, unfortunately.  The php4/xapian/ directory is 
currently created at build time, so for a VPATH build, it will be in the 
build tree, not the source tree.  If config.sub was put into the 
tarball, it would be placed into the source tree.

"config.sub" is already in the tarball, incidentally.  It's just not 
also in the tarball at "php4/xapian/config.sub", and even if it were it 
wouldn't be found by the build process.  Suppose we are building 
xapian-bindings in xapian-bindings/build/:

The php4 build process (at "make" time) will create 
"xapian-bindings/build/php4/xapian", populate it with source files and a 
Makefile and configure script, and then run configure.  This configure 
run is not a VPATH build, and even if it were, the source directory is 
"xapian-bindings/build/php4/xapian/", so it will not look in 
"xapian-bindings/php4/xapian/" for config.sub.

The problem is that swig generates an autotools project, and expects us 
to use it to build the bindings.  This prevents us distributing it in 
pre-made form.  I think the best solution is to make our own autotools 
project, and ignore the files generated by swig.  (Though this runs the 
risk of being broken as new versions of swig appear.  We have to do work 
to support new versions of swig anyway, often, so I don't think this is 
a big loss.)

-- 
Richard