Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2021-03-10 00:29:20 +0300
committerJames M Snell <jasnell@gmail.com>2021-03-19 18:18:35 +0300
commit2b710c1413735ad8b497c5d6faf399d0f8c2c577 (patch)
treee14c9a5d29cd3775ce5c3fc3722bb801f613b4f0 /tools
parent65e8864fa39fb51250d63212548807589cba08f3 (diff)
tools: partially detect quic support in shared_openssl
If the shared openssl does not have the `OPENSSL_INFO_QUIC` define, then it definitely does not have the QUIC apis. This is only a partially accurate check because it does not detect if the shared openssl was actually *built* without the OPENSSL_NO_QUIC define set. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37682 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/getsharedopensslhasquic.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/getsharedopensslhasquic.py b/tools/getsharedopensslhasquic.py
new file mode 100644
index 00000000000..549a0eacdae
--- /dev/null
+++ b/tools/getsharedopensslhasquic.py
@@ -0,0 +1,19 @@
+from __future__ import print_function
+import os
+import re
+
+def get_has_quic(include_path):
+ openssl_crypto_h = os.path.join(
+ include_path,
+ 'openssl',
+ 'crypto.h')
+
+ f = open(openssl_crypto_h)
+
+ regex = '^#\s*define OPENSSL_INFO_QUIC'
+
+ for line in f:
+ if (re.match(regex, line)):
+ return True
+
+ return False