com php-src: basic support for external libzip: ext/zip/config.w32

[email protected] (Anatol Belski)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    42821dd1c984574dde62d902a91ea58d2d83ecc6
Author:    Anatol Belski <[email protected]>         Sun, 19 Mar 2017 23:10:49 +0100
Parents:   5d5679c4a9e2f04f14b87167f7c87e77d69ff102
Branches:  master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=42821dd1c984574dde62d902a91ea58d2d83ecc6

Log:
basic support for external libzip

Changed paths:
  M  ext/zip/config.w32


Diff:
diff --git a/ext/zip/config.w32 b/ext/zip/config.w32
index 5460b6d..18bad33 100644
--- a/ext/zip/config.w32
+++ b/ext/zip/config.w32
@@ -5,6 +5,20 @@ ARG_ENABLE("zip", "ZIP support", "yes");
 
 if (PHP_ZIP != "no") {
 	if (CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_ZIP", "..\\zlib;" + PHP_ZIP) &&
+		CHECK_HEADER_ADD_INCLUDE("zip.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\include;" + PHP_EXTRA_INCLUDES) &&
+		CHECK_HEADER_ADD_INCLUDE("zipconf.h", "CFLAGS_ZIP", PHP_PHP_BUILD + "\\lib\\libzip\\include;" + PHP_EXTRA_LIBS + "\\libzip\\include;" + PHP_ZIP) &&
+		(CHECK_LIB("zlib_a.lib;zlib.lib", "zip", PHP_ZIP) && (PHP_ZIP_SHARED && CHECK_LIB("libzip.lib", "zip", PHP_ZIP) || CHECK_LIB("libzip_a.lib", "zip", PHP_ZIP)))
+	) {
+		EXTENSION('zip', 'php_zip.c zip_stream.c');
+
+		if (!PHP_ZIP_SHARED) {
+			AC_DEFINE("ZIP_STATIC", 1);
+		}
+
+		AC_DEFINE('HAVE_ZIP', 1);
+		AC_DEFINE('HAVE_LIBZIP', 1);
+		ADD_FLAG("CFLAGS_ZIP", "/D _WIN32");
+	} else if (CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS_ZIP", "..\\zlib;" + PHP_ZIP) &&
 		CHECK_HEADER_ADD_INCLUDE("zipconf.h", "CFLAGS_ZIP", configure_module_dirname + "\\lib;" + PHP_ZIP) &&
 		(((PHP_ZLIB=="no") && (CHECK_LIB("zlib_a.lib", "zip", PHP_ZIP) ||  CHECK_LIB("zlib.lib", "zip", PHP_ZIP))) || 
 			(PHP_ZLIB_SHARED && CHECK_LIB("zlib.lib", "zip", PHP_ZIP)) || (PHP_ZLIB == "yes" && (!PHP_ZLIB_SHARED)))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.