Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYihong Wang <yh.wang@ibm.com>2018-02-02 21:06:33 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2018-02-16 19:30:16 +0300
commitec9e7922bb72ce17b453d345232a0e725883a470 (patch)
tree9a8784d93eb487fd813abd638c1ef2dc6a64db33 /node.gyp
parent3e1e450f92f3a605bfad125d1f4288ccaa83d09b (diff)
test: add lib path env when node_shared=true
When building the node with `--shared` option, the major output is the shared library. However, we still build a node executable which links to the shared lib. It's for testing purpose. When testing with the executable, some test cases move/copy the executable, change the relative path to the shared library and fail. Using lib path env would solve the issue. However, in macOS, need to change the install name for the shared library and use rpath in the executable. In AIX, `-brtl` linker option rebinds the symbols in the executable and addon modules could use them. Signed-off-by: Yihong Wang <yh.wang@ibm.com> PR-URL: https://github.com/nodejs/node/pull/18626 Refs: https://github.com/nodejs/node/issues/18535 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'node.gyp')
-rw-r--r--node.gyp12
1 files changed, 12 insertions, 0 deletions
diff --git a/node.gyp b/node.gyp
index 826543a9d17..8e41cc053d4 100644
--- a/node.gyp
+++ b/node.gyp
@@ -260,6 +260,11 @@
}],
],
}],
+ [ 'node_shared=="true"', {
+ 'xcode_settings': {
+ 'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
+ },
+ }],
[ 'node_intermediate_lib_type=="shared_library" and OS=="win"', {
# On Windows, having the same name for both executable and shared
# lib causes filename collision. Need a different PRODUCT_NAME for
@@ -416,6 +421,10 @@
'conditions': [
[ 'node_shared=="true" and node_module_version!="" and OS!="win"', {
'product_extension': '<(shlib_suffix)',
+ 'xcode_settings': {
+ 'LD_DYLIB_INSTALL_NAME':
+ '@rpath/lib<(node_core_target_name).<(shlib_suffix)'
+ },
}],
['node_shared=="true" and OS=="aix"', {
'product_name': 'node_base',
@@ -1130,6 +1139,9 @@
'<@(library_files)',
'common.gypi',
],
+ 'direct_dependent_settings': {
+ 'ldflags': [ '-Wl,-brtl' ],
+ },
},
]
}], # end aix section