com php-src: ext/xml: Use PKG_CHECK_MODULES to detect the Expat library: UPGRADING ext/xml/config.m4
| From: | Nikita Popov | Date: | Mon, 27 May 2019 13:16:42 +0000 |
| Subject: | com php-src: ext/xml: Use PKG_CHECK_MODULES to detect the Expat library: UPGRADING ext/xml/config.m4 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-106338@lists.php.net to get a copy of this message | ||
Commit: a8f4e8fe7349f64c42bfb961de46bf66d7b1a96e
Author: Hugh McMaster <hugh.mcmaster@outlook.com> Sun, 26 May 2019 19:30:54 +1000
Committer: Nikita Popov <nikita.ppv@gmail.com> Mon, 27 May 2019 15:16:42 +0200
Parents: 62ded6efbcb41e24a505117f8de5b70d56a98f57
Branches: PHP-7.4 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a8f4e8fe7349f64c42bfb961de46bf66d7b1a96e
Log:
ext/xml: Use PKG_CHECK_MODULES to detect the Expat library
Changed paths:
M UPGRADING
M ext/xml/config.m4
Diff:
diff --git a/UPGRADING b/UPGRADING
index 20a0348..058a5d0 100644
--- a/UPGRADING
+++ b/UPGRADING
@@ -545,6 +545,8 @@ The following extensions and SAPIs are affected:
- Libxml:
. --with-libxml-dir has been removed.
. --enable-libxml becomes --with-libxml.
+ . --with-libexpat-dir has been renamed to --with-expat and no longer
+ accepts a directory.
- LiteSpeed:
. --with-litespeed becomes --enable-litespeed.
diff --git a/ext/xml/config.m4 b/ext/xml/config.m4
index 24cf7fe..8389722 100644
--- a/ext/xml/config.m4
+++ b/ext/xml/config.m4
@@ -4,19 +4,19 @@ PHP_ARG_ENABLE([xml],
[Disable XML support])],
[yes])
-PHP_ARG_WITH([libexpat-dir],
- [libexpat install dir],
- [AS_HELP_STRING([--with-libexpat-dir=DIR],
- [XML: libexpat install prefix (deprecated)])],
+PHP_ARG_WITH([expat],
+ [whether to build with expat support],
+ [AS_HELP_STRING([--with-expat],
+ [XML: use expat instead of libxml2])],
[no],
[no])
if test "$PHP_XML" != "no"; then
dnl
- dnl Default to libxml2 if --with-libexpat-dir is not used.
+ dnl Default to libxml2 if --with-expat is not specified.
dnl
- if test "$PHP_LIBEXPAT_DIR" = "no"; then
+ if test "$PHP_EXPAT" = "no"; then
if test "$PHP_LIBXML" = "no"; then
AC_MSG_ERROR([XML extension requires LIBXML extension, add --with-libxml])
@@ -26,25 +26,12 @@ if test "$PHP_XML" != "no"; then
xml_extra_sources="compat.c"
PHP_ADD_EXTENSION_DEP(xml, libxml)
])
- fi
+ else
+ PKG_CHECK_MODULES([EXPAT], [expat])
- dnl
- dnl Check for expat only if --with-libexpat-dir is used.
- dnl
- if test "$PHP_LIBEXPAT_DIR" != "no"; then
- for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do
- if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f
"$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then
- EXPAT_DIR=$i
- break
- fi
- done
-
- if test -z "$EXPAT_DIR"; then
- AC_MSG_ERROR([not found. Please reinstall the expat distribution.])
- fi
+ PHP_EVAL_INCLINE($EXPAT_CFLAGS)
+ PHP_EVAL_LIBLINE($EXPAT_LIBS, XML_SHARED_LIBADD)
- PHP_ADD_INCLUDE($EXPAT_DIR/include)
- PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, XML_SHARED_LIBADD)
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
fi