config.m4 1.9 KB

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