OLD | NEW |
1 LOCAL_PATH := $(call my-dir) | 1 LOCAL_PATH := $(call my-dir) |
2 | 2 |
| 3 # SHARED_V8_LIB_DIRECTORY is expected to be full absolute path if set by user |
| 4 ifeq ($(SHARED_V8_LIB_DIRECTORY),) |
| 5 # default |
| 6 SHARED_V8_LIB_DIRECTORY := ./libadblockplus-binaries |
| 7 SHARED_V8_INCLUDE_DIRECTORY := jni/libadblockplus-binaries/include/ |
| 8 else |
| 9 # set by user |
| 10 $(info [Configuration] Using shared v8 libraries directory $(SHARED_V8_LIB_DIR
ECTORY)) |
| 11 SHARED_V8_INCLUDE_DIRECTORY := $(SHARED_V8_LIB_DIRECTORY)/include/ |
| 12 endif |
| 13 |
3 # Report configuration | 14 # Report configuration |
4 ifeq ($(SHARED_V8_LIB_FILENAMES),) | 15 ifeq ($(SHARED_V8_LIB_FILENAMES),) |
5 # static | 16 # static |
6 $(info [Configuration] Linking statically with built-in v8) | 17 $(info [Configuration] Linking statically with built-in v8) |
7 else | 18 else |
8 # dynamic | 19 # dynamic |
9 | 20 |
10 define info_define | 21 define info_define |
11 $(info [Configuration] Linking dynamically with shared v8 library ./libadblo
ckplus-binaries/android_$(TARGET_ARCH_ABI)/$1) | 22 $(info [Configuration] Linking dynamically with shared v8 library $(SHARED_V
8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/$1) |
12 endef | 23 endef |
13 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call info_define,$(item)))) | 24 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call info_define,$(item)))) |
14 endif | 25 endif |
15 | 26 |
16 # libadblockplus.a | 27 # libadblockplus.a |
17 include $(CLEAR_VARS) | 28 include $(CLEAR_VARS) |
18 | 29 |
19 LOCAL_MODULE := libadblockplus | 30 LOCAL_MODULE := libadblockplus |
20 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libadblo
ckplus.a | 31 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/libadbl
ockplus.a |
21 | 32 |
22 include $(PREBUILT_STATIC_LIBRARY) | 33 include $(PREBUILT_STATIC_LIBRARY) |
23 | 34 |
24 # libv8-platform.a | 35 # libv8-platform.a |
25 include $(CLEAR_VARS) | 36 include $(CLEAR_VARS) |
26 | 37 |
27 LOCAL_MODULE := v8-libplatform | 38 LOCAL_MODULE := v8-libplatform |
28 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li
bplatform.a | 39 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/libv8_l
ibplatform.a |
29 | 40 |
30 include $(PREBUILT_STATIC_LIBRARY) | 41 include $(PREBUILT_STATIC_LIBRARY) |
31 | 42 |
32 ifeq ($(SHARED_V8_LIB_FILENAMES),) | 43 ifeq ($(SHARED_V8_LIB_FILENAMES),) |
33 # static | 44 # static |
34 | 45 |
35 # libv8-libsampler.a | 46 # libv8-libsampler.a |
36 include $(CLEAR_VARS) | 47 include $(CLEAR_VARS) |
37 | 48 |
38 LOCAL_MODULE := v8-libsampler | 49 LOCAL_MODULE := v8-libsampler |
39 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li
bsampler.a | 50 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/libv8_l
ibsampler.a |
40 | 51 |
41 include $(PREBUILT_STATIC_LIBRARY) | 52 include $(PREBUILT_STATIC_LIBRARY) |
42 | 53 |
43 # libv8-base.a | 54 # libv8-base.a |
44 include $(CLEAR_VARS) | 55 include $(CLEAR_VARS) |
45 | 56 |
46 LOCAL_MODULE := v8-base | 57 LOCAL_MODULE := v8-base |
47 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_ba
se.a | 58 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/libv8_b
ase.a |
48 | 59 |
49 include $(PREBUILT_STATIC_LIBRARY) | 60 include $(PREBUILT_STATIC_LIBRARY) |
50 | 61 |
51 # libv8_libbase.a | 62 # libv8_libbase.a |
52 include $(CLEAR_VARS) | 63 include $(CLEAR_VARS) |
53 | 64 |
54 LOCAL_MODULE := v8-libbase | 65 LOCAL_MODULE := v8-libbase |
55 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_li
bbase.a | 66 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/libv8_l
ibbase.a |
56 | 67 |
57 include $(PREBUILT_STATIC_LIBRARY) | 68 include $(PREBUILT_STATIC_LIBRARY) |
58 | 69 |
59 # libv8_snapshot.a | 70 # libv8_snapshot.a |
60 include $(CLEAR_VARS) | 71 include $(CLEAR_VARS) |
61 | 72 |
62 LOCAL_MODULE := v8-snapshot | 73 LOCAL_MODULE := v8-snapshot |
63 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/libv8_sn
apshot.a | 74 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/libv8_s
napshot.a |
64 | 75 |
65 include $(PREBUILT_STATIC_LIBRARY) | 76 include $(PREBUILT_STATIC_LIBRARY) |
66 | 77 |
67 else | 78 else |
68 # dynamic | 79 # dynamic |
69 | 80 |
70 # prebuilt shared libraries v8 | 81 # prebuilt shared libraries v8 |
71 | 82 |
72 define libv8_define | 83 define libv8_define |
73 include $(CLEAR_VARS) | 84 include $(CLEAR_VARS) |
74 | 85 |
75 LOCAL_MODULE := $1 | 86 LOCAL_MODULE := $1 |
76 LOCAL_SRC_FILES := ./libadblockplus-binaries/android_$(TARGET_ARCH_ABI)/$1 | 87 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIRECTORY)/android_$(TARGET_ARCH_ABI)/$1 |
77 | 88 |
78 include $(PREBUILT_SHARED_LIBRARY) | 89 include $(PREBUILT_SHARED_LIBRARY) |
79 endef | 90 endef |
80 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call libv8_define,$(item)))) | 91 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call libv8_define,$(item)))) |
81 | 92 |
82 endif | 93 endif |
83 | 94 |
84 include $(CLEAR_VARS) | 95 include $(CLEAR_VARS) |
85 | 96 |
86 LOCAL_MODULE := libadblockplus-jni | 97 LOCAL_MODULE := libadblockplus-jni |
87 LOCAL_SRC_FILES := JniLibrary.cpp | 98 LOCAL_SRC_FILES := JniLibrary.cpp |
88 LOCAL_SRC_FILES += JniPlatform.cpp | 99 LOCAL_SRC_FILES += JniPlatform.cpp |
89 LOCAL_SRC_FILES += JniJsEngine.cpp JniFilterEngine.cpp JniJsValue.cpp | 100 LOCAL_SRC_FILES += JniJsEngine.cpp JniFilterEngine.cpp JniJsValue.cpp |
90 LOCAL_SRC_FILES += JniFilter.cpp JniSubscription.cpp JniEventCallback.cpp | 101 LOCAL_SRC_FILES += JniFilter.cpp JniSubscription.cpp JniEventCallback.cpp |
91 LOCAL_SRC_FILES += JniLogSystem.cpp JniWebRequest.cpp | 102 LOCAL_SRC_FILES += JniLogSystem.cpp JniWebRequest.cpp |
92 LOCAL_SRC_FILES += JniUpdateAvailableCallback.cpp JniUpdateCheckDoneCallback.cpp | 103 LOCAL_SRC_FILES += JniUpdateAvailableCallback.cpp JniUpdateCheckDoneCallback.cpp |
93 LOCAL_SRC_FILES += JniFilterChangeCallback.cpp JniCallbacks.cpp Utils.cpp | 104 LOCAL_SRC_FILES += JniFilterChangeCallback.cpp JniCallbacks.cpp Utils.cpp |
94 LOCAL_SRC_FILES += JniNotification.cpp JniShowNotificationCallback.cpp | 105 LOCAL_SRC_FILES += JniNotification.cpp JniShowNotificationCallback.cpp |
95 LOCAL_SRC_FILES += JniIsAllowedConnectionTypeCallback.cpp | 106 LOCAL_SRC_FILES += JniIsAllowedConnectionTypeCallback.cpp |
96 | 107 |
97 LOCAL_CPP_FEATURES := exceptions | 108 LOCAL_CPP_FEATURES := exceptions |
98 LOCAL_CPPFLAGS += -std=c++11 | 109 LOCAL_CPPFLAGS += -std=c++11 |
99 | 110 |
100 LOCAL_C_INCLUDES := jni/libadblockplus-binaries/include/ | 111 LOCAL_C_INCLUDES := $(SHARED_V8_INCLUDE_DIRECTORY) |
101 | 112 |
102 LOCAL_STATIC_LIBRARIES := libadblockplus v8-libplatform | 113 LOCAL_STATIC_LIBRARIES := libadblockplus v8-libplatform |
103 | 114 |
104 ifeq ($(SHARED_V8_LIB_FILENAMES),) | 115 ifeq ($(SHARED_V8_LIB_FILENAMES),) |
105 # static | 116 # static |
106 LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase | 117 LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase |
107 else | 118 else |
108 # dynamic | 119 # dynamic |
109 LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAMES) | 120 LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAMES) |
110 endif | 121 endif |
111 | 122 |
112 include $(BUILD_SHARED_LIBRARY) | 123 include $(BUILD_SHARED_LIBRARY) |
OLD | NEW |