summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorFabian Groffen <grobian@gentoo.org>2019-11-11 08:34:49 +0100
committerKevin McCarthy <kevin@8t8.us>2019-11-30 13:59:51 -0800
commit136ae0add512f21bc418f9e31a2f1b970ad1a490 (patch)
tree82797901e6688047b77fb05a6d4865db2e260cbb /configure.ac
parent1dd65e6beb0f1d211d63f936d92aecc792d2f72b (diff)
imap: add support for COMPRESS=DEFLATE, RFC 4978
- added mutt_zstrm which allows wrapping an existing connection with deflate/inflate (zlib compression) - call mutt_zstrm_wrap_conn when setting up an IMAP connection if the server supports COMPRESSION=DEFLATE and imap_deflate evaluates to yes - add config quad-option imap_deflate enable/disable use of (de)compression for IMAP connections, defaulting to yes - add configure check for zlib, --with-zlib to detect if mutt_zstrm can (or should) be built Tested against a Dovecot IMAP server, observed easily 7x compression rates on received data, and 5x on sent data for a normal session. Rates can be observed when the connection is closed on debug level 4 and higher. Bug: https://gitlab.com/muttmua/mutt/issues/92
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 38 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 8c1c27ee..4e9cf2b2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -756,6 +756,44 @@ then
fi
AM_CONDITIONAL(USE_GSS, test x$need_gss = xyes)
+# if zlib
+AC_ARG_WITH(zlib, AS_HELP_STRING([--with-zlib@<:@=PFX@:>@],[Enable DEFLATE support for IMAP using libz]),
+ zlib_prefix="$withval", zlib_prefix="auto")
+if test "$zlib_prefix" != "no"
+then
+ if test "$need_imap" = "yes"
+ then
+ have_zlib=
+ saved_LDFLAGS="$LDFLAGS"
+ saved_CPPFLAGS="$CPPFLAGS"
+ if test "$zlib_prefix" != "yes"
+ then
+ LDFLAGS="$LDFLAGS -L$zlib_prefix/lib"
+ CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include"
+ fi
+ AC_CHECK_HEADERS([zlib.h], [AC_CHECK_LIB([z], [deflate],
+ [have_zlib=yes])])
+ if test "x$have_zlib" = "x"
+ then
+ if test "x$zlib_prefix" != "xauto"
+ then
+ AC_MSG_ERROR([ZLIB requested, but library or headers not found])
+ fi
+ zlib_prefix=no
+ else
+ MUTTLIBS="$MUTTLIBS -lz"
+ AC_DEFINE(USE_ZLIB, 1, [Define if you have libz available])
+ MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_zstrm.o"
+ zlib_prefix=yes
+ fi
+ LDFLAGS="$saved_LDFLAGS"
+ CPPFLAGS="$saved_CPPFLAGS"
+ else
+ AC_MSG_WARN([ZLIB was requested but IMAP is not enabled])
+ fi
+fi
+AM_CONDITIONAL(USE_ZLIB, test x$zlib_prefix = xyes)
+
dnl -- end imap dependencies --
AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl@<:@=PFX@:>@],[Enable TLS support using OpenSSL]),