Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/jni/Android.mk

Issue 29557565: Issue 5800 - Add option to specify a list of V8 libraries (Closed)
Patch Set: Using comma as separator, README changes Created Sept. 29, 2017, 11:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.md ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/jni/Android.mk
diff --git a/libadblockplus-android/jni/Android.mk b/libadblockplus-android/jni/Android.mk
index d152a10bfe00bfc1360a9bef4cbe44cebf132adc..c42bd77e846a90f520f4c8746aeec8eb9eeadb60 100755
--- a/libadblockplus-android/jni/Android.mk
+++ b/libadblockplus-android/jni/Android.mk
@@ -1,5 +1,21 @@
LOCAL_PATH := $(call my-dir)
+# Report configuration
+ifeq ($(SHARED_V8_LIB_FILENAMES),)
+# static
+$(info [Configuration] Linking statically with built-in v8)
+else
+# dynamic
+
+comma = ,
sergei 2017/10/02 09:12:02 should it be called something like shared_v8_lib_s
anton 2017/10/02 09:22:04 Does not matter for me. Should i rename?
+SHARED_V8_LIB_FILENAMES_LIST = $(subst $(comma), ,$(SHARED_V8_LIB_FILENAMES))
sergei 2017/10/02 10:08:01 Sorry, didn't pay attention to it before. What was
sergei 2017/10/02 12:06:52 It's three times here and there is even no need in
diegocarloslima 2017/10/10 13:40:51 Yeah, I agree that for sake of simplicity, just a
+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 +23,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 +42,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 +50,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 +58,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 $(comma), ,$(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 +97,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 $(comma), ,$(SHARED_V8_LIB_FILENAMES))
+LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAMES_LIST)
+endif
include $(BUILD_SHARED_LIBRARY)
« no previous file with comments | « README.md ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld