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/.
7 include("../components/telemetry/telemetry-constants.mozbuild")
10 BUG_COMPONENT = ("Toolkit", "Startup and Profile System")
12 if CONFIG["OS_ARCH"] == "WINNT":
13 TEST_DIRS += ["test/win"]
15 MOCHITEST_MANIFESTS += ["test/mochitest.toml"]
16 BROWSER_CHROME_MANIFESTS += ["test/browser.toml"]
17 XPCSHELL_TESTS_MANIFESTS += ["test/xpcshell.toml"]
18 MARIONETTE_MANIFESTS += ["test/marionette/marionette.toml"]
21 "nsINativeAppSupport.idl",
22 "nsIXREDirProvider.idl",
25 if CONFIG["OS_ARCH"] == "WINNT":
27 "nsIWinAppHelper.idl",
30 XPIDL_MODULE = "xulapp"
37 "AutoSQLiteLifetime.h",
39 "CmdLineAndEnvUtils.h",
41 "MultiInstanceLock.h",
45 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
46 EXPORTS += ["EventTracer.h"]
48 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
51 "DllPrefetchExperimentRegistryInfo.h",
56 "/toolkit/mozapps/update/common/pathhash.cpp",
57 "/toolkit/mozapps/update/common/updateutils_win.cpp",
58 "DllPrefetchExperimentRegistryInfo.cpp",
59 "nsNativeAppSupportWin.cpp",
62 DEFINES["PROXY_PRINTING"] = 1
64 "../components/printingui",
66 if CONFIG["MOZ_LAUNCHER_PROCESS"]:
68 "LauncherRegistryInfo.h",
71 "LauncherRegistryInfo.cpp",
76 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
78 "MacRunFromDmgUtils.h",
81 "MacApplicationDelegate.mm",
82 "MacAutoreleasePool.mm",
84 "MacRunFromDmgUtils.mm",
85 "nsCommandLineServiceMac.mm",
86 "nsNativeAppSupportCocoa.mm",
87 "updaterfileutils_osx.mm",
89 DEFINES["PROXY_PRINTING"] = 1
91 "../components/printingui",
93 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "uikit":
95 "nsNativeAppSupportDefault.cpp",
96 "UIKitDirProvider.mm",
98 elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
100 "nsNativeAppSupportUnix.cpp",
102 CXXFLAGS += CONFIG["MOZ_X11_SM_CFLAGS"]
105 "nsNativeAppSupportDefault.cpp",
108 if CONFIG["MOZ_HAS_REMOTE"]:
110 "../components/remote",
113 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
115 "nsGDKErrorHandler.cpp",
122 if CONFIG["MOZ_X11"]:
123 EXPORTS += ["nsX11ErrorHandler.h"]
125 "nsX11ErrorHandler.cpp",
128 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
130 "nsAndroidStartup.cpp",
133 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
135 "MultiInstanceLock.cpp",
139 "/toolkit/mozapps/update/common/commonupdatedir.cpp",
140 "AutoSQLiteLifetime.cpp",
142 "CmdLineAndEnvUtils.cpp",
144 "nsConsoleWriter.cpp",
145 "nsNativeAppSupportBase.cpp",
147 "nsXREDirProvider.cpp",
150 # nsAppRunner.cpp and ProfileReset.cpp cannot be built in unified mode because
151 # they pull in OS X system headers.
152 # nsEmbedFunctions.cpp cannot be built in unified mode because it pulls in X11 headers.
154 "../../other-licenses/nsis/Contrib/CityHash/cityhash/city.cpp",
156 "nsEmbedFunctions.cpp",
160 if CONFIG["MOZ_INSTRUMENT_EVENT_LOOP"]:
165 if CONFIG["MOZ_UPDATER"]:
166 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
168 "nsUpdateDriver.cpp",
169 "nsUpdateSyncManager.cpp",
172 if CONFIG["MOZ_PDF_PRINTING"]:
173 DEFINES["PROXY_PRINTING"] = 1
175 "../components/printingui",
182 include("/ipc/chromium/chromium-config.mozbuild")
184 FINAL_LIBRARY = "xul"
186 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
187 DEFINES["USE_GLX_TEST"] = True
193 "MOZ_APP_DISPLAYNAME",
197 "MOZ_WIDGET_TOOLKIT",
199 DEFINES[var] = '"%s"' % CONFIG[var]
201 if CONFIG["MOZ_DEFAULT_BROWSER_AGENT"] and CONFIG["OS_ARCH"] == "WINNT":
202 DEFINES["MOZ_DEFAULT_BROWSER_AGENT"] = CONFIG["MOZ_DEFAULT_BROWSER_AGENT"]
204 if CONFIG["MOZ_UPDATER"] and CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
205 DEFINES["MOZ_UPDATER"] = True
207 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
208 DEFINES["WIN32_LEAN_AND_MEAN"] = True
209 DEFINES["UNICODE"] = True
210 DEFINES["_UNICODE"] = True
212 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
213 DEFINES["ANDROID_PACKAGE_NAME"] = '"%s"' % CONFIG["ANDROID_PACKAGE_NAME"]
215 DEFINES["MOZ_DISTRIBUTION_ID"] = '"%s"' % CONFIG["MOZ_DISTRIBUTION_ID"]
217 if CONFIG["TARGET_XPCOM_ABI"]:
218 DEFINES["TARGET_OS_ABI"] = '"%s_%s"' % (
220 CONFIG["TARGET_XPCOM_ABI"],
223 if CONFIG["OS_ARCH"] == "Linux" and "lib64" in CONFIG["libdir"]:
224 DEFINES["HAVE_USR_LIB64_DIR"] = True
226 DEFINES["GRE_MILESTONE"] = CONFIG["GRE_MILESTONE"]
227 DEFINES["MOZ_APP_VERSION_DISPLAY"] = CONFIG["MOZ_APP_VERSION_DISPLAY"]
229 for var in ("APP_VERSION", "APP_ID"):
230 DEFINES[var] = CONFIG["MOZ_%s" % var]
232 if CONFIG["MOZ_BUILD_APP"] == "browser":
233 DEFINES["MOZ_BUILD_APP_IS_BROWSER"] = True
235 if CONFIG["MOZ_USE_NSS_FOR_MAR"]:
236 DEFINES["MAR_NSS"] = True
239 "../../other-licenses/nsis/Contrib/CityHash/cityhash",
240 "../components/find",
241 "../components/printingui/ipc",
242 "../components/windowwatcher",
243 "../mozapps/update/common",
247 "/dom/commandhandler",
249 "/dom/webbrowserpersist",
250 "/testing/gtest/mozilla",
251 "/toolkit/crashreporter",
255 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
257 "/security/sandbox/chromium",
258 "/security/sandbox/chromium-shim",
261 if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "Linux":
266 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
273 CXXFLAGS += CONFIG["MOZ_DBUS_CFLAGS"]
275 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
276 CXXFLAGS += CONFIG["MOZ_GTK3_CFLAGS"]
277 CXXFLAGS += CONFIG["MOZ_PANGO_CFLAGS"]
279 DEFINES["TOPOBJDIR"] = TOPOBJDIR
281 if not CONFIG["MOZ_ARTIFACT_BUILDS"]:
282 FINAL_TARGET_PP_FILES += ["platform.ini"]
284 if CONFIG["ENABLE_TESTS"]:
285 DIRS += ["test/gtest"]