From 30601b680fe33330bf5033bc433160d48fedcd2d Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Tue, 13 Jan 2026 02:31:12 +0100 Subject: [PATCH] build: add `--shared-nbytes` configure flag PR-URL: https://github.com/nodejs/node/pull/61341 Reviewed-By: Yagiz Nizipli Reviewed-By: Aviv Keller Reviewed-By: Colin Ihrig --- configure.py | 23 +++++++++++++++++++++++ node.gyp | 31 ++++++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/configure.py b/configure.py index f53391f16a4..66ed3d62bc6 100755 --- a/configure.py +++ b/configure.py @@ -351,6 +351,28 @@ shared_optgroup.add_argument('--shared-libuv-libpath', dest='shared_libuv_libpath', help='a directory to search for the shared libuv DLL') +shared_optgroup.add_argument('--shared-nbytes', + action='store_true', + dest='shared_nbytes', + default=None, + help='link to a shared nbytes DLL instead of static linking') + +shared_optgroup.add_argument('--shared-nbytes-includes', + action='store', + dest='shared_nbytes_includes', + help='directory containing nbytes header files') + +shared_optgroup.add_argument('--shared-nbytes-libname', + action='store', + dest='shared_nbytes_libname', + default='nbytes', + help='alternative lib name to link to [default: %(default)s]') + +shared_optgroup.add_argument('--shared-nbytes-libpath', + action='store', + dest='shared_nbytes_libpath', + help='a directory to search for the shared nbytes DLL') + shared_optgroup.add_argument('--shared-nghttp2', action='store_true', dest='shared_nghttp2', @@ -2344,6 +2366,7 @@ configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc']) configure_library('cares', output, pkgname='libcares') configure_library('gtest', output) configure_library('hdr_histogram', output) +configure_library('nbytes', output) configure_library('nghttp2', output, pkgname='libnghttp2') configure_library('nghttp3', output, pkgname='libnghttp3') configure_library('ngtcp2', output, pkgname='libngtcp2') diff --git a/node.gyp b/node.gyp index bd57f222283..2ed589f2b6a 100644 --- a/node.gyp +++ b/node.gyp @@ -18,6 +18,7 @@ 'node_shared_hdr_histogram%': 'false', 'node_shared_http_parser%': 'false', 'node_shared_libuv%': 'false', + 'node_shared_nbytes%': 'false', 'node_shared_nghttp2%': 'false', 'node_shared_openssl%': 'false', 'node_shared_sqlite%': 'false', @@ -863,7 +864,6 @@ '<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h ], 'dependencies': [ - 'deps/nbytes/nbytes.gyp:nbytes', 'tools/v8_gypfiles/abseil.gyp:abseil', 'node_js2c#host', ], @@ -935,6 +935,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_use_sqlite=="true"', { 'sources': [ '<@(node_sqlite_sources)', @@ -1173,7 +1178,6 @@ 'type': 'executable', 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', ], 'includes': [ 'node.gypi' @@ -1206,6 +1210,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_shared_uvwasi=="false"', { 'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ], 'include_dirs': [ 'deps/uvwasi/include' ], @@ -1229,7 +1238,6 @@ 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', 'tools/v8_gypfiles/abseil.gyp:abseil', ], @@ -1269,6 +1277,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_use_openssl=="true"', { 'defines': [ 'HAVE_OPENSSL=1', @@ -1329,7 +1342,6 @@ 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', ], 'includes': [ @@ -1369,6 +1381,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], ['OS=="win"', { 'libraries': [ 'Dbghelp.lib', @@ -1453,7 +1470,6 @@ 'dependencies': [ '<(node_lib_target_name)', - 'deps/nbytes/nbytes.gyp:nbytes', ], 'includes': [ @@ -1490,6 +1506,11 @@ 'deps/histogram/histogram.gyp:histogram', ], }], + [ 'node_shared_nbytes=="false"', { + 'dependencies': [ + 'deps/nbytes/nbytes.gyp:nbytes', + ], + }], [ 'node_use_openssl=="true"', { 'dependencies': [ 'deps/ncrypto/ncrypto.gyp:ncrypto',