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