Mercurial > mxe-octave
annotate src/gnutls-1-fixes.patch @ 2768:172cd8ec1feb
update package gnutls
author | Mark Brand <mabrand@mabrand.nl> |
---|---|
date | Thu, 20 Sep 2012 13:10:23 +0200 |
parents | 185b0c693c77 |
children | 1a91124dd342 |
rev | line source |
---|---|
2333
f653602a0500
Rebrand to new project name MXE
Volker Grabsch <vog@notjusthosting.com>
parents:
2285
diff
changeset
|
1 This file is part of MXE. |
2353
99516e73b368
Move doc/index.html -> index.html
Volker Grabsch <vog@notjusthosting.com>
parents:
2333
diff
changeset
|
2 See index.html for further information. |
1923 | 3 |
4 Contains ad hoc patches for cross building. | |
5 | |
2768 | 6 From 90387fb055e690a0d47c247f2ec8c2478bc7c942 Mon Sep 17 00:00:00 2001 |
2389 | 7 From: Mark Brand <mabrand@mabrand.nl> |
2057 | 8 Date: Fri, 28 Oct 2011 09:23:41 +0200 |
2768 | 9 Subject: [PATCH 1/7] add missing static library linking |
1923 | 10 |
11 | |
12 diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in | |
2246 | 13 index c45f8f3..57d0dbb 100644 |
1923 | 14 --- a/lib/gnutls.pc.in |
15 +++ b/lib/gnutls.pc.in | |
2246 | 16 @@ -19,6 +19,6 @@ Description: Transport Security Layer implementation for the GNU system |
1923 | 17 URL: http://www.gnu.org/software/gnutls/ |
18 Version: @VERSION@ | |
19 Libs: -L${libdir} -lgnutls | |
2057 | 20 -Libs.private: @LTLIBNETTLE@ |
2128 | 21 +Libs.private: @LTLIBNETTLE@ @LIBS@ |
1923 | 22 @GNUTLS_REQUIRES_PRIVATE@ |
23 Cflags: -I${includedir} | |
24 -- | |
2641
832d15e602a6
package gnutls: revert to ver 3.0.19
Mark Brand <mabrand@mabrand.nl>
parents:
2570
diff
changeset
|
25 1.7.10.4 |
2128 | 26 |
1923 | 27 |
2768 | 28 From 622969864d2c2ae3e96572bae6e64e3d585d86eb Mon Sep 17 00:00:00 2001 |
2389 | 29 From: Mark Brand <mabrand@mabrand.nl> |
2128 | 30 Date: Thu, 24 Nov 2011 15:06:06 +0100 |
2768 | 31 Subject: [PATCH 2/7] disable doc and test (mingw-cross-env specific) |
2128 | 32 |
33 | |
34 diff --git a/Makefile.am b/Makefile.am | |
2768 | 35 index 2eebb77..1633fcb 100644 |
2128 | 36 --- a/Makefile.am |
37 +++ b/Makefile.am | |
2246 | 38 @@ -23,7 +23,7 @@ DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --disable-valgrind-tests |
2128 | 39 |
2246 | 40 SUBDIRS = gl lib extra po |
2128 | 41 |
2246 | 42 -SUBDIRS += src doc tests |
43 +SUBDIRS += src | |
2128 | 44 |
45 if HAVE_GUILE | |
46 SUBDIRS += guile | |
47 -- | |
2641
832d15e602a6
package gnutls: revert to ver 3.0.19
Mark Brand <mabrand@mabrand.nl>
parents:
2570
diff
changeset
|
48 1.7.10.4 |
2264 | 49 |
2389 | 50 |
2768 | 51 From 922dd8e34aeedfd2130339b037b92b61840d72eb Mon Sep 17 00:00:00 2001 |
2389 | 52 From: Mark Brand <mabrand@mabrand.nl> |
53 Date: Tue, 3 Apr 2012 13:58:42 +0200 | |
2768 | 54 Subject: [PATCH 3/7] Revert "make dist will also make lzip compressed |
2389 | 55 tarball" |
56 | |
57 This reverts commit 97ac1bc58274f651338444693bd75441ba12f46f. | |
58 | |
59 diff --git a/configure.ac b/configure.ac | |
2768 | 60 index ccd2729..8797ec7 100644 |
2389 | 61 --- a/configure.ac |
62 +++ b/configure.ac | |
2768 | 63 @@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.1.1], [bug-gnutls@gnu.org]) |
2389 | 64 AC_CONFIG_AUX_DIR([build-aux]) |
65 AC_CONFIG_MACRO_DIR([m4]) | |
66 | |
2768 | 67 -AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz dist-lzip -Wall -Werror -Wno-override]) |
68 +AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz -Wall -Werror -Wno-override]) | |
2389 | 69 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
70 AM_CONFIG_HEADER(config.h) | |
71 | |
72 -- | |
2641
832d15e602a6
package gnutls: revert to ver 3.0.19
Mark Brand <mabrand@mabrand.nl>
parents:
2570
diff
changeset
|
73 1.7.10.4 |
2389 | 74 |
2570 | 75 |
2768 | 76 From fcd06b20700bbf26b740d1c9d22750c829ef6216 Mon Sep 17 00:00:00 2001 |
2570 | 77 From: Mark Brand <mabrand@mabrand.nl> |
78 Date: Wed, 6 Jun 2012 09:57:24 +0200 | |
2768 | 79 Subject: [PATCH 4/7] AM_PROG_AR for automake 1.12 compatibility |
2570 | 80 |
81 Taken from | |
82 http://lists.gnu.org/archive/html/automake/2012-05/msg00014.html | |
83 | |
84 diff --git a/configure.ac b/configure.ac | |
2768 | 85 index 8797ec7..fb167f9 100644 |
2570 | 86 --- a/configure.ac |
87 +++ b/configure.ac | |
88 @@ -37,6 +37,7 @@ dnl Checks for programs. | |
89 AC_PROG_CC | |
90 AM_PROG_AS | |
91 AC_PROG_CXX | |
92 +m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) | |
93 gl_EARLY | |
94 | |
95 # For includes/gnutls/gnutls.h.in. | |
96 -- | |
2641
832d15e602a6
package gnutls: revert to ver 3.0.19
Mark Brand <mabrand@mabrand.nl>
parents:
2570
diff
changeset
|
97 1.7.10.4 |
2570 | 98 |
2668
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
99 |
2768 | 100 From 6b6c5670a25161c61c6bc24a45ede8a4daf6590b Mon Sep 17 00:00:00 2001 |
2668
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
101 From: Mark Brand <mabrand@mabrand.nl> |
2768 | 102 Date: Thu, 16 Aug 2012 11:13:47 +0200 |
103 Subject: [PATCH 5/7] allow automake warnings not to be errors | |
2668
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
104 |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
105 |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
106 diff --git a/configure.ac b/configure.ac |
2768 | 107 index fb167f9..36b4026 100644 |
2668
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
108 --- a/configure.ac |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
109 +++ b/configure.ac |
2768 | 110 @@ -25,7 +25,7 @@ AC_INIT([GnuTLS], [3.1.1], [bug-gnutls@gnu.org]) |
2668
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
111 AC_CONFIG_AUX_DIR([build-aux]) |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
112 AC_CONFIG_MACRO_DIR([m4]) |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
113 |
2768 | 114 -AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz -Wall -Werror -Wno-override]) |
115 +AM_INIT_AUTOMAKE([1.11.3 no-dist-gzip dist-xz -Wall -Wno-override]) | |
2668
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
116 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
117 AM_CONFIG_HEADER(config.h) |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
118 |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
119 -- |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
120 1.7.10.4 |
185b0c693c77
package gnutls: workaround for automake
Mark Brand <mabrand@mabrand.nl>
parents:
2641
diff
changeset
|
121 |
2768 | 122 |
123 From 46635a2529108e077ee2585bd3de5532415cf68b Mon Sep 17 00:00:00 2001 | |
124 From: Nikos Mavrogiannopoulos <nmav@gnutls.org> | |
125 Date: Sat, 15 Sep 2012 13:43:28 +0200 | |
126 Subject: [PATCH 6/7] mingw32 support. Based on patch by LRN. (cherry picked | |
127 from commit 2cc740eb52abac318176c49f8e8358666c8457cd) | |
128 | |
129 | |
130 diff --git a/lib/gnutls_global.c b/lib/gnutls_global.c | |
131 index 8b84f46..4c9eabf 100644 | |
132 --- a/lib/gnutls_global.c | |
133 +++ b/lib/gnutls_global.c | |
134 @@ -270,6 +270,13 @@ gnutls_global_init (void) | |
135 goto out; | |
136 } | |
137 | |
138 + result = gnutls_system_global_init (); | |
139 + if (result < 0) | |
140 + { | |
141 + gnutls_assert (); | |
142 + goto out; | |
143 + } | |
144 + | |
145 #ifdef ENABLE_PKCS11 | |
146 gnutls_pkcs11_init (GNUTLS_PKCS11_FLAG_AUTO, NULL); | |
147 #endif | |
148 @@ -302,6 +309,7 @@ gnutls_global_deinit (void) | |
149 asn1_delete_structure (&_gnutls_pkix1_asn); | |
150 _gnutls_crypto_deregister (); | |
151 _gnutls_cryptodev_deinit (); | |
152 + gnutls_system_global_deinit (); | |
153 #ifdef ENABLE_PKCS11 | |
154 gnutls_pkcs11_deinit (); | |
155 #endif | |
156 diff --git a/lib/system.c b/lib/system.c | |
157 index 067f189..b22e07d 100644 | |
158 --- a/lib/system.c | |
159 +++ b/lib/system.c | |
160 @@ -31,6 +31,11 @@ | |
161 #ifdef _WIN32 | |
162 # include <windows.h> | |
163 # include <wincrypt.h> | |
164 +# if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20 | |
165 +typedef PCCRL_CONTEXT WINAPI (*Type_CertEnumCRLsInStore) (HCERTSTORE hCertStore, PCCRL_CONTEXT pPrevCrlContext); | |
166 +static Type_CertEnumCRLsInStore Loaded_CertEnumCRLsInStore; | |
167 +static HMODULE Crypt32_dll; | |
168 +# endif | |
169 | |
170 #else | |
171 # ifdef HAVE_PTHREAD_LOCKS | |
172 @@ -51,10 +56,7 @@ | |
173 /* System specific function wrappers. | |
174 */ | |
175 | |
176 -/* wrappers for write() and writev() | |
177 - */ | |
178 #ifdef _WIN32 | |
179 - | |
180 int | |
181 system_errno (gnutls_transport_ptr p) | |
182 { | |
183 @@ -150,9 +152,6 @@ int fd = GNUTLS_POINTER_TO_INT(ptr); | |
184 /* Thread stuff */ | |
185 | |
186 #ifdef HAVE_WIN32_LOCKS | |
187 - | |
188 - | |
189 -/* FIXME: win32 locks are untested */ | |
190 static int | |
191 gnutls_system_mutex_init (void **priv) | |
192 { | |
193 @@ -285,6 +284,41 @@ mutex_deinit_func gnutls_mutex_deinit = gnutls_system_mutex_deinit; | |
194 mutex_lock_func gnutls_mutex_lock = gnutls_system_mutex_lock; | |
195 mutex_unlock_func gnutls_mutex_unlock = gnutls_system_mutex_unlock; | |
196 | |
197 +int | |
198 +gnutls_system_global_init () | |
199 +{ | |
200 +#ifdef _WIN32 | |
201 +# if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20 | |
202 + HMODULE crypto; | |
203 + crypto = LoadLibraryA ("Crypt32.dll"); | |
204 + | |
205 + if (crypto == NULL) | |
206 + return GNUTLS_E_CRYPTO_INIT_FAILED; | |
207 + | |
208 + Loaded_CertEnumCRLsInStore = (Type_CertEnumCRLsInStore) GetProcAddress (crypto, "CertEnumCRLsInStore"); | |
209 + if (Loaded_CertEnumCRLsInStore == NULL) | |
210 + { | |
211 + FreeLibrary (crypto); | |
212 + return GNUTLS_E_CRYPTO_INIT_FAILED; | |
213 + } | |
214 + | |
215 + Crypt32_dll = crypto; | |
216 +# endif | |
217 +#endif | |
218 + return 0; | |
219 +} | |
220 + | |
221 +void | |
222 +gnutls_system_global_deinit () | |
223 +{ | |
224 +#ifdef _WIN32 | |
225 +# if defined(__MINGW32__) && !defined(__MINGW64__) && __MINGW32_MAJOR_VERSION <= 3 && __MINGW32_MINOR_VERSION <= 20 | |
226 + FreeLibrary (Crypt32_dll); | |
227 +# endif | |
228 +#endif | |
229 +} | |
230 + | |
231 + | |
232 #define CONFIG_PATH ".gnutls" | |
233 | |
234 /* Returns a path to store user-specific configuration | |
235 @@ -392,7 +426,7 @@ gnutls_x509_trust_list_add_system_trust(gnutls_x509_trust_list_t list, | |
236 if (store == NULL) return GNUTLS_E_FILE_ERROR; | |
237 | |
238 cert = CertEnumCertificatesInStore(store, NULL); | |
239 - crl = CertEnumCRLsInStore(store, NULL); | |
240 + crl = Loaded_CertEnumCRLsInStore(store, NULL); | |
241 | |
242 while(cert != NULL) | |
243 { | |
244 @@ -414,7 +448,7 @@ gnutls_x509_trust_list_add_system_trust(gnutls_x509_trust_list_t list, | |
245 data.size = crl->cbCrlEncoded; | |
246 gnutls_x509_trust_list_add_trust_mem(list, NULL, &data, GNUTLS_X509_FMT_DER, tl_flags, tl_vflags); | |
247 } | |
248 - crl = CertEnumCRLsInStore(store, crl); | |
249 + crl = Loaded_CertEnumCRLsInStore(store, crl); | |
250 } | |
251 CertCloseStore(store, 0); | |
252 } | |
253 diff --git a/lib/system.h b/lib/system.h | |
254 index 0178bd5..0afbdd2 100644 | |
255 --- a/lib/system.h | |
256 +++ b/lib/system.h | |
257 @@ -71,4 +71,7 @@ struct timespec ts; | |
258 | |
259 int _gnutls_find_config_path(char* path, size_t max_size); | |
260 | |
261 +int gnutls_system_global_init (); | |
262 +void gnutls_system_global_deinit (); | |
263 + | |
264 #endif /* SYSTEM_H */ | |
265 -- | |
266 1.7.10.4 | |
267 | |
268 | |
269 From ee1fab5fb04a698fb50e6ba2b571424ef40ffbbe Mon Sep 17 00:00:00 2001 | |
270 From: Mark Brand <mabrand@mabrand.nl> | |
271 Date: Thu, 20 Sep 2012 12:59:19 +0200 | |
272 Subject: [PATCH 7/7] add missing libs to Libs.private | |
273 | |
274 | |
275 diff --git a/lib/gnutls.pc.in b/lib/gnutls.pc.in | |
276 index 57d0dbb..02a6ef7 100644 | |
277 --- a/lib/gnutls.pc.in | |
278 +++ b/lib/gnutls.pc.in | |
279 @@ -19,6 +19,6 @@ Description: Transport Security Layer implementation for the GNU system | |
280 URL: http://www.gnu.org/software/gnutls/ | |
281 Version: @VERSION@ | |
282 Libs: -L${libdir} -lgnutls | |
283 -Libs.private: @LTLIBNETTLE@ @LIBS@ | |
284 +Libs.private: @LTLIBNETTLE@ @LIBS@ -lcrypt32 -lws2_32 | |
285 @GNUTLS_REQUIRES_PRIVATE@ | |
286 Cflags: -I${includedir} | |
287 -- | |
288 1.7.10.4 | |
289 |