On 2011-08-31 Russell Coker <[email protected]> wrote:
> I would appreciate it if you could write a patch for configure.in to
> check for the version.

> I've already put an ifdef around the code in question, but it'll
> still get a useless link.

Hello,
I honestly do not understand this,there is no -lgcrypt in any of the
linker lines, but even with  -Wl,--as-needed
-Wl,--no-copy-dt-needed-entries the binaries are linked against
libgcrypt. Has to be some g++ magic. Anyway, if I #if all gcrypt
related the gcrypt dependency is gone. (See attached patch).

cu andreas
--- a/bhm.cpp	2008-05-26 11:43:52.000000000 +0200
+++ b/bhm.cpp	2011-09-04 14:22:53.000000000 +0200
@@ -21,9 +21,11 @@
 #include "basictcp.h"
 #ifdef USE_GNUTLS
 #include <errno.h>
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
 #include <gcrypt.h>
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #endif
+#endif
 
 int processes = 0;
 int *thread_status;
@@ -320,7 +322,9 @@ int main(int argc, char **argv)
 #endif
   unsigned short port = 25;
 #ifdef USE_GNUTLS
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
   gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+#endif
   gnutls_global_init();
   if(!gnutls_check_version(GNUTLS_VER))
   {
--- a/postal.cpp	2007-01-14 05:40:23.000000000 +0100
+++ b/postal.cpp	2011-09-04 14:23:24.000000000 +0200
@@ -12,9 +12,11 @@
 #include "logit.h"
 #ifdef USE_GNUTLS
 #include <errno.h>
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
 #include <gcrypt.h>
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #endif
+#endif
 
 void usage()
 {
@@ -57,7 +59,9 @@ int main(int argc, char **argv)
   int ssl = 0;
 #endif
 #ifdef USE_GNUTLS
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
   gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+#endif
   gnutls_global_init();
   if(!gnutls_check_version(GNUTLS_VER))
   {
--- a/rabid.cpp	2008-05-26 11:40:30.000000000 +0200
+++ b/rabid.cpp	2011-09-04 14:18:53.000000000 +0200
@@ -14,9 +14,11 @@
 #include "logit.h"
 #ifdef USE_GNUTLS
 #include <errno.h>
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
 #include <gcrypt.h>
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #endif
+#endif
 
 void usage()
 {
@@ -59,7 +61,9 @@ int main(int argc, char **argv)
   bool debugMultipleFiles = false;
   bool strip_domain = false;
 #ifdef USE_GNUTLS
+#if GNUTLS_VERSION_NUMBER <= 0x020b00
   gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+#endif
   gnutls_global_init();
   if(!gnutls_check_version(GNUTLS_VER))
   {

Reply via email to