--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -112,18 +112,18 @@ set_config('L10NBASEDIR', l10n_base)
# Default toolkit
# ==============================================================
# Normally, we'd want to use the `default` field on the option, but that
# requires --target to be resolved at --help time, which requires to run
# config.guess, which we want to avoid. Even better, we could actually set
# `choices` depending on the target, but that doesn't pan out for the same
# reason.
option('--enable-default-toolkit', nargs=1,
- choices=('cairo-windows', 'cairo-gtk3', 'cairo-cocoa', 'cairo-uikit',
- 'cairo-android', 'cairo-gonk'),
+ choices=('cairo-windows', 'cairo-gtk3', 'cairo-gtk3-wayland',
+ 'cairo-cocoa', 'cairo-uikit', 'cairo-android', 'cairo-gonk'),
help='Select default toolkit')
@depends('--enable-default-toolkit', target)
def toolkit(value, target):
# Define possible choices for each platform. The default is the first one
# listed when there are several.
os = target.os
if target.os == 'WINNT':
@@ -135,31 +135,36 @@ def toolkit(value, target):
elif target.os == 'Android':
if value.origin == 'implied':
# Trust values coming from imply_option() (used in
# b2g/moz.configure).
platform_choices = tuple(value)
else:
platform_choices = ('cairo-android',)
else:
- platform_choices = ('cairo-gtk3',)
+ platform_choices = ('cairo-gtk3', 'cairo-gtk3-wayland')
if value:
if value[0] not in platform_choices:
die('`%s` is not a valid value for --enable-default-toolkit on %s\n'
'Valid values: %s', value[0], os, ', '.join(platform_choices))
return value[0]
return platform_choices[0]
+@depends(toolkit)
+def wayland(toolkit):
+ return toolkit == 'cairo-gtk3-wayland'
@depends(toolkit)
def toolkit(toolkit):
if toolkit == 'cairo-gtk2-x11':
widget_toolkit = 'gtk2'
+ elif toolkit == 'cairo-gtk3-wayland' :
+ widget_toolkit = 'gtk3'
else:
widget_toolkit = toolkit.replace('cairo-', '')
return widget_toolkit
set_config('MOZ_WIDGET_TOOLKIT', toolkit)
add_old_configure_assignment('MOZ_WIDGET_TOOLKIT', toolkit)
@depends(toolkit)
@@ -194,16 +199,24 @@ def x11(value, toolkit):
return True if value and toolkit in x11_toolkits else None
set_config('MOZ_ENABLE_XREMOTE', x11)
set_define('MOZ_ENABLE_XREMOTE', x11)
set_config('MOZ_X11', x11)
set_define('MOZ_X11', x11)
add_old_configure_assignment('MOZ_X11', x11)
+# Wayland support
+# ==============================================================
+wayland_headers = pkg_check_modules('MOZ_WAYLAND', 'gtk+-wayland-3.0 >= 3.22',
+ when=wayland)
+
+set_config('MOZ_WAYLAND', depends_if(wayland_headers)(lambda _: True))
+set_define('MOZ_WAYLAND', depends_if(wayland_headers)(lambda _: True))
+
# GL Provider
# ==============================================================
option('--with-gl-provider', nargs=1, help='Set GL provider backend type')
@depends('--with-gl-provider')
def gl_provider(value):
if value:
return value[0]