Skip to content

Commit

Permalink
core: update nodejs-mobile v0.1.4
Browse files Browse the repository at this point in the history
Update the libnode binaries to v0.1.4 release. Update the header
files for nodejs-mobile headers specific to each platform.
Updated the new name for the iOS framework.
  • Loading branch information
jaimecbernardo committed Feb 12, 2018
1 parent 4fe04f3 commit e3635f3
Show file tree
Hide file tree
Showing 319 changed files with 66,728 additions and 49 deletions.
2 changes: 1 addition & 1 deletion install/hooks/android/before-plugin-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var fs = require('fs');
var zlib = require('zlib');

const nodeProjectFolder = 'www/nodejs-project';
const libFolderPath = 'plugins/nodejs-mobile-cordova/libs/libnode/android/';
const libFolderPath = 'plugins/nodejs-mobile-cordova/libs/android/libnode/bin/';
const path_armv7 = libFolderPath + 'armeabi-v7a/';
const path_x86 = libFolderPath + 'x86/'
const lib_name = 'libnode.so';
Expand Down
16 changes: 8 additions & 8 deletions install/hooks/ios/before-plugin-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ var fs = require('fs');
var targz2 = require('tar.gz2');

const nodeProjectFolder = 'www/nodejs-project';
const libnodeFolderPath = 'plugins/nodejs-mobile-cordova/libs/libnode/ios/';
const libnodeFileName = 'libnode.framework';
const libnodeFilePath = libnodeFolderPath + libnodeFileName;
const zipFileName = libnodeFileName + '.tar.zip';
const zipFilePath = libnodeFolderPath + zipFileName
const nodeMobileFolderPath = 'plugins/nodejs-mobile-cordova/libs/ios/nodemobile/';
const nodeMobileFileName = 'NodeMobile.framework';
const nodeMobileFilePath = nodeMobileFolderPath + nodeMobileFileName;
const zipFileName = nodeMobileFileName + '.tar.zip';
const zipFilePath = nodeMobileFolderPath + zipFileName

module.exports = function(context) {
var Q = context.requireCordovaModule('q');
Expand All @@ -19,16 +19,16 @@ module.exports = function(context) {

// Unzip and untar the libnode.Framework
if (fs.existsSync(zipFilePath)) {
targz2().extract(zipFilePath, libnodeFolderPath, function(err) {
targz2().extract(zipFilePath, nodeMobileFolderPath, function(err) {
if (err) {
deferral.reject(err);
} else {
fs.unlinkSync(zipFilePath);
deferral.resolve();
}
});
} else if (!fs.existsSync(libnodeFilePath)) {
deferral.reject(new Error(libnodeFileName + ' is missing'));
} else if (!fs.existsSync(nodeMobileFilePath)) {
deferral.reject(new Error(nodeMobileFileName + ' is missing'));
} else {
deferral.resolve();
}
Expand Down
Binary file not shown.
Binary file added libs/android/libnode/bin/x86/libnode.so.gz
Binary file not shown.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'os_posix': 1,
'v8_postmortem_support%': 'true',
}],
['OS== "mac"', {
['OS== "mac" or OS=="ios"', {
'CHAKRASHIM_BASE': '<(PRODUCT_DIR)/libchakrashim.a',
'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a',
Expand All @@ -65,7 +65,7 @@
}, {
'OPENSSL_PRODUCT': 'libopenssl.a',
}],
['OS=="mac"', {
['OS=="mac" or OS=="ios"', {
'clang%': 1,
}, {
'clang%': 0,
Expand All @@ -90,7 +90,7 @@
'NODE_ENGINE_CHAKRACORE',
],
'conditions': [
['target_arch=="arm"', {
['target_arch=="arm" or target_arch=="arm64"', {
'msvs_windows_target_platform_version': '<(msvs_windows_target_platform_version)',
}],
],
Expand Down Expand Up @@ -125,11 +125,14 @@
['target_arch=="arm"', {
'msvs_configuration_platform': 'ARM',
}],
['target_arch=="arm64"', {
'msvs_configuration_platform': 'ARM64',
}],
['OS=="aix"', {
'cflags': [ '-gxcoff' ],
'ldflags': [ '-Wl,-bbigtoc' ],
}],
['OS == "android"', {
['OS == "android" and node_shared!="true" and _type!="loadable_module"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
Expand Down Expand Up @@ -175,14 +178,17 @@
['target_arch=="arm"', {
'msvs_configuration_platform': 'ARM',
}],
['target_arch=="arm64"', {
'msvs_configuration_platform': 'ARM64',
}],
['OS=="solaris"', {
# pull in V8's postmortem metadata
'ldflags': [ '-Wl,-z,allextract' ]
}],
['OS!="mac" and OS!="win"', {
['OS!="mac" and OS != "ios" and OS!="win"', {
'cflags': [ '-fno-omit-frame-pointer' ],
}],
['OS == "android"', {
['OS == "android" and node_shared!="true" and _type!="loadable_module"', {
'cflags': [ '-fPIE' ],
'ldflags': [ '-fPIE', '-pie' ]
}],
Expand Down Expand Up @@ -279,7 +285,7 @@
},
'msvs_disabled_warnings': [4351, 4355, 4800],
'conditions': [
['asan == 1 and OS != "mac"', {
['asan == 1 and OS != "mac" and OS != "ios"', {
'cflags+': [
'-fno-omit-frame-pointer',
'-fsanitize=address',
Expand All @@ -288,7 +294,7 @@
'cflags!': [ '-fomit-frame-pointer' ],
'ldflags': [ '-fsanitize=address' ],
}],
['asan == 1 and OS == "mac"', {
['asan == 1 and ( OS == "mac" or OS == "ios" )', {
'xcode_settings': {
'OTHER_CFLAGS+': [
'-fno-omit-frame-pointer',
Expand Down Expand Up @@ -393,11 +399,112 @@
],
}],
['OS=="android"', {
'conditions': [
[ 'node_shared=="true"', {
'ldflags': [ '-fPIC' ],
}]
],
'target_conditions': [
['_toolset=="target"', {
'defines': [ '_GLIBCXX_USE_C99_MATH' ],
'libraries': [ '-llog' ],
}],
[ '_type=="loadable_module"', {
'ldflags': [ '-fPIC' ],
'conditions': [
# While loading a native node module, Android needs to have a
# (NEEDED) entry for libnode.so, or it won't be able to locate
# referenced symbols.
# We link to the binary libraries that are distributed with the
# nodejs-mobile headers so the (NEEDED) entry is created
[ 'target_arch=="arm"', {
'libraries': ['>(node_root_dir)/bin/armeabi-v7a/libnode.so'],
}],
[ 'target_arch=="arm64"', {
'libraries': ['>(node_root_dir)/bin/arm64-v8a/libnode.so'],
}],
[ 'target_arch=="x86"', {
'libraries': ['>(node_root_dir)/bin/x86/libnode.so'],
}],
[ 'target_arch=="x86_64"', {
'libraries': ['>(node_root_dir)/bin/x86_64/libnode.so'],
}],
],
}],
],
}],
['OS=="ios"', {
'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
'xcode_settings': {
'ALWAYS_SEARCH_USER_PATHS': 'NO',
'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
# (Equivalent to -fPIC)
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'PREBINDING': 'NO', # No -Wl,-prebind
'IPHONEOS_DEPLOYMENT_TARGET': '9.0', # -miphoneos-version-min=9.0
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
'-fno-strict-aliasing',
],
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
],
},
'target_conditions': [
['_type!="static_library"', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-no_pie',
'-Wl,-search_paths_first',
],
},
}],
],
'conditions': [
['target_arch=="ia32"', {
'xcode_settings': {'ARCHS': ['i386']},
}],
['target_arch=="x64"', {
'xcode_settings': {'ARCHS': ['x86_64']},
}],
[ 'target_arch in "arm64 arm armv7s"', {
'xcode_settings': {
'OTHER_CFLAGS': [
'-fembed-bitcode'
],
'OTHER_CPLUSPLUSFLAGS': [
'-fembed-bitcode'
],
}
}],
[ 'target_arch=="arm64"', {
'xcode_settings': {'ARCHS': ['arm64']},
}],
[ 'target_arch=="arm"', {
'xcode_settings': {'ARCHS': ['armv7']},
}],
[ 'target_arch=="armv7s"', {
'xcode_settings': {'ARCHS': ['armv7s']},
}],
['clang==1', {
'xcode_settings': {
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x
'CLANG_CXX_LIBRARY': 'libc++',
},
}],
['target_arch=="x64" or target_arch=="ia32"', {
'xcode_settings': { 'SDKROOT': 'iphonesimulator' },
}, {
'xcode_settings': { 'SDKROOT': 'iphoneos', 'ENABLE_BITCODE': 'YES'},
}],
],
}],
['OS=="mac"', {
Expand Down
58 changes: 58 additions & 0 deletions libs/android/libnode/include/node/config.gypi
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Do not edit. Generated by the configure script.
{ 'target_defaults': { 'cflags': [],
'default_configuration': 'Release',
'defines': [],
'include_dirs': [],
'libraries': []},
'variables': { 'OS': 'android',
'arm_float_abi': 'default',
'arm_fpu': 'vfpv3',
'arm_thumb': 0,
'arm_version': '7',
'asan': 0,
'coverage': 'false',
'debug_devtools': 'node',
'debug_http2': 'false',
'debug_nghttp2': 'false',
'force_dynamic_crt': 1,
'host_arch': 'x64',
'icu_small': 'false',
'llvm_version': 0,
'node_byteorder': 'little',
'node_enable_d8': 'false',
'node_enable_v8_vtunejit': 'false',
'node_engine': 'v8',
'node_install_npm': 'true',
'node_module_version': 57,
'node_no_browser_globals': 'false',
'node_prefix': '/',
'node_release_urlbase': '',
'node_shared': 'true',
'node_shared_cares': 'false',
'node_shared_http_parser': 'false',
'node_shared_libuv': 'false',
'node_shared_openssl': 'false',
'node_shared_zlib': 'false',
'node_tag': '',
'node_use_bundled_v8': 'true',
'node_use_dtrace': 'false',
'node_use_etw': 'false',
'node_use_lttng': 'false',
'node_use_openssl': 'true',
'node_use_perfctr': 'false',
'node_use_v8_platform': 'true',
'node_without_node_options': 'false',
'openssl_fips': '',
'openssl_no_asm': 1,
'shlib_suffix': 'so',
'target_arch': 'arm',
'v8_enable_gdbjit': 0,
'v8_enable_i18n_support': 0,
'v8_enable_inspector': 0,
'v8_no_strict_aliasing': 1,
'v8_optimized_debug': 0,
'v8_promise_internal_field_count': 1,
'v8_random_seed': 0,
'v8_trace_maps': 0,
'v8_use_snapshot': 'false',
'want_separate_host_toolset': 0}}
29 changes: 29 additions & 0 deletions libs/android/libnode/include/node/libplatform/libplatform-export.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
#define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_

#if defined(_WIN32)

#ifdef BUILDING_V8_PLATFORM_SHARED
#define V8_PLATFORM_EXPORT __declspec(dllexport)
#elif USING_V8_PLATFORM_SHARED
#define V8_PLATFORM_EXPORT __declspec(dllimport)
#else
#define V8_PLATFORM_EXPORT
#endif // BUILDING_V8_PLATFORM_SHARED

#else // defined(_WIN32)

// Setup for Linux shared library export.
#ifdef BUILDING_V8_PLATFORM_SHARED
#define V8_PLATFORM_EXPORT __attribute__((visibility("default")))
#else
#define V8_PLATFORM_EXPORT
#endif

#endif // defined(_WIN32)

#endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_
Loading

0 comments on commit e3635f3

Please sign in to comment.