mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Autotools: Fix xml extension dependency (#15162)
The PHP_ADD_EXTENSION_DEP Autoconf macro needs to be called after PHP_NEW_EXTENSION to be fully effective. This simplifies the code and checks. Also, due to the current order_by_dep.awk script implementation it needs to be on its own line with arguments unquoted so that awk can parse the config.m4 file. Until order_by_dep.awk script is fixed.
This commit is contained in:
parent
0970fd439a
commit
8356dadb59
1 changed files with 10 additions and 18 deletions
|
@ -5,35 +5,27 @@ PHP_ARG_ENABLE([xml],
|
||||||
[yes])
|
[yes])
|
||||||
|
|
||||||
PHP_ARG_WITH([expat],
|
PHP_ARG_WITH([expat],
|
||||||
[whether to build with expat support],
|
[whether to build with Expat support],
|
||||||
[AS_HELP_STRING([--with-expat],
|
[AS_HELP_STRING([--with-expat],
|
||||||
[XML: use expat instead of libxml2])],
|
[XML: use Expat library instead of libxml2 in the xml extension])],
|
||||||
[no],
|
[no],
|
||||||
[no])
|
[no])
|
||||||
|
|
||||||
if test "$PHP_XML" != "no"; then
|
if test "$PHP_XML" != "no"; then
|
||||||
|
|
||||||
dnl
|
|
||||||
dnl Default to libxml2 if --with-expat is not specified.
|
dnl Default to libxml2 if --with-expat is not specified.
|
||||||
dnl
|
AS_VAR_IF([PHP_EXPAT], [no],
|
||||||
if test "$PHP_EXPAT" = "no"; then
|
[PHP_SETUP_LIBXML([XML_SHARED_LIBADD], [xml_extra_sources="compat.c"])],
|
||||||
|
[PHP_SETUP_EXPAT([XML_SHARED_LIBADD])])
|
||||||
if test "$PHP_LIBXML" = "no"; then
|
|
||||||
AC_MSG_ERROR([XML extension requires LIBXML extension, add --with-libxml])
|
|
||||||
fi
|
|
||||||
|
|
||||||
PHP_SETUP_LIBXML([XML_SHARED_LIBADD], [
|
|
||||||
xml_extra_sources="compat.c"
|
|
||||||
PHP_ADD_EXTENSION_DEP(xml, libxml)
|
|
||||||
])
|
|
||||||
else
|
|
||||||
PHP_SETUP_EXPAT([XML_SHARED_LIBADD])
|
|
||||||
fi
|
|
||||||
|
|
||||||
PHP_NEW_EXTENSION([xml],
|
PHP_NEW_EXTENSION([xml],
|
||||||
[xml.c $xml_extra_sources],
|
[xml.c $xml_extra_sources],
|
||||||
[$ext_shared],,
|
[$ext_shared],,
|
||||||
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
|
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
|
||||||
|
|
||||||
|
AS_VAR_IF([PHP_EXPAT], [no], [
|
||||||
|
PHP_ADD_EXTENSION_DEP(xml, libxml)
|
||||||
|
])
|
||||||
|
|
||||||
PHP_SUBST([XML_SHARED_LIBADD])
|
PHP_SUBST([XML_SHARED_LIBADD])
|
||||||
PHP_INSTALL_HEADERS([ext/xml], [expat_compat.h php_xml.h])
|
PHP_INSTALL_HEADERS([ext/xml], [expat_compat.h php_xml.h])
|
||||||
AC_DEFINE([HAVE_XML], [1], [Define to 1 if xml extension is available.])
|
AC_DEFINE([HAVE_XML], [1], [Define to 1 if xml extension is available.])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue