pulseaudio: fix dependencies for openssl-3
[oi-userland.git] / components / mail / opendkim / patches / openssl_1.1.0_compat.patch
blob383990832a390a37f0c5667744a1ddf1bb085210
1 Description: Build and work with either openssl 1.0.2 or 1.1.0
2 * Add patch to build with either openssl 1.0.2 or 1.1.0 (Closes: #828466)
3 - Thanks to Sebastian Andrzej Siewior for the patch
4 Author: Sebastian Andrzej Siewior
5 Bug-Debian: http://bugs.debian.org/828466
6 Origin: vendor
7 Forwarded: no
8 Reviewed-By: Scott Kitterman <scott@kitterman.com>
9 Last-Update: <YYYY-MM-DD>
11 --- opendkim-2.11.0~alpha.orig/configure.ac
12 +++ opendkim-2.11.0~alpha/configure.ac
13 @@ -864,26 +864,28 @@ then
14 AC_SEARCH_LIBS([ERR_peek_error], [crypto], ,
15 AC_MSG_ERROR([libcrypto not found]))
17 - AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
18 - [
19 - if test x"$enable_shared" = x"yes"
20 - then
21 - AC_MSG_ERROR([Cannot build shared opendkim
22 - against static openssl libraries.
23 - Configure with --disable-shared
24 - to get this working or obtain a
25 - shared libssl library for
26 - opendkim to use.])
27 - fi
29 - # avoid caching issue - last result of SSL_library_init
30 - # shouldn't be cached for this next check
31 - unset ac_cv_search_SSL_library_init
32 - LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
33 - AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
34 - AC_MSG_ERROR([libssl not found]), [-ldl])
35 - ]
36 - )
37 + AC_LINK_IFELSE(
38 + [AC_LANG_PROGRAM([[#include <openssl/ssl.h>]],
39 + [[SSL_library_init();]])],
40 + [od_have_ossl="yes";],
41 + [od_have_ossl="no";])
42 + if test x"$od_have_ossl" = x"no"
43 + then
44 + if test x"$enable_shared" = x"yes"
45 + then
46 + AC_MSG_ERROR([Cannot build shared opendkim
47 + against static openssl libraries.
48 + Configure with --disable-shared
49 + to get this working or obtain a
50 + shared libssl library for
51 + opendkim to use.])
52 + fi
54 + LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl"
55 + AC_SEARCH_LIBS([SSL_library_init], [ssl], ,
56 + AC_MSG_ERROR([libssl not found]), [-ldl])
57 + fi
59 AC_CHECK_DECL([SHA256_DIGEST_LENGTH],
60 AC_DEFINE([HAVE_SHA256], 1,
61 --- opendkim-2.11.0~alpha.orig/opendkim/opendkim-crypto.c
62 +++ opendkim-2.11.0~alpha/opendkim/opendkim-crypto.c
63 @@ -222,7 +222,11 @@ dkimf_crypto_free_id(void *ptr)
65 assert(pthread_setspecific(id_key, ptr) == 0);
67 +#if OPENSSL_VERSION_NUMBER >= 0x10100000
68 + OPENSSL_thread_stop();
69 +#else
70 ERR_remove_state(0);
71 +#endif
73 free(ptr);
75 @@ -392,11 +396,15 @@ dkimf_crypto_free(void)
77 if (crypto_init_done)
79 +#if OPENSSL_VERSION_NUMBER >= 0x10100000
80 + OPENSSL_thread_stop();
81 +#else
82 CRYPTO_cleanup_all_ex_data();
83 CONF_modules_free();
84 EVP_cleanup();
85 ERR_free_strings();
86 ERR_remove_state(0);
87 +#endif
89 if (nmutexes > 0)