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