]> git.eshelyaron.com Git - emacs.git/commitdiff
Support GnuTLS v3.4 and later on MS-Windows
authorChris Zheng <chriszheng99@gmail.com>
Sat, 11 Apr 2015 15:06:52 +0000 (18:06 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 11 Apr 2015 15:06:52 +0000 (18:06 +0300)
* src/gnutls.c (syms_of_gnutls) <libgnutls-version>: New DEFSYM.
* lisp/term/w32-win.el (dynamic-library-alist): Determine which
GnuTLS DLL to load according to value of libgnutls-version.

Fixes: bug#20294
Copyright-paperwork-exempt: yes

lisp/term/w32-win.el
src/gnutls.c

index b5e6ff34743addfcaf1b4082766704061ffe57f2..b0667e6c4f7b00097cd687f21787bf727180426f 100644 (file)
@@ -214,6 +214,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
 (defvar libgif-version)
 (defvar libjpeg-version)
 
+(defvar libgnutls-version)              ; gnutls.c
+
 ;;; Set default known names for external libraries
 (setq dynamic-library-alist
       (list
@@ -266,7 +268,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
        '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
        '(glib "libglib-2.0-0.dll")
        '(gobject "libgobject-2.0-0.dll")
-       '(gnutls "libgnutls-28.dll" "libgnutls-26.dll")
+       (if (>= libgnutls-version 30400)
+          '(gnutls "libgnutls-30.dll")
+        '(gnutls "libgnutls-28.dll" "libgnutls-26.dll"))
        '(libxml2 "libxml2-2.dll" "libxml2.dll")
        '(zlib "zlib1.dll" "libz-1.dll")))
 
index 35f0eb48bc110665fc3e3a4ac2d4b4573c6915fe..ddd36a91e9f61b30965b1311b6a0901f6e6cf521 100644 (file)
@@ -1645,6 +1645,16 @@ DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
 void
 syms_of_gnutls (void)
 {
+  DEFSYM (Qlibgnutls_version, "libgnutls-version");
+  Fset (Qlibgnutls_version,
+#ifdef HAVE_GNUTLS
+       make_number (GNUTLS_VERSION_MAJOR * 10000
+                    + GNUTLS_VERSION_MINOR * 100
+                    + GNUTLS_VERSION_PATCH)
+#else
+       make_number (-1)
+#endif
+        );
 #ifdef HAVE_GNUTLS
   gnutls_global_initialized = 0;