xref: /PHP-8.3/ext/xsl/config.w32 (revision 37c329d7)
1// vim: ft=javascript
2
3ARG_WITH("xsl", "xsl support", "no");
4
5if (PHP_XSL != "no") {
6	if (PHP_DOM == "yes" && PHP_LIBXML == "yes"
7	&& ADD_EXTENSION_DEP('xsl', 'libxml')
8	&& ADD_EXTENSION_DEP('xsl', 'dom')
9	&& CHECK_HEADER_ADD_INCLUDE("libxml/tree.h", "CFLAGS_XSL", PHP_PHP_BUILD + "\\include\\libxml2")
10	) {
11		var ext_xsl_lib_found = false;
12		var ext_exslt_lib_found = false;
13
14		if (CHECK_LIB("libxslt_a.lib", "xsl", PHP_XSL)) {
15			ext_xsl_lib_found = true;
16			ADD_FLAG("CFLAGS_XSL", "/D LIBXSLT_STATIC ");
17			if (CHECK_LIB("libexslt_a.lib", "xsl", PHP_XSL)) {
18				ADD_FLAG("CFLAGS_XSL", "/D LIBEXSLT_STATIC ");
19				ext_exslt_lib_found = true;
20			}
21		} else if (CHECK_LIB("libxslt.lib", "xsl", PHP_XSL)) {
22			ext_xsl_lib_found = true;
23			if (CHECK_LIB("libexslt.lib", "xsl", PHP_XSL)) {
24				ext_exslt_lib_found = true;
25			}
26		}
27
28		if (ext_xsl_lib_found && CHECK_HEADER_ADD_INCLUDE("libxslt\\xslt.h", "CFLAGS_XSL")) {
29			if (ext_exslt_lib_found) {
30				if (CHECK_HEADER_ADD_INCLUDE("libexslt\\exslt.h", "CFLAGS_XSL")) {
31					AC_DEFINE("HAVE_XSL_EXSLT", 1, "");
32				}
33			}
34			EXTENSION("xsl", "php_xsl.c xsltprocessor.c", PHP_XSL_SHARED);
35			AC_DEFINE("HAVE_XSL", 1, "Define if xsl extension is enabled");
36			if (! PHP_XSL_SHARED) {
37				ADD_FLAG("CFLAGS_XSL", "/D DOM_EXPORTS /D LIBXML_STATIC");
38			} else {
39				if (PHP_DEBUG == "yes") {
40					ADD_FLAG("LDFLAGS_XSL", "/nodefaultlib:msvcrt");
41				}
42			}
43
44		} else {
45			WARNING("xsl not enabled; libraries and headers not found");
46		}
47	} else {
48		WARNING("xsl not enabled; DOM extension required");
49	}
50}
51