diff options
author | Bert Belder <bertbelder@gmail.com> | 2011-02-16 05:09:02 +0100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-02-15 20:15:46 -0800 |
commit | 3ef6433255cfeabdeb70bbfa51ac32a287c5d243 (patch) | |
tree | 335084ce6c870c10e633f385eb7314226f2b93ab | |
parent | c365f5606121c4a1b8edbf260a0e32199e453fe7 (diff) | |
download | node-3ef6433255cfeabdeb70bbfa51ac32a287c5d243.tar.gz |
MinGW: OpenSSL support
-rw-r--r-- | wscript | 47 |
1 files changed, 44 insertions, 3 deletions
@@ -4,7 +4,7 @@ import Options import sys, os, shutil, glob import Utils from Utils import cmd_output -from os.path import join, dirname, abspath +from os.path import join, dirname, abspath, normpath from logging import fatal cwd = os.getcwd() @@ -101,6 +101,20 @@ def set_options(opt): , dest='shared_v8_libname' ) + opt.add_option( '--openssl-includes' + , action='store' + , default=False + , help='A directory to search for the OpenSSL includes' + , dest='openssl_includes' + ) + + opt.add_option( '--openssl-libpath' + , action='store' + , default=False + , help="A directory to search for the OpenSSL libraries" + , dest='openssl_libpath' + ) + opt.add_option( '--oprofile' , action='store_true' , default=False @@ -247,17 +261,44 @@ def configure(conf): Options.options.use_openssl = conf.env["USE_OPENSSL"] = True conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1") else: - libssl = conf.check_cc(lib=['ssl', 'crypto'], + if o.openssl_libpath: + openssl_libpath = [o.openssl_libpath] + elif not sys.platform.startswith('win32'): + openssl_libpath = ['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib'] + else: + openssl_libpath = [normpath(join(cwd, '../openssl'))] + + if o.openssl_includes: + openssl_includes = [o.openssl_includes] + elif not sys.platform.startswith('win32'): + openssl_includes = []; + else: + openssl_includes = [normpath(join(cwd, '../openssl/include'))]; + + openssl_lib_names = ['ssl', 'crypto'] + if sys.platform.startswith('win32'): + openssl_lib_names += ['ws2_32', 'gdi32'] + + libssl = conf.check_cc(lib=openssl_lib_names, header_name='openssl/ssl.h', function_name='SSL_library_init', - libpath=['/usr/lib', '/usr/local/lib', '/opt/local/lib', '/usr/sfw/lib'], + includes=openssl_includes, + libpath=openssl_libpath, uselib_store='OPENSSL') + libcrypto = conf.check_cc(lib='crypto', header_name='openssl/crypto.h', + includes=openssl_includes, + libpath=openssl_libpath, uselib_store='OPENSSL') + if libcrypto and libssl: conf.env["USE_OPENSSL"] = Options.options.use_openssl = True conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1") + elif sys.platform.startswith('win32'): + conf.fatal("Could not autodetect OpenSSL support. " + + "Use the --openssl-libpath and --openssl-includes options to set the search path. " + + "Use configure --without-ssl to disable this message.") else: conf.fatal("Could not autodetect OpenSSL support. " + "Make sure OpenSSL development packages are installed. " + |