3 <!ENTITY % scons SYSTEM "../scons.mod">
7 <section id="sect-Program"
8 xmlns="http://www.scons.org/dbxsd/v1.0"
9 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10 xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
11 <title>The Program Builder</title>
17 Permission is hereby granted, free of charge, to any person obtaining
18 a copy of this software and associated documentation files (the
19 "Software"), to deal in the Software without restriction, including
20 without limitation the rights to use, copy, modify, merge, publish,
21 distribute, sublicense, and/or sell copies of the Software, and to
22 permit persons to whom the Software is furnished to do so, subject to
23 the following conditions:
25 The above copyright notice and this permission notice shall be included
26 in all copies or substantial portions of the Software.
28 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
29 KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
30 WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40 =head2 The C<Program> method
42 The C<Program> method arranges to link the specified program with the
43 specified object files. It is invoked in the following manner:
45 Program $env <program name>, <source or object files>;
47 The program name will have the value of the C<SUFEXE> construction
48 variable appended (by default, C<.exe> on Win32 systems, nothing on Unix
49 systems) if the suffix is not already present.
51 Source files may be specified in place of objects files-,-the C<Objects>
52 method will be invoked to arrange the conversion of all the files into
53 object files, and hence all the observations about the C<Objects> method,
54 above, apply to this method also.
56 The actual linking of the program will be handled by an external command
57 which results from expanding the C<LINKCOM> construction variable, with
58 C<%E<lt>> set to the object files to be linked (in the order presented),
59 and C<%E<gt>> set to the target. (See the section above on construction
60 variable expansion for details.) The user may set additional variables
61 in the construction environment, including C<LINK>, to define which
62 program to use for linking, C<LIBPATH>, a colon-separated list of
63 library search paths, for use with library specifications of the form
64 I<-llib>, and C<LIBS>, specifying the list of libraries to link against
65 (in either I<-llib> form or just as pathnames. Relative pathnames in
66 both C<LIBPATH> and C<LIBS> are interpreted relative to the directory
67 in which the associated construction environment is created (absolute
68 and top-relative names may also be used). Cons automatically sets up
69 dependencies on any libraries mentioned in C<LIBS>: those libraries will
70 be built before the command is linked.
81 <title>The &Program; Builder</title>