+x_zlib_on=no
+AC_ARG_ENABLE(zlib,
+ [ --disable-zlib disable zlib compression (autodetected by default)],
+ [ if test "$enableval" = "yes"; then
+ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes,
+ AC_MSG_ERROR([Can't enable zlib: zlib.h not found!])
+ )
+ fi
+ ],
+ [ AC_CHECK_HEADER(zlib.h, x_zlib_on=yes) ]
+)
+if test "$x_zlib_on" = "yes"; then
+ AC_DEFINE(USE_ZLIB, 1)
+ AC_CHECK_LIB(z,deflate)
+fi
+