xref: /PHP-8.0/ext/xml/config.m4 (revision 32114b57)
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 instead of libxml2])],
11  [no],
12  [no])
13
14if test "$PHP_XML" != "no"; then
15
16  dnl
17  dnl Default to libxml2 if --with-expat is not specified.
18  dnl
19  if test "$PHP_EXPAT" = "no"; then
20
21    if test "$PHP_LIBXML" = "no"; then
22      AC_MSG_ERROR([XML extension requires LIBXML extension, add --with-libxml])
23    fi
24
25    PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [
26      xml_extra_sources="compat.c"
27      PHP_ADD_EXTENSION_DEP(xml, libxml)
28    ])
29  else
30    PHP_SETUP_EXPAT([XML_SHARED_LIBADD])
31  fi
32
33  PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
34  PHP_SUBST(XML_SHARED_LIBADD)
35  PHP_INSTALL_HEADERS([ext/xml/])
36  AC_DEFINE(HAVE_XML, 1, [ ])
37fi
38