Index: libadblockplus-android/jni/Android.mk |
diff --git a/libadblockplus-android/jni/Android.mk b/libadblockplus-android/jni/Android.mk |
index d152a10bfe00bfc1360a9bef4cbe44cebf132adc..7b0009c0d705835eb88b136e2aeb78e2fc5ff3e5 100755 |
--- a/libadblockplus-android/jni/Android.mk |
+++ b/libadblockplus-android/jni/Android.mk |
@@ -1,5 +1,20 @@ |
LOCAL_PATH := $(call my-dir) |
+# Report configuration |
+ifeq ($(SHARED_V8_LIB_FILENAMES),) |
+# static |
+$(info [Configuration] Linking statically with built-in v8) |
+else |
+# dynamic |
+ |
+SHARED_V8_LIB_FILENAMES_LIST = $(subst :, ,$(SHARED_V8_LIB_FILENAMES)) |
+define info_define |
+ $(info [Configuration] Linking dynamically with shared v8 library ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$1) |
+endef |
+$(foreach item,$(SHARED_V8_LIB_FILENAMES_LIST),$(eval $(call info_define,$(item)))) |
+endif |
+ |
+# libadblockplus.a |
include $(CLEAR_VARS) |
LOCAL_MODULE := libadblockplus |
@@ -7,6 +22,18 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libadblo |
include $(PREBUILT_STATIC_LIBRARY) |
+# libv8-platform.a |
+include $(CLEAR_VARS) |
+ |
+LOCAL_MODULE := v8-libplatform |
+LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_libplatform.a |
+ |
+include $(PREBUILT_STATIC_LIBRARY) |
+ |
+ifeq ($(SHARED_V8_LIB_FILENAMES),) |
+# static |
+ |
+# libv8-libsampler.a |
include $(CLEAR_VARS) |
LOCAL_MODULE := v8-libsampler |
@@ -14,6 +41,7 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li |
include $(PREBUILT_STATIC_LIBRARY) |
+# libv8-base.a |
include $(CLEAR_VARS) |
LOCAL_MODULE := v8-base |
@@ -21,6 +49,7 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_ba |
include $(PREBUILT_STATIC_LIBRARY) |
+# libv8_libbase.a |
include $(CLEAR_VARS) |
LOCAL_MODULE := v8-libbase |
@@ -28,19 +57,31 @@ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li |
include $(PREBUILT_STATIC_LIBRARY) |
+# libv8_snapshot.a |
include $(CLEAR_VARS) |
-LOCAL_MODULE := v8-libplatform |
-LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_libplatform.a |
+LOCAL_MODULE := v8-snapshot |
+LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_snapshot.a |
include $(PREBUILT_STATIC_LIBRARY) |
-include $(CLEAR_VARS) |
+else |
+# dynamic |
-LOCAL_MODULE := v8-snapshot |
-LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_snapshot.a |
+# prebuilt shared libraries v8 |
-include $(PREBUILT_STATIC_LIBRARY) |
+SHARED_V8_LIB_FILENAMES_LIST = $(subst :, ,$(SHARED_V8_LIB_FILENAMES)) |
+define libv8_define |
+ include $(CLEAR_VARS) |
+ |
+ LOCAL_MODULE := $1 |
+ LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$1 |
+ |
+ include $(PREBUILT_SHARED_LIBRARY) |
+endef |
+$(foreach item,$(SHARED_V8_LIB_FILENAMES_LIST),$(eval $(call libv8_define,$(item)))) |
+ |
+endif |
include $(CLEAR_VARS) |
@@ -55,10 +96,20 @@ LOCAL_SRC_FILES += JniFilterChangeCallback.cpp JniCallbacks.cpp Utils.cpp |
LOCAL_SRC_FILES += JniNotification.cpp JniShowNotificationCallback.cpp |
LOCAL_SRC_FILES += JniIsAllowedConnectionTypeCallback.cpp |
-LOCAL_CPP_FEATURES := exceptions |
+LOCAL_CPP_FEATURES := exceptions |
LOCAL_CPPFLAGS += -std=c++11 |
LOCAL_C_INCLUDES := jni/libadblockplus-binaries/include/ |
-LOCAL_STATIC_LIBRARIES := libadblockplus v8-base v8-snapshot v8-libsampler v8-libplatform v8-libbase |
+ |
+LOCAL_STATIC_LIBRARIES := libadblockplus v8-libplatform |
+ |
+ifeq ($(SHARED_V8_LIB_FILENAMES),) |
+# static |
+LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase |
+else |
+# dynamic |
+SHARED_V8_LIB_FILENAMES_LIST = $(subst :, ,$(SHARED_V8_LIB_FILENAMES)) |
+LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAMES_LIST) |
+endif |
include $(BUILD_SHARED_LIBRARY) |