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):
53 help="For builds that do not support symbols in the normal fashion,"
54 " generate and copy them into the resulting build archive.",
57 set_config("MOZ_COPY_PDBS", depends_if("MOZ_COPY_PDBS")(lambda _: True))
59 imply_option("--enable-compile-environment", imply_disable_compile_environment)
61 option("--disable-compile-environment", help="Disable compiler/library checks")
64 @depends("--disable-compile-environment")
65 def compile_environment(compile_env):
70 set_config("COMPILE_ENVIRONMENT", compile_environment)
71 add_old_configure_assignment("COMPILE_ENVIRONMENT", compile_environment)
73 option("--disable-tests", help="Do not build test libraries & programs")
76 @depends("--disable-tests")
77 def enable_tests(value):
82 set_config("ENABLE_TESTS", enable_tests)
83 set_define("ENABLE_TESTS", enable_tests)
86 @depends(enable_tests)
87 def gtest_has_rtti(value):
92 set_define("GTEST_HAS_RTTI", gtest_has_rtti)
95 @depends(target, enable_tests)
96 def linux_gtest_defines(target, enable_tests):
97 if enable_tests and target.os == "Android":
98 return namespace(os_linux_android=True, use_own_tr1_tuple=True, has_clone="0")
101 set_define("GTEST_OS_LINUX_ANDROID", linux_gtest_defines.os_linux_android)
102 set_define("GTEST_USE_OWN_TR1_TUPLE", linux_gtest_defines.use_own_tr1_tuple)
103 set_define("GTEST_HAS_CLONE", linux_gtest_defines.has_clone)
108 help="Enable building with developer debug info "
109 "(using the given compiler flags).",
113 @depends("--enable-debug")
114 def moz_debug(debug):
119 set_config("MOZ_DEBUG", moz_debug)
120 set_define("MOZ_DEBUG", moz_debug)
121 # Override any value MOZ_DEBUG may have from the environment when passing it
122 # down to old-configure.
123 add_old_configure_assignment("MOZ_DEBUG", depends("--enable-debug")(lambda x: bool(x)))
126 "MOZ_DIAGNOSTIC_ASSERT_ENABLED",
128 when=moz_debug | milestone.is_early_beta_or_earlier,
131 "MOZ_DIAGNOSTIC_ASSERT_ENABLED",
133 when=moz_debug | milestone.is_early_beta_or_earlier,
137 "--with-debug-label",
139 help="Debug DEBUG_<value> for each comma-separated value given",
143 @depends(moz_debug, "--with-debug-label")
144 def debug_defines(debug, labels):
146 return ["DEBUG"] + ["DEBUG_%s" % label for label in labels]
147 return ["NDEBUG", "TRIMMED"]
150 set_config("MOZ_DEBUG_DEFINES", debug_defines)
152 option(env="MOZ_PGO", help="Build with profile guided optimizations")
154 set_config("MOZ_PGO", depends("MOZ_PGO")(lambda x: bool(x)))
157 # Imply --enable-release when MOZILLA_OFFICIAL is set rather than adjusting the
158 # default so that we can't have both MOZILLA_OFFICIAL and --disable-release set.
159 imply_option("--enable-release", mozilla_official)
163 default=milestone.is_release_or_beta | depends("MOZ_AUTOMATION")(lambda x: bool(x)),
164 help="{Build|Do not build} with more conservative, release "
165 "engineering-oriented options.{ This may slow down builds.|}",
169 @depends("--enable-release")
170 def developer_options(value):
175 add_old_configure_assignment("DEVELOPER_OPTIONS", developer_options)
176 set_config("DEVELOPER_OPTIONS", developer_options)
179 # hybrid build handling
180 # ==============================================================
183 "--disable-unified-build",
184 help="Enable building modules in non unified context",
187 set_config("ENABLE_UNIFIED_BUILD", True, when="--disable-unified-build")
190 include("build/moz.configure/bootstrap.configure")
193 # The execution model of the configure sandbox doesn't allow for
194 # check_prog to use bootstrap_search_path directly because check_prog
195 # comes first, so we use a trick to allow it. Uses of check_prog
196 # happening before here won't allow bootstrap.
198 def check_prog(*args, **kwargs):
199 kwargs["bootstrap_search_path"] = bootstrap_search_path
200 return check_prog(*args, **kwargs)
203 check_prog("WGET", ("wget",), allow_missing=True)
206 include("build/moz.configure/toolchain.configure", when="--enable-compile-environment")
208 include("build/moz.configure/pkg.configure")
209 include("build/moz.configure/memory.configure", when="--enable-compile-environment")
210 include("build/moz.configure/headers.configure", when="--enable-compile-environment")
211 include("build/moz.configure/warnings.configure", when="--enable-compile-environment")
212 include("build/moz.configure/flags.configure", when="--enable-compile-environment")
213 include("build/moz.configure/lto-pgo.configure", when="--enable-compile-environment")
214 # rust.configure is included by js/moz.configure.
216 option("--enable-valgrind", help="Enable Valgrind integration hooks")
218 valgrind_h = check_header("valgrind/valgrind.h", when="--enable-valgrind")
221 @depends("--enable-valgrind", valgrind_h)
222 def check_valgrind(valgrind, valgrind_h):
225 die("--enable-valgrind specified but Valgrind is not installed")
229 set_define("MOZ_VALGRIND", check_valgrind)
230 set_config("MOZ_VALGRIND", check_valgrind)
233 @depends(target, host)
234 def is_openbsd(target, host):
235 return target.kernel == "OpenBSD" or host.kernel == "OpenBSD"
243 help="Shared library version for OpenBSD systems",
247 @depends("SO_VERSION", when=is_openbsd)
248 def so_version(value):
253 def library_name_info_template(host_or_target):
254 assert host_or_target in {host, target}
256 host: host_windows_abi,
257 target: target_windows_abi,
260 @depends(host_or_target, host_or_target.abi | windows_abi, so_version)
261 def library_name_info_impl(host_or_target, windows_abi, so_version):
262 if host_or_target.kernel == "WINNT":
263 # There aren't artifacts for mingw builds, so it's OK that the
264 # results are inaccurate in that case.
265 if windows_abi and windows_abi != "msvc":
267 dll=namespace(prefix="", suffix=".dll"),
268 lib=namespace(prefix="lib", suffix="a"),
269 import_lib=namespace(prefix="lib", suffix="a"),
270 obj=namespace(prefix="", suffix="o"),
274 dll=namespace(prefix="", suffix=".dll"),
275 lib=namespace(prefix="", suffix="lib"),
276 import_lib=namespace(prefix="", suffix="lib"),
277 obj=namespace(prefix="", suffix="obj"),
280 elif host_or_target.kernel == "Darwin":
282 dll=namespace(prefix="lib", suffix=".dylib"),
283 lib=namespace(prefix="lib", suffix="a"),
284 import_lib=namespace(prefix=None, suffix=""),
285 obj=namespace(prefix="", suffix="o"),
288 so = ".so.%s" % so_version
293 dll=namespace(prefix="lib", suffix=so),
294 lib=namespace(prefix="lib", suffix="a"),
295 import_lib=namespace(prefix=None, suffix=""),
296 obj=namespace(prefix="", suffix="o"),
299 return library_name_info_impl
302 host_library_name_info = library_name_info_template(host)
303 library_name_info = library_name_info_template(target)
305 set_config("DLL_PREFIX", library_name_info.dll.prefix)
306 set_config("DLL_SUFFIX", library_name_info.dll.suffix)
307 set_config("HOST_DLL_PREFIX", host_library_name_info.dll.prefix)
308 set_config("HOST_DLL_SUFFIX", host_library_name_info.dll.suffix)
309 set_config("LIB_PREFIX", library_name_info.lib.prefix)
310 set_config("LIB_SUFFIX", library_name_info.lib.suffix)
311 set_config("OBJ_SUFFIX", library_name_info.obj.suffix)
312 # Lots of compilation tests depend on this variable being present.
313 add_old_configure_assignment("OBJ_SUFFIX", library_name_info.obj.suffix)
314 set_config("IMPORT_LIB_SUFFIX", library_name_info.import_lib.suffix)
316 "MOZ_DLL_PREFIX", depends(library_name_info.dll.prefix)(lambda s: '"%s"' % s)
319 "MOZ_DLL_SUFFIX", depends(library_name_info.dll.suffix)(lambda s: '"%s"' % s)
321 set_config("HOST_LIB_PREFIX", host_library_name_info.lib.prefix)
322 set_config("HOST_IMPORT_LIB_SUFFIX", host_library_name_info.import_lib.suffix)
323 set_config("WASM_OBJ_SUFFIX", "wasm")
325 # Make `profiling` available to this file even when js/moz.configure
326 # doesn't end up included.
327 profiling = dependable(False)
328 # Same for js_standalone
329 js_standalone = dependable(False)
330 js_shared = dependable(False)
331 moz_linker = dependable(False)
333 fold_libs = dependable(False)
335 dmd = dependable(False)
337 include(include_project_configure)
341 @imports(_from="mozbuild.backend", _import="backends")
342 def build_backends_choices(_):
343 return tuple(backends)
346 @deprecated_option("--enable-build-backend", nargs="+", choices=build_backends_choices)
347 def build_backend(backends):
349 return tuple("+%s" % b for b in backends)
352 imply_option("--build-backends", build_backend)
358 "--enable-artifact-builds",
359 "--disable-compile-environment",
361 "--enable-application",
365 def build_backend_defaults(
375 project = application[0]
380 all_backends = ["FasterMake+RecursiveMake"]
382 all_backends = ["RecursiveMake", "FasterMake"]
385 and target.os == "WINNT"
386 and compile_environment
387 and project not in ("mobile/android", "memory", "tools/update-programs")
389 all_backends.append("VisualStudio")
390 if compile_environment and project not in ("memory", "tools/update-programs"):
391 all_backends.append("Clangd")
392 return tuple(all_backends) or None
398 default=build_backend_defaults,
399 choices=build_backends_choices,
400 help="Build backends to generate",
404 @depends("--build-backends")
405 def build_backends(backends):
409 set_config("BUILD_BACKENDS", build_backends)
412 # Determine whether to build the gtest xul. This happens in automation
413 # on Android and Desktop platforms with the exception of:
414 # - Windows PGO, where linking xul-gtest.dll takes too long;
415 # - Android other than x86_64, where gtest is not required.
421 when="--enable-compile-environment",
423 def build_gtest(build_project, target, automation, enable_tests):
427 and build_project in ("browser", "comm/mail", "mobile/android")
428 and not (target.os == "Android" and target.cpu != "x86_64")
433 "--enable-gtest-in-build",
435 help="{Enable|Force disable} building the gtest libxul during the build.",
436 when="--enable-compile-environment",
439 set_config("LINK_GTEST_DURING_COMPILE", True, when="--enable-gtest-in-build")
442 # ==============================================================
444 "--enable-ui-locale",
446 help="Select the user interface locale (default: en-US)",
449 set_config("MOZ_UI_LOCALE", depends("--enable-ui-locale")(lambda x: x))
453 help="An experiment to use ICU4X instead of ICU4C. See intl/ICU4X.md",
456 set_config("MOZ_ICU4X", True, when="--enable-icu4x")
458 # clang-plugin location
459 # ==============================================================
462 @depends(host_library_name_info, build_environment, when="--enable-clang-plugin")
463 def clang_plugin_path(library_name_info, build_env):
464 topobjdir = build_env.topobjdir
465 if topobjdir.endswith("/js/src"):
466 topobjdir = topobjdir[:-7]
467 return os.path.abspath(
473 % (library_name_info.dll.prefix, library_name_info.dll.suffix),
478 set_config("CLANG_PLUGIN", clang_plugin_path)
479 add_old_configure_assignment("CLANG_PLUGIN", clang_plugin_path)
483 # ==============================================================
484 awk = check_prog("AWK", ("gawk", "mawk", "nawk", "awk"), paths=prefer_mozillabuild_path)
486 # Until the AWK variable is not necessary in old-configure
490 def awk_for_old_configure(value):
494 add_old_configure_assignment("AWK", awk_for_old_configure)
498 # ==============================================================
499 option(env="MAKE", nargs=1, help="Path to GNU make")
502 @depends("MAKE", host)
503 def possible_makes(make, host):
506 candidates.append(make[0])
507 if host.kernel == "WINNT":
508 candidates.extend(("mozmake", "mingw32-make", "make", "gmake"))
510 candidates.extend(("gmake", "make"))
514 check_prog("GMAKE", possible_makes, bootstrap="mozmake")
517 # ==============================================================
519 option(env="WATCHMAN", nargs=1, help="Path to the watchman program")
522 @depends(host, "WATCHMAN")
523 @checking("for watchman", callback=lambda w: w.path if w else "not found")
524 def watchman(host, prog):
525 # On Windows, `watchman` is only supported on 64-bit hosts.
526 if host.os == "WINNT" and host.cpu != "x86_64":
530 prog = find_program("watchman")
535 # `watchman version` will talk to the Watchman daemon service.
536 # This can hang due to permissions problems. e.g.
537 # https://github.com/facebook/watchman/issues/376. So use
538 # `watchman --version` to prevent a class of failures.
539 out = check_cmd_output(prog, "--version", onerror=lambda: None)
543 return namespace(path=prog, version=Version(out.strip()))
546 @depends_if(watchman)
547 @checking("for watchman version")
548 def watchman_version(w):
552 set_config("WATCHMAN", watchman.path)
555 @depends_all(hg_version, hg_config, watchman)
556 @checking("for watchman Mercurial integration")
558 def watchman_hg(hg_version, hg_config, watchman):
559 if hg_version < Version("3.8"):
560 return "no (Mercurial 3.8+ required)"
563 mode_disabled = False
565 for k in ("extensions.fsmonitor", "extensions.hgext.fsmonitor"):
566 if k in hg_config and hg_config[k] != "!":
569 mode_disabled = hg_config.get("fsmonitor.mode") == "off"
572 return "no (fsmonitor extension not enabled)"
574 return "no (fsmonitor.mode=off disables fsmonitor)"
579 # Miscellaneous programs
580 # ==============================================================
581 check_prog("XARGS", ("xargs",))
585 def extra_programs(target):
586 if target.kernel == "Darwin":
588 DSYMUTIL=("dsymutil", "llvm-dsymutil"),
589 MKFSHFS=("newfs_hfs", "mkfs.hfsplus"),
590 HFS_TOOL=("hfsplus",),
592 if target.os == "GNU" and target.kernel == "Linux":
593 return namespace(RPMBUILD=("rpmbuild",))
596 check_prog("DSYMUTIL", extra_programs.DSYMUTIL, allow_missing=True)
597 check_prog("MKFSHFS", extra_programs.MKFSHFS, allow_missing=True)
598 check_prog("HFS_TOOL", extra_programs.HFS_TOOL, allow_missing=True)
599 check_prog("RPMBUILD", extra_programs.RPMBUILD, allow_missing=True)
605 bootstrap="nsis/bin",
607 when=target_is_windows,
610 # Make sure the version of makensis is up to date.
614 @checking("for NSIS version")
616 def nsis_version(nsis):
617 nsis_min_version = "3.0b1"
620 return die("Failed to get nsis version.")
622 out = check_cmd_output(nsis, "-version", onerror=onerror)
624 m = re.search(r"(?<=v)[0-9]+\.[0-9]+((a|b|rc)[0-9]+)?", out)
627 raise FatalCheckError("Unknown version of makensis")
628 ver = Version(m.group(0))
630 # Versions comparisons don't quite work well with beta versions, so ensure
631 # it works for the non-beta version.
632 if ver < nsis_min_version and (ver >= "3.0a" or ver < "3"):
633 raise FatalCheckError(
634 "To build the installer you must have NSIS"
635 " version %s or greater in your path" % nsis_min_version
641 # And that makensis is 32-bit (but only on Windows).
642 @depends_if(nsis, when=depends(host)(lambda h: h.kernel == "WINNT"))
643 @checking("for 32-bit NSIS")
644 def nsis_binary_type(nsis):
645 bin_type = windows_binary_type(nsis)
646 if bin_type != "win32":
647 raise FatalCheckError("%s is not a 32-bit Windows application" % nsis)
652 # And any flags we have to give to makensis
654 def nsis_flags(host):
655 if host.kernel != "WINNT":
660 set_config("MAKENSISU_FLAGS", nsis_flags)
662 check_prog("7Z", ("7z", "7za"), allow_missing=True, when=target_is_windows)
663 check_prog("UPX", ("upx",), allow_missing=True, when=target_is_windows)
668 @depends(host_c_compiler, c_compiler, bindgen_config_paths)
669 def llvm_tool(host_c_compiler, c_compiler, bindgen_config_paths):
671 for compiler in (host_c_compiler, c_compiler):
672 if compiler and compiler.type == "clang":
673 clang = compiler.compiler
675 elif compiler and compiler.type == "clang-cl":
676 clang = os.path.join(os.path.dirname(compiler.compiler), "clang")
679 if not clang and bindgen_config_paths:
680 clang = bindgen_config_paths.clang_path
683 out = check_cmd_output(
684 clang, "--print-prog-name=%s" % tool, onerror=lambda: None
693 llvm_objdump = check_prog(
695 llvm_tool("llvm-objdump"),
697 when="--enable-compile-environment",
698 paths=clang_search_path,
701 add_old_configure_assignment("LLVM_OBJDUMP", llvm_objdump)
704 @depends(llvm_tool("llvm-readelf"), toolchain_prefix)
705 def readelf(llvm_readelf, toolchain_prefix):
706 commands = [llvm_readelf[0], "readelf"]
707 for prefix in toolchain_prefix or ():
708 commands.insert(1, "%sreadelf" % prefix)
709 return tuple(commands)
712 def validate_readelf(path):
713 # llvm-readelf from llvm < 8 doesn't support the GNU binutils-compatible `-d`
714 # flag. We could try running `$path -d $some_binary` but we might be cross
715 # compiling and not have a binary at hand to run that against. `$path -d` alone
716 # would fail whether the flag is supported or not. So we resort to look for the
717 # option in the `--help` output, which fortunately, s compatible between
718 # llvm-readelf and readelf.
719 retcode, stdout, stderr = get_cmd_output(path, "--help")
720 return retcode == 0 and any(l.startswith(" -d ") for l in stdout.splitlines())
723 @depends("--enable-compile-environment", target, host)
724 def readelf_when(compile_env, target, host):
725 return compile_env and any(
726 x.kernel not in ("Darwin", "WINNT") for x in (target, host)
734 paths=clang_search_path,
735 validate=validate_readelf,
739 @depends(llvm_tool("llvm-objcopy"), toolchain_prefix)
740 def objcopy(llvm_objcopy, toolchain_prefix):
741 commands = [llvm_objcopy[0], "objcopy"]
742 for prefix in toolchain_prefix or ():
743 commands.insert(1, "%sreadelf" % prefix)
744 return tuple(commands)
747 def validate_objcopy(path):
748 if "llvm-objcopy" not in path:
750 # llvm-objcopy doesn't support --only-keep-debug before llvm 9.0.
751 retcode, stdout, stderr = get_cmd_output(path, "--help")
752 return retcode == 0 and any(
753 l.startswith(" --only-keep-debug ") for l in stdout.splitlines()
761 paths=clang_search_path,
762 validate=validate_objcopy,
765 option("--enable-dtrace", help="Build with dtrace support")
767 dtrace = check_header(
769 when="--enable-dtrace",
770 onerror=lambda: die("dtrace enabled but sys/sdt.h not found"),
773 set_config("HAVE_DTRACE", True, when=dtrace)
774 set_define("INCLUDE_MOZILLA_DTRACE", True, when=dtrace)
775 add_old_configure_assignment("enable_dtrace", "yes", when=dtrace)
778 option("--disable-icf", help="Disable Identical Code Folding")
780 add_old_configure_assignment(
781 "MOZ_DISABLE_ICF", "1", when=depends("--enable-icf")(lambda x: not x)
787 when=compile_environment,
788 help="Enable stripping of libs & executables",
791 # This should be handled as a `when` once bug 1617793 is fixed.
794 @depends("--enable-strip", c_compiler, when=compile_environment)
795 def enable_strip(strip, c_compiler):
796 if strip and c_compiler.type != "clang-cl":
800 set_config("ENABLE_STRIP", enable_strip)
803 "--disable-install-strip",
804 when=compile_environment,
805 help="Enable stripping of libs & executables when packaging",
808 # This should be handled as a `when` once bug 1617793 is fixed.
811 @depends("--enable-install-strip", c_compiler, when=compile_environment)
812 def enable_install_strip(strip, c_compiler):
813 if strip and c_compiler.type != "clang-cl":
817 set_config("PKG_STRIP", enable_install_strip)
820 @depends("--enable-strip", "--enable-install-strip", when=compile_environment)
821 def strip(strip, install_strip):
822 return strip or install_strip
825 option(env="STRIP_FLAGS", nargs=1, when=strip, help="Flags for the strip command")
828 @depends("STRIP_FLAGS", profiling, target, when=strip)
829 def strip_flags(flags, profiling, target):
831 return flags[0].split()
833 # Only strip debug info and symbols when profiling is enabled, keeping
835 if target.kernel == "Darwin":
837 elif target.os == "Android":
838 # The tooling we use with Android supports detached symbols, and the
839 # size increase caused by local symbols are too much for mobile. So,
840 # don't restrict the amount of stripping with a flag.
843 return ["--strip-debug"]
844 # Otherwise strip everything we can, which happens without flags on non-Darwin.
845 # On Darwin, it tries to strip things it can't, so we need to limit its scope.
846 elif target.kernel == "Darwin":
850 set_config("STRIP_FLAGS", strip_flags)
853 @depends(llvm_tool("llvm-strip"), toolchain_prefix, target)
854 def strip(llvm_strip, toolchain_prefix, target):
856 for prefix in toolchain_prefix or ():
857 commands.insert(0, "%sstrip" % prefix)
858 # llvm-strip causes some problems on macos targets.
859 if target.kernel == "Darwin":
860 commands.append(llvm_strip[0])
862 commands.insert(0, llvm_strip[0])
863 return tuple(commands)
866 def validate_strip(path):
867 if "llvm-strip" not in path:
869 # llvm-strip doesn't support -S before llvm 8.0.
870 retcode, stdout, stderr = get_cmd_output(path, "--help")
871 return retcode == 0 and any(l.startswith(" -S ") for l in stdout.splitlines())
874 @depends("--enable-compile-environment", target, host)
875 def strip_when(compile_env, target, host):
876 return compile_env and any(x.kernel != "WINNT" for x in (target, host))
883 paths=clang_search_path,
884 validate=validate_strip,
888 @depends(js_standalone, target)
889 def system_zlib_default(js_standalone, target):
892 and target.kernel not in ("WINNT", "Darwin")
893 and target.os != "Android"
898 "--with-system-zlib",
900 default=system_zlib_default,
901 help="{Use|Do not use} system libz",
905 @depends("--with-system-zlib")
906 def deprecated_system_zlib_path(value):
909 "--with-system-zlib=PATH is not supported anymore. Please use "
910 "--with-system-zlib and set any necessary pkg-config environment variable."
914 pkg_check_modules("MOZ_ZLIB", "zlib >= 1.2.3", when="--with-system-zlib")
916 set_config("MOZ_SYSTEM_ZLIB", True, when="--with-system-zlib")
919 @depends("--with-system-zlib", js_shared, moz_linker, target.os)
920 def zlib_in_mozglue(system_zlib, js_shared, linker, os):
921 if not system_zlib and (js_shared or linker or os == "Android"):
925 set_config("ZLIB_IN_MOZGLUE", zlib_in_mozglue)
926 set_define("ZLIB_IN_MOZGLUE", zlib_in_mozglue)
929 # Please do not add configure checks from here on.
931 # Fallthrough to autoconf-based configure
932 include("build/moz.configure/old.configure")
935 include("js/sub.configure", when=compile_environment & toolkit)
938 @depends(build_environment, configure_cache)
939 @imports(_import="json")
940 @imports(_from="pathlib", _import="Path")
941 def save_cache(build_environment, configure_cache):
942 cache_file = Path(build_environment.topobjdir) / "configure.cache"
944 with cache_file.open(mode="w") as fd:
945 json.dump(configure_cache, fd, indent=4)
948 @depends(build_environment, build_project)
949 @imports("__sandbox__")
951 @imports(_from="os.path", _import="exists")
952 def config_status_deps(build_env, build_project):
954 topsrcdir = build_env.topsrcdir
955 topobjdir = build_env.topobjdir
957 if not topobjdir.endswith("js/src"):
958 extra_deps = [os.path.join(topobjdir, ".mozconfig.json")]
960 # mozconfig changes may impact js configure.
961 extra_deps = [os.path.join(topobjdir[:-7], ".mozconfig.json")]
963 confvars = os.path.join(topsrcdir, build_project, "confvars.sh")
965 extra_deps.append(confvars)
968 list(__sandbox__._all_paths)
971 os.path.join(topsrcdir, "CLOBBER"),
972 os.path.join(topsrcdir, "configure"),
973 os.path.join(topsrcdir, "js", "src", "configure"),
974 os.path.join(topsrcdir, "nsprpub", "configure"),
975 os.path.join(topsrcdir, "config", "milestone.txt"),
976 os.path.join(topsrcdir, "browser", "config", "version.txt"),
977 os.path.join(topsrcdir, "browser", "config", "version_display.txt"),
978 os.path.join(topsrcdir, "python", "sites", "build.txt"),
979 os.path.join(topsrcdir, "python", "sites", "common.txt"),
980 os.path.join(topsrcdir, "python", "sites", "mach.txt"),
981 os.path.join(topsrcdir, "python", "mach", "mach", "site.py"),
982 os.path.join(topsrcdir, "aclocal.m4"),
983 os.path.join(topsrcdir, "old-configure.in"),
984 os.path.join(topsrcdir, "js", "src", "aclocal.m4"),
985 os.path.join(topsrcdir, "js", "src", "old-configure.in"),
987 + glob.glob(os.path.join(topsrcdir, "build", "autoconf", "*.m4"))
991 set_config("CONFIG_STATUS_DEPS", config_status_deps)
992 # Please do not add anything after setting config_dep_paths.