Index: tntnet-2.1/framework/common/Makefile.am
===================================================================
--- tntnet-2.1.orig/framework/common/Makefile.am	2012-02-01 21:36:41.000000000 +0200
+++ tntnet-2.1/framework/common/Makefile.am	2012-05-26 12:08:28.364369121 +0300
@@ -121,14 +121,13 @@
 
 if MAKE_GNUTLS
 libtntnet_la_SOURCES += \
-	gcryptinit.c \
 	gnutls.cpp
 
 noinst_HEADERS += \
 	tnt/gcryptinit.h \
 	tnt/gnutls.h
 
-libtntnet_la_LIBADD += -lgnutls -lgcrypt
+libtntnet_la_LIBADD += $(GNUTLS_LIBS)
 endif
 
 if MAKE_OPENSSL
Index: tntnet-2.1/framework/common/gnutls.cpp
===================================================================
--- tntnet-2.1.orig/framework/common/gnutls.cpp	2012-02-09 20:46:45.000000000 +0200
+++ tntnet-2.1/framework/common/gnutls.cpp	2012-05-26 12:09:43.232368194 +0300
@@ -32,7 +32,6 @@
 #include <cxxtools/mutex.h>
 #include <cxxtools/log.h>
 #include <sstream>
-#include "tnt/gcryptinit.h"
 #include <sys/poll.h>
 #include <errno.h>
 #include <cxxtools/ioerror.h>
@@ -150,11 +149,6 @@
     cxxtools::MutexLock lock(mutex);
     if (initCount++ == 0)
     {
-      log_debug("gcry_control");
-      ret = gcrypt_init();
-      if (ret != 0)
-        throw GnuTlsException("gcry_control", ret);
-
       log_debug("gnutls_global_init()");
       ret = gnutls_global_init();
       if (ret != 0)
Index: tntnet-2.1/configure.in
===================================================================
--- tntnet-2.1.orig/configure.in	2012-04-02 20:36:03.000000000 +0300
+++ tntnet-2.1/configure.in	2012-05-26 12:51:02.612337462 +0300
@@ -86,12 +86,12 @@
 
 case "$ssl_option" in
     gnutls)
-        AC_CHECK_HEADER([gnutls/gnutls.h], [
+	PKG_CHECK_MODULES([GNUTLS], [gnutls >= 2.11], [
             AC_MSG_RESULT([building with GnuTLS support])
             AC_DEFINE(WITH_GNUTLS, [], [Define to build with gnutls])
             with_gnutls=1
           ],
-          [AC_MSG_ERROR(gnutls-headers not not found)])
+          [AC_MSG_ERROR(gnutls >= 2.11 not found)])
         ;;
     openssl|yes)
         AC_CHECK_HEADER([openssl/ssl.h], [
