summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRobert Chiras <robert.chiras@intel.com>2016-03-03 17:13:12 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2016-03-22 19:17:28 +0100
commitcd9f54b3b93ab1f6693d271f4660d67abb2da85b (patch)
tree62d5beb1396e96238cb7e4e66c7fd85c3e47f07e /tools
parent271201fea935cdf85336736e87c06104ce185f61 (diff)
downloadandroid-node-v8-cd9f54b3b93ab1f6693d271f4660d67abb2da85b.tar.gz
android-node-v8-cd9f54b3b93ab1f6693d271f4660d67abb2da85b.tar.bz2
android-node-v8-cd9f54b3b93ab1f6693d271f4660d67abb2da85b.zip
build: add script to create Android .mk files
The create_android_makefiles script will create .mk files for node and all of its dependencies ready to be build using Android build system. Signed-off-by: Robert Chiras <robert.chiras@intel.com> PR-URL: https://github.com/nodejs/node/pull/5544 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/create_android_makefiles46
1 files changed, 46 insertions, 0 deletions
diff --git a/tools/create_android_makefiles b/tools/create_android_makefiles
new file mode 100755
index 0000000000..abf2ecf083
--- /dev/null
+++ b/tools/create_android_makefiles
@@ -0,0 +1,46 @@
+#!/bin/bash
+# Run this script ONLY inside an Android build system
+# and after you ran lunch command!
+
+if [ -z "$ANDROID_BUILD_TOP" ]; then
+ echo "Run lunch before running this script!"
+ exit 1
+fi
+
+if [ -z "$1" ]; then
+ ARCH="arm"
+else
+ ARCH="$1"
+fi
+
+if [ $ARCH = "x86" ]; then
+ TARGET_ARCH="ia32"
+else
+ TARGET_ARCH="$ARCH"
+fi
+
+cd $(dirname $0)/..
+
+./configure \
+ --without-snapshot \
+ --openssl-no-asm \
+ --dest-cpu=$TARGET_ARCH \
+ --dest-os=android
+
+export GYP_GENERATORS="android"
+export GYP_GENERATOR_FLAGS="limit_to_target_all=true"
+GYP_DEFINES="target_arch=$TARGET_ARCH"
+GYP_DEFINES+=" v8_target_arch=$TARGET_ARCH"
+GYP_DEFINES+=" android_target_arch=$ARCH"
+GYP_DEFINES+=" host_os=linux OS=android"
+export GYP_DEFINES
+
+./deps/npm/node_modules/node-gyp/gyp/gyp \
+ -Icommon.gypi \
+ -Iconfig.gypi \
+ --depth=. \
+ -Dcomponent=static_library \
+ -Dlibrary=static_library \
+ node.gyp
+
+echo -e "LOCAL_PATH := \$(call my-dir)\n\ninclude \$(LOCAL_PATH)/GypAndroid.mk" > Android.mk