Skip to content

Commit 09bd797

Browse files
EdSchoutenMylesBorins
authored andcommitted
build: Allow linking against an external copy of nghttp2.
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 <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
1 parent 4954eef commit 09bd797

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

configure

+22
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,27 @@ shared_optgroup.add_option('--shared-libuv-libpath',
220220
dest='shared_libuv_libpath',
221221
help='a directory to search for the shared libuv DLL')
222222

223+
shared_optgroup.add_option('--shared-nghttp2',
224+
action='store_true',
225+
dest='shared_nghttp2',
226+
help='link to a shared nghttp2 DLL instead of static linking')
227+
228+
shared_optgroup.add_option('--shared-nghttp2-includes',
229+
action='store',
230+
dest='shared_nghttp2_includes',
231+
help='directory containing nghttp2 header files')
232+
233+
shared_optgroup.add_option('--shared-nghttp2-libname',
234+
action='store',
235+
dest='shared_nghttp2_libname',
236+
default='nghttp2',
237+
help='alternative lib name to link to [default: %default]')
238+
239+
shared_optgroup.add_option('--shared-nghttp2-libpath',
240+
action='store',
241+
dest='shared_nghttp2_libpath',
242+
help='a directory to search for the shared nghttp2 DLLs')
243+
223244
shared_optgroup.add_option('--shared-openssl',
224245
action='store_true',
225246
dest='shared_openssl',
@@ -1415,6 +1436,7 @@ configure_library('zlib', output)
14151436
configure_library('http_parser', output)
14161437
configure_library('libuv', output)
14171438
configure_library('libcares', output)
1439+
configure_library('nghttp2', output)
14181440
# stay backwards compatible with shared cares builds
14191441
output['variables']['node_shared_cares'] = \
14201442
output['variables'].pop('node_shared_libcares')

node.gyp

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
'node_shared_http_parser%': 'false',
1717
'node_shared_cares%': 'false',
1818
'node_shared_libuv%': 'false',
19+
'node_shared_nghttp2%': 'false',
1920
'node_use_openssl%': 'true',
2021
'node_shared_openssl%': 'false',
2122
'node_v8_options%': '',
@@ -173,7 +174,6 @@
173174

174175
'dependencies': [
175176
'node_js2c#host',
176-
'deps/nghttp2/nghttp2.gyp:nghttp2'
177177
],
178178

179179
'includes': [
@@ -183,8 +183,7 @@
183183
'include_dirs': [
184184
'src',
185185
'tools/msvs/genfiles',
186-
'<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
187-
'deps/nghttp2/lib/includes'
186+
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
188187
],
189188

190189
'sources': [
@@ -923,6 +922,14 @@
923922
'deps/uv/uv.gyp:libuv'
924923
]
925924
}],
925+
[ 'node_shared_nghttp2=="false"', {
926+
'dependencies': [
927+
'deps/nghttp2/nghttp2.gyp:nghttp2'
928+
],
929+
'include_dirs': [
930+
'deps/nghttp2/lib/includes'
931+
]
932+
}],
926933
[ 'node_use_v8_platform=="true"', {
927934
'dependencies': [
928935
'deps/v8/src/v8.gyp:v8_libplatform',

node.gypi

+4
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@
133133
'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
134134
}],
135135

136+
[ 'node_shared_nghttp2=="false"', {
137+
'dependencies': [ 'deps/nghttp2/nghttp2.gyp:nghttp2' ],
138+
}],
139+
136140
[ 'OS=="mac"', {
137141
# linking Corefoundation is needed since certain OSX debugging tools
138142
# like Instruments require it for some features

0 commit comments

Comments
 (0)