Files
MINGW-packages/mingw-w64-nodejs/0002-Mat_Sutcliffe-node_mingw64-without-MSYS-path-convers.patch
2016-09-14 22:06:55 +02:00

146 lines
4.0 KiB
Diff

From 4a32209018ca0d1013d326d4233013ca1bc5a98a Mon Sep 17 00:00:00 2001
From: mati865 <mati865@gmail.com>
Date: Sun, 4 Sep 2016 12:56:33 +0200
Subject: [PATCH 02/13] Mat_Sutcliffe-node_mingw64-without-MSYS-path-conversion
---
deps/cares/cares.gyp | 4 ++--
deps/openssl/openssl.gypi | 14 +++++++-------
deps/uv/src/win/pipe.c | 4 ++++
deps/uv/src/win/process.c | 3 +++
deps/v8/tools/gyp/v8.gyp | 2 +-
node.gyp | 2 +-
src/node_main.cc | 8 +++++++-
7 files changed, 25 insertions(+), 12 deletions(-)
diff --git a/deps/cares/cares.gyp b/deps/cares/cares.gyp
index 158cef3..5e2a17c 100644
--- a/deps/cares/cares.gyp
+++ b/deps/cares/cares.gyp
@@ -120,8 +120,8 @@
'src/ares_platform.c'
],
'libraries': [
- '-lws2_32.lib',
- '-liphlpapi.lib'
+ '-lws2_32',
+ '-liphlpapi'
],
}, {
# Not Windows i.e. POSIX
diff --git a/deps/openssl/openssl.gypi b/deps/openssl/openssl.gypi
index 3620e45..a472b12 100644
--- a/deps/openssl/openssl.gypi
+++ b/deps/openssl/openssl.gypi
@@ -1225,11 +1225,11 @@
'-lnsl',
],
'openssl_cli_libraries_win': [
- '-lws2_32.lib',
- '-lgdi32.lib',
- '-ladvapi32.lib',
- '-lcrypt32.lib',
- '-luser32.lib',
+ '-lws2_32',
+ '-lgdi32',
+ '-ladvapi32',
+ '-lcrypt32',
+ '-luser32',
],
#### Variables for Target Defaults ####
'openssl_default_include_dirs': [
@@ -1270,8 +1270,8 @@
'OPENSSL_SYSNAME_WIN32',
],
'openssl_default_libraries_win': [
- '-lgdi32.lib',
- '-luser32.lib',
+ '-lgdi32',
+ '-luser32',
],
'openssl_default_defines_not_win': [
# ENGINESDIR must be defined if OPENSSLDIR is.
diff --git a/deps/uv/src/win/pipe.c b/deps/uv/src/win/pipe.c
index a784325..6ab1fd4 100644
--- a/deps/uv/src/win/pipe.c
+++ b/deps/uv/src/win/pipe.c
@@ -31,6 +31,10 @@
#include "stream-inl.h"
#include "req-inl.h"
+#ifndef FILE_FLAG_FIRST_PIPE_INSTANCE
+#define FILE_FLAG_FIRST_PIPE_INSTANCE 524288
+#endif
+
typedef struct uv__ipc_queue_item_s uv__ipc_queue_item_t;
struct uv__ipc_queue_item_s {
diff --git a/deps/uv/src/win/process.c b/deps/uv/src/win/process.c
index 855c374..dd67b19 100644
--- a/deps/uv/src/win/process.c
+++ b/deps/uv/src/win/process.c
@@ -33,6 +33,9 @@
#include "handle-inl.h"
#include "req-inl.h"
+#ifndef JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE
+#define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE 0x2000
+#endif
#define SIGKILL 9
diff --git a/deps/v8/tools/gyp/v8.gyp b/deps/v8/tools/gyp/v8.gyp
index e1ba0b1..45c7c8f 100644
--- a/deps/v8/tools/gyp/v8.gyp
+++ b/deps/v8/tools/gyp/v8.gyp
@@ -1915,7 +1915,7 @@
],
'msvs_disabled_warnings': [4351, 4355, 4800],
'link_settings': {
- 'libraries': [ '-lwinmm.lib', '-lws2_32.lib' ],
+ 'libraries': [ '-lwinmm', '-lws2_32' ],
},
}],
],
diff --git a/node.gyp b/node.gyp
index 1b5a23f..d098100 100644
--- a/node.gyp
+++ b/node.gyp
@@ -504,7 +504,7 @@
'NODE_PLATFORM="win32"',
'_UNICODE=1',
],
- 'libraries': [ '-lpsapi.lib' ]
+ 'libraries': [ '-municode', '-lpsapi' ]
}, { # POSIX
'defines': [ '__POSIX__' ],
'sources': [ 'src/backtrace_posix.cc' ],
diff --git a/src/node_main.cc b/src/node_main.cc
index bde3975..7acd7bc 100644
--- a/src/node_main.cc
+++ b/src/node_main.cc
@@ -1,6 +1,9 @@
#include "node.h"
-#ifdef _WIN32
+#if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR)
+#if defined (__cplusplus) && defined(__MINGW64_VERSION_MAJOR)
+extern "C" {
+#endif
#include <VersionHelpers.h>
int wmain(int argc, wchar_t *wargv[]) {
@@ -47,6 +50,9 @@ int wmain(int argc, wchar_t *wargv[]) {
// Now that conversion is done, we can finally start.
return node::Start(argc, argv);
}
+#if defined (__cplusplus) && defined(__MINGW64_VERSION_MAJOR)
+}
+#endif
#else
// UNIX
int main(int argc, char *argv[]) {
--
2.9.1