2016-07-14 16:16:42 +00:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2016-03-08 04:49:35 +00:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2016-03-09 06:59:39 +00:00
|
|
|
|
2016-03-17 06:56:23 +00:00
|
|
|
|
|
|
|
# Profiling
|
|
|
|
# ==============================================================
|
|
|
|
# Some of the options here imply an option from js/moz.configure,
|
|
|
|
# so, need to be declared before the include.
|
|
|
|
|
2016-03-17 07:05:10 +00:00
|
|
|
option('--enable-jprof', env='MOZ_JPROF',
|
|
|
|
help='Enable jprof profiling tool (needs mozilla/tools/jprof)')
|
|
|
|
|
|
|
|
@depends('--enable-jprof')
|
|
|
|
def jprof(value):
|
|
|
|
if value:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
2016-03-17 07:05:10 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_JPROF', jprof)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_JPROF', jprof)
|
2016-03-23 05:18:57 +00:00
|
|
|
imply_option('--enable-profiling', jprof)
|
2016-03-17 07:05:10 +00:00
|
|
|
|
2016-03-17 07:08:53 +00:00
|
|
|
@depends(target)
|
2017-01-24 22:08:15 +00:00
|
|
|
def gecko_profiler(target):
|
2016-03-17 07:08:53 +00:00
|
|
|
if target.os == 'Android':
|
2017-05-03 15:36:18 +00:00
|
|
|
return target.cpu in ('aarch64', 'arm', 'x86')
|
2016-03-17 07:08:53 +00:00
|
|
|
elif target.kernel == 'Linux':
|
|
|
|
return target.cpu in ('x86', 'x86_64')
|
|
|
|
return target.os in ('OSX', 'WINNT')
|
|
|
|
|
2017-01-24 22:08:15 +00:00
|
|
|
@depends(gecko_profiler)
|
|
|
|
def gecko_profiler_define(value):
|
2016-03-17 07:08:53 +00:00
|
|
|
if value:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
|
|
|
|
2017-01-24 22:08:15 +00:00
|
|
|
set_config('MOZ_GECKO_PROFILER', gecko_profiler_define)
|
|
|
|
set_define('MOZ_GECKO_PROFILER', gecko_profiler_define)
|
2016-03-17 07:08:53 +00:00
|
|
|
|
|
|
|
|
2016-03-17 07:22:18 +00:00
|
|
|
option('--enable-dmd', env='MOZ_DMD',
|
|
|
|
help='Enable Dark Matter Detector (heap profiler). '
|
|
|
|
'Also enables jemalloc, replace-malloc and profiling')
|
|
|
|
|
|
|
|
@depends('--enable-dmd')
|
|
|
|
def dmd(value):
|
|
|
|
if value:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
2016-03-17 07:22:18 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_DMD', dmd)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_DMD', dmd)
|
2016-03-23 07:34:59 +00:00
|
|
|
add_old_configure_assignment('MOZ_DMD', dmd)
|
2016-03-23 05:18:57 +00:00
|
|
|
imply_option('--enable-profiling', dmd)
|
2017-05-11 04:16:00 +00:00
|
|
|
imply_option('--enable-jemalloc', dmd)
|
2016-04-14 09:55:01 +00:00
|
|
|
imply_option('--enable-replace-malloc', dmd)
|
2016-03-17 07:22:18 +00:00
|
|
|
|
2016-07-18 11:28:39 +00:00
|
|
|
# JACK cubeb backend
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-jack', env='MOZ_JACK',
|
|
|
|
help='Enable JACK audio backend.')
|
|
|
|
|
|
|
|
@depends('--enable-jack')
|
|
|
|
def jack(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_JACK', jack)
|
|
|
|
set_define('MOZ_JACK', jack)
|
|
|
|
|
2016-03-17 06:56:23 +00:00
|
|
|
# Javascript engine
|
|
|
|
# ==============================================================
|
2016-03-09 06:59:39 +00:00
|
|
|
include('../js/moz.configure')
|
2016-03-16 04:10:54 +00:00
|
|
|
|
|
|
|
|
2016-12-15 21:40:06 +00:00
|
|
|
# Rust
|
|
|
|
# ==============================================================
|
|
|
|
include('../build/moz.configure/rust.configure',
|
|
|
|
when='--enable-compile-environment')
|
|
|
|
|
|
|
|
|
2016-03-16 23:38:52 +00:00
|
|
|
# L10N
|
|
|
|
# ==============================================================
|
|
|
|
option('--with-l10n-base', nargs=1, env='L10NBASEDIR',
|
|
|
|
help='Path to l10n repositories')
|
|
|
|
|
|
|
|
@depends('--with-l10n-base')
|
2016-11-03 21:50:43 +00:00
|
|
|
@imports(_from='os.path', _import='isdir')
|
bug 1370506, for Nightly builds, automatically clone l10n repos for localized installers, r=glandium
Making more decisions on behalf of developers:
L10NBASEDIR is always defined, if not specified, it's ~/.mozbuild/l10n-central,
or in MOZBUILD_STATE_PATH/l10n-central if the state path in defined in the
environment.
If a locale isn't checked out, do that. The targets for which that works are
merge-%, installers-%, langpack-%
But only do that for Nightly builds, as for Beta and beyond, we have
explicit revisions to use for the builds, and we don't want to break release
builds silently with this.
MozReview-Commit-ID: EhGJPLuiyYO
--HG--
extra : rebase_source : 61a92396920965107a8811679552c1992b29155e
2017-06-15 17:47:28 +00:00
|
|
|
@imports(_from='os.path', _import='expanduser')
|
|
|
|
@imports(_from='os', _import='environ')
|
2016-03-16 23:38:52 +00:00
|
|
|
def l10n_base(value):
|
|
|
|
if value:
|
|
|
|
path = value[0]
|
2016-11-03 21:50:43 +00:00
|
|
|
if not isdir(path):
|
2016-03-25 06:48:21 +00:00
|
|
|
die("Invalid value --with-l10n-base, %s doesn't exist", path)
|
bug 1370506, for Nightly builds, automatically clone l10n repos for localized installers, r=glandium
Making more decisions on behalf of developers:
L10NBASEDIR is always defined, if not specified, it's ~/.mozbuild/l10n-central,
or in MOZBUILD_STATE_PATH/l10n-central if the state path in defined in the
environment.
If a locale isn't checked out, do that. The targets for which that works are
merge-%, installers-%, langpack-%
But only do that for Nightly builds, as for Beta and beyond, we have
explicit revisions to use for the builds, and we don't want to break release
builds silently with this.
MozReview-Commit-ID: EhGJPLuiyYO
--HG--
extra : rebase_source : 61a92396920965107a8811679552c1992b29155e
2017-06-15 17:47:28 +00:00
|
|
|
else:
|
|
|
|
path = os.path.join(
|
|
|
|
environ.get(
|
|
|
|
'MOZBUILD_STATE_PATH',
|
|
|
|
expanduser(os.path.join('~', '.mozbuild'))),
|
|
|
|
'l10n-central')
|
|
|
|
return os.path.realpath(os.path.abspath(path))
|
2016-03-16 23:38:52 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('L10NBASEDIR', l10n_base)
|
2016-03-16 23:38:52 +00:00
|
|
|
|
|
|
|
|
2016-03-16 04:10:54 +00:00
|
|
|
# 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,
|
2017-04-06 08:40:27 +00:00
|
|
|
choices=('cairo-windows', 'cairo-gtk3', 'cairo-gtk3-wayland',
|
2017-04-18 07:56:09 +00:00
|
|
|
'cairo-cocoa', 'cairo-uikit', 'cairo-android'),
|
2016-03-16 04:10:54 +00:00
|
|
|
help='Select default toolkit')
|
|
|
|
|
Bug 1344038 - Move the gio protocol handler under netwerk/protocol. r=chmanchester,karlt
Historically, we had support for some GNOME VFS protocols through the
gnomevfs library, and this was under extension. This may not have been
built by default when it was introduced, but GNOME upstream moved those
things into Gtk itself, and we then got support for the new Gio-based
protocol, similar to what we had through the gnomevfs library.
Time passes, and we switched off the gnomevfs library entirely, and
enabled the Gio-based protocol handlers by default. We then removed
everything related to the gnomevfs library.
Fast forward to now, and disabling Gio support in Firefox just doesn't
make sense, and leaving the gio protocol handler as an extension doesn't
make sense either.
As it is a protocol handler, its natural place is under
netwerk/protocol, which is where we're moving it here.
The netwerk/protocol subdirectories being handled automatically, we
don't need to add the moved directory in any DIRS variable.
--HG--
rename : extensions/gio/moz.build => netwerk/protocol/gio/moz.build
rename : extensions/gio/nsGIOProtocolHandler.cpp => netwerk/protocol/gio/nsGIOProtocolHandler.cpp
extra : rebase_source : 071a9cb1769f013717357458df24e2fd9570ccf4
2017-04-05 04:48:52 +00:00
|
|
|
@depends('--enable-default-toolkit', target, '--help')
|
|
|
|
def toolkit(value, target, _):
|
2016-03-16 04:10:54 +00:00
|
|
|
# Define possible choices for each platform. The default is the first one
|
|
|
|
# listed when there are several.
|
|
|
|
os = target.os
|
|
|
|
if target.os == 'WINNT':
|
|
|
|
platform_choices = ('cairo-windows',)
|
|
|
|
elif target.os == 'OSX':
|
|
|
|
platform_choices = ('cairo-cocoa',)
|
|
|
|
elif target.os == 'iOS':
|
|
|
|
platform_choices = ('cairo-uikit',)
|
|
|
|
elif target.os == 'Android':
|
2016-04-02 00:55:34 +00:00
|
|
|
if value.origin == 'implied':
|
|
|
|
# Trust values coming from imply_option() (used in
|
|
|
|
# b2g/moz.configure).
|
|
|
|
platform_choices = tuple(value)
|
2016-03-16 04:10:54 +00:00
|
|
|
else:
|
|
|
|
platform_choices = ('cairo-android',)
|
|
|
|
else:
|
2017-04-06 08:40:27 +00:00
|
|
|
platform_choices = ('cairo-gtk3', 'cairo-gtk3-wayland')
|
2016-03-16 04:10:54 +00:00
|
|
|
|
|
|
|
if value:
|
|
|
|
if value[0] not in platform_choices:
|
2016-03-25 06:48:21 +00:00
|
|
|
die('`%s` is not a valid value for --enable-default-toolkit on %s\n'
|
|
|
|
'Valid values: %s', value[0], os, ', '.join(platform_choices))
|
2016-03-16 04:10:54 +00:00
|
|
|
return value[0]
|
|
|
|
|
|
|
|
return platform_choices[0]
|
|
|
|
|
2017-04-06 08:40:27 +00:00
|
|
|
@depends(toolkit)
|
|
|
|
def wayland(toolkit):
|
|
|
|
return toolkit == 'cairo-gtk3-wayland'
|
2016-03-16 04:10:54 +00:00
|
|
|
|
|
|
|
@depends(toolkit)
|
|
|
|
def toolkit(toolkit):
|
|
|
|
if toolkit == 'cairo-gtk2-x11':
|
|
|
|
widget_toolkit = 'gtk2'
|
2017-04-06 08:40:27 +00:00
|
|
|
elif toolkit == 'cairo-gtk3-wayland' :
|
|
|
|
widget_toolkit = 'gtk3'
|
2016-03-16 04:10:54 +00:00
|
|
|
else:
|
|
|
|
widget_toolkit = toolkit.replace('cairo-', '')
|
|
|
|
return widget_toolkit
|
2016-03-16 05:56:24 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_WIDGET_TOOLKIT', toolkit)
|
2016-03-23 07:34:59 +00:00
|
|
|
add_old_configure_assignment('MOZ_WIDGET_TOOLKIT', toolkit)
|
2016-03-22 05:21:32 +00:00
|
|
|
|
2016-03-23 01:22:08 +00:00
|
|
|
@depends(toolkit)
|
|
|
|
def toolkit_gtk(toolkit):
|
|
|
|
if toolkit == 'gtk2':
|
|
|
|
return '2'
|
|
|
|
elif toolkit == 'gtk3':
|
|
|
|
return '3'
|
|
|
|
|
|
|
|
set_define('MOZ_WIDGET_GTK', toolkit_gtk)
|
|
|
|
|
|
|
|
@depends(toolkit)
|
|
|
|
def toolkit_define(toolkit):
|
|
|
|
if toolkit not in ('gtk2', 'gtk3', 'windows'):
|
|
|
|
return 'MOZ_WIDGET_%s' % toolkit.upper()
|
|
|
|
|
|
|
|
set_define(toolkit_define, True)
|
|
|
|
|
2016-03-16 05:56:24 +00:00
|
|
|
|
|
|
|
option('--without-x', env='WITHOUT_X', help='Disable X11 support')
|
|
|
|
|
|
|
|
@depends('--without-x', toolkit)
|
|
|
|
def x11(value, toolkit):
|
2016-07-07 16:14:25 +00:00
|
|
|
if not value:
|
|
|
|
die('--without-x is not supported')
|
2016-03-16 05:56:24 +00:00
|
|
|
|
2016-07-07 16:14:25 +00:00
|
|
|
x11_toolkits = ('gtk2', 'gtk3')
|
2016-03-16 05:56:24 +00:00
|
|
|
if value and value.origin != 'default' and toolkit not in x11_toolkits:
|
2016-03-25 06:48:21 +00:00
|
|
|
die('--with-x is only valid with --enable-default-toolkit={%s}',
|
|
|
|
','.join(x11_toolkits))
|
2016-03-16 05:56:24 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
return True if value and toolkit in x11_toolkits else None
|
2016-03-16 06:14:20 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_ENABLE_XREMOTE', x11)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_ENABLE_XREMOTE', x11)
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_X11', x11)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_X11', x11)
|
2016-03-23 07:34:59 +00:00
|
|
|
add_old_configure_assignment('MOZ_X11', x11)
|
2016-03-16 06:14:20 +00:00
|
|
|
|
2017-04-06 08:40:27 +00:00
|
|
|
# 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))
|
|
|
|
|
2016-03-16 06:14:20 +00:00
|
|
|
# GL Provider
|
|
|
|
# ==============================================================
|
|
|
|
option('--with-gl-provider', nargs=1, help='Set GL provider backend type')
|
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
@depends('--with-gl-provider')
|
|
|
|
def gl_provider(value):
|
2016-03-16 06:14:20 +00:00
|
|
|
if value:
|
2016-03-23 01:22:08 +00:00
|
|
|
return value[0]
|
|
|
|
|
|
|
|
@depends(gl_provider)
|
|
|
|
def gl_provider_define(provider):
|
|
|
|
if provider:
|
|
|
|
return 'GLContextProvider%s' % provider
|
|
|
|
|
|
|
|
set_define('MOZ_GL_PROVIDER', gl_provider_define)
|
2016-03-22 05:21:32 +00:00
|
|
|
|
|
|
|
@depends(gl_provider, x11)
|
|
|
|
def gl_default_provider(value, x11):
|
|
|
|
if value:
|
|
|
|
return value
|
2016-03-16 06:14:20 +00:00
|
|
|
elif x11:
|
2016-03-22 05:21:32 +00:00
|
|
|
return 'GLX'
|
2016-03-16 07:10:40 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_GL_PROVIDER', gl_provider)
|
|
|
|
set_config('MOZ_GL_DEFAULT_PROVIDER', gl_default_provider)
|
2016-03-16 07:10:40 +00:00
|
|
|
|
2016-03-23 01:22:08 +00:00
|
|
|
@depends(gl_default_provider)
|
|
|
|
def gl_provider_define(provider):
|
|
|
|
if provider:
|
|
|
|
return 'GL_PROVIDER_%s' % provider
|
|
|
|
|
|
|
|
set_define(gl_provider_define, True)
|
|
|
|
|
|
|
|
|
2016-03-16 07:10:40 +00:00
|
|
|
# PDF printing
|
|
|
|
# ==============================================================
|
|
|
|
@depends(toolkit)
|
|
|
|
def pdf_printing(toolkit):
|
2017-04-18 07:56:09 +00:00
|
|
|
if toolkit in ('windows', 'gtk2', 'gtk3', 'android'):
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
@depends(pdf_printing)
|
|
|
|
def pdf_surface_feature(pdf_printing):
|
|
|
|
if pdf_printing:
|
|
|
|
return '#define CAIRO_HAS_PDF_SURFACE 1'
|
2016-03-16 07:10:40 +00:00
|
|
|
else:
|
|
|
|
# CONFIGURE_SUBST_FILES need explicit empty values.
|
2016-03-22 05:21:32 +00:00
|
|
|
return ''
|
|
|
|
|
|
|
|
set_config('MOZ_PDF_PRINTING', pdf_printing)
|
|
|
|
set_config('PDF_SURFACE_FEATURE', pdf_surface_feature)
|
2016-03-16 07:19:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Event loop instrumentation
|
|
|
|
# ==============================================================
|
|
|
|
option(env='MOZ_INSTRUMENT_EVENT_LOOP',
|
|
|
|
help='Force-enable event loop instrumentation')
|
|
|
|
|
|
|
|
@depends('MOZ_INSTRUMENT_EVENT_LOOP', toolkit)
|
|
|
|
def instrument_event_loop(value, toolkit):
|
2017-04-18 07:56:09 +00:00
|
|
|
if value or (toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa', 'android') and
|
|
|
|
value.origin == 'default'):
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
|
2016-03-16 07:23:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Fontconfig Freetype
|
|
|
|
# ==============================================================
|
|
|
|
option(env='USE_FC_FREETYPE',
|
|
|
|
help='Force-enable the use of fontconfig freetype')
|
|
|
|
|
|
|
|
@depends('USE_FC_FREETYPE', toolkit)
|
|
|
|
def fc_freetype(value, toolkit):
|
2016-07-07 16:14:25 +00:00
|
|
|
if value or (toolkit in ('gtk2', 'gtk3') and
|
2016-03-16 07:23:30 +00:00
|
|
|
value.origin == 'default'):
|
2016-03-23 07:34:59 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
add_old_configure_assignment('USE_FC_FREETYPE', fc_freetype)
|
2016-03-16 08:37:42 +00:00
|
|
|
|
2016-10-14 18:06:30 +00:00
|
|
|
# Pango
|
|
|
|
# ==============================================================
|
|
|
|
pkg_check_modules('MOZ_PANGO',
|
|
|
|
'pango >= 1.22.0 pangoft2 >= 1.22.0 pangocairo >= 1.22.0',
|
|
|
|
when=toolkit_gtk)
|
2016-03-16 08:37:42 +00:00
|
|
|
|
2016-10-14 18:06:31 +00:00
|
|
|
# Fontconfig
|
|
|
|
# ==============================================================
|
|
|
|
fontconfig_info = pkg_check_modules('_FONTCONFIG', 'fontconfig >= 2.7.0',
|
|
|
|
when=fc_freetype)
|
|
|
|
|
2016-10-14 18:06:31 +00:00
|
|
|
@depends(fc_freetype)
|
|
|
|
def check_for_freetype2(fc_freetype):
|
|
|
|
if fc_freetype:
|
|
|
|
return True
|
|
|
|
|
|
|
|
# Check for freetype2. Flags are combined with fontconfig flags.
|
|
|
|
freetype2_info = pkg_check_modules('_FT2', 'freetype2 >= 6.1.0',
|
|
|
|
when=check_for_freetype2)
|
|
|
|
|
|
|
|
@depends(fontconfig_info, freetype2_info)
|
|
|
|
def freetype2_combined_info(fontconfig_info, freetype2_info):
|
|
|
|
if not freetype2_info:
|
|
|
|
return
|
|
|
|
if not fontconfig_info:
|
|
|
|
return freetype2_info
|
|
|
|
return namespace(
|
|
|
|
cflags=freetype2_info.cflags + fontconfig_info.cflags,
|
|
|
|
libs=freetype2_info.libs + fontconfig_info.libs,
|
|
|
|
)
|
|
|
|
|
|
|
|
add_old_configure_assignment('_HAVE_FREETYPE2',
|
|
|
|
depends_if(freetype2_info)(lambda _: True))
|
2016-10-14 18:06:31 +00:00
|
|
|
|
2016-03-16 08:37:42 +00:00
|
|
|
# Apple platform decoder support
|
|
|
|
# ==============================================================
|
|
|
|
@depends(toolkit)
|
|
|
|
def applemedia(toolkit):
|
|
|
|
if toolkit in ('cocoa', 'uikit'):
|
|
|
|
return True
|
2016-03-16 08:42:57 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_APPLEMEDIA', applemedia)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_APPLEMEDIA', applemedia)
|
2016-03-23 07:34:59 +00:00
|
|
|
add_old_configure_assignment('MOZ_APPLEMEDIA', applemedia)
|
2016-03-16 08:42:57 +00:00
|
|
|
|
|
|
|
# Windows Media Foundation support
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-wmf',
|
|
|
|
help='Disable support for Windows Media Foundation')
|
|
|
|
|
|
|
|
@depends('--disable-wmf', target)
|
|
|
|
def wmf(value, target):
|
|
|
|
enabled = bool(value)
|
|
|
|
if value.origin == 'default':
|
|
|
|
# Enable Windows Media Foundation support by default.
|
|
|
|
# Note our minimum SDK version is Windows 7 SDK, so we are (currently)
|
|
|
|
# guaranteed to have a recent-enough SDK to build WMF.
|
|
|
|
enabled = target.os == 'WINNT'
|
|
|
|
if enabled and target.os != 'WINNT':
|
2016-03-25 06:48:21 +00:00
|
|
|
die('Cannot enable Windows Media Foundation support on %s', target.os)
|
2016-03-16 08:42:57 +00:00
|
|
|
if enabled:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
2016-03-16 08:46:13 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_WMF', wmf)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_WMF', wmf)
|
2016-03-16 08:46:13 +00:00
|
|
|
|
|
|
|
# FFmpeg H264/AAC Decoding Support
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-ffmpeg',
|
|
|
|
help='Disable FFmpeg for fragmented H264/AAC decoding')
|
|
|
|
|
|
|
|
@depends('--disable-ffmpeg', target)
|
|
|
|
def ffmpeg(value, target):
|
|
|
|
enabled = bool(value)
|
|
|
|
if value.origin == 'default':
|
|
|
|
enabled = target.os not in ('Android', 'WINNT')
|
|
|
|
if enabled:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
2016-03-16 08:50:42 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_FFMPEG', ffmpeg)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_FFMPEG', ffmpeg)
|
2016-03-23 05:18:57 +00:00
|
|
|
imply_option('--enable-fmp4', ffmpeg, '--enable-ffmpeg')
|
2016-03-16 08:50:42 +00:00
|
|
|
|
2017-04-18 16:08:18 +00:00
|
|
|
# Libaom AV1 Video Codec Support
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-av1',
|
|
|
|
help='Enable libaom for av1 video support')
|
|
|
|
|
2017-06-07 17:29:59 +00:00
|
|
|
@depends('--enable-av1', target, milestone)
|
|
|
|
def av1(value, target, milestone):
|
2017-04-18 16:08:18 +00:00
|
|
|
enabled = bool(value)
|
2017-06-07 17:29:59 +00:00
|
|
|
if value.origin == 'default' and milestone.is_nightly:
|
2017-06-02 21:42:17 +00:00
|
|
|
enabled = target.os != 'Android'
|
2017-04-18 16:08:18 +00:00
|
|
|
if enabled:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_AV1', av1)
|
|
|
|
set_define('MOZ_AV1', av1)
|
|
|
|
|
2016-03-16 08:50:42 +00:00
|
|
|
# Built-in fragmented MP4 support.
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-fmp4', env='MOZ_FMP4',
|
|
|
|
help='Disable support for in built Fragmented MP4 parsing')
|
|
|
|
|
|
|
|
@depends('--disable-fmp4', target, wmf, applemedia)
|
|
|
|
def fmp4(value, target, wmf, applemedia):
|
|
|
|
enabled = bool(value)
|
|
|
|
if value.origin == 'default':
|
|
|
|
# target.os == 'Android' includes all B2G versions
|
|
|
|
enabled = wmf or applemedia or target.os == 'Android'
|
|
|
|
if enabled:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
2016-03-16 08:52:20 +00:00
|
|
|
|
2016-03-22 05:21:32 +00:00
|
|
|
set_config('MOZ_FMP4', fmp4)
|
2016-03-23 01:22:08 +00:00
|
|
|
set_define('MOZ_FMP4', fmp4)
|
2016-03-23 07:34:59 +00:00
|
|
|
add_old_configure_assignment('MOZ_FMP4', fmp4)
|
2016-03-16 08:52:20 +00:00
|
|
|
|
|
|
|
# EME Support
|
|
|
|
# ==============================================================
|
2016-07-29 05:14:55 +00:00
|
|
|
# Widevine is enabled by default in desktop browser builds.
|
|
|
|
@depends(build_project, '--help')
|
|
|
|
def eme_default(build_project, help):
|
|
|
|
if build_project == 'browser':
|
|
|
|
return 'widevine'
|
|
|
|
|
|
|
|
option('--enable-eme',
|
|
|
|
nargs='*',
|
2017-01-09 13:41:19 +00:00
|
|
|
choices=('widevine',),
|
2016-07-29 05:14:55 +00:00
|
|
|
default=eme_default,
|
2016-03-16 08:52:20 +00:00
|
|
|
help='Enable support for Encrypted Media Extensions')
|
|
|
|
|
2016-08-17 09:40:43 +00:00
|
|
|
@depends('--enable-eme', target)
|
|
|
|
def enable_eme(value, target):
|
|
|
|
# Widevine EME by default enabled on desktop Windows, MacOS and Linux,
|
|
|
|
# x86 and x64 builds.
|
|
|
|
if (target.kernel in ('Darwin', 'WINNT', 'Linux') and
|
|
|
|
target.os not in ('Android', 'iOS') and
|
|
|
|
target.cpu in ('x86', 'x86_64')):
|
|
|
|
return value
|
|
|
|
elif value and value.origin != 'default':
|
|
|
|
die('%s is not supported on %s' % (value.format('--enable-eme'), target.alias))
|
2016-09-05 01:54:37 +00:00
|
|
|
# Return the same type of OptionValue (Positive or Negative), with an empty tuple.
|
|
|
|
return value.__class__(())
|
2016-08-17 09:40:43 +00:00
|
|
|
|
|
|
|
@depends(enable_eme, fmp4)
|
2016-03-16 08:52:20 +00:00
|
|
|
def eme(value, fmp4):
|
|
|
|
enabled = bool(value)
|
|
|
|
if value.origin == 'default':
|
|
|
|
enabled = enabled or fmp4
|
|
|
|
if enabled and not fmp4:
|
2016-03-25 06:48:21 +00:00
|
|
|
die('Encrypted Media Extension support requires '
|
|
|
|
'Fragmented MP4 support')
|
2016-03-16 08:52:20 +00:00
|
|
|
if enabled:
|
2016-03-22 05:21:32 +00:00
|
|
|
return True
|
|
|
|
|
2016-08-17 09:40:43 +00:00
|
|
|
@depends(enable_eme)
|
2016-03-22 05:21:32 +00:00
|
|
|
def eme_modules(value):
|
2016-08-19 08:42:04 +00:00
|
|
|
return value
|
2016-03-22 05:21:32 +00:00
|
|
|
|
|
|
|
set_config('MOZ_EME_MODULES', eme_modules)
|
2016-04-14 19:26:38 +00:00
|
|
|
|
|
|
|
option(name='--enable-chrome-format',
|
|
|
|
help='Select FORMAT of chrome files during packaging.',
|
|
|
|
nargs=1,
|
|
|
|
choices=('omni', 'jar', 'flat'),
|
|
|
|
default='omni')
|
|
|
|
|
|
|
|
@depends('--enable-chrome-format')
|
|
|
|
def packager_format(value):
|
|
|
|
return value[0]
|
|
|
|
|
|
|
|
set_config('MOZ_PACKAGER_FORMAT', packager_format)
|
|
|
|
|
2016-04-30 23:02:43 +00:00
|
|
|
@depends(host, build_project)
|
|
|
|
def jar_maker_format(host, build_project):
|
|
|
|
# Multilocales for mobile/android use the same mergedirs for all locales,
|
|
|
|
# so we can't use symlinks for those builds.
|
|
|
|
if host.os == 'WINNT' or build_project == 'mobile/android':
|
|
|
|
return 'flat'
|
|
|
|
return 'symlink'
|
2016-04-14 19:26:38 +00:00
|
|
|
|
|
|
|
set_config('MOZ_JAR_MAKER_FILE_FORMAT', jar_maker_format)
|
|
|
|
|
|
|
|
@depends(toolkit)
|
|
|
|
def omnijar_name(toolkit):
|
|
|
|
# Fennec's static resources live in the assets/ folder of the
|
|
|
|
# APK. Adding a path to the name here works because we only
|
|
|
|
# have one omnijar file in the final package (which is not the
|
|
|
|
# case on desktop), and necessitates some contortions during
|
|
|
|
# packaging so that the resources in the omnijar are considered
|
|
|
|
# as rooted at / and not as rooted at assets/ (which again is
|
|
|
|
# not the case on desktop: there are omnijars rooted at webrtc/,
|
|
|
|
# etc). packager.mk handles changing the rooting of the single
|
|
|
|
# omnijar.
|
|
|
|
return 'assets/omni.ja' if toolkit == 'android' else 'omni.ja'
|
|
|
|
|
|
|
|
set_config('OMNIJAR_NAME', omnijar_name)
|
2016-04-20 09:47:33 +00:00
|
|
|
|
2016-05-12 18:55:58 +00:00
|
|
|
project_flag('MOZ_PLACES',
|
|
|
|
help='Build Places if required',
|
|
|
|
set_as_define=True)
|
|
|
|
|
2016-05-12 18:55:59 +00:00
|
|
|
project_flag('MOZ_SOCIAL',
|
|
|
|
help='Build SocialAPI if required',
|
|
|
|
default=True)
|
|
|
|
|
2016-05-12 18:55:59 +00:00
|
|
|
project_flag('MOZ_SERVICES_HEALTHREPORT',
|
|
|
|
help='Build Firefox Health Reporter Service',
|
|
|
|
set_for_old_configure=True,
|
|
|
|
set_as_define=True)
|
|
|
|
|
2016-05-12 18:55:59 +00:00
|
|
|
project_flag('MOZ_SERVICES_SYNC',
|
|
|
|
help='Build Sync Services if required')
|
|
|
|
|
2016-05-17 21:40:03 +00:00
|
|
|
project_flag('MOZ_ANDROID_HISTORY',
|
|
|
|
help='Enable Android History instead of Places',
|
|
|
|
set_as_define=True)
|
|
|
|
|
2017-05-13 04:28:14 +00:00
|
|
|
project_flag('MOZ_ALLOW_LEGACY_EXTENSIONS',
|
|
|
|
help='Allow legacy browser extensions',
|
|
|
|
default=True, set_as_define=True)
|
|
|
|
|
2016-05-17 21:40:03 +00:00
|
|
|
@depends('MOZ_PLACES', 'MOZ_ANDROID_HISTORY')
|
|
|
|
def check_places_and_android_history(places, android_history):
|
|
|
|
if places and android_history:
|
|
|
|
die('Cannot use MOZ_ANDROID_HISTORY alongside MOZ_PLACES.')
|
|
|
|
|
2016-08-18 20:39:40 +00:00
|
|
|
# Permissions system
|
|
|
|
# ==============================================================
|
|
|
|
option(name='--disable-permissions',
|
|
|
|
help='Disable permissions (popup and cookie blocking)')
|
|
|
|
|
|
|
|
moz_permissions = depends_if('--disable-permissions')(lambda _: True)
|
|
|
|
|
|
|
|
set_config('MOZ_PERMISSIONS', moz_permissions)
|
|
|
|
set_define('MOZ_PERMISSIONS', moz_permissions)
|
|
|
|
|
2016-07-22 09:52:09 +00:00
|
|
|
# gpsd support
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-gpsd', env='MOZ_GPSD',
|
|
|
|
help='Enable gpsd support')
|
|
|
|
|
|
|
|
@depends('--enable-gpsd')
|
|
|
|
def gpsd(value):
|
|
|
|
return bool(value)
|
|
|
|
|
2016-08-17 22:02:31 +00:00
|
|
|
system_gpsd = pkg_check_modules('MOZ_GPSD', 'libgps >= 3.11',
|
|
|
|
when=gpsd)
|
2016-07-22 09:52:09 +00:00
|
|
|
|
2016-10-14 18:06:30 +00:00
|
|
|
set_config('MOZ_GPSD', depends_if(system_gpsd)(lambda _: True))
|
2016-07-22 09:52:09 +00:00
|
|
|
|
2016-04-20 09:47:33 +00:00
|
|
|
# Miscellaneous programs
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
check_prog('TAR', ('gnutar', 'gtar', 'tar'))
|
|
|
|
check_prog('UNZIP', ('unzip',))
|
|
|
|
check_prog('ZIP', ('zip',))
|
2016-08-09 09:15:53 +00:00
|
|
|
|
|
|
|
# Key files
|
|
|
|
# ==============================================================
|
|
|
|
include('../build/moz.configure/keyfiles.configure')
|
|
|
|
|
|
|
|
simple_keyfile('Mozilla API')
|
|
|
|
|
|
|
|
simple_keyfile('Google API')
|
|
|
|
|
|
|
|
id_and_secret_keyfile('Bing API')
|
|
|
|
|
|
|
|
simple_keyfile('Adjust SDK')
|
2016-08-12 07:14:08 +00:00
|
|
|
|
2017-05-26 19:31:20 +00:00
|
|
|
id_and_secret_keyfile('Leanplum SDK')
|
|
|
|
|
2016-08-12 07:14:08 +00:00
|
|
|
# Servo integration
|
|
|
|
# ==============================================================
|
2017-05-18 22:39:40 +00:00
|
|
|
option('--enable-stylo', nargs='?', choices=('build',),
|
|
|
|
help='Include Stylo in the build and/or enable it at runtime')
|
|
|
|
|
2017-07-25 21:29:52 +00:00
|
|
|
@depends('--enable-stylo', '--help', target)
|
|
|
|
def stylo_config(value, _, target):
|
2017-05-18 22:39:40 +00:00
|
|
|
build_stylo = None
|
|
|
|
enable_stylo = None
|
|
|
|
|
2017-07-25 21:29:52 +00:00
|
|
|
# If nothing is specified, default to building stylo where possible.
|
2017-05-18 22:39:40 +00:00
|
|
|
if value.origin == 'default':
|
2017-07-25 21:29:52 +00:00
|
|
|
if target.os == 'GNU' and target.bitness == 32:
|
|
|
|
# The clang setup we use in automation is a little unusual, and
|
|
|
|
# doesn't play well with bindgen on 32-bit Linux.
|
|
|
|
pass
|
|
|
|
elif target.os == 'Android':
|
|
|
|
# Stylo on Android is happening Later(tm).
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
build_stylo = True
|
2017-06-21 19:17:37 +00:00
|
|
|
elif len(value) and value[0] == 'build':
|
2017-07-25 21:29:52 +00:00
|
|
|
# Build but disable by request.
|
2017-05-18 22:39:40 +00:00
|
|
|
build_stylo = True
|
|
|
|
elif bool(value):
|
2017-07-25 21:29:52 +00:00
|
|
|
# Build and enable.
|
2017-05-18 22:39:40 +00:00
|
|
|
build_stylo = True
|
|
|
|
enable_stylo = True
|
|
|
|
|
|
|
|
return namespace(
|
|
|
|
build = build_stylo,
|
|
|
|
enable = enable_stylo,
|
|
|
|
)
|
2016-08-30 20:10:00 +00:00
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
option('--disable-stylo-build-bindgen',
|
|
|
|
help='Disable build-time bindgen for Stylo')
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
@depends(stylo_config, '--enable-stylo-build-bindgen', '--enable-compile-environment')
|
|
|
|
def building_stylo_bindgen(stylo_config, bindgen_enabled, compile_environment):
|
|
|
|
if not compile_environment:
|
|
|
|
return False
|
2017-06-21 17:28:37 +00:00
|
|
|
if not bindgen_enabled:
|
|
|
|
return False
|
|
|
|
return stylo_config.build
|
|
|
|
|
2017-01-20 16:33:04 +00:00
|
|
|
# We support setting up the appropriate options for Stylo's build-time
|
|
|
|
# bindings generation via setting LLVM_CONFIG or by providing explicit
|
|
|
|
# configure options. The Windows installer of LLVM/Clang doesn't provide
|
|
|
|
# llvm-config, so we need both methods to support all of our tier-1
|
|
|
|
# platforms.
|
2017-07-03 15:13:05 +00:00
|
|
|
@depends(host)
|
|
|
|
@imports('which')
|
2017-06-22 21:15:59 +00:00
|
|
|
@imports('os')
|
2017-07-03 15:13:05 +00:00
|
|
|
@imports('subprocess')
|
|
|
|
def llvm_config_paths(host):
|
2017-06-22 21:15:59 +00:00
|
|
|
llvm_config_progs = [
|
|
|
|
'llvm-config-4.0',
|
2017-07-08 02:20:34 +00:00
|
|
|
'llvm-config-mp-4.0', # MacPorts' chosen naming scheme.
|
2017-06-22 21:15:59 +00:00
|
|
|
'llvm-config40',
|
|
|
|
'llvm-config-3.9',
|
|
|
|
'llvm-config39',
|
|
|
|
'llvm-config',
|
|
|
|
]
|
|
|
|
|
2017-07-08 02:20:34 +00:00
|
|
|
# Homebrew on macOS doesn't make clang available on PATH, so we have to
|
2017-07-03 15:13:05 +00:00
|
|
|
# look for it in non-standard places.
|
|
|
|
if host.kernel == 'Darwin':
|
|
|
|
try:
|
|
|
|
brew = which.which('brew')
|
|
|
|
brew_config = subprocess.check_output([brew, 'config']).strip()
|
|
|
|
|
|
|
|
for line in brew_config.splitlines():
|
|
|
|
if line.startswith('HOMEBREW_PREFIX'):
|
|
|
|
fields = line.split(None, 2)
|
|
|
|
prefix = fields[1] if len(fields) == 2 else ''
|
|
|
|
path = ['opt', 'llvm', 'bin', 'llvm-config']
|
|
|
|
llvm_config_progs.append(os.path.join(prefix, *path))
|
|
|
|
break
|
|
|
|
except which.WhichError:
|
|
|
|
# Homebrew not installed, which is fine.
|
|
|
|
pass
|
|
|
|
|
2017-07-08 02:20:34 +00:00
|
|
|
# Also add in the location to which `mach bootstrap` or
|
|
|
|
# `mach artifact toolchain` installs clang.
|
|
|
|
mozbuild_state_dir = os.environ.get('MOZBUILD_STATE_PATH',
|
|
|
|
os.path.expanduser(os.path.join('~', '.mozbuild')))
|
|
|
|
bootstrap_llvm_config = os.path.join(mozbuild_state_dir, 'clang', 'bin', 'llvm-config')
|
|
|
|
|
|
|
|
llvm_config_progs.append(bootstrap_llvm_config)
|
|
|
|
|
2017-06-22 21:15:59 +00:00
|
|
|
return llvm_config_progs
|
|
|
|
|
|
|
|
llvm_config = check_prog('LLVM_CONFIG', llvm_config_paths,
|
2017-06-21 17:28:37 +00:00
|
|
|
when=building_stylo_bindgen,
|
2017-01-20 16:33:04 +00:00
|
|
|
what='llvm-config', allow_missing=True)
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
with only_when(building_stylo_bindgen):
|
|
|
|
option('--with-libclang-path', nargs=1,
|
|
|
|
help='Absolute path to a directory containing Clang/LLVM libraries for Stylo (version 3.9.x or above)')
|
|
|
|
option('--with-clang-path', nargs=1,
|
|
|
|
help='Absolute path to a Clang binary for Stylo bindgen (version 3.9.x or above)')
|
|
|
|
|
|
|
|
def invoke_llvm_config(llvm_config, *options):
|
|
|
|
'''Invoke llvm_config with the given options and return the first line of
|
|
|
|
output.'''
|
|
|
|
lines = check_cmd_output(llvm_config, *options).splitlines()
|
|
|
|
return lines[0]
|
|
|
|
|
|
|
|
@imports(_from='textwrap', _import='dedent')
|
|
|
|
def check_minimum_llvm_config_version(llvm_config):
|
|
|
|
version = Version(invoke_llvm_config(llvm_config, '--version'))
|
|
|
|
min_version = Version('3.9.0')
|
|
|
|
if version < min_version:
|
|
|
|
die(dedent('''\
|
|
|
|
llvm installation {} is incompatible with Stylo bindgen.
|
|
|
|
|
|
|
|
To compile Stylo, please install version {} or greater of
|
|
|
|
Clang + LLVM and ensure that the 'llvm-config' from that
|
|
|
|
installation is first on your path.
|
|
|
|
|
|
|
|
You can verify this by typing 'llvm-config --version'.
|
|
|
|
'''.format(version, min_version)))
|
|
|
|
|
|
|
|
@depends(llvm_config, '--with-libclang-path', '--with-clang-path',
|
2017-06-23 06:12:04 +00:00
|
|
|
host_library_name_info, host)
|
2017-06-21 17:28:37 +00:00
|
|
|
@imports('os.path')
|
2017-08-04 16:43:00 +00:00
|
|
|
@imports('glob')
|
2017-06-21 17:28:37 +00:00
|
|
|
@imports(_from='textwrap', _import='dedent')
|
|
|
|
def bindgen_config_paths(llvm_config, libclang_path, clang_path,
|
2017-06-21 17:28:37 +00:00
|
|
|
library_name_info, host):
|
|
|
|
def search_for_libclang(path):
|
|
|
|
# Try to ensure that the clang shared library that bindgen is going
|
|
|
|
# to look for is actually present. The files that we search for
|
|
|
|
# mirror the logic in clang-sys/build.rs.
|
|
|
|
libclang_choices = []
|
|
|
|
if host.os == 'WINNT':
|
|
|
|
libclang_choices.append('libclang.dll')
|
Bug 1375798 - Reorganize the library_name_info function. r=mshal
The function as it currently is matches how things were done in
old-configure.in. However, that's just confusing and hard to follow. In
fact, the unit test failing numerous times while writing this patch
pretty much highlights the problem.
So instead of a confusing set of overrides to the prefixes and suffixes,
spell out the whole set for each set of platforms. This also happens to
make the function shorter. Win/win.
At the same time, we normalize the function output as a nested
namespace, where we get, for each of dll, lib, import_lib, etc. a
prefix/suffix pair. Further down the road, we can imagine changing those
to class instances with a method allowing to format file names based on
those prefix/suffixes.
--HG--
extra : rebase_source : c18520d4df54feeea0a7f9588bc3cf8346793aaf
2017-06-23 06:05:06 +00:00
|
|
|
libclang_choices.append('%sclang%s' % (library_name_info.dll.prefix,
|
|
|
|
library_name_info.dll.suffix))
|
2017-06-21 17:28:37 +00:00
|
|
|
if host.kernel == 'Linux':
|
|
|
|
libclang_choices.append('libclang.so.1')
|
|
|
|
|
2017-08-04 16:43:00 +00:00
|
|
|
if host.os == 'OpenBSD':
|
|
|
|
libclang_choices = glob.glob(path + '/libclang.so.*.*')
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
# At least one of the choices must be found.
|
|
|
|
for choice in libclang_choices:
|
|
|
|
libclang = os.path.join(path, choice)
|
|
|
|
if os.path.exists(libclang):
|
|
|
|
return (True, None)
|
|
|
|
else:
|
|
|
|
return (False, list(set(libclang_choices)))
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
if not libclang_path and not clang_path:
|
|
|
|
# We must have LLVM_CONFIG in this case.
|
|
|
|
if not llvm_config:
|
|
|
|
die(dedent('''\
|
|
|
|
Could not find LLVM/Clang installation for compiling stylo build-time
|
|
|
|
bindgen. Please specify the 'LLVM_CONFIG' environment variable
|
|
|
|
(recommended), pass the '--with-libclang-path' and '--with-clang-path'
|
|
|
|
options to configure, or put 'llvm-config' in your PATH. Altering your
|
|
|
|
PATH may expose 'clang' as well, potentially altering your compiler,
|
|
|
|
which may not be what you intended.'''))
|
|
|
|
|
|
|
|
check_minimum_llvm_config_version(llvm_config)
|
|
|
|
libclang_arg = '--bindir' if host.os == 'WINNT' else '--libdir'
|
|
|
|
libclang_path = invoke_llvm_config(llvm_config, libclang_arg)
|
|
|
|
clang_path = os.path.join(invoke_llvm_config(llvm_config, '--bindir'),
|
|
|
|
'clang')
|
|
|
|
libclang_path = normsep(libclang_path)
|
|
|
|
clang_path = normsep(clang_path)
|
|
|
|
|
|
|
|
# Debian-based distros, at least, can have llvm-config installed
|
|
|
|
# but not have other packages installed. Since the user is trying
|
|
|
|
# to use their system packages, we can't be more specific about what
|
|
|
|
# they need.
|
|
|
|
if not os.path.exists(libclang_path):
|
|
|
|
die(dedent('''\
|
|
|
|
The directory {} returned by `llvm-config {}` does not exist.
|
|
|
|
Please check your system configuration.
|
|
|
|
'''.format(libclang_path, libclang_arg)))
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
(found, searched) = search_for_libclang(libclang_path)
|
|
|
|
if not found:
|
|
|
|
die(dedent('''\
|
|
|
|
Could not find the clang shared library in the path {}
|
|
|
|
returned by `llvm-config {}` (searched for files {}).
|
|
|
|
Please check your system configuration.
|
|
|
|
'''.format(libclang_path, libclang_arg, searched)))
|
|
|
|
|
2017-06-28 22:41:52 +00:00
|
|
|
clang_resolved = find_program(clang_path)
|
|
|
|
if not clang_resolved:
|
2017-06-21 17:28:37 +00:00
|
|
|
die(dedent('''\
|
|
|
|
The file {} returned by `llvm-config {}` does not exist.
|
|
|
|
Please check your system configuration.
|
|
|
|
'''.format(clang_path, '--bindir')))
|
|
|
|
|
|
|
|
return namespace(
|
|
|
|
libclang_path=libclang_path,
|
2017-06-28 22:41:52 +00:00
|
|
|
clang_path=clang_resolved,
|
2017-06-21 17:28:37 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
if (not libclang_path and clang_path) or \
|
|
|
|
(libclang_path and not clang_path):
|
2017-06-21 17:28:37 +00:00
|
|
|
die(dedent('''\
|
2017-06-21 17:28:37 +00:00
|
|
|
You must provide both of --with-libclang-path and --with-clang-path
|
|
|
|
or neither of them.'''))
|
|
|
|
|
2017-06-22 18:29:50 +00:00
|
|
|
libclang_path = libclang_path[0]
|
|
|
|
clang_path = clang_path[0]
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
if not os.path.exists(libclang_path) or \
|
|
|
|
not os.path.isdir(libclang_path):
|
2017-06-21 17:28:37 +00:00
|
|
|
die(dedent('''\
|
2017-06-21 17:28:37 +00:00
|
|
|
The argument to --with-libclang-path is not a directory: {}
|
|
|
|
'''.format(libclang_path)))
|
2017-06-21 17:28:37 +00:00
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
(found, searched) = search_for_libclang(libclang_path)
|
|
|
|
if not found:
|
|
|
|
die(dedent('''\
|
|
|
|
Could not find the clang shared library in the path {}
|
|
|
|
specified by --with-libclang-path (searched for files {}).
|
|
|
|
'''.format(libclang_path, searched)))
|
|
|
|
|
2017-06-28 22:41:52 +00:00
|
|
|
clang_resolved = find_program(clang_path)
|
|
|
|
if not clang_resolved:
|
2017-06-21 17:28:37 +00:00
|
|
|
die(dedent('''\
|
2017-06-21 17:28:37 +00:00
|
|
|
The argument to --with-clang-path is not a file: {}
|
|
|
|
'''.format(clang_path)))
|
2017-01-20 16:33:04 +00:00
|
|
|
|
|
|
|
return namespace(
|
2017-06-22 18:29:50 +00:00
|
|
|
libclang_path=libclang_path,
|
2017-06-28 22:41:52 +00:00
|
|
|
clang_path=clang_resolved,
|
2017-01-20 16:33:04 +00:00
|
|
|
)
|
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
set_config('MOZ_LIBCLANG_PATH', bindgen_config_paths.libclang_path)
|
|
|
|
set_config('MOZ_CLANG_PATH', bindgen_config_paths.clang_path)
|
|
|
|
set_config('MOZ_STYLO_BINDGEN', depends_if('--enable-stylo-build-bindgen')(lambda _: True))
|
2017-01-20 16:33:04 +00:00
|
|
|
|
2017-06-21 17:28:37 +00:00
|
|
|
set_config('MOZ_STYLO', stylo_config.build)
|
|
|
|
set_define('MOZ_STYLO', stylo_config.build)
|
2017-06-20 15:34:37 +00:00
|
|
|
set_config('MOZ_STYLO_ENABLE', stylo_config.enable)
|
2017-05-19 15:46:56 +00:00
|
|
|
set_define('MOZ_STYLO_ENABLE', stylo_config.enable)
|
2016-08-30 20:10:00 +00:00
|
|
|
|
2016-08-12 07:14:08 +00:00
|
|
|
option('--with-servo', env='SERVO_TARGET_DIR', nargs=1,
|
|
|
|
help='Absolute path of the target directory where libgeckoservo can '
|
2016-08-30 20:10:00 +00:00
|
|
|
'be found. This is generally servo_src_dir/target/release.')
|
2016-08-12 07:14:08 +00:00
|
|
|
|
|
|
|
@depends_if('--with-servo')
|
2016-08-15 23:45:50 +00:00
|
|
|
def servo_target_dir(value):
|
2016-08-12 07:14:08 +00:00
|
|
|
return value[0]
|
|
|
|
|
|
|
|
set_config('SERVO_TARGET_DIR', servo_target_dir)
|
2016-08-10 07:54:08 +00:00
|
|
|
|
2017-02-06 16:42:53 +00:00
|
|
|
# WebRender integration
|
Bug 1342450 - Extract a MOZ_ENABLE_WEBRENDER from MOZ_BUILD_WEBRENDER so that we build but disable by default. r=rhunt,froydnj,ted
This adds back a MOZ_ENABLE_WEBRENDER define, which only controls whether or
not WebRender is enabled at runtime. The default behaviour is changed so that:
- if the user specifies --disable-webrender in the mozconfig, WebRender is
neither built nor enabled
- if the user specifies --enable-webrender in the mozconfig, WebRender is
built and enabled
- if the user specifies --enable-webrender=build in the mozconfig, WebRender is
built but not enabled, except on Android where it is neither built nor enabled
- if the user doesn't specify any of the above, the default behaviour is:
- on nightly/local builds, the same as --enable-webrender=build
- on other channels (e.g. aurora), the same as --disable-webrender
The net effect is that local/Nightly-automation builds will have WebRender
built-in but not enabled where possible (i.e. not Android). However the user
can override this behaviour via mozconfig options to either not build WebRender
at all, or to enable it in addition to building it.
MozReview-Commit-ID: IM7DdSHkIB
2017-03-22 21:38:09 +00:00
|
|
|
option('--enable-webrender', nargs='?', choices=('build',),
|
|
|
|
help='Include WebRender in the build and/or enable it at runtime')
|
2017-02-06 16:42:53 +00:00
|
|
|
|
2017-04-05 15:12:53 +00:00
|
|
|
@depends('--enable-webrender', milestone)
|
|
|
|
def webrender(value, milestone):
|
Bug 1342450 - Extract a MOZ_ENABLE_WEBRENDER from MOZ_BUILD_WEBRENDER so that we build but disable by default. r=rhunt,froydnj,ted
This adds back a MOZ_ENABLE_WEBRENDER define, which only controls whether or
not WebRender is enabled at runtime. The default behaviour is changed so that:
- if the user specifies --disable-webrender in the mozconfig, WebRender is
neither built nor enabled
- if the user specifies --enable-webrender in the mozconfig, WebRender is
built and enabled
- if the user specifies --enable-webrender=build in the mozconfig, WebRender is
built but not enabled, except on Android where it is neither built nor enabled
- if the user doesn't specify any of the above, the default behaviour is:
- on nightly/local builds, the same as --enable-webrender=build
- on other channels (e.g. aurora), the same as --disable-webrender
The net effect is that local/Nightly-automation builds will have WebRender
built-in but not enabled where possible (i.e. not Android). However the user
can override this behaviour via mozconfig options to either not build WebRender
at all, or to enable it in addition to building it.
MozReview-Commit-ID: IM7DdSHkIB
2017-03-22 21:38:09 +00:00
|
|
|
build_webrender = None
|
|
|
|
enable_webrender = None
|
|
|
|
|
2017-04-05 14:11:46 +00:00
|
|
|
if value.origin == 'default':
|
Bug 1342450 - Extract a MOZ_ENABLE_WEBRENDER from MOZ_BUILD_WEBRENDER so that we build but disable by default. r=rhunt,froydnj,ted
This adds back a MOZ_ENABLE_WEBRENDER define, which only controls whether or
not WebRender is enabled at runtime. The default behaviour is changed so that:
- if the user specifies --disable-webrender in the mozconfig, WebRender is
neither built nor enabled
- if the user specifies --enable-webrender in the mozconfig, WebRender is
built and enabled
- if the user specifies --enable-webrender=build in the mozconfig, WebRender is
built but not enabled, except on Android where it is neither built nor enabled
- if the user doesn't specify any of the above, the default behaviour is:
- on nightly/local builds, the same as --enable-webrender=build
- on other channels (e.g. aurora), the same as --disable-webrender
The net effect is that local/Nightly-automation builds will have WebRender
built-in but not enabled where possible (i.e. not Android). However the user
can override this behaviour via mozconfig options to either not build WebRender
at all, or to enable it in addition to building it.
MozReview-Commit-ID: IM7DdSHkIB
2017-03-22 21:38:09 +00:00
|
|
|
# if nothing is specified, default to just building on Nightly
|
|
|
|
build_webrender = milestone.is_nightly
|
2017-06-21 20:04:04 +00:00
|
|
|
elif len(value) and value[0] == 'build':
|
Bug 1342450 - Extract a MOZ_ENABLE_WEBRENDER from MOZ_BUILD_WEBRENDER so that we build but disable by default. r=rhunt,froydnj,ted
This adds back a MOZ_ENABLE_WEBRENDER define, which only controls whether or
not WebRender is enabled at runtime. The default behaviour is changed so that:
- if the user specifies --disable-webrender in the mozconfig, WebRender is
neither built nor enabled
- if the user specifies --enable-webrender in the mozconfig, WebRender is
built and enabled
- if the user specifies --enable-webrender=build in the mozconfig, WebRender is
built but not enabled, except on Android where it is neither built nor enabled
- if the user doesn't specify any of the above, the default behaviour is:
- on nightly/local builds, the same as --enable-webrender=build
- on other channels (e.g. aurora), the same as --disable-webrender
The net effect is that local/Nightly-automation builds will have WebRender
built-in but not enabled where possible (i.e. not Android). However the user
can override this behaviour via mozconfig options to either not build WebRender
at all, or to enable it in addition to building it.
MozReview-Commit-ID: IM7DdSHkIB
2017-03-22 21:38:09 +00:00
|
|
|
# if explicitly set to 'build', then we build but don't enable
|
|
|
|
build_webrender = True
|
|
|
|
elif bool(value):
|
|
|
|
# if set to true, then build and enable
|
|
|
|
build_webrender = True
|
|
|
|
enable_webrender = True
|
|
|
|
|
|
|
|
# in all other cases, don't build it or enable it (defaults are fine)
|
|
|
|
return namespace(
|
|
|
|
build = build_webrender,
|
|
|
|
enable = enable_webrender,
|
|
|
|
)
|
|
|
|
|
2017-05-17 07:13:34 +00:00
|
|
|
set_config('MOZ_BUILD_WEBRENDER', webrender.build)
|
|
|
|
set_define('MOZ_BUILD_WEBRENDER', webrender.build)
|
|
|
|
set_config('MOZ_ENABLE_WEBRENDER', webrender.enable)
|
2017-02-06 16:42:53 +00:00
|
|
|
|
2017-05-29 14:11:18 +00:00
|
|
|
# SIMD acceleration for Rust code (currently just encoding_rs)
|
|
|
|
|
|
|
|
option('--enable-rust-simd', env='MOZ_RUST_SIMD',
|
|
|
|
help='Enable explicit SIMD in Rust code.')
|
|
|
|
|
2017-06-12 11:55:29 +00:00
|
|
|
@depends('--enable-rust-simd', target)
|
|
|
|
def rust_simd(value, target):
|
|
|
|
# As of 2017-06-13, the simd crate only works on aarch64,
|
|
|
|
# x86 and x86_64. It's meant to work on 32-bit ARM, too,
|
|
|
|
# but currently does not.
|
|
|
|
if target.cpu in ('aarch64', 'x86', 'x86_64') and value:
|
2017-05-29 14:11:18 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_RUST_SIMD', rust_simd)
|
|
|
|
set_define('MOZ_RUST_SIMD', rust_simd)
|
|
|
|
|
2016-08-16 04:28:33 +00:00
|
|
|
# Printing
|
|
|
|
# ==============================================================
|
|
|
|
@depends(target)
|
|
|
|
def ios_disable_printing(target):
|
|
|
|
if target.os == 'iOS':
|
|
|
|
return False
|
|
|
|
|
|
|
|
imply_option('--enable-printing', ios_disable_printing, reason='--target')
|
|
|
|
|
|
|
|
option('--disable-printing', help='Disable printing support')
|
|
|
|
|
|
|
|
@depends('--disable-printing')
|
|
|
|
def printing(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('NS_PRINTING', printing)
|
|
|
|
set_define('NS_PRINTING', printing)
|
|
|
|
set_define('NS_PRINT_PREVIEW', printing)
|
2016-08-16 04:45:12 +00:00
|
|
|
|
|
|
|
# Speech-dispatcher support
|
|
|
|
# ==============================================================
|
|
|
|
@depends(toolkit)
|
|
|
|
def no_speechd_on_non_gtk(toolkit):
|
|
|
|
if toolkit not in ('gtk2', 'gtk3'):
|
|
|
|
return False
|
|
|
|
|
|
|
|
imply_option('--enable-synth-speechd', no_speechd_on_non_gtk,
|
|
|
|
reason='--enable-default-toolkit')
|
|
|
|
|
|
|
|
option('--disable-synth-speechd', help='Disable speech-dispatcher support')
|
|
|
|
|
|
|
|
set_config('MOZ_SYNTH_SPEECHD',
|
|
|
|
depends_if('--disable-synth-speechd')(lambda _: True))
|
2016-08-16 04:57:56 +00:00
|
|
|
|
2016-08-16 05:26:00 +00:00
|
|
|
# Speech API
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-webspeech', help='Disable support for HTML Speech API')
|
|
|
|
|
2016-08-16 05:33:09 +00:00
|
|
|
@depends('--disable-webspeech', '--help')
|
|
|
|
def webspeech(value, _):
|
2016-08-16 05:26:00 +00:00
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_WEBSPEECH', webspeech)
|
|
|
|
set_define('MOZ_WEBSPEECH', webspeech)
|
|
|
|
add_old_configure_assignment('MOZ_WEBSPEECH', webspeech)
|
|
|
|
|
2016-08-16 05:13:14 +00:00
|
|
|
# Speech API pocketsphinx backend
|
|
|
|
# ==============================================================
|
2016-08-16 05:26:00 +00:00
|
|
|
@depends(build_project, milestone, webspeech)
|
|
|
|
def webspeech_pocketsphinx(build_project, milestone, webspeech):
|
|
|
|
if webspeech and milestone.is_nightly and build_project == 'b2g':
|
2016-08-16 05:13:14 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_WEBSPEECH_POCKETSPHINX', webspeech_pocketsphinx)
|
|
|
|
set_define('MOZ_WEBSPEECH_POCKETSPHINX', webspeech_pocketsphinx)
|
|
|
|
|
2016-08-16 05:44:50 +00:00
|
|
|
# Speech API models
|
|
|
|
# ==============================================================
|
|
|
|
@depends(build_project, milestone, webspeech)
|
|
|
|
def webspeech_models(build_project, milestone, webspeech):
|
|
|
|
if webspeech and milestone.is_nightly and build_project == 'b2g':
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_WEBSPEECH_MODELS', webspeech_models)
|
|
|
|
set_define('MOZ_WEBSPEECH_MODELS', webspeech_models)
|
|
|
|
|
2016-08-16 05:33:09 +00:00
|
|
|
# Speech API test backend
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-webspeechtestbackend', default=webspeech,
|
|
|
|
help='Enable support for HTML Speech API Test Backend')
|
|
|
|
|
|
|
|
@depends_if('--enable-webspeechtestbackend')
|
|
|
|
def webspeech_test_backend(value):
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_WEBSPEECH_TEST_BACKEND', webspeech_test_backend)
|
|
|
|
set_define('MOZ_WEBSPEECH_TEST_BACKEND', webspeech_test_backend)
|
|
|
|
|
2016-08-16 05:01:02 +00:00
|
|
|
# Enable IPDL's "expensive" unit tests
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-ipdl-tests', help='Enable expensive IPDL tests')
|
|
|
|
|
|
|
|
set_config('MOZ_IPDL_TESTS',
|
|
|
|
depends_if('--enable-ipdl-tests')(lambda _: True))
|
2016-08-16 05:07:05 +00:00
|
|
|
|
|
|
|
include('nss.configure')
|
2016-08-18 00:57:06 +00:00
|
|
|
|
|
|
|
# Network protocol support
|
|
|
|
# ==============================================================
|
Bug 1344038 - Move the gio protocol handler under netwerk/protocol. r=chmanchester,karlt
Historically, we had support for some GNOME VFS protocols through the
gnomevfs library, and this was under extension. This may not have been
built by default when it was introduced, but GNOME upstream moved those
things into Gtk itself, and we then got support for the new Gio-based
protocol, similar to what we had through the gnomevfs library.
Time passes, and we switched off the gnomevfs library entirely, and
enabled the Gio-based protocol handlers by default. We then removed
everything related to the gnomevfs library.
Fast forward to now, and disabling Gio support in Firefox just doesn't
make sense, and leaving the gio protocol handler as an extension doesn't
make sense either.
As it is a protocol handler, its natural place is under
netwerk/protocol, which is where we're moving it here.
The netwerk/protocol subdirectories being handled automatically, we
don't need to add the moved directory in any DIRS variable.
--HG--
rename : extensions/gio/moz.build => netwerk/protocol/gio/moz.build
rename : extensions/gio/nsGIOProtocolHandler.cpp => netwerk/protocol/gio/nsGIOProtocolHandler.cpp
extra : rebase_source : 071a9cb1769f013717357458df24e2fd9570ccf4
2017-04-05 04:48:52 +00:00
|
|
|
@depends(check_build_environment, toolkit_gtk, '--help')
|
2016-08-18 00:57:06 +00:00
|
|
|
@imports('os')
|
|
|
|
@imports(_from='__builtin__', _import='sorted')
|
Bug 1344038 - Move the gio protocol handler under netwerk/protocol. r=chmanchester,karlt
Historically, we had support for some GNOME VFS protocols through the
gnomevfs library, and this was under extension. This may not have been
built by default when it was introduced, but GNOME upstream moved those
things into Gtk itself, and we then got support for the new Gio-based
protocol, similar to what we had through the gnomevfs library.
Time passes, and we switched off the gnomevfs library entirely, and
enabled the Gio-based protocol handlers by default. We then removed
everything related to the gnomevfs library.
Fast forward to now, and disabling Gio support in Firefox just doesn't
make sense, and leaving the gio protocol handler as an extension doesn't
make sense either.
As it is a protocol handler, its natural place is under
netwerk/protocol, which is where we're moving it here.
The netwerk/protocol subdirectories being handled automatically, we
don't need to add the moved directory in any DIRS variable.
--HG--
rename : extensions/gio/moz.build => netwerk/protocol/gio/moz.build
rename : extensions/gio/nsGIOProtocolHandler.cpp => netwerk/protocol/gio/nsGIOProtocolHandler.cpp
extra : rebase_source : 071a9cb1769f013717357458df24e2fd9570ccf4
2017-04-05 04:48:52 +00:00
|
|
|
def all_necko_protocols(build_env, toolkit_gtk, _):
|
2016-08-18 00:57:06 +00:00
|
|
|
basedir = os.path.join(build_env.topsrcdir, 'netwerk', 'protocol')
|
|
|
|
return tuple(sorted(p for p in os.listdir(basedir)
|
Bug 1344038 - Move the gio protocol handler under netwerk/protocol. r=chmanchester,karlt
Historically, we had support for some GNOME VFS protocols through the
gnomevfs library, and this was under extension. This may not have been
built by default when it was introduced, but GNOME upstream moved those
things into Gtk itself, and we then got support for the new Gio-based
protocol, similar to what we had through the gnomevfs library.
Time passes, and we switched off the gnomevfs library entirely, and
enabled the Gio-based protocol handlers by default. We then removed
everything related to the gnomevfs library.
Fast forward to now, and disabling Gio support in Firefox just doesn't
make sense, and leaving the gio protocol handler as an extension doesn't
make sense either.
As it is a protocol handler, its natural place is under
netwerk/protocol, which is where we're moving it here.
The netwerk/protocol subdirectories being handled automatically, we
don't need to add the moved directory in any DIRS variable.
--HG--
rename : extensions/gio/moz.build => netwerk/protocol/gio/moz.build
rename : extensions/gio/nsGIOProtocolHandler.cpp => netwerk/protocol/gio/nsGIOProtocolHandler.cpp
extra : rebase_source : 071a9cb1769f013717357458df24e2fd9570ccf4
2017-04-05 04:48:52 +00:00
|
|
|
if (os.path.isdir(os.path.join(basedir, p)) and
|
|
|
|
(p != 'gio' or toolkit_gtk))))
|
2016-08-18 00:57:06 +00:00
|
|
|
|
|
|
|
default_necko_protocols = all_necko_protocols
|
|
|
|
|
|
|
|
@deprecated_option('--enable-necko-protocols', nargs='*')
|
|
|
|
def necko_protocols(protocols):
|
|
|
|
return protocols
|
|
|
|
|
|
|
|
@depends(necko_protocols, default_necko_protocols)
|
|
|
|
def necko_protocols(protocols, default_protocols):
|
|
|
|
if protocols is None or (protocols and len(protocols) == 0):
|
|
|
|
return None
|
|
|
|
if len(protocols) == 1 and protocols[0] == '':
|
|
|
|
return False
|
|
|
|
result = set()
|
|
|
|
for p in protocols:
|
|
|
|
if p in ('yes', 'all', 'default'):
|
|
|
|
result |= set(default_protocols)
|
|
|
|
continue
|
|
|
|
if p in ('no', 'none'):
|
|
|
|
result = set()
|
|
|
|
continue
|
|
|
|
if p.startswith('-'):
|
|
|
|
if p[1:] in result:
|
|
|
|
result.remove(p[1:])
|
|
|
|
else:
|
|
|
|
result.add(p)
|
|
|
|
if result != set(default_protocols):
|
|
|
|
return tuple(result)
|
|
|
|
|
|
|
|
imply_option('--enable-network-protocols', necko_protocols,
|
|
|
|
reason='--enable-necko-protocols')
|
|
|
|
|
|
|
|
option('--enable-network-protocols', nargs='+', default=default_necko_protocols,
|
|
|
|
choices=all_necko_protocols,
|
|
|
|
help='Enable/disable specific protocol handlers')
|
|
|
|
|
|
|
|
@depends('--enable-network-protocols')
|
|
|
|
def necko_protocol_defines(protocols):
|
|
|
|
return tuple('NECKO_PROTOCOL_%s' % p for p in protocols)
|
|
|
|
|
|
|
|
add_old_configure_assignment('_NON_GLOBAL_ACDEFINES', necko_protocol_defines)
|
|
|
|
|
|
|
|
@depends(necko_protocol_defines)
|
|
|
|
@imports('__sandbox__')
|
|
|
|
def set_necko_protocol_defines(protocols):
|
|
|
|
for p in protocols:
|
|
|
|
__sandbox__.set_define_impl(p, True)
|
|
|
|
|
|
|
|
@depends('--enable-network-protocols')
|
|
|
|
@imports(_from='__builtin__', _import='sorted')
|
|
|
|
def necko_protocols(protocols):
|
|
|
|
return tuple(sorted(protocols))
|
|
|
|
|
|
|
|
set_config('NECKO_PROTOCOLS', necko_protocols)
|
|
|
|
add_old_configure_assignment('NECKO_PROTOCOLS', necko_protocols)
|
2016-08-25 22:55:16 +00:00
|
|
|
|
|
|
|
# Graphics
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-skia', help='Disable use of Skia')
|
|
|
|
|
2016-12-21 14:31:13 +00:00
|
|
|
@depends('--disable-skia')
|
|
|
|
def skia(value):
|
|
|
|
if not value:
|
|
|
|
die('--disable-skia is not supported anymore')
|
|
|
|
else:
|
2016-08-25 22:55:16 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_ENABLE_SKIA', skia)
|
|
|
|
set_define('MOZ_ENABLE_SKIA', skia)
|
|
|
|
set_define('USE_SKIA', skia)
|
|
|
|
|
|
|
|
@depends(skia, target)
|
|
|
|
def skia_android(skia, target):
|
|
|
|
if skia and target.os == 'Android':
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('SK_BUILD_FOR_ANDROID_NDK', skia_android)
|
|
|
|
|
|
|
|
option('--disable-skia-gpu', help='Disable use of Skia-GPU')
|
|
|
|
|
|
|
|
@depends('--disable-skia-gpu', skia, target)
|
|
|
|
def skia_gpu(value, skia, target):
|
|
|
|
if value.origin == 'default':
|
|
|
|
if not skia:
|
2016-08-31 16:08:18 +00:00
|
|
|
return None
|
2016-08-25 22:55:16 +00:00
|
|
|
# Skia GPU support may not reliably build on certain *BSDs (see bug 1234494)
|
|
|
|
if target.os in ('NetBSD', 'OpenBSD'):
|
2016-08-31 16:08:18 +00:00
|
|
|
return None
|
2016-08-25 22:55:16 +00:00
|
|
|
elif value and not skia:
|
|
|
|
die('Cannot enable Skia-GPU without enabling Skia')
|
|
|
|
if skia and value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_ENABLE_SKIA_GPU', skia_gpu)
|
|
|
|
set_define('USE_SKIA_GPU', skia_gpu)
|
|
|
|
|
2016-10-26 18:23:07 +00:00
|
|
|
option('--enable-skia-pdf', help='Enable Skia PDF')
|
|
|
|
|
2016-12-01 12:16:19 +00:00
|
|
|
@depends('--enable-skia-pdf', skia, milestone)
|
|
|
|
def skia_pdf(value, skia, milestone):
|
2016-10-26 18:23:07 +00:00
|
|
|
if value.origin == 'default':
|
|
|
|
if not skia:
|
|
|
|
return None
|
2016-12-01 12:16:19 +00:00
|
|
|
if milestone.is_nightly:
|
|
|
|
return True
|
2016-10-26 18:23:07 +00:00
|
|
|
elif value and not skia:
|
|
|
|
die('Cannot enable Skia PDF without enabling Skia')
|
|
|
|
if skia and value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_ENABLE_SKIA_PDF', skia_pdf)
|
|
|
|
set_define('MOZ_ENABLE_SKIA_PDF', skia_pdf)
|
|
|
|
|
2017-01-07 22:20:25 +00:00
|
|
|
option('--enable-skia-pdf-sfntly', help='Enable SFNTLY font subsetting in Skia PDF')
|
|
|
|
|
|
|
|
@depends('--enable-skia-pdf-sfntly', skia_pdf)
|
|
|
|
def skia_pdf_sfntly(value, skia_pdf):
|
|
|
|
if value.origin == 'default':
|
|
|
|
return skia_pdf
|
|
|
|
if value and not skia_pdf:
|
|
|
|
die('Cannot enable SFNTLY subsetting without enabling Skia PDF')
|
|
|
|
if skia_pdf and value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_ENABLE_SKIA_PDF_SFNTLY', skia_pdf_sfntly)
|
|
|
|
set_define('MOZ_ENABLE_SKIA_PDF_SFNTLY', skia_pdf_sfntly)
|
|
|
|
|
|
|
|
@depends(skia_pdf_sfntly)
|
|
|
|
def sfntly_includes(skia_pdf_sfntly):
|
|
|
|
includes = []
|
|
|
|
if skia_pdf_sfntly:
|
|
|
|
includes += [
|
|
|
|
'/gfx/sfntly/cpp/src',
|
|
|
|
]
|
|
|
|
return includes
|
|
|
|
|
|
|
|
set_config('SFNTLY_INCLUDES', sfntly_includes)
|
|
|
|
|
2016-08-25 22:55:16 +00:00
|
|
|
@depends(skia, skia_gpu)
|
|
|
|
def skia_includes(skia, skia_gpu):
|
|
|
|
includes = []
|
|
|
|
if skia:
|
|
|
|
includes += [
|
|
|
|
'/gfx/skia',
|
|
|
|
'/gfx/skia/skia/include/config',
|
|
|
|
'/gfx/skia/skia/include/core',
|
|
|
|
]
|
|
|
|
|
|
|
|
if skia_gpu:
|
|
|
|
includes += [
|
|
|
|
'/gfx/skia/skia/include/gpu',
|
|
|
|
'/gfx/skia/skia/include/utils',
|
|
|
|
]
|
|
|
|
|
|
|
|
return includes
|
|
|
|
|
|
|
|
set_config('SKIA_INCLUDES', skia_includes)
|
2016-09-01 13:07:01 +00:00
|
|
|
|
2017-06-30 00:17:46 +00:00
|
|
|
# Build Freetype in the tree
|
|
|
|
# ==============================================================
|
|
|
|
@depends(target, skia_pdf)
|
|
|
|
def tree_freetype(target, skia_pdf):
|
|
|
|
if target.os == 'Android' or (skia_pdf and target.os == 'WINNT'):
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_define('MOZ_TREE_FREETYPE', tree_freetype)
|
|
|
|
set_config('MOZ_TREE_FREETYPE', tree_freetype)
|
|
|
|
add_old_configure_assignment('MOZ_TREE_FREETYPE', tree_freetype)
|
|
|
|
|
|
|
|
set_define('HAVE_FT_BITMAP_SIZE_Y_PPEM', tree_freetype)
|
|
|
|
set_define('HAVE_FT_GLYPHSLOT_EMBOLDEN', tree_freetype)
|
|
|
|
set_define('HAVE_FT_LOAD_SFNT_TABLE', tree_freetype)
|
|
|
|
|
|
|
|
@depends(freetype2_combined_info, tree_freetype, check_build_environment)
|
|
|
|
def ft2_info(freetype2_combined_info, tree_freetype, build_env):
|
|
|
|
if tree_freetype:
|
|
|
|
return namespace(cflags=('-I%s/modules/freetype2/include' % build_env.topsrcdir,),
|
|
|
|
libs=())
|
|
|
|
if freetype2_combined_info:
|
|
|
|
return freetype2_combined_info
|
|
|
|
|
|
|
|
set_config('FT2_LIBS', ft2_info.libs)
|
|
|
|
add_old_configure_assignment('FT2_LIBS',
|
|
|
|
ft2_info.libs)
|
|
|
|
add_old_configure_assignment('FT2_CFLAGS',
|
|
|
|
ft2_info.cflags)
|
|
|
|
|
2016-11-29 23:21:00 +00:00
|
|
|
# Mortar
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-mortar', help='Enable mortar extension')
|
|
|
|
|
|
|
|
set_config('MOZ_MORTAR', True, when='--enable-mortar')
|
|
|
|
|
2017-05-26 15:27:07 +00:00
|
|
|
# Marionette remote protocol
|
|
|
|
# ==============================================================
|
|
|
|
#
|
|
|
|
# Marionette is the Gecko remote protocol used for various remote control,
|
|
|
|
# automation, and testing purposes throughout Gecko, Firefox, and Fennec.
|
|
|
|
# Marionette lives in ../testing/marionette.
|
2016-12-16 23:49:14 +00:00
|
|
|
#
|
2017-05-26 15:27:07 +00:00
|
|
|
# Marionette is not really a toolkit feature, as much as a Gecko engine
|
|
|
|
# feature. But it is enabled based on the toolkit (and target), so here
|
|
|
|
# it lives.
|
|
|
|
#
|
|
|
|
# It also backs ../testing/geckodriver, which is Mozilla's WebDriver
|
|
|
|
# implementation.
|
|
|
|
#
|
|
|
|
# For more information, see
|
|
|
|
# https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette.
|
2016-12-16 23:49:14 +00:00
|
|
|
|
2017-04-18 07:56:09 +00:00
|
|
|
@depends(target)
|
2017-05-26 15:27:07 +00:00
|
|
|
def marionette(target):
|
|
|
|
"""Enable Marionette by default, except on Android."""
|
|
|
|
if target.os != 'Android':
|
|
|
|
return True
|
2016-12-16 23:49:14 +00:00
|
|
|
|
2017-05-26 15:27:07 +00:00
|
|
|
imply_option('--enable-marionette', marionette, reason='Not Android')
|
2016-12-16 23:49:14 +00:00
|
|
|
|
|
|
|
option('--enable-marionette',
|
2017-05-26 15:27:07 +00:00
|
|
|
help='Enable Marionette remote protocol')
|
2016-12-16 23:49:14 +00:00
|
|
|
|
|
|
|
@depends('--enable-marionette')
|
|
|
|
def marionette(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('ENABLE_MARIONETTE', marionette)
|
2017-05-27 17:51:40 +00:00
|
|
|
|
|
|
|
# geckodriver WebDriver implementation
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-geckodriver', help='Enable WebDriver implementation')
|
|
|
|
|
|
|
|
@depends('--enable-geckodriver',
|
|
|
|
'MOZ_AUTOMATION',
|
|
|
|
compile_environment,
|
|
|
|
cross_compiling,
|
|
|
|
hazard_analysis,
|
|
|
|
target)
|
|
|
|
def geckodriver(enable, automation, compile_env, cross_compile, hazard, target):
|
|
|
|
"""
|
|
|
|
geckodriver is implied on supported platforms when MOZ_AUTOMATION
|
|
|
|
is set, but we also provide the --enable-geckodriver option for
|
|
|
|
developers to use.
|
|
|
|
|
|
|
|
At the present time, we want individual developers to be able to
|
|
|
|
opt-in to building geckodriver locally, and for it to be enabled by
|
|
|
|
default on supported CI build platforms.
|
|
|
|
"""
|
|
|
|
if enable:
|
2017-06-19 15:57:43 +00:00
|
|
|
if not compile_env:
|
|
|
|
die("--enable-geckodriver is not available without a compile "
|
|
|
|
"environment. A geckodriver binary will be downloaded during "
|
|
|
|
"an artifact build by default where available.")
|
2017-05-27 17:51:40 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
if enable.origin == 'default':
|
|
|
|
linux32 = target.kernel == 'Linux' and target.cpu == 'x86'
|
|
|
|
broken_platforms = cross_compile or linux32 or hazard
|
|
|
|
|
|
|
|
if automation and compile_env and not broken_platforms:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('ENABLE_GECKODRIVER', geckodriver)
|
2017-07-13 17:12:23 +00:00
|
|
|
|
|
|
|
# Code Coverage
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--enable-coverage', env='MOZ_CODE_COVERAGE',
|
|
|
|
help='Enable code coverage')
|
|
|
|
|
|
|
|
@depends('--enable-coverage')
|
|
|
|
def code_coverage(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_CODE_COVERAGE', code_coverage)
|
|
|
|
set_define('MOZ_CODE_COVERAGE', code_coverage)
|