2001-12-01 03:00:13 +08:00
|
|
|
dnl
|
|
|
|
dnl $Id$
|
|
|
|
dnl
|
1999-04-22 10:48:28 +08:00
|
|
|
|
2003-05-20 08:20:29 +08:00
|
|
|
PHP_ARG_ENABLE(xml,whether to enable XML support,
|
2005-05-30 07:17:16 +08:00
|
|
|
[ --disable-xml Disable XML support], yes)
|
2003-05-19 23:33:19 +08:00
|
|
|
|
2003-07-01 01:23:52 +08:00
|
|
|
if test -z "$PHP_LIBXML_DIR"; then
|
|
|
|
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
|
2013-08-07 02:06:09 +08:00
|
|
|
[ --with-libxml-dir=DIR XML: libxml2 install prefix], no, no)
|
2003-07-01 01:23:52 +08:00
|
|
|
fi
|
2003-05-19 23:33:19 +08:00
|
|
|
|
2003-05-20 08:20:29 +08:00
|
|
|
PHP_ARG_WITH(libexpat-dir, libexpat install dir,
|
2013-08-07 02:06:09 +08:00
|
|
|
[ --with-libexpat-dir=DIR XML: libexpat install prefix (deprecated)], no, no)
|
2003-05-19 23:33:19 +08:00
|
|
|
|
2005-04-27 21:12:55 +08:00
|
|
|
if test "$PHP_XML" != "no"; then
|
|
|
|
|
2003-05-20 08:20:29 +08:00
|
|
|
dnl
|
2005-04-27 21:12:55 +08:00
|
|
|
dnl Default to libxml2 if --with-libexpat-dir is not used.
|
2003-05-20 08:20:29 +08:00
|
|
|
dnl
|
2005-04-27 21:12:55 +08:00
|
|
|
if test "$PHP_LIBEXPAT_DIR" = "no"; then
|
|
|
|
|
|
|
|
if test "$PHP_LIBXML" = "no"; then
|
|
|
|
AC_MSG_ERROR([XML extension requires LIBXML extension, add --enable-libxml])
|
2003-05-20 05:50:23 +08:00
|
|
|
fi
|
2005-04-27 21:12:55 +08:00
|
|
|
|
|
|
|
PHP_SETUP_LIBXML(XML_SHARED_LIBADD, [
|
|
|
|
xml_extra_sources="compat.c"
|
2005-05-07 10:51:53 +08:00
|
|
|
PHP_ADD_EXTENSION_DEP(xml, libxml)
|
2005-04-27 21:12:55 +08:00
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=<DIR>])
|
|
|
|
])
|
|
|
|
fi
|
2003-11-13 07:42:38 +08:00
|
|
|
|
2003-05-20 08:20:29 +08:00
|
|
|
dnl
|
|
|
|
dnl Check for expat only if --with-libexpat-dir is used.
|
|
|
|
dnl
|
|
|
|
if test "$PHP_LIBEXPAT_DIR" != "no"; then
|
2005-12-22 16:57:50 +08:00
|
|
|
for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do
|
2005-04-27 21:12:55 +08:00
|
|
|
if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then
|
2003-05-19 23:33:19 +08:00
|
|
|
EXPAT_DIR=$i
|
2003-07-01 01:23:52 +08:00
|
|
|
break
|
2003-05-19 23:33:19 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
if test -z "$EXPAT_DIR"; then
|
2005-04-27 21:12:55 +08:00
|
|
|
AC_MSG_ERROR([not found. Please reinstall the expat distribution.])
|
2003-05-19 23:33:19 +08:00
|
|
|
fi
|
2001-01-05 14:36:51 +08:00
|
|
|
|
2003-05-19 23:33:19 +08:00
|
|
|
PHP_ADD_INCLUDE($EXPAT_DIR/include)
|
2004-11-03 22:32:52 +08:00
|
|
|
PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, XML_SHARED_LIBADD)
|
2003-05-20 08:20:29 +08:00
|
|
|
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
|
2003-05-19 23:33:19 +08:00
|
|
|
fi
|
2003-05-02 12:02:27 +08:00
|
|
|
|
2003-05-20 08:20:29 +08:00
|
|
|
PHP_NEW_EXTENSION(xml, xml.c $xml_extra_sources, $ext_shared)
|
2003-05-19 23:33:19 +08:00
|
|
|
PHP_SUBST(XML_SHARED_LIBADD)
|
2005-06-20 08:52:59 +08:00
|
|
|
PHP_INSTALL_HEADERS([ext/xml/])
|
2003-05-19 23:33:19 +08:00
|
|
|
AC_DEFINE(HAVE_XML, 1, [ ])
|
2001-06-03 21:59:21 +08:00
|
|
|
fi
|