]> source.dussan.org Git - tigervnc.git/commitdiff
Support building with older versions of gnutls; Fix gnutls detection when building...
authorDRC <dcommander@users.sourceforge.net>
Thu, 30 Sep 2010 06:25:28 +0000 (06:25 +0000)
committerDRC <dcommander@users.sourceforge.net>
Thu, 30 Sep 2010 06:25:28 +0000 (06:25 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4147 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rdr/TLSInStream.cxx
common/rdr/TLSOutStream.cxx
configure.ac

index faf548c806c05b5620d16902899c21be0b2d986a..ddc9991737c0bd85263b9583529a7cdee4f27ae0 100644 (file)
 #include <rdr/TLSInStream.h>
 #include <errno.h>
 
+#ifdef HAVE_OLD_GNUTLS
+#define gnutls_transport_set_global_errno(A) do { errno = (A); } while(0)
+#endif
+
 #ifdef HAVE_GNUTLS 
 using namespace rdr;
 
index 888b455b586ee96581009e0b582825b73f067b40..d577ccc92d8511bf017c7195aa5500981c840116 100644 (file)
 #include <rdr/TLSOutStream.h>
 #include <errno.h>
 
+#ifdef HAVE_OLD_GNUTLS
+#define gnutls_transport_set_global_errno(A) do { errno = (A); } while(0)
+#endif
+
 #ifdef HAVE_GNUTLS
 using namespace rdr;
 
index c411f8a7e6e0e0b9270bd607dd42245763d900f2..4ea0706314d28464b3ab00b0b94f6442720fffd7 100644 (file)
@@ -76,8 +76,12 @@ AC_ARG_ENABLE([gnutls],
 GNUTLS_LIBS=
 if test "x$enable_gnutls" = xyes; then
        AC_CHECK_LIB([gnutls], [gnutls_global_init],
-                    [GNUTLS_LIBS='-lgnutls'
-                     AC_DEFINE([HAVE_GNUTLS], 1, [Is gnutls present? ])])
+                    [GNUTLS_LIBS='-lgnutls -lgcrypt -lgpg-error'
+                     AC_DEFINE([HAVE_GNUTLS], 1, [Is gnutls present? ])], [],
+                    [-lgcrypt -lgpg-error])
+       AC_CHECK_LIB([gnutls], [gnutls_transport_set_global_errno], [],
+                    [AC_DEFINE([HAVE_OLD_GNUTLS], 1, [Does gnutls lack the gnutls_transport_set_global_errno() function? ])],
+                    [-lgcrypt -lgpg-error])
 fi
 AC_SUBST([GNUTLS_LIBS])
 AM_CONDITIONAL([HAVE_GNUTLS], [ ! test "x$GNUTLS_LIBS" = x ])