Add CMake build infrastructure for the BlackBerry port
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 03:56:59 +0000 (03:56 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 Nov 2011 03:56:59 +0000 (03:56 +0000)
https://bugs.webkit.org/show_bug.cgi?id=72768

.:

Reviewed by Adam Barth and Antonio Gomes.

* Source/CMakeLists.txt: Add the BlackBerry port and support for building on QNX.
* Source/cmake/OptionsBlackBerry.cmake: Added.
* Source/cmake/OptionsCommon.cmake: Add QNX QCC-variant of CODE_GENERATOR_PREPROCESSOR.
  We may be able to fold this into the non-MSVC CODE_GENERATOR_PREPROCESSOR.

Source/JavaScriptCore:

Reviewed by Antonio Gomes.

* PlatformBlackBerry.cmake: Added.
* shell/PlatformBlackBerry.cmake: Added.
* wtf/PlatformBlackBerry.cmake: Added.

Source/WebCore:

Reviewed by Antonio Gomes.

* CMakeLists.txt: At this time the BlackBerry port doesn't support generating
  DOM bindings from the SVG IDLs. See WebKit bug #72773.
* PlatformBlackBerry.cmake: Added.

Source/WebKit:

Reviewed by Antonio Gomes.

* blackberry: Added.
* blackberry/CMakeListsBlackBerry.txt: Added.

Tools:

Reviewed by Antonio Gomes.

Add optional --blackberry command line argument to build-webkit to build the
BlackBerry port.

* Scripts/build-webkit:
* Scripts/webkitdirs.pm:
(determineBaseProductDir):
(argumentsForConfiguration):
(builtDylibPathForName):
(determineIsQt):
(isBlackBerry): Added.
(determineIsBlackBerry): Added.
(blackberryTargetArchitecture): Added.
(isAppleWebKit):

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

16 files changed:
ChangeLog
Source/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformBlackBerry.cmake [new file with mode: 0644]
Source/JavaScriptCore/shell/PlatformBlackBerry.cmake [new file with mode: 0644]
Source/JavaScriptCore/wtf/PlatformBlackBerry.cmake [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformBlackBerry.cmake [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/blackberry/CMakeListsBlackBerry.txt [new file with mode: 0644]
Source/cmake/OptionsBlackBerry.cmake [new file with mode: 0644]
Source/cmake/OptionsCommon.cmake
Tools/ChangeLog
Tools/Scripts/build-webkit
Tools/Scripts/webkitdirs.pm

index fb3d32c..16e9d86 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2011-11-18  Daniel Bates  <dbates@rim.com>
+
+        Add CMake build infrastructure for the BlackBerry port
+        https://bugs.webkit.org/show_bug.cgi?id=72768
+
+        Reviewed by Adam Barth and Antonio Gomes.
+
+        * Source/CMakeLists.txt: Add the BlackBerry port and support for building on QNX.
+        * Source/cmake/OptionsBlackBerry.cmake: Added.
+        * Source/cmake/OptionsCommon.cmake: Add QNX QCC-variant of CODE_GENERATOR_PREPROCESSOR.
+          We may be able to fold this into the non-MSVC CODE_GENERATOR_PREPROCESSOR.
+
 2011-11-18  Adam Barth  <abarth@webkit.org>
 
         Prepare to move manual-tests out of WebCore
index ad1e96f..cbc11cc 100644 (file)
@@ -37,7 +37,7 @@ INCLUDE(WebKitFeatures)
 # -----------------------------------------------------------------------------
 # Determine which port will be built
 # -----------------------------------------------------------------------------
-SET(ALL_PORTS Efl WinCE)
+SET(ALL_PORTS Efl WinCE BlackBerry)
 SET(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})")
 
 LIST(FIND ALL_PORTS ${PORT} RET)
@@ -83,6 +83,9 @@ IF (UNIX)
     ENDIF ()
 ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
     SET(WTF_OS_WINDOWS 1)
+ELSEIF (CMAKE_SYSTEM_NAME MATCHES "QNX")
+    SET(WTF_OS_QNX 1)
+    SET(WTF_OS_UNIX 1)
 ELSE ()
     MESSAGE(FATAL_ERROR "Unknown OS '${CMAKE_SYSTEM_NAME}'")
 ENDIF ()
index 5d09862..44206f6 100644 (file)
@@ -1,3 +1,14 @@
+2011-11-18  Daniel Bates  <dbates@rim.com>
+
+        Add CMake build infrastructure for the BlackBerry port
+        https://bugs.webkit.org/show_bug.cgi?id=72768
+
+        Reviewed by Antonio Gomes.
+
+        * PlatformBlackBerry.cmake: Added.
+        * shell/PlatformBlackBerry.cmake: Added.
+        * wtf/PlatformBlackBerry.cmake: Added.
+
 2011-11-18  Filip Pizlo  <fpizlo@apple.com>
 
         DFG JIT fails speculation on InstanceOf if the base is not an object
diff --git a/Source/JavaScriptCore/PlatformBlackBerry.cmake b/Source/JavaScriptCore/PlatformBlackBerry.cmake
new file mode 100644 (file)
index 0000000..41563cf
--- /dev/null
@@ -0,0 +1,9 @@
+LIST(INSERT JavaScriptCore_INCLUDE_DIRECTORIES 0
+    "${BLACKBERRY_THIRD_PARTY_DIR}/icu"
+)
+
+LIST(APPEND JavaScriptCore_SOURCES
+    DisassemblerARM.cpp
+)
+
+INSTALL(FILES "wtf/Forward.h" DESTINATION usr/include/browser/webkit/wtf)
diff --git a/Source/JavaScriptCore/shell/PlatformBlackBerry.cmake b/Source/JavaScriptCore/shell/PlatformBlackBerry.cmake
new file mode 100644 (file)
index 0000000..4271148
--- /dev/null
@@ -0,0 +1,15 @@
+LIST(APPEND JSC_LIBRARIES
+    ${ICUI18N_LIBRARY}
+    ${ICUUC_LIBRARY}
+    ${INTL_LIBRARY} # Required for x86 builds
+    ${M_LIBRARY}
+    ${Screen_LIBRARY}
+    ${Skia_QNX_LIBRARY}
+    ${WebKitPlatform_LIBRARY}
+)
+
+IF (PROFILING)
+    LIST(APPEND JSC_LIBRARIES
+        ${PROFILING_LIBRARY}
+    )
+ENDIF ()
diff --git a/Source/JavaScriptCore/wtf/PlatformBlackBerry.cmake b/Source/JavaScriptCore/wtf/PlatformBlackBerry.cmake
new file mode 100644 (file)
index 0000000..5f30d08
--- /dev/null
@@ -0,0 +1,12 @@
+LIST(APPEND WTF_SOURCES
+    OSAllocatorPosix.cpp
+    TCSystemAlloc.cpp
+    ThreadIdentifierDataPthreads.cpp
+    ThreadingPthreads.cpp
+    blackberry/MainThreadBlackBerry.cpp
+    unicode/icu/CollatorICU.cpp
+)
+
+LIST(INSERT WTF_INCLUDE_DIRECTORIES 0
+    "${BLACKBERRY_THIRD_PARTY_DIR}/icu"
+)
index e86162b..652742c 100644 (file)
@@ -1820,7 +1820,10 @@ IF (ENABLE_SVG)
         svg/properties/SVGPathSegListPropertyTearOff.cpp
     )
 
-    LIST(APPEND WebCore_IDL_FILES
+    # FIXME: The BlackBerry port doesn't support generating DOM bindings from the SVG IDL files.
+    # For now, we explicitly demarcate the SVG IDL files so that the BlackBerry port can skip them
+    # during DOM binding generation. See <https://bugs.webkit.org/show_bug.cgi?id=72773>.
+    SET(SVG_IDL_FILES
         svg/SVGAElement.idl
         svg/SVGAltGlyphDefElement.idl
         svg/SVGAltGlyphElement.idl
@@ -1964,6 +1967,10 @@ IF (ENABLE_SVG)
         svg/SVGZoomEvent.idl
     )
 
+    LIST(APPEND WebCore_IDL_FILES
+        ${SVG_IDL_FILES}
+    )
+
     LIST(APPEND WebCore_CSS_PROPERTY_NAMES
         ${WEBCORE_DIR}/css/SVGCSSPropertyNames.in
     )
index a60ce24..01c14f3 100644 (file)
@@ -1,3 +1,14 @@
+2011-11-18  Daniel Bates  <dbates@rim.com>
+
+        Add CMake build infrastructure for the BlackBerry port
+        https://bugs.webkit.org/show_bug.cgi?id=72768
+
+        Reviewed by Antonio Gomes.
+
+        * CMakeLists.txt: At this time the BlackBerry port doesn't support generating
+          DOM bindings from the SVG IDLs. See WebKit bug #72773.
+        * PlatformBlackBerry.cmake: Added.
+
 2011-11-18  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r100826.
diff --git a/Source/WebCore/PlatformBlackBerry.cmake b/Source/WebCore/PlatformBlackBerry.cmake
new file mode 100644 (file)
index 0000000..c04339a
--- /dev/null
@@ -0,0 +1,330 @@
+LIST(INSERT WebCore_INCLUDE_DIRECTORIES 0
+    "${BLACKBERRY_THIRD_PARTY_DIR}" # For <unicode.h>, which is included from <sys/keycodes.h>.
+    "${BLACKBERRY_THIRD_PARTY_DIR}/icu"
+)
+
+LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+    "${WEBCORE_DIR}/bindings/cpp"
+    "${WEBCORE_DIR}/platform/blackberry/CookieDatabaseBackingStore"
+    "${WEBCORE_DIR}/platform/network/blackberry"
+    "${WEBCORE_DIR}/platform/graphics/blackberry/skia"
+    "${WEBCORE_DIR}/platform/graphics/chromium" # For font subsystem
+    "${WEBCORE_DIR}/platform/graphics/opentype/"
+    "${WEBCORE_DIR}/platform/graphics/skia"
+    "${WEBCORE_DIR}/platform/image-decoders/skia"
+    "${WEBCORE_DIR}/platform/image-encoders/skia"
+)
+
+# Skia sources
+LIST(APPEND WebCore_SOURCES
+    platform/graphics/skia/FloatPointSkia.cpp
+    platform/graphics/skia/FloatRectSkia.cpp
+    platform/graphics/skia/FontCustomPlatformData.cpp
+    platform/graphics/skia/GradientSkia.cpp
+    platform/graphics/skia/GraphicsContext3DSkia.cpp
+    platform/graphics/skia/GraphicsContextSkia.cpp
+    platform/graphics/skia/HarfbuzzSkia.cpp
+    platform/graphics/skia/ImageBufferSkia.cpp
+    platform/graphics/skia/ImageSkia.cpp
+    platform/graphics/skia/IntPointSkia.cpp
+    platform/graphics/skia/IntRectSkia.cpp
+    platform/graphics/skia/NativeImageSkia.cpp
+    platform/graphics/skia/PathSkia.cpp
+    platform/graphics/skia/PatternSkia.cpp
+    platform/graphics/skia/PlatformContextSkia.cpp
+    platform/graphics/skia/SkiaUtils.cpp
+    platform/graphics/skia/TransformationMatrixSkia.cpp
+    platform/graphics/skia/VDMXParser.cpp
+    platform/image-decoders/skia/ImageDecoderSkia.cpp
+    platform/image-encoders/skia/PNGImageEncoder.cpp
+)
+
+# Skia font backend sources
+LIST(APPEND WebCore_SOURCES
+    platform/graphics/blackberry/skia/PlatformBridge.cpp
+    platform/graphics/chromium/ComplexTextControllerLinux.cpp
+    platform/graphics/chromium/FontCacheLinux.cpp
+    platform/graphics/chromium/FontLinux.cpp
+    platform/graphics/chromium/FontPlatformDataLinux.cpp
+    platform/graphics/chromium/HarfbuzzSkia.cpp
+    platform/graphics/chromium/SimpleFontDataLinux.cpp
+    platform/graphics/skia/GlyphPageTreeNodeSkia.cpp
+)
+
+# Other sources
+LIST(APPEND WebCore_SOURCES
+    bindings/cpp/WebDOMCString.cpp
+    bindings/cpp/WebDOMEventTarget.cpp
+    bindings/cpp/WebDOMString.cpp
+    bindings/cpp/WebExceptionHandler.cpp
+    platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp
+    platform/blackberry/CookieManager.cpp
+    platform/blackberry/CookieMap.cpp
+    platform/blackberry/CookieParser.cpp
+    platform/blackberry/FileSystemBlackBerry.cpp
+    platform/blackberry/ParsedCookie.cpp
+    platform/graphics/ImageSource.cpp
+    platform/graphics/WOFFFileFormat.cpp
+    platform/graphics/opentype/OpenTypeSanitizer.cpp
+    platform/image-decoders/ImageDecoder.cpp
+    platform/image-decoders/blackberry/JPEGImageDecoder.cpp
+    platform/image-decoders/bmp/BMPImageDecoder.cpp
+    platform/image-decoders/bmp/BMPImageReader.cpp
+    platform/image-decoders/gif/GIFImageDecoder.cpp
+    platform/image-decoders/gif/GIFImageReader.cpp
+    platform/image-decoders/ico/ICOImageDecoder.cpp
+    platform/image-decoders/png/PNGImageDecoder.cpp
+    platform/image-decoders/webp/WEBPImageDecoder.cpp
+    platform/posix/FileSystemPOSIX.cpp
+    platform/posix/SharedBufferPOSIX.cpp
+    platform/text/TextBreakIteratorICU.cpp
+    platform/text/TextCodecICU.cpp
+    platform/text/TextEncodingDetectorICU.cpp
+    platform/text/blackberry/TextBreakIteratorInternalICUBlackBerry.cpp
+)
+
+# Networking sources
+LIST(APPEND WebCore_SOURCES
+    platform/network/ProxyServer.cpp
+    platform/network/blackberry/AboutData.cpp
+    platform/network/blackberry/MultipartResponseDelegate.cpp
+    platform/network/blackberry/NetworkManager.cpp
+    platform/network/blackberry/NetworkStateNotifierBlackBerry.cpp
+    platform/network/blackberry/ProxyServerBlackBerry.cpp
+    platform/network/blackberry/ResourceErrorBlackBerry.cpp
+    platform/network/blackberry/ResourceHandleBlackBerry.cpp
+    platform/network/blackberry/ResourceRequestBlackBerry.cpp
+    platform/network/blackberry/ResourceResponseBlackBerry.cpp
+    platform/network/blackberry/SocketStreamHandleBlackBerry.cpp
+)
+
+LIST(APPEND WebCore_USER_AGENT_STYLE_SHEETS
+    ${WEBCORE_DIR}/css/mediaControlsBlackBerry.css
+    ${WEBCORE_DIR}/css/themeBlackBerry.css
+)
+
+LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+    "${WEBCORE_DIR}/bridge/blackberry"
+    "${WEBCORE_DIR}/history/blackberry"
+    "${WEBCORE_DIR}/page/blackberry"
+    "${WEBCORE_DIR}/platform/blackberry"
+    "${WEBCORE_DIR}/platform/graphics/blackberry"
+    "${WEBCORE_DIR}/platform/image-decoders/bmp"
+    "${WEBCORE_DIR}/platform/image-decoders/gif"
+    "${WEBCORE_DIR}/platform/image-decoders/ico"
+    "${WEBCORE_DIR}/platform/image-decoders/jpeg"
+    "${WEBCORE_DIR}/platform/image-decoders/png"
+    "${WEBCORE_DIR}/platform/image-encoders"
+    "${WEBCORE_DIR}/platform/network/blackberry"
+    "${WEBCORE_DIR}/platform/text/blackberry"
+    "${WEBKIT_DIR}/blackberry/Api"
+    "${WEBKIT_DIR}/blackberry/WebCoreSupport"
+    "${WEBKIT_DIR}/blackberry/WebKitSupport"
+)
+
+# BlackBerry sources
+LIST(APPEND WebCore_SOURCES
+    bindings/js/ScriptControllerBlackBerry.cpp
+    editing/blackberry/EditorBlackBerry.cpp
+    editing/blackberry/SmartReplaceBlackBerry.cpp
+    page/blackberry/AccessibilityObjectBlackBerry.cpp
+    page/blackberry/DragControllerBlackBerry.cpp
+    page/blackberry/EventHandlerBlackBerry.cpp
+    page/blackberry/FrameBlackBerry.cpp
+    platform/blackberry/BlackBerryCookieCache.cpp
+    platform/blackberry/ClipboardBlackBerry.cpp
+    platform/blackberry/ContextMenuBlackBerry.cpp
+    platform/blackberry/ContextMenuItemBlackBerry.cpp
+    platform/blackberry/CookieJarBlackBerry.cpp
+    platform/blackberry/CursorBlackBerry.cpp
+    platform/blackberry/DragDataBlackBerry.cpp
+    platform/blackberry/DragImageBlackBerry.cpp
+    platform/blackberry/EventLoopBlackBerry.cpp
+    platform/blackberry/KURLBlackBerry.cpp
+    platform/blackberry/Localizations.cpp
+    platform/blackberry/LoggingBlackBerry.cpp
+    platform/blackberry/MIMETypeRegistryBlackBerry.cpp
+    platform/blackberry/PasteboardBlackBerry.cpp
+    platform/blackberry/PlatformKeyboardEventBlackBerry.cpp
+    platform/blackberry/PlatformMouseEventBlackBerry.cpp
+    platform/blackberry/PlatformScreenBlackBerry.cpp
+    platform/blackberry/PlatformTouchEventBlackBerry.cpp
+    platform/blackberry/PlatformTouchPointBlackBerry.cpp
+    platform/blackberry/PopupMenuBlackBerry.cpp
+    platform/blackberry/RenderThemeBlackBerry.cpp
+    platform/blackberry/SSLKeyGeneratorBlackBerry.cpp
+    platform/blackberry/ScrollViewBlackBerry.cpp
+    platform/blackberry/ScrollbarBlackBerry.cpp
+    platform/blackberry/ScrollbarThemeBlackBerry.cpp
+    platform/blackberry/SearchPopupMenuBlackBerry.cpp
+    platform/blackberry/SharedTimerBlackBerry.cpp
+    platform/blackberry/SoundBlackBerry.cpp
+    platform/blackberry/SystemTimeBlackBerry.cpp
+    platform/blackberry/TemporaryLinkStubs.cpp
+    platform/blackberry/WheelEventBlackBerry.cpp
+    platform/blackberry/WidgetBlackBerry.cpp
+    platform/graphics/blackberry/FloatPointBlackBerry.cpp
+    platform/graphics/blackberry/FloatRectBlackBerry.cpp
+    platform/graphics/blackberry/FloatSizeBlackBerry.cpp
+    platform/graphics/blackberry/IconBlackBerry.cpp
+    platform/graphics/blackberry/IntPointBlackBerry.cpp
+    platform/graphics/blackberry/IntRectBlackBerry.cpp
+    platform/graphics/blackberry/IntSizeBlackBerry.cpp
+    platform/graphics/blackberry/MMrenderer.cpp
+    platform/graphics/blackberry/MediaPlayerPrivateMMrenderer.cpp
+    platform/graphics/blackberry/ResourceBlackBerry.cpp
+    platform/image-decoders/blackberry/JPEGImageDecoder.cpp
+    platform/image-decoders/bmp/BMPImageDecoder.cpp
+    platform/image-decoders/gif/GIFImageDecoder.cpp
+    platform/image-decoders/ico/ICOImageDecoder.cpp
+    platform/image-decoders/png/PNGImageDecoder.cpp
+    platform/image-encoders/JPEGImageEncoder.cpp
+    platform/network/blackberry/AboutData.cpp
+    platform/network/blackberry/MultipartResponseDelegate.cpp
+    platform/network/blackberry/NetworkManager.cpp
+    platform/network/blackberry/NetworkStateNotifierBlackBerry.cpp
+    platform/network/blackberry/ResourceErrorBlackBerry.cpp
+    platform/network/blackberry/ResourceRequestBlackBerry.cpp
+    platform/text/blackberry/StringBlackBerry.cpp
+)
+
+# Credential Persistence sources
+LIST(APPEND WebCore_SOURCES
+    platform/network/blackberry/CredentialBackingStore.cpp
+    platform/network/blackberry/CredentialStorageBlackBerry.cpp
+)
+
+# Touch sources
+LIST(APPEND WebCore_SOURCES
+    dom/Touch.cpp
+    dom/TouchEvent.cpp
+    dom/TouchList.cpp
+)
+
+LIST(APPEND WEBDOM_IDL_HEADERS
+    bindings/cpp/WebDOMCString.h
+    bindings/cpp/WebDOMEventTarget.h
+    bindings/cpp/WebDOMObject.h
+    bindings/cpp/WebDOMString.h
+)
+
+if (ENABLE_WEBGL)
+    LIST(APPEND WebCore_INCLUDE_DIRECTORIES
+        "${WEBCORE_DIR}/platform/graphics/gpu"
+        "${WEBCORE_DIR}/platform/graphics/opengl"
+    )
+    LIST(APPEND WebCore_SOURCES
+        platform/graphics/blackberry/DrawingBufferBlackBerry.cpp
+        platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp
+    )
+ENDIF ()
+
+IF (ENABLE_NETSCAPE_PLUGIN_API)
+    LIST(APPEND WebCore_SOURCES
+        plugins/PluginDatabase.cpp
+        plugins/PluginPackage.cpp
+        plugins/PluginView.cpp
+        plugins/blackberry/PluginDataBlackBerry.cpp
+        plugins/blackberry/PluginPackageBlackBerry.cpp
+        plugins/blackberry/PluginViewBlackBerry.cpp
+    )
+ELSE ()
+    LIST(APPEND WebCore_SOURCES
+        plugins/PluginDataNone.cpp
+        plugins/PluginDatabase.cpp
+        plugins/PluginPackage.cpp
+        plugins/PluginPackageNone.cpp
+        plugins/PluginView.cpp
+        plugins/PluginViewNone.cpp
+    )
+ENDIF ()
+
+# To speed up linking when working on accel comp, you can move this whole chunk
+# to Source/WebKit/blackberry/CMakeListsBlackBerry.txt.
+# Append to WebKit_SOURCES instead of WebCore_SOURCES.
+IF (WTF_USE_ACCELERATED_COMPOSITING)
+    LIST(APPEND WebCore_SOURCES
+        ${WEBCORE_DIR}/platform/graphics/GraphicsLayer.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/LayerAnimation.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/LayerCompositingThread.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/LayerRenderer.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/LayerTile.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/LayerTiler.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/LayerWebKitThread.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/PluginLayerWebKitThread.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/Texture.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/TextureCacheCompositingThread.cpp
+        ${WEBCORE_DIR}/platform/graphics/blackberry/WebGLLayerWebKitThread.cpp
+        ${WEBCORE_DIR}/rendering/RenderLayerBacking.cpp
+        ${WEBCORE_DIR}/rendering/RenderLayerCompositor.cpp
+    )
+ENDIF ()
+
+SET(ENV{WEBKITDIR} ${CMAKE_SOURCE_DIR})
+SET(ENV{PLATFORMNAME} ${CMAKE_SYSTEM_NAME})
+EXECUTE_PROCESS(
+    COMMAND hostname
+    OUTPUT_VARIABLE host
+)
+STRING(REPLACE "\n" "" host1 "${host}")
+SET(ENV{COMPUTERNAME} ${host1})
+
+IF ($ENV{PUBLIC_BUILD})
+    ADD_DEFINITIONS(-DPUBLIC_BUILD=$ENV{PUBLIC_BUILD})
+ENDIF ()
+
+EXECUTE_PROCESS(
+    COMMAND ${WEBKIT_BUILDINFO_GENERATOR} ${DERIVED_SOURCES_WEBCORE_DIR}/BuildInformation.cpp
+    OUTPUT ${DERIVED_SOURCES_WEBCORE_DIR}/BuildInformation.cpp
+)
+
+LIST(APPEND WebCore_SOURCES
+    ${DERIVED_SOURCES_WEBCORE_DIR}/BuildInformation.cpp
+)
+INSTALL(FILES ${WEBDOM_IDL_HEADERS} DESTINATION usr/include/browser/webkit/dom)
+
+# Create DOM C++ code given an IDL input
+# We define a new list of feature defines that is prefixed with LANGUAGE_CPP=1 so as to avoid the
+# warning "missing whitespace after the macro name" when inlining "LANGUAGE_CPP=1 ${FEATURE_DEFINES}".
+SET(FEATURE_DEFINES_WEBCORE "LANGUAGE_CPP=1")
+FOREACH (_feature ${FEATURE_DEFINES})
+    SET(FEATURE_DEFINES_WEBCORE "${FEATURE_DEFINES_WEBCORE} ${_feature}")
+ENDFOREACH ()
+
+# FIXME: We need to add the IDLs for SQL storage and Web Workers. See PR #123484.
+SET(WebCore_NO_CPP_IDL_FILES
+    ${SVG_IDL_FILES}
+    dom/CustomEvent.idl
+    dom/PopStateEvent.idl
+    inspector/ScriptProfile.idl
+    inspector/ScriptProfileNode.idl
+)
+
+LIST(APPEND WebCore_IDL_FILES
+    css/MediaQueryListListener.idl
+)
+
+SET(WebCore_CPP_IDL_FILES ${WebCore_IDL_FILES})
+
+FOREACH (_file ${WebCore_NO_CPP_IDL_FILES})
+    STRING(REPLACE "${_file}" "" WebCore_CPP_IDL_FILES "${WebCore_CPP_IDL_FILES}")
+ENDFOREACH ()
+
+SET(WebCore_CPP_IDL_FILES
+    dom/EventListener.idl
+    html/canvas/CanvasPixelArray.idl
+    "${WebCore_CPP_IDL_FILES}"
+)
+
+FOREACH (_file ${WebCore_CPP_IDL_FILES})
+    GET_FILENAME_COMPONENT (_name ${_file} NAME_WE)
+    ADD_CUSTOM_COMMAND(
+        OUTPUT  ${DERIVED_SOURCES_WEBCORE_DIR}/WebDOM${_name}.cpp ${DERIVED_SOURCES_WEBCORE_DIR}/WebDOM${_name}.h
+        MAIN_DEPENDENCY ${_file}
+        DEPENDS ${WEBCORE_DIR}/bindings/scripts/generate-bindings.pl ${SCRIPTS_BINDINGS} ${WEBCORE_DIR}/bindings/scripts/CodeGeneratorCPP.pm ${_file}
+        COMMAND ${PERL_EXECUTABLE} -I${WEBCORE_DIR}/bindings/scripts ${WEBCORE_DIR}/bindings/scripts/generate-bindings.pl --defines "${FEATURE_DEFINES_WEBCORE}" --generator CPP ${IDL_INCLUDES} --outputDir "${DERIVED_SOURCES_WEBCORE_DIR}" --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" ${WEBCORE_DIR}/${_file}
+        VERBATIM)
+    LIST(APPEND WebCore_SOURCES ${DERIVED_SOURCES_WEBCORE_DIR}/WebDOM${_name}.cpp)
+ENDFOREACH ()
index 1e6f66d..96100ce 100644 (file)
@@ -1,3 +1,13 @@
+2011-11-18  Daniel Bates  <dbates@rim.com>
+
+        Add CMake build infrastructure for the BlackBerry port
+        https://bugs.webkit.org/show_bug.cgi?id=72768
+
+        Reviewed by Antonio Gomes.
+
+        * blackberry: Added.
+        * blackberry/CMakeListsBlackBerry.txt: Added.
+
 2011-11-18  Patrick Gansterer  <paroga@webkit.org>
 
         [CMake] Add possibility to overwrite WEBKIT_PORT_DIR in platform specific files
diff --git a/Source/WebKit/blackberry/CMakeListsBlackBerry.txt b/Source/WebKit/blackberry/CMakeListsBlackBerry.txt
new file mode 100644 (file)
index 0000000..d8ea0f3
--- /dev/null
@@ -0,0 +1,178 @@
+LIST(INSERT WebKit_INCLUDE_DIRECTORIES 0
+    "${BLACKBERRY_THIRD_PARTY_DIR}" # For <unicode.h>, which is included from <sys/keycodes.h>.
+    "${BLACKBERRY_THIRD_PARTY_DIR}/icu"
+)
+
+LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+    "${JAVASCRIPTCORE_DIR}/wtf/text"
+    "${WEBCORE_DIR}/bindings/cpp"
+    "${WEBCORE_DIR}/history/blackberry"
+    "${WEBCORE_DIR}/html/canvas"
+    "${WEBCORE_DIR}/html/parser" # For HTMLParserIdioms.h
+    "${WEBCORE_DIR}/loader/appcache"
+    "${WEBCORE_DIR}/notifications"
+    "${WEBCORE_DIR}/platform/blackberry"
+    "${WEBCORE_DIR}/platform/graphics/blackberry"
+    "${WEBCORE_DIR}/platform/graphics/blackberry/skia"
+    "${WEBCORE_DIR}/platform/graphics/skia"
+    "${WEBCORE_DIR}/platform/network/blackberry"
+    "${WEBCORE_DIR}/websockets"
+    "${WEBKIT_DIR}/blackberry/Api"
+    "${WEBKIT_DIR}/blackberry/WebCoreSupport"
+    "${WEBKIT_DIR}/blackberry/WebKitSupport"
+    "${CMAKE_SOURCE_DIR}" # For JavaScriptCore API headers
+)
+IF (ENABLE_DRT)
+    LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+        # needed for DRT for now
+        "${JAVASCRIPTCORE_DIR}/wtf"
+        "${WEBCORE_DIR}/platform/mock"
+        "${WEBCORE_DIR}/svg/animation"
+        "${WEBCORE_DIR}/workers"
+        "${TOOLS_DIR}"
+        "${TOOLS_DIR}/DumpRenderTree"
+        "${TOOLS_DIR}/DumpRenderTree/blackberry"
+    )
+ENDIF ()
+
+ADD_DEFINITIONS(-DUSER_PROCESSES)
+
+LIST(APPEND WebKit_SOURCES
+    blackberry/Api/BackingStore.cpp
+    blackberry/Api/BlackBerryGlobal.cpp
+    blackberry/Api/WebString.cpp
+    blackberry/Api/ResourceHolderImpl.cpp
+    blackberry/Api/WebKitTextCodec.cpp
+    blackberry/Api/WebPage.cpp
+    blackberry/Api/WebPageGroupLoadDeferrer.cpp
+    blackberry/Api/WebSettings.cpp
+    blackberry/WebCoreSupport/CacheClientBlackBerry.cpp
+    blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp
+    blackberry/WebCoreSupport/ClientExtension.cpp
+    blackberry/WebCoreSupport/ContextMenuClientBlackBerry.cpp
+    blackberry/WebCoreSupport/DeviceMotionClientBlackBerry.cpp
+    blackberry/WebCoreSupport/DeviceOrientationClientBlackBerry.cpp
+    blackberry/WebCoreSupport/DragClientBlackBerry.cpp
+    blackberry/WebCoreSupport/EditCommandBlackBerry.cpp
+    blackberry/WebCoreSupport/EditorClientBlackBerry.cpp
+    blackberry/WebCoreSupport/FrameLoaderClientBlackBerry.cpp
+    blackberry/WebCoreSupport/FrameNetworkingContextBlackBerry.cpp
+    blackberry/WebCoreSupport/GeolocationControllerClientBlackBerry.cpp
+    blackberry/WebCoreSupport/IconDatabaseClientBlackBerry.cpp
+    blackberry/WebCoreSupport/InspectorClientBlackBerry.cpp
+    blackberry/WebCoreSupport/JavaScriptDebuggerBlackBerry.cpp
+    blackberry/WebCoreSupport/NotificationPresenterImpl.cpp
+    blackberry/WebKitSupport/BackingStoreCompositingSurface.cpp
+    blackberry/WebKitSupport/BackingStoreTile.cpp
+    blackberry/WebKitSupport/BackingStoreClient.cpp
+    blackberry/WebKitSupport/DOMSupport.cpp
+    blackberry/WebKitSupport/FrameLayers.cpp
+    blackberry/WebKitSupport/InputHandler.cpp
+    blackberry/WebKitSupport/OutOfMemoryHandler.cpp
+    blackberry/WebKitSupport/RenderQueue.cpp
+    blackberry/WebKitSupport/SelectionHandler.cpp
+    blackberry/WebKitSupport/SurfacePool.cpp
+    blackberry/WebKitSupport/TouchEventHandler.cpp
+    blackberry/WebKitSupport/FatFingers.cpp
+    blackberry/WebKitSupport/WebPageCompositor.cpp
+)
+
+IF (ENABLE_DRT)
+    # DumpRenderTree sources
+    LIST(APPEND WebKit_SOURCES
+        blackberry/WebKitSupport/DumpRenderTreeSupport.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/AccessibilityControllerBlackBerry.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/AccessibilityUIElementBlackBerry.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/DumpRenderTree.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/EventSender.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/GCControllerBlackBerry.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/LayoutTestControllerBlackBerry.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/PixelDumpSupportBlackBerry.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/PNGImageEncoder.cpp
+        ${TOOLS_DIR}/DumpRenderTree/blackberry/WorkQueueItemBlackBerry.cpp
+        ${TOOLS_DIR}/DumpRenderTree/AccessibilityController.cpp
+        ${TOOLS_DIR}/DumpRenderTree/AccessibilityUIElement.cpp
+        ${TOOLS_DIR}/DumpRenderTree/AccessibilityTextMarker.cpp
+        ${TOOLS_DIR}/DumpRenderTree/LayoutTestController.cpp
+        ${TOOLS_DIR}/DumpRenderTree/CyclicRedundancyCheck.cpp
+        ${TOOLS_DIR}/DumpRenderTree/PixelDumpSupport.cpp
+        ${TOOLS_DIR}/DumpRenderTree/WorkQueue.cpp
+        ${TOOLS_DIR}/DumpRenderTree/GCController.cpp
+    )
+ENDIF ()
+
+SET(WebKit_LINK_FLAGS ${BLACKBERRY_LINK_FLAGS})
+
+LIST(APPEND WebKit_LIBRARIES
+    ${AOI_LIBRARY}
+    ${CLIPBOARD_LIBRARY}
+    ${CURL_LIBRARY}
+    ${Crypto_LIBRARY}
+    ${FONTCONFIG_LIBRARY}
+    ${FREETYPE_LIBRARY}
+    ${HARFBUZZ_LIBRARY}
+    ${ICUData_LIBRARY}
+    ${ICUI18N_LIBRARY}
+    ${ICUUC_LIBRARY}
+    ${IMG_LIBRARY}
+    ${INTL_LIBRARY}
+    ${Iconv_LIBRARY}
+    ${JavaScriptCore_LIBRARY_NAME}
+    ${MD_LIBRARY}
+    ${MMR_LIBRARY}
+    ${M_LIBRARY}
+    ${NBUTIL_LIBRARY}
+    ${PNG_LIBRARY}
+    ${PPSCache_LIBRARY}
+    ${SQLITE3_LIBRARY}
+    ${SSL_LIBRARY}
+    ${STRM_LIBRARY}
+    ${Screen_LIBRARY}
+    ${Skia_LIBRARY}
+    ${Skia_QNX_LIBRARY}
+    ${Socket_LIBRARY}
+    ${UUID_LIBRARY}
+    ${WebKitPlatform_LIBRARY}
+    ${XML2_LIBRARY}
+    ${XSLT_LIBRARY}
+    ${Z_LIBRARY}
+)
+
+IF (PROFILING)
+    LIST(APPEND WebKit_LIBRARIES
+        ${PROFILING_LIBRARY}
+    )
+ENDIF ()
+
+IF (WTF_USE_ACCELERATED_COMPOSITING)
+    LIST(APPEND WebKit_SOURCES
+        blackberry/WebCoreSupport/GLES2Context.cpp
+    )
+    LIST(APPEND WebKit_INCLUDE_DIRECTORIES
+        "${WEBCORE_DIR}/platform/graphics/gles2"
+    )
+    LIST(APPEND WebKit_LIBRARIES
+        ${GLESv2_LIBRARY}
+        ${EGL_LIBRARY}
+    )
+ENDIF ()
+
+FILE(GLOB BBWebKit_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/blackberry/Api/*.h")
+
+INSTALL(FILES ${BBWebKit_HEADERS} DESTINATION usr/include/browser/webkit)
+
+IF (ENABLE_DRT)
+    INSTALL(FILES ${TOOLS_DIR}/DumpRenderTree/blackberry/DumpRenderTreeBlackBerry.h
+            DESTINATION usr/include/browser/webkit)
+ENDIF ()
+
+SET(WebKit_INSTALL_DIR "${CMAKE_SYSTEM_PROCESSOR}/usr/lib/torch-webkit")
+
+# FIXME: We need to make this target more straight forward to read and modify. See <https://bugs.webkit.org/show_bug.cgi?id=72784>.
+ADD_CUSTOM_TARGET(
+    inspector ALL
+        # Note, we cannot "cat *.js" since the order of the JavaScript files is important for there to be no JavaScript errors.
+            COMMAND cat ${WEBCORE_DIR}/inspector/front-end/utilities.js ${WEBCORE_DIR}/inspector/front-end/BinarySearch.js ${WEBCORE_DIR}/inspector/front-end/treeoutline.js ${WEBCORE_DIR}/inspector/front-end/inspector.js ${DERIVED_SOURCES_WEBCORE_DIR}/InspectorBackendStub.js ${WEBCORE_DIR}/inspector/front-end/InspectorFrontendHostStub.js ${WEBCORE_DIR}/inspector/front-end/ExtensionRegistryStub.js ${WEBCORE_DIR}/inspector/front-end/Object.js ${WEBCORE_DIR}/inspector/front-end/Settings.js ${WEBCORE_DIR}/inspector/front-end/Checkbox.js ${WEBCORE_DIR}/inspector/front-end/ContextMenu.js ${WEBCORE_DIR}/inspector/front-end/SoftContextMenu.js ${WEBCORE_DIR}/inspector/front-end/KeyboardShortcut.js ${WEBCORE_DIR}/inspector/front-end/TextPrompt.js ${WEBCORE_DIR}/inspector/front-end/Popover.js ${WEBCORE_DIR}/inspector/front-end/TabbedPane.js ${WEBCORE_DIR}/inspector/front-end/Placard.js ${WEBCORE_DIR}/inspector/front-end/View.js ${WEBCORE_DIR}/inspector/front-end/IFrameView.js ${WEBCORE_DIR}/inspector/front-end/Drawer.js ${WEBCORE_DIR}/inspector/front-end/ConsoleView.js ${WEBCORE_DIR}/inspector/front-end/Panel.js ${WEBCORE_DIR}/inspector/front-end/TimelineGrid.js ${WEBCORE_DIR}/inspector/front-end/Resource.js ${WEBCORE_DIR}/inspector/front-end/CSSStyleModel.js ${WEBCORE_DIR}/inspector/front-end/NetworkManager.js ${WEBCORE_DIR}/inspector/front-end/ResourceTreeModel.js ${WEBCORE_DIR}/inspector/front-end/ResourceCategory.js ${WEBCORE_DIR}/inspector/front-end/TimelineManager.js ${WEBCORE_DIR}/inspector/front-end/Database.js ${WEBCORE_DIR}/inspector/front-end/DOMStorage.js ${WEBCORE_DIR}/inspector/front-end/DOMStorageItemsView.js ${WEBCORE_DIR}/inspector/front-end/DataGrid.js ${WEBCORE_DIR}/inspector/front-end/ShowMoreDataGridNode.js ${WEBCORE_DIR}/inspector/front-end/CookiesTable.js ${WEBCORE_DIR}/inspector/front-end/CookieItemsView.js ${WEBCORE_DIR}/inspector/front-end/ApplicationCacheItemsView.js ${WEBCORE_DIR}/inspector/front-end/Script.js ${WEBCORE_DIR}/inspector/front-end/SidebarPane.js ${WEBCORE_DIR}/inspector/front-end/ElementsTreeOutline.js ${WEBCORE_DIR}/inspector/front-end/SidebarTreeElement.js ${WEBCORE_DIR}/inspector/front-end/Section.js ${WEBCORE_DIR}/inspector/front-end/PropertiesSection.js ${WEBCORE_DIR}/inspector/front-end/RemoteObject.js ${WEBCORE_DIR}/inspector/front-end/ObjectPropertiesSection.js ${WEBCORE_DIR}/inspector/front-end/BreakpointsSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/DOMBreakpointsSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/CallStackSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/ScopeChainSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/WatchExpressionsSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/WorkersSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/MetricsSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/PropertiesSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/EventListenersSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/Color.js ${WEBCORE_DIR}/inspector/front-end/CSSCompletions.js ${WEBCORE_DIR}/inspector/front-end/CSSKeywordCompletions.js ${WEBCORE_DIR}/inspector/front-end/StylesSidebarPane.js ${WEBCORE_DIR}/inspector/front-end/PanelEnablerView.js ${WEBCORE_DIR}/inspector/front-end/WelcomeView.js ${WEBCORE_DIR}/inspector/front-end/StatusBarButton.js ${WEBCORE_DIR}/inspector/front-end/ElementsPanel.js ${WEBCORE_DIR}/inspector/front-end/NetworkPanel.js ${WEBCORE_DIR}/inspector/front-end/InjectedFakeWorker.js ${WEBCORE_DIR}/inspector/front-end/TextViewer.js ${WEBCORE_DIR}/inspector/front-end/SourceFrame.js ${WEBCORE_DIR}/inspector/front-end/ResourceView.js ${WEBCORE_DIR}/inspector/front-end/ScriptsPanel.js ${WEBCORE_DIR}/inspector/front-end/ResourcesPanel.js ${WEBCORE_DIR}/inspector/front-end/ProfilesPanel.js ${WEBCORE_DIR}/inspector/front-end/ConsolePanel.js ${WEBCORE_DIR}/inspector/front-end/ExtensionAPI.js ${WEBCORE_DIR}/inspector/front-end/ExtensionAuditCategory.js ${WEBCORE_DIR}/inspector/front-end/ExtensionCommon.js ${WEBCORE_DIR}/inspector/front-end/ExtensionServer.js ${WEBCORE_DIR}/inspector/front-end/ExtensionPanel.js ${WEBCORE_DIR}/inspector/front-end/AuditsPanel.js ${WEBCORE_DIR}/inspector/front-end/AuditResultView.js ${WEBCORE_DIR}/inspector/front-end/AuditLauncherView.js ${WEBCORE_DIR}/inspector/front-end/AuditRules.js ${WEBCORE_DIR}/inspector/front-end/AuditCategories.js ${WEBCORE_DIR}/inspector/front-end/AuditFormatters.js ${WEBCORE_DIR}/inspector/front-end/NetworkItemView.js ${WEBCORE_DIR}/inspector/front-end/EmptyView.js ${WEBCORE_DIR}/inspector/front-end/ResourceHeadersView.js ${WEBCORE_DIR}/inspector/front-end/ResourceCookiesView.js ${WEBCORE_DIR}/inspector/front-end/ResourceTimingView.js ${WEBCORE_DIR}/inspector/front-end/ResourceJSONView.js ${WEBCORE_DIR}/inspector/front-end/ResourceHTMLView.js ${WEBCORE_DIR}/inspector/front-end/ResourceResponseView.js ${WEBCORE_DIR}/inspector/front-end/ResourcePreviewView.js ${WEBCORE_DIR}/inspector/front-end/ScriptFormatter.js ${WEBCORE_DIR}/inspector/front-end/DOMSyntaxHighlighter.js ${WEBCORE_DIR}/inspector/front-end/TextEditorModel.js ${WEBCORE_DIR}/inspector/front-end/TextEditorHighlighter.js ${WEBCORE_DIR}/inspector/front-end/SourceTokenizer.js ${WEBCORE_DIR}/inspector/front-end/SourceCSSTokenizer.js ${WEBCORE_DIR}/inspector/front-end/SourceHTMLTokenizer.js ${WEBCORE_DIR}/inspector/front-end/SourceJavaScriptTokenizer.js ${WEBCORE_DIR}/inspector/front-end/FontView.js ${WEBCORE_DIR}/inspector/front-end/ImageView.js ${WEBCORE_DIR}/inspector/front-end/DatabaseTableView.js ${WEBCORE_DIR}/inspector/front-end/DatabaseQueryView.js ${WEBCORE_DIR}/inspector/front-end/ProfileDataGridTree.js ${WEBCORE_DIR}/inspector/front-end/BottomUpProfileDataGridTree.js ${WEBCORE_DIR}/inspector/front-end/TopDownProfileDataGridTree.js ${WEBCORE_DIR}/inspector/front-end/ProfileView.js ${WEBCORE_DIR}/inspector/front-end/PartialQuickSort.js ${WEBCORE_DIR}/inspector/front-end/HeapSnapshot.js ${WEBCORE_DIR}/inspector/front-end/HeapSnapshotProxy.js ${WEBCORE_DIR}/inspector/front-end/HeapSnapshotWorkerDispatcher.js ${WEBCORE_DIR}/inspector/front-end/DetailedHeapshotGridNodes.js ${WEBCORE_DIR}/inspector/front-end/DetailedHeapshotView.js ${WEBCORE_DIR}/inspector/front-end/DebuggerModel.js ${WEBCORE_DIR}/inspector/front-end/DebuggerPresentationModel.js ${WEBCORE_DIR}/inspector/front-end/SourceFile.js ${WEBCORE_DIR}/inspector/front-end/DOMAgent.js ${WEBCORE_DIR}/inspector/front-end/TimelineAgent.js ${WEBCORE_DIR}/inspector/front-end/TimelinePanel.js ${WEBCORE_DIR}/inspector/front-end/TimelineOverviewPane.js ${WEBCORE_DIR}/inspector/front-end/TestController.js ${WEBCORE_DIR}/inspector/front-end/HelpScreen.js ${WEBCORE_DIR}/inspector/front-end/GoToLineDialog.js ${WEBCORE_DIR}/inspector/front-end/SettingsScreen.js ${WEBCORE_DIR}/inspector/front-end/ShortcutsScreen.js ${WEBCORE_DIR}/inspector/front-end/HAREntry.js ${WEBCORE_DIR}/inspector/front-end/CookieParser.js ${WEBCORE_DIR}/inspector/front-end/Toolbar.js ${WEBCORE_DIR}/inspector/front-end/SearchController.js ${WEBCORE_DIR}/inspector/front-end/WorkerManager.js ${WEBCORE_DIR}/inspector/front-end/UserMetrics.js ${WEBCORE_DIR}/inspector/front-end/JavaScriptContextManager.js ${WEBCORE_DIR}/../WebKit/blackberry/WebCoreSupport/inspectorBB.js > ${DERIVED_SOURCES_WEBCORE_DIR}/javascript.js
+    DEPENDS ${WebCore_LIBRARY_NAME}
+    COMMENT "Web Inspector resources building..."
+            )
diff --git a/Source/cmake/OptionsBlackBerry.cmake b/Source/cmake/OptionsBlackBerry.cmake
new file mode 100644 (file)
index 0000000..4eaa7cf
--- /dev/null
@@ -0,0 +1,217 @@
+SET(PROJECT_VERSION_MAJOR 0)
+SET(PROJECT_VERSION_MINOR 1)
+SET(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR})
+
+SET(DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}-${PROJECT_VERSION})
+
+ADD_DEFINITIONS(-DDATA_DIR="${DATA_DIR}")
+
+ADD_DEFINITIONS(-DBUILDING_BLACKBERRY__)
+ADD_DEFINITIONS(-DBUILD_WEBKIT)
+
+# Workaround for now so that SK_DEBUG isn't defined in SkPreConfig.h
+ADD_DEFINITIONS(-DSK_RELEASE)
+
+# TODO: Make this build-time configurable
+SET(WTF_USE_PTHREADS 1)
+ADD_DEFINITIONS(-DWTF_USE_PTHREADS=1)
+
+IF (TARGETING_PLAYBOOK)
+    SET(WTF_USE_ACCELERATED_COMPOSITING 1)
+    ADD_DEFINITIONS(-DWTF_USE_ACCELERATED_COMPOSITING=1)
+    ADD_DEFINITIONS(-DBLACKBERRY_PLATFORM_GRAPHICS_EGL=1)
+    ADD_DEFINITIONS(-DBLACKBERRY_PLATFORM_EXPORT_WEBDOM=1)
+ENDIF ()
+
+IF (ADDITIONAL_SYSTEM_INCLUDE_PATH)
+    SET(CMAKE_INCLUDE_SYSTEM_FLAG_C "-Wp,-isystem")
+    SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-Wp,-isystem")
+    FOREACH (directory ${ADDITIONAL_SYSTEM_INCLUDE_PATH})
+        INCLUDE_DIRECTORIES(SYSTEM ${directory})
+    ENDFOREACH ()
+ENDIF ()
+
+IF (ENABLE_DRT)
+    message("*** DRT is ENABLED ***")
+ENDIF ()
+
+ADD_DEFINITIONS(-D__QNXNTO__)
+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
+ADD_DEFINITIONS(-D_LARGEFILE64_SOURCE)
+
+SET(WEBKIT_BUILDINFO_GENERATOR perl ${TOOLS_DIR}/Scripts/generate-buildinfo)
+
+# Find a library only in the staging directory (which is the CMAKE_INSTALL_PATH)
+# TODO: CMAKE_INSTALL_PATH may not be staging directory.
+MACRO(FIND_STAGING_LIBRARY _var _libname)
+  FIND_LIBRARY(${_var} ${_libname}
+    PATHS "${CMAKE_INSTALL_PREFIX}"
+    ENV "QNX_TARGET"
+    PATH_SUFFIXES "${CMAKE_SYSTEM_PROCESSOR}/usr/lib" "${CMAKE_SYSTEM_PROCESSOR}/usr/lib/torch-webkit" "${CMAKE_SYSTEM_PROCESSOR}/lib"
+    NO_DEFAULT_PATH)
+ENDMACRO()
+
+FIND_STAGING_LIBRARY(Skia_LIBRARY grskia)
+FIND_STAGING_LIBRARY(Skia_QNX_LIBRARY skia-qnx)
+FIND_STAGING_LIBRARY(IMG_LIBRARY img)
+FIND_STAGING_LIBRARY(PNG_LIBRARY png)
+FIND_STAGING_LIBRARY(XML2_LIBRARY xml2)
+FIND_STAGING_LIBRARY(XSLT_LIBRARY xslt)
+FIND_STAGING_LIBRARY(SQLITE3_LIBRARY sqlite3)
+FIND_STAGING_LIBRARY(M_LIBRARY m)
+FIND_STAGING_LIBRARY(NBUTIL_LIBRARY nbutil)
+FIND_STAGING_LIBRARY(FREETYPE_LIBRARY freetype)
+FIND_STAGING_LIBRARY(ICUData_LIBRARY icudata)
+FIND_STAGING_LIBRARY(ICUI18N_LIBRARY icui18n)
+FIND_STAGING_LIBRARY(ICUUC_LIBRARY icuuc)
+FIND_STAGING_LIBRARY(Iconv_LIBRARY iconv)
+FIND_STAGING_LIBRARY(INTL_LIBRARY intl)
+FIND_STAGING_LIBRARY(Z_LIBRARY z)
+FIND_STAGING_LIBRARY(Socket_LIBRARY socket)
+FIND_STAGING_LIBRARY(CURL_LIBRARY curl)
+FIND_STAGING_LIBRARY(SSL_LIBRARY ssl)
+FIND_STAGING_LIBRARY(Crypto_LIBRARY crypto)
+FIND_STAGING_LIBRARY(WebKitPlatform_LIBRARY webkitplatform)
+FIND_STAGING_LIBRARY(UUID_LIBRARY uuid-browser)
+FIND_STAGING_LIBRARY(Screen_LIBRARY screen)
+FIND_STAGING_LIBRARY(MMR_LIBRARY mmrndclient)
+FIND_STAGING_LIBRARY(PPSCache_LIBRARY ppscache)
+FIND_STAGING_LIBRARY(MD_LIBRARY md)
+FIND_STAGING_LIBRARY(AOI_LIBRARY aoi)
+FIND_STAGING_LIBRARY(CLIPBOARD_LIBRARY clipboard)
+FIND_STAGING_LIBRARY(EGL_LIBRARY EGL)
+FIND_STAGING_LIBRARY(GLESv2_LIBRARY GLESv2)
+FIND_STAGING_LIBRARY(STRM_LIBRARY strm)
+FIND_STAGING_LIBRARY(HARFBUZZ_LIBRARY harfbuzz)
+FIND_STAGING_LIBRARY(FONTCONFIG_LIBRARY fontconfig)
+FIND_STAGING_LIBRARY(PROFILING_LIBRARY profilingS)
+FIND_STAGING_LIBRARY(LIB_INPUT_UTILITIES input_utilities)
+
+# Show unresolved symbols when doing the final shared object link
+IF (PROFILING)
+    SET(BLACKBERRY_LINK_FLAGS "-Wl,-z,defs -Wl,-zrelro -Wl,-E")
+ELSE (PROFILING)
+    SET(BLACKBERRY_LINK_FLAGS "-Wl,-z,defs -Wl,-zrelro")
+ENDIF ()
+
+# Set custom CFLAGS for our port
+IF (CMAKE_COMPILER_IS_GNUCC)
+    SET(CMAKE_CXX_FLAGS "-fstack-protector -fno-rtti -Wformat -Wformat-security -Werror=format-security ${CMAKE_CXX_FLAGS}")
+    SET(CMAKE_C_FLAGS "-fstack-protector -fno-rtti -Wformat -Wformat-security -Werror=format-security ${CMAKE_C_FLAGS}")
+    SET(JSC_LINK_FLAGS "-N1024K")
+ENDIF ()
+
+IF (PROFILING)
+    SET(CMAKE_CXX_FLAGS "-finstrument-functions -g ${CMAKE_CXX_FLAGS}")
+    SET(CMAKE_C_FLAGS "-finstrument-functions -g ${CMAKE_C_FLAGS}")
+ENDIF ()
+
+# FIXME: Make this more elegant
+IF (TARGETING_PLAYBOOK)
+    SET(CMAKE_CXX_FLAGS "-mfpu=vfpv3 -mthumb -mthumb-interwork ${CMAKE_CXX_FLAGS}")
+    SET(CMAKE_C_FLAGS "-mfpu=vfpv3 -mthumb -mthumb-interwork ${CMAKE_C_FLAGS}")
+ENDIF ()
+
+ADD_DEFINITIONS(-DRESOURCE_PATH="/usr/share/webkit-owb/resources/")
+INCLUDE_DIRECTORIES(${CMAKE_INCLUDE_PATH})
+
+SET(JSC_EXECUTABLE_NAME jsc)
+
+SET(WTF_LIBRARY_NAME wtf)
+SET(JavaScriptCore_LIBRARY_NAME javascriptcore)
+SET(WebCore_LIBRARY_NAME webcore)
+SET(WebKit_LIBRARY_NAME webkit)
+SET(WebKit_DRT_LIBRARY_NAME webkit_DRT)
+
+IF (TARGETING_PLAYBOOK)
+    WEBKIT_FEATURE(ENABLE_3D_RENDERING "Enable 3D Rendering" DEFAULT ON)
+    WEBKIT_FEATURE(ENABLE_WEBGL "Enable WebGL" DEFAULT ON)
+ELSE ()
+    WEBKIT_FEATURE(ENABLE_3D_RENDERING "Enable 3D Rendering" DEFAULT OFF)
+    WEBKIT_FEATURE(ENABLE_WEBGL "Enable WebGL" DEFAULT OFF)
+ENDIF ()
+
+WEBKIT_FEATURE(ENABLE_ASSEMBLER_WX_EXCLUSIVE "Assembler WX Exclusive" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_BLACKBERRY_CARET_APPEARANCE "Blackberry Caret Appearance" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_BLOB "Enable blob slice" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_CHANNEL_MESSAGING "Enable channel messaging" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_CLIENT_BASED_GEOLOCATION "Client based Geolocation" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_DATABASE "Enable database" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_DATAGRID "Enable datagrid" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_DATALIST "Enable datalist" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_DETAILS "Enable details element" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_DEVICE_ORIENTATION "Enable Device Orientation" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_DOM_STORAGE "Enable DOM storage" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_DRAG_SUPPORT "Enable Drag Support" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_EVENTSOURCE "Enable event source" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_EVENT_MODE_METATAGS "Enable meta-tag touch and mouse events" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_FAST_MOBILE_SCROLLING "Enable fast mobile scrolling" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_FILE_SYSTEM "Enable file system" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_FILTERS "Enable SVG filters" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_FIXED_REPORTED_SIZE "Fixed Reported Size" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_FTPDIR "Enable FTP directory browsing" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_GEOLOCATION "Enable geolocation" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_GLIB_SUPPORT "Enable Glib support" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_GROUP_BASED_DATABASE "Enable Group Based Database support" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_ICONDATABASE "Enable icon database" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_IMAGE_DECODER_DOWN_SAMPLING "Enable image decoder down sampling" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_INDEXED_DATABASE "Enable IndexDB" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_INPUT_COLOR "Enable Color Input" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_INSPECTOR "Enable inspector" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_JAVASCRIPT_DEBUGGER "Enable JavaScript debugger" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_MATHML "Enable MathML" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_METER_TAG "Enable Meter Tag" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_NETSCAPE_PLUGIN_API "Enable Netscape plugin API" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_NOTIFICATIONS "Enable notifications" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_OFFLINE_WEB_APPLICATIONS "Enable offline web applications" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_BLACKBERRY_OBJECT_ALLOCATOR "Enable BlackBerry object allocator" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_ORIENTATION_EVENTS "Enable orientation events" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_PROGRESS_TAG "Enable progress tag" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_REPAINT_THROTTLING "Enable repaint throttling" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_RUBY "Enable Ruby" DEFAULT ON HTML)
+WEBKIT_FEATURE(ENABLE_SANDBOX "Enable Sandbox" DEFAULT OFF HTML)
+WEBKIT_FEATURE(ENABLE_SHARED_WORKERS "Enable shared workers" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_SVG "Enable SVG" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_SVG_ANIMATION "Enable SVG animation" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_SVG_AS_IMAGE "Enable SVG as image" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_SVG_FONTS "Enable SVG fonts" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_SVG_FOREIGN_OBJECT "Enable SVG foreign object" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_SVG_USE "Enable SVG use" DEFAULT ON SVG)
+WEBKIT_FEATURE(ENABLE_TOUCH_EVENTS "Enable touch events " DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_VIDEO "Enable video" DEFAULT ON HTML)
+WEBKIT_FEATURE(ENABLE_VIEWPORT_REFLOW "Enable viewport reflow" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_WEB_SOCKETS "Enable web sockets" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_WML "Enable WML" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_WORKERS "Enable workers" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_XHTMLMP "Enable XHTMLMP" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_XPATH "Enable XPath" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_XSLT "Enable XSLT" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_CSS3_FLEXBOX "Enable CSS3 Flexbox" DEFAULT ON)
+WEBKIT_FEATURE(ENABLE_PLUGIN_PROXY_FOR_VIDEO "Plugin Proxy for Video" DEFAULT OFF)
+WEBKIT_FEATURE(ENABLE_ANIMATION_API "Enable animation API" DEFAULT ON)
+
+IF (ENABLE_DRT)
+    WEBKIT_FEATURE(ENABLE_DRT "Enable DRT" DEFAULT ON)
+ELSE ()
+    WEBKIT_FEATURE(ENABLE_DRT "Enable DRT" DEFAULT OFF)
+ENDIF ()
+
+IF (CMAKE_SYSTEM_PROCESSOR MATCHES x86)
+    WEBKIT_FEATURE(ENABLE_JIT "Enable JIT" DEFAULT OFF)
+    WEBKIT_FEATURE(ENABLE_SKIA_GPU_CANVAS "Enable GPU-backed Skia canvases" DEFAULT OFF)
+ELSE ()
+    WEBKIT_FEATURE(ENABLE_JIT "Enable JIT" DEFAULT ON)
+    WEBKIT_FEATURE(ENABLE_SKIA_GPU_CANVAS "Enable GPU-backed Skia canvases" DEFAULT ON)
+ENDIF ()
+
+# Some of our files, such as platform/graphics/chromium/ComplexTextControllerLinux.cpp, require a
+# newer ICU version than the version associated with the headers in {WebCore, JavaScriptCore}/icu.
+# Because of <https://bugs.webkit.org/show_bug.cgi?id=70913> we can't directly reference these newer
+# ICU headers within the QNX system header directory. As a workaround, we copy these newer ICU headers
+# from the QNX system header directory to a third-party directory under the CMake binary tree.
+#
+# FIXME: Make this mechanism more general purpose. Maybe accept a list or directories/files to copy
+# instead of individual variables. Generalizing this solution may allow us to fix <https://bugs.webkit.org/show_bug.cgi?id=70913>.
+SET(BLACKBERRY_THIRD_PARTY_DIR "${CMAKE_BINARY_DIR}/ThirdPartyBlackBerry")
+FILE(COPY ${THIRD_PARTY_ICU_DIR} DESTINATION "${BLACKBERRY_THIRD_PARTY_DIR}/icu")
+FILE(COPY ${THIRD_PARTY_UNICODE_FILE} DESTINATION ${BLACKBERRY_THIRD_PARTY_DIR})
index eeaa02b..734874b 100644 (file)
@@ -9,6 +9,8 @@ IF (MSVC)
     # FIXME: Some codegenerators don't support paths with spaces. So use the executable name only.
     GET_FILENAME_COMPONENT(CODE_GENERATOR_PREPROCESSOR_EXECUTABLE ${CMAKE_CXX_COMPILER} NAME)
     SET(CODE_GENERATOR_PREPROCESSOR "${CODE_GENERATOR_PREPROCESSOR_EXECUTABLE} /nologo /EP")
+ELSEIF (CMAKE_SYSTEM_NAME MATCHES QNX)
+    SET(CODE_GENERATOR_PREPROCESSOR "${CMAKE_CXX_COMPILER} -E -Wp,-P -x c++")
 ELSE ()
     SET(CODE_GENERATOR_PREPROCESSOR "${CMAKE_CXX_COMPILER} -E -P -x c++")
 ENDIF ()
index 4b7d469..6fc3175 100644 (file)
@@ -1,3 +1,24 @@
+2011-11-18  Daniel Bates  <dbates@rim.com>
+
+        Add CMake build infrastructure for the BlackBerry port
+        https://bugs.webkit.org/show_bug.cgi?id=72768
+
+        Reviewed by Antonio Gomes.
+
+        Add optional --blackberry command line argument to build-webkit to build the
+        BlackBerry port.
+
+        * Scripts/build-webkit:
+        * Scripts/webkitdirs.pm:
+        (determineBaseProductDir):
+        (argumentsForConfiguration):
+        (builtDylibPathForName):
+        (determineIsQt):
+        (isBlackBerry): Added.
+        (determineIsBlackBerry): Added.
+        (blackberryTargetArchitecture): Added.
+        (isAppleWebKit):
+
 2011-11-18  James Robinson  <jamesr@chromium.org>
 
         Unreviewed, rolling out r100835.
index 264f46b..1ab84cb 100755 (executable)
@@ -147,7 +147,7 @@ my @features = (
       define => "ENABLE_ACCELERATED_2D_CANVAS", default => 0, value => \$accelerated2dCanvasSupport },
 
     { option => "animation-api", desc => "Toggle animation API support",
-      define => "ENABLE_ANIMATION_API", default => 0, value => \$animationAPISupport },
+      define => "ENABLE_ANIMATION_API", default => isBlackBerry(), value => \$animationAPISupport },
 
     { option => "blob", desc => "Toggle Blob support",
       define => "ENABLE_BLOB", default => (isAppleMacWebKit() || isGtk() || isChromium()), value => \$blobSupport },
@@ -156,7 +156,7 @@ my @features = (
       define => "ENABLE_CHANNEL_MESSAGING", default => 1, value => \$channelMessagingSupport },
 
     { option => "client-based-geolocation", desc => "Toggle client-based Geolocation support",
-      define => "ENABLE_CLIENT_BASED_GEOLOCATION", default => (isAppleWebKit() || isGtk()), value => \$clientBasedGeolocationSupport },
+      define => "ENABLE_CLIENT_BASED_GEOLOCATION", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$clientBasedGeolocationSupport },
 
     { option => "css-filters", desc => "Toggle CSS Filters support",
       define => "ENABLE_CSS_FILTERS", default => isAppleWebKit(), value => \$cssFiltersSupport },
@@ -183,7 +183,7 @@ my @features = (
       define => "ENABLE_DETAILS", default => 1, value => \$detailsSupport },
 
     { option => "device-orientation", desc => "Toggle DeviceOrientation support",
-      define => "ENABLE_DEVICE_ORIENTATION", default => 0, value => \$deviceOrientationSupport },
+      define => "ENABLE_DEVICE_ORIENTATION", default => isBlackBerry(), value => \$deviceOrientationSupport },
 
     { option => "directory-upload", desc => "Toogle Directory upload support",
       define => "ENABLE_DIRECTORY_UPLOAD", default => 0, value => \$directoryUploadSupport },
@@ -195,7 +195,7 @@ my @features = (
       define => "ENABLE_FILE_SYSTEM", default => 0, value => \$fileSystemSupport },
 
     { option => "filters", desc => "Toggle SVG Filters support",
-      define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl()), value => \$filtersSupport },
+      define => "ENABLE_FILTERS", default => (isAppleWebKit() || isGtk() || isQt() || isEfl() || isBlackBerry()), value => \$filtersSupport },
 
     { option => "fullscreen-api", desc => "Toggle Fullscreen API support",
       define => "ENABLE_FULLSCREEN_API", default => (isAppleMacWebKit() || isGtk()), value => \$fullscreenAPISupport },
@@ -204,7 +204,7 @@ my @features = (
       define => "ENABLE_GAMEPAD", default => 0, value => \$gamepadSupport },
 
     { option => "geolocation", desc => "Toggle Geolocation support",
-      define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk()), value => \$geolocationSupport },
+      define => "ENABLE_GEOLOCATION", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$geolocationSupport },
 
     { option => "icon-database", desc => "Toggle Icon database support",
       define => "ENABLE_ICONDATABASE", default => 1, value => \$iconDatabaseSupport },
@@ -213,7 +213,7 @@ my @features = (
       define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
 
     { option => "input-color", desc => "Color Input support",
-      define => "ENABLE_INPUT_COLOR", default => 0, value => \$inputColorSupport },
+      define => "ENABLE_INPUT_COLOR", default => isBlackBerry(), value => \$inputColorSupport },
 
     { option => "input-speech", desc => "Speech Input API support",
       define => "ENABLE_INPUT_SPEECH", default => 0, value => \$inputSpeechSupport },
@@ -270,10 +270,10 @@ my @features = (
       define => "ENABLE_NETSCAPE_PLUGIN_API", default => !isEfl(), value => \$netscapePluginSupport },
 
     { option => "notifications", desc => "Toggle Desktop Notifications Support",
-      define => "ENABLE_NOTIFICATIONS", default => 0, value => \$notificationsSupport },
+      define => "ENABLE_NOTIFICATIONS", default => isBlackBerry(), value => \$notificationsSupport },
 
     { option => "orientation-events", desc => "Toggle Orientation Events support",
-      define => "ENABLE_ORIENTATION_EVENTS", default => 0, value => \$orientationEventsSupport },
+      define => "ENABLE_ORIENTATION_EVENTS", default => isBlackBerry(), value => \$orientationEventsSupport },
 
     { option => "page-visibility-api", desc => "Page Visibility API support",
       define => "ENABLE_PAGE_VISIBILITY_API", default => 0, value => \$pageVisibilityApiSupport },
@@ -291,7 +291,7 @@ my @features = (
       define => "USE_SYSTEM_MALLOC", default => 0, value => \$systemMallocSupport },
 
     { option => "shared-workers", desc => "Toggle SharedWorkers support",
-      define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$sharedWorkersSupport },
+      define => "ENABLE_SHARED_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$sharedWorkersSupport },
 
     { option => "svg", desc => "Toggle SVG support",
       define => "ENABLE_SVG", default => 1, value => \$svgSupport },
@@ -306,13 +306,13 @@ my @features = (
       define => "WTF_USE_TILED_BACKING_STORE", default => isQt(), value => \$tiledBackingStoreSupport },
 
     { option => "touch-events", desc => "Toggle Touch Events support",
-      define => "ENABLE_TOUCH_EVENTS", default => isQt(), value => \$touchEventsSupport },
+      define => "ENABLE_TOUCH_EVENTS", default => (isQt() || isBlackBerry()), value => \$touchEventsSupport },
 
     { option => "touch-icon-loading", desc => "Toggle Touch Icon Loading Support",
       define => "ENABLE_TOUCH_ICON_LOADING", default => 0, value => \$touchIconLoadingSupport },
 
     { option => "video", desc => "Toggle Video support",
-      define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk()), value => \$videoSupport },
+      define => "ENABLE_VIDEO", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$videoSupport },
 
     { option => "web-audio", desc => "Toggle Web Audio support",
       define => "ENABLE_WEB_AUDIO", default => 0, value=> \$webAudioSupport },
@@ -324,7 +324,7 @@ my @features = (
       define => "ENABLE_WEB_TIMING", default => 0, value=> \$webTimingSupport },
 
     { option => "workers", desc => "Toggle Web Workers support",
-      define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk()), value => \$workersSupport },
+      define => "ENABLE_WORKERS", default => (isAppleWebKit() || isGtk() || isBlackBerry()), value => \$workersSupport },
 
     { option => "xslt", desc => "Toggle XSLT support",
       define => "ENABLE_XSLT", default => 1, value => \$xsltSupport },
@@ -382,6 +382,7 @@ Usage: $programName [options] [options to pass to build system]
   --gyp                             Use GYP-generated project files
   --dsym                            Change debugging format to dwarf-with-dsym (Mac only)
 
+  --blackberry                      Build the BlackBerry port on Mac/Linux
   --chromium                        Build the Chromium port on Mac/Win/Linux
   --chromium-android                Build the Chromium port on Android
   --efl                             Build the EFL port
@@ -396,7 +397,7 @@ Usage: $programName [options] [options to pass to build system]
   --install-libs=<path>             Set installation path for the libraries (Qt only)
   --v8                              Use V8 as JavaScript engine (Qt only)
 
-  --prefix=<path>                   Set installation prefix to the given path (Gtk/Efl only)
+  --prefix=<path>                   Set installation prefix to the given path (Gtk/Efl/BlackBerry only)
   --makeargs=<arguments>            Optional Makefile flags
   --qmakearg=<arguments>            Optional qmake flags (Qt only, e.g. --qmakearg="CONFIG+=webkit2" to build WebKit2)
   --cmakearg=<arguments>            Optional CMake flags (e.g. --cmakearg="-DFOO=bar -DCMAKE_PREFIX_PATH=/usr/local")
@@ -630,6 +631,107 @@ if (isWinCE()) {
     buildCMakeProjectOrExit($clean, "WinCE", $prefixPath, $makeArgs, ("-DCMAKE_WINCE_SDK=\"STANDARDSDK_500 (ARMV4I)\"", cMakeArgsFromFeatures()), $cmakeArgs);
 }
 
+if (isBlackBerry()) {
+    my %archInfo = blackberryTargetArchitecture();
+    my $arch = $archInfo{"arch"};
+    my $cpu = $archInfo{"cpu"};
+    my $cpuDir = $archInfo{"cpuDir"};
+    my $buSuffix = $archInfo{"buSuffix"};
+
+    my @cmakeExtraOptions;
+    if ($cpu eq "a9") {
+        $cpu = $arch . "v7le";
+        push @cmakeExtraOptions, '-DTARGETING_PLAYBOOK=1';
+    }
+
+    my $stageDir = $ENV{"STAGE_DIR"};
+    my $stageLib = File::Spec->catdir($stageDir, $cpuDir, "lib");
+    my $stageUsrLib = File::Spec->catdir($stageDir, $cpuDir, "usr", "lib");
+    my $stageInc = File::Spec->catdir($stageDir, "usr", "include");
+
+    my $qnxHost = $ENV{"QNX_HOST"};
+    my $numberOfJobs;
+    my $ccCommand;
+    my $cxxCommand;
+    if ($ENV{"USE_ICECC"}) {
+        chomp($ccCommand = `which icecc`);
+        $cxxCommand = $ccCommand;
+        $numberOfJobs = 50; # 50 is the number we choose for internal development
+    } else {
+        $ccCommand = File::Spec->catfile($qnxHost, "usr", "bin", "qcc");
+        $cxxCommand = $ccCommand;
+        $numberOfJobs = numberOfCPUs();
+    }
+    $makeArgs .= ($makeArgs ? " " : "") . "-j" . $numberOfJobs if $makeArgs !~ /-j\s*\d+/;
+
+    if ($ENV{"CCWRAP"}) {
+        $ccCommand = $ENV{"CCWRAP"};
+        push @cmakeExtraOptions, "-DCMAKE_C_COMPILER_ARG1=qcc";
+        push @cmakeExtraOptions, "-DCMAKE_CXX_COMPILER_ARG1=qcc";
+    }
+
+    push @cmakeExtraOptions, "-DCMAKE_SKIP_RPATH='ON'" if isDarwin();
+    push @cmakeExtraOptions, "-DENABLE_DRT=1" if $ENV{"ENABLE_DRT"};
+
+    my @includeSystemDirectories;
+    push @includeSystemDirectories, File::Spec->catdir($stageInc, "grskia", "skia");
+    push @includeSystemDirectories, File::Spec->catdir($stageInc, "grskia");
+    push @includeSystemDirectories, File::Spec->catdir($stageInc, "harfbuzz");
+    push @includeSystemDirectories, File::Spec->catdir($stageInc, "imf");
+    push @includeSystemDirectories, $stageInc;
+    push @includeSystemDirectories, File::Spec->catdir($stageInc, "browser", "platform");
+    push @includeSystemDirectories, File::Spec->catdir($stageInc, "browser", "qsk");
+
+    my @cxxFlags;
+    push @cxxFlags, "-Wl,-rpath-link,$stageLib";
+    push @cxxFlags, "-Wl,-rpath-link," . File::Spec->catfile($stageUsrLib, "torch-webkit");
+    push @cxxFlags, "-Wl,-rpath-link,$stageUsrLib";
+    push @cxxFlags, "-L$stageLib";
+    push @cxxFlags, "-L$stageUsrLib";
+
+    if ($ENV{"PROFILE"}) {
+        push @cmakeExtraOptions, "-DPROFILING=1";
+        push @cxxFlags, "-p";
+    }
+
+    my @cmakeArgs;
+    push @cmakeArgs, "-DPUBLIC_BUILD=0";
+    push @cmakeArgs, '-DCMAKE_SYSTEM_NAME="QNX"';
+    push @cmakeArgs, "-DCMAKE_SYSTEM_PROCESSOR=\"$cpuDir\"";
+    push @cmakeArgs, '-DCMAKE_SYSTEM_VERSION="1"';
+    push @cmakeArgs, "-DCMAKE_C_COMPILER=\"$ccCommand\"";
+    push @cmakeArgs, "-DCMAKE_CXX_COMPILER=\"$cxxCommand\"";
+    push @cmakeArgs, "-DCMAKE_C_FLAGS=\"-Vgcc_nto${cpu} -g @cxxFlags\"";
+    push @cmakeArgs, "-DCMAKE_CXX_FLAGS=\"-Vgcc_nto${cpu}_cpp-ne -g -lang-c++ @cxxFlags\"";
+
+    # We cannot use CMAKE_INCLUDE_PATH since this describes the search path for header files in user directories.
+    # And the QNX system headers are in user directories on the host OS (i.e. they aren't installed in the host OS's
+    # system header search path). So, we need to inform g++ that these user directories (@includeSystemDirectories)
+    # are to be taken as the host OS's system header directories when building our port.
+    #
+    # Also, we cannot use CMAKE_SYSTEM_INCLUDE_PATH since that will override the entire system header path.
+    # So, we define the additional system include paths in ADDITIONAL_SYSTEM_INCLUDE_PATH. This list will
+    # be processed in OptionsBlackBerry.cmake.
+    push @cmakeArgs, '-DADDITIONAL_SYSTEM_INCLUDE_PATH="' . join(';', @includeSystemDirectories) . '"';
+
+    # FIXME: Make this more general purpose such that we can pass a list of directories and files.
+    push @cmakeArgs, '-DTHIRD_PARTY_ICU_DIR="' . File::Spec->catdir($stageInc, "unicode") . '"';
+    push @cmakeArgs, '-DTHIRD_PARTY_UNICODE_FILE="' . File::Spec->catfile($stageInc, "unicode.h") . '"';
+
+    push @cmakeArgs, "-DCMAKE_LIBRARY_PATH=\"$stageLib;$stageUsrLib\"";
+    push @cmakeArgs, '-DCMAKE_AR="' . File::Spec->catfile($qnxHost, "usr", "bin", "nto${buSuffix}-ar") . '"';
+    push @cmakeArgs, '-DCMAKE_RANLIB="' . File::Spec->catfile($qnxHost, "usr", "bin", "nto${buSuffix}-ranlib") . '"';
+    push @cmakeArgs, '-DCMAKE_LD="'. File::Spec->catfile($qnxHost, "usr", "bin", "nto${buSuffix}-ld") . '"';
+    push @cmakeArgs, '-DCMAKE_LINKER="' . File::Spec->catfile($qnxHost, "usr", "bin", "nto${buSuffix}-ld") . '"';
+    push @cmakeArgs, "-DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT=TRUE";
+    push @cmakeArgs, '-G"Eclipse CDT4 - Unix Makefiles"';
+    push @cmakeArgs, @cmakeExtraOptions;
+
+    $prefixPath = $stageDir unless $prefixPath;
+
+    buildCMakeProjectOrExit($clean, "BlackBerry", $prefixPath, $makeArgs, (@cmakeArgs, cMakeArgsFromFeatures()));
+}
+
 # Build, and abort if the build fails.
 for my $dir (@projects) {
     chdir $dir or die;
index 76cae72..8a53247 100755 (executable)
@@ -49,6 +49,7 @@ BEGIN {
        &XcodeOptionStringNoConfig
        &XcodeOptions
        &baseProductDir
+       &blackberryTargetArchitecture
        &chdirWebKit
        &checkFrameworks
        &currentSVNRevision
@@ -87,6 +88,7 @@ my $isWinCairo;
 my $isWx;
 my $isEfl;
 my @wxArgs;
+my $isBlackBerry;
 my $isChromium;
 my $isChromiumAndroid;
 my $isChromiumMacMake;
@@ -183,6 +185,11 @@ sub determineBaseProductDir
         $baseProductDir = "$sourceDir/WebKitBuild";
     }
 
+    if (isBlackBerry()) {
+        my %archInfo = blackberryTargetArchitecture();
+        $baseProductDir = "$baseProductDir/" . $archInfo{"cpuDir"};
+    }
+
     if (isGit() && isGitBranchBuild() && !isChromium()) {
         my $branch = gitBranch();
         $baseProductDir = "$baseProductDir/$branch";
@@ -322,6 +329,7 @@ sub argumentsForConfiguration()
     push(@args, '--wincairo') if isWinCairo();
     push(@args, '--wince') if isWinCE();
     push(@args, '--wx') if isWx();
+    push(@args, '--blackberry') if isBlackBerry();
     push(@args, '--chromium') if isChromium() && !isChromiumAndroid();
     push(@args, '--chromium-android') if isChromiumAndroid();
     push(@args, '--inspector-frontend') if isInspectorFrontend();
@@ -637,6 +645,10 @@ sub builtDylibPathForName
     if (isChromium()) {
         return "$configurationProductDir/$libraryName";
     }
+    if (isBlackBerry()) {
+        my $libraryExtension = $libraryName =~ /^WebKit$/i ? ".so" : ".a";
+        return "$configurationProductDir/$libraryName/lib" . lc($libraryName) . $libraryExtension;
+    }
     if (isQt()) {
         $libraryName = "QtWebKit";
         if (isDarwin() and -d "$configurationProductDir/lib/$libraryName.framework") {
@@ -824,8 +836,8 @@ sub determineIsQt()
         return;
     }
 
-    # The presence of QTDIR only means Qt if --gtk or --wx or --efl are not on the command-line
-    if (isGtk() || isWx() || isEfl()) {
+    # The presence of QTDIR only means Qt if --gtk or --wx or --efl or --blackberry are not on the command-line
+    if (isGtk() || isWx() || isEfl() || isBlackBerry()) {
         $isQt = 0;
         return;
     }
@@ -833,6 +845,38 @@ sub determineIsQt()
     $isQt = defined($ENV{'QTDIR'});
 }
 
+sub isBlackBerry()
+{
+    determineIsBlackBerry();
+    return $isBlackBerry;
+}
+
+sub determineIsBlackBerry()
+{
+    return if defined($isBlackBerry);
+    $isBlackBerry = checkForArgumentAndRemoveFromARGV("--blackberry");
+}
+
+sub blackberryTargetArchitecture()
+{
+    my $arch = $ENV{"BLACKBERRY_ARCH_TYPE"} ? $ENV{"BLACKBERRY_ARCH_TYPE"} : "arm";
+    my $cpu = $ENV{"BLACKBERRY_ARCH_CPU"} ? $ENV{"BLACKBERRY_ARCH_CPU"} : "";
+    my $cpuDir;
+    my $buSuffix;
+    if (($cpu eq "v7le") || ($cpu eq "a9")) {
+        $cpuDir = $arch . "le-v7";
+        $buSuffix = $arch . "v7";
+    } else {
+        $cpu = $arch;
+        $cpuDir = $arch;
+        $buSuffix = $arch;
+    }
+    return ("arch" => $arch,
+            "cpu" => $cpu,
+            "cpuDir" => $cpuDir,
+            "buSuffix" => $buSuffix);
+}
+
 sub determineIsEfl()
 {
     return if defined($isEfl);
@@ -1045,7 +1089,7 @@ sub isARM()
 
 sub isAppleWebKit()
 {
-    return !(isQt() or isGtk() or isWx() or isChromium() or isEfl() or isWinCE());
+    return !(isQt() or isGtk() or isWx() or isChromium() or isEfl() or isWinCE() or isBlackBerry());
 }
 
 sub isAppleMacWebKit()