Browse Source

MinGW: OpenSSL support

v0.7.4-release
Bert Belder 14 years ago
committed by Ryan Dahl
parent
commit
3ef6433255
  1. 47
      wscript

47
wscript

@ -4,7 +4,7 @@ import Options
import sys, os, shutil, glob import sys, os, shutil, glob
import Utils import Utils
from Utils import cmd_output from Utils import cmd_output
from os.path import join, dirname, abspath from os.path import join, dirname, abspath, normpath
from logging import fatal from logging import fatal
cwd = os.getcwd() cwd = os.getcwd()
@ -101,6 +101,20 @@ def set_options(opt):
, dest='shared_v8_libname' , 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' opt.add_option( '--oprofile'
, action='store_true' , action='store_true'
, default=False , default=False
@ -247,17 +261,44 @@ def configure(conf):
Options.options.use_openssl = conf.env["USE_OPENSSL"] = True Options.options.use_openssl = conf.env["USE_OPENSSL"] = True
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1") conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1")
else: 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', header_name='openssl/ssl.h',
function_name='SSL_library_init', 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') uselib_store='OPENSSL')
libcrypto = conf.check_cc(lib='crypto', libcrypto = conf.check_cc(lib='crypto',
header_name='openssl/crypto.h', header_name='openssl/crypto.h',
includes=openssl_includes,
libpath=openssl_libpath,
uselib_store='OPENSSL') uselib_store='OPENSSL')
if libcrypto and libssl: if libcrypto and libssl:
conf.env["USE_OPENSSL"] = Options.options.use_openssl = True conf.env["USE_OPENSSL"] = Options.options.use_openssl = True
conf.env.append_value("CPPFLAGS", "-DHAVE_OPENSSL=1") 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: else:
conf.fatal("Could not autodetect OpenSSL support. " + conf.fatal("Could not autodetect OpenSSL support. " +
"Make sure OpenSSL development packages are installed. " + "Make sure OpenSSL development packages are installed. " +

Loading…
Cancel
Save