22dnl $Id$
33dnl
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
88PHP_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
1414if 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 , [ ] )
4948fi
0 commit comments