Re: cvs: pecl /phar config.w32 phar_internal.h phar_object.c
| From: | Marcus Boerger | Date: | Fri, 25 Jan 2008 15:35:41 +0000 |
| Subject: | Re: cvs: pecl /phar config.w32 phar_internal.h phar_object.c | ||
| References: | 1 | Groups: | php.pecl.cvs |
| Request: | Send a blank email to pecl-cvs+get-9596@lists.php.net to get a copy of this message | ||
Hello Steph,
Friday, January 25, 2008, 4:00:23 PM, you wrote:
> sfox Fri Jan 25 15:00:23 2008 UTC
> Modified files:
> /pecl/phar config.w32 phar_internal.h phar_object.c
> Log:
> Make all possible build combinations work under doze (external zip library)
>
>
> http://cvs.php.net/viewvc.cgi/pecl/phar/config.w32?r1=1.24&r2=1.25&diff_format=u
> Index: pecl/phar/config.w32
> diff -u pecl/phar/config.w32:1.24 pecl/phar/config.w32:1.25
> --- pecl/phar/config.w32:1.24 Tue Jan 22 05:26:36 2008
> +++ pecl/phar/config.w32 Fri Jan 25 15:00:23 2008
> @@ -1,18 +1,25 @@
> -// $Id: config.w32,v 1.24 2008/01/22 05:26:36 cellog Exp $
> +// $Id: config.w32,v 1.25 2008/01/25 15:00:23 sfox Exp $
> // vim:ft=javascript
>
> 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);
> }
>
> http://cvs.php.net/viewvc.cgi/pecl/phar/phar_internal.h?r1=1.70&r2=1.71&diff_format=u
> Index: pecl/phar/phar_internal.h
> diff -u pecl/phar/phar_internal.h:1.70 pecl/phar/phar_internal.h:1.71
> --- pecl/phar/phar_internal.h:1.70 Sun Jan 20 00:49:44 2008
> +++ pecl/phar/phar_internal.h Fri Jan 25 15:00:23 2008
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: phar_internal.h,v 1.70 2008/01/20 00:49:44 cellog Exp $ */
> +/* $Id: phar_internal.h,v 1.71 2008/01/25 15:00:23 sfox Exp $ */
>
> #ifdef HAVE_CONFIG_H
> #include "config.h"
> @@ -354,7 +354,9 @@
> /* 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);
>
> http://cvs.php.net/viewvc.cgi/pecl/phar/phar_object.c?r1=1.132&r2=1.133&diff_format=u
> Index: pecl/phar/phar_object.c
> diff -u pecl/phar/phar_object.c:1.132 pecl/phar/phar_object.c:1.133
> --- pecl/phar/phar_object.c:1.132 Mon Jan 21 05:28:08 2008
> +++ pecl/phar/phar_object.c Fri Jan 25 15:00:23 2008
> @@ -17,7 +17,7 @@
> +----------------------------------------------------------------------+
> */
>
> -/* $Id: phar_object.c,v 1.132 2008/01/21 05:28:08 cellog Exp $ */
> +/* $Id: phar_object.c,v 1.133 2008/01/25 15:00:23 sfox Exp $ */
>
> #include "phar_internal.h"
> #include "func_interceptors.h"
> @@ -1348,7 +1348,6 @@
> 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 @@
> case 2 :
> phar.is_zip = 1;
> #if HAVE_PHAR_ZIP
> + int fd, ziperror;
> +
This is not working with all compilers. What you need to do is moving the
#if around the original declaration in line 1351;
> 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);
Best regards,
Marcus