Browse Source

Link boringssl and node together in one binary

Cheng Zhao 10 years ago
parent
commit
f169772031
7 changed files with 11 additions and 36 deletions
  1. 3 22
      atom.gyp
  2. 1 4
      atom/common/node_bindings.cc
  3. 3 6
      common.gypi
  4. 1 1
      script/bootstrap.py
  5. 1 1
      script/lib/config.py
  6. 1 1
      vendor/brightray
  7. 1 1
      vendor/node

+ 3 - 22
atom.gyp

@@ -197,6 +197,8 @@
         # Defined in Chromium but not exposed in its gyp file.
         'V8_USE_EXTERNAL_STARTUP_DATA',
         'ENABLE_PLUGINS',
+        # Needed by Node.
+        'NODE_WANT_INTERNALS=1',
       ],
       'sources': [
         '<@(lib_sources)',
@@ -527,7 +529,7 @@
                   ['libchromiumcontent_component', {
                     'copied_libraries': '<(libchromiumcontent_shared_libraries)',
                   }, {
-                    'copied_libraries': ['<(libchromiumcontent_dir)/libboringssl.dylib'],
+                    'copied_libraries': [],
                   }],
                 ],
               },
@@ -535,7 +537,6 @@
               'files': [
                 '<@(copied_libraries)',
                 '<(libchromiumcontent_dir)/ffmpegsumo.so',
-                '<(PRODUCT_DIR)/libnode.dylib',
               ],
             },
             {
@@ -547,26 +548,6 @@
             },
           ],
           'postbuilds': [
-            {
-              'postbuild_name': 'Fix path of libnode',
-              'action': [
-                'install_name_tool',
-                '-change',
-                '/usr/local/lib/libnode.dylib',
-                '@rpath/libnode.dylib',
-                '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework',
-              ],
-            },
-            {
-              'postbuild_name': 'Fix path of libboringssl',
-              'action': [
-                'install_name_tool',
-                '-change',
-                '/usr/local/lib/libboringssl.dylib',
-                '@rpath/libboringssl.dylib',
-                '${BUILT_PRODUCTS_DIR}/<(product_name) Framework.framework/Versions/A/<(product_name) Framework',
-              ],
-            },
             {
               'postbuild_name': 'Add symlinks for framework subdirectories',
               'action': [

+ 1 - 4
atom/common/node_bindings.cc

@@ -27,9 +27,7 @@ using content::BrowserThread;
 #define REFERENCE_MODULE(name) \
   extern "C" void _register_ ## name(void); \
   void (*fp_register_ ## name)(void) = _register_ ## name
-#if defined(OS_WIN)
-// On Windows Node is built as static_library so we need to reference Node's
-// builtin modules.
+// Node's builtin modules.
 REFERENCE_MODULE(cares_wrap);
 REFERENCE_MODULE(fs_event_wrap);
 REFERENCE_MODULE(buffer);
@@ -52,7 +50,6 @@ REFERENCE_MODULE(tty_wrap);
 REFERENCE_MODULE(udp_wrap);
 REFERENCE_MODULE(uv);
 REFERENCE_MODULE(js_stream);
-#endif  // defined(OS_WIN)
 // Atom Shell's builtin modules.
 REFERENCE_MODULE(atom_browser_app);
 REFERENCE_MODULE(atom_browser_auto_updater);

+ 3 - 6
common.gypi

@@ -4,7 +4,6 @@
   ],
   'variables': {
     'clang': 0,
-    'openssl_no_asm': 1,
     'conditions': [
       ['OS=="mac" or OS=="linux"', {
         'clang': 1,
@@ -20,7 +19,7 @@
     'node_shared_cares': 'false',
     'node_shared_http_parser': 'false',
     'node_shared_libuv': 'false',
-    'node_shared_openssl': 'false',
+    'node_shared_openssl': 'true',
     'node_shared_v8': 'true',
     'node_shared_zlib': 'false',
     'node_tag': '',
@@ -40,7 +39,7 @@
   # Settings to compile node under Windows.
   'target_defaults': {
     'target_conditions': [
-      ['_target_name in ["libuv", "http_parser", "cares", "openssl", "openssl-cli", "node", "zlib"]', {
+      ['_target_name in ["libuv", "http_parser", "cares", "node", "zlib"]', {
         'msvs_disabled_warnings': [
           4703,  # potentially uninitialized local pointer variable 'req' used
           4013,  # 'free' undefined; assuming extern returning int
@@ -104,6 +103,7 @@
       ['_target_name in ["node", "atom_lib"]', {
         'include_dirs': [
           '<(libchromiumcontent_src_dir)/v8/include',
+          '<(libchromiumcontent_src_dir)/third_party/boringssl/src/include',
         ],
       }],
       ['_target_name=="node"', {
@@ -114,9 +114,6 @@
               'DYLIB_INSTALL_NAME_BASE': '@rpath'
             },
           }],
-          ['OS=="win"', {
-            'type': 'static_library',
-          }],
           ['OS=="linux"', {
             'cflags': [ '-fPIC' ],
           }],

+ 1 - 1
script/bootstrap.py

@@ -26,7 +26,7 @@ def main():
     enable_verbose_mode()
   if sys.platform == 'cygwin':
     update_win32_python()
-  update_submodules()
+  # update_submodules()
   update_node_modules('.')
   bootstrap_brightray(args.url)
 

+ 1 - 1
script/lib/config.py

@@ -4,7 +4,7 @@ import platform
 import sys
 
 BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
-LIBCHROMIUMCONTENT_COMMIT = 'e0213676879061470efe50720368bce9b99aaa12'
+LIBCHROMIUMCONTENT_COMMIT = '2b564074393dcd3dd90e0edfc5a75099c2a72d1d'
 
 ARCH = {
     'cygwin': '32bit',

+ 1 - 1
vendor/brightray

@@ -1 +1 @@
-Subproject commit a09b6c78b76fbbc019a9be72a0c5f2403f5c0763
+Subproject commit d4c8ac2565a2e257c37215d9b65d6dd0267aad1b

+ 1 - 1
vendor/node

@@ -1 +1 @@
-Subproject commit 790c4a3af36144fcdd5fe39d0cb6cd622f282434
+Subproject commit 6a8c1dda355e67303441afb4bb812b8428362f23