Skip to content

Commit f315029

Browse files
committed
build: rename openssl configure switches
For consistency's sake, rename: --openssl-use-sys --openssl-includes --openssl-libpath To: --shared-openssl --shared-openssl-includes --shared-openssl-libpath And add --shared-openssl-libname while we're at it. The old switches still work but `./configure --help` won't print them. Fixes nodejs#3591.
1 parent 7e5aeac commit f315029

File tree

1 file changed

+42
-21
lines changed

1 file changed

+42
-21
lines changed

configure

+42-21
Original file line numberDiff line numberDiff line change
@@ -65,20 +65,43 @@ parser.add_option("--shared-v8-libname",
6565
dest="shared_v8_libname",
6666
help="Alternative lib name to link to (default: 'v8')")
6767

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
6889
parser.add_option("--openssl-use-sys",
6990
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)
7293

94+
# deprecated
7395
parser.add_option("--openssl-includes",
7496
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)
7799

100+
# deprecated
78101
parser.add_option("--openssl-libpath",
79102
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)
82105

83106
parser.add_option("--no-ssl2",
84107
action="store_true",
@@ -293,6 +316,8 @@ def configure_node(o):
293316
else:
294317
o['variables']['node_use_dtrace'] = 'false'
295318

319+
if options.no_ifaddrs:
320+
o['defines'] += ['SUNOS_NO_IFADDRS']
296321

297322
# By default, enable ETW on Windows.
298323
if sys.platform.startswith('win32'):
@@ -334,35 +359,31 @@ def configure_v8(o):
334359

335360
def configure_openssl(o):
336361
o['variables']['node_use_openssl'] = b(not options.without_ssl)
362+
o['variables']['node_shared_openssl'] = b(options.shared_openssl)
337363

338364
if options.without_ssl:
339365
return
340366

341-
if options.no_ifaddrs:
342-
o['defines'] += ['SUNOS_NO_IFADDRS']
343-
344367
if options.no_ssl2:
345368
o['defines'] += ['OPENSSL_NO_SSL2=1']
346369

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', '')
352372

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]
355379
else:
356380
o['libraries'] += libs.split()
357381

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]
360384
else:
361385
o['cflags'] += cflags.split()
362386

363-
o['variables']['node_shared_openssl'] = b(
364-
libs or cflags or options.openssl_libpath or options.openssl_includes)
365-
366387

367388
output = {
368389
'variables': {},

0 commit comments

Comments
 (0)