Permalink
Browse files

Check if OpenSSL supports SSL_COMP_get_compression_methods().

Fixes #1242.
  • Loading branch information...
1 parent 69d20f5 commit 649c1e8e262de175ad1759adbb85435c52ad92a9 @bnoordhuis committed Jul 3, 2011
Showing with 21 additions and 5 deletions.
  1. +1 −1 src/node_crypto.cc
  2. +20 −4 wscript
View
@@ -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);
View
24 wscript
@@ -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
@@ -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:
@@ -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')

0 comments on commit 649c1e8

Please sign in to comment.