1 Disable all DLL init functions in libgpg-error, since they're
2 not actually run in statically linked libs. And libtool seems
3 to unconditionally set that flag on all Windows builds.
5 diff -ur libgpg-error.org/src/init.c libgpg-error/src/init.c
6 --- libgpg-error.org/src/init.c 2017-02-28 10:11:05.000000000 +0100
7 +++ libgpg-error/src/init.c 2017-11-23 16:44:56.850797400 +0100
11 #ifdef HAVE_W32_SYSTEM
13 +# ifdef HAVE_DLL_INIT
14 /* We always have a constructor and thus this function is called
15 automatically. Due to the way the C init code of mingw works,
16 the constructors are called before our DllMain function is
19 _gpg_err_deinit (int mode)
21 -#if defined (HAVE_W32_SYSTEM) && !defined(DLL_EXPORT)
22 +#if defined (HAVE_W32_SYSTEM) && !defined(HAVE_DLL_INIT)
23 struct tls_space_s *tls;
25 tls = TlsGetValue (tls_index);
29 /* Entry point called by the DLL loader. */
33 DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
35 diff -ur libgpg-error.org/src/w32-gettext.c libgpg-error/src/w32-gettext.c
36 --- libgpg-error.org/src/w32-gettext.c 2016-12-02 22:51:19.000000000 +0100
37 +++ libgpg-error/src/w32-gettext.c 2017-11-23 16:43:28.450453000 +0100
39 DLL. If used as a static lib we can't control the process set; for
40 example it might be used with a main module which is not build with
41 mingw and thus does not know how to call the constructors. */
44 static void module_init (void) _GPG_ERR_CONSTRUCTOR;
51 -#if !defined(DLL_EXPORT) || !defined(_GPG_ERR_HAVE_CONSTRUCTOR)
52 +#if !defined(HAVE_DLL_INIT) || !defined(_GPG_ERR_HAVE_CONSTRUCTOR)
54 _gpg_w32__init_gettext_module (void)