]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Merge the extra libraries to link dynamically in GNUTLS_LIBS_PRIVATE
authorSteve Lhomme <robux4@ycbcr.xyz>
Sat, 6 Jun 2020 12:05:16 +0000 (14:05 +0200)
committerSteve Lhomme <robux4@ycbcr.xyz>
Sat, 6 Jun 2020 12:12:59 +0000 (14:12 +0200)
This should fix #1020 where bcrypt is missing from thirdparty_libadd.

Ultimately it would be good to add libraries that always need to be linked in
one variable that is shared between the Makefile and the pkg-config file.

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

index d59553b6a180ed066aabe7654d8f541e23c1025c..74278d5689af2dc66552c7dbd61f87b1a3b08130 100644 (file)
@@ -120,8 +120,7 @@ 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])
+    GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -lcrypt32"
     AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
       [[#include <windows.h>
        #if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0600
@@ -135,9 +134,8 @@ case "$host" in
     if test "x$enable_dyn_ncrypt" = "xyes"; then
       AC_DEFINE([DYN_NCRYPT], 1, [Dynamic use of ncrypt API (win32)])
     else
-      LIBNCRYPT="-lncrypt"
+      GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -lncrypt"
     fi
-    AC_SUBST([LIBNCRYPT])
   ;;
   *darwin*)
     have_macosx=yes
@@ -601,11 +599,12 @@ fi
 AM_CONDITIONAL(HAVE_LIBIDN2, test "$with_libidn2" != "no")
 
 if test "x$have_vista_dynamic" = "xno"; then
-  AC_CHECK_TYPES([BCRYPT_ALG_HANDLE],[LIBBCRYPT="-lbcrypt"],[],[#include <windows.h>
+  AC_CHECK_TYPES([BCRYPT_ALG_HANDLE],[
+    GNUTLS_LIBS_PRIVATE="${GNUTLS_LIBS_PRIVATE} -lbcrypt"
+  ],[],[#include <windows.h>
   #include <bcrypt.h>])
 fi
 AM_CONDITIONAL(HAVE_BCRYPT, test "$ac_cv_type_BCRYPT_ALG_HANDLE" = "yes")
-AC_SUBST([LIBBCRYPT])
 
 AC_ARG_ENABLE(non-suiteb-curves,
   AS_HELP_STRING([--disable-non-suiteb-curves], [disable curves not in SuiteB]),
@@ -937,6 +936,7 @@ AC_CHECK_SIZEOF(time_t, 4)
 # export for use in scripts
 AC_SUBST(ac_cv_sizeof_time_t)
 
+AC_SUBST(GNUTLS_LIBS_PRIVATE)
 AC_SUBST(GNUTLS_REQUIRES_PRIVATE)
 
 
index f55f298f7b9386a26a2b522c4bf866312974fb7d..fa47ac5e62c2c5a1624cd6933cccc88113a0ed14 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) $(LIB_CRYPT32)
+       $(P11_KIT_LIBS) $(LIB_SELECT) $(GNUTLS_LIBS_PRIVATE)
 
 if HAVE_LIBIDN2
 thirdparty_libadd += $(LIBIDN2_LIBS)
index 0ed41e2ddd88c3dec0590d724b058fa879748473..7cdedda5d7ecaab85bddb411085c7b1037de9d46 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@ @LIB_CRYPT32@ @LIBNCRYPT@ @LIBBCRYPT@
+Libs.private: @LIBINTL@ @LIBSOCKET@ @INET_PTON_LIB@ @LIBPTHREAD@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LIBUNISTRING@ @LIBATOMIC_LIBS@ @GNUTLS_LIBS_PRIVATE@
 @GNUTLS_REQUIRES_PRIVATE@
 Cflags: -I${includedir}