mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

This implements an SVG handler using the libxml reader API. This does not parse the entire document but instead uses a pull parser to locate the root element, check whether it's an svg root, do some extra sanity checks on the attribute, and fill in the php_gfxinfo structure.
28 lines
1.3 KiB
JavaScript
28 lines
1.3 KiB
JavaScript
// vim:ft=javascript
|
|
|
|
ARG_WITH("libxml", "LibXML support", "yes");
|
|
|
|
if (PHP_LIBXML == "yes") {
|
|
if (CHECK_LIB("libxml2_a_dll.lib;libxml2_a.lib", "libxml") &&
|
|
((PHP_ICONV != "no" && !PHP_ICONV_SHARED) || CHECK_LIB("libiconv_a.lib;iconv_a.lib;libiconv.lib;iconv.lib", "libxml")) &&
|
|
CHECK_HEADER_ADD_INCLUDE("libxml/parser.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2") &&
|
|
CHECK_HEADER_ADD_INCLUDE("libxml/tree.h", "CFLAGS_LIBXML", PHP_PHP_BUILD + "\\include\\libxml2")) {
|
|
|
|
if (GREP_HEADER("libxml/xmlversion.h", "#define\\s+LIBXML_VERSION\\s+(\\d+)", PHP_PHP_BUILD + "\\include\\libxml2") &&
|
|
+RegExp.$1 >= 20904) {
|
|
|
|
EXTENSION("libxml", "libxml.c mime_sniff.c image_svg.c", false /* never shared */, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
|
AC_DEFINE("HAVE_LIBXML", 1, "Define to 1 if the PHP extension 'libxml' is available.");
|
|
ADD_FLAG("CFLAGS_LIBXML", "/D LIBXML_STATIC /D LIBXML_STATIC_FOR_DLL /D HAVE_WIN32_THREADS ");
|
|
if (!PHP_LIBXML_SHARED) {
|
|
ADD_DEF_FILE("ext\\libxml\\php_libxml2.def");
|
|
}
|
|
PHP_INSTALL_HEADERS("ext/libxml", "php_libxml.h");
|
|
} else {
|
|
WARNING("libxml support can't be enabled, libxml version >= 2.9.4 required");
|
|
}
|
|
} else {
|
|
WARNING("libxml support can't be enabled, iconv or libxml are missing")
|
|
PHP_LIBXML = "no"
|
|
}
|
|
}
|