xref: /PHP-7.3/ext/xsl/config.m4 (revision 902d39a3)
1dnl config.m4 for extension xsl
2
3PHP_ARG_WITH(xsl, for XSL support,
4[  --with-xsl[=DIR]          Include XSL support.  DIR is the libxslt base
5                          install directory (libxslt >= 1.1.0 required)])
6
7if test "$PHP_XSL" != "no"; then
8
9  if test "$PHP_LIBXML" = "no"; then
10    AC_MSG_ERROR([XSL extension requires LIBXML extension, add --enable-libxml])
11  fi
12
13  if test "$PHP_DOM" = "no"; then
14    AC_MSG_ERROR([XSL extension requires DOM extension, add --enable-dom])
15  fi
16
17  for i in $PHP_XSL /usr/local /usr; do
18    if test -x "$i/bin/xslt-config"; then
19      XSLT_CONFIG=$i/bin/xslt-config
20      break
21    fi
22  done
23
24  if test -z "$XSLT_CONFIG"; then
25    AC_MSG_ERROR([xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution])
26  else
27    libxslt_full_version=`$XSLT_CONFIG --version`
28    ac_IFS=$IFS
29    IFS="."
30    set $libxslt_full_version
31    IFS=$ac_IFS
32    LIBXSLT_VERSION=`expr [$]1 \* 1000000 + [$]2 \* 1000 + [$]3`
33    if test "$LIBXSLT_VERSION" -ge "1001000"; then
34      XSL_LIBS=`$XSLT_CONFIG --libs`
35      XSL_INCS=`$XSLT_CONFIG --cflags`
36      PHP_EVAL_LIBLINE($XSL_LIBS, XSL_SHARED_LIBADD)
37      PHP_EVAL_INCLINE($XSL_INCS)
38
39      AC_MSG_CHECKING([for EXSLT support])
40      for i in $PHP_XSL /usr/local /usr; do
41        if test -r "$i/include/libexslt/exslt.h"; then
42          PHP_XSL_EXSL_DIR=$i
43          break
44        fi
45      done
46      if test -z "$PHP_XSL_EXSL_DIR"; then
47        AC_MSG_RESULT(not found)
48      else
49        AC_MSG_RESULT(found)
50        PHP_ADD_LIBRARY_WITH_PATH(exslt, $PHP_XSL_EXSL_DIR/$PHP_LIBDIR, XSL_SHARED_LIBADD)
51        PHP_ADD_INCLUDE($PHP_XSL_EXSL_DIR/include)
52        AC_DEFINE(HAVE_XSL_EXSLT,1,[ ])
53      fi
54    else
55      AC_MSG_ERROR([libxslt version 1.1.0 or greater required.])
56    fi
57
58
59  fi
60
61  AC_DEFINE(HAVE_XSL,1,[ ])
62  PHP_NEW_EXTENSION(xsl, php_xsl.c xsltprocessor.c, $ext_shared)
63  PHP_SUBST(XSL_SHARED_LIBADD)
64  PHP_ADD_EXTENSION_DEP(xsl, libxml)
65fi
66