Skip to content

Commit

Permalink
build: Allow linking against an external copy of nghttp2.
Browse files Browse the repository at this point in the history
The version of nghttp2 in deps/ does not build on CloudABI, even though
the official version does. Though this is an issue on its own that needs
to be resolved, it is currently a bit hard to work around this. There is
no switch to link against an external version of nghttp2, even though we
do provide this option for other libraries.

This change adds configure flags, similar to the ones we have for
OpenSSL, zlib, http_parser, libuv, etc. and makes the dependency on
deps/nghttp2 optional.

PR-URL: #16788
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
EdSchouten authored and gibfahn committed Dec 19, 2017
1 parent 92e0e2e commit 72e2535
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
22 changes: 22 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,27 @@ shared_optgroup.add_option('--shared-libuv-libpath',
dest='shared_libuv_libpath',
help='a directory to search for the shared libuv DLL')

shared_optgroup.add_option('--shared-nghttp2',
action='store_true',
dest='shared_nghttp2',
help='link to a shared nghttp2 DLL instead of static linking')

shared_optgroup.add_option('--shared-nghttp2-includes',
action='store',
dest='shared_nghttp2_includes',
help='directory containing nghttp2 header files')

shared_optgroup.add_option('--shared-nghttp2-libname',
action='store',
dest='shared_nghttp2_libname',
default='nghttp2',
help='alternative lib name to link to [default: %default]')

shared_optgroup.add_option('--shared-nghttp2-libpath',
action='store',
dest='shared_nghttp2_libpath',
help='a directory to search for the shared nghttp2 DLLs')

shared_optgroup.add_option('--shared-openssl',
action='store_true',
dest='shared_openssl',
Expand Down Expand Up @@ -1407,6 +1428,7 @@ configure_library('zlib', output)
configure_library('http_parser', output)
configure_library('libuv', output)
configure_library('libcares', output)
configure_library('nghttp2', output)
# stay backwards compatible with shared cares builds
output['variables']['node_shared_cares'] = \
output['variables'].pop('node_shared_libcares')
Expand Down
13 changes: 10 additions & 3 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'node_shared_http_parser%': 'false',
'node_shared_cares%': 'false',
'node_shared_libuv%': 'false',
'node_shared_nghttp2%': 'false',
'node_use_openssl%': 'true',
'node_shared_openssl%': 'false',
'node_v8_options%': '',
Expand Down Expand Up @@ -162,7 +163,6 @@

'dependencies': [
'node_js2c#host',
'deps/nghttp2/nghttp2.gyp:nghttp2'
],

'includes': [
Expand All @@ -172,8 +172,7 @@
'include_dirs': [
'src',
'tools/msvs/genfiles',
'<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
'deps/nghttp2/lib/includes'
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
],

'sources': [
Expand Down Expand Up @@ -906,6 +905,14 @@
'deps/uv/uv.gyp:libuv'
]
}],
[ 'node_shared_nghttp2=="false"', {
'dependencies': [
'deps/nghttp2/nghttp2.gyp:nghttp2'
],
'include_dirs': [
'deps/nghttp2/lib/includes'
]
}],
[ 'node_use_v8_platform=="true"', {
'dependencies': [
'deps/v8/src/v8.gyp:v8_libplatform',
Expand Down
4 changes: 4 additions & 0 deletions node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@
'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
}],

[ 'node_shared_nghttp2=="false"', {
'dependencies': [ 'deps/nghttp2/nghttp2.gyp:nghttp2' ],
}],

[ 'OS=="mac"', {
# linking Corefoundation is needed since certain OSX debugging tools
# like Instruments require it for some features
Expand Down

0 comments on commit 72e2535

Please sign in to comment.