Re: Changes to ext/xml config.m4

From: Date: Tue, 09 Jan 2001 16:27:07 +0000
Subject: Re: Changes to ext/xml config.m4
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-43573@lists.php.net to get a copy of this message
On Tue, 9 Jan 2001, Sterling Hughes wrote: >> Why not doing it like Mysql is done? ie. change it to --with-xml >> and if no path is issued, use bundled library. And maybe issue a warning >> about it..? >> >> Or have both --with-xml and --enable-xml (on by default). >> >> Another thing I run into today is Sablotron 0.50: >> >> ----8<---------------- >> There is a significant change of how the expat is used since version >> 0.50. Sablotron _never_ builds the expat under source tree, but >> supposes, that you have installed Expat library in your system. >> -------8<------------- >> > >Right that's why PHP has changed its build process to include the xmltok and >xmlparse libraries when building sablotron. ;-) But it looks for the expat library only from the same place as it expects the sablot library to be? Why? As I have installed expat library in different place this config will fail. Also, this could be used with the XML extension. ie. if it's defined, then the external expat libraries are used in it. Here's a patch to add an extra configure option, --with-expat-dir: =================================================================== RCS file: /repository/php4/ext/sablot/config.m4,v retrieving revision 1.9 diff -u -r1.9 config.m4 --- config.m4 2001/01/06 08:37:00 1.9 +++ config.m4 2001/01/09 16:22:00 @@ -1,6 +1,9 @@ dnl $Id: config.m4,v 1.9 2001/01/06 08:37:00 hirokawa Exp $ dnl config.m4 for extension Sablot +PHP_ARG_WITH(expat-dir, for Sablotron XSL support, +[ --with-expat-dir=DIR Sablotron: libexpat dir for Sablotron 0.50]) + PHP_ARG_WITH(sablot, for Sablotron XSL support, [ --with-sablot[=DIR] Include Sablotron support]) @@ -27,13 +30,22 @@ PHP_SUBST(SABLOT_SHARED_LIBADD) AC_ADD_LIBRARY_WITH_PATH(sablot, $SABLOT_DIR/lib, SABLOT_SHARED_LIBADD) - if test -f $SABLOT_DIR/lib/libexpat.a -o -f $SABLOT_DIR/lib/libexpat.so ; then - AC_ADD_LIBRARY(expat) - AC_CHECK_LIB(sablot, SablotSetEncoding, - AC_DEFINE(HAVE_SABLOT_SET_ENCODING,1,[ ])) - else - AC_ADD_LIBRARY(xmlparse) - AC_ADD_LIBRARY(xmltok) + if test -z "$PHP_EXPAT_DIR"; then + PHP_EXPAT_DIR="" + fi + + testval=no + for i in $PHP_EXPAT_DIR $SABLOT_DIR; do + if test -f $i/lib/libexpat.a -o -f $i/lib/libexpat.so; then + AC_ADD_LIBRARY_WITH_PATH(expat, $i/lib) + AC_CHECK_LIB(sablot, SablotSetEncoding, AC_DEFINE(HAVE_SABLOT_SET_ENCODING,1,[ ])) + testval=yes + fi + done + + if test "$testval" == "no"; then + AC_ADD_LIBRARY(xmlparse) + AC_ADD_LIBRARY(xmltok) fi AC_DEFINE(HAVE_SABLOT,1,[ ])

« previous php.dev (#43573) next »