xref: /php-src/ext/libxml/config.w32 (revision dc8f18af)
1// vim:ft=javascript
2
3ARG_WITH("libxml", "LibXML support", "yes");
4
5if (PHP_LIBXML == "yes") {
6	if (CHECK_LIB("libxml2_a_dll.lib;libxml2_a.lib", "libxml") &&
7			CHECK_LIB("libiconv_a.lib;iconv_a.lib;libiconv.lib;iconv.lib", "libxml") &&
8			CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2") &&
9			CHECK_HEADER_ADD_INCLUDE("libxml/tree.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2") &&
10			ADD_EXTENSION_DEP('libxml', 'iconv')) {
11
12		if (GREP_HEADER("libxml/xmlversion.h", "#define\\s+LIBXML_VERSION\\s+(\\d+)", PHP_PHP_BUILD + "\\include\\libxml2") &&
13				+RegExp.$1 >= 20904) {
14
15			EXTENSION("libxml", "libxml.c mime_sniff.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
16			AC_DEFINE("HAVE_LIBXML", 1, "Define to 1 if the PHP extension 'libxml' is available.");
17			ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS ");
18			if (!PHP_LIBXML_SHARED) {
19				ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
20			}
21			PHP_INSTALL_HEADERS("ext/libxml", "php_libxml.h");
22		} else {
23			WARNING("libxml support can't be enabled, libxml version >= 2.9.4 required");
24		}
25	} else {
26		WARNING("libxml support can't be enabled, iconv or libxml are missing")
27		PHP_LIBXML = "no"
28	}
29}
30