]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
win32: link with crypt32
authorSteve Lhomme <robux4@ycbcr.xyz>
Tue, 19 May 2020 14:23:40 +0000 (16:23 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Wed, 20 May 2020 05:47:45 +0000 (07:47 +0200)
Since 5d03564cccd2c10c41252ea468d4a098bd08e9c1 we use CertOpenStore().
To properly link it needs to be linked with the crypt32.dll.
https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-certopenstore

This library was missing from the pkg-config library. It exists in
thirdparty_libadd to link gnutls as a DLL.

Signed-off-by: Steve Lhomme <robux4@ycbcr.xyz>
configure.ac
lib/Makefile.am
lib/gnutls.pc.in

index 2aca4b9fcaa3a165979c142773ef0486df2bdb6a..3413a3dc99561124888fb8c620f869f8cd5433c2 100644 (file)
@@ -119,6 +119,8 @@ case "$host" in
   *mingw32* | *mingw64*)
     have_win=yes
     AC_DEFINE([_UNICODE], [1], [Defined to 1 for Unicode (wide chars) APIs])
+    LIB_CRYPT32="-lcrypt32"
+    AC_SUBST([LIB_CRYPT32])
   ;;
   *darwin*)
     have_macosx=yes
index eddd1167a72c8c5867ba205d1b0324a5ce0140d4..f55f298f7b9386a26a2b522c4bf866312974fb7d 100644 (file)
@@ -151,7 +151,7 @@ libgnutls_la_LIBADD = ../gl/libgnu.la x509/libgnutls_x509.la \
        auth/libgnutls_auth.la algorithms/libgnutls_alg.la \
        extras/libgnutls_extras.la
 thirdparty_libadd = $(LTLIBZ) $(LTLIBINTL) $(LIBSOCKET) $(LTLIBNSL) \
-       $(P11_KIT_LIBS) $(LIB_SELECT)
+       $(P11_KIT_LIBS) $(LIB_SELECT) $(LIB_CRYPT32)
 
 if HAVE_LIBIDN2
 thirdparty_libadd += $(LIBIDN2_LIBS)
@@ -208,10 +208,6 @@ defexec_DATA = libgnutls-$(DLL_VERSION).def
 DISTCLEANFILES += $(defexec_DATA)
 endif
 
-if WINDOWS
-thirdparty_libadd += -lcrypt32
-endif
-
 if MACOSX
 libgnutls_la_LDFLAGS += -framework Security -framework CoreFoundation
 endif
index 4b6b5578f546239ad74c4ddab232d29b32fef68a..46a1eb5d859af0ad955a54d66e6f06d63397f908 100644 (file)
@@ -19,6 +19,6 @@ Description: Transport Security Layer implementation for the GNU system
 URL: https://www.gnutls.org/
 Version: @VERSION@
 Libs: -L${libdir} -lgnutls
-Libs.private: @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@
+Libs.private: @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@ @LIB_CRYPT32@
 @GNUTLS_REQUIRES_PRIVATE@
 Cflags: -I${includedir}