config.m4 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. dnl
  2. dnl $Id$
  3. dnl
  4. PHP_ARG_ENABLE(wddx,whether to enable WDDX support,
  5. [ --enable-wddx Enable WDDX support])
  6. if test -z "$PHP_LIBXML_DIR"; then
  7. PHP_ARG_WITH(libxml-dir, libxml2 install dir,
  8. [ --with-libxml-dir=DIR WDDX: libxml2 install prefix], no, no)
  9. fi
  10. PHP_ARG_WITH(libexpat-dir, libexpat dir for WDDX,
  11. [ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)],no,no)
  12. if test "$PHP_WDDX" != "no"; then
  13. dnl
  14. dnl Default to libxml2 if --with-libexpat-dir is not used
  15. dnl
  16. if test "$PHP_LIBEXPAT_DIR" = "no"; then
  17. if test "$PHP_LIBXML" = "no"; then
  18. AC_MSG_ERROR([WDDX extension requires LIBXML extension, add --enable-libxml])
  19. fi
  20. PHP_SETUP_LIBXML(WDDX_SHARED_LIBADD, [
  21. if test "$PHP_XML" = "no"; then
  22. PHP_ADD_SOURCES(ext/xml, compat.c)
  23. PHP_ADD_BUILD_DIR(ext/xml)
  24. fi
  25. ], [
  26. AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=<DIR>])
  27. ])
  28. fi
  29. dnl
  30. dnl Check for expat only if --with-libexpat-dir is used.
  31. dnl
  32. if test "$PHP_LIBEXPAT_DIR" != "no"; then
  33. for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do
  34. if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then
  35. EXPAT_DIR=$i
  36. break
  37. fi
  38. done
  39. if test -z "$EXPAT_DIR"; then
  40. AC_MSG_ERROR([not found. Please reinstall the expat distribution.])
  41. fi
  42. PHP_ADD_INCLUDE($EXPAT_DIR/include)
  43. PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, WDDX_SHARED_LIBADD)
  44. AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
  45. fi
  46. AC_DEFINE(HAVE_WDDX, 1, [ ])
  47. PHP_NEW_EXTENSION(wddx, wddx.c, $ext_shared)
  48. PHP_ADD_EXTENSION_DEP(wddx, libxml)
  49. PHP_SUBST(XMLRPC_SHARED_LIBADD)
  50. fi