Skip to content

Commit 336af9a

Browse files
EdSchoutenrefack
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 ad1967d commit 336af9a

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

configure

Lines changed: 22 additions & 0 deletions
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

Lines changed: 10 additions & 3 deletions
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%': '',
@@ -177,7 +178,6 @@
177178

178179
'dependencies': [
179180
'node_js2c#host',
180-
'deps/nghttp2/nghttp2.gyp:nghttp2'
181181
],
182182

183183
'includes': [
@@ -187,8 +187,7 @@
187187
'include_dirs': [
188188
'src',
189189
'tools/msvs/genfiles',
190-
'<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
191-
'deps/nghttp2/lib/includes'
190+
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
192191
],
193192

194193
'sources': [
@@ -930,6 +929,14 @@
930929
'deps/uv/uv.gyp:libuv'
931930
]
932931
}],
932+
[ 'node_shared_nghttp2=="false"', {
933+
'dependencies': [
934+
'deps/nghttp2/nghttp2.gyp:nghttp2'
935+
],
936+
'include_dirs': [
937+
'deps/nghttp2/lib/includes'
938+
]
939+
}],
933940
[ 'node_use_v8_platform=="true"', {
934941
'dependencies': [
935942
'deps/v8/src/v8.gyp:v8_libplatform',

node.gypi

Lines changed: 4 additions & 0 deletions
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)