config.m4 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. PHP_ARG_WITH([zip],
  2. [for zip archive read/write support],
  3. [AS_HELP_STRING([--with-zip],
  4. [Include Zip read/write support])])
  5. if test "$PHP_ZIP" != "no"; then
  6. PKG_CHECK_MODULES([LIBZIP], [libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0])
  7. PHP_EVAL_INCLINE($LIBZIP_CFLAGS)
  8. PHP_EVAL_LIBLINE($LIBZIP_LIBS, ZIP_SHARED_LIBADD)
  9. PHP_CHECK_LIBRARY(zip, zip_file_set_mtime,
  10. [
  11. AC_DEFINE(HAVE_SET_MTIME, 1, [Libzip >= 1.0.0 with zip_file_set_mtime])
  12. ], [
  13. AC_MSG_WARN(Libzip >= 1.0.0 needed for setting mtime)
  14. ], [
  15. $LIBZIP_LIBS
  16. ])
  17. PHP_CHECK_LIBRARY(zip, zip_file_set_encryption,
  18. [
  19. AC_DEFINE(HAVE_ENCRYPTION, 1, [Libzip >= 1.2.0 with encryption support])
  20. ], [
  21. AC_MSG_WARN(Libzip >= 1.2.0 needed for encryption support)
  22. ], [
  23. $LIBZIP_LIBS
  24. ])
  25. PHP_CHECK_LIBRARY(zip, zip_libzip_version,
  26. [
  27. AC_DEFINE(HAVE_LIBZIP_VERSION, 1, [Libzip >= 1.3.1 with zip_libzip_version function])
  28. ], [
  29. ], [
  30. $LIBZIP_LIBS
  31. ])
  32. PHP_CHECK_LIBRARY(zip, zip_register_progress_callback_with_state,
  33. [
  34. AC_DEFINE(HAVE_PROGRESS_CALLBACK, 1, [Libzip >= 1.3.0 with zip_register_progress_callback_with_state function])
  35. ], [
  36. ], [
  37. $LIBZIP_LIBS
  38. ])
  39. PHP_CHECK_LIBRARY(zip, zip_register_cancel_callback_with_state,
  40. [
  41. AC_DEFINE(HAVE_CANCEL_CALLBACK, 1, [Libzip >= 1.6.0 with zip_register_cancel_callback_with_state function])
  42. ], [
  43. ], [
  44. $LIBZIP_LIBS
  45. ])
  46. PHP_CHECK_LIBRARY(zip, zip_compression_method_supported,
  47. [
  48. AC_DEFINE(HAVE_METHOD_SUPPORTED, 1, [Libzip >= 1.7.0 with zip_*_method_supported functions])
  49. ], [
  50. ], [
  51. $LIBZIP_LIBS
  52. ])
  53. AC_DEFINE(HAVE_ZIP,1,[ ])
  54. PHP_ZIP_SOURCES="php_zip.c zip_stream.c"
  55. PHP_NEW_EXTENSION(zip, $PHP_ZIP_SOURCES, $ext_shared)
  56. PHP_SUBST(ZIP_SHARED_LIBADD)
  57. dnl so we always include the known-good working hack.
  58. PHP_ADD_MAKEFILE_FRAGMENT
  59. fi