Skip to content

Commit

Permalink
Check if OpenSSL supports SSL_COMP_get_compression_methods().
Browse files Browse the repository at this point in the history
  • Loading branch information
bnoordhuis committed Jul 3, 2011
1 parent 69d20f5 commit 649c1e8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,7 @@ void InitCrypto(Handle<Object> target) {
ERR_load_crypto_strings();

// Turn off compression. Saves memory - do it in userland.
#ifdef SSL_COMP_get_compression_methods
#ifdef HAVE_SSL_COMP_GET_COMPRESSION_METHODS
// Before OpenSSL 0.9.8 this was not possible.
STACK_OF(SSL_COMP)* comp_methods = SSL_COMP_get_compression_methods();
sk_SSL_COMP_zero(comp_methods);
Expand Down
24 changes: 20 additions & 4 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,9 @@ def configure(conf):
uselib_store="EXECINFO"):
conf.fatal("Install the libexecinfo port from /usr/ports/devel/libexecinfo.")

if not Options.options.without_ssl:
if o.without_ssl:
o.use_openssl = conf.env["USE_OPENSSL"] = False
else:
# Don't override explicitly supplied openssl paths with pkg-config results.
explicit_openssl = o.openssl_includes or o.openssl_libpath

Expand All @@ -272,7 +274,7 @@ def configure(conf):
if not explicit_openssl and conf.check_cfg(package='openssl',
args='--cflags --libs',
uselib_store='OPENSSL'):
Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
o.use_openssl = conf.env["USE_OPENSSL"] = True
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
else:
if o.openssl_libpath:
Expand Down Expand Up @@ -317,8 +319,22 @@ def configure(conf):
conf.fatal("Could not autodetect OpenSSL support. " +
"Make sure OpenSSL development packages are installed. " +
"Use configure --without-ssl to disable this message.")
else:
Options.options.use_openssl = conf.env["USE_OPENSSL"] = False

# use='OPENSSL' doesn't work with our version of waf
# and we have to use a fragment because function_name
# wont't detect macros :(
conf.check_cc(fragment='''
#include <openssl/ssl.h>
int main(void) {
(void) SSL_COMP_get_compression_methods();
return 0;
}
''',
function_name='SSL_COMP_get_compression_methods',
includes=conf.env['INCLUDES_OPENSSL'],
defines=conf.env['DEFINES_OPENSSL'],
libpath=conf.env['LIBPATH_OPENSSL'],
lib=conf.env['LIB_OPENSSL'])

conf.check(lib='util', libpath=['/usr/lib', '/usr/local/lib'],
uselib_store='UTIL')
Expand Down

0 comments on commit 649c1e8

Please sign in to comment.