vcpkg/ports/libgnutls/link-zlib.patch

49 lines
1.3 KiB
Diff
Raw Normal View History

2024-04-20 03:57:44 +08:00
diff --git a/lib/Makefile.am b/lib/Makefile.am
index a50d311..0a8b711 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -158,6 +158,7 @@ libgnutls_la_LIBADD = ../gl/libgnu.la x509/libgnutls_x509.la \
extras/libgnutls_extras.la
thirdparty_libadd = $(LTLIBINTL) $(LIBSOCKET) $(LTLIBNSL) \
$(P11_KIT_LIBS) $(LIB_SELECT) $(GNUTLS_LIBS_PRIVATE)
+thirdparty_libadd += $(LTLIBZ)
if HAVE_LIBIDN2
thirdparty_libadd += $(LIBIDN2_LIBS)
diff --git a/lib/compress.c b/lib/compress.c
index a0a7c69..ed2c743 100644
--- a/lib/compress.c
+++ b/lib/compress.c
@@ -59,16 +59,19 @@ static int (*_gnutls_zlib_uncompress)(Bytef *dest, uLongf *destLen,
static void zlib_deinit(void)
{
+#if 0 // using libdl
#ifndef _WIN32
if (_zlib_handle != NULL) {
dlclose(_zlib_handle);
_zlib_handle = NULL;
}
#endif /* _WIN32 */
+#endif // using libdl
}
static int zlib_init(void)
{
+#if 0 // using libdl
#ifndef _WIN32
if (_zlib_handle != NULL)
return 0;
@@ -90,6 +93,11 @@ error:
#else
return gnutls_assert_val(GNUTLS_E_UNIMPLEMENTED_FEATURE);
#endif /* _WIN32 */
+#else // ^ using libdl | v not using libdl
+ _gnutls_zlib_compressBound = &compressBound;
+ _gnutls_zlib_compress = &compress;
+ _gnutls_zlib_uncompress = &uncompress;
+#endif // using libdl
}
#endif /* HAVE_LIBZ */