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 BUG_COMPONENT = ("Firefox Build System", "General")
10 # This cannot be named "build" because of bug 922191.
11 SPHINX_TREES["buildsystem"] = "docs"
13 with Files("docs/**"):
14 SCHEDULES.exclusive = ["docs"]
16 if CONFIG["OS_ARCH"] == "WINNT":
21 if CONFIG["MOZ_STDCXX_COMPAT"]:
22 DIRS += ["unix/stdc++compat"]
24 CRAMTEST_MANIFESTS += [
25 "tests/cram/cram.ini",
28 DEFINES["ACCEPTED_MAR_CHANNEL_IDS"] = CONFIG["ACCEPTED_MAR_CHANNEL_IDS"]
30 if CONFIG["MOZ_BUILD_APP"] == "browser":
31 PYTHON_UNITTEST_MANIFESTS += [
32 "compare-mozconfig/python.ini",
35 if CONFIG["ENABLE_TESTS"] or CONFIG["MOZ_DMD"]:
36 FINAL_TARGET_FILES += ["/tools/rb/fix_stacks.py"]
39 FINAL_TARGET_FILES += ["/memory/replace/dmd/dmd.py"]
41 # Put a useful .gdbinit and .gdbinit.py in $objdir/build, to be picked up
42 # automatically by GDB via either libxul.so-gdb.py or js-gdb.py.
43 OBJDIR_PP_FILES.build += [".gdbinit.py.in"]
44 OBJDIR_FILES.build += [".gdbinit.loader"]
45 OBJDIR_FILES.build += [".gdbinit"]
47 # Install the clang-cl runtime library for ASAN next to the binaries we produce.
48 if CONFIG["MOZ_ASAN"] and CONFIG["CC_TYPE"] == "clang-cl":
49 FINAL_TARGET_FILES += ["%" + CONFIG["MOZ_CLANG_RT_ASAN_LIB_PATH"]]
50 FINAL_TARGET_FILES += [
51 "%" + CONFIG["MOZ_CLANG_RT_ASAN_LIB_PATH"].replace(".dll", ".pdb")
54 # Install the clang runtime library for ASAN next to the binaries we produce.
55 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android" and CONFIG["MOZ_ASAN"]:
56 FINAL_TARGET_FILES += ["%" + CONFIG["MOZ_CLANG_RT_ASAN_LIB_PATH"]]
58 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android" and CONFIG["LLVM_SYMBOLIZER"]:
59 FINAL_TARGET_FILES += ["/" + CONFIG["LLVM_SYMBOLIZER"]]
61 if CONFIG["MOZ_APP_BASENAME"]:
63 "TOPOBJDIR": TOPOBJDIR,
73 "MOZ_APP_REMOTINGNAME",
74 "MOZ_CRASHREPORTER_URL",
76 appini_defines[var] = CONFIG[var]
78 if CONFIG["MOZ_APP_DISPLAYNAME"] != CONFIG["MOZ_APP_BASENAME"]:
79 appini_defines["MOZ_APP_DISPLAYNAME"] = CONFIG["MOZ_APP_DISPLAYNAME"]
81 if CONFIG["MOZ_BUILD_APP"] == "browser":
82 appini_defines["MOZ_BUILD_APP_IS_BROWSER"] = True
84 if CONFIG["MOZ_APP_PROFILE"]:
85 appini_defines["MOZ_APP_PROFILE"] = CONFIG["MOZ_APP_PROFILE"]
87 for var in ("MOZ_CRASHREPORTER", "MOZ_PROFILE_MIGRATOR", "MOZ_UPDATER"):
89 appini_defines[var] = True
91 appini_defines["MOZ_APPUPDATE_HOST"] = "aus5.mozilla.org"
92 if CONFIG["MOZ_APPUPDATE_HOST"]:
93 appini_defines["MOZ_APPUPDATE_HOST"] = CONFIG["MOZ_APPUPDATE_HOST"]
97 script="../python/mozbuild/mozbuild/action/preprocessor.py",
98 entry_point="generate",
99 inputs=["application.ini.in"],
101 "-D%s=%s" % (k, "1" if v is True else v)
102 for k, v in sorted(appini_defines.items(), key=lambda t: t[0])
106 FINAL_TARGET_FILES += ["!application.ini"]
107 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android" and CONFIG["MOZ_UPDATER"]:
108 FINAL_TARGET_PP_FILES += ["update-settings.ini"]
111 "application.ini.h", script="appini_header.py", inputs=["!application.ini"]
115 # Put a .lldbinit in the bin directory and the objdir, to be picked up
116 # automatically by LLDB when we debug executables using either of those two
117 # directories as the current working directory. The .lldbinit file will
118 # load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are.
119 DEFINES["topsrcdir"] = TOPSRCDIR
120 DEFINES["topobjdir"] = TOPOBJDIR
121 FINAL_TARGET_PP_FILES += [".lldbinit.in"]
122 OBJDIR_FILES += ["!/dist/bin/.lldbinit"]
124 # Put the .ycm_extra_conf.py file at the root of the objdir. It is used by
125 # the vim plugin YouCompleteMe.
126 OBJDIR_FILES += ["/.ycm_extra_conf.py"]
128 if CONFIG["MOZ_VALGRIND"]:
129 OBJDIR_FILES._valgrind += [
130 "valgrind/cross-architecture.sup",
131 "valgrind/i386-pc-linux-gnu.sup",
132 "valgrind/x86_64-pc-linux-gnu.sup",