aboutsummaryrefslogtreecommitdiff
path: root/lang/erlang/patches/033-Update-configure-scripts.patch
blob: cdc6af78210e9b694079f6509903893e99a34729 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From 2f27f4bf85971dc8d8e0c2dcef133729835458c5 Mon Sep 17 00:00:00 2001
From: Hans Nilsson <hans@erlang.org>
Date: Mon, 21 Feb 2022 14:58:35 +0100
Subject: [PATCH] Update configure scripts

---
 lib/crypto/configure | 50 ++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 48 insertions(+), 2 deletions(-)

--- a/lib/crypto/configure
+++ b/lib/crypto/configure
@@ -1423,7 +1423,9 @@ Optional Features:
   --disable-evp-dh        intentionally undocumented workaround
   --disable-evp-hmac      intentionally undocumented workaround
   --disable-otp-test-engine
-                          intentionally undocumented workaround
+                          Disable build of the otp_test_engine. (default is
+                          --enable-otp-test-engine, unless for LibreSSL >=
+                          3.5.0 where default is --disable-otp-test-engine)
   --disable-deprecated-warnings
                           disable warnings for deprecated functions in
                           cryptolib (default is to warn, except for OpenSSL
@@ -5108,7 +5110,7 @@ if test "${enable_otp_test_engine+set}"
     *)    DISABLE_OTP_TEST_ENGINE=no;;
   esac
 else
-  DISABLE_OTP_TEST_ENGINE=no
+  DISABLE_OTP_TEST_ENGINE=default
 fi
 
 
@@ -5300,6 +5302,28 @@ else
 fi
 rm -f conftest*
 
+
+if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
+# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <openssl/opensslv.h>
+#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "^yes.?$" >/dev/null 2>&1; then :
+  DISABLE_OTP_TEST_ENGINE=yes
+else
+  DISABLE_OTP_TEST_ENGINE=no
+fi
+rm -f conftest*
+
+    fi
+
     CPPFLAGS="$save_CPPFLAGS"
 
     if test $valid_include != yes; then
@@ -5705,6 +5729,28 @@ else
 fi
 rm -f conftest*
 
+
+if test "x$DISABLE_OTP_TEST_ENGINE" = "xdefault"; then
+# Get default value for the --disable-otp-test-engine. Depends on cryptolib version
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <openssl/opensslv.h>
+#if LIBRESSL_VERSION_NUMBER >= 0x3050000fL
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "^yes.?$" >/dev/null 2>&1; then :
+  DISABLE_OTP_TEST_ENGINE=yes
+else
+  DISABLE_OTP_TEST_ENGINE=no
+fi
+rm -f conftest*
+
+    fi
+
     CPPFLAGS="$save_CPPFLAGS"
 
     if test $valid_include != yes; then