xref: /php-src/ext/xml/config.m4 (revision f66feaec)
1PHP_ARG_ENABLE([xml],
2  [whether to enable XML support],
3  [AS_HELP_STRING([--disable-xml],
4    [Disable XML support])],
5  [yes])
6
7PHP_ARG_WITH([expat],
8  [whether to build with Expat support],
9  [AS_HELP_STRING([--with-expat],
10    [XML: use Expat library instead of libxml2 in the xml extension])],
11  [no],
12  [no])
13
14if test "$PHP_XML" != "no"; then
15  dnl Default to libxml2 if --with-expat is not specified.
16  AS_VAR_IF([PHP_EXPAT], [no],
17    [PHP_SETUP_LIBXML([XML_SHARED_LIBADD], [xml_extra_sources="compat.c"])],
18    [PHP_SETUP_EXPAT([XML_SHARED_LIBADD])])
19
20  PHP_NEW_EXTENSION([xml],
21    [xml.c $xml_extra_sources],
22    [$ext_shared],,
23    [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1])
24
25  AS_VAR_IF([PHP_EXPAT], [no], [
26    PHP_ADD_EXTENSION_DEP(xml, libxml)
27  ])
28
29  PHP_SUBST([XML_SHARED_LIBADD])
30  PHP_INSTALL_HEADERS([ext/xml], [expat_compat.h php_xml.h])
31  AC_DEFINE([HAVE_XML], [1],
32    [Define to 1 if the PHP extension 'xml' is available.])
33fi
34