Subject: bug#20294: 25.0.50; Make Emacs work with GnuTLS 3.4.0 on MS-Windows

From: Eli Zaretskii <[email-masked]>
Date: Fri, 10 Apr 2015 20:48:10 +0300

> Date: Sat, 11 Apr 2015 00:38:52 +0800
> From: Chris Zheng <[email-masked]>
> 
> After the release of GnuTLS 3.4.0, the DLL name of libgnutls has changed
> from `libgnutls-28.dll' to `libgnutls-30.dll', which makes Emacs unable
> to load the DLL.  Can we add this name to `dynamic-library-alist', as
> the following patch do?

No, because libgnutls-30.dll exports a binary-incompatible ABI (that's
why its name changes in the first place).  Just adding that DLL will
cause Emacs compiled against an older GnuTLS to try loading the new
DLL, or vice versa, which will most probably crash at run time.

Instead, we need to introduce a libgnutls-version variable, whose
value depends on the version of GnuTLS as conveyed by version-related
macros in the GnuTLS headers, and insert into dynamic-library-alist
the DLL whose name matches the version with which Emacs was compiled,
like we do with several image libraries.