1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00
Files
Tim Starling e0e2963b74 Wrap strings passed to libzip with zip_source_function_create() (#21659)
Wrap strings passed to libzip with zip_source_function_create()
instead of using zip_source_buffer_create(). This allows us to make
the string writable, and simplifies memory management.
2026-04-09 18:46:59 -07:00

25 lines
1.1 KiB
JavaScript

// vim:ft=javascript
ARG_ENABLE("zip", "ZIP support", "yes,shared");
if (PHP_ZIP != "no") {
if (CHECK_HEADER("zip.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\include;" + PHP_EXTRA_INCLUDES) &&
CHECK_HEADER("zipconf.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\lib\\libzip\\include;" + PHP_EXTRA_LIBS + "\\libzip\\include;" + PHP_ZIP) &&
(PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) ||
CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP) && CHECK_LIB("libbz2_a.lib", "zip", PHP_ZIP) && CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP) && CHECK_LIB("liblzma_a.lib", "zip", PHP_ZIP))
) {
EXTENSION('zip', 'php_zip.c zip_source.c zip_stream.c');
ADD_EXTENSION_DEP('zip', 'pcre');
if (get_define("LIBS_ZIP").match("libzip_a(?:_debug)?\.lib")) {
/* Using static dependency lib. */
AC_DEFINE("ZIP_STATIC", 1);
}
AC_DEFINE('HAVE_ZIP', 1, "Define to 1 if the PHP extension 'zip' is available.");
ADD_FLAG("CFLAGS_ZIP", "/D HAVE_ENCRYPTION /D HAVE_LIBZIP_VERSION /D HAVE_PROGRESS_CALLBACK /D HAVE_CANCEL_CALLBACK /D HAVE_METHOD_SUPPORTED /D LZMA_API_STATIC");
} else {
WARNING("zip not enabled; libraries and headers not found");
}
}