| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5b75572 commit 7e75a78
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -251,6 +251,11 @@ | |||
| 251 | 251 | }], | |
| 252 | 252 | ], | |
| 253 | 253 | }], | |
| 254 | + [ 'node_shared=="true"', { | ||
| 255 | + 'xcode_settings': { | ||
| 256 | + 'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ], | ||
| 257 | + }, | ||
| 258 | + }], | ||
| 254 | 259 | [ 'node_intermediate_lib_type=="shared_library" and OS=="win"', { | |
| 255 | 260 | # On Windows, having the same name for both executable and shared | |
| 256 | 261 | # lib causes filename collision. Need a different PRODUCT_NAME for | |
@@ -402,6 +407,10 @@ | |||
| 402 | 407 | 'conditions': [ | |
| 403 | 408 | [ 'node_shared=="true" and node_module_version!="" and OS!="win"', { | |
| 404 | 409 | 'product_extension': '<(shlib_suffix)', | |
| 410 | + 'xcode_settings': { | ||
| 411 | + 'LD_DYLIB_INSTALL_NAME': | ||
| 412 | + '@rpath/lib<(node_core_target_name).<(shlib_suffix)' | ||
| 413 | + }, | ||
| 405 | 414 | }], | |
| 406 | 415 | ['node_shared=="true" and OS=="aix"', { | |
| 407 | 416 | 'product_name': 'node_base', | |
@@ -1113,6 +1122,9 @@ | |||
| 1113 | 1122 | '<@(library_files)', | |
| 1114 | 1123 | 'common.gypi', | |
| 1115 | 1124 | ], | |
| 1125 | + 'direct_dependent_settings': { | ||
| 1126 | + 'ldflags': [ '-Wl,-brtl' ], | ||
| 1127 | + }, | ||
| 1116 | 1128 | }, | |
| 1117 | 1129 | ] | |
| 1118 | 1130 | }], # end aix section | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,29 @@ | |||
| 1 | + /* eslint-disable required-modules */ | ||
| 2 | + 'use strict'; | ||
| 3 | + const path = require('path'); | ||
| 4 | + | ||
| 5 | + // If node executable is linked to shared lib, need to take care about the | ||
| 6 | + // shared lib path. | ||
| 7 | + exports.addLibraryPath = function(env) { | ||
| 8 | + if (!process.config.variables.node_shared) { | ||
| 9 | + return; | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + env = env || process.env; | ||
| 13 | + | ||
| 14 | + env.LD_LIBRARY_PATH = | ||
| 15 | + (env.LD_LIBRARY_PATH ? env.LD_LIBRARY_PATH + path.delimiter : '') + | ||
| 16 | + path.join(path.dirname(process.execPath), 'lib.target'); | ||
| 17 | + // For AIX. | ||
| 18 | + env.LIBPATH = | ||
| 19 | + (env.LIBPATH ? env.LIBPATH + path.delimiter : '') + | ||
| 20 | + path.join(path.dirname(process.execPath), 'lib.target'); | ||
| 21 | + // For Mac OSX. | ||
| 22 | + env.DYLD_LIBRARY_PATH = | ||
| 23 | + (env.DYLD_LIBRARY_PATH ? env.DYLD_LIBRARY_PATH + path.delimiter : '') + | ||
| 24 | + path.dirname(process.execPath); | ||
| 25 | + // For Windows. | ||
| 26 | + env.PATH = | ||
| 27 | + (env.PATH ? env.PATH + path.delimiter : '') + | ||
| 28 | + path.dirname(process.execPath); | ||
| 29 | + }; | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -28,6 +28,9 @@ const tmpdir = require('../common/tmpdir'); | |||
| 28 | 28 | const msg = { test: 'this' }; | |
| 29 | 29 | const nodePath = process.execPath; | |
| 30 | 30 | const copyPath = path.join(tmpdir.path, 'node-copy.exe'); | |
| 31 | + const { addLibraryPath } = require('../common/shared-lib-util'); | ||
| 32 | + | ||
| 33 | + addLibraryPath(process.env); | ||
| 31 | 34 | ||
| 32 | 35 | if (process.env.FORK) { | |
| 33 | 36 | assert(process.send); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,9 @@ const path = require('path'); | |||
| 6 | 6 | const fs = require('fs'); | |
| 7 | 7 | const child_process = require('child_process'); | |
| 8 | 8 | const pkgName = 'foo'; | |
| 9 | + const { addLibraryPath } = require('../common/shared-lib-util'); | ||
| 10 | + | ||
| 11 | + addLibraryPath(process.env); | ||
| 9 | 12 | ||
| 10 | 13 | if (process.argv[2] === 'child') { | |
| 11 | 14 | console.log(require(pkgName).string); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments