Skip to content

Commit 64237c4

Browse files
author
foobar
committed
- Fix phpize build
1 parent 03c13dd commit 64237c4

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

ext/wddx/config.m4

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,56 @@ dnl
55
PHP_ARG_ENABLE(wddx,whether to enable WDDX support,
66
[ --enable-wddx Enable WDDX support])
77

8+
if test -z "$PHP_LIBXML_DIR"; then
9+
PHP_ARG_WITH(libxml-dir, libxml2 install dir,
10+
[ --with-libxml-dir=DIR WDDX: libxml2 install prefix], no, no)
11+
fi
12+
13+
PHP_ARG_WITH(libexpat-dir, libexpat dir for WDDX,
14+
[ --with-libexpat-dir=DIR WDDX: libexpat dir for XMLRPC-EPI (deprecated)],no,no)
15+
816
if test "$PHP_WDDX" != "no"; then
9-
if test "$ext_shared" != "yes" && (test "$enable_xml" = "no" || test "${enable_xml+set}" != "set"); then
10-
AC_MSG_WARN(Activating XML)
11-
enable_xml=yes
17+
18+
dnl
19+
dnl Default to libxml2 if --with-libexpat-dir is not used
20+
dnl
21+
if test "$PHP_LIBEXPAT_DIR" = "no"; then
22+
if test "$PHP_LIBXML" = "no"; then
23+
AC_MSG_ERROR([WDDX extension requires LIBXML extension, add --enable-libxml])
24+
fi
25+
26+
PHP_SETUP_LIBXML(WDDX_SHARED_LIBADD, [
27+
if test "$PHP_XML" = "no"; then
28+
PHP_ADD_SOURCES(ext/xml, compat.c)
29+
PHP_ADD_BUILD_DIR(ext/xml)
30+
fi
31+
], [
32+
AC_MSG_ERROR([xml2-config not found. Use --with-libxml-dir=<DIR>])
33+
])
1234
fi
35+
36+
dnl
37+
dnl Check for expat only if --with-libexpat-dir is used.
38+
dnl
39+
if test "$PHP_LIBEXPAT_DIR" != "no"; then
40+
for i in $PHP_XML $PHP_LIBEXPAT_DIR /usr /usr/local; do
41+
if test -f "$i/$PHP_LIBDIR/libexpat.a" || test -f "$i/$PHP_LIBDIR/libexpat.$SHLIB_SUFFIX_NAME"; then
42+
EXPAT_DIR=$i
43+
break
44+
fi
45+
done
46+
47+
if test -z "$EXPAT_DIR"; then
48+
AC_MSG_ERROR([not found. Please reinstall the expat distribution.])
49+
fi
50+
51+
PHP_ADD_INCLUDE($EXPAT_DIR/include)
52+
PHP_ADD_LIBRARY_WITH_PATH(expat, $EXPAT_DIR/$PHP_LIBDIR, WDDX_SHARED_LIBADD)
53+
AC_DEFINE(HAVE_LIBEXPAT, 1, [ ])
54+
fi
55+
1356
AC_DEFINE(HAVE_WDDX, 1, [ ])
1457
PHP_NEW_EXTENSION(wddx, wddx.c, $ext_shared)
58+
PHP_ADD_EXTENSION_DEP(wddx, libxml)
59+
PHP_SUBST(XMLRPC_SHARED_LIBADD)
1560
fi

0 commit comments

Comments
 (0)