2 https://bugzilla.redhat.com/show_bug.cgi?id=551513
3 https://bugs.php.net/bug.php?id=39388
4 http://spot.fedorapeople.org/php-5.3.6-libzip.patch
5 pld fixes: link with -lzip when using system lib, -lz otherwise
7 --- php-5.3.8/ext/zip/config.m4~ 2008-08-08 12:47:15.000000000 +0300
8 +++ php-5.3.8/ext/zip/config.m4 2011-09-27 01:18:53.258197363 +0300
10 PHP_ARG_WITH(pcre-dir, pcre install prefix,
11 [ --with-pcre-dir ZIP: pcre install prefix], no, no)
13 +PHP_ARG_WITH(libzip, libzip,
14 +[ --with-libzip[=DIR] ZIP: use libzip], no, no)
16 if test "$PHP_ZIP" != "no"; then
17 + dnl This is PECL build, check if bundled PCRE library is used
18 + old_CPPFLAGS=$CPPFLAGS
21 +#include <main/php_config.h>
22 +#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
29 +#include <main/php_config.h>
30 +#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
39 + CPPFLAGS=$old_CPPFLAGS
41 + if test "$PHP_LIBZIP" != "no"; then
42 + dnl system libzip, depends on libzip
43 + if test -r $PHP_LIBZIP/include/zip.h; then
44 + LIBZIP_DIR=$PHP_LIBZIP
46 + AC_MSG_CHECKING(for libzip in default path)
47 + for i in /usr/local /usr; do
48 + if test -r $i/include/zip.h; then
50 + AC_MSG_RESULT(found in $i)
56 + if test -z "$LIBZIP_DIR"; then
57 + AC_MSG_RESULT(not found)
58 + AC_MSG_ERROR(Please reinstall the libzip distribution)
61 + dnl Could not think of a simple way to check libzip for overwrite support
62 + PHP_CHECK_LIBRARY(zip, zip_open,
64 + PHP_ADD_INCLUDE($LIBZIP_DIR/include)
65 + PHP_ADD_LIBRARY_WITH_PATH(zip, $LIBZIP_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD)
66 + AC_DEFINE(HAVE_LIBZIP,1,[ ])
68 + AC_MSG_ERROR(could not find usable libzip)
70 + -L$LIBZIP_DIR/$PHP_LIBDIR
73 + AC_DEFINE(HAVE_ZIP,1,[ ])
74 + PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared)
75 + PHP_SUBST(ZIP_SHARED_LIBADD)
78 + dnl bundled libzip, depends on zlib
79 if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
80 if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
81 PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
83 PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR)
86 - dnl This is PECL build, check if bundled PCRE library is used
87 - old_CPPFLAGS=$CPPFLAGS
90 -#include <main/php_config.h>
91 -#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
98 -#include <main/php_config.h>
99 -#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE)
103 - PHP_PCRE_REGEX=pecl
108 - CPPFLAGS=$old_CPPFLAGS
110 - PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
111 + PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
112 lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c \
113 lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \
114 lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \
116 lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \
117 lib/zip_error_clear.c lib/zip_file_error_clear.c"
119 - AC_DEFINE(HAVE_ZIP,1,[ ])
120 - PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
121 - PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
122 - PHP_SUBST(ZIP_SHARED_LIBADD)
123 + AC_DEFINE(HAVE_ZIP,1,[ ])
124 + PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
125 + PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
126 + PHP_SUBST(ZIP_SHARED_LIBADD)
129 dnl so we always include the known-good working hack.
130 PHP_ADD_MAKEFILE_FRAGMENT