Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,20 @@ else
ARCH := arm
endif

NDK_WHICH := $(shell test -f $(shell dirname $(shell which ndk-which))/ndk-which && echo yes)

v8basepath := $(LOCAL_PATH)/v8core/v8
v8libpath := $(v8basepath)/out/android_$(ARCH).release//obj.target/tools/gyp/
v8libs := $(v8libpath)/libv8_base.a $(v8libpath)/libpreparser_lib.a $(v8libpath)/libv8_nosnapshot.a

$(v8libs): MY_ARCH_ABI := $(TARGET_ARCH_ABI)

$(v8libs):
cd $(v8basepath) && TARGET_ARCH=$(MY_ARCH_ABI) ./build.sh
ifeq ($(NDK_WHICH), yes)
cd "$(v8basepath)" && TARGET_ARCH="$(MY_ARCH_ABI)" TOOLCHAIN_PATH="$(shell dirname $(shell (ndk-which --abi $(TARGET_ARCH) objdump)))" ./build.sh
else
cd "$(v8basepath)" && TARGET_ARCH="$(MY_ARCH_ABI)" ./build.sh
endif

$(TARGET_OUT)/libweexv8.so: $(v8libs)

Expand Down
4 changes: 2 additions & 2 deletions jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_ABI := armeabi x86
APP_PLATFORM := android-9
APP_ABI := armeabi-v7a x86
APP_PLATFORM := android-16
#LOCAL_CPP_FEATURES += exceptions
#APP_CPPFLAGS := -frtti -fexceptions
1 change: 1 addition & 0 deletions jni/v8core/com_taobao_weex_bridge_WXBridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <v8.h>
#include <assert.h>
#include <fcntl.h>
#include <string.h>


jclass jBridgeClazz;
Expand Down
12 changes: 9 additions & 3 deletions jni/v8core/v8/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ fi
# If not defined ANDROID_TOOLCHAIN, it search the ndk directory and find the gcc-4.4.3 to compile v8.
if [ -z "$ANDROID_TOOLCHAIN" ]; then
if [ "$TARGET_ARCH" = "x86" ]; then
TOOLCHAIN_PATH=`dirname $(find $NDK_ROOT/toolchains $NDK_ROOT/build -name 'i686*' -name '*-g++' | sort -r | head -n 1)`
if [ -z "$TOOLCHAIN_PATH" ]; then
TOOLCHAIN_PATH=`dirname $(find $NDK_ROOT/toolchains $NDK_ROOT/build -name 'i686*' -name '*-g++' | sort -r | head -n 1)`
fi
elif [ "$TARGET_ARCH" = "armeabi" ]; then
TOOLCHAIN_PATH=`dirname $(find $NDK_ROOT/toolchains $NDK_ROOT/build -name 'arm*' -name '*-g++' | sort -r| head -n 1)`
if [ -z "$TOOLCHAIN_PATH" ]; then
TOOLCHAIN_PATH=`dirname $(find $NDK_ROOT/toolchains $NDK_ROOT/build -name 'arm*' -name '*-g++' | sort -r| head -n 1)`
fi
EXTRA_OPTION="armv7=false vfp2=off vfp3=off"
elif [ "$TARGET_ARCH" = "armeabi-v7a" ]; then
TOOLCHAIN_PATH=`dirname $(find $NDK_ROOT/toolchains $NDK_ROOT/build -name 'arm*' -name '*-g++' | sort -r| head -n 1)`
if [ -z "$TOOLCHAIN_PATH" ]; then
TOOLCHAIN_PATH=`dirname $(find $NDK_ROOT/toolchains $NDK_ROOT/build -name 'arm*' -name '*-g++' | sort -r| head -n 1)`
fi
EXTRA_OPTION="armv7=true vfp2=on vfp3=on"
else
echo "unsupported platform " "$TARGET_ARCH" 1>&2
Expand Down