Author: rfm
Date: Mon Jun 30 08:28:38 2014
New Revision: 37966

URL: http://svn.gna.org/viewcvs/gnustep?rev=37966&view=rev
Log:
Yavor Doganov's patch to avoid unnecessary link to libgcrypt

Modified:
    libs/base/trunk/ChangeLog
    libs/base/trunk/Source/GSTLS.h
    libs/base/trunk/Source/GSTLS.m
    libs/base/trunk/configure
    libs/base/trunk/configure.ac

Modified: libs/base/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=37966&r1=37965&r2=37966&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Mon Jun 30 08:28:38 2014
@@ -8,6 +8,10 @@
        * Tools/DocMakefile:
        Flags alterations to build documentation before base/autogsdoc is
        installed.
+        * configure.ac: Test whether gnutls needs libgcrypt
+        * Source/GSTLS.h: Use test
+        * Source/GSTLS.m: Use test
+        * configure: regenerate
 
 2014-06-26 Riccardo Mottola <[email protected]>
 

Modified: libs/base/trunk/Source/GSTLS.h
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSTLS.h?rev=37966&r1=37965&r2=37966&view=diff
==============================================================================
--- libs/base/trunk/Source/GSTLS.h      (original)
+++ libs/base/trunk/Source/GSTLS.h      Mon Jun 30 08:28:38 2014
@@ -49,7 +49,9 @@
 #define        _GCRYPT_IN_LIBGCRYPT
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
 #include <gcrypt.h>
+#endif
 #undef id
 
 /* This class is used to ensure that the GNUTLS system is initialised

Modified: libs/base/trunk/Source/GSTLS.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/GSTLS.m?rev=37966&r1=37965&r2=37966&view=diff
==============================================================================
--- libs/base/trunk/Source/GSTLS.m      (original)
+++ libs/base/trunk/Source/GSTLS.m      Mon Jun 30 08:28:38 2014
@@ -67,6 +67,7 @@
 
 #if     defined(HAVE_GNUTLS)
 
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
 /* Set up locking callbacks for gcrypt so that it will be thread-safe.
  */
 static int gcry_mutex_init(void **priv)
@@ -98,6 +99,7 @@
   gcry_mutex_lock,
   gcry_mutex_unlock
 };
+#endif
 
 static void
 GSTLSLog(int level, const char *msg)
@@ -324,9 +326,11 @@
                    name: NSUserDefaultsDidChangeNotification
                  object: nil];
 
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
           /* Make gcrypt thread-safe
            */
           gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_other);
+#endif
 
           /* Initialise gnutls
            */

Modified: libs/base/trunk/configure
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/configure?rev=37966&r1=37965&r2=37966&view=diff
==============================================================================
--- libs/base/trunk/configure   (original)
+++ libs/base/trunk/configure   Mon Jun 30 08:28:38 2014
@@ -25301,7 +25301,8 @@
     fi
   fi
   if test $HAVE_GNUTLS = 1; then
-    { $as_echo "$as_me:$LINENO: checking for gcry_control in -lgcrypt" >&5
+    if ! pkg-config --atleast-version=2.12 gnutls; then
+      { $as_echo "$as_me:$LINENO: checking for gcry_control in -lgcrypt" >&5
 $as_echo_n "checking for gcry_control in -lgcrypt... " >&6; }
 if test "${ac_cv_lib_gcrypt_gcry_control+set}" = set; then
   $as_echo_n "(cached) " >&6
@@ -25372,12 +25373,11 @@
   have_gcrypt=no
 fi
 
-    if test "$have_gcrypt" = "no"; then
-      { $as_echo "$as_me:$LINENO: WARNING: Missing support for thread-safe 
operation in GNUTLS.  Disabling TLS support)." >&5
-$as_echo "$as_me: WARNING: Missing support for thread-safe operation in 
GNUTLS.  Disabling TLS support)." >&2;}
-      HAVE_GNUTLS=0
-    else
-      TLS_LIBS="$TLS_LIBS -lgcrypt"
+      if test "$have_gcrypt" = "no"; then
+        HAVE_GNUTLS=0
+      else
+        TLS_LIBS="$TLS_LIBS -lgcrypt"
+      fi
     fi
   fi
   if test $HAVE_GNUTLS = 0; then

Modified: libs/base/trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/configure.ac?rev=37966&r1=37965&r2=37966&view=diff
==============================================================================
--- libs/base/trunk/configure.ac        (original)
+++ libs/base/trunk/configure.ac        Mon Jun 30 08:28:38 2014
@@ -3130,12 +3130,13 @@
     fi
   fi
   if test $HAVE_GNUTLS = 1; then
-    AC_CHECK_LIB(gcrypt, gcry_control, have_gcrypt=yes, have_gcrypt=no)
-    if test "$have_gcrypt" = "no"; then
-      AC_MSG_WARN([Missing support for thread-safe operation in GNUTLS.  
Disabling TLS support).])
-      HAVE_GNUTLS=0
-    else
-      TLS_LIBS="$TLS_LIBS -lgcrypt"
+    if ! pkg-config --atleast-version=2.12 gnutls; then
+      AC_CHECK_LIB(gcrypt, gcry_control, have_gcrypt=yes, have_gcrypt=no)
+      if test "$have_gcrypt" = "no"; then
+        HAVE_GNUTLS=0
+      else
+        TLS_LIBS="$TLS_LIBS -lgcrypt"
+      fi
     fi
   fi
   if test $HAVE_GNUTLS = 0; then


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to