Skip to content

Commit 08218f5

Browse files
committed
Tweak xml related build.
Still some warnings for ext/xsl, but I'll leave that to someone else for now.
1 parent 7a9cf22 commit 08218f5

File tree

5 files changed

+22
-4
lines changed

5 files changed

+22
-4
lines changed

ext/dom/config.w32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ if (PHP_DOM == "yes" && PHP_LIBXML == "yes") {
1313
notation.c xpath.c dom_iterators.c typeinfo.c domerror.c \
1414
domlocator.c namednodemap.c userdatahandler.c");
1515
AC_DEFINE("HAVE_DOM", 1, "DOM support");
16+
if (!PHP_DOM_SHARED) {
17+
ADD_FLAG("CFLAGS_DOM", "/D LIBXML_STATIC ");
18+
}
1619
}
1720

1821

ext/libxml/config.w32

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ if (PHP_LIBXML == "yes") {
1010

1111
EXTENSION("libxml", "libxml.c", false /* never shared */);
1212
AC_DEFINE("HAVE_LIBXML", 1, "LibXML support");
13-
ADD_FLAG("CFLAGS", "/D LIBXML_THREAD_ENABLED /D LIBXML_STATIC ");
13+
ADD_FLAG("CFLAGS", "/D LIBXML_THREAD_ENABLED");
14+
ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC ");
1415
if (!PHP_LIBXML_SHARED) {
1516
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
1617
}

ext/simplexml/config.w32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ARG_WITH("simplexml", "Simple XML support", "yes");
66
if (PHP_SIMPLEXML == "yes" && PHP_LIBXML == "yes") {
77
EXTENSION("simplexml", "simplexml.c");
88
AC_DEFINE("HAVE_SIMPLEXML", 1, "Simple XML support");
9+
if (!PHP_SIMPLEXML_SHARED) {
10+
ADD_FLAG("CFLAGS_SIMPLEXML", "/D LIBXML_STATIC");
11+
}
912
}
1013

1114

ext/xml/config.w32

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ ARG_WITH("xml", "XML support", "yes");
66
if (PHP_XML == "yes" && PHP_LIBXML == "yes") {
77
EXTENSION("xml", "xml.c compat.c");
88
AC_DEFINE("HAVE_XML", 1, "XML support");
9+
if (!PHP_XML_SHARED) {
10+
ADD_FLAG("CFLAGS_XML", "/D LIBXML_STATIC ");
11+
}
912
}
1013

1114

ext/xsl/config.w32

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ ARG_WITH("xsl", "xsl support", "no");
55

66
if (PHP_XSL != "no") {
77
if (PHP_DOM == "yes" && PHP_LIBXML == "yes") {
8-
if (CHECK_LIB("libxslt_a.lib;libxslt.lib", "xsl", PHP_XSL) &&
9-
CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) {
8+
var ext_xsl_lib_found = false;
9+
10+
if (CHECK_LIB("libxslt_a.lib", "xsl", PHP_XSL)) {
11+
ADD_FLAG("CFLAGS_XSL", "/D LIBXSL_STATIC ");
12+
ext_xsl_lib_found = true;
13+
} else if (CHECK_LIB("libxslt.lib", "xsl", PHP_XSL)) {
14+
ext_xsl_lib_found = true;
15+
}
16+
17+
if (ext_xsl_lib_found && CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) {
1018

1119
EXTENSION("xsl", "php_xsl.c xsltprocessor.c", PHP_XSL_SHARED);
1220
AC_DEFINE("HAVE_XSL", 1, "Define if xsl extension is enabled");
1321
if (! PHP_XSL_SHARED) {
14-
ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS ");
22+
ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS /D LIBXML_STATIC");
1523
}
1624
} else {
1725
WARNING("xsl not enabled; libraries and headers not found");

0 commit comments

Comments
 (0)