2011-01-24 Martin Robinson <mrobinson@igalia.com>
[WebKit-https.git] / Android.mk
index a1f7db9..6ee564b 100644 (file)
@@ -33,6 +33,8 @@ LOCAL_PATH := $(call my-dir)
 #    To help setup buildbot, a new environment variable, USE_ALT_JS_ENGINE,
 #    can be set to true, so that two builds can be different but without
 #    specifying which JS engine to use.
+# To enable JIT in Android's JSC, please set ENABLE_JSC_JIT environment
+# variable to true.
 
 # Read JS_ENGINE environment variable
 JAVASCRIPT_ENGINE = $(JS_ENGINE)
@@ -62,18 +64,104 @@ WEBKIT_SRC_FILES :=
 # We have to use bison 2.3
 include $(BASE_PATH)/bison_check.mk
 
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-d := V8Binding
-LOCAL_PATH := $(BASE_PATH)/$d
-WEBCORE_PATH := $(BASE_PATH)/WebCore
-intermediates := $(base_intermediates)/WebCore
-JAVASCRIPTCORE_PATH := $(BASE_PATH)/JavaScriptCore
-include $(LOCAL_PATH)/V8Binding.derived.mk
-WEBKIT_SRC_FILES += $(addprefix $d/, $(LOCAL_SRC_FILES))
-WEBKIT_SRC_FILES += $(addprefix WebCore/, $(WEBCORE_SRC_FILES))
+# Build our list of include paths. We include Source/WebKit/android/icu first so that
+# any files that include <unicode/ucnv.h> will include our ucnv.h first. We
+# also add external/ as an include directory so that we can specify the real
+# icu header directory as a more exact reference to avoid including our ucnv.h.
+#
+# Note that JavasCriptCore/ must be included after WebCore/, so that we pick up
+# the right config.h.
+LOCAL_C_INCLUDES := \
+       $(JNI_H_INCLUDE) \
+       $(LOCAL_PATH)/Source/WebKit/android/icu \
+       external/ \
+       external/icu4c/common \
+       external/icu4c/i18n \
+       external/libxml2/include \
+       external/skia/emoji \
+       external/skia/include/core \
+       external/skia/include/effects \
+       external/skia/include/images \
+       external/skia/include/ports \
+       external/skia/include/utils \
+       external/skia/src/ports \
+       external/sqlite/dist \
+       frameworks/base/core/jni/android/graphics
+
+LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
+       $(LOCAL_PATH)/Source/WebCore \
+       $(LOCAL_PATH)/Source/WebCore/accessibility \
+       $(LOCAL_PATH)/Source/WebCore/bindings/generic \
+       $(LOCAL_PATH)/Source/WebCore/css \
+       $(LOCAL_PATH)/Source/WebCore/dom \
+       $(LOCAL_PATH)/Source/WebCore/editing \
+       $(LOCAL_PATH)/Source/WebCore/history \
+       $(LOCAL_PATH)/Source/WebCore/history/android \
+       $(LOCAL_PATH)/Source/WebCore/html \
+       $(LOCAL_PATH)/Source/WebCore/html/canvas \
+       $(LOCAL_PATH)/Source/WebCore/inspector \
+       $(LOCAL_PATH)/Source/WebCore/loader \
+       $(LOCAL_PATH)/Source/WebCore/loader/appcache \
+       $(LOCAL_PATH)/Source/WebCore/loader/icon \
+       $(LOCAL_PATH)/Source/WebCore/notifications \
+       $(LOCAL_PATH)/Source/WebCore/page \
+       $(LOCAL_PATH)/Source/WebCore/page/android \
+       $(LOCAL_PATH)/Source/WebCore/page/animation \
+       $(LOCAL_PATH)/Source/WebCore/platform \
+       $(LOCAL_PATH)/Source/WebCore/platform/android \
+       $(LOCAL_PATH)/Source/WebCore/platform/animation \
+       $(LOCAL_PATH)/Source/WebCore/platform/graphics \
+       $(LOCAL_PATH)/Source/WebCore/platform/graphics/android \
+       $(LOCAL_PATH)/Source/WebCore/platform/graphics/network \
+       $(LOCAL_PATH)/Source/WebCore/platform/graphics/skia \
+       $(LOCAL_PATH)/Source/WebCore/platform/graphics/transforms \
+       $(LOCAL_PATH)/Source/WebCore/platform/image-decoders \
+       $(LOCAL_PATH)/Source/WebCore/platform/mock \
+       $(LOCAL_PATH)/Source/WebCore/platform/network \
+       $(LOCAL_PATH)/Source/WebCore/platform/network/android \
+       $(LOCAL_PATH)/Source/WebCore/platform/sql \
+       $(LOCAL_PATH)/Source/WebCore/platform/text \
+       $(LOCAL_PATH)/Source/WebCore/plugins \
+       $(LOCAL_PATH)/Source/WebCore/plugins/android \
+       $(LOCAL_PATH)/Source/WebCore/rendering \
+       $(LOCAL_PATH)/Source/WebCore/rendering/style \
+       $(LOCAL_PATH)/Source/WebCore/storage \
+       $(LOCAL_PATH)/Source/WebCore/workers \
+       $(LOCAL_PATH)/Source/WebCore/xml
+
+LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
+       $(LOCAL_PATH)/Source/WebKit/android \
+       $(LOCAL_PATH)/Source/WebKit/android/WebCoreSupport \
+       $(LOCAL_PATH)/Source/WebKit/android/jni \
+       $(LOCAL_PATH)/Source/WebKit/android/nav \
+       $(LOCAL_PATH)/Source/WebKit/android/plugins \
+       $(LOCAL_PATH)/Source/WebKit/android/stl
+
+LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
+       $(LOCAL_PATH)/Source/JavaScriptCore \
+       $(LOCAL_PATH)/Source/JavaScriptCore/wtf \
+       $(LOCAL_PATH)/Source/JavaScriptCore/wtf/unicode \
+       $(LOCAL_PATH)/Source/JavaScriptCore/wtf/unicode/icu
+
+LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
+       $(base_intermediates)/Source/WebCore/ \
+       $(base_intermediates)/Source/WebCore/css \
+       $(base_intermediates)/Source/WebCore/html \
+       $(base_intermediates)/Source/WebCore/platform
+
+ifeq ($(ENABLE_SVG), true)
+LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
+       $(LOCAL_PATH)/Source/WebCore/platform/graphics/filters \
+       $(LOCAL_PATH)/Source/WebCore/svg \
+       $(LOCAL_PATH)/Source/WebCore/svg/animation \
+       $(LOCAL_PATH)/Source/WebCore/svg/graphics \
+       $(LOCAL_PATH)/Source/WebCore/svg/graphics/filters \
+       $(base_intermediates)/Source/WebCore/svg
+endif
 
+ifeq ($(JAVASCRIPT_ENGINE),v8)
 # Include WTF source file.
-d := JavaScriptCore
+d := Source/JavaScriptCore
 LOCAL_PATH := $(BASE_PATH)/$d
 intermediates := $(base_intermediates)/$d
 include $(LOCAL_PATH)/Android.v8.wtf.mk
@@ -83,12 +171,17 @@ endif  # JAVASCRIPT_ENGINE == v8
 # Include source files for WebCore
 d := WebCore
 LOCAL_PATH := $(BASE_PATH)/$d
+JAVASCRIPTCORE_PATH := $(BASE_PATH)/Source/JavaScriptCore
 intermediates := $(base_intermediates)/$d
 include $(LOCAL_PATH)/Android.mk
 ifeq ($(JAVASCRIPT_ENGINE),jsc)
 include $(LOCAL_PATH)/Android.jscbindings.mk
 endif
+ifeq ($(JAVASCRIPT_ENGINE),v8)
+include $(LOCAL_PATH)/Android.v8bindings.mk
+endif
 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
+LOCAL_C_INCLUDES += $(BINDING_C_INCLUDES)
 
 # Include the derived source files for WebCore. Uses the same path as
 # WebCore
@@ -96,7 +189,9 @@ include $(LOCAL_PATH)/Android.derived.mk
 ifeq ($(JAVASCRIPT_ENGINE),jsc)
 include $(LOCAL_PATH)/Android.derived.jscbindings.mk
 endif
-WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
+ifeq ($(JAVASCRIPT_ENGINE),v8)
+include $(LOCAL_PATH)/Android.derived.v8bindings.mk
+endif
 
 # Redefine LOCAL_PATH here so the build system is not confused
 LOCAL_PATH := $(BASE_PATH)
@@ -107,6 +202,14 @@ LOCAL_CFLAGS += -fno-strict-aliasing
 LOCAL_CFLAGS += -include "WebCorePrefix.h"
 LOCAL_CFLAGS += -fvisibility=hidden
 
+# Enable JSC JIT if JSC is used and ENABLE_JSC_JIT environment
+# variable is set to true
+ifeq ($(JAVASCRIPT_ENGINE),jsc)
+ifeq ($(ENABLE_JSC_JIT),true)
+LOCAL_CFLAGS += -DENABLE_ANDROID_JSC_JIT=1
+endif
+endif
+
 ifeq ($(TARGET_ARCH),arm)
 LOCAL_CFLAGS += -Darm
 endif
@@ -128,146 +231,6 @@ endif
 # valid on Linux
 LOCAL_LDLIBS += -lpthread -ldl
 
-# Build our list of include paths. We include WebKit/android/icu first so that
-# any files that include <unicode/ucnv.h> will include our ucnv.h first. We
-# also add external/ as an include directory so that we can specify the real
-# icu header directory as a more exact reference to avoid including our ucnv.h.
-LOCAL_C_INCLUDES := \
-       $(JNI_H_INCLUDE) \
-       $(LOCAL_PATH)/WebKit/android/icu \
-       external/ \
-       external/icu4c/common \
-       external/icu4c/i18n \
-       external/libxml2/include \
-       external/skia/emoji \
-       external/skia/include/core \
-       external/skia/include/effects \
-       external/skia/include/images \
-       external/skia/include/ports \
-       external/skia/include/utils \
-       external/skia/src/ports \
-       external/sqlite/dist \
-       frameworks/base/core/jni/android/graphics
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       external/v8/include
-endif
-
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/WebCore \
-       $(LOCAL_PATH)/WebCore/accessibility \
-       $(LOCAL_PATH)/WebCore/css \
-       $(LOCAL_PATH)/WebCore/dom \
-       $(LOCAL_PATH)/WebCore/editing \
-       $(LOCAL_PATH)/WebCore/history \
-       $(LOCAL_PATH)/WebCore/html \
-       $(LOCAL_PATH)/WebCore/html/canvas \
-       $(LOCAL_PATH)/WebCore/inspector \
-       $(LOCAL_PATH)/WebCore/loader \
-       $(LOCAL_PATH)/WebCore/loader/appcache \
-       $(LOCAL_PATH)/WebCore/loader/icon \
-       $(LOCAL_PATH)/WebCore/notifications \
-       $(LOCAL_PATH)/WebCore/page \
-       $(LOCAL_PATH)/WebCore/page/android \
-       $(LOCAL_PATH)/WebCore/page/animation \
-       $(LOCAL_PATH)/WebCore/platform \
-       $(LOCAL_PATH)/WebCore/platform/android \
-       $(LOCAL_PATH)/WebCore/platform/animation \
-       $(LOCAL_PATH)/WebCore/platform/graphics \
-       $(LOCAL_PATH)/WebCore/platform/graphics/android \
-       $(LOCAL_PATH)/WebCore/platform/graphics/network \
-       $(LOCAL_PATH)/WebCore/platform/graphics/skia \
-       $(LOCAL_PATH)/WebCore/platform/graphics/transforms \
-       $(LOCAL_PATH)/WebCore/platform/image-decoders \
-       $(LOCAL_PATH)/WebCore/platform/mock \
-       $(LOCAL_PATH)/WebCore/platform/network \
-       $(LOCAL_PATH)/WebCore/platform/network/android \
-       $(LOCAL_PATH)/WebCore/platform/sql \
-       $(LOCAL_PATH)/WebCore/platform/text \
-       $(LOCAL_PATH)/WebCore/plugins \
-       $(LOCAL_PATH)/WebCore/plugins/android \
-       $(LOCAL_PATH)/WebCore/rendering \
-       $(LOCAL_PATH)/WebCore/rendering/style \
-       $(LOCAL_PATH)/WebCore/storage \
-       $(LOCAL_PATH)/WebCore/workers \
-       $(LOCAL_PATH)/WebCore/xml
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/WebCore/bindings/js \
-       $(LOCAL_PATH)/WebCore/bridge \
-       $(LOCAL_PATH)/WebCore/bridge/c \
-       $(LOCAL_PATH)/WebCore/bridge/jni
-endif
-
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/WebKit/android \
-       $(LOCAL_PATH)/WebKit/android/WebCoreSupport \
-       $(LOCAL_PATH)/WebKit/android/jni \
-       $(LOCAL_PATH)/WebKit/android/nav \
-       $(LOCAL_PATH)/WebKit/android/plugins \
-       $(LOCAL_PATH)/WebKit/android/stl
-
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/JavaScriptCore/wtf \
-       $(LOCAL_PATH)/JavaScriptCore/wtf/unicode \
-       $(LOCAL_PATH)/JavaScriptCore/wtf/unicode/icu
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/JavaScriptCore \
-       $(LOCAL_PATH)/JavaScriptCore/API \
-       $(LOCAL_PATH)/JavaScriptCore/assembler \
-       $(LOCAL_PATH)/JavaScriptCore/bytecode \
-       $(LOCAL_PATH)/JavaScriptCore/bytecompiler \
-       $(LOCAL_PATH)/JavaScriptCore/debugger \
-       $(LOCAL_PATH)/JavaScriptCore/parser \
-       $(LOCAL_PATH)/JavaScriptCore/jit \
-       $(LOCAL_PATH)/JavaScriptCore/interpreter \
-       $(LOCAL_PATH)/JavaScriptCore/pcre \
-       $(LOCAL_PATH)/JavaScriptCore/profiler \
-       $(LOCAL_PATH)/JavaScriptCore/runtime \
-       $(LOCAL_PATH)/JavaScriptCore/wrec \
-       $(LOCAL_PATH)/JavaScriptCore/ForwardingHeaders
-endif
-
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(base_intermediates)/WebCore/ \
-       $(base_intermediates)/WebCore/css \
-       $(base_intermediates)/WebCore/html \
-       $(base_intermediates)/WebCore/platform
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(base_intermediates)/WebCore/bindings/js \
-       $(base_intermediates)/WebCore/dom \
-       $(base_intermediates)/WebCore/html/canvas \
-       $(base_intermediates)/WebCore/inspector \
-       $(base_intermediates)/WebCore/loader/appcache \
-       $(base_intermediates)/WebCore/page \
-       $(base_intermediates)/WebCore/plugins \
-       $(base_intermediates)/WebCore/storage \
-       $(base_intermediates)/WebCore/workers \
-       $(base_intermediates)/WebCore/xml
-endif
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(base_intermediates)/WebCore/bindings \
-       $(base_intermediates)/JavaScriptCore
-endif
-
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(BINDING_C_INCLUDES)
-endif
-
-ifeq ($(ENABLE_SVG), true)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/WebCore/platform/graphics/filters \
-       $(LOCAL_PATH)/WebCore/svg \
-       $(LOCAL_PATH)/WebCore/svg/animation \
-       $(LOCAL_PATH)/WebCore/svg/graphics \
-       $(LOCAL_PATH)/WebCore/svg/graphics/filters \
-       $(base_intermediates)/WebCore/svg
-endif
-
 # Build the list of shared libraries
 LOCAL_SHARED_LIBRARIES := \
        libandroid_runtime \
@@ -320,7 +283,7 @@ LOCAL_SHARED_LIBRARIES := $(WEBKIT_SHARED_LIBRARIES)
 LOCAL_STATIC_LIBRARIES := $(WEBKIT_STATIC_LIBRARIES)
 LOCAL_CFLAGS := $(WEBKIT_CFLAGS)
 # Include source files for JavaScriptCore
-d := JavaScriptCore
+d := Source/JavaScriptCore
 LOCAL_PATH := $(BASE_PATH)/$d
 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
 # Cannot use base_intermediates as this is a new module