Skip to content

Commit 2253be9

Browse files
committed
deps: reintroduce supporting shared c-ares builds
As of cc192f0e we've now in sync with upstream which means that we also can allow our users to build against a shared version of c-ares. Note: It is still up to users to make sure that the library version is on par with what Node.js bundles. This "reverts" commit 25fa5c4. PR-URL: #5775 Reviewed-By: Fedor Indutny <fedor@indutny.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent ea63f79 commit 2253be9

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

configure

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,27 @@ shared_optgroup.add_option('--shared-zlib-libpath',
202202
dest='shared_zlib_libpath',
203203
help='a directory to search for the shared zlib DLL')
204204

205+
shared_optgroup.add_option('--shared-cares',
206+
action='store_true',
207+
dest='shared_libcares',
208+
help='link to a shared cares DLL instead of static linking')
209+
210+
shared_optgroup.add_option('--shared-cares-includes',
211+
action='store',
212+
dest='shared_libcares_includes',
213+
help='directory containing cares header files')
214+
215+
shared_optgroup.add_option('--shared-cares-libname',
216+
action='store',
217+
dest='shared_libcares_libname',
218+
default='cares',
219+
help='alternative lib name to link to [default: %default]')
220+
221+
shared_optgroup.add_option('--shared-cares-libpath',
222+
action='store',
223+
dest='shared_libcares_libpath',
224+
help='a directory to search for the shared cares DLL')
225+
205226
parser.add_option_group(shared_optgroup)
206227

207228
parser.add_option('--systemtap-includes',
@@ -1125,6 +1146,10 @@ configure_node(output)
11251146
configure_library('zlib', output)
11261147
configure_library('http_parser', output)
11271148
configure_library('libuv', output)
1149+
configure_library('libcares', output)
1150+
# stay backwards compatible with shared cares builds
1151+
output['variables']['node_shared_cares'] = \
1152+
output['variables'].pop('node_shared_libcares')
11281153
configure_v8(output)
11291154
configure_openssl(output)
11301155
configure_intl(output)

node.gyp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
'node_no_browser_globals%': 'false',
99
'node_shared_zlib%': 'false',
1010
'node_shared_http_parser%': 'false',
11+
'node_shared_cares%': 'false',
1112
'node_shared_libuv%': 'false',
1213
'node_use_openssl%': 'true',
1314
'node_shared_openssl%': 'false',
@@ -107,7 +108,6 @@
107108

108109
'dependencies': [
109110
'node_js2c#host',
110-
'deps/cares/cares.gyp:cares',
111111
'deps/v8/tools/gyp/v8.gyp:v8',
112112
'deps/v8/tools/gyp/v8.gyp:v8_libplatform'
113113
],
@@ -391,6 +391,10 @@
391391
'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ],
392392
}],
393393

394+
[ 'node_shared_cares=="false"', {
395+
'dependencies': [ 'deps/cares/cares.gyp:cares' ],
396+
}],
397+
394398
[ 'node_shared_libuv=="false"', {
395399
'dependencies': [ 'deps/uv/uv.gyp:libuv' ],
396400
}],

tools/install.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,11 @@ def headers(action):
164164
if sys.platform.startswith('aix'):
165165
action(['out/Release/node.exp'], 'include/node/')
166166

167-
subdir_files('deps/cares/include', 'include/node/', action)
168167
subdir_files('deps/v8/include', 'include/node/', action)
169168

169+
if 'false' == variables.get('node_shared_cares'):
170+
subdir_files('deps/cares/include', 'include/node/', action)
171+
170172
if 'false' == variables.get('node_shared_libuv'):
171173
subdir_files('deps/uv/include', 'include/node/', action)
172174

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy