summaryrefslogtreecommitdiff
blob: 43e7c098f3bf0f3cb14ea2382624d607d47a2084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From 672445004bafb94ea14cbb89c12c205c731eb288 Mon Sep 17 00:00:00 2001
From: Elvis Pranskevichus <elvis@magic.io>
Date: Wed, 10 Feb 2016 14:45:13 -0500
Subject: [PATCH] Build fixes

---
 lib/internal/bootstrap_node.js |  2 ++
 node.gyp                       | 14 +++++++++-----
 src/node_main.cc               |  4 ++++
 3 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index aee7261f23..b921843643 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -39,7 +39,9 @@
       setupGlobalConsole();
     }
 
+    if (!process.env._ELECTRON_BUILD_NO_ASAR) {
     setupAsarSupport();
+    }
 
     const _process = NativeModule.require('internal/process');
 
diff --git a/node.gyp b/node.gyp
index c0bc2d7d4c..e5920f6a33 100644
--- a/node.gyp
+++ b/node.gyp
@@ -17,6 +17,7 @@
     'node_shared_libuv%': 'false',
     'node_use_openssl%': 'true',
     'node_shared_openssl%': 'false',
+    'node_v8_path%': 'deps/v8',
     'node_v8_options%': '',
     'node_enable_v8_vtunejit%': 'false',
     'node_core_target_name%': 'node',
@@ -146,6 +147,7 @@
       ],
 
       'include_dirs': [
+        '<(node_v8_path)/include',
         'src',
         'tools/msvs/genfiles',
         'deps/uv/src/ares',
@@ -261,6 +263,13 @@
         'V8_DEPRECATION_WARNINGS=1',
       ],
 
+      'link_settings': {
+        'ldflags': [
+          '-Wl,-rpath=\$$ORIGIN/',
+          # Make native module dynamic loading work.
+          '-rdynamic',
+        ],
+      },
 
       'conditions': [
         [ 'node_shared=="false"', {
@@ -950,11 +959,6 @@
             }]
           ]
         }],
-        [ 'node_use_v8_platform=="true"', {
-          'dependencies': [
-            'deps/v8/src/v8.gyp:v8_libplatform',
-          ],
-        }],
         [ 'node_use_bundled_v8=="true"', {
           'dependencies': [
             'deps/v8/src/v8.gyp:v8',
diff --git a/src/node_main.cc b/src/node_main.cc
index 16bda81ae6..2eb1d08369 100644
--- a/src/node_main.cc
+++ b/src/node_main.cc
@@ -50,11 +50,15 @@ int wmain(int argc, wchar_t *wargv[]) {
 }
 #else
 // UNIX
+#include <stdlib.h>
 int main(int argc, char *argv[]) {
   // Disable stdio buffering, it interacts poorly with printf()
   // calls elsewhere in the program (e.g., any logging from V8.)
   setvbuf(stdout, nullptr, _IONBF, 0);
   setvbuf(stderr, nullptr, _IONBF, 0);
+#ifdef ELECTRON_NODE_BUILD_NO_ASAR
+  setenv("_ELECTRON_BUILD_NO_ASAR", "1", 1);
+#endif
   return node::Start(argc, argv);
 }
 #endif
-- 
2.14.3