]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added configure option to disable lzo completely.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 12 May 2004 16:32:50 +0000 (16:32 +0000)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Wed, 12 May 2004 16:32:50 +0000 (16:32 +0000)
configure.in
libextra/Makefile.am
libextra/gnutls_extra.c

index 59608d2a2d0962feb1ab51b74be57b141d2e08ba..0197648e99f5320259e64a7b217615f29e789989 100644 (file)
@@ -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([***
index a4ba2d425f9db17a1613f46b278b3f8e13d11c57..e4a9a23b634818c63760376e0eaea70dea9b1a56 100644 (file)
@@ -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
index 1bda1681aadacd0596c1d9f43aa246f6b18f0bfe..ebf6607421e0cec6e56e378ff164d1858cd83d0e 100644 (file)
@@ -26,7 +26,9 @@
 #include <openpgp/gnutls_openpgp.h>
 #include <gnutls_extra.h>
 #include <gnutls_algorithms.h>
-#include <minilzo.h>
+#ifdef USE_LZO
+# include <minilzo.h>
+#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