Commit 8aeb8aab authored by Ghislain MARY's avatar Ghislain MARY

Add check for zlib when building with autotools.

parent 073a1e66
......@@ -315,6 +315,42 @@ AC_ARG_ENABLE(tests,
)
AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes && test x$found_cunit = xyes)
dnl check zlib
AC_ARG_ENABLE(zlib,
[AS_HELP_STRING([--disable-zlib], [Disable ZLib support])],
[case "${enableval}" in
yes) build_zlib=true ;;
no) build_zlib=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-zlib) ;;
esac],
[build_zlib=auto]
)
if test "$build_zlib" != "false" ; then
PKG_CHECK_MODULES(ZLIB, [zlib], [found_zlib=yes], [found_zlib=no])
if test "x$found_zlib" = "xno" ; then
AC_CHECK_LIB(z, inflate,
[AC_CHECK_HEADER([zlib.h],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <zlib.h>
#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1230)
// compile error
#endif
]],[])],
[found_zlib=yes])])])
if test "x$found_zlib" = "xno" ; then
AC_MSG_NOTICE([zlib library and headers not found])
else
AC_DEFINE( HAVE_ZLIB, 1, [ZLIB support] )
ZLIB_LIBS='-lz'
AC_SUBST(ZLIB_LIBS)
fi
else
AC_MSG_NOTICE([ZLIB found])
AC_DEFINE( HAVE_ZLIB, 1, [ZLIB support] )
fi
fi
REQUIRES_PRIVATE=""
LIBS_PRIVATE=""
if test "$found_pkg_config_cunit" = "yes" ; then
......
......@@ -61,7 +61,7 @@ endif
libbellesip_la_CFLAGS=$(STRICT_OPTIONS) $(STRICT_OPTIONS_CC) $(ANTLR_CFLAGS) $(TLS_CFLAGS) $(TUNNEL_CFLAGS) $(LIBBELLESIP_CFLAGS)
libbellesip_la_CXXFLAGS=$(STRICT_OPTIONS) $(STRICT_OPTIONS_CXX) $(TLS_CFLAGS) $(TUNNEL_CFLAGS) $(LIBBELLESIP_CFLAGS)
libbellesip_la_LIBADD=grammars/libbellesip_generated.la $(ANTLR_LIBS) $(TLS_LIBS) $(TUNNEL_LIBS)
libbellesip_la_LIBADD=grammars/libbellesip_generated.la $(ANTLR_LIBS) $(TLS_LIBS) $(TUNNEL_LIBS) $(ZLIB_LIBS)
libbellesip_la_LDFLAGS=-no-undefined -version-info $(BELLESIP_SO_VERSION) $(LDFLAGS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment