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

Side by Side Diff: adblock-android/jni/Android.mk

Issue 29812630: Issue 6750 - Update libadblockplus dependency to revision hg:4f6413dbcf2e (Closed)
Patch Set: Updated Android.mk because of different dirs per prebuilt libs. Created June 21, 2018, 6:53 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « README.md ('k') | dependencies » ('j') | dependencies » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 LOCAL_PATH := $(call my-dir) 1 LOCAL_PATH := $(call my-dir)
2 2
3 # SHARED_V8_LIB_DIR is expected to be full absolute path if set by user 3 # Use cases:
4 ifeq ($(SHARED_V8_LIB_DIR),) 4 # ----------
5 # default 5 # V8 - static/dynamic
6 SHARED_V8_LIB_DIR := ./libadblockplus-binaries 6 # headers: V8_INCLUDE_DIR
7 SHARED_V8_INCLUDE_DIR := jni/libadblockplus-binaries/include/ 7 # binaries:
8 else 8 # static: STATIC_V8_LIB_DIR (libv8_monolith.a)
9 # set by user 9 # dynamic: SHARED_V8_LIB_DIR (libv8.cr.so, libv8_libbase.cr.so)
10 $(info [Configuration] Using shared v8 libraries directory $(SHARED_V8_LIB_DIR )) 10 # libadblockplus - static
11 SHARED_V8_INCLUDE_DIR := $(SHARED_V8_LIB_DIR)/include/ 11 # headers: LIBABP_INCLUDE_DIR
12 # binaries:
13 # LIBABP_LIB_DIR (libadblockplus.a)
14
15 # libadblockplus
16 # ---
17
18 # headers
19
20 # default
21 ifeq ($(LIBABP_INCLUDE_DIR),)
22 LIBABP_INCLUDE_DIR := $(PWD)/../libadblockplus/include
23 $(info [Configuration] Pass LIBABP_INCLUDE_DIR to set libadblockplus headers d irectory, using default value.)
12 endif 24 endif
13 25
14 # Report configuration 26 $(info [Configuration] Using libadblockplus headers directory $(LIBABP_INCLUDE_D IR))
15 ifeq ($(SHARED_V8_LIB_FILENAMES),) 27 TMP_C_INCLUDES := $(LIBABP_INCLUDE_DIR)
16 # static
17 $(info [Configuration] Linking statically with built-in v8)
18 else
19 # dynamic
20 28
21 define info_define 29 # binaries
22 $(info [Configuration] Linking dynamically with shared v8 library $(SHARED_V 8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/$1) 30
23 endef 31 ifeq ($(LIBABP_LIB_DIR),)
24 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call info_define,$(item)))) 32 LIBABP_LIB_DIR := $(PWD)/../libadblockplus/build/local/$(TARGET_ARCH_ABI)
33 $(info [Configuration] Pass LIBABP_LIB_DIR to set static libadblockplus librar y directory, using default value.)
25 endif 34 endif
26 35
27 # libadblockplus.a 36 $(info [Configuration] Using static libadblockplus library $(LIBABP_LIB_DIR)/lib adblockplus.a)
37
28 include $(CLEAR_VARS) 38 include $(CLEAR_VARS)
39 LOCAL_MODULE := libadblockplus
40 LOCAL_SRC_FILES := $(LIBABP_LIB_DIR)/libadblockplus.a
41 include $(PREBUILT_STATIC_LIBRARY)
42 TMP_LIBRARIES += libadblockplus
43 # ---
29 44
30 LOCAL_MODULE := libadblockplus 45 # V8
31 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/libadblockplu s.a 46 # ---
32 47
33 include $(PREBUILT_STATIC_LIBRARY) 48 # headers
34 49
35 # libv8-platform.a 50 # default
36 include $(CLEAR_VARS) 51 ifeq ($(V8_INCLUDE_DIR),)
52 V8_INCLUDE_DIR := $(PWD)/../libadblockplus/third_party/prebuilt-v8/include
53 $(info [Configuration] Pass V8_INCLUDE_DIR to set V8 headers directory, using default value.)
54 endif
37 55
38 LOCAL_MODULE := v8-libplatform 56 $(info [Configuration] Using V8 headers directory $(V8_INCLUDE_DIR))
39 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/libv8_libplat form.a 57 TMP_C_INCLUDES += $(V8_INCLUDE_DIR)
40 58
41 include $(PREBUILT_STATIC_LIBRARY) 59 # binaries
60 ifeq ($(SHARED_V8_LIB_DIR),)
42 61
43 ifeq ($(SHARED_V8_LIB_FILENAMES),) 62 # default
44 # static 63 ifeq ($(STATIC_V8_LIB_DIR),)
45 64
46 # libv8-libsampler.a 65 ifeq ($(APP_ABI),armeabi-v7a)
47 include $(CLEAR_VARS) 66 ABP_TARGET_ARCH := arm
67 else
68 ABP_TARGET_ARCH := ia32
69 endif
70
71 STATIC_V8_LIB_DIR := $(PWD)/../libadblockplus/third_party/prebuilt-v8/androi d-$(ABP_TARGET_ARCH)-release
72 $(info [Configuration] Pass STATIC_V8_LIB_DIR to set static V8 libraries dir ectory, using default value.)
73 endif
48 74
49 LOCAL_MODULE := v8-libsampler 75 $(info [Configuration] Using static v8 library $(STATIC_V8_LIB_DIR)/libv8_mono lith.a)
50 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/libv8_libsamp ler.a
51 76
52 include $(PREBUILT_STATIC_LIBRARY) 77 include $(CLEAR_VARS)
53 78 LOCAL_MODULE := libv8_monolith
54 # libv8-base.a 79 LOCAL_SRC_FILES := $(STATIC_V8_LIB_DIR)/libv8_monolith.a
55 include $(CLEAR_VARS) 80 include $(PREBUILT_STATIC_LIBRARY)
56 81 TMP_LIBRARIES += libv8_monolith
57 LOCAL_MODULE := v8-base
58 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/libv8_base.a
59
60 include $(PREBUILT_STATIC_LIBRARY)
61
62 # libv8_libbase.a
63 include $(CLEAR_VARS)
64
65 LOCAL_MODULE := v8-libbase
66 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/libv8_libbase .a
67
68 include $(PREBUILT_STATIC_LIBRARY)
69
70 # libv8_snapshot.a
71 include $(CLEAR_VARS)
72
73 LOCAL_MODULE := v8-snapshot
74 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/libv8_snapsho t.a
75
76 include $(PREBUILT_STATIC_LIBRARY)
77 82
78 else 83 else
79 # dynamic
80 84
81 # prebuilt shared libraries v8 85 define libv8_define
82 86 include $(CLEAR_VARS)
83 define libv8_define 87 $(info [Configuration] Linking dynamically with shared v8 library $(SHARED _V8_LIB_DIR)/$1)
84 include $(CLEAR_VARS) 88 LOCAL_MODULE := $1
85 89 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/$1
86 LOCAL_MODULE := $1 90 include $(PREBUILT_SHARED_LIBRARY)
87 LOCAL_SRC_FILES := $(SHARED_V8_LIB_DIR)/android_$(TARGET_ARCH_ABI)/$1 91 TMP_LIBRARIES += $1
88 92 endef
89 include $(PREBUILT_SHARED_LIBRARY) 93 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call libv8_define,$(item))) )
90 endef
91 $(foreach item,$(SHARED_V8_LIB_FILENAMES),$(eval $(call libv8_define,$(item))))
92 94
93 endif 95 endif
96 # ----
94 97
95 include $(CLEAR_VARS) 98 include $(CLEAR_VARS)
96 99
97 LOCAL_MODULE := libadblockplus-jni 100 LOCAL_MODULE := libadblockplus-jni
98 LOCAL_SRC_FILES := JniLibrary.cpp 101 LOCAL_SRC_FILES := JniLibrary.cpp
99 LOCAL_SRC_FILES += JniPlatform.cpp 102 LOCAL_SRC_FILES += JniPlatform.cpp
100 LOCAL_SRC_FILES += JniJsEngine.cpp JniFilterEngine.cpp JniJsValue.cpp 103 LOCAL_SRC_FILES += JniJsEngine.cpp JniFilterEngine.cpp JniJsValue.cpp
101 LOCAL_SRC_FILES += JniFilter.cpp JniSubscription.cpp JniEventCallback.cpp 104 LOCAL_SRC_FILES += JniFilter.cpp JniSubscription.cpp JniEventCallback.cpp
102 LOCAL_SRC_FILES += JniLogSystem.cpp JniWebRequest.cpp 105 LOCAL_SRC_FILES += JniLogSystem.cpp JniWebRequest.cpp
103 LOCAL_SRC_FILES += JniUpdateAvailableCallback.cpp JniUpdateCheckDoneCallback.cpp 106 LOCAL_SRC_FILES += JniUpdateAvailableCallback.cpp JniUpdateCheckDoneCallback.cpp
104 LOCAL_SRC_FILES += JniFilterChangeCallback.cpp JniCallbacks.cpp Utils.cpp 107 LOCAL_SRC_FILES += JniFilterChangeCallback.cpp JniCallbacks.cpp Utils.cpp
105 LOCAL_SRC_FILES += JniNotification.cpp JniShowNotificationCallback.cpp 108 LOCAL_SRC_FILES += JniNotification.cpp JniShowNotificationCallback.cpp
106 LOCAL_SRC_FILES += JniIsAllowedConnectionTypeCallback.cpp 109 LOCAL_SRC_FILES += JniIsAllowedConnectionTypeCallback.cpp
107 110
108 LOCAL_CPP_FEATURES := exceptions 111 LOCAL_CPP_FEATURES := exceptions
109 112
110 LOCAL_C_INCLUDES := $(SHARED_V8_INCLUDE_DIR)
111
112 LOCAL_LDFLAGS += -Wl,--allow-multiple-definition 113 LOCAL_LDFLAGS += -Wl,--allow-multiple-definition
113 LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true 114 LOCAL_DISABLE_FATAL_LINKER_WARNINGS := true
114 115
115 LOCAL_STATIC_LIBRARIES := libadblockplus v8-libplatform 116 # TMP_ variables are used to collect include paths for LOCAL_C_INCLUDES
116 117 # and libs for LOCAL_STATIC_LIBRARIES because `include $(CLEAR_VARS)` clears the m otherwise
117 ifeq ($(SHARED_V8_LIB_FILENAMES),) 118 LOCAL_C_INCLUDES := $(TMP_C_INCLUDES)
118 # static 119 LOCAL_STATIC_LIBRARIES := $(TMP_LIBRARIES)
119 LOCAL_STATIC_LIBRARIES += v8-base v8-snapshot v8-libsampler v8-libbase
120 else
121 # dynamic
122 LOCAL_STATIC_LIBRARIES += $(SHARED_V8_LIB_FILENAMES)
123 endif
124 120
125 include $(BUILD_SHARED_LIBRARY) 121 include $(BUILD_SHARED_LIBRARY)
OLDNEW
« no previous file with comments | « README.md ('k') | dependencies » ('j') | dependencies » ('J')

Powered by Google App Engine
This is Rietveld