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"]
25 DIRS += ["rust/mozbuild"]
27 CRAMTEST_MANIFESTS += [
28 "tests/cram/cram.ini",
31 DEFINES["ACCEPTED_MAR_CHANNEL_IDS"] = CONFIG["ACCEPTED_MAR_CHANNEL_IDS"]
33 if CONFIG["MOZ_BUILD_APP"] == "browser":
34 PYTHON_UNITTEST_MANIFESTS += [
35 "compare-mozconfig/python.ini",
38 if CONFIG["ENABLE_TESTS"] or CONFIG["MOZ_DMD"]:
39 FINAL_TARGET_FILES += ["/tools/rb/fix_stacks.py"]
42 FINAL_TARGET_FILES += ["/memory/replace/dmd/dmd.py"]
44 # Put a useful .gdbinit and .gdbinit.py in $objdir/build, to be picked up
45 # automatically by GDB via either libxul.so-gdb.py or js-gdb.py.
46 OBJDIR_PP_FILES.build += [".gdbinit.py.in"]
47 OBJDIR_FILES.build += [".gdbinit.loader"]
48 OBJDIR_FILES.build += [".gdbinit"]
50 # Install the clang-cl runtime library for ASAN next to the binaries we produce.
51 if CONFIG["MOZ_ASAN"] and CONFIG["CC_TYPE"] == "clang-cl":
52 FINAL_TARGET_FILES += ["%" + CONFIG["MOZ_CLANG_RT_ASAN_LIB_PATH"]]
53 FINAL_TARGET_FILES += [
54 "%" + CONFIG["MOZ_CLANG_RT_ASAN_LIB_PATH"].replace(".dll", ".pdb")
57 # Install the clang runtime library for ASAN next to the binaries we produce.
58 if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android" and CONFIG["MOZ_ASAN"]:
59 FINAL_TARGET_FILES += ["%" + CONFIG["MOZ_CLANG_RT_ASAN_LIB_PATH"]]
61 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android" and CONFIG["LLVM_SYMBOLIZER"]:
62 FINAL_TARGET_FILES += ["/" + CONFIG["LLVM_SYMBOLIZER"]]
64 if CONFIG["MOZ_APP_BASENAME"]:
66 "TOPOBJDIR": TOPOBJDIR,
76 "MOZ_APP_REMOTINGNAME",
77 "MOZ_CRASHREPORTER_URL",
79 appini_defines[var] = CONFIG[var]
81 if CONFIG["MOZ_APP_DISPLAYNAME"] != CONFIG["MOZ_APP_BASENAME"]:
82 appini_defines["MOZ_APP_DISPLAYNAME"] = CONFIG["MOZ_APP_DISPLAYNAME"]
84 if CONFIG["MOZ_BUILD_APP"] == "browser":
85 appini_defines["MOZ_BUILD_APP_IS_BROWSER"] = True
87 if CONFIG["MOZ_APP_PROFILE"]:
88 appini_defines["MOZ_APP_PROFILE"] = CONFIG["MOZ_APP_PROFILE"]
90 for var in ("MOZ_CRASHREPORTER", "MOZ_PROFILE_MIGRATOR", "MOZ_UPDATER"):
92 appini_defines[var] = True
94 appini_defines["MOZ_APPUPDATE_HOST"] = "aus5.mozilla.org"
95 if CONFIG["MOZ_APPUPDATE_HOST"]:
96 appini_defines["MOZ_APPUPDATE_HOST"] = CONFIG["MOZ_APPUPDATE_HOST"]
100 script="../python/mozbuild/mozbuild/action/preprocessor.py",
101 entry_point="generate",
102 inputs=["application.ini.in"],
104 "-D%s=%s" % (k, "1" if v is True else v)
105 for k, v in sorted(appini_defines.items(), key=lambda t: t[0])
109 FINAL_TARGET_FILES += ["!application.ini"]
110 if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android" and CONFIG["MOZ_UPDATER"]:
111 FINAL_TARGET_PP_FILES += ["update-settings.ini"]
114 "application.ini.h", script="appini_header.py", inputs=["!application.ini"]
118 # Put a .lldbinit in the bin directory and the objdir, to be picked up
119 # automatically by LLDB when we debug executables using either of those two
120 # directories as the current working directory. The .lldbinit file will
121 # load $(topsrcdir)/.lldbinit, which is where the actual debugging commands are.
122 DEFINES["topsrcdir"] = TOPSRCDIR
123 DEFINES["topobjdir"] = TOPOBJDIR
124 FINAL_TARGET_PP_FILES += [".lldbinit.in"]
125 OBJDIR_FILES += ["!/dist/bin/.lldbinit"]
127 # Put the .ycm_extra_conf.py file at the root of the objdir. It is used by
128 # the vim plugin YouCompleteMe.
129 OBJDIR_FILES += ["/.ycm_extra_conf.py"]
131 if CONFIG["MOZ_VALGRIND"]:
132 OBJDIR_FILES._valgrind += [
133 "valgrind/cross-architecture.sup",
134 "valgrind/i386-pc-linux-gnu.sup",
135 "valgrind/x86_64-pc-linux-gnu.sup",