Changeset 155032 in webkit


Ignore:
Timestamp:
Sep 4, 2013 3:19:34 AM (11 years ago)
Author:
zandobersek@gmail.com
Message:

[GTK] Add support for the Wayland build target
https://bugs.webkit.org/show_bug.cgi?id=120627

Reviewed by Gustavo Noronha Silva.

.:

Add support for building the GTK port with Wayland as the target. The Wayland target can be the sole target
that's enabled, or it can be enabled in parallel with the X11 target.

Each of those two targets, when enabled, checks for the corresponding GTK+ windowing dependency being present.
In the case of only the Wayland target being enabled, the accelerated compositing feature is disabled at
build-time as the feature is not yet supported under the Wayland display protocol. X11-based plugin support is
also disabled under that configuration, even if the WebKitPluginProcess is still built but is left non-operational.
GLX support is also disabled if not building the X11 target.

The Wayland target can be enabled through using the --with-target configuration option that now accepts two
additional values:

  • 'wayland' - only enables the Wayland target,
  • 'x11,wayland' - enables the X11 and Wayland targets that are to be built in parallel.

This makes it possible to build the GTK port of WebKit with the Wayland target, relying solely on the GTK+
dependency that only has the Wayland backend enabled, and removes linking against any X11-related library.
Note that at the moment there seem to be other dependencies that still link to X11-related libraries.
Complete functionality is not yet guaranteed, but is of course the goal.

  • Source/autotools/FindDependencies.m4: Store the version of the basic GTK+ dependency that was found.

This is later used to check that the GTK+ X11 and GTK+ Wayland dependencies are of the same version. The
X11-specific dependencies are grouped into one section (apart from the XComposite and XDamage dependencies),
also checking for the GTK+ X11 dependency. If the X11 target is not enabled, the GLX dependency is disabled.
Additionally check for the GTK+ Wayland dependency if the Wayland target is enabled.
We only check for the presence and correct version of the GTK+ X11 and Wayland dependencies, if necessary.
Check for the XComposite and XDamage dependencies if the X11 target is enabled (in addition to the OpenGL
headers being present).
In case of the Wayland target being enabled while the X11 target is not, disable the accelerated compositing
feature as there's no support yet for it under the Wayland display protocol.

  • Source/autotools/PrintBuildConfiguration.m4: The build configuration should now print out 'GDK targets'.
  • Source/autotools/ReadCommandLineArguments.m4: The --with-target option can now take two additional values,

'wayland' and 'x11,wayland'. The first one enables only the Wayland target, while the second one enables both
X11 and Wayland targets. This makes it possible to build the GTK port with both X11 and Wayland display protocols
supported in the same build.
We must now check the outcoming with_target variable to see if the special case of building one or both of the
possible parallel targets was chosen. We define with_x11_target and with_wayland_target variables if the
with_target value applies to that case.

  • Source/autotools/SetupAutoconfHeader.m4: Do not define the XP_UNIX macro on builds that enable the Wayland-only

target. It should still be defined if we're building both X11 and Wayland targets in parallel.

  • Source/autotools/SetupAutomake.m4: Define TARGET_X11 and TARGET_WAYLAND Automake conditionals if the new

with_x11_target or with_wayland_target variables were set, respectively. Additionall, define the TARGET_X11_OR_WAYLAND
Automake conditional if we're building either of the two targets.

Source/WebCore:

  • GNUmakefile.list.am: Reorder the Source/WebCore/plugins/np* source files.

The X11-specific source files should only be included if the X11 target is being built. PluginPackageNone and
PluginViewNone source files must be included in non-X11-target builds. Other source files that were previously
guarded with the TARGET_X11 conditional should also be built for the Wayland target, so the new TARGET_X11_OR_WAYLAND
conditional is used. If neither of those two targets is being built we fall back to adding source files to the build
as necessary by the actual build target.

  • platform/gtk/GtkVersioning.c:

(gdk_screen_get_monitor_workarea): Additionally guard bits of code that depend on the GDK_WINDOWING_X11 macro being
defined - these should only be built when building the X11 target, checked for with PLATFORM(X11).

Source/WebKit/gtk:

  • WebCoreSupport/ChromeClientGtk.cpp:

(WebKit::createBackingStore): Additionally guard the <gdk/gdkx.h> inclusion and the inclusion and use of
WidgetBackingStoreGtkX11 with PLATFORM(X11), ensuring this code is built when also building with X11 target
enabled. GDK_WINDOWING_X11 macro can be defined even if the X11 target is disabled.

Source/WebKit2:

  • GNUmakefile.list.am: Build X11-specific NetscapePluginModule and NetscapePlugin classes if building the X11 target,

fall back to the generic, empty classes otherwise.

  • PluginProcess/unix/PluginProcessMainUnix.cpp:

(WebKit::PluginProcessMainUnix): Guard the NetscapePluginModule::scanPlugin() invocation with PLUGIN_ARCHITECTURE(X11),
it's at the moment specific to the X11 implementation of the Netscape plugins.

  • UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Guard PluginProcessProxy::scanPlugin() with PLUGIN_ARCHITECTURE(X11),

just like it's guarded in the PluginProcessProxy class declaration.

  • UIProcess/cairo/BackingStoreCairo.cpp: Additionally guard <gdk/gdkx.h> and WidgetBackingStoreGtkX11 inclusion and use

with PLATFORM(X11), this code should only be built when building the X11 target.
(WebKit::createBackingStoreForGTK):

  • UIProcess/gtk/WebPageProxyGtk.cpp: Guard the createPluginContainer() and windowedPluginGeometryDidChange() methods and their

helper functions and objects with PLUGIN_ARCHITECTURE(X11), just like they're guarded in the WebPageProxy class declaration.

  • config.h: Only define PLUGIN_ARCHITECTURE_X11 to 1 if we're actually building the X11 target.

Tools:

  • GNUmakefile.am: Define the additional macros also if building the Wayland target.
Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r154978 r155032  
     12013-09-04  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for the Wayland build target
     4        https://bugs.webkit.org/show_bug.cgi?id=120627
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        Add support for building the GTK port with Wayland as the target. The Wayland target can be the sole target
     9        that's enabled, or it can be enabled in parallel with the X11 target.
     10
     11        Each of those two targets, when enabled, checks for the corresponding GTK+ windowing dependency being present.
     12        In the case of only the Wayland target being enabled, the accelerated compositing feature is disabled at
     13        build-time as the feature is not yet supported under the Wayland display protocol. X11-based plugin support is
     14        also disabled under that configuration, even if the WebKitPluginProcess is still built but is left non-operational.
     15        GLX support is also disabled if not building the X11 target.
     16
     17        The Wayland target can be enabled through using the --with-target configuration option that now accepts two
     18        additional values:
     19        - 'wayland' - only enables the Wayland target,
     20        - 'x11,wayland' - enables the X11 and Wayland targets that are to be built in parallel.
     21
     22        This makes it possible to build the GTK port of WebKit with the Wayland target, relying solely on the GTK+
     23        dependency that only has the Wayland backend enabled, and removes linking against any X11-related library.
     24        Note that at the moment there seem to be other dependencies that still link to X11-related libraries.
     25        Complete functionality is not yet guaranteed, but is of course the goal.
     26
     27        * Source/autotools/FindDependencies.m4: Store the version of the basic GTK+ dependency that was found.
     28        This is later used to check that the GTK+ X11 and GTK+ Wayland dependencies are of the same version. The
     29        X11-specific dependencies are grouped into one section (apart from the XComposite and XDamage dependencies),
     30        also checking for the GTK+ X11 dependency. If the X11 target is not enabled, the GLX dependency is disabled.
     31        Additionally check for the GTK+ Wayland dependency if the Wayland target is enabled.
     32        We only check for the presence and correct version of the GTK+ X11 and Wayland dependencies, if necessary.
     33        Check for the XComposite and XDamage dependencies if the X11 target is enabled (in addition to the OpenGL
     34        headers being present).
     35        In case of the Wayland target being enabled while the X11 target is not, disable the accelerated compositing
     36        feature as there's no support yet for it under the Wayland display protocol.
     37        * Source/autotools/PrintBuildConfiguration.m4: The build configuration should now print out 'GDK targets'.
     38        * Source/autotools/ReadCommandLineArguments.m4: The --with-target option can now take two additional values,
     39        'wayland' and 'x11,wayland'. The first one enables only the Wayland target, while the second one enables both
     40        X11 and Wayland targets. This makes it possible to build the GTK port with both X11 and Wayland display protocols
     41        supported in the same build.
     42        We must now check the outcoming with_target variable to see if the special case of building one or both of the
     43        possible parallel targets was chosen. We define with_x11_target and with_wayland_target variables if the
     44        with_target value applies to that case.
     45        * Source/autotools/SetupAutoconfHeader.m4: Do not define the XP_UNIX macro on builds that enable the Wayland-only
     46        target. It should still be defined if we're building both X11 and Wayland targets in parallel.
     47        * Source/autotools/SetupAutomake.m4: Define TARGET_X11 and TARGET_WAYLAND Automake conditionals if the new
     48        with_x11_target or with_wayland_target variables were set, respectively. Additionall, define the TARGET_X11_OR_WAYLAND
     49        Automake conditional if we're building either of the two targets.
     50
    1512013-09-03  Patrick Gansterer  <paroga@webkit.org>
    252
  • trunk/Source/WebCore/ChangeLog

    r155031 r155032  
     12013-09-04  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for the Wayland build target
     4        https://bugs.webkit.org/show_bug.cgi?id=120627
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        * GNUmakefile.list.am: Reorder the Source/WebCore/plugins/np* source files.
     9        The X11-specific source files should only be included if the X11 target is being built. PluginPackageNone and
     10        PluginViewNone source files must be included in non-X11-target builds. Other source files that were previously
     11        guarded with the TARGET_X11 conditional should also be built for the Wayland target, so the new TARGET_X11_OR_WAYLAND
     12        conditional is used. If neither of those two targets is being built we fall back to adding source files to the build
     13        as necessary by the actual build target.
     14        * platform/gtk/GtkVersioning.c:
     15        (gdk_screen_get_monitor_workarea): Additionally guard bits of code that depend on the GDK_WINDOWING_X11 macro being
     16        defined - these should only be built when building the X11 target, checked for with PLATFORM(X11).
     17
    1182013-09-04  Mario Sanchez Prada  <mario.prada@samsung.com>
    219
  • trunk/Source/WebCore/GNUmakefile.list.am

    r154965 r155032  
    42924292        Source/WebCore/page/WorkerNavigator.cpp \
    42934293        Source/WebCore/page/WorkerNavigator.h \
    4294         Source/WebCore/plugins/npapi.h \
    4295         Source/WebCore/plugins/npruntime.h \
    4296         Source/WebCore/plugins/nptypes.h \
    42974294        Source/WebCore/plugins/DOMMimeTypeArray.cpp \
    42984295        Source/WebCore/plugins/DOMMimeTypeArray.h \
     
    43034300        Source/WebCore/plugins/DOMPlugin.cpp \
    43044301        Source/WebCore/plugins/DOMPlugin.h \
    4305         Source/WebCore/plugins/npapi.cpp \
    4306         Source/WebCore/plugins/npfunctions.h \
    43074302        Source/WebCore/plugins/PluginDatabase.cpp \
    43084303        Source/WebCore/plugins/PluginDatabase.h \
     
    43224317        Source/WebCore/plugins/PluginView.cpp \
    43234318        Source/WebCore/plugins/PluginView.h \
     4319        Source/WebCore/plugins/npapi.cpp \
     4320        Source/WebCore/plugins/npapi.h \
     4321        Source/WebCore/plugins/npfunctions.h \
     4322        Source/WebCore/plugins/npruntime.h \
     4323        Source/WebCore/plugins/nptypes.h \
    43244324        Source/WebCore/rendering/AutoTableLayout.cpp \
    43254325        Source/WebCore/rendering/AutoTableLayout.h \
     
    62636263platformgtk_sources += \
    62646264        Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.h \
    6265         Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.cpp \
     6265        Source/WebCore/platform/gtk/WidgetBackingStoreGtkX11.cpp
     6266if USE_GLX
     6267webcoregtk_sources += \
     6268        Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \
     6269        Source/WebCore/platform/graphics/glx/GLContextGLX.h
     6270endif # END USE_GLX
     6271else
     6272webcore_sources += \
     6273        Source/WebCore/plugins/PluginPackageNone.cpp \
     6274        Source/WebCore/plugins/PluginViewNone.cpp
     6275endif # END TARGET_X11
     6276
     6277if TARGET_X11_OR_WAYLAND
     6278platformgtk_sources += \
    62666279        Source/WebCore/platform/cairo/WidgetBackingStoreCairo.h \
    62676280        Source/WebCore/platform/cairo/WidgetBackingStoreCairo.cpp
     
    62786291        Source/WebCore/platform/graphics/egl/GLContextEGL.h
    62796292endif # END USE_EGL
    6280 if USE_GLX
    6281 webcoregtk_sources += \
    6282         Source/WebCore/platform/graphics/glx/GLContextGLX.cpp \
    6283         Source/WebCore/platform/graphics/glx/GLContextGLX.h
    6284 endif # END USE_GLX
    62856293else
    62866294if TARGET_WIN32
     
    63116319        Source/WebCore/plugins/PluginViewNone.cpp
    63126320endif # END TARGET_WIN32
    6313 endif # END TARGET_X11
     6321endif # END TARGET_X11_OR_WAYLAND
    63146322
    63156323if USE_GLES2
  • trunk/Source/WebCore/platform/gtk/GtkVersioning.c

    r150189 r155032  
    2424#include <gtk/gtk.h>
    2525
    26 #ifdef GDK_WINDOWING_X11
     26#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    2727#include <X11/Xatom.h>
    2828#include <gdk/gdkx.h>
     
    201201}
    202202
    203 #ifdef GDK_WINDOWING_X11
     203#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    204204static int getScreenCurrentDesktop(GdkScreen *screen)
    205205{
     
    258258    XFree(returnedData);
    259259}
    260 #endif // GDK_WINDOWING_X11
     260#endif // PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    261261
    262262void gdk_screen_get_monitor_workarea(GdkScreen *screen, int monitor, GdkRectangle *area)
     
    264264    gdk_screen_get_monitor_geometry(screen, monitor, area);
    265265
    266 #ifdef GDK_WINDOWING_X11
     266#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    267267    GdkRectangle workArea;
    268268    getScreenWorkArea(screen, &workArea);
  • trunk/Source/WebKit/gtk/ChangeLog

    r154953 r155032  
     12013-09-04  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for the Wayland build target
     4        https://bugs.webkit.org/show_bug.cgi?id=120627
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        * WebCoreSupport/ChromeClientGtk.cpp:
     9        (WebKit::createBackingStore): Additionally guard the <gdk/gdkx.h> inclusion and the inclusion and use of
     10        WidgetBackingStoreGtkX11 with PLATFORM(X11), ensuring this code is built when also building with X11 target
     11        enabled. GDK_WINDOWING_X11 macro can be defined even if the X11 target is disabled.
     12
    1132013-09-02  Brian Holt  <brian.holt@samsung.com>
    214
  • trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r154877 r155032  
    7676#include <wtf/text/WTFString.h>
    7777
    78 #ifdef GDK_WINDOWING_X11
     78#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    7979#define Font XFont
    8080#define Cursor XCursor
     
    9696#endif
    9797
    98 #ifdef GDK_WINDOWING_X11
     98#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    9999#include "WidgetBackingStoreGtkX11.h"
    100100#endif
     
    107107static PassOwnPtr<WidgetBackingStore> createBackingStore(GtkWidget* widget, const IntSize& size)
    108108{
    109 #ifdef GDK_WINDOWING_X11
     109#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    110110    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
    111111    if (GDK_IS_X11_DISPLAY(display))
  • trunk/Source/WebKit2/ChangeLog

    r155017 r155032  
     12013-09-04  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for the Wayland build target
     4        https://bugs.webkit.org/show_bug.cgi?id=120627
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        * GNUmakefile.list.am: Build X11-specific NetscapePluginModule and NetscapePlugin classes if building the X11 target,
     9        fall back to the generic, empty classes otherwise.
     10        * PluginProcess/unix/PluginProcessMainUnix.cpp:
     11        (WebKit::PluginProcessMainUnix): Guard the NetscapePluginModule::scanPlugin() invocation with PLUGIN_ARCHITECTURE(X11),
     12        it's at the moment specific to the X11 implementation of the Netscape plugins.
     13        * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp: Guard PluginProcessProxy::scanPlugin() with PLUGIN_ARCHITECTURE(X11),
     14        just like it's guarded in the PluginProcessProxy class declaration.
     15        * UIProcess/cairo/BackingStoreCairo.cpp: Additionally guard <gdk/gdkx.h> and WidgetBackingStoreGtkX11 inclusion and use
     16        with PLATFORM(X11), this code should only be built when building the X11 target.
     17        (WebKit::createBackingStoreForGTK):
     18        * UIProcess/gtk/WebPageProxyGtk.cpp: Guard the createPluginContainer() and windowedPluginGeometryDidChange() methods and their
     19        helper functions and objects with PLUGIN_ARCHITECTURE(X11), just like they're guarded in the WebPageProxy class declaration.
     20        * config.h: Only define PLUGIN_ARCHITECTURE_X11 to 1 if we're actually building the X11 target.
     21
    1222013-09-03  Darin Adler  <darin@apple.com>
    223
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r154603 r155032  
    446446        Source/WebKit2/Shared/Plugins/Netscape/PluginInformation.cpp \
    447447        Source/WebKit2/Shared/Plugins/Netscape/PluginInformation.h \
    448         Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
    449448        Source/WebKit2/Shared/Plugins/NPIdentifierData.cpp \
    450449        Source/WebKit2/Shared/Plugins/NPIdentifierData.h \
     
    11421141        Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h \
    11431142        Source/WebKit2/WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp \
    1144         Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
    11451143        Source/WebKit2/WebProcess/Plugins/PluginController.h \
    11461144        Source/WebKit2/WebProcess/Plugins/Plugin.cpp \
     
    12621260        Source/WebKit2/WebProcess/WebProcess.h
    12631261
     1262if TARGET_X11
     1263webkit2_sources += \
     1264        Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
     1265        Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
     1266else
     1267webkit2_sources += \
     1268        Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
     1269        Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
     1270endif # END TARGET_X11
     1271
    12641272if USE_TEXTURE_MAPPER_GL
    12651273webkit2_sources += \
     
    13141322        Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp \
    13151323        Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h \
    1316         Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
    13171324        Source/WebKit2/Shared/ShareableBitmap.cpp \
    13181325        Source/WebKit2/Shared/ShareableBitmap.h \
     
    13481355        Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp \
    13491356        Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h \
    1350         Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp \
    13511357        Source/WebKit2/unix/PluginMainUnix.cpp
     1358
     1359if TARGET_X11
     1360webkit2_plugin_process_sources += \
     1361        Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
     1362        Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
     1363else
     1364webkit2_plugin_process_sources += \
     1365        Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModuleNone.cpp \
     1366        Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginNone.cpp
     1367endif # END TARGET_X11
  • trunk/Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp

    r148519 r155032  
    3737#include <WebCore/RunLoop.h>
    3838#if PLATFORM(GTK)
     39#include <gtk/gtk.h>
     40#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    3941#include <gdk/gdkx.h>
    40 #include <gtk/gtk.h>
     42#endif
    4143#elif PLATFORM(EFL) && HAVE_ECORE_X
    4244#include <Ecore_X.h>
     
    7476WK_EXPORT int PluginProcessMainUnix(int argc, char* argv[])
    7577{
     78#if PLUGIN_ARCHITECTURE(X11)
    7679    bool scanPlugin = !strcmp(argv[1], "-scanPlugin");
     80#endif
    7781    ASSERT_UNUSED(argc, argc == 3);
    7882
     
    8892    InitializeWebKit2();
    8993
     94#if PLUGIN_ARCHITECTURE(X11)
    9095    if (scanPlugin) {
    9196        String pluginPath(argv[2]);
     
    9499        return EXIT_SUCCESS;
    95100    }
     101#endif
    96102
    97103    // Plugins can produce X errors that are handled by the GDK X error handler, which
  • trunk/Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp

    r152575 r155032  
    6060}
    6161
     62#if PLUGIN_ARCHITECTURE(X11)
    6263bool PluginProcessProxy::scanPlugin(const String& pluginPath, RawPluginMetaData& result)
    6364{
     
    108109#endif // PLATFORM(GTK) || PLATFORM(EFL)
    109110}
     111#endif // PLUGIN_ARCHITECTURE(X11)
    110112
    111113} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/cairo/BackingStoreCairo.cpp

    r152094 r155032  
    3535#include <cairo.h>
    3636
    37 #if PLATFORM(GTK) && defined(GDK_WINDOWING_X11)
     37#if PLATFORM(GTK) && PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    3838#include <WebCore/WidgetBackingStoreGtkX11.h>
    3939#include <gdk/gdkx.h>
     
    5151static OwnPtr<WidgetBackingStore> createBackingStoreForGTK(GtkWidget* widget, const IntSize& size)
    5252{
    53 #ifdef GDK_WINDOWING_X11
     53#if PLATFORM(X11) && defined(GDK_WINDOWING_X11)
    5454    GdkDisplay* display = gdk_display_manager_get_default_display(gdk_display_manager_get());
    5555    if (GDK_IS_X11_DISPLAY(display))
  • trunk/Source/WebKit2/UIProcess/gtk/WebPageProxyGtk.cpp

    r152627 r155032  
    7272}
    7373
     74#if PLUGIN_ARCHITECTURE(X11)
    7475typedef HashMap<uint64_t, GtkWidget* > PluginWindowMap;
    7576static PluginWindowMap& pluginWindowMap()
     
    112113    webkitWebViewBaseChildMoveResize(WEBKIT_WEB_VIEW_BASE(viewWidget()), plugin, frameRect);
    113114}
     115#endif // PLUGIN_ARCHITECTURE(X11)
    114116
    115117void WebPageProxy::setInputMethodState(bool enabled)
  • trunk/Source/WebKit2/config.h

    r150460 r155032  
    103103#if PLATFORM(MAC)
    104104#define PLUGIN_ARCHITECTURE_MAC 1
    105 #elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X))
     105#elif (PLATFORM(GTK) || PLATFORM(EFL)) && (OS(UNIX) && !OS(MAC_OS_X)) && PLATFORM(X11)
    106106#define PLUGIN_ARCHITECTURE_X11 1
    107107#elif PLATFORM(QT)
  • trunk/Source/autotools/FindDependencies.m4

    r154747 r155032  
    166166    PKG_CHECK_MODULES(CAIRO, cairo >= cairo_required_version)
    167167    PKG_CHECK_MODULES(GTK, gtk+-$GTK_API_VERSION >= $GTK_REQUIRED_VERSION)
    168 
    169     if test "$with_target" = "x11" && test "$os_win32" = "no"; then
     168    GTK_ACTUAL_VERSION=`pkg-config --modversion gtk+-$GTK_API_VERSION`
     169fi
     170AC_SUBST(GTK_CFLAGS)
     171AC_SUBST(GTK_LIBS)
     172AC_SUBST(CAIRO_CFLAGS)
     173AC_SUBST(CAIRO_LIBS)
     174
     175if test "$with_x11_target" = "yes"; then
     176    # The GTK+ X11 target dependency should match the version of the master GTK+ dependency.
     177    PKG_CHECK_MODULES(GTK_X11, gtk+-x11-$GTK_API_VERSION = $GTK_ACTUAL_VERSION)
     178
     179    if test "$os_win32" = "no"; then
    170180        PKG_CHECK_MODULES([XT], [xt], [xt_has_pkg_config=yes], [xt_has_pkg_config=no])
    171181
     
    181191        AC_SUBST([XT_CFLAGS])
    182192        AC_SUBST([XT_LIBS])
    183    fi
    184 fi
    185 AC_SUBST(GTK_CFLAGS)
    186 AC_SUBST(GTK_LIBS)
    187 AC_SUBST(CAIRO_CFLAGS)
    188 AC_SUBST(CAIRO_LIBS)
     193    fi
     194
     195    # Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
     196    # so we cannot rely on GTK+ pulling XRender.
     197    if test "$with_x11_target" = "yes"; then
     198        PKG_CHECK_MODULES([XRENDER], [xrender])
     199        AC_SUBST([XRENDER_CFLAGS])
     200        AC_SUBST([XRENDER_LIBS])
     201    fi
     202elif test "enable_glx" != "no"; then
     203    AC_MSG_WARN([X11 target support not enabled, disabling GLX support.])
     204    enable_glx=no
     205fi
     206
     207if test "$with_wayland_target" = "yes"; then
     208    # The GTK+ Wayland target dependency should match the version of the master GTK+ dependency.
     209    PKG_CHECK_MODULES(GTK_WAYLAND, gtk+-wayland-$GTK_API_VERSION = $GTK_ACTUAL_VERSION)
     210fi
    189211
    190212AC_CHECK_HEADERS([GL/glx.h], [have_glx="yes"], [have_glx="no"])
     
    254276fi
    255277
    256 if test "$found_opengl" = "yes"; then
    257     PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite]);
    258     PKG_CHECK_MODULES([XDAMAGE], [xdamage]);
     278if test "$with_x11_target" = "yes" && test "$found_opengl" = "yes"; then
     279    PKG_CHECK_MODULES([XCOMPOSITE], [xcomposite])
     280    PKG_CHECK_MODULES([XDAMAGE], [xdamage])
    259281    AC_SUBST(XCOMPOSITE_CFLAGS)
    260282    AC_SUBST(XCOMPOSITE_LIBS)
     
    272294        enable_webgl=no
    273295    fi
     296fi
     297
     298if test "$with_x11_target" != "yes" && test "$with_wayland_target" = "yes" && test "enable_accelerated_compositing" != "no"; then
     299    AC_MSG_WARN([Accelerated compositing for Wayland is not yet implemented, disabling due to the Wayland-only target.])
     300    enable_accelerated_compositing=no
    274301fi
    275302
     
    386413    AC_SUBST([GEOCLUE_CFLAGS])
    387414    AC_SUBST([GEOCLUE_LIBS])
    388 fi
    389 
    390 # Check for XRender under Linux/Unix. Some linkers require explicit linkage (like GNU Gold),
    391 # so we cannot rely on GTK+ pulling XRender.
    392 if test "$with_target" = "x11"; then
    393     PKG_CHECK_MODULES([XRENDER], [xrender])
    394     AC_SUBST([XRENDER_CFLAGS])
    395     AC_SUBST([XRENDER_LIBS])
    396415fi
    397416
  • trunk/Source/autotools/PrintBuildConfiguration.m4

    r154747 r155032  
    3535GTK+ configuration:
    3636 GTK+ version                                             : $with_gtk
    37  GDK target                                               : $with_target
     37 GDK targets                                              : $with_target
    3838 Introspection support                                    : $enable_introspection
    3939 Generate documentation                                   : $enable_gtk_doc
  • trunk/Source/autotools/ReadCommandLineArguments.m4

    r154747 r155032  
    4848AC_MSG_CHECKING([the target windowing system])
    4949AC_ARG_WITH(target,
    50     AC_HELP_STRING([--with-target=@<:@x11/win32/quartz/directfb@:>@], [Select webkit target [default=x11]]),
     50    AC_HELP_STRING([--with-target=@<:@x11/wayland/x11,wayland/win32/quartz/directfb@:>@], [Select webkit target [default=x11]]),
    5151    [
    5252        case "$with_target" in
    53             x11|win32|quartz|directfb) ;;
    54             *) AC_MSG_ERROR([Invalid target: must be x11, quartz, win32, or directfb.]) ;;
     53            x11|wayland|x11,wayland|win32|quartz|directfb) ;;
     54            *) AC_MSG_ERROR([Invalid target: must be x11, wayland, both x11 and wayland (x11,wayland), quartz, win32, or directfb.]) ;;
    5555        esac
    5656    ],
    5757    [with_target="x11"])
    5858AC_MSG_RESULT([$with_target])
     59
     60# To support building for X11 and Wayland targets concurrently, the $with_target value is checked for this
     61# special case and two additional variables are introduced that denote specifically whether we're building
     62# the X11 target, the Wayland target, both of these or neither.
     63if test "$with_target" = "x11,wayland"; then
     64    with_x11_target=yes
     65    with_wayland_target=yes
     66elif test "$with_target" = "x11"; then
     67    with_x11_target=yes
     68    with_wayland_target=no
     69elif test "$with_target" = "wayland"; then
     70    with_x11_target=no
     71    with_wayland_target=yes
     72else
     73    with_x11_target=no
     74    with_wayland_target=no
     75fi
    5976
    6077AC_MSG_CHECKING([whether to enable spellcheck support])
  • trunk/Source/autotools/SetupAutoconfHeader.m4

    r154747 r155032  
    3737    AC_DEFINE([UNICODE], [1], [ ])
    3838    AC_DEFINE([_UNICODE], [1], [ ])
    39 else
     39elif test "$with_x11_target" = "yes" || test "$with_wayland_target" != "yes"; then
    4040    AC_DEFINE([XP_UNIX], [1], [ ])
    4141fi
    4242
    43 if test "$with_target" = "x11"; then
     43if test "$with_x11_target" = "yes"; then
    4444    AC_DEFINE([MOZ_X11], [1], [ ])
    4545    AC_DEFINE([WTF_PLATFORM_X11], [1], [Define if target is X11])
     46fi
     47
     48if test "$with_wayland_target" = "yes"; then
     49    AC_DEFINE([WTF_PLATFORM_WAYLAND], [1], [Define if target is Wayland])
    4650fi
    4751
  • trunk/Source/autotools/SetupAutomake.m4

    r153885 r155032  
    2424
    2525# Target conditionals.
    26 AM_CONDITIONAL([TARGET_X11], [test "$with_target" = "x11"])
     26AM_CONDITIONAL([TARGET_X11], [test "$with_x11_target" = "yes"])
     27AM_CONDITIONAL([TARGET_WAYLAND], [test "$with_wayland_target" = "yes"])
     28AM_CONDITIONAL([TARGET_X11_OR_WAYLAND], [test "$with_x11_target" = "yes" || test "$with_wayland_target" = "yes"])
    2729AM_CONDITIONAL([TARGET_WIN32], [test "$with_target" = "win32"])
    2830AM_CONDITIONAL([TARGET_QUARTZ], [test "$with_target" = "quartz"])
  • trunk/Tools/ChangeLog

    r155024 r155032  
     12013-09-04  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [GTK] Add support for the Wayland build target
     4        https://bugs.webkit.org/show_bug.cgi?id=120627
     5
     6        Reviewed by Gustavo Noronha Silva.
     7
     8        * GNUmakefile.am: Define the additional macros also if building the Wayland target.
     9
    1102013-09-04  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
    211
  • trunk/Tools/GNUmakefile.am

    r154697 r155032  
    123123        $(webcore_cppflags)
    124124
    125 if TARGET_X11
     125if TARGET_X11_OR_WAYLAND
    126126Programs_DumpRenderTree_CPPFLAGS += \
    127127        -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
Note: See TracChangeset for help on using the changeset viewer.