]> granicus.if.org Git - php/commitdiff
Make all possible build combinations work under doze (external zip library)
authorSteph Fox <sfox@php.net>
Fri, 25 Jan 2008 15:00:24 +0000 (15:00 +0000)
committerSteph Fox <sfox@php.net>
Fri, 25 Jan 2008 15:00:24 +0000 (15:00 +0000)
ext/phar/config.w32
ext/phar/phar_internal.h
ext/phar/phar_object.c

index e99914a2ab877ccaef60c5ac8a38a9cffc41a435..7d6bf11d3479b5818fc39f34c84df41a2d96915e 100644 (file)
@@ -4,15 +4,22 @@
 ARG_ENABLE("phar", "enable phar support", "no");
 
 if (PHP_PHAR != "no") {
-       EXTENSION("phar", "tar.c zip.c stream.c dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c");
+       EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c zip.c");
        if (PHP_PHAR_SHARED) {
                ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR ");
        }
-       if (HAVE_ZIP) {
-               AC_DEFINE('HAVE_PHAR_ZIP', 1);
+       if (PHP_ZIP_SHARED) {
+               if (PHP_PHAR_SHARED) {
+                       ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_ZIP ");
+               } else {
+                       ERROR("Phar cannot be built statically with shared Zip extension");
+               }
+       }
+       if (PHP_ZIP != "no") {
                ADD_EXTENSION_DEP('phar', 'zip', true);
+               AC_DEFINE('HAVE_PHAR_ZIP', 1);
        }
-       ADD_EXTENSION_DEP('phar', 'zlib', true);
        ADD_EXTENSION_DEP('phar', 'bz2', true);
        ADD_EXTENSION_DEP('phar', 'spl', true);
+       ADD_EXTENSION_DEP('phar', 'zlib', true);
 }
index 213125eec18850c0f3e781591b87b9196aac184e..82be02c6a7a400a94c8da187494a8880748970aa 100755 (executable)
@@ -354,7 +354,9 @@ int phar_tar_flush(phar_archive_data *phar, char *user_stub, long len, char **er
 /* zip functions in zip.c */
 int phar_open_zipfile(char *fname, int fname_len, char *alias, int alias_len, phar_archive_data** pphar, char **error TSRMLS_DC);
 int phar_open_or_create_zip(char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
+#if HAVE_PHAR_ZIP
 int phar_zip_flush(phar_archive_data *archive, char *user_stub, long len, char **error TSRMLS_DC);
+#endif
 
 #ifdef PHAR_MAIN
 static int phar_open_fp(php_stream* fp, char *fname, int fname_len, char *alias, int alias_len, int options, phar_archive_data** pphar, char **error TSRMLS_DC);
index efa587b079567562b9421cdbf93a6808fbdd054c..0f0c704d723c7462ca2a256f4d615ca460ff0c1f 100755 (executable)
@@ -1348,7 +1348,6 @@ static void phar_convert_to_other(phar_archive_data *source, int convert, php_ui
        phar_archive_data phar = {0};
        long offset = 0;
        char *error, *opened_path = NULL;
-       int fd, ziperror;
 
        /* set whole-archive compression from parameter */
        phar.flags = flags;
@@ -1359,6 +1358,8 @@ static void phar_convert_to_other(phar_archive_data *source, int convert, php_ui
                case 2 :
                        phar.is_zip = 1;
 #if HAVE_PHAR_ZIP
+                       int fd, ziperror;
+
                        if (!((fd = php_open_temporary_fd(NULL, "pharzip", &opened_path TSRMLS_CC)) >= 0)) {
                                zend_throw_exception_ex(spl_ce_UnexpectedValueException, 0 TSRMLS_CC,
                                        "Cannot convert phar archive \"%s\", unable to open temporary zip archive", source->fname);