Skip to content

Commit dab706e

Browse files
author
foobar
committed
- Go back to using --disable-xml and --enable-xml
. Require use of --with-libxml-dir and --with-libexpat-dir for ext/xml. Allows other extensions to use --with-expat-dir for now. # still defaults to libxml if --with-libxml-dir and --with-libexpat-dir # are not used.
1 parent daded6e commit dab706e

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

ext/xml/config.m4

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,32 @@ dnl
22
dnl $Id$
33
dnl
44

5-
PHP_ARG_WITH(xml,whether to enable XML support,
6-
[ --without-xml Disable XML support. Requires libxml2.], yes)
5+
PHP_ARG_ENABLE(xml,whether to enable XML support,
6+
[ --disable-xml Disable XML support. Requires libxml2.], yes)
77

88
PHP_ARG_WITH(libxml-dir, libxml install dir,
9-
[ --with-libxml-dir=DIR XML: libxml install prefix], no, no)
9+
[ --with-libxml-dir=DIR XML: libxml install prefix], no, no)
1010

11-
PHP_ARG_WITH(expat-dir, libexpat install dir,
12-
[ --with-expat-dir=DIR XML: libexpat install prefix (deprecated)], no, no)
11+
PHP_ARG_WITH(libexpat-dir, libexpat install dir,
12+
[ --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)], no, no)
1313

1414
if test "$PHP_XML" != "no"; then
15-
16-
if test "$PHP_XML" != "yes" && test -n "$PHP_LIBXML_DIR"; then
17-
PHP_LIBXML_DIR=$PHP_XML
18-
fi
19-
15+
dnl
16+
dnl Default to libxml2.
17+
dnl
2018
PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [
21-
xml_sources="xml.c compat.c"
19+
xml_extra_sources="compat.c"
2220
], [
2321
if test "$PHP_EXPAT_DIR" = "no"; then
2422
AC_MSG_ERROR(xml2-config not found. Use --with-libxml-dir=<DIR>)
2523
fi
2624
])
2725

28-
if test "$PHP_EXPAT_DIR" != "no"; then
29-
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
30-
xml_sources="xml.c"
31-
32-
for i in $PHP_XML $PHP_EXPAT_DIR; do
26+
dnl
27+
dnl Check for expat only if --with-libexpat-dir is used.
28+
dnl
29+
if test "$PHP_LIBEXPAT_DIR" != "no"; then
30+
for i in $PHP_XML $PHP_LIBEXPAT_DIR; do
3331
if test -f "$i/lib/libexpat.a" -o -f "$i/lib/libexpat.$SHLIB_SUFFIX_NAME"; then
3432
EXPAT_DIR=$i
3533
fi
@@ -41,9 +39,10 @@ if test "$PHP_XML" != "no"; then
4139

4240
PHP_ADD_INCLUDE($EXPAT_DIR/include)
4341
PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/lib, XML_SHARED_LIBADD)
42+
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
4443
fi
4544

46-
PHP_NEW_EXTENSION(xml, $xml_sources, $ext_shared)
45+
PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared)
4746
PHP_SUBST(XML_SHARED_LIBADD)
4847
AC_DEFINE(HAVE_XML, 1, [ ])
4948
fi

0 commit comments

Comments
 (0)