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("build/moz.configure/init.configure")
10 # - Gecko-specific options and rules should go in toolkit/moz.configure.
11 # - Firefox-specific options and rules should go in browser/moz.configure.
12 # - Fennec-specific options and rules should go in
13 # mobile/android/moz.configure.
14 # - Spidermonkey-specific options and rules should go in js/moz.configure.
18 "--enable-artifact-build-symbols",
19 depends(artifact_builds)(lambda v: False if v is None else None),
20 reason="--disable-artifact-builds",
24 "--enable-artifact-build-symbols",
27 help="Download symbols when artifact builds are enabled.",
31 @depends("--enable-artifact-build-symbols", "MOZ_AUTOMATION", target)
32 def enable_artifact_build_symbols(value, automation, target):
36 if target.os == "Android" and not automation:
42 set_config("MOZ_ARTIFACT_BUILD_SYMBOLS", enable_artifact_build_symbols)
45 @depends("--enable-artifact-builds")
46 def imply_disable_compile_environment(value):
54 help="moz.build file that will be executed as if it were appended to"
55 " every moz.build in the tree.",
59 @depends_if("MOZ_BUILD_HOOK")
61 def moz_build_hook(value):
62 if not os.path.exists(value[0]):
63 die(f"MOZ_BUILD_HOOK set to {value[0]} but the file doesn't exist")
64 return os.path.abspath(value[0])
67 set_config("MOZ_BUILD_HOOK", moz_build_hook)
72 help="For builds that do not support symbols in the normal fashion,"
73 " generate and copy them into the resulting build archive.",
76 set_config("MOZ_COPY_PDBS", depends_if("MOZ_COPY_PDBS")(lambda _: True))
78 imply_option("--enable-compile-environment", imply_disable_compile_environment)
80 option("--disable-compile-environment", help="Disable compiler/library checks")
83 @depends("--disable-compile-environment")
84 def compile_environment(compile_env):
89 set_config("COMPILE_ENVIRONMENT", compile_environment)
90 add_old_configure_assignment("COMPILE_ENVIRONMENT", compile_environment)
92 option("--disable-tests", help="Do not build test libraries & programs")
95 @depends("--disable-tests")
96 def enable_tests(value):
101 set_config("ENABLE_TESTS", enable_tests)
102 set_define("ENABLE_TESTS", enable_tests)
105 @depends(enable_tests)
106 def gtest_has_rtti(value):
111 set_define("GTEST_HAS_RTTI", gtest_has_rtti)
114 @depends(target, enable_tests)
115 def linux_gtest_defines(target, enable_tests):
116 if enable_tests and target.os == "Android":
117 return namespace(os_linux_android=True, use_own_tr1_tuple=True, has_clone="0")
120 set_define("GTEST_OS_LINUX_ANDROID", linux_gtest_defines.os_linux_android)
121 set_define("GTEST_USE_OWN_TR1_TUPLE", linux_gtest_defines.use_own_tr1_tuple)
122 set_define("GTEST_HAS_CLONE", linux_gtest_defines.has_clone)
127 help="Enable building with developer debug info "
128 "(using the given compiler flags).",
132 @depends("--enable-debug")
133 def moz_debug(debug):
138 set_config("MOZ_DEBUG", moz_debug)
139 set_define("MOZ_DEBUG", moz_debug)
140 # Override any value MOZ_DEBUG may have from the environment when passing it
141 # down to old-configure.
142 add_old_configure_assignment("MOZ_DEBUG", depends("--enable-debug")(lambda x: bool(x)))
145 "MOZ_DIAGNOSTIC_ASSERT_ENABLED",
147 when=moz_debug | milestone.is_early_beta_or_earlier,
150 "MOZ_DIAGNOSTIC_ASSERT_ENABLED",
152 when=moz_debug | milestone.is_early_beta_or_earlier,
156 "--with-debug-label",
158 help="Debug DEBUG_<value> for each comma-separated value given",
162 @depends(moz_debug, "--with-debug-label")
163 def debug_defines(debug, labels):
165 return ["DEBUG"] + ["DEBUG_%s" % label for label in labels]
166 return ["NDEBUG", "TRIMMED"]
169 set_config("MOZ_DEBUG_DEFINES", debug_defines)
171 option(env="MOZ_PGO", help="Build with profile guided optimizations")
173 set_config("MOZ_PGO", depends("MOZ_PGO")(lambda x: bool(x)))
176 # Imply --enable-release when MOZILLA_OFFICIAL is set rather than adjusting the
177 # default so that we can't have both MOZILLA_OFFICIAL and --disable-release set.
178 imply_option("--enable-release", mozilla_official)
182 default=milestone.is_release_or_beta | depends("MOZ_AUTOMATION")(lambda x: bool(x)),
183 help="{Build|Do not build} with more conservative, release "
184 "engineering-oriented options.{ This may slow down builds.|}",
188 @depends("--enable-release")
189 def developer_options(value):
194 add_old_configure_assignment("DEVELOPER_OPTIONS", developer_options)
195 set_config("DEVELOPER_OPTIONS", developer_options)
198 # hybrid build handling
199 # ==============================================================
202 "--disable-unified-build",
203 help="Enable building modules in non unified context",
206 set_config("ENABLE_UNIFIED_BUILD", True, when="--disable-unified-build")
209 include("build/moz.configure/bootstrap.configure")
212 # The execution model of the configure sandbox doesn't allow for
213 # check_prog to use bootstrap_search_path directly because check_prog
214 # comes first, so we use a trick to allow it. Uses of check_prog
215 # happening before here won't allow bootstrap.
219 def check_prog(*args, **kwargs):
220 kwargs["bootstrap_search_path"] = bootstrap_search_path
221 return check_prog(*args, **kwargs)
224 check_prog("WGET", ("wget",), allow_missing=True)
227 include("build/moz.configure/toolchain.configure", when="--enable-compile-environment")
229 include("build/moz.configure/pkg.configure")
230 include("build/moz.configure/memory.configure", when="--enable-compile-environment")
231 include("build/moz.configure/headers.configure", when="--enable-compile-environment")
232 include("build/moz.configure/libraries.configure", when="--enable-compile-environment")
233 include("build/moz.configure/warnings.configure", when="--enable-compile-environment")
234 include("build/moz.configure/flags.configure", when="--enable-compile-environment")
235 include("build/moz.configure/lto-pgo.configure", when="--enable-compile-environment")
236 # rust.configure is included by js/moz.configure.
239 option("--enable-valgrind", help="Enable Valgrind integration hooks")
241 valgrind_h = check_header("valgrind/valgrind.h", when="--enable-valgrind")
244 @depends("--enable-valgrind", valgrind_h)
245 def check_valgrind(valgrind, valgrind_h):
248 die("--enable-valgrind specified but Valgrind is not installed")
252 set_define("MOZ_VALGRIND", check_valgrind)
253 set_config("MOZ_VALGRIND", check_valgrind)
256 @depends(target, host)
257 def is_openbsd(target, host):
258 return target.kernel == "OpenBSD" or host.kernel == "OpenBSD"
266 help="Shared library version for OpenBSD systems",
270 @depends("SO_VERSION", when=is_openbsd)
271 def so_version(value):
276 def library_name_info_template(host_or_target):
277 assert host_or_target in {host, target}
279 host: host_windows_abi,
280 target: target_windows_abi,
283 @depends(host_or_target, host_or_target.abi | windows_abi, so_version)
284 def library_name_info_impl(host_or_target, windows_abi, so_version):
285 if host_or_target.kernel == "WINNT":
286 # There aren't artifacts for mingw builds, so it's OK that the
287 # results are inaccurate in that case.
288 if windows_abi and windows_abi != "msvc":
290 dll=namespace(prefix="", suffix=".dll"),
291 lib=namespace(prefix="lib", suffix="a"),
292 import_lib=namespace(prefix="lib", suffix="a"),
293 obj=namespace(prefix="", suffix="o"),
297 dll=namespace(prefix="", suffix=".dll"),
298 lib=namespace(prefix="", suffix="lib"),
299 import_lib=namespace(prefix="", suffix="lib"),
300 obj=namespace(prefix="", suffix="obj"),
303 elif host_or_target.kernel == "Darwin":
305 dll=namespace(prefix="lib", suffix=".dylib"),
306 lib=namespace(prefix="lib", suffix="a"),
307 import_lib=namespace(prefix=None, suffix=""),
308 obj=namespace(prefix="", suffix="o"),
311 so = ".so.%s" % so_version
316 dll=namespace(prefix="lib", suffix=so),
317 lib=namespace(prefix="lib", suffix="a"),
318 import_lib=namespace(prefix=None, suffix=""),
319 obj=namespace(prefix="", suffix="o"),
322 return library_name_info_impl
325 host_library_name_info = library_name_info_template(host)
326 library_name_info = library_name_info_template(target)
328 set_config("DLL_PREFIX", library_name_info.dll.prefix)
329 set_config("DLL_SUFFIX", library_name_info.dll.suffix)
330 set_config("HOST_DLL_PREFIX", host_library_name_info.dll.prefix)
331 set_config("HOST_DLL_SUFFIX", host_library_name_info.dll.suffix)
332 set_config("LIB_PREFIX", library_name_info.lib.prefix)
333 set_config("LIB_SUFFIX", library_name_info.lib.suffix)
334 set_config("OBJ_SUFFIX", library_name_info.obj.suffix)
335 # Lots of compilation tests depend on this variable being present.
336 add_old_configure_assignment("OBJ_SUFFIX", library_name_info.obj.suffix)
337 set_config("IMPORT_LIB_SUFFIX", library_name_info.import_lib.suffix)
339 "MOZ_DLL_PREFIX", depends(library_name_info.dll.prefix)(lambda s: '"%s"' % s)
342 "MOZ_DLL_SUFFIX", depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s)
344 set_config("HOST_LIB_PREFIX", host_library_name_info.lib.prefix)
345 set_config("HOST_IMPORT_LIB_SUFFIX", host_library_name_info.import_lib.suffix)
346 set_config("WASM_OBJ_SUFFIX", "wasm")
350 def plain_llvm_or_prefixed(name, llvm_name=None):
351 # look for a tool, using the following alternatives, in that order:
352 # 1. llvm-${llvm_name}, or llvm-${name} if ${llvm_name} is not provided
353 # 2. ${toolchain_prefix}${name}
356 @depends(llvm_tool("llvm-{}".format(llvm_name or name)), toolchain_prefix)
357 def plain_llvm_or_prefixed(llvm_tool, toolchain_prefix):
358 commands = [llvm_tool[0], name]
359 for prefix in toolchain_prefix or ():
360 commands.insert(1, f"{prefix}{name}")
361 return tuple(commands)
363 return plain_llvm_or_prefixed
366 def validate_readelf(path):
367 # llvm-readelf from llvm < 8 doesn't support the GNU binutils-compatible `-d`
368 # flag. We could try running `$path -d $some_binary` but we might be cross
369 # compiling and not have a binary at hand to run that against. `$path -d` alone
370 # would fail whether the flag is supported or not. So we resort to look for the
371 # option in the `--help` output, which fortunately, s compatible between
372 # llvm-readelf and readelf.
373 retcode, stdout, stderr = get_cmd_output(path, "--help")
374 return retcode == 0 and any(l.startswith(" -d ") for l in stdout.splitlines())
377 @depends("--enable-compile-environment", target, host)
378 def readelf_when(compile_env, target, host):
379 return compile_env and any(
380 x.kernel not in ("Darwin", "WINNT") for x in (target, host)
384 readelf = check_prog(
386 plain_llvm_or_prefixed("readelf"),
388 paths=clang_search_path,
389 validate=validate_readelf,
393 def validate_objcopy(path):
394 if "llvm-objcopy" not in path:
396 # llvm-objcopy doesn't support --only-keep-debug before llvm 9.0.
397 retcode, stdout, stderr = get_cmd_output(path, "--help")
398 return retcode == 0 and any(
399 l.startswith(" --only-keep-debug ") for l in stdout.splitlines()
405 plain_llvm_or_prefixed("objcopy"),
407 paths=clang_search_path,
408 validate=validate_objcopy,
412 # Make `profiling` available to this file even when js/moz.configure
413 # doesn't end up included.
414 profiling = dependable(False)
415 # Same for js_standalone
416 js_standalone = dependable(False)
417 js_shared = dependable(False)
418 moz_linker = dependable(False)
420 fold_libs = dependable(False)
422 dmd = dependable(False)
424 include(include_project_configure)
428 @imports(_from="mozbuild.backend", _import="backends")
429 def build_backends_choices(_):
430 return tuple(backends)
433 @deprecated_option("--enable-build-backend", nargs="+", choices=build_backends_choices)
434 def build_backend(backends):
436 return tuple("+%s" % b for b in backends)
439 imply_option("--build-backends", build_backend)
445 "--enable-artifact-builds",
446 "--disable-compile-environment",
448 "--enable-application",
452 def build_backend_defaults(
462 project = application[0]
467 all_backends = ["FasterMake+RecursiveMake"]
469 all_backends = ["RecursiveMake", "FasterMake"]
472 and target.os == "WINNT"
473 and compile_environment
474 and project not in ("mobile/android", "memory", "tools/update-programs")
476 all_backends.append("VisualStudio")
477 if compile_environment and project not in ("memory", "tools/update-programs"):
478 all_backends.append("Clangd")
479 return tuple(all_backends) or None
485 default=build_backend_defaults,
486 choices=build_backends_choices,
487 help="Build backends to generate",
491 @depends("--build-backends")
492 def build_backends(backends):
496 set_config("BUILD_BACKENDS", build_backends)
499 # Determine whether to build the gtest xul. This happens in automation
500 # on Android and Desktop platforms with the exception of:
501 # - Windows PGO, where linking xul-gtest.dll takes too long;
502 # - Android other than x86_64, where gtest is not required.
508 when="--enable-compile-environment",
510 def build_gtest(build_project, target, automation, enable_tests):
514 and build_project in ("browser", "comm/mail", "mobile/android")
515 and not (target.os == "Android" and target.cpu != "x86_64")
520 "--enable-gtest-in-build",
522 help="{Enable|Force disable} building the gtest libxul during the build.",
523 when="--enable-compile-environment",
526 set_config("LINK_GTEST_DURING_COMPILE", True, when="--enable-gtest-in-build")
529 # ==============================================================
531 "--enable-ui-locale",
533 help="Select the user interface locale (default: en-US)",
536 set_config("MOZ_UI_LOCALE", depends("--enable-ui-locale")(lambda x: x))
540 help="Disable using ICU4X",
543 set_config("MOZ_ICU4X", True, when="--enable-icu4x")
544 set_define("MOZ_ICU4X", True, when="--enable-icu4x")
546 # clang-plugin location
547 # ==============================================================
550 @depends(host_library_name_info, build_environment, when="--enable-clang-plugin")
551 def clang_plugin_path(library_name_info, build_env):
552 topobjdir = build_env.topobjdir
553 if topobjdir.endswith("/js/src"):
554 topobjdir = topobjdir[:-7]
555 return os.path.abspath(
561 % (library_name_info.dll.prefix, library_name_info.dll.suffix),
566 set_config("CLANG_PLUGIN", clang_plugin_path)
567 add_old_configure_assignment("CLANG_PLUGIN", clang_plugin_path)
571 # ==============================================================
572 awk = check_prog("AWK", ("gawk", "mawk", "nawk", "awk"), paths=prefer_mozillabuild_path)
574 # Until the AWK variable is not necessary in old-configure
578 def awk_for_old_configure(value):
582 add_old_configure_assignment("AWK", awk_for_old_configure)
586 # ==============================================================
587 option(env="MAKE", nargs=1, help="Path to GNU make")
590 @depends("MAKE", host)
591 def possible_makes(make, host):
594 candidates.append(make[0])
595 if host.kernel == "WINNT":
596 candidates.extend(("mozmake", "mingw32-make", "make", "gmake"))
598 candidates.extend(("gmake", "make"))
602 check_prog("GMAKE", possible_makes, bootstrap="mozmake")
605 # ==============================================================
607 option(env="WATCHMAN", nargs=1, help="Path to the watchman program")
610 @depends(host, "WATCHMAN")
611 @checking("for watchman", callback=lambda w: w.path if w else "not found")
612 def watchman(host, prog):
613 # On Windows, `watchman` is only supported on 64-bit hosts.
614 if host.os == "WINNT" and host.cpu != "x86_64":
618 prog = find_program("watchman")
623 # `watchman version` will talk to the Watchman daemon service.
624 # This can hang due to permissions problems. e.g.
625 # https://github.com/facebook/watchman/issues/376. So use
626 # `watchman --version` to prevent a class of failures.
627 out = check_cmd_output(prog, "--version", onerror=lambda: None)
631 return namespace(path=prog, version=Version(out.strip()))
634 @depends_if(watchman)
635 @checking("for watchman version")
636 def watchman_version(w):
640 set_config("WATCHMAN", watchman.path)
643 @depends_all(hg_version, hg_config, watchman)
644 @checking("for watchman Mercurial integration")
646 def watchman_hg(hg_version, hg_config, watchman):
647 if hg_version < Version("3.8"):
648 return "no (Mercurial 3.8+ required)"
651 mode_disabled = False
653 for k in ("extensions.fsmonitor", "extensions.hgext.fsmonitor"):
654 if k in hg_config and hg_config[k] != "!":
657 mode_disabled = hg_config.get("fsmonitor.mode") == "off"
660 return "no (fsmonitor extension not enabled)"
662 return "no (fsmonitor.mode=off disables fsmonitor)"
667 # Miscellaneous programs
668 # ==============================================================
669 check_prog("XARGS", ("xargs",))
673 def extra_programs(target):
674 if target.kernel == "Darwin":
676 MKFSHFS=("newfs_hfs", "mkfs.hfsplus"),
677 HFS_TOOL=("hfsplus",),
679 if target.os == "GNU" and target.kernel == "Linux":
680 return namespace(RPMBUILD=("rpmbuild",))
683 check_prog("MKFSHFS", extra_programs.MKFSHFS, allow_missing=True)
684 check_prog("HFS_TOOL", extra_programs.HFS_TOOL, allow_missing=True)
685 check_prog("RPMBUILD", extra_programs.RPMBUILD, allow_missing=True)
691 bootstrap="nsis/bin",
693 when=target_is_windows,
696 # Make sure the version of makensis is up to date.
700 @checking("for NSIS version")
702 def nsis_version(nsis):
703 nsis_min_version = "3.0b1"
706 return die("Failed to get nsis version.")
708 out = check_cmd_output(nsis, "-version", onerror=onerror)
710 m = re.search(r"(?<=v)[0-9]+\.[0-9]+((a|b|rc)[0-9]+)?", out)
713 raise FatalCheckError("Unknown version of makensis")
714 ver = Version(m.group(0))
716 # Versions comparisons don't quite work well with beta versions, so ensure
717 # it works for the non-beta version.
718 if ver < nsis_min_version and (ver >= "3.0a" or ver < "3"):
719 raise FatalCheckError(
720 "To build the installer you must have NSIS"
721 " version %s or greater in your path" % nsis_min_version
727 # And that makensis is 32-bit (but only on Windows).
728 @depends_if(nsis, when=depends(host)(lambda h: h.kernel == "WINNT"))
729 @checking("for 32-bit NSIS")
730 def nsis_binary_type(nsis):
731 bin_type = windows_binary_type(nsis)
732 if bin_type != "win32":
733 raise FatalCheckError("%s is not a 32-bit Windows application" % nsis)
738 # And any flags we have to give to makensis
740 def nsis_flags(host):
741 if host.kernel != "WINNT":
746 set_config("MAKENSISU_FLAGS", nsis_flags)
748 check_prog("7Z", ("7z", "7za"), allow_missing=True, when=target_is_windows)
749 check_prog("UPX", ("upx",), allow_missing=True, when=target_is_windows)
754 llvm_tool("dsymutil"),
755 when=compile_environment & target_is_darwin,
756 paths=clang_search_path,
762 plain_llvm_or_prefixed("otool"),
763 when=compile_environment & target_is_darwin,
764 paths=clang_search_path,
769 plain_llvm_or_prefixed("install_name_tool", llvm_name="install-name-tool"),
770 when=compile_environment & target_is_darwin & js_standalone,
771 paths=clang_search_path,
776 when=compile_environment,
777 help="Enable stripping of libs & executables",
780 # This should be handled as a `when` once bug 1617793 is fixed.
783 @depends("--enable-strip", c_compiler, when=compile_environment)
784 def enable_strip(strip, c_compiler):
785 if strip and c_compiler.type != "clang-cl":
789 set_config("ENABLE_STRIP", enable_strip)
792 "--disable-install-strip",
793 when=compile_environment,
794 help="Enable stripping of libs & executables when packaging",
797 # This should be handled as a `when` once bug 1617793 is fixed.
800 @depends("--enable-install-strip", c_compiler, when=compile_environment)
801 def enable_install_strip(strip, c_compiler):
802 if strip and c_compiler.type != "clang-cl":
806 set_config("PKG_STRIP", enable_install_strip)
809 @depends("--enable-strip", "--enable-install-strip", when=compile_environment)
810 def strip(strip, install_strip):
811 return strip or install_strip
814 option(env="STRIP_FLAGS", nargs=1, when=strip, help="Flags for the strip command")
817 @depends("STRIP_FLAGS", profiling, target, when=strip)
818 def strip_flags(flags, profiling, target):
820 return flags[0].split()
822 # Only strip debug info and symbols when profiling is enabled, keeping
824 if target.kernel == "Darwin":
826 elif target.os == "Android":
827 # The tooling we use with Android supports detached symbols, and the
828 # size increase caused by local symbols are too much for mobile. So,
829 # don't restrict the amount of stripping with a flag.
832 return ["--strip-debug"]
833 # Otherwise strip everything we can, which happens without flags on non-Darwin.
834 # On Darwin, it tries to strip things it can't, so we need to limit its scope.
835 elif target.kernel == "Darwin":
839 set_config("STRIP_FLAGS", strip_flags)
842 def validate_strip(path):
843 if "llvm-strip" not in path:
845 # llvm-strip doesn't support -S before llvm 8.0.
846 retcode, stdout, stderr = get_cmd_output(path, "--help")
847 return retcode == 0 and any(l.startswith(" -S ") for l in stdout.splitlines())
850 @depends("--enable-compile-environment", target, host)
851 def strip_when(compile_env, target, host):
852 return compile_env and any(x.kernel != "WINNT" for x in (target, host))
857 plain_llvm_or_prefixed("strip"),
859 paths=clang_search_path,
860 validate=validate_strip,
864 @depends(js_standalone, target)
865 def system_zlib_default(js_standalone, target):
868 and target.kernel not in ("WINNT", "Darwin")
869 and target.os != "Android"
874 "--with-system-zlib",
876 default=system_zlib_default,
877 help="{Use|Do not use} system libz",
882 @depends("--with-system-zlib", when=use_pkg_config)
883 def with_system_zlib_option(with_system_zlib):
884 return with_system_zlib
887 @depends(with_system_zlib_option)
888 def deprecated_system_zlib_path(value):
889 if value and len(value) == 1:
891 "--with-system-zlib=PATH is not supported anymore. Please use "
892 "--with-system-zlib and set any necessary pkg-config environment variable."
896 pkg_check_modules("MOZ_ZLIB", "zlib >= 1.2.3", when="--with-system-zlib")
898 set_config("MOZ_SYSTEM_ZLIB", True, when="--with-system-zlib")
901 @depends(with_system_zlib_option, js_shared, moz_linker, target.os)
902 def zlib_in_mozglue(system_zlib, js_shared, linker, os):
903 if not system_zlib and (js_shared or linker or os == "Android"):
907 set_config("ZLIB_IN_MOZGLUE", zlib_in_mozglue)
908 set_define("ZLIB_IN_MOZGLUE", zlib_in_mozglue)
911 with only_when(cross_compiling):
915 help="Host JavaScript runtime, if any, to use during cross compiles",
917 set_config("JS_BINARY", depends_if("JS_BINARY")(lambda value: value[0]))
919 # Please do not add configure checks from here on.
921 # Fallthrough to autoconf-based configure
922 include("build/moz.configure/old.configure")
925 include("js/sub.configure", when=compile_environment & toolkit)
928 @depends(build_environment, configure_cache)
929 @imports(_import="json")
930 @imports(_from="pathlib", _import="Path")
931 def save_cache(build_environment, configure_cache):
932 cache_file = Path(build_environment.topobjdir) / "configure.cache"
934 with cache_file.open(mode="w") as fd:
935 json.dump(configure_cache, fd, indent=4)
938 @depends(build_environment, build_project)
939 @imports("__sandbox__")
941 @imports(_from="os.path", _import="exists")
942 def config_status_deps(build_env, build_project):
943 topsrcdir = build_env.topsrcdir
944 topobjdir = build_env.topobjdir
946 if not topobjdir.endswith("js/src"):
947 extra_deps = [os.path.join(topobjdir, ".mozconfig.json")]
949 # mozconfig changes may impact js configure.
950 extra_deps = [os.path.join(topobjdir[:-7], ".mozconfig.json")]
952 confvars = os.path.join(topsrcdir, build_project, "confvars.sh")
954 extra_deps.append(confvars)
957 list(__sandbox__._all_paths)
960 os.path.join(topsrcdir, "CLOBBER"),
961 os.path.join(topsrcdir, "configure"),
962 os.path.join(topsrcdir, "js", "src", "configure"),
963 os.path.join(topsrcdir, "nsprpub", "configure"),
964 os.path.join(topsrcdir, "config", "milestone.txt"),
965 os.path.join(topsrcdir, "browser", "config", "version.txt"),
966 os.path.join(topsrcdir, "browser", "config", "version_display.txt"),
967 os.path.join(topsrcdir, "python", "sites", "build.txt"),
968 os.path.join(topsrcdir, "python", "sites", "common.txt"),
969 os.path.join(topsrcdir, "python", "sites", "mach.txt"),
970 os.path.join(topsrcdir, "python", "mach", "mach", "site.py"),
971 os.path.join(topsrcdir, "aclocal.m4"),
972 os.path.join(topsrcdir, "old-configure.in"),
973 os.path.join(topsrcdir, "js", "src", "aclocal.m4"),
974 os.path.join(topsrcdir, "js", "src", "old-configure.in"),
976 + glob.glob(os.path.join(topsrcdir, "build", "autoconf", "*.m4"))
980 set_config("CONFIG_STATUS_DEPS", config_status_deps)
981 # Please do not add anything after setting config_dep_paths.