config.m4 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. dnl
  2. dnl $Id$
  3. dnl
  4. sinclude(ext/xmlrpc/libxmlrpc/acinclude.m4)
  5. sinclude(ext/xmlrpc/libxmlrpc/xmlrpc.m4)
  6. sinclude(libxmlrpc/acinclude.m4)
  7. sinclude(libxmlrpc/xmlrpc.m4)
  8. PHP_ARG_WITH(xmlrpc, for XMLRPC-EPI support,
  9. [ --with-xmlrpc[=DIR] Include XMLRPC-EPI support])
  10. if test -z "$PHP_LIBXML_DIR"; then
  11. PHP_ARG_WITH(libxml-dir, libxml2 install dir,
  12. [ --with-libxml-dir=DIR XMLRPC-EPI: libxml2 install prefix], no, no)
  13. fi
  14. PHP_ARG_WITH(libexpat-dir, libexpat dir for XMLRPC-EPI,
  15. [ --with-libexpat-dir=DIR XMLRPC-EPI: libexpat dir for XMLRPC-EPI (deprecated)],no,no)
  16. PHP_ARG_WITH(iconv-dir, iconv dir for XMLRPC-EPI,
  17. [ --with-iconv-dir=DIR XMLRPC-EPI: iconv dir for XMLRPC-EPI],no,no)
  18. if test "$PHP_XMLRPC" != "no"; then
  19. PHP_ADD_EXTENSION_DEP(xmlrpc, libxml)
  20. PHP_SUBST(XMLRPC_SHARED_LIBADD)
  21. AC_DEFINE(HAVE_XMLRPC,1,[ ])
  22. dnl
  23. dnl Default to libxml2 if --with-libexpat-dir is not used
  24. dnl
  25. if test "$PHP_LIBEXPAT_DIR" = "no"; then
  26. if test "$PHP_LIBXML" = "no"; then
  27. AC_MSG_ERROR([XML-RPC extension requires LIBXML extension, add --enable-libxml])
  28. fi
  29. PHP_SETUP_LIBXML(XMLRPC_SHARED_LIBADD, [
  30. if test "$PHP_XML" = "no"; then
  31. PHP_ADD_SOURCES(ext/xml, compat.c)
  32. PHP_ADD_BUILD_DIR(ext/xml)
  33. fi
  34. ], [
  35. AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=<DIR>])
  36. ])
  37. else
  38. testval=no
  39. for i in $PHP_LIBEXPAT_DIR $XMLRPC_DIR /usr/local /usr; do
  40. if test -f $i/$PHP_LIBDIR/libexpat.a || test -f $i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME; then
  41. AC_DEFINE(HAVE_LIBEXPAT,1,[ ])
  42. PHP_ADD_LIBRARY_WITH_PATH(expat, $i/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD)
  43. PHP_ADD_INCLUDE($i/include)
  44. testval=yes
  45. break
  46. fi
  47. done
  48. if test "$testval" = "no"; then
  49. AC_MSG_ERROR([XML-RPC support requires libexpat. Use --with-libexpat-dir=<DIR> (deprecated!)])
  50. fi
  51. fi
  52. dnl if iconv is shared or missing then we should build iconv ourselves
  53. if test "$PHP_ICONV_SHARED" = "yes" || test "$PHP_ICONV" = "no"; then
  54. if test "$PHP_ICONV_DIR" != "no"; then
  55. PHP_ICONV=$PHP_ICONV_DIR
  56. fi
  57. if test -z "$PHP_ICONV" || test "$PHP_ICONV" = "no"; then
  58. PHP_ICONV=yes
  59. fi
  60. PHP_SETUP_ICONV(XMLRPC_SHARED_LIBADD, [], [
  61. AC_MSG_ERROR([iconv not found, in order to build xmlrpc you need the iconv library])
  62. ])
  63. fi
  64. fi
  65. if test "$PHP_XMLRPC" = "yes"; then
  66. XMLRPC_CHECKS
  67. PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c libxmlrpc/base64.c \
  68. libxmlrpc/simplestring.c libxmlrpc/xml_to_dandarpc.c \
  69. libxmlrpc/xmlrpc_introspection.c libxmlrpc/encodings.c \
  70. libxmlrpc/system_methods.c libxmlrpc/xml_to_xmlrpc.c \
  71. libxmlrpc/queue.c libxmlrpc/xml_element.c libxmlrpc/xmlrpc.c \
  72. libxmlrpc/xml_to_soap.c,$ext_shared,,
  73. -I@ext_srcdir@/libxmlrpc -DVERSION="0.50")
  74. PHP_ADD_BUILD_DIR($ext_builddir/libxmlrpc)
  75. XMLRPC_MODULE_TYPE=builtin
  76. elif test "$PHP_XMLRPC" != "no"; then
  77. if test -r $PHP_XMLRPC/include/xmlrpc.h; then
  78. XMLRPC_DIR=$PHP_XMLRPC/include
  79. elif test -r $PHP_XMLRPC/include/xmlrpc-epi/xmlrpc.h; then
  80. dnl some xmlrpc-epi header files have generic file names like
  81. dnl queue.h or base64.h. Distributions have to create dir
  82. dnl for xmlrpc-epi because of this.
  83. XMLRPC_DIR=$PHP_XMLRPC/include/xmlrpc-epi
  84. else
  85. AC_MSG_CHECKING(for XMLRPC-EPI in default path)
  86. for i in /usr/local /usr; do
  87. if test -r $i/include/xmlrpc.h; then
  88. XMLRPC_DIR=$i/include
  89. AC_MSG_RESULT(found in $i)
  90. break
  91. fi
  92. done
  93. fi
  94. if test -z "$XMLRPC_DIR"; then
  95. AC_MSG_RESULT(not found)
  96. AC_MSG_ERROR(Please reinstall the XMLRPC-EPI distribution)
  97. fi
  98. PHP_ADD_INCLUDE($XMLRPC_DIR)
  99. PHP_ADD_LIBRARY_WITH_PATH(xmlrpc, $XMLRPC_DIR/$PHP_LIBDIR, XMLRPC_SHARED_LIBADD)
  100. PHP_NEW_EXTENSION(xmlrpc,xmlrpc-epi-php.c, $ext_shared)
  101. XMLRPC_MODULE_TYPE=external
  102. fi