#19124 [Fbk->Asn]: config.m4 problems with ext/xmlrpc
| From: | sniper@php.net | Date: | Wed, 28 Aug 2002 16:28:03 +0000 |
| Subject: | #19124 [Fbk->Asn]: config.m4 problems with ext/xmlrpc | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-18051@lists.php.net to get a copy of this message | ||
ID: 19124
Updated by: sniper@php.net
Reported By: list@firehawksystems.com
-Status: Feedback
+Status: Assigned
Bug Type: XMLRPC-EPI related
Operating System: FreeBSD 4.3, but any Unix
PHP Version: 4.2.2
-Assigned To:
+Assigned To: sniper
New Comment:
I'm looking into this..the provided patch is not the way to do it.
Previous Comments:
------------------------------------------------------------------------
[2002-08-28 12:23:14] kalowsky@php.net
Can you please make your patch a unified diff (diff -u) which makes it
easier for us to test against.
Your HAVE_CONFIG change seems to disregard the initial intention which
was to provide functionality for Win32 users. You might want to make
that happen as well.
------------------------------------------------------------------------
[2002-08-27 11:26:40] list@firehawksystems.com
I tried to build xmlrpc as a shared extension (phpize, ./configure,
make), but when it builds it didn't have dependences for libexpat and
libiconv, but the expat, libiconv and XMLRPC_ functions are undefined.
While trying to fix this I rewrote the config.m4 to handle all the
following build cases:
1) built-in to PHP with libxmlrpc included from extension directory
--with-xmlrpc
2) built-in to PHP with shared libxmlrpc
--with-xmlrpc --with-libxmlrpc=/usr/local
3) built shared with libxmlrpc included from extension directory
--with-xmlrpc=shared
4) built shared with shared libxmlrpc
--with-xmlrpc=shared --with-libxmlrpc=/usr/local
There is one part I don't like and that is the new option of
--with-libxmlrpc is only used in a state where it is not equal to 'yes'
or 'no'. It would have a directory value, but I don't like how it I
did it.
Is this the best way to handle it? Comments?
For the new config.m4 to work, xmlrpc-epi-php.c needs this changed:
#ifndef PHP_WIN32
#include "php_config.h"
#endif
to:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
Also what does PHP_FAST_OUTPUT do?
Thanks,
Brian
------
sinclude(ext/xmlrpc/libxmlrpc/acinclude.m4)
sinclude(ext/xmlrpc/libxmlrpc/xmlrpc.m4)
sinclude(libxmlrpc/acinclude.m4)
sinclude(libxmlrpc/xmlrpc.m4)
PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support,
[ --with-xmlrpc Include XMLRPC-EPI support.])
PHP_ARG_WITH(libxmlrpc, Use shared libxmlrpc for XMLRPC-EPI,
[ --with-libxmlrpc[=DIR] Will build and include the local copy of
XMLRPC-EPI,
unless the DIR is set. ])
PHP_ARG_WITH(expat-dir, libexpat dir for XMLRPC-EPI,
[ --with-expat-dir=DIR XMLRPC-EPI: libexpat dir for
XMLRPC-EPI.])
if test "$PHP_XMLRPC" != "no"; then
PHP_EXTENSION(xmlrpc, $ext_shared)
PHP_SUBST(XMLRPC_SHARED_LIBADD)
if test "$PHP_LIBXMLRPC" = "no" || test "$PHP_LIBXMLRPC" =
"yes";
then
XMLRPC_CHECKS
XMLRPC_SHARED_LIBADD=libxmlrpc/libxmlrpc.la
XMLRPC_LIBADD=libxmlrpc/libxmlrpc.la
XMLRPC_SUBDIRS=libxmlrpc
PHP_SUBST(XMLRPC_LIBADD)
PHP_SUBST(XMLRPC_SUBDIRS)
AC_DEFINE(HAVE_BUNDLED_XMLRPC, 1, [ ])
dnl PHP_FAST_OUTPUT($ext_builddir/libxmlrpc/Makefile)
LIB_BUILD($ext_builddir/libxmlrpc,$ext_shared,yes)
PHP_ADD_INCLUDE($ext_srcdir/libxmlrpc)
else
if test -r $PHP_XMLRPC/include/xmlrpc.h; then
XMLRPC_DIR=$PHP_XMLRPC
else
AC_MSG_CHECKING([for XMLRPC-EPI in default path])
for i in /usr/local /usr; do
if test -r $i/include/xmlrpc.h; then
XMLRPC_DIR=$i
AC_MSG_RESULT(found in $i)
fi
done
fi
if test -z "$XMLRPC_DIR"; then
AC_MSG_ERROR([XMLRPC-EPI not found, please reinstall the
XMLRPC-EPI distribution])
fi
PHP_ADD_INCLUDE($XMLRPC_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/lib,
XMLRPC_SHARED_LIBADD)
fi
PHP_SUBST(EXPAT_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
for i in $PHP_XML $PHP_EXPAT_DIR; do
if test -f $i/lib/libexpat.a -o -f
$i/lib/libexpat.$SHLIB_SUFFIX_NAME ; then
EXPAT_DIR=$i
fi
done
if test -z "$EXPAT_DIR"; then
AC_MSG_ERROR(not found. Please reinstall the expat
distribution.)
fi
PHP_ADD_INCLUDE($EXPAT_DIR/include)
PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/lib,
XMLRPC_SHARED_LIBADD)
if test "$PHP_ICONV" = "no"; then
PHP_ICONV=yes
fi
PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [
AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need
the iconv library])
])
AC_DEFINE(HAVE_XMLRPC, 1, [ ])
fi
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=19124&edit=1