diff --git a/configure.py b/configure.py index 096d40a13ab..bb0f8019da6 100755 --- a/configure.py +++ b/configure.py @@ -38,6 +38,7 @@ import nodedownload sys.path.insert(0, 'tools') import getmoduleversion import getnapibuildversion +import getsharedopensslhasquic from gyp_node import run_gyp # parse our options @@ -1348,6 +1349,7 @@ def configure_openssl(o): variables['node_shared_openssl'] = b(options.shared_openssl) variables['openssl_is_fips'] = b(options.openssl_is_fips) variables['openssl_fips'] = '' + variables['openssl_quic'] = b(True) if options.openssl_no_asm: variables['openssl_no_asm'] = 1 @@ -1403,6 +1405,9 @@ def configure_openssl(o): if options.openssl_fips or options.openssl_fips == '': error('FIPS is not supported in this version of Node.js') + if options.shared_openssl: + variables['openssl_quic'] = b(getsharedopensslhasquic.get_has_quic(options.__dict__['shared_openssl_includes'])) + configure_library('openssl', o) 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