michael@0: .. _mozconfig: michael@0: michael@0: =============== michael@0: mozconfig Files michael@0: =============== michael@0: michael@0: mozconfig files are used to configure how a build works. michael@0: michael@0: mozconfig files are actually shell scripts. They are executed in a michael@0: special context with specific variables and functions exposed to them. michael@0: michael@0: API michael@0: === michael@0: michael@0: Functions michael@0: --------- michael@0: michael@0: The following special functions are available to a mozconfig script. michael@0: michael@0: ac_add_options michael@0: ^^^^^^^^^^^^^^ michael@0: michael@0: This function is used to declare extra options/arguments to pass into michael@0: configure. michael@0: michael@0: e.g.:: michael@0: michael@0: ac_add_options --disable-tests michael@0: ac_add_options --enable-optimize michael@0: michael@0: mk_add_options michael@0: ^^^^^^^^^^^^^^ michael@0: michael@0: This function is used to inject statements into client.mk for execution. michael@0: It is typically used to define variables, notably the object directory. michael@0: michael@0: e.g.:: michael@0: michael@0: mk_add_options AUTOCLOBBER=1 michael@0: michael@0: ac_add_options michael@0: ^^^^^^^^^^^^^^ michael@0: michael@0: This is a variant of ac_add_options() which only adds configure options michael@0: for a specified application. This is only used when building multiple michael@0: applications through client.mk. This function is typically not needed. michael@0: michael@0: Special mk_add_options Variables michael@0: -------------------------------- michael@0: michael@0: For historical reasons, the method for communicating certain michael@0: well-defined variables is via mk_add_options(). In this section, we michael@0: document what those special variables are. michael@0: michael@0: MOZ_OBJDIR michael@0: ^^^^^^^^^^ michael@0: michael@0: This variable is used to define the :term:`object directory` for the current michael@0: build. michael@0: michael@0: Finding the active mozconfig michael@0: ============================ michael@0: michael@0: Multiple mozconfig files can exist to provide different configuration michael@0: options for different tasks. The rules for finding the active mozconfig michael@0: are defined in the michael@0: :py:func:`mozbuild.mozconfig.MozconfigLoader.find_mozconfig` method: michael@0: michael@0: .. autoclass:: mozbuild.mozconfig.MozconfigLoader michael@0: :members: find_mozconfig