[Xapian-discuss] PHP Bindings with Cygwin : start of an HOWTO & status report

Olly Betts olly at survex.com
Fri Feb 17 14:45:11 GMT 2006


On Thu, Feb 16, 2006 at 10:18:09AM +0100, Thomas Deniau wrote:
> As a Cygwin module for a Windows PHP isn't really a PHP target,
> php-config does not report the paths, LDFLAGS, &c. needed for the
> compilation. So you will have to use a "make
> xapian_la_LDFLAGS="-L/cygdrive/....youphpdir.... -lphp5ts". I think
> you would use php4ts for php4 but I have not tried this.

This should have been handled by 0.9.3 out of the box, except that the
case in configure only checked for mingw and pw32, not cygwin.  I've
just added cygwin, but I'm totally not sure if that's the right thing to
do as it may not work for a "true" cygwin build - your hybrid approach
is rather non-standard I suspect.

Incidentally, if you do need to specify extra libs for PHP, then
PHP_LIBS is a better option that xapian_la_LDFLAGS.

> And that's where I'm stuck : the PHP bindings are generated by SWIG
> and SWIG isn't compatible with ZTS PHP yet (ZTS adds an argument to
> many functions ; that's presumably needed for thread safety, and SWIG
> generates code without that last argument). This SWIG bug is
> reportedly fixed in 1.3.27, but that last argument isn't there when
> you generate the PHP bindings in 1.3.28. Makes me
> wonder if the bug is really fixed.

The original bug was really fixed.  Debian unstable had PHP built with
ZTS enabled for a while, but reverted to non-ZTS.  But during that
period, the Xapian PHP bindings weren't building on my debian unstable
box.  With the patch applied they did build.

But this seems to be another instance of the same class of problem,
presumably in some SWIG code added since then.

Is SWIG CVS HEAD any better?

Cheers,
    Olly



More information about the Xapian-discuss mailing list