]>
Commit | Line | Data |
---|---|---|
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.2.17/ext/zip/config.m4 2011-10-10 21:33:09.589608203 +0300 | |
8 | +++ php-5.3.8/ext/zip/config.m4 2011-09-27 01:24:57.614837494 +0300 | |
9 | @@ -10,8 +10,48 @@ | |
10 | [ --with-zlib-dir[=DIR] ZIP: Set the path to libz install prefix], no, no) | |
11 | fi | |
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 | + if test "$PHP_LIBZIP" != "no"; then | |
18 | + dnl system libzip, depends on libzip | |
19 | + if test -r $PHP_LIBZIP/include/zip.h; then | |
20 | + LIBZIP_DIR=$PHP_LIBZIP | |
21 | + else | |
22 | + AC_MSG_CHECKING(for libzip in default path) | |
23 | + for i in /usr/local /usr; do | |
24 | + if test -r $i/include/zip.h; then | |
25 | + LIBZIP_DIR=$i | |
26 | + AC_MSG_RESULT(found in $i) | |
27 | + break | |
28 | + fi | |
29 | + done | |
30 | + fi | |
31 | ||
32 | + if test -z "$LIBZIP_DIR"; then | |
33 | + AC_MSG_RESULT(not found) | |
34 | + AC_MSG_ERROR(Please reinstall the libzip distribution) | |
35 | + fi | |
36 | + | |
37 | + dnl Could not think of a simple way to check libzip for overwrite support | |
38 | + PHP_CHECK_LIBRARY(zip, zip_open, | |
39 | + [ | |
40 | + PHP_ADD_INCLUDE($LIBZIP_DIR/include) | |
41 | + PHP_ADD_LIBRARY_WITH_PATH(zip, $LIBZIP_DIR/$PHP_LIBDIR, ZIP_SHARED_LIBADD) | |
42 | + AC_DEFINE(HAVE_LIBZIP,1,[ ]) | |
43 | + ], [ | |
44 | + AC_MSG_ERROR(could not find usable libzip) | |
45 | + ], [ | |
46 | + -L$LIBZIP_DIR/$PHP_LIBDIR | |
47 | + ]) | |
48 | + | |
49 | + AC_DEFINE(HAVE_ZIP,1,[ ]) | |
50 | + PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared) | |
51 | + PHP_SUBST(ZIP_SHARED_LIBADD) | |
52 | + else | |
53 | + | |
54 | + dnl bundled libzip, depends on zlib | |
55 | if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then | |
56 | if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then | |
57 | PHP_ZLIB_DIR="$PHP_ZLIB_DIR" | |
58 | @@ -68,4 +108,5 @@ | |
59 | PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared) | |
60 | PHP_ADD_BUILD_DIR($ext_builddir/lib, 1) | |
61 | PHP_SUBST(ZIP_SHARED_LIBADD) | |
62 | + fi | |
63 |