d3f563c52ac512793e3c35127fd40bdce1f29a27
[scons.git] / doc / user / parseconfig.in
1 <!--
2
3   __COPYRIGHT__
4
5   Permission is hereby granted, free of charge, to any person obtaining
6   a copy of this software and associated documentation files (the
7   "Software"), to deal in the Software without restriction, including
8   without limitation the rights to use, copy, modify, merge, publish,
9   distribute, sublicense, and/or sell copies of the Software, and to
10   permit persons to whom the Software is furnished to do so, subject to
11   the following conditions:
12
13   The above copyright notice and this permission notice shall be included
14   in all copies or substantial portions of the Software.
15
16   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
17   KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
18   WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 -->
25
26  <para>
27
28  Configuring the right options to build programs to work with the
29  libraries--especially shared libraries--installed on a POSIX system
30  can be very complicated.
31  Various utilies with names that end in <filename>config</filename>
32  can return command-line options for the
33  GNU Compiler Collection
34
35  </para>
36
37  <para>
38
39  &SCons; construction environments have a &ParseConfig; method
40  that executes a utility and configures
41  the appropriate construction variables
42  in the environment
43  based on the command-line options
44  returned by the specified command.
45
46  </para>
47
48  </para>
49
50  <scons_example name="ParseConfig1">
51    <file name="SConstruct" printme="1">
52     env = Environment()
53     env.ParseConfig("pkg-config")
54    </file>
55    <file name="f1.c">
56    int f1() { }
57    </file>
58    <file name="f2.c">
59    int f2() { }
60    </file>
61    <file name="f3.c">
62    int f3() { }
63    </file>
64  </scons_example>
65
66  <para>
67
68  &SCons; will execute the specified command string
69  and XXX
70
71  </para>
72
73  <scons_output example="ParseConfig1">
74     <scons_output_command>scons -Q</scons_output_command>
75  </scons_output>
76
77  <para>
78
79  XXX
80
81  </para>