2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2016-03-08 07:49:35 +03: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 09:59:39 +03:00
|
|
|
|
2016-03-17 09:56:23 +03: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 10:05:10 +03: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 08:21:32 +03:00
|
|
|
return True
|
2016-03-17 10:05:10 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_JPROF', jprof)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_JPROF', jprof)
|
2016-03-23 08:18:57 +03:00
|
|
|
imply_option('--enable-profiling', jprof)
|
2016-03-17 10:05:10 +03:00
|
|
|
|
2016-03-17 10:08:53 +03:00
|
|
|
@depends(target)
|
2017-01-25 01:08:15 +03:00
|
|
|
def gecko_profiler(target):
|
2016-03-17 10:08:53 +03:00
|
|
|
if target.os == 'Android':
|
2017-05-03 18:36:18 +03:00
|
|
|
return target.cpu in ('aarch64', 'arm', 'x86')
|
2016-03-17 10:08:53 +03:00
|
|
|
elif target.kernel == 'Linux':
|
2018-01-29 12:01:23 +03:00
|
|
|
return target.cpu in ('x86', 'x86_64', 'mips64', 'arm')
|
2016-03-17 10:08:53 +03:00
|
|
|
return target.os in ('OSX', 'WINNT')
|
|
|
|
|
2017-01-25 01:08:15 +03:00
|
|
|
@depends(gecko_profiler)
|
|
|
|
def gecko_profiler_define(value):
|
2016-03-17 10:08:53 +03:00
|
|
|
if value:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
2017-01-25 01:08:15 +03:00
|
|
|
set_config('MOZ_GECKO_PROFILER', gecko_profiler_define)
|
|
|
|
set_define('MOZ_GECKO_PROFILER', gecko_profiler_define)
|
2016-03-17 10:08:53 +03:00
|
|
|
|
|
|
|
|
2018-10-02 04:49:13 +03:00
|
|
|
# Whether code to parse ELF binaries should be compiled for the Gecko profiler
|
|
|
|
# (for symbol table dumping).
|
|
|
|
@depends(gecko_profiler, target)
|
|
|
|
def gecko_profiler_parse_elf(value, target):
|
|
|
|
# Currently we only want to build this code on Android, in order to dump
|
|
|
|
# symbols from Android system libraries on the device. For other platforms
|
|
|
|
# there exist alternatives that don't require bloating up our binary size.
|
|
|
|
if value and target.os == 'Android':
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_GECKO_PROFILER_PARSE_ELF', gecko_profiler_parse_elf)
|
|
|
|
set_define('MOZ_GECKO_PROFILER_PARSE_ELF', gecko_profiler_parse_elf)
|
|
|
|
|
2018-10-10 05:29:02 +03:00
|
|
|
# enable this by default if the profiler is enabled
|
|
|
|
# Note: also requires jemalloc
|
|
|
|
set_config('MOZ_PROFILER_MEMORY', gecko_profiler_define)
|
|
|
|
set_define('MOZ_PROFILER_MEMORY', gecko_profiler_define)
|
2018-10-02 04:49:13 +03:00
|
|
|
|
2016-03-17 10:22:18 +03: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 08:21:32 +03:00
|
|
|
return True
|
2016-03-17 10:22:18 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_DMD', dmd)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_DMD', dmd)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_DMD', dmd)
|
2016-03-23 08:18:57 +03:00
|
|
|
imply_option('--enable-profiling', dmd)
|
2017-05-11 07:16:00 +03:00
|
|
|
imply_option('--enable-jemalloc', dmd)
|
2016-04-14 12:55:01 +03:00
|
|
|
imply_option('--enable-replace-malloc', dmd)
|
2016-03-17 10:22:18 +03:00
|
|
|
|
2018-03-19 02:46:16 +03:00
|
|
|
# ALSA cubeb backend
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-alsa', env='MOZ_ALSA',
|
|
|
|
help='Enable ALSA audio backend.')
|
|
|
|
|
|
|
|
alsa = pkg_check_modules('MOZ_ALSA', 'alsa', when='--enable-alsa')
|
|
|
|
|
|
|
|
set_config('MOZ_ALSA', depends_if(alsa)(lambda _: True))
|
|
|
|
set_define('MOZ_ALSA', depends_if(alsa)(lambda _: True))
|
|
|
|
|
2016-07-18 14:28:39 +03:00
|
|
|
# JACK cubeb backend
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-jack', env='MOZ_JACK',
|
|
|
|
help='Enable JACK audio backend.')
|
|
|
|
|
2018-03-19 02:42:22 +03:00
|
|
|
jack = pkg_check_modules('MOZ_JACK', 'jack', when='--enable-jack')
|
2016-07-18 14:28:39 +03:00
|
|
|
|
2018-03-19 02:42:22 +03:00
|
|
|
set_config('MOZ_JACK', depends_if(jack)(lambda _: True))
|
|
|
|
set_define('MOZ_JACK', depends_if(jack)(lambda _: True))
|
2016-07-18 14:28:39 +03:00
|
|
|
|
2018-03-19 02:55:25 +03:00
|
|
|
# PulseAudio cubeb backend
|
|
|
|
# ==============================================================
|
|
|
|
@depends(target)
|
|
|
|
def pulseaudio_default(target):
|
|
|
|
return target.os not in ('WINNT', 'OSX', 'iOS', 'Android', 'OpenBSD')
|
|
|
|
|
|
|
|
option('--enable-pulseaudio', env='MOZ_PULSEAUDIO', default=pulseaudio_default,
|
|
|
|
help='Enable PulseAudio audio backend.')
|
|
|
|
|
|
|
|
pulseaudio = pkg_check_modules('MOZ_PULSEAUDIO', 'libpulse', when='--enable-pulseaudio')
|
|
|
|
|
|
|
|
set_config('MOZ_PULSEAUDIO', depends_if(pulseaudio)(lambda _: True))
|
|
|
|
set_define('MOZ_PULSEAUDIO', depends_if(pulseaudio)(lambda _: True))
|
|
|
|
|
2016-03-17 09:56:23 +03:00
|
|
|
# Javascript engine
|
|
|
|
# ==============================================================
|
2016-03-09 09:59:39 +03:00
|
|
|
include('../js/moz.configure')
|
2016-03-16 07:10:54 +03:00
|
|
|
|
|
|
|
|
2018-07-04 00:24:58 +03:00
|
|
|
# NodeJS
|
|
|
|
# ==============================================================
|
|
|
|
include('../build/moz.configure/node.configure')
|
2016-12-16 00:40:06 +03:00
|
|
|
|
2016-03-17 02:38:52 +03:00
|
|
|
# L10N
|
|
|
|
# ==============================================================
|
|
|
|
option('--with-l10n-base', nargs=1, env='L10NBASEDIR',
|
|
|
|
help='Path to l10n repositories')
|
|
|
|
|
|
|
|
@depends('--with-l10n-base')
|
2016-11-04 00:50:43 +03: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 20:47:28 +03:00
|
|
|
@imports(_from='os.path', _import='expanduser')
|
|
|
|
@imports(_from='os', _import='environ')
|
2016-03-17 02:38:52 +03:00
|
|
|
def l10n_base(value):
|
|
|
|
if value:
|
|
|
|
path = value[0]
|
2016-11-04 00:50:43 +03:00
|
|
|
if not isdir(path):
|
2016-03-25 09:48:21 +03: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 20:47:28 +03: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-17 02:38:52 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('L10NBASEDIR', l10n_base)
|
2016-03-17 02:38:52 +03:00
|
|
|
|
|
|
|
|
2016-03-16 07:10:54 +03: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 11:40:27 +03:00
|
|
|
choices=('cairo-windows', 'cairo-gtk3', 'cairo-gtk3-wayland',
|
2017-04-18 10:56:09 +03:00
|
|
|
'cairo-cocoa', 'cairo-uikit', 'cairo-android'),
|
2016-03-16 07:10:54 +03: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 07:48:52 +03:00
|
|
|
@depends('--enable-default-toolkit', target, '--help')
|
|
|
|
def toolkit(value, target, _):
|
2016-03-16 07:10:54 +03:00
|
|
|
# Define possible choices for each platform. The default is the first one
|
|
|
|
# listed when there are several.
|
|
|
|
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':
|
2017-08-31 02:30:52 +03:00
|
|
|
platform_choices = ('cairo-android',)
|
2016-03-16 07:10:54 +03:00
|
|
|
else:
|
2017-04-06 11:40:27 +03:00
|
|
|
platform_choices = ('cairo-gtk3', 'cairo-gtk3-wayland')
|
2016-03-16 07:10:54 +03:00
|
|
|
|
|
|
|
if value:
|
|
|
|
if value[0] not in platform_choices:
|
2016-03-25 09:48:21 +03:00
|
|
|
die('`%s` is not a valid value for --enable-default-toolkit on %s\n'
|
2017-08-31 02:39:06 +03:00
|
|
|
'Valid values: %s', value[0], target.os,
|
|
|
|
', '.join(platform_choices))
|
2016-03-16 07:10:54 +03:00
|
|
|
return value[0]
|
|
|
|
|
|
|
|
return platform_choices[0]
|
|
|
|
|
2017-04-06 11:40:27 +03:00
|
|
|
@depends(toolkit)
|
|
|
|
def wayland(toolkit):
|
|
|
|
return toolkit == 'cairo-gtk3-wayland'
|
2016-03-16 07:10:54 +03:00
|
|
|
|
|
|
|
@depends(toolkit)
|
|
|
|
def toolkit(toolkit):
|
2018-01-10 12:04:59 +03:00
|
|
|
if toolkit == 'cairo-gtk3-wayland':
|
2017-04-06 11:40:27 +03:00
|
|
|
widget_toolkit = 'gtk3'
|
2016-03-16 07:10:54 +03:00
|
|
|
else:
|
|
|
|
widget_toolkit = toolkit.replace('cairo-', '')
|
|
|
|
return widget_toolkit
|
2016-03-16 08:56:24 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_WIDGET_TOOLKIT', toolkit)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_WIDGET_TOOLKIT', toolkit)
|
2016-03-22 08:21:32 +03:00
|
|
|
|
2016-03-23 04:22:08 +03:00
|
|
|
@depends(toolkit)
|
|
|
|
def toolkit_gtk(toolkit):
|
2018-01-10 12:04:59 +03:00
|
|
|
if toolkit == 'gtk3':
|
2016-03-23 04:22:08 +03:00
|
|
|
return '3'
|
|
|
|
|
|
|
|
set_define('MOZ_WIDGET_GTK', toolkit_gtk)
|
|
|
|
|
|
|
|
@depends(toolkit)
|
|
|
|
def toolkit_define(toolkit):
|
2018-01-10 12:04:59 +03:00
|
|
|
if toolkit not in ('gtk3', 'windows'):
|
2016-03-23 04:22:08 +03:00
|
|
|
return 'MOZ_WIDGET_%s' % toolkit.upper()
|
|
|
|
|
|
|
|
set_define(toolkit_define, True)
|
|
|
|
|
2016-03-16 08:56:24 +03:00
|
|
|
|
2018-10-04 16:54:18 +03:00
|
|
|
set_config('MOZ_X11', True, when=toolkit_gtk)
|
|
|
|
set_define('MOZ_X11', True, when=toolkit_gtk)
|
|
|
|
add_old_configure_assignment('MOZ_X11', True, when=toolkit_gtk)
|
2016-03-16 09:14:20 +03:00
|
|
|
|
2017-04-06 11:40:27 +03: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 09:14:20 +03:00
|
|
|
# GL Provider
|
|
|
|
# ==============================================================
|
|
|
|
option('--with-gl-provider', nargs=1, help='Set GL provider backend type')
|
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
@depends('--with-gl-provider')
|
|
|
|
def gl_provider(value):
|
2016-03-16 09:14:20 +03:00
|
|
|
if value:
|
2016-03-23 04:22:08 +03: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 08:21:32 +03:00
|
|
|
|
2018-10-04 16:54:18 +03:00
|
|
|
@depends(gl_provider, wayland, toolkit_gtk)
|
|
|
|
def gl_default_provider(value, wayland, toolkit_gtk):
|
2016-03-22 08:21:32 +03:00
|
|
|
if value:
|
|
|
|
return value
|
2018-01-31 15:13:50 +03:00
|
|
|
elif wayland:
|
|
|
|
return 'EGL'
|
2018-10-04 16:54:18 +03:00
|
|
|
elif toolkit_gtk:
|
2016-03-22 08:21:32 +03:00
|
|
|
return 'GLX'
|
2016-03-16 10:10:40 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_GL_PROVIDER', gl_provider)
|
|
|
|
set_config('MOZ_GL_DEFAULT_PROVIDER', gl_default_provider)
|
2016-03-16 10:10:40 +03:00
|
|
|
|
2016-03-23 04:22:08 +03: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 10:10:40 +03:00
|
|
|
# PDF printing
|
|
|
|
# ==============================================================
|
|
|
|
@depends(toolkit)
|
|
|
|
def pdf_printing(toolkit):
|
2018-01-10 12:04:59 +03:00
|
|
|
if toolkit in ('windows', 'gtk3', 'android'):
|
2016-03-22 08:21:32 +03: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 10:10:40 +03:00
|
|
|
else:
|
|
|
|
# CONFIGURE_SUBST_FILES need explicit empty values.
|
2016-03-22 08:21:32 +03:00
|
|
|
return ''
|
|
|
|
|
|
|
|
set_config('MOZ_PDF_PRINTING', pdf_printing)
|
|
|
|
set_config('PDF_SURFACE_FEATURE', pdf_surface_feature)
|
2016-03-16 10:19:03 +03: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):
|
2018-01-10 12:04:59 +03:00
|
|
|
if value or (toolkit in ('windows', 'gtk3', 'cocoa', 'android') and
|
2017-04-18 10:56:09 +03:00
|
|
|
value.origin == 'default'):
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
|
2016-03-16 10:23:30 +03: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):
|
2018-01-10 12:04:59 +03:00
|
|
|
if value or (toolkit == 'gtk3' and
|
2016-03-16 10:23:30 +03:00
|
|
|
value.origin == 'default'):
|
2016-03-23 10:34:59 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
add_old_configure_assignment('USE_FC_FREETYPE', fc_freetype)
|
2016-03-16 11:37:42 +03:00
|
|
|
|
2016-10-14 21:06:30 +03: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 11:37:42 +03:00
|
|
|
|
2016-10-14 21:06:31 +03:00
|
|
|
# Fontconfig
|
|
|
|
# ==============================================================
|
|
|
|
fontconfig_info = pkg_check_modules('_FONTCONFIG', 'fontconfig >= 2.7.0',
|
|
|
|
when=fc_freetype)
|
|
|
|
|
2016-10-14 21:06:31 +03: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 21:06:31 +03:00
|
|
|
|
2016-03-16 11:37:42 +03:00
|
|
|
# Apple platform decoder support
|
|
|
|
# ==============================================================
|
|
|
|
@depends(toolkit)
|
|
|
|
def applemedia(toolkit):
|
|
|
|
if toolkit in ('cocoa', 'uikit'):
|
|
|
|
return True
|
2016-03-16 11:42:57 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_APPLEMEDIA', applemedia)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_APPLEMEDIA', applemedia)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_APPLEMEDIA', applemedia)
|
2016-03-16 11:42:57 +03: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 09:48:21 +03:00
|
|
|
die('Cannot enable Windows Media Foundation support on %s', target.os)
|
2016-03-16 11:42:57 +03:00
|
|
|
if enabled:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
2016-03-16 11:46:13 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_WMF', wmf)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_WMF', wmf)
|
2016-03-16 11:46:13 +03: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 08:21:32 +03:00
|
|
|
return True
|
2016-03-16 11:50:42 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_FFMPEG', ffmpeg)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_FFMPEG', ffmpeg)
|
2016-03-23 08:18:57 +03:00
|
|
|
imply_option('--enable-fmp4', ffmpeg, '--enable-ffmpeg')
|
2016-03-16 11:50:42 +03:00
|
|
|
|
2017-04-18 19:08:18 +03:00
|
|
|
# Libaom AV1 Video Codec Support
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-av1',
|
|
|
|
help='Enable libaom for av1 video support')
|
|
|
|
|
2018-07-25 17:54:55 +03:00
|
|
|
@depends('--enable-av1', target)
|
|
|
|
def av1(value, target):
|
2017-04-18 19:08:18 +03:00
|
|
|
enabled = bool(value)
|
2018-07-12 22:57:11 +03:00
|
|
|
if value.origin == 'default':
|
|
|
|
if target.os == 'WINNT' and target.cpu == 'x86':
|
|
|
|
enabled = False
|
2018-07-25 17:54:55 +03:00
|
|
|
else:
|
2018-09-20 11:25:35 +03:00
|
|
|
enabled = True
|
2017-04-18 19:08:18 +03:00
|
|
|
if enabled:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_AV1', av1)
|
|
|
|
set_define('MOZ_AV1', av1)
|
|
|
|
|
2016-03-16 11:50:42 +03: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 08:21:32 +03:00
|
|
|
return True
|
2016-03-16 11:52:20 +03:00
|
|
|
|
2016-03-22 08:21:32 +03:00
|
|
|
set_config('MOZ_FMP4', fmp4)
|
2016-03-23 04:22:08 +03:00
|
|
|
set_define('MOZ_FMP4', fmp4)
|
2016-03-23 10:34:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_FMP4', fmp4)
|
2016-03-16 11:52:20 +03:00
|
|
|
|
2018-05-10 00:26:31 +03:00
|
|
|
@depends(target)
|
|
|
|
def sample_type_is_s16(target):
|
|
|
|
# Use integers over floats for audio on Android regardless of the CPU
|
|
|
|
# architecture, because audio backends for Android don't support floats.
|
|
|
|
# We also use integers on ARM because it's more efficient.
|
|
|
|
if target.os == 'Android' or target.cpu == 'arm':
|
|
|
|
return True
|
|
|
|
|
|
|
|
@depends(sample_type_is_s16)
|
|
|
|
def sample_type_is_float(t):
|
|
|
|
if not t:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_SAMPLE_TYPE_S16', sample_type_is_s16)
|
|
|
|
set_define('MOZ_SAMPLE_TYPE_S16', sample_type_is_s16)
|
|
|
|
set_config('MOZ_SAMPLE_TYPE_FLOAT32', sample_type_is_float)
|
|
|
|
set_define('MOZ_SAMPLE_TYPE_FLOAT32', sample_type_is_float)
|
|
|
|
|
|
|
|
set_define('MOZ_VORBIS', sample_type_is_float)
|
|
|
|
set_config('MOZ_VORBIS', sample_type_is_float)
|
|
|
|
set_define('MOZ_TREMOR', sample_type_is_s16)
|
|
|
|
set_config('MOZ_TREMOR', sample_type_is_s16)
|
|
|
|
|
2018-04-18 05:38:12 +03:00
|
|
|
# OpenMAX IL Decoding Support
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-openmax',
|
|
|
|
help='Enable OpenMAX IL for video/audio decoding')
|
|
|
|
|
|
|
|
@depends('--enable-openmax')
|
|
|
|
def openmax(value):
|
|
|
|
enabled = bool(value)
|
|
|
|
if enabled:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_OMX', openmax)
|
|
|
|
set_define('MOZ_OMX', openmax)
|
|
|
|
|
2016-03-16 11:52:20 +03:00
|
|
|
# EME Support
|
|
|
|
# ==============================================================
|
2016-07-29 08:14:55 +03: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 16:41:19 +03:00
|
|
|
choices=('widevine',),
|
2016-07-29 08:14:55 +03:00
|
|
|
default=eme_default,
|
2016-03-16 11:52:20 +03:00
|
|
|
help='Enable support for Encrypted Media Extensions')
|
|
|
|
|
2016-08-17 12:40:43 +03: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 04:54:37 +03:00
|
|
|
# Return the same type of OptionValue (Positive or Negative), with an empty tuple.
|
|
|
|
return value.__class__(())
|
2016-08-17 12:40:43 +03:00
|
|
|
|
|
|
|
@depends(enable_eme, fmp4)
|
2016-03-16 11:52:20 +03:00
|
|
|
def eme(value, fmp4):
|
|
|
|
enabled = bool(value)
|
|
|
|
if value.origin == 'default':
|
|
|
|
enabled = enabled or fmp4
|
|
|
|
if enabled and not fmp4:
|
2016-03-25 09:48:21 +03:00
|
|
|
die('Encrypted Media Extension support requires '
|
|
|
|
'Fragmented MP4 support')
|
2016-03-16 11:52:20 +03:00
|
|
|
if enabled:
|
2016-03-22 08:21:32 +03:00
|
|
|
return True
|
|
|
|
|
2016-08-17 12:40:43 +03:00
|
|
|
@depends(enable_eme)
|
2016-03-22 08:21:32 +03:00
|
|
|
def eme_modules(value):
|
2016-08-19 11:42:04 +03:00
|
|
|
return value
|
2016-03-22 08:21:32 +03:00
|
|
|
|
|
|
|
set_config('MOZ_EME_MODULES', eme_modules)
|
2016-04-14 22:26:38 +03: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-05-01 02:02:43 +03: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 22:26:38 +03: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 12:47:33 +03:00
|
|
|
|
2016-05-12 21:55:58 +03:00
|
|
|
project_flag('MOZ_PLACES',
|
|
|
|
help='Build Places if required',
|
|
|
|
set_as_define=True)
|
|
|
|
|
2016-05-12 21:55:59 +03:00
|
|
|
project_flag('MOZ_SERVICES_HEALTHREPORT',
|
|
|
|
help='Build Firefox Health Reporter Service',
|
|
|
|
set_for_old_configure=True,
|
|
|
|
set_as_define=True)
|
|
|
|
|
2016-05-12 21:55:59 +03:00
|
|
|
project_flag('MOZ_SERVICES_SYNC',
|
|
|
|
help='Build Sync Services if required')
|
|
|
|
|
2016-05-18 00:40:03 +03:00
|
|
|
project_flag('MOZ_ANDROID_HISTORY',
|
|
|
|
help='Enable Android History instead of Places',
|
|
|
|
set_as_define=True)
|
2018-09-22 02:32:55 +03:00
|
|
|
|
|
|
|
project_flag('MOZ_DEDICATED_PROFILES',
|
|
|
|
help='Enable dedicated profiles per install',
|
|
|
|
set_as_define=True)
|
|
|
|
|
|
|
|
project_flag('MOZ_BLOCK_PROFILE_DOWNGRADE',
|
|
|
|
help='Block users from starting profiles last used by a newer build',
|
|
|
|
set_as_define=True)
|
2016-05-18 00:40:03 +03:00
|
|
|
|
2017-08-17 21:48:44 +03:00
|
|
|
option(env='MOZ_ALLOW_LEGACY_EXTENSIONS',
|
|
|
|
default=milestone.is_nightly,
|
|
|
|
help='Allow legacy browser extensions')
|
|
|
|
|
|
|
|
@depends('MOZ_ALLOW_LEGACY_EXTENSIONS')
|
|
|
|
def legacy_extensions(value):
|
|
|
|
if bool(value):
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_ALLOW_LEGACY_EXTENSIONS', legacy_extensions)
|
|
|
|
set_define('MOZ_ALLOW_LEGACY_EXTENSIONS', legacy_extensions)
|
2017-05-13 07:28:14 +03:00
|
|
|
|
2016-05-18 00:40:03 +03: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-07-22 12:52:09 +03:00
|
|
|
# gpsd support
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-gpsd', env='MOZ_GPSD',
|
|
|
|
help='Enable gpsd support')
|
|
|
|
|
|
|
|
@depends('--enable-gpsd')
|
|
|
|
def gpsd(value):
|
|
|
|
return bool(value)
|
|
|
|
|
2016-08-18 01:02:31 +03:00
|
|
|
system_gpsd = pkg_check_modules('MOZ_GPSD', 'libgps >= 3.11',
|
|
|
|
when=gpsd)
|
2016-07-22 12:52:09 +03:00
|
|
|
|
2016-10-14 21:06:30 +03:00
|
|
|
set_config('MOZ_GPSD', depends_if(system_gpsd)(lambda _: True))
|
2016-07-22 12:52:09 +03:00
|
|
|
|
2016-04-20 12:47:33 +03:00
|
|
|
# Miscellaneous programs
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
check_prog('TAR', ('gnutar', 'gtar', 'tar'))
|
|
|
|
check_prog('UNZIP', ('unzip',))
|
|
|
|
check_prog('ZIP', ('zip',))
|
2017-12-08 02:58:18 +03:00
|
|
|
check_prog('GN', ('gn',), allow_missing=True)
|
2016-08-09 12:15:53 +03: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 10:14:08 +03:00
|
|
|
|
2017-05-26 22:31:20 +03:00
|
|
|
id_and_secret_keyfile('Leanplum SDK')
|
|
|
|
|
2017-08-09 22:11:10 +03:00
|
|
|
simple_keyfile('Pocket API')
|
|
|
|
|
2016-08-30 23:10:00 +03:00
|
|
|
|
2017-02-06 19:42:53 +03: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-23 00:38:09 +03:00
|
|
|
option('--enable-webrender', nargs='?', choices=('build',),
|
|
|
|
help='Include WebRender in the build and/or enable it at runtime')
|
2017-02-06 19:42:53 +03:00
|
|
|
|
2018-05-09 22:24:38 +03:00
|
|
|
@depends('--enable-webrender')
|
|
|
|
def webrender(value):
|
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-23 00:38:09 +03:00
|
|
|
build_webrender = None
|
|
|
|
enable_webrender = None
|
|
|
|
|
2017-04-05 17:11:46 +03:00
|
|
|
if value.origin == 'default':
|
2018-05-09 22:24:38 +03:00
|
|
|
# if nothing is specified, default to building
|
|
|
|
build_webrender = True
|
2017-06-21 23:04:04 +03: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-23 00:38:09 +03: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 10:13:34 +03: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 19:42:53 +03:00
|
|
|
|
2017-05-29 17:11:18 +03: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 14:55:29 +03:00
|
|
|
@depends('--enable-rust-simd', target)
|
|
|
|
def rust_simd(value, target):
|
2018-06-05 14:56:11 +03:00
|
|
|
# As of 2018-06-05, the simd crate only works on aarch64,
|
|
|
|
# armv7, x86 and x86_64.
|
|
|
|
if target.cpu in ('aarch64', 'arm', 'x86', 'x86_64') and value:
|
2017-05-29 17:11:18 +03:00
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_RUST_SIMD', rust_simd)
|
|
|
|
set_define('MOZ_RUST_SIMD', rust_simd)
|
|
|
|
|
2016-08-16 07:28:33 +03: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 07:45:12 +03:00
|
|
|
|
|
|
|
# Speech-dispatcher support
|
|
|
|
# ==============================================================
|
|
|
|
@depends(toolkit)
|
|
|
|
def no_speechd_on_non_gtk(toolkit):
|
2018-01-10 12:04:59 +03:00
|
|
|
if toolkit != 'gtk3':
|
2016-08-16 07:45:12 +03:00
|
|
|
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 07:57:56 +03:00
|
|
|
|
2016-08-16 08:26:00 +03:00
|
|
|
# Speech API
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-webspeech', help='Disable support for HTML Speech API')
|
|
|
|
|
2016-08-16 08:33:09 +03:00
|
|
|
@depends('--disable-webspeech', '--help')
|
|
|
|
def webspeech(value, _):
|
2016-08-16 08:26:00 +03: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 08:33:09 +03: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 08:01:02 +03: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 08:07:05 +03:00
|
|
|
|
|
|
|
include('nss.configure')
|
2016-08-18 03:57:06 +03:00
|
|
|
|
2016-08-26 01:55:16 +03:00
|
|
|
# Graphics
|
|
|
|
# ==============================================================
|
|
|
|
option('--disable-skia', help='Disable use of Skia')
|
|
|
|
|
2016-12-21 17:31:13 +03:00
|
|
|
@depends('--disable-skia')
|
|
|
|
def skia(value):
|
|
|
|
if not value:
|
|
|
|
die('--disable-skia is not supported anymore')
|
|
|
|
else:
|
2016-08-26 01:55:16 +03: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')
|
|
|
|
|
2018-03-22 22:06:38 +03:00
|
|
|
@depends('--disable-skia-gpu', skia)
|
|
|
|
def skia_gpu(value, skia):
|
2016-08-26 01:55:16 +03:00
|
|
|
if value.origin == 'default':
|
|
|
|
if not skia:
|
2016-08-31 19:08:18 +03:00
|
|
|
return None
|
2016-08-26 01:55:16 +03: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 21:23:07 +03:00
|
|
|
option('--enable-skia-pdf', help='Enable Skia PDF')
|
|
|
|
|
2018-02-21 17:54:27 +03:00
|
|
|
@depends('--enable-skia-pdf', skia, target, milestone)
|
|
|
|
def skia_pdf(value, skia, target, milestone):
|
2016-10-26 21:23:07 +03:00
|
|
|
if value.origin == 'default':
|
|
|
|
if not skia:
|
|
|
|
return None
|
2018-02-21 17:54:27 +03:00
|
|
|
if milestone.is_nightly and target.os != 'WINNT':
|
2016-12-01 15:16:19 +03:00
|
|
|
return True
|
2016-10-26 21:23:07 +03: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-08 01:20:25 +03: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)
|
|
|
|
|
2018-03-22 21:30:53 +03:00
|
|
|
@depends(skia)
|
|
|
|
def skia_includes(skia):
|
2016-08-26 01:55:16 +03:00
|
|
|
includes = []
|
|
|
|
if skia:
|
|
|
|
includes += [
|
|
|
|
'/gfx/skia',
|
|
|
|
'/gfx/skia/skia/include/config',
|
|
|
|
'/gfx/skia/skia/include/core',
|
|
|
|
'/gfx/skia/skia/include/gpu',
|
|
|
|
'/gfx/skia/skia/include/utils',
|
|
|
|
]
|
|
|
|
return includes
|
|
|
|
|
|
|
|
set_config('SKIA_INCLUDES', skia_includes)
|
2016-09-01 16:07:01 +03:00
|
|
|
|
2017-06-30 03:17:46 +03: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-30 02:21:00 +03:00
|
|
|
# Mortar
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-mortar', help='Enable mortar extension')
|
|
|
|
|
|
|
|
set_config('MOZ_MORTAR', True, when='--enable-mortar')
|
|
|
|
|
2017-05-26 18:27:07 +03: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-17 02:49:14 +03:00
|
|
|
#
|
2017-05-26 18:27:07 +03: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-17 02:49:14 +03:00
|
|
|
|
2017-04-18 10:56:09 +03:00
|
|
|
@depends(target)
|
2017-05-26 18:27:07 +03:00
|
|
|
def marionette(target):
|
|
|
|
"""Enable Marionette by default, except on Android."""
|
|
|
|
if target.os != 'Android':
|
|
|
|
return True
|
2016-12-17 02:49:14 +03:00
|
|
|
|
2017-05-26 18:27:07 +03:00
|
|
|
imply_option('--enable-marionette', marionette, reason='Not Android')
|
2016-12-17 02:49:14 +03:00
|
|
|
|
|
|
|
option('--enable-marionette',
|
2017-05-26 18:27:07 +03:00
|
|
|
help='Enable Marionette remote protocol')
|
2016-12-17 02:49:14 +03:00
|
|
|
|
|
|
|
@depends('--enable-marionette')
|
|
|
|
def marionette(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('ENABLE_MARIONETTE', marionette)
|
2017-05-27 20:51:40 +03:00
|
|
|
|
|
|
|
# geckodriver WebDriver implementation
|
|
|
|
# ==============================================================
|
2018-08-22 19:26:10 +03:00
|
|
|
#
|
|
|
|
# Turn off geckodriver for build configs we don't handle yet,
|
|
|
|
# but allow --enable-geckodriver to override when compile environment is available.
|
|
|
|
# --disable-tests implies disabling geckodriver.
|
2017-05-27 20:51:40 +03:00
|
|
|
|
2018-08-22 19:26:10 +03:00
|
|
|
@depends('--enable-tests', target, cross_compiling, hazard_analysis, asan)
|
|
|
|
def geckodriver_default(enable_tests, target, cross_compile, hazard, asan):
|
|
|
|
if not enable_tests:
|
|
|
|
return False
|
2018-09-27 19:44:02 +03:00
|
|
|
# geckodriver depends on winapi 0.2.8, which doesn't work with AArch64.
|
|
|
|
if target.os == 'WINNT' and target.cpu == 'aarch64':
|
|
|
|
return False
|
2018-08-22 19:26:10 +03:00
|
|
|
if hazard or target.os == 'Android' or (asan and cross_compile):
|
|
|
|
return False
|
|
|
|
return True
|
2017-05-27 20:51:40 +03:00
|
|
|
|
2018-08-22 19:26:10 +03:00
|
|
|
option('--enable-geckodriver', default=geckodriver_default,
|
|
|
|
when='--enable-compile-environment',
|
|
|
|
help='Build geckodriver')
|
|
|
|
|
|
|
|
@depends('--enable-geckodriver', when='--enable-compile-environment')
|
|
|
|
def geckodriver(enabled):
|
|
|
|
if enabled:
|
|
|
|
return True
|
2017-05-27 20:51:40 +03:00
|
|
|
|
|
|
|
set_config('ENABLE_GECKODRIVER', geckodriver)
|
2017-07-13 20:12:23 +03:00
|
|
|
|
2017-09-21 02:29:39 +03:00
|
|
|
# WebRTC
|
|
|
|
# ========================================================
|
|
|
|
@depends(target)
|
|
|
|
def webrtc_default(target):
|
|
|
|
# Turn off webrtc for OS's we don't handle yet, but allow
|
|
|
|
# --enable-webrtc to override.
|
|
|
|
os_match = False
|
|
|
|
for os_fragment in ('linux', 'mingw', 'android', 'linuxandroid',
|
|
|
|
'dragonfly', 'freebsd', 'netbsd', 'openbsd',
|
|
|
|
'darwin'):
|
|
|
|
if target.raw_os.startswith(os_fragment):
|
|
|
|
os_match = True
|
|
|
|
|
|
|
|
cpu_match = False
|
2017-11-09 02:30:00 +03:00
|
|
|
if (target.cpu in ('x86_64', 'arm', 'aarch64', 'x86', 'ia64', 'mips32', 'mips64') or
|
2017-09-21 02:29:39 +03:00
|
|
|
target.cpu.startswith('ppc')):
|
|
|
|
cpu_match = True
|
|
|
|
|
|
|
|
if os_match and cpu_match:
|
|
|
|
return True
|
|
|
|
return False
|
|
|
|
|
|
|
|
option('--disable-webrtc', default=webrtc_default,
|
|
|
|
help='Disable support for WebRTC')
|
|
|
|
|
|
|
|
@depends('--disable-webrtc')
|
|
|
|
def webrtc(enabled):
|
|
|
|
if enabled:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_WEBRTC', webrtc)
|
|
|
|
set_define('MOZ_WEBRTC', webrtc)
|
|
|
|
add_old_configure_assignment('MOZ_WEBRTC', webrtc)
|
2018-10-01 21:51:27 +03:00
|
|
|
set_config('MOZ_SCTP', webrtc)
|
|
|
|
set_define('MOZ_SCTP', webrtc)
|
|
|
|
set_config('MOZ_SRTP', webrtc)
|
|
|
|
set_define('MOZ_SRTP', webrtc)
|
2017-09-21 02:29:39 +03:00
|
|
|
set_config('MOZ_WEBRTC_SIGNALING', webrtc)
|
|
|
|
set_define('MOZ_WEBRTC_SIGNALING', webrtc)
|
|
|
|
set_config('MOZ_PEERCONNECTION', webrtc)
|
|
|
|
set_define('MOZ_PEERCONNECTION', webrtc)
|
|
|
|
# MOZ_WEBRTC_ASSERT_ALWAYS turns on a number of safety asserts in
|
|
|
|
# opt/production builds (via MOZ_CRASH())
|
|
|
|
set_config('MOZ_WEBRTC_ASSERT_ALWAYS', webrtc)
|
|
|
|
set_define('MOZ_WEBRTC_ASSERT_ALWAYS', webrtc)
|
|
|
|
|
2018-10-01 21:51:27 +03:00
|
|
|
option('--enable-hardware-aec-ns', when=webrtc,
|
|
|
|
help='Enable support for hardware AEC and noise suppression')
|
|
|
|
|
|
|
|
set_config('MOZ_WEBRTC_HARDWARE_AEC_NS',
|
|
|
|
depends_if('--enable-hardware-aec-ns', when=webrtc)(lambda _: True))
|
|
|
|
set_define('MOZ_WEBRTC_HARDWARE_AEC_NS',
|
|
|
|
depends_if('--enable-hardware-aec-ns', when=webrtc)(lambda _: True))
|
|
|
|
|
2018-10-01 21:51:27 +03:00
|
|
|
# RAW media
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
@depends(target, webrtc)
|
|
|
|
def raw_media_default(target, webrtc):
|
|
|
|
if target.os == 'Android':
|
|
|
|
return True
|
|
|
|
if webrtc:
|
|
|
|
return True
|
|
|
|
|
|
|
|
option('--enable-raw', help='Enable support for RAW media',
|
|
|
|
default=raw_media_default)
|
|
|
|
|
|
|
|
set_config('MOZ_RAW', depends_if('--enable-raw')(lambda _: True))
|
|
|
|
set_define('MOZ_RAW', depends_if('--enable-raw')(lambda _: True))
|
|
|
|
|
2017-07-31 16:13:38 +03:00
|
|
|
# ASan Reporter Addon
|
|
|
|
# ==============================================================
|
|
|
|
option('--enable-address-sanitizer-reporter',
|
|
|
|
help='Enable Address Sanitizer Reporter Extension')
|
|
|
|
|
|
|
|
@depends('--enable-address-sanitizer-reporter')
|
|
|
|
def enable_asan_reporter(value):
|
|
|
|
if value:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_ASAN_REPORTER', enable_asan_reporter)
|
|
|
|
set_define('MOZ_ASAN_REPORTER', enable_asan_reporter)
|
2018-04-19 16:28:59 +03:00
|
|
|
add_old_configure_assignment('MOZ_ASAN_REPORTER', enable_asan_reporter)
|
2017-11-16 01:52:26 +03:00
|
|
|
|
|
|
|
# Elfhack
|
|
|
|
# ==============================================================
|
2018-07-05 03:23:56 +03:00
|
|
|
with only_when('--enable-compile-environment'):
|
|
|
|
@depends(host, target)
|
|
|
|
def has_elfhack(host, target):
|
|
|
|
return target.kernel == 'Linux' and host.kernel == 'Linux' and \
|
|
|
|
target.cpu in ('arm', 'x86', 'x86_64')
|
|
|
|
|
|
|
|
@depends('--enable-release')
|
|
|
|
def default_elfhack(release):
|
|
|
|
return bool(release)
|
2017-11-16 01:52:26 +03:00
|
|
|
|
2018-07-05 03:23:56 +03:00
|
|
|
with only_when(has_elfhack):
|
|
|
|
option('--disable-elf-hack', default=default_elfhack,
|
|
|
|
help='Disable elf hacks')
|
2017-11-16 01:52:26 +03:00
|
|
|
|
2018-07-05 03:23:56 +03:00
|
|
|
set_config('USE_ELF_HACK',
|
|
|
|
depends_if('--enable-elf-hack')(lambda _: True))
|
2018-01-25 00:55:05 +03:00
|
|
|
|
|
|
|
|
|
|
|
@depends(check_build_environment)
|
|
|
|
def idl_roots(build_env):
|
|
|
|
return namespace(ipdl_root=os.path.join(build_env.topobjdir, 'ipc', 'ipdl'),
|
|
|
|
webidl_root=os.path.join(build_env.topobjdir,
|
|
|
|
'dom', 'bindings'))
|
|
|
|
|
|
|
|
set_config('WEBIDL_ROOT', idl_roots.webidl_root)
|
|
|
|
set_config('IPDL_ROOT', idl_roots.ipdl_root)
|
2018-02-02 15:45:00 +03:00
|
|
|
|
|
|
|
# Proxy bypass protection
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--enable-proxy-bypass-protection',
|
|
|
|
help='Prevent suspected or confirmed proxy bypasses')
|
|
|
|
|
|
|
|
@depends_if('--enable-proxy-bypass-protection')
|
|
|
|
def proxy_bypass_protection(_):
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_PROXY_BYPASS_PROTECTION', proxy_bypass_protection)
|
|
|
|
set_define('MOZ_PROXY_BYPASS_PROTECTION', proxy_bypass_protection)
|
2018-05-28 10:15:13 +03:00
|
|
|
|
2018-10-04 03:29:29 +03:00
|
|
|
# MIDL
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
@depends(c_compiler, toolchain_prefix)
|
|
|
|
def midl_names(c_compiler, toolchain_prefix):
|
|
|
|
if c_compiler and c_compiler.type in ['gcc', 'clang']:
|
|
|
|
# mingw
|
|
|
|
widl = ('widl', )
|
|
|
|
if toolchain_prefix:
|
|
|
|
prefixed = tuple('%s%s' % (p, 'widl') for p in toolchain_prefix)
|
|
|
|
widl = prefixed + widl
|
|
|
|
return widl
|
|
|
|
|
|
|
|
return ('midl',)
|
|
|
|
|
|
|
|
@depends(target, '--enable-compile-environment')
|
|
|
|
def check_for_midl(target, compile_environment):
|
|
|
|
if target.os != 'WINNT':
|
|
|
|
return
|
|
|
|
|
|
|
|
if compile_environment:
|
|
|
|
return True
|
|
|
|
|
|
|
|
|
|
|
|
midl = check_prog('MIDL', midl_names, when=check_for_midl, allow_missing=True)
|
|
|
|
|
2018-10-04 03:29:29 +03:00
|
|
|
|
|
|
|
@depends(c_compiler, target, when=depends(midl, target)(lambda m, t: m and t.kernel == 'WINNT'))
|
|
|
|
def midl_flags(c_compiler, target):
|
|
|
|
if c_compiler and c_compiler.type in ('msvc', 'clang-cl'):
|
|
|
|
env = {
|
|
|
|
'x86': 'win32',
|
|
|
|
'x86_64': 'x64',
|
|
|
|
'aarch64': 'arm64',
|
|
|
|
}[target.cpu]
|
|
|
|
return ['-env', env]
|
|
|
|
|
|
|
|
# mingw
|
|
|
|
return {
|
|
|
|
'x86': ['--win32', '-m32'],
|
|
|
|
'x86_64': ['--win64', '-m64'],
|
|
|
|
}[target.cpu]
|
|
|
|
|
|
|
|
|
|
|
|
set_config('MIDL_FLAGS', midl_flags)
|
2018-10-04 03:29:29 +03:00
|
|
|
|
2018-10-04 03:29:29 +03:00
|
|
|
# Accessibility
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--disable-accessibility', help='Disable accessibility support')
|
|
|
|
|
|
|
|
@depends('--disable-accessibility', check_for_midl, midl, c_compiler)
|
|
|
|
def accessibility(value, check_for_midl, midl, c_compiler):
|
|
|
|
enabled = bool(value)
|
|
|
|
|
|
|
|
if not enabled:
|
|
|
|
return
|
|
|
|
|
|
|
|
if check_for_midl and not midl:
|
|
|
|
if c_compiler and c_compiler.type in ('gcc', 'clang'):
|
|
|
|
die('You have accessibility enabled, but widl could not be found. '
|
|
|
|
'Add --disable-accessibility to your mozconfig or install widl. '
|
|
|
|
'See https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 for details.')
|
|
|
|
else:
|
|
|
|
die('MIDL could not be found. '
|
|
|
|
'Building accessibility without MIDL is not supported.')
|
|
|
|
|
|
|
|
return enabled
|
|
|
|
|
|
|
|
|
|
|
|
set_config('ACCESSIBILITY', accessibility)
|
|
|
|
set_define('ACCESSIBILITY', accessibility)
|
|
|
|
add_old_configure_assignment('ACCESSIBILITY', accessibility)
|
|
|
|
|
2018-05-28 10:15:13 +03:00
|
|
|
# Addon signing
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--with-unsigned-addon-scopes',
|
|
|
|
nargs='+', choices=('app', 'system'),
|
|
|
|
help='Addon scopes where signature is not required')
|
|
|
|
|
|
|
|
@depends('--with-unsigned-addon-scopes')
|
|
|
|
def unsigned_addon_scopes(scopes):
|
|
|
|
return namespace(
|
|
|
|
app='app' in scopes or None,
|
|
|
|
system='system' in scopes or None,
|
|
|
|
)
|
|
|
|
|
|
|
|
set_config('MOZ_UNSIGNED_APP_SCOPE', unsigned_addon_scopes.app)
|
|
|
|
set_config('MOZ_UNSIGNED_SYSTEM_SCOPE', unsigned_addon_scopes.system)
|
2018-07-24 00:58:45 +03:00
|
|
|
|
|
|
|
# Launcher process (Windows only)
|
|
|
|
# ==============================================================
|
|
|
|
|
2018-09-26 21:46:24 +03:00
|
|
|
@depends(target, milestone)
|
|
|
|
def launcher_process_default(target, milestone):
|
|
|
|
return target.os == 'WINNT' and milestone.is_nightly
|
|
|
|
|
|
|
|
option('--enable-launcher-process', default=launcher_process_default,
|
|
|
|
help='Enable launcher process by default')
|
2018-07-24 00:58:45 +03:00
|
|
|
|
|
|
|
@depends('--enable-launcher-process', target)
|
|
|
|
def launcher(value, target):
|
|
|
|
enabled = bool(value)
|
|
|
|
if enabled and target.os != 'WINNT':
|
|
|
|
die('Cannot enable launcher process on %s', target.os)
|
|
|
|
if enabled:
|
|
|
|
return True
|
|
|
|
|
|
|
|
set_config('MOZ_LAUNCHER_PROCESS', launcher)
|
|
|
|
set_define('MOZ_LAUNCHER_PROCESS', launcher)
|
2018-08-27 23:07:51 +03:00
|
|
|
|
|
|
|
# Prio
|
|
|
|
# ==============================================================
|
2018-09-26 01:45:07 +03:00
|
|
|
@depends(c_compiler)
|
|
|
|
def libprio(info):
|
2018-08-27 23:07:51 +03:00
|
|
|
if info:
|
2018-09-26 01:45:07 +03:00
|
|
|
# MSVC is not supported by libprio.
|
|
|
|
if info.type in ('msvc',):
|
2018-08-27 23:07:51 +03:00
|
|
|
return None
|
2018-08-31 07:57:39 +03:00
|
|
|
return True
|
2018-08-27 23:07:51 +03:00
|
|
|
|
|
|
|
set_config('MOZ_LIBPRIO', libprio)
|
|
|
|
|
2018-10-01 21:51:28 +03:00
|
|
|
# Maintenance service (Windows only)
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--enable-maintenance-service', help='Enable building of maintenance service',
|
|
|
|
when=target_is_windows, default=target_is_windows)
|
|
|
|
|
|
|
|
set_define('MOZ_MAINTENANCE_SERVICE',
|
|
|
|
depends_if('--enable-maintenance-service',
|
|
|
|
when=target_is_windows)(lambda _: True))
|
|
|
|
set_config('MOZ_MAINTENANCE_SERVICE',
|
|
|
|
depends_if('--enable-maintenance-service',
|
|
|
|
when=target_is_windows)(lambda _: True))
|
2018-10-01 21:51:28 +03:00
|
|
|
|
|
|
|
# Bundled fonts on desktop platform
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
@depends(target)
|
|
|
|
def bundled_fonts_default(target):
|
|
|
|
return target.os == 'WINNT' or target.kernel == 'Linux'
|
|
|
|
|
|
|
|
@depends(build_project)
|
|
|
|
def allow_bundled_fonts(project):
|
|
|
|
return project == 'browser'
|
|
|
|
|
|
|
|
option('--enable-bundled-fonts', default=bundled_fonts_default,
|
|
|
|
when=allow_bundled_fonts,
|
|
|
|
help='Enable support for bundled fonts on desktop platforms')
|
|
|
|
|
|
|
|
set_define('MOZ_BUNDLED_FONTS',
|
|
|
|
depends_if('--enable-bundled-fonts', when=allow_bundled_fonts)(lambda _: True))
|
2018-10-01 21:51:28 +03:00
|
|
|
|
|
|
|
# Verify MAR signatures
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--enable-verify-mar', help='Enable verifying MAR signatures')
|
|
|
|
|
|
|
|
set_define('MOZ_VERIFY_MAR_SIGNATURE',
|
|
|
|
depends_if('--enable-verify-mar')(lambda _: True))
|
|
|
|
set_config('MOZ_VERIFY_MAR_SIGNATURE',
|
|
|
|
depends_if('--enable-verify-mar')(lambda _: True))
|
2018-10-01 21:51:27 +03:00
|
|
|
|
|
|
|
# TaskTracer
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
option('--enable-tasktracer', help='Enable TaskTracer')
|
|
|
|
|
|
|
|
set_define('MOZ_TASK_TRACER', depends_if('--enable-tasktracer')(lambda _: True))
|
|
|
|
set_config('MOZ_TASK_TRACER', depends_if('--enable-tasktracer')(lambda _: True))
|
2018-10-01 21:51:27 +03:00
|
|
|
|
|
|
|
# Reflow counting
|
|
|
|
# ==============================================================
|
|
|
|
|
|
|
|
@depends(moz_debug, '--help')
|
|
|
|
def reflow_perf(debug, _):
|
|
|
|
if debug:
|
|
|
|
return True
|
|
|
|
|
|
|
|
option('--enable-reflow-perf', help='Enable reflow performance tracing',
|
|
|
|
default=reflow_perf)
|
|
|
|
|
|
|
|
# The difference in conditions here comes from the initial implementation
|
|
|
|
# in old-configure, which was unexplained there as well.
|
|
|
|
set_define('MOZ_REFLOW_PERF', depends_if('--enable-reflow-perf')(lambda _: True))
|
|
|
|
set_define('MOZ_REFLOW_PERF_DSP', reflow_perf)
|