# HG changeset patch # User serge-sans-paille # Date 1768903043 0 # Node ID a924182c4e55e19b1b8dbd5904e8f9ca99e79b98 # Parent cd5449e09b6cd3e3b0bb1f2d6d8a8048e8883535 Bug 2008085 - Provide AR_FLAGS customization point r=glandium In a similar way to other customization flags. That way users can specify `--thin` if they want to to reduce disk pressure. Differential Revision: https://phabricator.services.mozilla.com/D278841 diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure --- a/build/moz.configure/toolchain.configure +++ b/build/moz.configure/toolchain.configure @@ -4,6 +4,13 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. +option( + env="AR_FLAGS", + help="Extra flags for creating static archives", + nargs=1, + default="", +) + # Code optimization # ============================================================== @@ -3346,12 +3353,14 @@ if not toolchain_prefix: toolchain_prefix = dependable(None) - @depends(toolchain_prefix, c_compiler) - def ar_config(toolchain_prefix, c_compiler): + @depends(toolchain_prefix, c_compiler, "AR_FLAGS") + @imports(_from="mozbuild.shellutil", _import="split") + def ar_config(toolchain_prefix, c_compiler, env_flags): + extra_ar_flags = tuple(split(env_flags[0])) if c_compiler.type == "clang-cl": return namespace( names=("llvm-lib",), - flags=("-llvmlibthin", "-out:$@"), + flags=("-llvmlibthin", "-out:$@") + extra_ar_flags, ) names = tuple("%s%s" % (p, "ar") for p in (toolchain_prefix or ()) + ("",)) @@ -3368,7 +3377,7 @@ return namespace( names=names, - flags=("crs", "$@"), + flags=("crs",) + extra_ar_flags + ("$@",), ) return ar_config