config.m4 1.9 KB

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