Bug 1869043 add a main thread record of track audio outputs r=padenot
[gecko.git] / build / moz.configure / update-programs.configure
blob3be098308d61a9b60904de7615b1dc850a0e07ed
1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # Updater
9 # ==============================================================
10 @depends(build_project)
11 def updater_default(build_project):
12     return build_project != "mobile/android"
15 option(
16     "--enable-updater",
17     default=updater_default,
18     help="{Enable|Disable} building the updater",
21 set_config("MOZ_UPDATER", True, when="--enable-updater")
22 set_define("MOZ_UPDATER", True, when="--enable-updater")
24 # Updates that do not verify signatures
25 # ==============================================================
27 option(
28     "--enable-unverified-updates",
29     default=False,
30     help="Enable application update without verifying MAR or updater binary signatures",
34 @depends("--enable-unverified-updates", "--enable-compile-environment")
35 def disable_unverified_updates(unverified_updates, compile_environment):
36     if unverified_updates:
37         if not compile_environment:
38             die("--enable-unverified-updates requires --enable-compile-environment")
39     return not unverified_updates
42 set_define(
43     "MOZ_VERIFY_MAR_SIGNATURE",
44     depends_if(disable_unverified_updates)(lambda _: True),
46 set_config(
47     "MOZ_VERIFY_MAR_SIGNATURE",
48     True,
49     depends_if(disable_unverified_updates)(lambda _: True),
52 set_config(
53     "DISABLE_UPDATER_AUTHENTICODE_CHECK",
54     True,
55     depends_if("--enable-unverified-updates")(lambda _: True),
58 # Use NSS for MAR signatures even on platforms where system libraries are
59 # supported (currently Windows and macOS).
60 # ==============================================================
62 can_toggle_nss_mar = target_is_windows | target_is_osx
64 option(
65     "--enable-nss-mar",
66     when=can_toggle_nss_mar,
67     help="Enable using NSS to check MAR signatures instead of system crypto.",
71 @depends(
72     depends("--enable-nss-mar", when=can_toggle_nss_mar)(lambda x: x),
73     can_toggle_nss_mar,
75 def enable_nss_mar(enabled, can_toggle_nss_mar):
76     return enabled or not can_toggle_nss_mar
79 set_config("MOZ_USE_NSS_FOR_MAR", True, when=enable_nss_mar)
81 # Maintenance service (Windows only)
82 # ==============================================================
85 @depends("--enable-updater")
86 def maintenance_service_default(updater):
87     return bool(updater)
90 option(
91     "--enable-maintenance-service",
92     when=target_is_windows,
93     default=maintenance_service_default,
94     help="{Enable|Disable} building of maintenance service",
97 set_define(
98     "MOZ_MAINTENANCE_SERVICE",
99     depends_if("--enable-maintenance-service", when=target_is_windows)(lambda _: True),
101 set_config(
102     "MOZ_MAINTENANCE_SERVICE",
103     depends_if("--enable-maintenance-service", when=target_is_windows)(lambda _: True),
107 @depends("--enable-maintenance-service", "--enable-updater", when=target_is_windows)
108 def check_maintenance_service(mainteance_service, updater):
109     if mainteance_service and not updater:
110         die("--enable-updater is required to --enable-maintenance-service")
111     return mainteance_service
114 # Update agent (currently Windows and macOS only)
115 # This is an independent task that runs on a schedule to
116 # check for, download, and install updates.
117 # ==============================================================
120 @depends("--enable-backgroundtasks", "--enable-updater", build_project)
121 def update_agent_default(backgroundtasks, updater, build_project):
122     return bool(backgroundtasks) and bool(updater) and build_project == "browser"
125 option(
126     "--disable-update-agent",
127     when=target_is_windows | target_is_osx,
128     default=update_agent_default,
129     help="{Enable|Disable} building update agent",
132 set_config(
133     "MOZ_UPDATE_AGENT",
134     depends_if("--enable-update-agent", when=target_is_windows | target_is_osx)(
135         lambda _: True
136     ),
140 @depends(
141     "--enable-update-agent",
142     "--enable-backgroundtasks",
143     "--enable-updater",
144     when=target_is_windows | target_is_osx,
146 def check_update_agent(update_agent, backgroundtasks, updater):
147     if update_agent and not backgroundtasks:
148         die("--enable-backgroundtasks is required to --enable-update-agent")
149     if update_agent and not updater:
150         die("--enable-updater is required to --enable-update-agent")
151     return update_agent
154 # Enable or disable the default browser agent, which monitors the user's default
155 # browser setting on Windows.
156 # ==============================================================================
159 @depends(target, build_project)
160 def default_browser_agent_default(target, build_project):
161     return target.os == "WINNT" and build_project == "browser"
164 option(
165     "--enable-default-browser-agent",
166     default=default_browser_agent_default,
167     help="{Enable|Disable} building the default browser agent",
171 @depends("--enable-default-browser-agent", when=target_is_windows)
172 def default_agent_flag(enabled):
173     if enabled:
174         return True
177 set_config("MOZ_DEFAULT_BROWSER_AGENT", default_agent_flag)
180 # Enable or disable the notification server, which allows Windows native
181 # notifications to persist when the application is not running and relaunch as
182 # necessary.
183 # ==============================================================================
184 @depends(target, build_project)
185 def notification_server_default(target, build_project):
186     return target.os == "WINNT" and build_project in (
187         "browser",
188         "comm/mail",
189     )
192 option(
193     "--disable-notification-server",
194     when=notification_server_default,
195     help="Disable building the notification server",
198 set_config("MOZ_NOTIFICATION_SERVER", True, when="--enable-notification-server")