From: Nikos Mavrogiannopoulos Date: Wed, 12 May 2004 16:32:50 +0000 (+0000) Subject: Added configure option to disable lzo completely. X-Git-Tag: gnutls_1_1_11~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a606db7280ece79e888df098e10dd59097aaed9;p=thirdparty%2Fgnutls.git Added configure option to disable lzo completely. --- diff --git a/configure.in b/configure.in index 59608d2a2d..0197648e99 100644 --- a/configure.in +++ b/configure.in @@ -434,6 +434,21 @@ fi dnl CHECK FOR LZO SUPPORT (whether to use the included one) dnl +minilzo_enabled=no +use_lzo=yes +AC_ARG_WITH(lzo, + [ --without-lzo do not use lzo compression], + use_lzo=no, + use_lzo=yes +) + +AC_MSG_CHECKING([whether to include lzo compression support]) +AC_MSG_RESULT($use_lzo) + +if test x$use_lzo = xyes; then + +AC_DEFINE(USE_LZO, 1, [whether to use the lzo compression]) + if test x$opt_developer_mode = xyes; then minilzo_enabled=yes fi @@ -457,15 +472,15 @@ AC_CHECK_LIB( lzo, lzo1x_1_compress, minilzo_enabled=no, fi if test x"$minilzo_enabled" = xyes; then + AC_DEFINE(USE_MINILZO, 1, [whether to use the included minilzo]) - LZO_OBJECTS="minilzo.lo" -else - LZO_LINK=-llzo fi -AC_SUBST(LZO_OBJECTS) -AC_SUBST(LZO_LINK) +dnl use lzo +fi +AM_CONDITIONAL(USE_LZO, test "$use_lzo" = "yes") +AM_CONDITIONAL(ENABLE_INCLUDED_LZO, test "$minilzo_enabled" = "yes") AC_MSG_RESULT([*** diff --git a/libextra/Makefile.am b/libextra/Makefile.am index a4ba2d425f..e4a9a23b63 100644 --- a/libextra/Makefile.am +++ b/libextra/Makefile.am @@ -40,6 +40,17 @@ PGP_LIBS = openpgp/libpgp.la endif endif +if ENABLE_INCLUDED_LZO +LZO_OBJECTS = minilzo.c +else + +if USE_LZO +LZO_LIBS = -llzo +endif +LZO_OBJECTS = +endif + + COBJECTS_EXTRA = ext_srp.c \ gnutls_srp.c auth_srp.c auth_srp_passwd.c auth_srp_sb64.c \ gnutls_extra.c auth_srp_rsa.c gnutls_openpgp.c @@ -48,15 +59,12 @@ COBJECTS_EXTRA = ext_srp.c \ libgnutls_extra_la_LDFLAGS = $(libgnutls_extra_version_script_cmd) \ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ $(LIBOPENCDK_LIBS) $(LZO_LINK) -libgnutls_extra_la_DEPENDENCIES = $(LZO_OBJECTS) -libgnutls_extra_la_SOURCES = $(COBJECTS_EXTRA) +libgnutls_extra_la_SOURCES = $(COBJECTS_EXTRA) $(LZO_OBJECTS) -libgnutls_extra_la_LIBADD = $(LZO_OBJECTS) $(PGP_LIBS) \ +libgnutls_extra_la_LIBADD = $(LZO_LIBS) $(PGP_LIBS) \ ../lib/libgnutls.la -EXTRA_libgnutls_extra_la_SOURCES = minilzo.c - gnutls-extra-api.tex: $(COBJECTS_EXTRA) @echo "" > gnutls-extra-api.tex diff --git a/libextra/gnutls_extra.c b/libextra/gnutls_extra.c index 1bda1681aa..ebf6607421 100644 --- a/libextra/gnutls_extra.c +++ b/libextra/gnutls_extra.c @@ -26,7 +26,9 @@ #include #include #include -#include +#ifdef USE_LZO +# include +#endif extern gnutls_extension_entry _gnutls_extensions[]; extern const int _gnutls_extensions_size; @@ -116,6 +118,7 @@ extern int _gnutls_comp_algorithms_size; /* Functions in gnutls that have not been initialized. */ +#ifdef USE_LZO typedef int (*LZO_FUNC)(); extern LZO_FUNC _gnutls_lzo1x_decompress_safe; extern LZO_FUNC _gnutls_lzo1x_1_compress; @@ -148,7 +151,7 @@ int i; return GNUTLS_E_MEMORY_ERROR; } - +#endif extern OPENPGP_KEY_CREATION_TIME_FUNC _E_gnutls_openpgp_get_raw_key_creation_time; extern OPENPGP_KEY_EXPIRATION_TIME_FUNC _E_gnutls_openpgp_get_raw_key_expiration_time; @@ -215,6 +218,7 @@ int ret; /* Initialize the LZO library */ +#ifdef USE_LZO if (lzo_init() != LZO_E_OK) { return GNUTLS_E_LZO_INIT_FAILED; } @@ -227,6 +231,7 @@ int ret; gnutls_assert(); return ret; } +#endif #ifdef ENABLE_SRP /* Add the SRP authentication to the list of authentication