]>
Commit | Line | Data |
---|---|---|
c638a5d4 | 1 | |
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 | |
6 | ||
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 | |
9 | @@ -13,8 +13,72 @@ | |
10 | PHP_ARG_WITH(pcre-dir, pcre install prefix, | |
11 | [ --with-pcre-dir ZIP: pcre install prefix], no, no) | |
12 | ||
13 | +PHP_ARG_WITH(libzip, libzip, | |
14 | +[ --with-libzip[=DIR] ZIP: use libzip], no, no) | |
15 | + | |
16 | if test "$PHP_ZIP" != "no"; then | |
17 | + dnl This is PECL build, check if bundled PCRE library is used | |
18 | + old_CPPFLAGS=$CPPFLAGS | |
19 | + CPPFLAGS=$INCLUDES | |
20 | + AC_EGREP_CPP(yes,[ | |
21 | +#include <main/php_config.h> | |
22 | +#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) | |
23 | +yes | |
24 | +#endif | |
25 | + ],[ | |
26 | + PHP_PCRE_REGEX=yes | |
27 | + ],[ | |
28 | + AC_EGREP_CPP(yes,[ | |
29 | +#include <main/php_config.h> | |
30 | +#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE) | |
31 | +yes | |
32 | +#endif | |
33 | + ],[ | |
34 | + PHP_PCRE_REGEX=pecl | |
35 | + ],[ | |
36 | + PHP_PCRE_REGEX=no | |
37 | + ]) | |
38 | + ]) | |
39 | + CPPFLAGS=$old_CPPFLAGS | |
40 | + | |
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 | |
45 | + else | |
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 | |
49 | + LIBZIP_DIR=$i | |
50 | + AC_MSG_RESULT(found in $i) | |
51 | + break | |
52 | + fi | |
53 | + done | |
54 | + fi | |
55 | + | |
56 | + if test -z "$LIBZIP_DIR"; then | |
57 | + AC_MSG_RESULT(not found) | |
58 | + AC_MSG_ERROR(Please reinstall the libzip distribution) | |
59 | + fi | |
60 | ||
61 | + dnl Could not think of a simple way to check libzip for overwrite support | |
62 | + PHP_CHECK_LIBRARY(zip, zip_open, | |
63 | + [ | |
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,[ ]) | |
67 | + ], [ | |
68 | + AC_MSG_ERROR(could not find usable libzip) | |
69 | + ], [ | |
70 | + -L$LIBZIP_DIR/$PHP_LIBDIR | |
71 | + ]) | |
72 | + | |
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) | |
76 | + else | |
77 | + | |
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" | |
82 | @@ -47,31 +111,7 @@ | |
83 | PHP_ADD_INCLUDE($PHP_ZLIB_INCDIR) | |
84 | fi | |
85 | ||
86 | - dnl This is PECL build, check if bundled PCRE library is used | |
87 | - old_CPPFLAGS=$CPPFLAGS | |
88 | - CPPFLAGS=$INCLUDES | |
89 | - AC_EGREP_CPP(yes,[ | |
90 | -#include <main/php_config.h> | |
91 | -#if defined(HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE) | |
92 | -yes | |
93 | -#endif | |
94 | - ],[ | |
95 | - PHP_PCRE_REGEX=yes | |
96 | - ],[ | |
97 | - AC_EGREP_CPP(yes,[ | |
98 | -#include <main/php_config.h> | |
99 | -#if defined(HAVE_PCRE) && !defined(COMPILE_DL_PCRE) | |
100 | -yes | |
101 | -#endif | |
102 | - ],[ | |
103 | - PHP_PCRE_REGEX=pecl | |
104 | - ],[ | |
105 | - PHP_PCRE_REGEX=no | |
106 | - ]) | |
107 | - ]) | |
108 | - CPPFLAGS=$old_CPPFLAGS | |
109 | - | |
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 \ | |
115 | @@ -91,10 +131,11 @@ | |
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" | |
118 | ||
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) | |
127 | + fi | |
128 | ||
129 | dnl so we always include the known-good working hack. | |
130 | PHP_ADD_MAKEFILE_FRAGMENT |