[Qt] Fix WebKit1 build with V8
authorkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 22:28:03 +0000 (22:28 +0000)
committerkbalazs@webkit.org <kbalazs@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 12 Apr 2012 22:28:03 +0000 (22:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=83322

Reviewed by Adam Barth.

Source/JavaScriptCore:

* yarr/yarr.pri:

Source/WebCore:

Make it possible to build WebKit1 with v8.
WebKit2 is not covered yet so it need to be disabled.
To build webkit with --v8 one need a qtjsbackend with
an up-to-date copy of v8. Thanks to Peter Varga such
a public repository is available on gitorious:
https://qt.gitorious.org/~stampho/qt/stamphos-qtjsbackend.

This patch contains some build fix with !ENABLE(INSPECTOR)
from it's previous version. These are not necessary now
but I kept them because they makes sense.

No change in behaviour so no new tests.

* DerivedSources.pri:
* Target.pri:
* WebCore.pri:
* bindings/v8/ScriptController.cpp:
* bindings/v8/ScriptControllerQt.cpp:
* bindings/v8/ScriptProfiler.cpp:
(WebCore::retainedDOMInfo):
(WebCore::ScriptProfiler::initialize):
* bindings/v8/ScriptState.cpp:
(WebCore::evalEnabled):
(WebCore::setEvalEnabled):
* bindings/v8/V8Binding.cpp:
(WebCore):
* bindings/v8/V8Binding.h:
(V8BindingPerIsolateData):
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::V8DOMWindowShell::initContextIfNeeded):
* bindings/v8/V8GCForContextDispose.cpp:
(WebCore::V8GCForContextDispose::pseudoIdleTimerFired):
* bindings/v8/custom/V8InjectedScriptManager.cpp:
* config.h:
* editing/TextIterator.cpp:
* html/MediaFragmentURIParser.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/qt/PlatformSupportQt.cpp:
(WebCore::PlatformSupport::popupsAllowed):

Source/WebKit/qt:

* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::didCreateScriptContext):
* WebCoreSupport/FrameLoaderClientQt.h:
(FrameLoaderClientQt):
(WebCore::FrameLoaderClientQt::allowScriptExtension):
* WebCoreSupport/InitWebCoreQt.cpp:

Source/WTF:

* wtf/StdLibExtras.h:
(WTF):

Tools:

* DumpRenderTree/qt/DumpRenderTree.pro:
* qmake/mkspecs/features/default_post.prf:
* qmake/mkspecs/features/default_pre.prf:
* qmake/mkspecs/features/features.prf:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114042 268f45cc-cd09-0410-ab3c-d52691b4dbfc

31 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/yarr/yarr.pri
Source/WTF/ChangeLog
Source/WTF/wtf/StdLibExtras.h
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.pri
Source/WebCore/Target.pri
Source/WebCore/bindings/v8/ScriptController.cpp
Source/WebCore/bindings/v8/ScriptControllerQt.cpp
Source/WebCore/bindings/v8/ScriptProfiler.cpp
Source/WebCore/bindings/v8/V8Binding.cpp
Source/WebCore/bindings/v8/V8Binding.h
Source/WebCore/bindings/v8/V8DOMWindowShell.cpp
Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp
Source/WebCore/config.h
Source/WebCore/dom/RequestAnimationFrameCallback.h
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/html/MediaFragmentURIParser.cpp
Source/WebCore/inspector/InspectorFrontendClientLocal.cpp
Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
Source/WebCore/platform/qt/PlatformSupportQt.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.h
Source/WebKit/qt/WebCoreSupport/InitWebCoreQt.cpp
Source/WebKit/qt/declarative/declarative.pro
Tools/ChangeLog
Tools/DumpRenderTree/qt/DumpRenderTree.pro
Tools/qmake/mkspecs/features/default_post.prf
Tools/qmake/mkspecs/features/features.prf
WebKit.pro

index 9a4b2ed02213b4b51c31fedfedd8d141ff6df278..6982ab9d94111a43d58c9562924c573000ddf360 100644 (file)
@@ -1,3 +1,12 @@
+2012-04-12  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [Qt] Fix WebKit1 build with V8
+        https://bugs.webkit.org/show_bug.cgi?id=83322
+
+        Reviewed by Adam Barth.
+
+        * yarr/yarr.pri:
+
 2012-04-12  Gavin Barraclough  <barraclough@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=83821
index d2c90ce808274d113268d47cc4febba41bb8a8f0..623098fd3af7b30e00ee8531425336cc82d400e9 100644 (file)
@@ -11,4 +11,8 @@ SOURCES += \
     $$PWD/YarrCanonicalizeUCS2.cpp
 
 # For UString.h
-v8: INCLUDEPATH += $$PWD/../runtime
+v8 {
+    INCLUDEPATH += \
+        $$PWD/.. \
+        $$PWD/../runtime
+}
index b90ea215537904c285ba2ea31ba205da4e061481..d7a4d3483e6faad3829783b54237120fd643865e 100644 (file)
@@ -1,3 +1,13 @@
+2012-04-12  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [Qt] Fix WebKit1 build with V8
+        https://bugs.webkit.org/show_bug.cgi?id=83322
+
+        Reviewed by Adam Barth.
+
+        * wtf/StdLibExtras.h:
+        (WTF):
+
 2012-04-12  Jer Noble  <jer.noble@apple.com>
 
         ThreadingWin: Mutex::unlock() can be "over-unlocked".
index 2b8289731ee091cd7cc76e07bb51822e1d0e0912..db366053505494032ce87158f219d85995c1ed4e 100644 (file)
@@ -151,6 +151,10 @@ inline size_t bitCount(unsigned bits)
 
 // Macro that returns a compile time constant with the length of an array, but gives an error if passed a non-array.
 template<typename T, size_t Size> char (&ArrayLengthHelperFunction(T (&)[Size]))[Size];
+// GCC needs some help to deduce a 0 length array.
+#if COMPILER(GCC)
+template<typename T> char (&ArrayLengthHelperFunction(T (&)[0]))[0];
+#endif
 #define WTF_ARRAY_LENGTH(array) sizeof(::WTF::ArrayLengthHelperFunction(array))
 
 // Efficient implementation that takes advantage of powers of two.
index 43f57b1f5ed386b445ff7237d268b532f838420f..2e3f8d950ec2f83867bc9e1931afa3a6e4af77ad 100644 (file)
@@ -1,3 +1,50 @@
+2012-04-12  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [Qt] Fix WebKit1 build with V8
+        https://bugs.webkit.org/show_bug.cgi?id=83322
+
+        Reviewed by Adam Barth.
+
+        Make it possible to build WebKit1 with v8.
+        WebKit2 is not covered yet so it need to be disabled.
+        To build webkit with --v8 one need a qtjsbackend with
+        an up-to-date copy of v8. Thanks to Peter Varga such
+        a public repository is available on gitorious:
+        https://qt.gitorious.org/~stampho/qt/stamphos-qtjsbackend.
+
+        This patch contains some build fix with !ENABLE(INSPECTOR)
+        from it's previous version. These are not necessary now
+        but I kept them because they makes sense.
+
+        No change in behaviour so no new tests.
+
+        * DerivedSources.pri:
+        * Target.pri:
+        * WebCore.pri:
+        * bindings/v8/ScriptController.cpp:
+        * bindings/v8/ScriptControllerQt.cpp:
+        * bindings/v8/ScriptProfiler.cpp:
+        (WebCore::retainedDOMInfo):
+        (WebCore::ScriptProfiler::initialize):
+        * bindings/v8/ScriptState.cpp:
+        (WebCore::evalEnabled):
+        (WebCore::setEvalEnabled):
+        * bindings/v8/V8Binding.cpp:
+        (WebCore):
+        * bindings/v8/V8Binding.h:
+        (V8BindingPerIsolateData):
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::V8DOMWindowShell::initContextIfNeeded):
+        * bindings/v8/V8GCForContextDispose.cpp:
+        (WebCore::V8GCForContextDispose::pseudoIdleTimerFired):
+        * bindings/v8/custom/V8InjectedScriptManager.cpp:
+        * config.h:
+        * editing/TextIterator.cpp:
+        * html/MediaFragmentURIParser.cpp:
+        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
+        * platform/qt/PlatformSupportQt.cpp:
+        (WebCore::PlatformSupport::popupsAllowed):
+
 2012-04-12  Alec Flett  <alecflett@chromium.org>
 
         IndexedDB: Refactor cursor iteration to remove duplicate code
index 5ee35aeae59133864df09a382a71db78b6b37ba9..777378653a651052bad8083e1967eb1099a5e26c 100644 (file)
@@ -456,8 +456,8 @@ IDL_BINDINGS += \
 v8 {
   IDL_BINDINGS += \
     $$PWD/html/canvas/CanvasPixelArray.idl \
-    $$PWD/storage/IDBVersionChangeEvent.idl \
-    $$PWD/storage/IDBVersionChangeRequest.idl
+    $$PWD/Modules/indexeddb/IDBVersionChangeEvent.idl \
+    $$PWD/Modules/indexeddb/IDBVersionChangeRequest.idl
 }
 
 contains(DEFINES, ENABLE_SVG=1) {
index d159589f8d41b61db08d936e5e0a5a366742bd4b..01719e23404a9ad964997dac251b4c7202271842 100644 (file)
@@ -103,6 +103,7 @@ v8 {
         bindings/v8/custom/V8Uint8ArrayCustom.cpp \
         bindings/v8/custom/V8Uint16ArrayCustom.cpp \
         bindings/v8/custom/V8Uint32ArrayCustom.cpp \
+        bindings/v8/custom/V8Uint8ClampedArrayCustom.cpp \
         \
         bindings/v8/DateExtension.cpp \
         bindings/v8/DOMData.cpp \
@@ -130,6 +131,7 @@ v8 {
         bindings/v8/SerializedScriptValue.cpp \
         bindings/v8/V8AbstractEventListener.cpp \
         bindings/v8/V8Binding.cpp \
+        bindings/v8/V8BindingPerContextData.cpp \
         bindings/v8/V8Collection.cpp \
         bindings/v8/V8DOMMap.cpp \
         bindings/v8/V8DOMWrapper.cpp \
@@ -4095,4 +4097,3 @@ contains(CONFIG, graphics_surfaces) {
 
 # Make sure the derived sources are built
 include(DerivedSources.pri)
-
index 9c0165d4298750b1dcc441045fb7fa921b16e363..beb426ccb87cda11db221d501d7df98e6dac8edb 100644 (file)
@@ -70,7 +70,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(QT)
-#include <QJSEngine>
+#include <QtQml/QJSEngine>
 #endif
 
 namespace WebCore {
index 508d7a2143dd74e68bec5ff0c415ba18974fb5fe..1d7f794769d5354bd58e5e4f1e92d7dd31c51db8 100644 (file)
@@ -28,7 +28,7 @@
 #include "config.h"
 #include "ScriptController.h"
 
-#include <QJSEngine>
+#include <QtQml/QJSEngine>
 
 namespace WebCore {
 
index dc4114f12784abd905e3f2a276e1b8451fd5a786..056d92e30e43d32a2d354f4b48cf82cf68b9ef90 100644 (file)
@@ -29,6 +29,7 @@
  */
 
 #include "config.h"
+#if ENABLE(INSPECTOR)
 #include "ScriptProfiler.h"
 
 #include "DOMWrapperVisitor.h"
@@ -43,7 +44,6 @@
 
 namespace WebCore {
 
-#if ENABLE(INSPECTOR)
 void ScriptProfiler::start(ScriptState* state, const String& title)
 {
     v8::HandleScope hs;
@@ -163,13 +163,10 @@ static v8::RetainedObjectInfo* retainedDOMInfo(uint16_t classId, v8::Handle<v8::
     Node* node = V8Node::toNative(wrapper.As<v8::Object>());
     return node ? new RetainedDOMInfo(node) : 0;
 }
-#endif // ENABLE(INSPECTOR)
 
 void ScriptProfiler::initialize()
 {
-#if ENABLE(INSPECTOR)
     v8::HeapProfiler::DefineWrapperClass(v8DOMSubtreeClassId, &retainedDOMInfo);
-#endif // ENABLE(INSPECTOR)
 }
 
 void ScriptProfiler::visitJSDOMWrappers(DOMWrapperVisitor* visitor)
@@ -194,3 +191,5 @@ void ScriptProfiler::visitExternalJSStrings(DOMWrapperVisitor* visitor)
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
index f7dbe05918efc83e27759f913c1ffd457766cf4f..40a940dd30e9fc3744b7995097a28cb2f62e358b 100644 (file)
@@ -177,6 +177,7 @@ private:
 #endif
 };
 
+#if ENABLE(INSPECTOR)
 void V8BindingPerIsolateData::visitJSExternalStrings(DOMWrapperVisitor* visitor)
 {
     v8::HandleScope handleScope;
@@ -195,6 +196,7 @@ void V8BindingPerIsolateData::visitJSExternalStrings(DOMWrapperVisitor* visitor)
     } v8Visitor(visitor);
     v8::V8::VisitExternalResources(&v8Visitor);
 }
+#endif
 
 String v8ValueToWebCoreString(v8::Handle<v8::Value> value)
 {
index e77765f6bdf4fdeb20d47c2adaa607ab20d3fcd7..95a50057516b87890ddb43d00546528f702fb8b0 100644 (file)
@@ -124,8 +124,9 @@ namespace WebCore {
         }
 
         StringCache* stringCache() { return &m_stringCache; }
+#if ENABLE(INSPECTOR)
         void visitJSExternalStrings(DOMWrapperVisitor*);
-
+#endif
         DOMDataList& allStores() { return m_domDataList; }
 
         V8HiddenPropertyName* hiddenPropertyName() { return &m_hiddenPropertyName; }
index c094450dba483971f06618592341034d8c5b948f..078415b906acc1e5ed4967dc5cbd2fd69edd25ee 100644 (file)
@@ -294,9 +294,9 @@ bool V8DOMWindowShell::initContextIfNeeded()
         v8::V8::AddMessageListener(&v8UncaughtExceptionHandler);
 
         v8::V8::SetFailedAccessCheckCallbackFunction(reportUnsafeJavaScriptAccess);
-
+#if ENABLE(JAVASCRIPT_DEBUGGER)
         ScriptProfiler::initialize();
-
+#endif
         V8BindingPerIsolateData::ensureInitialized(v8::Isolate::GetCurrent());
 
         isV8Initialized = true;
index 7d9493f73aa90c3d25e2a85263a89cb06772c330..45559fc6eceb199fe5ea9ea2cac9183c15f98080 100644 (file)
@@ -29,6 +29,7 @@
  */
 
 #include "config.h"
+#if ENABLE(INSPECTOR)
 #include "InjectedScriptManager.h"
 
 #include "DOMWindow.h"
@@ -171,3 +172,5 @@ bool InjectedScriptManager::canAccessInspectedWindow(ScriptState* scriptState)
 }
 
 } // namespace WebCore
+
+#endif // ENABLE(INSPECTOR)
index 81ae1b7cbc5a68dae2e54e0251f5dd997af898eb..3784eed1aa596f913bed5c0bd7cb302dce4a6ccf 100644 (file)
 #endif
 
 #include <wtf/ExportMacros.h>
-#include <runtime/JSExportMacros.h>
 #include "PlatformExportMacros.h"
 
+#if PLATFORM(QT) && USE(V8)
+#include <JavaScriptCore/runtime/JSExportMacros.h>
+#else
+#include <runtime/JSExportMacros.h>
+#endif
+
 #ifdef __APPLE__
 #define HAVE_FUNC_USLEEP 1
 #endif /* __APPLE__ */
index 420f023cae5b7b865a557b546c874ffcdb78a910..a86792249eecc19957153bc6e0f5761807f17f34 100644 (file)
@@ -31,6 +31,7 @@
 #ifndef RequestAnimationFrameCallback_h
 #define RequestAnimationFrameCallback_h
 
+#include "DOMTimeStamp.h"
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
index bc91fca7197cad21c82888f11f9e4b16ded44a78..85b5595145097dc2f7e547f2478e535671790ea1 100644 (file)
@@ -43,6 +43,7 @@
 #include "TextBreakIterator.h"
 #include "VisiblePosition.h"
 #include "visible_units.h"
+#include <wtf/text/CString.h>
 #include <wtf/unicode/CharacterNames.h>
 
 #if USE(ICU_UNICODE) && !UCONFIG_NO_COLLATION
index 3ecc6f586c44fc143743db8c5574503f9dc86d75..5c8647befc02c7a4b4e3510c27449b1b78125958 100644 (file)
@@ -33,6 +33,7 @@
 #include "ProcessingInstruction.h"
 #include "SegmentedString.h"
 #include "Text.h"
+#include <wtf/text/CString.h>
 #include <wtf/text/StringBuilder.h>
 #include <wtf/text/WTFString.h>
 
index 0118ec969127e36bdd2cfb6f2e9ad05bc516518a..cad8042aa863d1157ecb92f72feec9fa534cc9e1 100644 (file)
@@ -35,6 +35,7 @@
 #include "InspectorFrontendClientLocal.h"
 
 #include "Chrome.h"
+#include "Document.h"
 #include "FloatRect.h"
 #include "Frame.h"
 #include "FrameLoadRequest.h"
@@ -53,6 +54,7 @@
 #include "UserGestureIndicator.h"
 #include "WindowFeatures.h"
 #include <wtf/Deque.h>
+#include <wtf/text/CString.h>
 
 namespace WebCore {
 
index 934fb5cf3d3f562c8df199a8d4b786148d98cdec..1762d228bc57408249950e65fc3c68b069815ac6 100644 (file)
@@ -45,6 +45,7 @@
 #include <wtf/ArrayBufferView.h>
 #include <wtf/Float32Array.h>
 #include <wtf/Int32Array.h>
+#include <wtf/OwnArrayPtr.h>
 #include <wtf/Uint8Array.h>
 #include <wtf/UnusedParam.h>
 #include <wtf/text/CString.h>
index 4e33a9f05605a51f4e9bc29633b2818eb4d6f6b9..55a5cfab8441abd3bdb29a2e28aed9122c50b09a 100644 (file)
@@ -31,8 +31,10 @@ namespace WebCore {
 
 bool PlatformSupport::popupsAllowed(NPP npp)
 {
+#if ENABLE(NETSCAPE_PLUGIN_API)
     if (npp && npp->ndata)
         return static_cast<PluginView*>(npp->ndata)->arePopupsAllowed();
+#endif
 
     return false;
 }
index 7d478fbbf7ce77ab977d2a6b5d50aacb7a367c2b..9f29e0849d52e1680d94e90ba43c61fd78575b59 100644 (file)
@@ -1,3 +1,17 @@
+2012-04-12  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [Qt] Fix WebKit1 build with V8
+        https://bugs.webkit.org/show_bug.cgi?id=83322
+
+        Reviewed by Adam Barth.
+
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::didCreateScriptContext):
+        * WebCoreSupport/FrameLoaderClientQt.h:
+        (FrameLoaderClientQt):
+        (WebCore::FrameLoaderClientQt::allowScriptExtension):
+        * WebCoreSupport/InitWebCoreQt.cpp:
+
 2012-03-05  Pierre Rossi  <pierre.rossi@gmail.com>
 
         [Qt] Use QRawFont when building with Qt 5
index af2e3e4135ed18630855d805928a37c867fde2f3..b6d8503cef67b67b2b45ee0d9bdcda28e575b4c7 100644 (file)
@@ -397,7 +397,7 @@ void FrameLoaderClientQt::dispatchDidChangeLocationWithinPage()
 }
 
 #if USE(V8)
-void FrameLoaderClientQt::didCreateScriptContext(v8::Handle<v8::Context>, int)
+void FrameLoaderClientQt::didCreateScriptContext(v8::Handle<v8::Context>, int, int)
 {
 }
 void FrameLoaderClientQt::willReleaseScriptContext(v8::Handle<v8::Context>, int)
index d774d3a4780b0c39d0e77a9036ef4943f0708053..7dc919e17422445cba1ff7ff1d416fb9a048a16b 100644 (file)
@@ -220,7 +220,7 @@ public:
 
 #if USE(V8)
     // A frame's V8 context was created or destroyed.
-    virtual void didCreateScriptContext(v8::Handle<v8::Context>, int);
+    virtual void didCreateScriptContext(v8::Handle<v8::Context>, int, int);
     virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int);
 
     // A context untied to a frame was created (through evaluateInIsolatedWorld).
@@ -230,7 +230,7 @@ public:
 
     // Returns true if we should allow the given V8 extension to be added to
     // the script context at the currently loading page and given extension group.
-    virtual bool allowScriptExtension(const String& extensionName, int extensionGroup) { return false; }
+    virtual bool allowScriptExtension(const String& extensionName, int extensionGroup, int worldID) { return false; }
 #endif
 
     virtual void registerForIconNotification(bool);
index b0941334595fa8dfdb1209a32c1ca0bc1d780c0a..452091c28fe9d5f9d84e35e280ed93c281172b7e 100644 (file)
 #endif
 
 #include "qwebelement_p.h"
+#include <JavaScriptCore/runtime/InitializeThreading.h>
 #include <QApplication>
 #include <QStyle>
-
-#include <runtime/InitializeThreading.h>
 #include <wtf/MainThread.h>
 
 namespace WebKit {
index 73792833868c231fa94db68b562f76ef500f14c7..e7ed4496c85136b0a5b3ca6f3fb9c359c8321f20 100644 (file)
@@ -7,6 +7,8 @@
 TEMPLATE = subdirs
 CONFIG += ordered
 
+load(features)
+
 public_api.file = public.pri
 public_api.makefile = Makefile.declarative.public
 SUBDIRS += public_api
index a4aabcd77bde439db6b32c8703046ea0d1115467..a9a25caad9a8e1f9239414b5b6b74b71b4f8a235 100644 (file)
@@ -1,3 +1,15 @@
+2012-04-12  Balazs Kelemen  <kbalazs@webkit.org>
+
+        [Qt] Fix WebKit1 build with V8
+        https://bugs.webkit.org/show_bug.cgi?id=83322
+
+        Reviewed by Adam Barth.
+
+        * DumpRenderTree/qt/DumpRenderTree.pro:
+        * qmake/mkspecs/features/default_post.prf:
+        * qmake/mkspecs/features/default_pre.prf:
+        * qmake/mkspecs/features/features.prf:
+
 2012-04-12  Dirk Pranke  <dpranke@chromium.org>
 
         test-webkitpy fails on metered_stream_unittest for non-US West Coast Time Zones
index c116388510cc6b50fab4c620ff5e8ac2851c71a7..2aa54cdfa46a7ad9bbb4d0f6a2874cbb4f23e798 100644 (file)
@@ -11,7 +11,8 @@ DESTDIR = $$ROOT_BUILD_DIR/bin
 
 load(features)
 
-WEBKIT += wtf javascriptcore webcore
+WEBKIT += wtf webcore
+!v8: WEBKIT += javascriptcore
 
 INCLUDEPATH += \
     $$PWD/.. \
index 6abb114bb7e51cecdb0b71fada78933d8f7e8bfb..c37d71b62d951353e6e3ea525308b0f1755308ac 100644 (file)
@@ -5,6 +5,8 @@
 # See 'Tools/qmake/README' for an overview of the build system
 # -------------------------------------------------------------------
 
+load(features)
+
 # Flag that we're now done processing the project file. This allows
 # a feature to distinguish between being processed due to a load()
 # or include() and a CONFIG += feature.
@@ -48,8 +50,11 @@ CONFIG -= warn_on
     -Winit-self \
     $$QMAKE_CXXFLAGS
 
-contains(JAVASCRIPTCORE_JIT, yes): DEFINES+=ENABLE_JIT=1
-contains(JAVASCRIPTCORE_JIT, no): DEFINES+=ENABLE_JIT=0
+v8: DEFINES += WTF_USE_V8=1
+else {
+    contains(JAVASCRIPTCORE_JIT, yes): DEFINES+=ENABLE_JIT=1
+    contains(JAVASCRIPTCORE_JIT, no): DEFINES+=ENABLE_JIT=0
+}
 
 # Template configurations
 contains(TEMPLATE, derived) {
index 85780192ec5bc397c01e66b799328876ef40eaf2..4053e982b86b95879ecf2f4d9044136ccbf5e34a 100644 (file)
@@ -279,6 +279,13 @@ contains(DEFINES, ENABLE_FULLSCREEN_API=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE
 contains(DEFINES, ENABLE_REQUEST_ANIMATION_FRAME=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_REQUEST_ANIMATION_FRAME=1
 contains(DEFINES, ENABLE_TOUCH_ADJUSTMENT=1): FEATURE_DEFINES_JAVASCRIPT += ENABLE_TOUCH_ADJUSTMENT=1
 
+v8 {
+    # This have to be placed here because command line arguments, such as CONFIG+=v8 are
+    # not considered by qmake when processing defaults_pre.prf.
+    root_project_file: message("Building WebKit2 with v8 is not supported currently. Disabling WebKit2.")
+    CONFIG += no_webkit2
+}
+
 # Used to compute defaults for the build-webkit script
 # Don't place anything after this!
 CONFIG(compute_defaults) {
index d055e7bc9ac2290e18c2bf6e2fada0bca0af89a1..eb23fd331ab63db3016a7181f21a22302cb830f9 100644 (file)
@@ -8,6 +8,8 @@
 TEMPLATE = subdirs
 CONFIG += ordered
 
+load(features)
+
 QMAKEPATH = $$(QMAKEPATH)
 isEmpty(QMAKEPATH)|!exists($${QMAKEPATH}/mkspecs) {
     error("The environment variable QMAKEPATH needs to point to $WEBKITSRC/Tools/qmake")