257 lines
11 KiB
Diff
257 lines
11 KiB
Diff
diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi
|
|
index b4ac369a..4f866859 100644
|
|
--- a/deps/npm/node_modules/node-gyp/addon.gypi
|
|
+++ b/deps/npm/node_modules/node-gyp/addon.gypi
|
|
@@ -71,7 +71,7 @@
|
|
# that the addon will work regardless of whether the node/iojs binary
|
|
# is named node.exe, iojs.exe, or something else.
|
|
'conditions': [
|
|
- [ 'OS=="win"', {
|
|
+ [ 'OS=="msvc"', {
|
|
'defines': [ 'HOST_BINARY=\"<(node_host_binary)<(EXECUTABLE_SUFFIX)\"', ],
|
|
'sources': [
|
|
'<(node_gyp_dir)/src/win_delay_load_hook.cc',
|
|
@@ -167,20 +167,21 @@
|
|
}
|
|
}]
|
|
],
|
|
+ 'library_dirs': [ '<(node_root_dir)/lib' ],
|
|
'libraries': [
|
|
- '-lkernel32.lib',
|
|
- '-luser32.lib',
|
|
- '-lgdi32.lib',
|
|
- '-lwinspool.lib',
|
|
- '-lcomdlg32.lib',
|
|
- '-ladvapi32.lib',
|
|
- '-lshell32.lib',
|
|
- '-lole32.lib',
|
|
- '-loleaut32.lib',
|
|
- '-luuid.lib',
|
|
- '-lodbc32.lib',
|
|
- '-lDelayImp.lib',
|
|
- '-l"<(node_lib_file)"'
|
|
+ '-lkernel32',
|
|
+ '-luser32',
|
|
+ '-lgdi32',
|
|
+ '-lwinspool',
|
|
+ '-lcomdlg32',
|
|
+ '-ladvapi32',
|
|
+ '-lshell32',
|
|
+ '-lole32',
|
|
+ '-loleaut32',
|
|
+ '-luuid',
|
|
+ '-lodbc32',
|
|
+ '-ldelayimp',
|
|
+ '-lnode'
|
|
],
|
|
'msvs_disabled_warnings': [
|
|
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
|
|
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
|
|
index 77800661..3f35afd9 100755
|
|
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
|
|
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
|
|
@@ -533,7 +533,7 @@ def gyp_main(args):
|
|
# Nothing in the variable, default based on platform.
|
|
elif sys.platform == "darwin":
|
|
options.formats = ["xcode"]
|
|
- elif sys.platform in ("win32", "cygwin"):
|
|
+ elif sys.platform in ("win32", "cygwin") and not "GCC" in sys.version:
|
|
options.formats = ["msvs"]
|
|
else:
|
|
options.formats = ["make"]
|
|
diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
|
|
index e8604790..e199821f 100644
|
|
--- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
|
|
+++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py
|
|
@@ -103,6 +103,8 @@ def CalculateVariables(default_variables, params):
|
|
elif flavor == "zos":
|
|
default_variables.setdefault("SHARED_LIB_SUFFIX", ".x")
|
|
COMPILABLE_EXTENSIONS.update({".pli": "pli"})
|
|
+ elif flavor == "win":
|
|
+ default_variables.setdefault("SHARED_LIB_SUFFIX", ".dll")
|
|
else:
|
|
default_variables.setdefault("SHARED_LIB_SUFFIX", ".so")
|
|
default_variables.setdefault("SHARED_LIB_DIR", "$(builddir)/lib.$(TOOLSET)")
|
|
@@ -145,6 +147,26 @@ def CalculateGeneratorInputInfo(params):
|
|
SPACE_REPLACEMENT = "?"
|
|
|
|
|
|
+LINK_COMMANDS_WINMINGW = """\
|
|
+quiet_cmd_alink = AR($(TOOLSET)) $@
|
|
+cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
|
|
+
|
|
+quiet_cmd_alink_thin = AR($(TOOLSET)) $@
|
|
+cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
|
|
+
|
|
+# Due to circular dependencies between libraries :(, we wrap the
|
|
+# special "figure out circular dependencies" flags around the entire
|
|
+# input list during linking.
|
|
+quiet_cmd_link = LINK($(TOOLSET)) $@
|
|
+cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
|
|
+
|
|
+quiet_cmd_solink = SOLINK($(TOOLSET)) $@
|
|
+cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--out-implib,$(builddir)/$(@F).a -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
|
|
+
|
|
+quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
|
|
+cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) $(filter-out FORCE_DO_CMD, $^) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
|
|
+"""
|
|
+
|
|
LINK_COMMANDS_LINUX = """\
|
|
quiet_cmd_alink = AR($(TOOLSET)) $@
|
|
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
|
|
@@ -1585,6 +1607,8 @@ $(obj).$(TOOLSET)/$(TARGET)/%%.o: $(obj)/%%%s FORCE_DO_CMD
|
|
target_ext = ".a"
|
|
elif self.flavor == "zos":
|
|
target_ext = ".x"
|
|
+ elif self.flavor == "win":
|
|
+ target_ext = ".dll"
|
|
else:
|
|
target_ext = ".so"
|
|
elif self.type == "none":
|
|
@@ -2558,6 +2582,13 @@ def GenerateOutput(target_list, target_dicts, data, params):
|
|
elif flavor == "openbsd":
|
|
copy_archive_arguments = "-pPRf"
|
|
header_params.update({"copy_archive_args": copy_archive_arguments})
|
|
+ elif flavor == "win":
|
|
+ copy_archive_arguments = "-pPRf"
|
|
+ header_params.update(
|
|
+ {
|
|
+ "link_commands": LINK_COMMANDS_WINMINGW,
|
|
+ }
|
|
+ )
|
|
elif flavor == "aix":
|
|
copy_archive_arguments = "-pPRf"
|
|
header_params.update(
|
|
diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js
|
|
index 9c0cca8f..081c57bd 100644
|
|
--- a/deps/npm/node_modules/node-gyp/lib/build.js
|
|
+++ b/deps/npm/node_modules/node-gyp/lib/build.js
|
|
@@ -6,7 +6,7 @@ const path = require('path')
|
|
const { glob } = require('tinyglobby')
|
|
const log = require('./log')
|
|
const which = require('which')
|
|
-const win = process.platform === 'win32'
|
|
+const win = require('os').type() === 'Windows_NT'
|
|
|
|
async function build (gyp, argv) {
|
|
let platformMake = 'make'
|
|
@@ -193,7 +193,7 @@ async function build (gyp, argv) {
|
|
}
|
|
}
|
|
|
|
- if (!win) {
|
|
+ if (!process.platform === 'win32') {
|
|
// Add build-time dependency symlinks (such as Python) to PATH
|
|
buildBinsDir = path.resolve('build', 'node_gyp_bins')
|
|
process.env.PATH = `${buildBinsDir}:${process.env.PATH}`
|
|
diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js
|
|
index ee672cfb..35166375 100644
|
|
--- a/deps/npm/node_modules/node-gyp/lib/configure.js
|
|
+++ b/deps/npm/node_modules/node-gyp/lib/configure.js
|
|
@@ -5,7 +5,7 @@ const path = require('path')
|
|
const log = require('./log')
|
|
const os = require('os')
|
|
const processRelease = require('./process-release')
|
|
-const win = process.platform === 'win32'
|
|
+const win = require('os').type() === 'Windows_NT'
|
|
const findNodeDirectory = require('./find-node-directory')
|
|
const { createConfigGypi } = require('./create-config-gypi')
|
|
const { format: msgFormat } = require('util')
|
|
@@ -79,7 +79,7 @@ async function configure (gyp, argv) {
|
|
await gyp.commands.install([release.version])
|
|
|
|
log.verbose('get node dir', 'target node version installed:', release.versionDir)
|
|
- nodeDir = path.resolve(gyp.devDir, release.versionDir)
|
|
+ nodeDir = path.resolve(path.dirname(path.dirname(process.execPath)))
|
|
}
|
|
|
|
return createBuildDir()
|
|
@@ -263,8 +263,8 @@ async function configure (gyp, argv) {
|
|
const nodeGypDir = path.resolve(__dirname, '..')
|
|
|
|
let nodeLibFile = path.join(nodeDir,
|
|
- !gyp.opts.nodedir ? '<(target_arch)' : '$(Configuration)',
|
|
- release.name + '.lib')
|
|
+ !gyp.opts.nodedir ? 'lib' : 'lib',
|
|
+ 'lib' + release.name + '.dll.a')
|
|
|
|
argv.push('-I', addonGypi)
|
|
argv.push('-I', commonGypi)
|
|
diff --git a/deps/npm/node_modules/node-gyp/lib/create-config-gypi.js b/deps/npm/node_modules/node-gyp/lib/create-config-gypi.js
|
|
index 01a820e9..325e6bfe 100644
|
|
--- a/deps/npm/node_modules/node-gyp/lib/create-config-gypi.js
|
|
+++ b/deps/npm/node_modules/node-gyp/lib/create-config-gypi.js
|
|
@@ -3,6 +3,7 @@
|
|
const fs = require('graceful-fs').promises
|
|
const log = require('./log')
|
|
const path = require('path')
|
|
+const win = require('os').type() === 'Windows_NT'
|
|
|
|
function parseConfigGypi (config) {
|
|
// translated from tools/js2c.py of Node.js
|
|
@@ -81,7 +82,7 @@ async function getCurrentConfigGypi ({ gyp, nodeDir, vsInfo, python }) {
|
|
// disable -T "thin" static archives by default
|
|
variables.standalone_static_library = gyp.opts.thin ? 0 : 1
|
|
|
|
- if (process.platform === 'win32') {
|
|
+ if (win) {
|
|
defaults.msbuild_toolset = vsInfo.toolset
|
|
if (vsInfo.sdk) {
|
|
defaults.msvs_windows_target_platform_version = vsInfo.sdk
|
|
diff --git a/deps/npm/node_modules/node-gyp/lib/find-node-directory.js b/deps/npm/node_modules/node-gyp/lib/find-node-directory.js
|
|
index 8838b81d..12b6d64e 100644
|
|
--- a/deps/npm/node_modules/node-gyp/lib/find-node-directory.js
|
|
+++ b/deps/npm/node_modules/node-gyp/lib/find-node-directory.js
|
|
@@ -2,6 +2,7 @@
|
|
|
|
const path = require('path')
|
|
const log = require('./log')
|
|
+const win = require('os').type() === 'Windows_NT'
|
|
|
|
function findNodeDirectory (scriptLocation, processObj) {
|
|
// set dirname and process if not passed in
|
|
@@ -31,7 +32,7 @@ function findNodeDirectory (scriptLocation, processObj) {
|
|
// lib/node_modules/npm/node_modules/node-gyp/lib or
|
|
// node_modules/npm/node_modules/node-gyp/lib depending on the
|
|
// platform
|
|
- if (processObj.platform === 'win32') {
|
|
+ if (win) {
|
|
nodeRootDir = path.join(npmParentDirectory, '..')
|
|
} else {
|
|
nodeRootDir = path.join(npmParentDirectory, '../..')
|
|
@@ -49,7 +50,7 @@ function findNodeDirectory (scriptLocation, processObj) {
|
|
// If we are a recently built node, and the directory structure
|
|
// is that of a repository. If we are on Windows then we only need
|
|
// to go one level up, everything else, two
|
|
- if (processObj.platform === 'win32') {
|
|
+ if (win) {
|
|
nodeRootDir = path.join(nodeDir, '..')
|
|
} else {
|
|
nodeRootDir = path.join(nodeDir, '../..')
|
|
diff --git a/deps/npm/node_modules/node-gyp/lib/find-python.js b/deps/npm/node_modules/node-gyp/lib/find-python.js
|
|
index a71c00c2..2bf245ba 100644
|
|
--- a/deps/npm/node_modules/node-gyp/lib/find-python.js
|
|
+++ b/deps/npm/node_modules/node-gyp/lib/find-python.js
|
|
@@ -3,7 +3,7 @@
|
|
const log = require('./log')
|
|
const semver = require('semver')
|
|
const { execFile } = require('./util')
|
|
-const win = process.platform === 'win32'
|
|
+const win = require('os').type() === 'Windows_NT'
|
|
|
|
function getOsUserInfo () {
|
|
try {
|
|
diff --git a/deps/npm/node_modules/node-gyp/lib/install.js b/deps/npm/node_modules/node-gyp/lib/install.js
|
|
index 90be86c8..158778d8 100644
|
|
--- a/deps/npm/node_modules/node-gyp/lib/install.js
|
|
+++ b/deps/npm/node_modules/node-gyp/lib/install.js
|
|
@@ -12,7 +12,7 @@ const semver = require('semver')
|
|
const { download } = require('./download')
|
|
const processRelease = require('./process-release')
|
|
|
|
-const win = process.platform === 'win32'
|
|
+const win = require('os').type() === 'Windows_NT'
|
|
|
|
async function install (gyp, argv) {
|
|
log.stdout()
|