@@ -65,20 +65,43 @@ parser.add_option("--shared-v8-libname",
65
65
dest = "shared_v8_libname" ,
66
66
help = "Alternative lib name to link to (default: 'v8')" )
67
67
68
+ parser .add_option ("--shared-openssl" ,
69
+ action = "store_true" ,
70
+ dest = "shared_openssl" ,
71
+ help = "Link to a shared OpenSSl DLL instead of static linking" )
72
+
73
+ parser .add_option ("--shared-openssl-includes" ,
74
+ action = "store" ,
75
+ dest = "shared_openssl_includes" ,
76
+ help = "Directory containing OpenSSL header files" )
77
+
78
+ parser .add_option ("--shared-openssl-libpath" ,
79
+ action = "store" ,
80
+ dest = "shared_openssl_libpath" ,
81
+ help = "A directory to search for the shared OpenSSL DLLs" )
82
+
83
+ parser .add_option ("--shared-openssl-libname" ,
84
+ action = "store" ,
85
+ dest = "shared_openssl_libname" ,
86
+ help = "Alternative lib name to link to (default: 'crypto,ssl')" )
87
+
88
+ # deprecated
68
89
parser .add_option ("--openssl-use-sys" ,
69
90
action = "store_true" ,
70
- dest = "openssl_use_sys " ,
71
- help = "Use the system OpenSSL instead of one included with Node" )
91
+ dest = "shared_openssl " ,
92
+ help = optparse . SUPPRESS_HELP )
72
93
94
+ # deprecated
73
95
parser .add_option ("--openssl-includes" ,
74
96
action = "store" ,
75
- dest = "openssl_includes " ,
76
- help = "A directory to search for the OpenSSL includes" )
97
+ dest = "shared_openssl_includes " ,
98
+ help = optparse . SUPPRESS_HELP )
77
99
100
+ # deprecated
78
101
parser .add_option ("--openssl-libpath" ,
79
102
action = "store" ,
80
- dest = "openssl_libpath " ,
81
- help = "A directory to search for the OpenSSL libraries" )
103
+ dest = "shared_openssl_libpath " ,
104
+ help = optparse . SUPPRESS_HELP )
82
105
83
106
parser .add_option ("--no-ssl2" ,
84
107
action = "store_true" ,
@@ -293,6 +316,8 @@ def configure_node(o):
293
316
else :
294
317
o ['variables' ]['node_use_dtrace' ] = 'false'
295
318
319
+ if options .no_ifaddrs :
320
+ o ['defines' ] += ['SUNOS_NO_IFADDRS' ]
296
321
297
322
# By default, enable ETW on Windows.
298
323
if sys .platform .startswith ('win32' ):
@@ -334,35 +359,31 @@ def configure_v8(o):
334
359
335
360
def configure_openssl (o ):
336
361
o ['variables' ]['node_use_openssl' ] = b (not options .without_ssl )
362
+ o ['variables' ]['node_shared_openssl' ] = b (options .shared_openssl )
337
363
338
364
if options .without_ssl :
339
365
return
340
366
341
- if options .no_ifaddrs :
342
- o ['defines' ] += ['SUNOS_NO_IFADDRS' ]
343
-
344
367
if options .no_ssl2 :
345
368
o ['defines' ] += ['OPENSSL_NO_SSL2=1' ]
346
369
347
- if not options .openssl_use_sys :
348
- o ['variables' ]['node_shared_openssl' ] = b (False )
349
- else :
350
- out = pkg_config ('openssl' )
351
- (libs , cflags ) = out if out else ('' , '' )
370
+ if options .shared_openssl :
371
+ (libs , cflags ) = pkg_config ('openssl' ) or ('-lssl -lcrypto' , '' )
352
372
353
- if options .openssl_libpath :
354
- o ['libraries' ] += ['-L%s' % options .openssl_libpath , '-lssl' , '-lcrypto' ]
373
+ if options .shared_openssl_libpath :
374
+ o ['libraries' ] += ['-L%s' % options .shared_openssl_libpath ]
375
+
376
+ if options .shared_openssl_libname :
377
+ libnames = options .shared_openssl_libname .split (',' )
378
+ o ['libraries' ] += ['-l%s' % s for s in libnames ]
355
379
else :
356
380
o ['libraries' ] += libs .split ()
357
381
358
- if options .openssl_includes :
359
- o ['include_dirs' ] += [options .openssl_includes ]
382
+ if options .shared_openssl_includes :
383
+ o ['include_dirs' ] += [options .shared_openssl_includes ]
360
384
else :
361
385
o ['cflags' ] += cflags .split ()
362
386
363
- o ['variables' ]['node_shared_openssl' ] = b (
364
- libs or cflags or options .openssl_libpath or options .openssl_includes )
365
-
366
387
367
388
output = {
368
389
'variables' : {},
0 commit comments