xref: /PHP-7.4/ext/zip/config.m4 (revision f3e6b123)
1PHP_ARG_WITH([zip],
2  [for zip archive read/write support],
3  [AS_HELP_STRING([--with-zip],
4    [Include Zip read/write support])])
5
6if test "$PHP_ZIP" != "no"; then
7  PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0])
8
9  PHP_EVAL_INCLINE($LIBZIP_CFLAGS)
10  PHP_EVAL_LIBLINE($LIBZIP_LIBS, ZIP_SHARED_LIBADD)
11
12  PHP_CHECK_LIBRARY(zip, zip_file_set_encryption,
13  [
14    AC_DEFINE(HAVE_ENCRYPTION, 1, [Libzip >= 1.2.0 with encryption support])
15  ], [
16    AC_MSG_WARN(Libzip >= 1.2.0 needed for encryption support)
17  ], [
18    $LIBZIP_LIBS
19  ])
20
21  PHP_CHECK_LIBRARY(zip, zip_libzip_version,
22  [
23    AC_DEFINE(HAVE_LIBZIP_VERSION, 1, [Libzip >= 1.3.1 with zip_libzip_version function])
24  ], [
25  ], [
26    $LIBZIP_LIBS
27  ])
28
29  AC_DEFINE(HAVE_ZIP,1,[ ])
30
31  PHP_ZIP_SOURCES="php_zip.c zip_stream.c"
32  PHP_NEW_EXTENSION(zip, $PHP_ZIP_SOURCES, $ext_shared)
33
34  PHP_SUBST(ZIP_SHARED_LIBADD)
35
36  dnl so we always include the known-good working hack.
37  PHP_ADD_MAKEFILE_FRAGMENT
38fi
39