summaryrefslogtreecommitdiff
path: root/ext/xsl
diff options
context:
space:
mode:
authorHugh McMaster <hugh.mcmaster@outlook.com>2019-06-06 21:19:19 +1000
committerNikita Popov <nikita.ppv@gmail.com>2019-06-07 09:35:12 +0200
commitab66179227dfce5c916592f47a66cd5f09e86359 (patch)
tree40baf049b5e431dba56764513ceb844c08e130d8 /ext/xsl
parent30a34eab814490e4926056d314a55b95ea9febad (diff)
downloadphp-git-ab66179227dfce5c916592f47a66cd5f09e86359.tar.gz
ext/xsl: Use PKG_CHECK_MODULES to detect the XSLT library
Diffstat (limited to 'ext/xsl')
-rw-r--r--ext/xsl/config.m460
1 files changed, 18 insertions, 42 deletions
diff --git a/ext/xsl/config.m4 b/ext/xsl/config.m4
index 26f6e10e6e..ab70ad6b87 100644
--- a/ext/xsl/config.m4
+++ b/ext/xsl/config.m4
@@ -1,8 +1,7 @@
PHP_ARG_WITH([xsl],
- [for XSL support],
- [AS_HELP_STRING([[--with-xsl[=DIR]]],
- [Include XSL support. DIR is the libxslt base install directory (libxslt >=
- 1.1.0 required)])])
+ [whether to build with XSL support],
+ [AS_HELP_STRING([--with-xsl],
+ [Build with XSL support])])
if test "$PHP_XSL" != "no"; then
@@ -14,48 +13,25 @@ if test "$PHP_XSL" != "no"; then
AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom])
fi
- for i in $PHP_XSL /usr/local /usr; do
- if test -x "$i/bin/xslt-config"; then
- XSLT_CONFIG=$i/bin/xslt-config
+ PKG_CHECK_MODULES([XSL], [libxslt >= 1.1.0])
+
+ PHP_EVAL_INCLINE($XSL_CFLAGS)
+ PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD)
+
+ AC_MSG_CHECKING([for EXSLT support])
+ for i in /usr/local /usr; do
+ if test -r "$i/include/libexslt/exslt.h"; then
+ PHP_XSL_EXSL_DIR=$i
break
fi
done
-
- if test -z "$XSLT_CONFIG"; then
- AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution])
+ if test -z "$PHP_XSL_EXSL_DIR"; then
+ AC_MSG_RESULT(not found)
else
- libxslt_full_version=`$XSLT_CONFIG --version`
- ac_IFS=$IFS
- IFS="."
- set $libxslt_full_version
- IFS=$ac_IFS
- LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
- if test "$LIBXSLT_VERSION" -ge "1001000"; then
- XSL_LIBS=`$XSLT_CONFIG --libs`
- XSL_INCS=`$XSLT_CONFIG --cflags`
- PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD)
- PHP_EVAL_INCLINE($XSL_INCS)
-
- AC_MSG_CHECKING([for EXSLT support])
- for i in $PHP_XSL /usr/local /usr; do
- if test -r "$i/include/libexslt/exslt.h"; then
- PHP_XSL_EXSL_DIR=$i
- break
- fi
- done
- if test -z "$PHP_XSL_EXSL_DIR"; then
- AC_MSG_RESULT(not found)
- else
- AC_MSG_RESULT(found)
- PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/$PHP_LIBDIR, XSL_SHARED_LIBADD)
- PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include)
- AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
- fi
- else
- AC_MSG_ERROR([libxslt version 1.1.0 or greater required.])
- fi
-
-
+ AC_MSG_RESULT(found)
+ PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/$PHP_LIBDIR, XSL_SHARED_LIBADD)
+ PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include)
+ AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
fi
AC_DEFINE(HAVE_XSL,1,[ ])