OSDN Git Service

am dd77efd5: (-s ours) am 60326ce1: Android ICU4.2.1 upgrade. DO NOT MERGE. ...
[android-x86/external-webkit.git] / Android.mk
1 ##
2 ## Copyright 2009, The Android Open Source Project
3 ##
4 ## Redistribution and use in source and binary forms, with or without
5 ## modification, are permitted provided that the following conditions
6 ## are met:
7 ##  * Redistributions of source code must retain the above copyright
8 ##    notice, this list of conditions and the following disclaimer.
9 ##  * Redistributions in binary form must reproduce the above copyright
10 ##    notice, this list of conditions and the following disclaimer in the
11 ##    documentation and/or other materials provided with the distribution.
12 ##
13 ## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
14 ## EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 ## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 ## PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 ## EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 ## PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 ## PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 ## OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 ## (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 ## OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 ##
25
26 LOCAL_PATH := $(call my-dir)
27
28 # Two ways to control which JS engine is used:
29 # 1. use JS_ENGINE environment variable, value can be either 'jsc' or 'v8'
30 #    This is the preferred way.
31 # 2. if JS_ENGINE is not set, or is not 'jsc' or 'v8', this makefile picks
32 #    up a default engine to build.
33 #    To help setup buildbot, a new environment variable, USE_ALT_JS_ENGINE,
34 #    can be set to true, so that two builds can be different but without
35 #    specifying which JS engine to use.
36
37 # To enable JIT in Android's JSC, please set ENABLE_JSC_JIT environment
38 # variable to true.
39
40 # Read JS_ENGINE environment variable
41 JAVASCRIPT_ENGINE = $(JS_ENGINE)
42
43 ifneq ($(JAVASCRIPT_ENGINE),jsc)
44   ifneq ($(JAVASCRIPT_ENGINE),v8)
45     # No JS engine is specified, pickup the one we want as default.
46     ifeq ($(USE_ALT_JS_ENGINE),true)
47       JAVASCRIPT_ENGINE = v8
48     else
49       JAVASCRIPT_ENGINE = jsc
50     endif
51   endif
52 endif
53
54 BASE_PATH := $(call my-dir)
55 include $(CLEAR_VARS)
56
57 # Define our module and find the intermediates directory
58 LOCAL_MODULE := libwebcore
59 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
60 base_intermediates := $(call local-intermediates-dir)
61
62 # Using := here prevents recursive expansion
63 WEBKIT_SRC_FILES :=
64
65 # We have to use bison 2.3
66 include $(BASE_PATH)/bison_check.mk
67
68 # Build our list of include paths. We include WebKit/android/icu first so that
69 # any files that include <unicode/ucnv.h> will include our ucnv.h first. We
70 # also add external/ as an include directory so that we can specify the real
71 # icu header directory as a more exact reference to avoid including our ucnv.h.
72 #
73 # Note that JavasCriptCore/ must be included after WebCore/, so that we pick up
74 # the right config.h.
75 LOCAL_C_INCLUDES := \
76         $(JNI_H_INCLUDE) \
77         $(LOCAL_PATH)/WebKit/android/icu \
78         external/ \
79         external/icu4c/common \
80         external/icu4c/i18n \
81         external/libxml2/include \
82         external/skia/emoji \
83         external/skia/include/core \
84         external/skia/include/effects \
85         external/skia/include/images \
86         external/skia/include/ports \
87         external/skia/include/utils \
88         external/skia/src/ports \
89         external/sqlite/dist \
90         frameworks/base/core/jni/android/graphics
91
92 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
93         $(LOCAL_PATH)/WebCore \
94         $(LOCAL_PATH)/WebCore/accessibility \
95         $(LOCAL_PATH)/WebCore/bindings/generic \
96         $(LOCAL_PATH)/WebCore/css \
97         $(LOCAL_PATH)/WebCore/dom \
98         $(LOCAL_PATH)/WebCore/editing \
99         $(LOCAL_PATH)/WebCore/history \
100         $(LOCAL_PATH)/WebCore/history/android \
101         $(LOCAL_PATH)/WebCore/html \
102         $(LOCAL_PATH)/WebCore/html/canvas \
103         $(LOCAL_PATH)/WebCore/inspector \
104         $(LOCAL_PATH)/WebCore/loader \
105         $(LOCAL_PATH)/WebCore/loader/appcache \
106         $(LOCAL_PATH)/WebCore/loader/icon \
107         $(LOCAL_PATH)/WebCore/notifications \
108         $(LOCAL_PATH)/WebCore/page \
109         $(LOCAL_PATH)/WebCore/page/android \
110         $(LOCAL_PATH)/WebCore/page/animation \
111         $(LOCAL_PATH)/WebCore/platform \
112         $(LOCAL_PATH)/WebCore/platform/android \
113         $(LOCAL_PATH)/WebCore/platform/animation \
114         $(LOCAL_PATH)/WebCore/platform/graphics \
115         $(LOCAL_PATH)/WebCore/platform/graphics/android \
116         $(LOCAL_PATH)/WebCore/platform/graphics/filters \
117         $(LOCAL_PATH)/WebCore/platform/graphics/network \
118         $(LOCAL_PATH)/WebCore/platform/graphics/skia \
119         $(LOCAL_PATH)/WebCore/platform/graphics/transforms \
120         $(LOCAL_PATH)/WebCore/platform/image-decoders \
121         $(LOCAL_PATH)/WebCore/platform/image-decoders/bmp \
122         $(LOCAL_PATH)/WebCore/platform/image-decoders/gif \
123         $(LOCAL_PATH)/WebCore/platform/image-decoders/ico \
124         $(LOCAL_PATH)/WebCore/platform/image-decoders/jpeg \
125         $(LOCAL_PATH)/WebCore/platform/image-decoders/png \
126         $(LOCAL_PATH)/WebCore/platform/mock \
127         $(LOCAL_PATH)/WebCore/platform/network \
128         $(LOCAL_PATH)/WebCore/platform/network/android \
129         $(LOCAL_PATH)/WebCore/platform/sql \
130         $(LOCAL_PATH)/WebCore/platform/text \
131         $(LOCAL_PATH)/WebCore/plugins \
132         $(LOCAL_PATH)/WebCore/plugins/android \
133         $(LOCAL_PATH)/WebCore/rendering \
134         $(LOCAL_PATH)/WebCore/rendering/style \
135         $(LOCAL_PATH)/WebCore/storage \
136         $(LOCAL_PATH)/WebCore/svg \
137         $(LOCAL_PATH)/WebCore/svg/animation \
138         $(LOCAL_PATH)/WebCore/svg/graphics \
139         $(LOCAL_PATH)/WebCore/svg/graphics/filters \
140         $(LOCAL_PATH)/WebCore/websockets \
141         $(LOCAL_PATH)/WebCore/workers \
142         $(LOCAL_PATH)/WebCore/xml
143
144 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
145         $(LOCAL_PATH)/WebKit/android \
146         $(LOCAL_PATH)/WebKit/android/WebCoreSupport \
147         $(LOCAL_PATH)/WebKit/android/jni \
148         $(LOCAL_PATH)/WebKit/android/nav \
149         $(LOCAL_PATH)/WebKit/android/plugins
150
151 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
152         $(LOCAL_PATH)/JavaScriptCore \
153         $(LOCAL_PATH)/JavaScriptCore/wtf \
154         $(LOCAL_PATH)/JavaScriptCore/wtf/unicode \
155         $(LOCAL_PATH)/JavaScriptCore/wtf/unicode/icu
156
157 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
158         $(base_intermediates)/WebCore/ \
159         $(base_intermediates)/WebCore/css \
160         $(base_intermediates)/WebCore/html \
161         $(base_intermediates)/WebCore/platform
162
163 ifeq ($(JAVASCRIPT_ENGINE),v8)
164 # Include WTF source file.
165 d := JavaScriptCore
166 LOCAL_PATH := $(BASE_PATH)/$d
167 intermediates := $(base_intermediates)/$d
168 include $(LOCAL_PATH)/Android.v8.wtf.mk
169 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
170 endif  # JAVASCRIPT_ENGINE == v8
171
172 # Include source files for WebCore
173 d := WebCore
174 LOCAL_PATH := $(BASE_PATH)/$d
175 JAVASCRIPTCORE_PATH := $(BASE_PATH)/JavaScriptCore
176 intermediates := $(base_intermediates)/$d
177 include $(LOCAL_PATH)/Android.mk
178 ifeq ($(JAVASCRIPT_ENGINE),jsc)
179 include $(LOCAL_PATH)/Android.jscbindings.mk
180 endif
181 ifeq ($(JAVASCRIPT_ENGINE),v8)
182 include $(LOCAL_PATH)/Android.v8bindings.mk
183 endif
184 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
185 LOCAL_C_INCLUDES += $(BINDING_C_INCLUDES)
186
187 # Include the derived source files for WebCore. Uses the same path as
188 # WebCore
189 include $(LOCAL_PATH)/Android.derived.mk
190 ifeq ($(JAVASCRIPT_ENGINE),jsc)
191 include $(LOCAL_PATH)/Android.derived.jscbindings.mk
192 endif
193 ifeq ($(JAVASCRIPT_ENGINE),v8)
194 include $(LOCAL_PATH)/Android.derived.v8bindings.mk
195 endif
196
197 # Include source files for android WebKit port
198 d := WebKit
199 LOCAL_PATH := $(BASE_PATH)/$d
200 intermediates := $(base_intermediates)/$d
201 include $(LOCAL_PATH)/Android.mk
202 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
203
204 # Redefine LOCAL_PATH here so the build system is not confused
205 LOCAL_PATH := $(BASE_PATH)
206
207 # Define our compiler flags
208 LOCAL_CFLAGS += -Wno-endif-labels -Wno-import -Wno-format
209 LOCAL_CFLAGS += -fno-strict-aliasing
210 LOCAL_CFLAGS += -include "WebCorePrefix.h"
211 LOCAL_CFLAGS += -fvisibility=hidden
212
213 # Enable JSC JIT if JSC is used and ENABLE_JSC_JIT environment
214 # variable is set to true
215 ifeq ($(JAVASCRIPT_ENGINE),jsc)
216 ifeq ($(ENABLE_JSC_JIT),true)
217 LOCAL_CFLAGS += -DENABLE_ANDROID_JSC_JIT=1
218 endif
219 endif
220
221 ifeq ($(TARGET_ARCH),arm)
222 LOCAL_CFLAGS += -Darm
223 # remove this warning: "note: the mangling of 'va_list' has changed in GCC 4.4"
224 LOCAL_CFLAGS += -Wno-psabi
225 endif
226
227 # need a flag to tell the C side when we're on devices with large memory
228 # budgets (i.e. larger than the low-end devices that initially shipped)
229 ifeq ($(ARCH_ARM_HAVE_VFP),true)
230 LOCAL_CFLAGS += -DANDROID_LARGE_MEMORY_DEVICE
231 endif
232
233 ifeq ($(ENABLE_SVG),true)
234 LOCAL_CFLAGS += -DENABLE_SVG=1
235 endif
236
237 ifeq ($(ENABLE_WTF_USE_ACCELERATED_COMPOSITING),false)
238 LOCAL_CFLAGS += -DWTF_USE_ACCELERATED_COMPOSITING=0
239 endif
240
241 ifeq ($(ENABLE_WTF_USE_ACCELERATED_COMPOSITING),true)
242 LOCAL_CFLAGS += -DWTF_USE_ACCELERATED_COMPOSITING=1
243 endif
244
245 # Temporary disable SVG_ANIMATION.
246 ifeq ($(ENABLE_SVG_ANIMATION),true)
247 LOCAL_CFLAGS += -DENABLE_SVG_ANIMATION=1
248 endif
249
250 ifeq ($(WEBCORE_INSTRUMENTATION),true)
251 LOCAL_CFLAGS += -DANDROID_INSTRUMENT
252 endif
253
254 # LOCAL_LDLIBS is used in simulator builds only and simulator builds are only
255 # valid on Linux
256 LOCAL_LDLIBS += -lpthread -ldl
257
258 # Build the list of shared libraries
259 LOCAL_SHARED_LIBRARIES := \
260         libandroid_runtime \
261         libnativehelper \
262         libsqlite \
263         libskia \
264         libutils \
265         libui \
266         libcutils \
267         libicuuc \
268         libicudata \
269         libicui18n \
270         libmedia \
271         libsurfaceflinger_client
272
273 ifeq ($(WEBCORE_INSTRUMENTATION),true)
274 LOCAL_SHARED_LIBRARIES += libhardware_legacy
275 endif
276
277 # We have to use the android version of libdl when we are not on the simulator
278 ifneq ($(TARGET_SIMULATOR),true)
279 LOCAL_SHARED_LIBRARIES += libdl libstlport
280 include external/stlport/libstlport.mk
281 endif
282
283 # Build the list of static libraries
284 LOCAL_STATIC_LIBRARIES := libxml2
285 ifeq ($(JAVASCRIPT_ENGINE),v8)
286 LOCAL_STATIC_LIBRARIES += libv8
287 endif
288
289 # Redefine LOCAL_SRC_FILES to be all the WebKit source files
290 LOCAL_SRC_FILES := $(WEBKIT_SRC_FILES)
291
292 # Define this for use in other makefiles.
293 WEBKIT_C_INCLUDES := $(LOCAL_C_INCLUDES)
294 WEBKIT_CFLAGS := $(LOCAL_CFLAGS)
295 WEBKIT_GENERATED_SOURCES := $(LOCAL_GENERATED_SOURCES)
296 WEBKIT_LDLIBS := $(LOCAL_LDLIBS)
297 WEBKIT_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES)
298 WEBKIT_STATIC_LIBRARIES := $(LOCAL_STATIC_LIBRARIES)
299
300 # Build the library all at once
301 include $(BUILD_STATIC_LIBRARY)
302
303 ifeq ($(JAVASCRIPT_ENGINE),jsc)
304 # Now build libjs as a static library.
305 include $(CLEAR_VARS)
306 LOCAL_MODULE := libjs
307 LOCAL_LDLIBS := $(WEBKIT_LDLIBS)
308 LOCAL_SHARED_LIBRARIES := $(WEBKIT_SHARED_LIBRARIES)
309 LOCAL_STATIC_LIBRARIES := $(WEBKIT_STATIC_LIBRARIES)
310 LOCAL_CFLAGS := $(WEBKIT_CFLAGS)
311 # Include source files for JavaScriptCore
312 d := JavaScriptCore
313 LOCAL_PATH := $(BASE_PATH)/$d
314 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
315 # Cannot use base_intermediates as this is a new module
316 intermediates := $(call local-intermediates-dir)
317 include $(LOCAL_PATH)/Android.mk
318 # Redefine LOCAL_SRC_FILES with the correct prefix
319 LOCAL_SRC_FILES := $(addprefix $d/,$(LOCAL_SRC_FILES))
320 # Use the base path to resolve file names
321 LOCAL_PATH := $(BASE_PATH)
322 # Append jsc intermediate include paths to the WebKit include list.
323 LOCAL_C_INCLUDES := $(WEBKIT_C_INCLUDES) \
324         $(intermediates) \
325         $(intermediates)/parser \
326         $(intermediates)/runtime \
327 # Build libjs
328 include $(BUILD_STATIC_LIBRARY)
329 endif  # JAVASCRIPT_ENGINE == jsc
330
331 # Now build the shared library using only the exported jni entry point. This
332 # will strip out any unused code from the entry point.
333 include $(CLEAR_VARS)
334 # if you need to make webcore huge (for debugging), enable this line
335 #LOCAL_PRELINK_MODULE := false
336 LOCAL_MODULE := libwebcore
337 LOCAL_LDLIBS := $(WEBKIT_LDLIBS)
338 LOCAL_SHARED_LIBRARIES := $(WEBKIT_SHARED_LIBRARIES)
339 LOCAL_STATIC_LIBRARIES := libwebcore $(WEBKIT_STATIC_LIBRARIES)
340 ifeq ($(JAVASCRIPT_ENGINE),jsc)
341 LOCAL_STATIC_LIBRARIES += libjs
342 endif
343 LOCAL_LDFLAGS := -fvisibility=hidden
344 LOCAL_CFLAGS := $(WEBKIT_CFLAGS)
345 LOCAL_C_INCLUDES := $(WEBKIT_C_INCLUDES)
346 LOCAL_PATH := $(BASE_PATH)
347 LOCAL_SRC_FILES := \
348         WebKit/android/jni/WebCoreJniOnLoad.cpp
349 # Do this dependency by hand. The reason we have to do this is because the
350 # headers that this file pulls in are generated during the build of webcore.
351 # We make all of our object files depend on those files so that they are built
352 # before we try to compile the file.
353 LOCAL_ADDITIONAL_DEPENDENCIES := $(filter %.h, $(WEBKIT_GENERATED_SOURCES))
354 include $(BUILD_SHARED_LIBRARY)
355
356 # Build the wds client
357 include $(BASE_PATH)/WebKit/android/wds/client/Android.mk
358
359 # Build the performance command line tool.
360 include $(BASE_PATH)/WebKit/android/benchmark/Android.mk
361
362 # Build the webkit merge tool.
363 include $(BASE_PATH)/WebKitTools/android/webkitmerge/Android.mk