Skip to content

Autotools: Fix xml extension dependency #15162

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions ext/xml/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,27 @@ PHP_ARG_ENABLE([xml],
[yes])

PHP_ARG_WITH([expat],
[whether to build with expat support],
[whether to build with Expat support],
[AS_HELP_STRING([--with-expat],
[XML: use expat instead of libxml2])],
[XML: use Expat library instead of libxml2 in the xml extension])],
[no],
[no])

if test "$PHP_XML" != "no"; then

dnl
dnl Default to libxml2 if --with-expat is not specified.
dnl
if test "$PHP_EXPAT" = "no"; then

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
AS_VAR_IF([PHP_EXPAT], [no],
[PHP_SETUP_LIBXML([XML_SHARED_LIBADD], [xml_extra_sources="compat.c"])],
[PHP_SETUP_EXPAT([XML_SHARED_LIBADD])])

PHP_NEW_EXTENSION([xml],
[xml.c $xml_extra_sources],
[$ext_shared],,
[-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])

AS_VAR_IF([PHP_EXPAT], [no], [
PHP_ADD_EXTENSION_DEP(xml, libxml)
])

PHP_SUBST([XML_SHARED_LIBADD])
PHP_INSTALL_HEADERS([ext/xml], [expat_compat.h php_xml.h])
AC_DEFINE([HAVE_XML], [1], [Define to 1 if xml extension is available.])
Expand Down
Loading