From: Olly B. <ol...@su...> - 2016-11-30 23:17:36
|
On Wed, Nov 30, 2016 at 09:49:49PM +0000, Olly Betts wrote: > On Wed, Nov 30, 2016 at 09:21:16PM +0000, William S Fulton wrote: > > $ ~/swig/github/swig (master=)$ make check-php5-version > > showing php5 version > > PHP 5.6.27-1+deb.sury.org~xenial+1 (cli) > > $ ~/swig/github/swig (master=)$ make check-php5-examples > > checking Examples/php5/callback > > checking Examples/php5/class > > checking Examples/php5/constants > > example_wrap.c:724:18: fatal error: zend.h: No such file or directory > > compilation terminated. > > ../../Makefile:1182: recipe for target 'php' failed > > > > This worked before. Looks like the php5/Examples are using the php_xxxx > > targets which are actually php7 targets. > > Hmm, I did test this. Not sure what's going wrong, but will sort it out. OK - I missed this because if you had both installed, then the PHP5 examples were just being generate, built and run using PHP7, which works because none of the differences between the two matter at this level. Now fixed. > > If using php5 headers with php7 generated code can you add some nice > > compiler error saying the wrong version has been used, and vice-versa? > > That wouldn't catch the case above as the failure is trying to include the PHP > headers, and we can't check what version the headers are for if we fail to > find them. Might be nice for the case of finding the wrong headers though, if > assuming it is feasible then. Adding checks for this, though they wouldn't have fired in the above case - either the PHP7 stuff isn't installed and you get the error you did, or else it is and everything consistently used PHP7. > > Have you tested this with both php5 and php7 installed and on a box and > > with just one of the two versions installed? Probably this needs doing and > > it will flush out the problems. I've now tested with just php5 installed and with both installed but all the php5 binaries and header files moved aside, and the testsuite passes for the installed version and skips for the other in each case, as it ought to. I did "make distclean" in between tests. I've also successfully built working PHP7 bindings for Xapian using this new code. Cheers, Olly |