mozconfigs.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .. _mozconfig:
  2. ===============
  3. mozconfig Files
  4. ===============
  5. mozconfig files are used to configure how a build works.
  6. mozconfig files are actually shell scripts. They are executed in a
  7. special context with specific variables and functions exposed to them.
  8. API
  9. ===
  10. Functions
  11. ---------
  12. The following special functions are available to a mozconfig script.
  13. ac_add_options
  14. ^^^^^^^^^^^^^^
  15. This function is used to declare extra options/arguments to pass into
  16. configure.
  17. e.g.::
  18. ac_add_options --disable-tests
  19. ac_add_options --enable-optimize
  20. mk_add_options
  21. ^^^^^^^^^^^^^^
  22. This function is used to inject statements into client.mk for execution.
  23. It is typically used to define variables, notably the object directory.
  24. e.g.::
  25. mk_add_options AUTOCLOBBER=1
  26. ac_add_options
  27. ^^^^^^^^^^^^^^
  28. This is a variant of ac_add_options() which only adds configure options
  29. for a specified application. This is only used when building multiple
  30. applications through client.mk. This function is typically not needed.
  31. Special mk_add_options Variables
  32. --------------------------------
  33. For historical reasons, the method for communicating certain
  34. well-defined variables is via mk_add_options(). In this section, we
  35. document what those special variables are.
  36. MOZ_OBJDIR
  37. ^^^^^^^^^^
  38. This variable is used to define the :term:`object directory` for the current
  39. build.
  40. Finding the active mozconfig
  41. ============================
  42. Multiple mozconfig files can exist to provide different configuration
  43. options for different tasks. The rules for finding the active mozconfig
  44. are defined in the
  45. :py:func:`mozbuild.mozconfig.MozconfigLoader.find_mozconfig` method:
  46. .. autoclass:: mozbuild.mozconfig.MozconfigLoader
  47. :members: find_mozconfig