Add Fortran COMSTR variables for output customizability.
[scons.git] / doc / man / scons.1
1 .\" __COPYRIGHT__
2 .\"
3 .\" Permission is hereby granted, free of charge, to any person obtaining
4 .\" a copy of this software and associated documentation files (the
5 .\" "Software"), to deal in the Software without restriction, including
6 .\" without limitation the rights to use, copy, modify, merge, publish,
7 .\" distribute, sublicense, and/or sell copies of the Software, and to
8 .\" permit persons to whom the Software is furnished to do so, subject to
9 .\" the following conditions:
10 .\"
11 .\" The above copyright notice and this permission notice shall be included
12 .\" in all copies or substantial portions of the Software.
13 .\"
14 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
15 .\" KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
16 .\" WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 .\" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 .\" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 .\" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 .\" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 .\"
22 .\" __FILE__ __REVISION__ __DATE__ __DEVELOPER__
23 .\"
24 .\" ES - Example Start - indents and turns off line fill
25 .de ES
26 .RS
27 .nf
28 ..
29 .\" EE - Example End - ends indent and turns line fill back on
30 .de EE
31 .fi
32 .RE
33 ..
34 .TH SCONS 1 "October 2004"
35 .SH NAME
36 scons \- a software construction tool
37 .SH SYNOPSIS
38 .B scons
39 [
40 .IR options ...
41 ]
42 [
43 .IR name = val ...
44 ]
45 [
46 .IR targets ...
47 ]
48 .SH DESCRIPTION
49
50 The 
51 .B scons 
52 utility builds software (or other files) by determining which
53 component pieces must be rebuilt and executing the necessary commands to
54 rebuild them.
55
56 By default, 
57 .B scons 
58 searches for a file named 
59 .IR SConstruct ,
60 .IR Sconstruct ,
61 or
62 .I sconstruct
63 (in that order) in the current directory and reads its
64 configuration from the first file found.
65 An alternate file name may be
66 specified via the 
67 .B -f
68 option.
69
70 The
71 .I SConstruct
72 file can specify subsidiary
73 configuration files using the
74 .B SConscript()
75 function.
76 By convention,
77 these subsidiary files are named
78 .IR SConscript ,
79 although any name may be used.
80 (Because of this naming convention,
81 the term "SConscript files"
82 is sometimes used to refer
83 generically to all
84 .B scons
85 configuration files,
86 regardless of actual file name.)
87
88 The configuration files
89 specify the target files to be built, and
90 (optionally) the rules to build those targets.  Reasonable default
91 rules exist for building common software components (executable
92 programs, object files, libraries), so that for most software
93 projects, only the target and input files need be specified.
94
95 .B scons
96 reads and executes the SConscript files as Python scripts,
97 so you may use normal Python scripting capabilities
98 (such as flow control, data manipulation, and imported Python libraries)
99 to handle complicated build situations.
100 .BR scons ,
101 however, reads and executes all of the SConscript files
102 .I before
103 it begins building any targets.
104 To make this obvious,
105 .B scons
106 prints the following messages about what it is doing:
107
108 .ES
109 $ scons foo.out
110 scons: Reading SConscript files ...
111 scons: done reading SConscript files.
112 scons: Building targets  ...
113 cp foo.in foo.out
114 scons: done building targets.
115 $
116 .EE
117
118 The status messages
119 (everything except the line that reads "cp foo.in foo.out")
120 may be suppressed using the
121 .B -Q
122 option.
123
124 .B scons
125 does not automatically propagate
126 the external environment used to execute
127 .B scons
128 to the commands used to build target files.
129 This is so that builds will be guaranteed
130 repeatable regardless of the environment
131 variables set at the time
132 .B scons
133 is invoked.
134 This also means that if the compiler or other commands
135 that you want to use to build your target files
136 are not in standard system locations,
137 .B scons
138 will not find them unless
139 you explicitly set the PATH
140 to include those locations.
141 Whenever you create an
142 .B scons
143 construction environment,
144 you can propagate the value of PATH
145 from your external environment as follows:
146
147 .ES
148 import os
149 env = Environment(ENV = {'PATH' : os.environ['PATH']})
150 .EE
151
152 .B scons
153 can scan known input files automatically for dependency
154 information (for example, #include statements
155 in C or C++ files) and will rebuild dependent files appropriately
156 whenever any "included" input file changes. 
157 .B scons
158 supports the
159 ability to define new scanners for unknown input file types.
160
161 .B scons
162 knows how to fetch files automatically from
163 SCCS or RCS subdirectories
164 using SCCS, RCS or BitKeeper.
165
166 .B scons
167 is normally executed in a top-level directory containing a
168 .I SConstruct
169 file, optionally specifying
170 as command-line arguments
171 the target file or files to be built.
172
173 By default, the command
174
175 .ES
176 scons
177 .EE
178
179 will build all target files in or below the current directory.
180 Explicit default targets
181 (to be built when no targets are specified on the command line)
182 may be defined the SConscript file(s)
183 using the
184 .B Default()
185 function, described below.
186
187 Even when
188 .B Default()
189 targets are specified in the SConscript file(s),
190 all target files in or below the current directory
191 may be built by explicitly specifying
192 the current directory (.)
193 as a command-line target:
194
195 .ES
196 scons .
197 .EE
198
199 Building all target files,
200 including any files outside of the current directory,
201 may be specified by supplying a command-line target
202 of the root directory (on POSIX systems):
203
204 .ES
205 scons /
206 .EE
207
208 or the path name(s) of the volume(s) in which all the targets
209 should be built (on Windows systems):
210
211 .ES
212 scons C:\\ D:\\
213 .EE
214
215 To build only specific targets,
216 supply them as command-line arguments:
217
218 .ES
219 scons foo bar
220 .EE
221
222 in which case only the specified targets will be built
223 (along with any derived files on which they depend).
224
225 Specifying "cleanup" targets in SConscript files is not
226 necessary.  The 
227 .B -c
228 flag removes all files
229 necessary to build the specified target:
230
231 .ES
232 scons -c .
233 .EE
234
235 to remove all target files, or:
236
237 .ES
238 scons -c build export
239 .EE
240
241 to remove target files under build and export.
242 Additional files or directories to remove can be specified using the
243 Clean() function.
244
245 A subset of a hierarchical tree may be built by
246 remaining at the top-level directory (where the 
247 .I SConstruct
248 file lives) and specifying the subdirectory as the target to be
249 built:
250
251 .ES
252 scons src/subdir
253 .EE
254
255 or by changing directory and invoking scons with the
256 .B -u
257 option, which traverses up the directory
258 hierarchy until it finds the 
259 .I SConstruct
260 file, and then builds
261 targets relatively to the current subdirectory:
262
263 .ES
264 cd src/subdir
265 scons -u .
266 .EE
267
268 .B scons
269 supports building multiple targets in parallel via a
270 .B -j
271 option that takes, as its argument, the number
272 of simultaneous tasks that may be spawned:
273
274 .ES
275 scons -j 4
276 .EE
277
278 builds four targets in parallel, for example.
279
280 .B scons
281 can maintain a cache of target (derived) files that can
282 be shared between multiple builds.  When caching is enabled in a
283 SConscript file, any target files built by 
284 .B scons
285 will be copied
286 to the cache.  If an up-to-date target file is found in the cache, it
287 will be retrieved from the cache instead of being rebuilt locally.
288 Caching behavior may be disabled and controlled in other ways by the
289 .BR --cache-force , 
290 .BR --cache-disable ,
291 and
292 .B --cache-show
293 command-line options.  The
294 .B --random
295 option is useful to prevent multiple builds
296 from trying to update the cache simultaneously.
297
298 Values of variables to be passed to the SConscript file(s)
299 may be specified on the command line:
300
301 .ES
302 scons debug=1 .
303 .EE
304
305 These variables are available in SConscript files
306 through the ARGUMENTS dictionary,
307 and can be used in the SConscript file(s) to modify
308 the build in any way:
309
310 .ES
311 if ARGUMENTS.get('debug', 0):
312     env = Environment(CCFLAGS = '-g')
313 else:
314     env = Environment()
315 .EE
316
317 The command-line variable arguments are also available
318 in the ARGLIST list,
319 indexed by their order on the command line.
320 This allows you to process them in order rather than by name,
321 if necessary.
322 ARGLIST[0] returns a tuple
323 containing (argname, argvalue).
324 A Python exception is thrown if you
325 try to access a list member that
326 does not exist.
327
328 .B scons
329 requires Python version 1.5.2 or later.
330 There should be no other dependencies or requirements to run
331 .B scons.
332
333 .\" The following paragraph reflects the default tool search orders
334 .\" currently in SCons/Tool/__init__.py.  If any of those search orders
335 .\" change, this documentation should change, too.
336 By default,
337 .B scons
338 knows how to search for available programming tools
339 on various systems.
340 On WIN32 systems,
341 .B scons
342 searches in order for the
343 Microsoft Visual C++ tools,
344 the MinGW tool chain,
345 the Intel compiler tools,
346 and the PharLap ETS compiler.
347 On OS/2 systems,
348 .B scons
349 searches in order for the 
350 OS/2 compiler,
351 the GCC tool chain,
352 and the Microsoft Visual C++ tools,
353 On SGI IRIX, IBM AIX, Hewlett Packard HP-UX, and Sun Solaris systems,
354 .B scons
355 searches for the native compiler tools
356 (MIPSpro, Visual Age, aCC, and Forte tools respectively)
357 and the GCC tool chain.
358 On all other platforms,
359 including POSIX (Linux and UNIX) platforms,
360 .B scons
361 searches in order
362 for the GCC tool chain,
363 the Microsoft Visual C++ tools,
364 and the Intel compiler tools.
365 You may, of course, override these default values
366 by appropriate configuration of
367 Environment construction variables.
368
369 .SH OPTIONS
370 In general, 
371 .B scons 
372 supports the same command-line options as GNU
373 .BR make , 
374 and many of those supported by 
375 .BR cons .
376
377 .TP
378 -b
379 Ignored for compatibility with non-GNU versions of
380 .BR make.
381
382 .TP
383 -c, --clean, --remove
384 Clean up by removing all target files for which a construction
385 command is specified.
386 Also remove any files or directories associated to the construction command
387 using the Clean() function.
388
389 .TP
390 --cache-disable, --no-cache
391 Disable the derived-file caching specified by
392 .BR CacheDir ().
393 .B scons
394 will neither retrieve files from the cache
395 nor copy files to the cache.
396
397 .TP
398 --cache-force, --cache-populate
399 When using
400 .BR CacheDir (),
401 populate a cache by copying any already-existing, up-to-date
402 derived files to the cache,
403 in addition to files built by this invocation.
404 This is useful to populate a new cache with
405 all the current derived files,
406 or to add to the cache any derived files
407 recently built with caching disabled via the
408 .B --cache-disable
409 option.
410
411 .TP
412 --cache-show
413 When using
414 .BR CacheDir ()
415 and retrieving a derived file from the cache,
416 show the command
417 that would have been executed to build the file,
418 instead of the usual report,
419 "Retrieved `file' from cache."
420 This will produce consistent output for build logs,
421 regardless of whether a target
422 file was rebuilt or retrieved from the cache.
423
424 .TP
425 .RI --config= mode
426 This specifies how the
427 .B Configure
428 call should use or generate the
429 results of configuration tests.
430 The option should be specified from
431 among the following choices:
432
433 .TP
434 --config=auto
435 scons will use its normal dependency mechanisms
436 to decide if a test must be rebuilt or not.
437 This saves time by not running the same configuration tests
438 every time you invoke scons,
439 but will overlook changes in system header files
440 or external commands (such as compilers)
441 if you don't specify those dependecies explicitly.
442 This is the default behavior.
443
444 .TP
445 --config=force
446 If this option is specified,
447 all configuration tests will be re-run
448 regardless of whether the
449 cached results are out of date.
450 This can be used to explicitly
451 force the configuration tests to be updated
452 in response to an otherwise unconfigured change
453 in a system header file or compiler.
454
455 .TP
456 --config=cache
457 If this option is specified,
458 no configuration tests will be rerun
459 and all results will be taken from cache.
460 Note that scons will still consider it an error
461 if --config=cache is specified
462 and a necessary test does not
463 yet have any results in the cache.
464
465 .TP 
466 .RI "-C" " directory" ",  --directory=" directory
467 Change to the specified 
468 .I directory
469 before searching for the 
470 .IR SConstruct ,
471 .IR Sconstruct ,
472 or
473 .I sconstruct
474 file, or doing anything
475 else.  Multiple 
476 .B -C
477 options are interpreted
478 relative to the previous one, and the right-most
479 .B -C
480 option wins. (This option is nearly
481 equivalent to 
482 .BR "-f directory/SConstruct" ,
483 except that it will search for
484 .IR SConstruct ,
485 .IR Sconstruct , 
486 or
487 .I sconstruct
488 in the specified directory.)
489
490 .\" .TP
491 .\" -d
492 .\" Display dependencies while building target files.  Useful for
493 .\" figuring out why a specific file is being rebuilt, as well as
494 .\" general debugging of the build process.
495
496 .TP
497 -D
498 Works exactly the same way as the
499 .B -u
500 option except for the way default targets are handled.
501 When this option is used and no targets are specified on the command line,
502 all default targets are built, whether or not they are below the current
503 directory.
504
505 .TP
506 .RI --debug= type
507 Debug the build process.
508 .I type
509 specifies what type of debugging:
510
511 .TP
512 --debug=count
513 Print a count of how many objects are created
514 of the various classes used internally by SCons.
515 This only works when run under Python 2.1 or later.
516
517 .TP
518 --debug=dtree
519 Print the dependency tree
520 after each top-level target is built. This prints out only derived files.
521
522 .TP
523 --debug=findlibs
524 Instruct the scanner that searches for libraries
525 to print a message about each potential library
526 name it is searching for,
527 and about the actual libraries it finds.
528
529 .TP
530 --debug=includes
531 Print the include tree after each top-level target is built. 
532 This is generally used to find out what files are included by the sources
533 of a given derived file:
534
535 .ES
536 $ scons --debug=includes foo.o
537 .EE
538
539 .TP
540 --debug=memory
541 Prints how much memory SCons uses
542 before and after reading the SConscript files
543 and before and after building.
544
545 .TP
546 --debug=objects
547 Prints a list of the various objects
548 of the various classes used internally by SCons.
549 This only works when run under Python 2.1 or later.
550
551 .TP
552 --debug=pdb
553 Re-run SCons under the control of the
554 .RI pdb
555 Python debugger.
556 .EE
557
558 .TP
559 --debug=presub
560 Print the raw command line used to build each target
561 before the construction environment variables are substituted.
562 Also shows which targets are being built by this command.
563 Output looks something like this:
564 .ES
565 $ scons --debug=presub
566 Building myprog.o with action(s):
567   $SHCC $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES
568 ...
569 .EE
570
571 .TP
572 --debug=stacktrace
573 Prints an internal Python stack trace
574 when encountering an otherwise unexplained error.
575
576 .TP
577 --debug=time
578 Prints various time profiling information: the time spent
579 executing each build command, the total build time, the total time spent
580 executing build commands, the total time spent executing SConstruct and
581 SConscript files, and the total time spent executing SCons itself.
582
583 .TP
584 --debug=tree
585 Print the dependency tree
586 after each top-level target is built. This prints out the complete
587 dependency tree including implicit dependencies and ignored
588 dependencies.
589
590 .\" .TP
591 .\" -e, --environment-overrides
592 .\" Variables from the execution environment override construction
593 .\" variables from the SConscript files.
594
595 .TP
596 .RI -f " file" ", --file=" file ", --makefile=" file ", --sconstruct=" file
597 Use 
598 .I file 
599 as the initial SConscript file.
600
601 .TP 
602 -h, --help
603 Print a local help message for this build, if one is defined in
604 the SConscript file(s), plus a line that describes the 
605 .B -H
606 option for command-line option help.  If no local help message
607 is defined, prints the standard help message about command-line
608 options.  Exits after displaying the appropriate message.
609
610 .TP
611 -H, --help-options
612 Print the standard help message about command-line options and
613 exit.
614
615 .TP
616 -i, --ignore-errors
617 Ignore all errors from commands executed to rebuild files.
618
619 .TP 
620 .RI -I " directory" ", --include-dir=" directory
621 Specifies a 
622 .I directory
623 to search for
624 imported Python modules.  If several 
625 .B -I
626 options
627 are used, the directories are searched in the order specified.
628
629 .TP
630 --implicit-cache
631 Cache implicit dependencies. This can cause 
632 .B scons
633 to miss changes in the implicit dependencies in cases where a new implicit
634 dependency is added earlier in the implicit dependency search path
635 (e.g. CPPPATH) than a current implicit dependency with the same name.
636
637 .TP
638 --implicit-deps-changed
639 Force SCons to ignore the cached implicit dependencies. This causes the
640 implicit dependencies to be rescanned and recached. This implies
641 .BR --implicit-cache .
642
643 .TP
644 --implicit-deps-unchanged
645 Force SCons to ignore changes in the implicit dependencies.
646 This causes cached implicit dependencies to always be used.
647 This implies 
648 .BR --implicit-cache .
649
650 .TP
651 .RI -j " N" ", --jobs=" N
652 Specifies the number of jobs (commands) to run simultaneously.
653 If there is more than one 
654 .B -j 
655 option, the last one is effective.
656 .\" ??? If the 
657 .\" .B -j 
658 .\" option
659 .\" is specified without an argument,
660 .\" .B scons 
661 .\" will not limit the number of
662 .\" simultaneous jobs.
663
664 .TP
665 -k, --keep-going
666 Continue as much as possible after an error.  The target that
667 failed and those that depend on it will not be remade, but other
668 targets specified on the command line will still be processed.
669
670 .\" .TP
671 .\" .RI  -l " N" ", --load-average=" N ", --max-load=" N
672 .\" No new jobs (commands) will be started if
673 .\" there are other jobs running and the system load
674 .\" average is at least 
675 .\" .I N
676 .\" (a floating-point number).
677
678 .TP
679 .RI --duplicate= ORDER
680 There are three ways to duplicate files in a build tree: hard links,
681 soft (symbolic) links and copies. The default behaviour of SCons is to 
682 prefer hard links to soft links to copies. You can specify different
683 behaviours with this option.
684 .IR ORDER 
685 must be one of 
686 .IR hard-soft-copy
687 (the default),
688 .IR soft-hard-copy ,
689 .IR hard-copy ,
690 .IR soft-copy
691 or
692 .IR copy .
693 SCons will attempt to duplicate files using
694 the mechanisms in the specified order.
695
696 .\"
697 .\" .TP
698 .\" --list-derived
699 .\" List derived files (targets, dependencies) that would be built,
700 .\" but do not build them.
701 .\" [XXX This can probably go away with the right
702 .\" combination of other options.  Revisit this issue.]
703 .\"
704 .\" .TP
705 .\" --list-actions
706 .\" List derived files that would be built, with the actions
707 .\" (commands) that build them.  Does not build the files.
708 .\" [XXX This can probably go away with the right
709 .\" combination of other options.  Revisit this issue.]
710 .\"
711 .\" .TP
712 .\" --list-where
713 .\" List derived files that would be built, plus where the file is
714 .\" defined (file name and line number).  Does not build the files.
715 .\" [XXX This can probably go away with the right
716 .\" combination of other options.  Revisit this issue.]
717
718 .TP
719 -m
720 Ignored for compatibility with non-GNU versions of
721 .BR make .
722
723 .TP
724 .RI --max-drift= SECONDS
725 Set the maximum expected drift in the modification time of files to 
726 .IR SECONDS .
727 This value determines how old a file must be before its content signature
728 is cached. The default value is 2 days, which means a file must have a
729 modification time of at least two days ago in order to have its content
730 signature cached. A negative value means to never cache the content
731 signature and to ignore the cached value if there already is one. A value
732 of 0 means to always cache the signature, no matter how old the file is.
733
734 .TP
735 -n, --just-print, --dry-run, --recon
736 No execute.  Print the commands that would be executed to build
737 any out-of-date target files, but do not execute the commands.
738
739 .\" .TP
740 .\" .RI -o " file" ", --old-file=" file ", --assume-old=" file
741 .\" Do not rebuild 
742 .\" .IR file ,
743 .\" and do
744 .\" not rebuild anything due to changes in the contents of
745 .\" .IR file .
746 .\" .TP 
747 .\" .RI --override " file"
748 .\" Read values to override specific build environment variables
749 .\" from the specified 
750 .\" .IR file .
751 .\" .TP
752 .\" -p
753 .\" Print the data base (construction environments,
754 .\" Builder and Scanner objects) that are defined
755 .\" after reading the SConscript files.
756 .\" After printing, a normal build is performed
757 .\" as usual, as specified by other command-line options.
758 .\" This also prints version information
759 .\" printed by the 
760 .\" .B -v
761 .\" option.
762 .\"
763 .\" To print the database without performing a build do:
764 .\"
765 .\" .ES
766 .\" scons -p -q
767 .\" .EE
768
769 .TP
770 .RI --profile= file
771 Run SCons under the Python profiler
772 and save the results in the specified
773 .IR file .
774 The results may be analyzed using the Python
775 pstats module.
776 .TP
777 -q, --question
778 Do not run any commands, or print anything.  Just return an exit
779 status that is zero if the specified targets are already up to
780 date, non-zero otherwise.
781 .TP
782 -Q
783 Quiets SCons status messages about
784 reading SConscript files,
785 building targets
786 and entering directories.
787 Commands that are executed
788 to rebuild target files are still printed.
789
790 .\" .TP
791 .\" -r, -R, --no-builtin-rules, --no-builtin-variables
792 .\" Clear the default construction variables.  Construction
793 .\" environments that are created will be completely empty.
794
795 .TP
796 --random
797 Build dependencies in a random order.  This is useful when
798 building multiple trees simultaneously with caching enabled,
799 to prevent multiple builds from simultaneously trying to build
800 or retrieve the same target files.
801
802 .TP
803 -s, --silent, --quiet
804 Silent.  Do not print commands that are executed to rebuild
805 target files.
806 Also suppresses SCons status messages.
807
808 .TP
809 -S, --no-keep-going, --stop
810 Ignored for compatibility with GNU 
811 .BR make .
812
813 .TP
814 -t, --touch
815 Ignored for compatibility with GNU
816 .BR make .  
817 (Touching a file to make it
818 appear up-to-date is unnecessary when using 
819 .BR scons .)
820
821 .TP
822 -u, --up, --search-up
823 Walks up the directory structure until an 
824 .I SConstruct ,
825 .I Sconstruct
826 or 
827 .I sconstruct
828 file is found, and uses that
829 as the top of the directory tree.
830 If no targets are specified on the command line,
831 only targets at or below the
832 current directory will be built.
833
834 .TP
835 -U
836 Works exactly the same way as the
837 .B -u
838 option except for the way default targets are handled.
839 When this option is used and no targets are specified on the command line,
840 all default targets that are defined in the SConscript(s) in the current
841 directory are built, regardless of what directory the resultant targets end
842 up in.
843
844 .TP
845 -v, --version
846 Print the 
847 .B scons
848 version, copyright information,
849 list of authors, and any other relevant information.
850 Then exit.
851
852 .TP
853 -w, --print-directory
854 Print a message containing the working directory before and
855 after other processing.
856
857 .TP
858 .RI --warn= type ", --warn=no-" type
859 Enable or disable warnings.
860 .I type
861 specifies the type of warnings to be enabled or disabled:
862
863 .TP
864 --warn=all, --warn=no-all
865 Enables or disables all warnings.
866
867 .TP
868 --warn=dependency, --warn=no-dependency
869 Enables or disables warnings about dependencies.
870 These warnings are disabled by default.
871
872 .TP
873 --warn=deprecated, --warn=no-deprecated
874 Enables or disables warnings about use of deprecated features.
875 These warnings are enabled by default.
876
877 .TP
878 --warn=missing-sconscript, --warn=no-missing-sconscript
879 Enables or disables warnings about missing SConscript files.
880 These warnings are enabled by default.
881
882 .TP
883 --no-print-directory
884 Turn off -w, even if it was turned on implicitly.
885
886 .\" .TP
887 .\" .RI --write-filenames= file
888 .\" Write all filenames considered into
889 .\" .IR file .
890 .\"
891 .\" .TP
892 .\" .RI -W " file" ", --what-if=" file ", --new-file=" file ", --assume-new=" file
893 .\" Pretend that the target 
894 .\" .I file 
895 .\" has been
896 .\" modified.  When used with the 
897 .\" .B -n
898 .\" option, this
899 .\" show you what would be rebuilt if you were to modify that file.
900 .\" Without 
901 .\" .B -n
902 .\" ... what? XXX
903 .\"
904 .\" .TP
905 .\" --warn-undefined-variables
906 .\" Warn when an undefined variable is referenced.
907
908 .TP 
909 .RI -Y " repository" ", --repository=" repository
910 Search the specified repository for any input and target
911 files not found in the local directory hierarchy.  Multiple
912 .B -Y
913 options may specified, in which case the
914 repositories are searched in the order specified.
915
916 .SH CONFIGURATION FILE REFERENCE
917 .\" .SS Python Basics
918 .\" XXX Adding this in the future would be a help.
919 .SS Construction Environments
920 A construction environment is the basic means by which the SConscript
921 files communicate build information to 
922 .BR scons .
923 A new construction environment is created using the 
924 .B Environment 
925 function:
926
927 .ES
928 env = Environment()
929 .EE
930
931 By default, a new construction environment is
932 initialized with a set of builder methods
933 and construction variables that are appropriate
934 for the current platform.
935 An optional platform keyword argument may be
936 used to specify that an environment should
937 be initialized for a different platform:
938
939 .ES
940 env = Environment(platform = 'cygwin')
941 env = Environment(platform = 'os2')
942 env = Environment(platform = 'posix')
943 env = Environment(platform = 'win32')
944 .EE
945
946 Specifying a platform initializes the appropriate
947 construction variables in the environment
948 to use and generate file names with prefixes
949 and suffixes appropriate for the platform.
950
951 Note that the
952 .B win32
953 platform adds the
954 .B SYSTEMROOT
955 variable from the user's external environment
956 to the construction environment's
957 .B ENV
958 dictionary.
959 This is so that any executed commands
960 that use sockets to connect with other systems
961 (such as fetching source files from
962 external CVS repository specifications like 
963 .BR :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons )
964 will work on Win32 systems.
965
966 The platform argument may be function or callable object,
967 in which case the Environment() method
968 will call the specified argument to update
969 the new construction environment:
970
971 .ES
972 def my_platform(env):
973     env['VAR'] = 'xyzzy'
974
975 env = Environment(platform = my_platform)
976 .EE
977
978 Additionally, a specific set of tools
979 with which to initialize the environment
980 may specified as an optional keyword argument:
981
982 .ES
983 env = Environment(tools = ['msvc', 'lex'])
984 .EE
985
986 Non-built-in tools may be specified using the toolpath argument:
987
988 .ES
989 env = Environment(tools = ['default', 'foo'], toolpath = ['tools'])
990 .EE
991
992 This looks for a tool specification in tools/foo.py (as well as
993 using the ordinary default tools for the platform).  foo.py should
994 have two functions: generate(env, **kw) and exists(env).
995 The
996 .B generate()
997 function
998 modifies the passed in environment
999 to set up variables so that the tool
1000 can be executed;
1001 it may use any keyword arguments
1002 that the user supplies (see below)
1003 to vary its initialization.
1004 The
1005 .B exists()
1006 function should return a true
1007 value if the tool is available.
1008 Tools in the toolpath are used before
1009 any of the built-in ones.  For example, adding gcc.py to the toolpath
1010 would override the built-in gcc tool.
1011
1012 The elements of the tools list may also
1013 be functions or callable objects,
1014 in which case the Environment() method
1015 will call the specified elements
1016 to update the new construction environment:
1017
1018 .ES
1019 def my_tool(env):
1020     env['XYZZY'] = 'xyzzy'
1021
1022 env = Environment(tools = [my_tool])
1023 .EE
1024
1025 The individual elements of the tools list
1026 may also themselves be two-element lists of the form
1027 .RI ( toolname ", " kw_dict ).
1028 SCons searches for the
1029 .I toolname
1030 specification file as described above, and
1031 passes
1032 .IR kw_dict ,
1033 which must be a dictionary, as keyword arguments to the tool's
1034 .B generate
1035 function.
1036 The
1037 .B generate
1038 function can use the arguments to modify the tool's behavior
1039 by setting up the environment in different ways
1040 or otherwise changing its initialization.
1041
1042 .ES
1043 # in tools/my_tool.py:
1044 def generate(env, **kw):
1045   # Sets MY_TOOL to the value of keyword argument 'arg1' or 1.
1046   env['MY_TOOL'] = kw.get('arg1', '1')
1047 def exists(env):
1048   return 1
1049
1050 # in SConstruct:
1051 env = Environment(tools = ['default', ('my_tool', {'arg1': 'abc'})],
1052                   toolpath=['tools'])
1053 .EE
1054
1055 The tool definition (i.e. my_tool()) can use the PLATFORM variable from
1056 the environment it receives to customize the tool for different platforms.
1057
1058 If no tool list is specified, then SCons will auto-detect the installed
1059 tools using the PATH variable in the ENV construction variable and the
1060 platform name when the Environment is constructed. Changing the PATH
1061 variable after the Environment is constructed will not cause the tools to
1062 be redetected.
1063
1064 SCons supports the following tool specifications out of the box:
1065
1066 .ES
1067 386asm
1068 aixc++
1069 aixcc
1070 aixf77
1071 aixlink
1072 ar
1073 as
1074 bcc32
1075 c++
1076 cc
1077 cvf
1078 dmd
1079 dvipdf
1080 dvips
1081 f77
1082 f90
1083 f95
1084 fortran
1085 g++
1086 g77
1087 gas
1088 gcc
1089 gnulink
1090 gs
1091 hpc++
1092 hpcc
1093 hplink
1094 icc
1095 icl
1096 ifl
1097 ifort
1098 ilink
1099 ilink32
1100 intelc
1101 jar
1102 javac
1103 javah
1104 latex
1105 lex
1106 link
1107 linkloc
1108 m4
1109 masm
1110 midl
1111 mingw
1112 mslib
1113 mslink
1114 msvc
1115 msvs
1116 mwcc
1117 mwld
1118 nasm
1119 pdflatex
1120 pdftex
1121 qt
1122 rmic
1123 rpcgen
1124 sgiar
1125 sgic++
1126 sgicc
1127 sgilink
1128 sunar
1129 sunc++
1130 suncc
1131 sunlink
1132 swig
1133 tar
1134 tex
1135 tlib
1136 yacc
1137 zip
1138 .EE
1139
1140 Additionally, there is a "tool" named
1141 .B default
1142 which configures the
1143 environment with a default set of tools for the current platform.
1144
1145 On posix and cygwin platforms
1146 the GNU tools (e.g. gcc) are preferred by SCons,
1147 on win32 the Microsoft tools (e.g. msvc)
1148 followed by MinGW are preferred by SCons,
1149 and in OS/2 the IBM tools (e.g. icc) are preferred by SCons.
1150
1151 .SS Builder Methods
1152
1153 Build rules are specified by calling a construction
1154 environment's builder methods.
1155 The arguments to the builder methods are
1156 .B target
1157 (a list of target files)
1158 and
1159 .B source
1160 (a list of source files).
1161
1162 Because long lists of file names
1163 can lead to a lot of quoting,
1164 .B scons
1165 supplies a
1166 .B Split()
1167 global function
1168 and a same-named environment method
1169 that split a single string
1170 into a list, separated on
1171 strings of white-space characters.
1172 (These are similar to the
1173 string.split() method
1174 from the standard Python library,
1175 but work even if the input isn't a string.)
1176
1177 Like all Python arguments,
1178 the target and source arguments to a builder method
1179 can be specified either with or without
1180 the "target" and "source" keywords.
1181 When the keywords are omitted,
1182 the target is first,
1183 followed by the source.
1184 The following are equivalent examples of calling the Program builder method:
1185
1186 .ES
1187 env.Program('bar', ['bar.c', 'foo.c'])
1188 env.Program('bar', Split('bar.c foo.c'))
1189 env.Program('bar', env.Split('bar.c foo.c'))
1190 env.Program(source =  ['bar.c', 'foo.c'], target = 'bar')
1191 env.Program(target = 'bar', Split('bar.c foo.c'))
1192 env.Program(target = 'bar', env.Split('bar.c foo.c'))
1193 env.Program('bar', source = string.split('bar.c foo.c'))
1194 .EE
1195
1196 When the target shares the same base name
1197 as the source and only the suffix varies,
1198 and if the builder method has a suffix defined for the target file type,
1199 then the target argument may be omitted completely,
1200 and
1201 .B scons
1202 will deduce the target file name from
1203 the source file name.
1204 The following examples all build the
1205 executable program
1206 .B bar
1207 (on POSIX systems)
1208 or 
1209 .B bar.exe
1210 (on Windows systems)
1211 from the bar.c source file:
1212
1213 .ES
1214 env.Program(target = 'bar', source = 'bar.c')
1215 env.Program('bar', source = 'bar.c')
1216 env.Program(source = 'bar.c')
1217 env.Program('bar.c')
1218 .EE
1219
1220 It is possible to override or add construction variables when calling a
1221 builder method by passing additional keyword arguments.
1222 These overridden or added
1223 variables will only be in effect when building the target, so they will not
1224 affect other parts of the build. For example, if you want to add additional
1225 libraries for just one program:
1226
1227 .ES
1228 env.Program('hello', 'hello.c', LIBS=['gl', 'glut'])
1229 .EE
1230
1231 or generate a shared library with a nonstandard suffix:
1232
1233 .ES
1234 env.SharedLibrary('word', 'word.cpp', SHLIBSUFFIX='.ocx')
1235 .EE
1236
1237 Although the builder methods defined by
1238 .B scons
1239 are, in fact,
1240 methods of a construction environment object,
1241 they may also be called without an explicit environment:
1242
1243 .ES
1244 Program('hello', 'hello.c')
1245 SharedLibrary('word', 'word.cpp')
1246 .EE
1247
1248 In this case,
1249 the methods are called internally using a default construction
1250 environment that consists of the tools and values that
1251 .B scons
1252 has determined are appropriate for the local system.
1253
1254 All builder methods return a list of Nodes
1255 that represent the target or targets that will be built.
1256 A
1257 .I Node
1258 is an internal SCons object
1259 which represents
1260 build targets or sources.
1261
1262 The returned Node(s)
1263 can be passed to other builder methods as source(s)
1264 or passed to any SCons function or method
1265 where a filename would normally be accepted.
1266 For example, if it were necessary
1267 to add a specific
1268 .B -D
1269 flag when compiling one specific object file:
1270
1271 .ES
1272 bar_obj_list = env.StaticObject('bar.c', CCFLAGS='-DBAR')
1273 env.Program(source = ['foo.c', bar_obj_list, 'main.c'])
1274 .EE
1275
1276 Using a Node in this way
1277 makes for a more portable build
1278 by avoiding having to specify
1279 a platform-specific object suffix
1280 when calling the Program() builder method.
1281
1282 Note that Builder calls will automatically "flatten"
1283 the source and target file lists,
1284 so it's all right to have the bar_obj list
1285 return by the StaticObject() call
1286 in the middle of the source file list.
1287 If you need to manipulate a list of lists returned by Builders
1288 directly using Python,
1289 you can either build the list by hand:
1290
1291 .ES
1292 foo = Object('foo.c')
1293 bar = Object('bar.c')
1294 objects = ['begin.o'] + foo + ['middle.o'] + bar + ['end.o']
1295 for object in objects:
1296     print str(object)
1297 .EE
1298
1299 Or you can use the
1300 .BR Flatten ()
1301 supplied by scons
1302 to create a list containing just the Nodes,
1303 which may be more convenient:
1304
1305 .ES
1306 foo = Object('foo.c')
1307 bar = Object('bar.c')
1308 objects = Flatten(['begin.o', foo, 'middle.o', bar, 'end.o'])
1309 for object in objects:
1310     print str(object)
1311 .EE
1312
1313 The path name for a Node's file may be used
1314 by passing the Node to the Python-builtin
1315 .B str()
1316 function:
1317
1318 .ES
1319 bar_obj_list = env.StaticObject('bar.c', CCFLAGS='-DBAR')
1320 print "The path to bar_obj is:", str(bar_obj_list[0])
1321 .EE
1322
1323 Note again that because the Builder call returns a list,
1324 we have to access the first element in the list
1325 .B (bar_obj_list[0])
1326 to get at the Node that actually represents
1327 the object file.
1328
1329 Builder calls support a
1330 .B chdir
1331 keyword argument that
1332 specifies that the Builder's action(s)
1333 should be executed
1334 after changing directory.
1335 If the
1336 .B chdir
1337 argument is
1338 a string or a directory Node,
1339 scons will change to the specified directory.
1340 If the
1341 .B chdir
1342 is not a string or Node
1343 and is non-zero,
1344 then scons will change to the
1345 target file's directory.
1346
1347 .ES
1348 # scons will change to the "sub" subdirectory
1349 # before executing the "cp" command.
1350 env.Command('sub/dir/foo.out', 'sub/dir/foo.in',
1351             "cp dir/foo.in dir/foo.out",
1352             chdir='sub')
1353
1354 # Because chdir is not a string, scons will change to the
1355 # target's directory ("sub/dir") before executing the
1356 # "cp" command.
1357 env.Command('sub/dir/foo.out', 'sub/dir/foo.in',
1358             "cp foo.in foo.out",
1359             chdir=1)
1360 .EE
1361
1362 Note that scons will
1363 .I not
1364 automatically modify
1365 its expansion of
1366 construction variables like
1367 .B $TARGET
1368 and
1369 .B $SOURCE
1370 when using the chdir
1371 keyword argument--that is,
1372 the expanded file names
1373 will still be relative to
1374 the top-level SConstruct directory,
1375 and consequently incorrect
1376 relative to the chdir directory.
1377 If you use the chdir keyword argument,
1378 you will typically need to supply a different
1379 command line using
1380 expansions like
1381 .B ${TARGET.file}
1382 and
1383 .B ${SOURCE.file}
1384 to use just the filename portion of the
1385 targets and source.
1386
1387 .B scons
1388 provides the following builder methods:
1389
1390 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1391 .IP CFile()
1392 .IP env.CFile()
1393 Builds a C source file given a lex (.l) or yacc (.y) input file.
1394 The suffix specified by the $CFILESUFFIX construction variable
1395 (.c by default)
1396 is automatically added to the target
1397 if it is not already present. Example:
1398
1399 .ES
1400 # builds foo.c
1401 env.CFile(target = 'foo.c', source = 'foo.l')
1402 # builds bar.c
1403 env.CFile(target = 'bar', source = 'bar.y')
1404 .EE
1405
1406 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1407 .IP CXXFile()
1408 .IP env.CXXFile()
1409 Builds a C++ source file given a lex (.ll) or yacc (.yy)
1410 input file.
1411 The suffix specified by the $CXXFILESUFFIX construction variable
1412 (.cc by default)
1413 is automatically added to the target
1414 if it is not already present. Example:
1415
1416 .ES
1417 # builds foo.cc
1418 env.CXXFile(target = 'foo.cc', source = 'foo.ll')
1419 # builds bar.cc
1420 env.CXXFile(target = 'bar', source = 'bar.yy')
1421 .EE
1422
1423 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1424 .IP DVI()
1425 .IP env.DVI()
1426 Builds a .dvi file from a .tex, .ltx or .latex input file.
1427 If the source file suffix is .tex,
1428 .B scons
1429 will examine the contents of the file;
1430 if the string
1431 .B \\documentclass
1432 or
1433 .B \\documentstyle
1434 is found, the file is assumed to be a LaTeX file and
1435 the target is built by invoking the $LATEXCOM command line;
1436 otherwise, the $TEXCOM command line is used.
1437 If the file is a LaTeX file,
1438 the
1439 .B DVI
1440 builder method will also examine the contents
1441 of the
1442 .B .aux file
1443 and invoke the $BIBTEX command line
1444 if the string
1445 .B bibdata
1446 is found,
1447 and will examine the contents
1448 .B .log
1449 file and re-run the $LATEXCOM command
1450 if the log file says it is necessary.
1451
1452 The suffix .dvi
1453 (hard-coded within TeX itself)
1454 is automatically added to the target
1455 if it is not already present. Examples:
1456
1457 .ES
1458 # builds from aaa.tex
1459 env.DVI(target = 'aaa.dvi', source = 'aaa.tex')
1460 # builds bbb.dvi
1461 env.DVI(target = 'bbb', source = 'bbb.ltx')
1462 # builds from ccc.latex
1463 env.DVI(target = 'ccc.dvi', source = 'ccc.latex')
1464 .EE
1465
1466 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1467 .IP Jar()
1468 .IP env.Jar()
1469 Builds a Java archive (.jar) file
1470 from a source tree of .class files.
1471 If the $JARCHDIR value is set, the
1472 .B jar
1473 command will change to the specified directory using the
1474 .B \-C
1475 option.
1476 If the contents any of the source files begin with the string
1477 .BR Manifest-Version ,
1478 the file is assumed to be a manifest
1479 and is passed to the
1480 .B jar
1481 command with the
1482 .B m
1483 option set.
1484
1485 .ES
1486 env.Jar(target = 'foo.jar', source = 'classes')
1487 .EE
1488
1489 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1490 .IP Java()
1491 .IP env.Java()
1492 Builds one or more Java class files
1493 from one or more source trees of .java files.
1494 The class files will be placed underneath
1495 the specified target directory.
1496 SCons will parse each source .java file
1497 to find the classes
1498 (including inner classes)
1499 defined within that file,
1500 and from that figure out the
1501 target .class files that will be created.
1502 SCons will also search each Java file
1503 for the Java package name,
1504 which it assumes can be found on a line
1505 beginning with the string
1506 .B package
1507 in the first column;
1508 the resulting .class files
1509 will be placed in a directory reflecting
1510 the specified package name.
1511 For example,
1512 the file
1513 .I Foo.java
1514 defining a single public
1515 .I Foo
1516 class and
1517 containing a package name of
1518 .I sub.dir
1519 will generate a corresponding
1520 .IR sub/dir/Foo.class
1521 class file.
1522
1523 Example:
1524
1525 .ES
1526 env.Java(target = 'classes', source = 'src')
1527 env.Java(target = 'classes', source = ['src1', 'src2'])
1528 .EE
1529
1530 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1531 .IP JavaH()
1532 .IP env.JavaH()
1533 Builds C header and source files for
1534 implementing Java native methods.
1535 The target can be either a directory
1536 in which the header files will be written,
1537 or a header file name which
1538 will contain all of the definitions.
1539 The source can be either the names of .class files,
1540 or the objects returned from the
1541 .B Java
1542 builder method.
1543
1544 If the construction variable
1545 .B JAVACLASSDIR
1546 is set, either in the environment
1547 or in the call to the
1548 .B JavaH
1549 builder method itself,
1550 then the value of the variable
1551 will be stripped from the
1552 beginning of any .class file names.
1553
1554 Examples:
1555
1556 .ES
1557 # builds java_native.h
1558 classes = env.Java(target = 'classdir', source = 'src')
1559 env.JavaH(target = 'java_native.h', source = classes)
1560
1561 # builds include/package_foo.h and include/package_bar.h
1562 env.JavaH(target = 'include',
1563           source = ['package/foo.class', 'package/bar.class'])
1564
1565 # builds export/foo.h and export/bar.h
1566 env.JavaH(target = 'export',
1567           source = ['classes/foo.class', 'classes/bar.class'],
1568           JAVACLASSDIR = 'classes')
1569 .EE
1570
1571 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1572 .IP Library()
1573 .IP env.Library()
1574 A synonym for the
1575 .B StaticLibrary
1576 builder method.
1577
1578 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1579 .IP M4()
1580 .IP env.M4()
1581 Builds an output file from an M4 input file.
1582 This uses a default $M4FLAGS value of
1583 .BR -E ,
1584 which considers all warnings to be fatal
1585 and stops on the first warning
1586 when using the GNU version of m4.
1587 Example:
1588
1589 .ES
1590 env.M4(target = 'foo.c', source = 'foo.c.m4')
1591 .EE
1592
1593 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1594 .IP Moc()
1595 .IP env.Moc()
1596 Builds an output file from a moc input file. Moc input files are either 
1597 header files or cxx files. This builder is only available after using the 
1598 tool 'qt'. See the QTDIR variable for more information.
1599 Example:
1600
1601 .ES
1602 env.Moc('foo.h') # generates moc_foo.cc
1603 env.Moc('foo.cpp') # generates foo.moc
1604 .EE
1605
1606 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1607 .IP MSVSProject()
1608 .IP env.MSVSProject()
1609 Builds Microsoft Visual Studio project files.
1610 This builds a Visual Studio project file, based on the version of
1611 Visual Studio that is configured (either the latest installed version,
1612 or the version set by 
1613 .B MSVS_VERSION
1614 in the Environment constructor).
1615 For VS 6, it will generate 
1616 .B .dsp
1617 and
1618 .B .dsw
1619 files, for VS 7, it will
1620 generate
1621 .B .vcproj
1622 and
1623 .B .sln
1624 files.
1625
1626 It takes several lists of filenames to be placed into the project
1627 file, currently these are limited to 
1628 .B srcs, incs, localincs, resources,
1629 and
1630 .B misc.
1631 These are pretty self explanatory, but it
1632 should be noted that the 'srcs' list is NOT added to the $SOURCES
1633 environment variable.  This is because it represents a list of files
1634 to be added to the project file, not the source used to build the
1635 project file (in this case, the 'source' is the SConscript file used
1636 to call MSVSProject).
1637
1638 In addition to these values (which are all optional, although not
1639 specifying any of them results in an empty project file), the
1640 following values must be specified:
1641
1642 target: The name of the target .dsp or .vcproj file.  The correct
1643 suffix for the version of Visual Studio must be used, but the value
1644
1645 env['MSVSPROJECTSUFFIX']
1646
1647 will be defined to the correct value (see example below).
1648
1649 variant: The name of this particular variant.  These are typically
1650 things like "Debug" or "Release", but really can be anything you want.
1651 Multiple calls to MSVSProject with different variants are allowed: all
1652 variants will be added to the project file with their appropriate
1653 build targets and sources.
1654
1655 buildtarget: A list of SCons.Node.FS objects which is returned from
1656 the command which builds the target.  This is used to tell SCons what
1657 to build when the 'build' button is pressed inside of the IDE.
1658
1659 Example Usage:
1660
1661 .ES
1662         barsrcs = ['bar.cpp'],
1663         barincs = ['bar.h'],
1664         barlocalincs = ['StdAfx.h']
1665         barresources = ['bar.rc','resource.h']
1666         barmisc = ['bar_readme.txt']
1667
1668         dll = local.SharedLibrary(target = 'bar.dll',
1669                                   source = barsrcs)
1670
1671         local.MSVSProject(target = 'Bar' + env['MSVSPROJECTSUFFIX'],
1672                           srcs = barsrcs,
1673                           incs = barincs,
1674                           localincs = barlocalincs,
1675                           resources = barresources,
1676                           misc = barmisc,
1677                           buildtarget = dll,
1678                           variant = 'Release')
1679 .EE
1680
1681 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1682 .IP Object()
1683 .IP env.Object()
1684 A synonym for the
1685 .B StaticObject
1686 builder method.
1687
1688 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1689 .IP PCH()
1690 .IP env.PCH()
1691 Builds a Microsoft Visual C++ precompiled header.
1692 Calling this builder method
1693 returns a list of two targets: the PCH as the first element, and the object
1694 file as the second element. Normally the object file is ignored.
1695 This builder method is only
1696 provided when Microsoft Visual C++ is being used as the compiler. 
1697 The PCH builder method is generally used in
1698 conjuction with the PCH construction variable to force object files to use
1699 the precompiled header:
1700
1701 .ES
1702 env['PCH'] = env.PCH('StdAfx.cpp')[0]
1703 .EE
1704
1705 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1706 .IP PDF()
1707 .IP env.PDF()
1708 Builds a .pdf file from a .dvi input file
1709 (or, by extension, a .tex, .ltx, or .latex input file).
1710 The suffix specified by the $PDFSUFFIX construction variable
1711 (.pdf by default)
1712 is added automatically to the target
1713 if it is not already present.  Example:
1714
1715 .ES
1716 # builds from aaa.tex
1717 env.PDF(target = 'aaa.pdf', source = 'aaa.tex')
1718 # builds bbb.pdf from bbb.dvi
1719 env.PDF(target = 'bbb', source = 'bbb.dvi')
1720 .EE
1721
1722 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1723 .IP PostScript()
1724 .IP env.PostScript()
1725 Builds a .ps file from a .dvi input file
1726 (or, by extension, a .tex, .ltx, or .latex input file).
1727 The suffix specified by the $PSSUFFIX construction variable
1728 (.ps by default)
1729 is added automatically to the target
1730 if it is not already present.  Example:
1731
1732 .ES
1733 # builds from aaa.tex
1734 env.PostScript(target = 'aaa.ps', source = 'aaa.tex')
1735 # builds bbb.ps from bbb.dvi
1736 env.PostScript(target = 'bbb', source = 'bbb.dvi')
1737 .EE
1738
1739 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1740 .IP Program()
1741 .IP env.Program()
1742 Builds an executable given one or more object files
1743 or C, C++, D, or Fortran source files.
1744 If any C, C++, D or Fortran source files are specified,
1745 then they will be automatically
1746 compiled to object files using the
1747 .B Object
1748 builder method;
1749 see that builder method's description for
1750 a list of legal source file suffixes
1751 and how they are interpreted.
1752 The target executable file prefix
1753 (specified by the $PROGPREFIX construction variable; nothing by default)
1754 and suffix
1755 (specified by the $PROGSUFFIX construction variable;
1756 by default, .exe on Windows systems, nothing on POSIX systems)
1757 are automatically added to the target if not already present.
1758 Example:
1759
1760 .ES
1761 env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f'])
1762 .EE
1763
1764 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1765 .IP RES()
1766 .IP env.RES()
1767 Builds a Microsoft Visual C++ resource file.
1768 This builder method is only provided
1769 when Microsoft Visual C++ or MinGW is being used as the compiler. The
1770 .I .res
1771 (or 
1772 .I .o 
1773 for MinGW) suffix is added to the target name if no other suffix is given. The source
1774 file is scanned for implicit dependencies as though it were a C file. Example:
1775
1776 .ES
1777 env.RES('resource.rc')
1778 .EE
1779
1780 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1781 .IP RMIC()
1782 .IP env.RMIC()
1783 Builds stub and skeleton class files
1784 for remote objects
1785 from Java .class files.
1786 The target is a directory
1787 relative to which the stub
1788 and skeleton class files will be written.
1789 The source can be the names of .class files,
1790 or the objects return from the
1791 .B Java
1792 builder method.
1793
1794 If the construction variable
1795 .B JAVACLASSDIR
1796 is set, either in the environment
1797 or in the call to the
1798 .B RMIC
1799 builder method itself,
1800 then the value of the variable
1801 will be stripped from the
1802 beginning of any .class file names.
1803
1804 .ES
1805 classes = env.Java(target = 'classdir', source = 'src')
1806 env.RMIC(target = 'outdir1', source = classes)
1807
1808 env.RMIC(target = 'outdir2',
1809          source = ['package/foo.class', 'package/bar.class'])
1810
1811 env.RMIC(target = 'outdir3',
1812          source = ['classes/foo.class', 'classes/bar.class'],
1813          JAVACLASSDIR = 'classes')
1814 .EE
1815
1816 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1817 .IP RPCGenClient()
1818 .IP env.RPCGenClient()
1819 Generates an RPC client stub (_clnt.c) file
1820 from a specified RPC (.x) source file.
1821 Because rpcgen only builds output files
1822 in the local directory,
1823 the command will be executed
1824 in the source file's directory by default.
1825
1826 .ES
1827 # Builds src/rpcif_clnt.c
1828 env.RPCGenClient('src/rpcif.x')
1829 .EE
1830
1831 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1832 .IP RPCGenHeader()
1833 .IP env.RPCGenHeader()
1834 Generates an RPC header (.h) file
1835 from a specified RPC (.x) source file.
1836 Because rpcgen only builds output files
1837 in the local directory,
1838 the command will be executed
1839 in the source file's directory by default.
1840
1841 .ES
1842 # Builds src/rpcif.h
1843 env.RPCGenHeader('src/rpcif.x')
1844 .EE
1845
1846 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1847 .IP RPCGenService()
1848 .IP env.RPCGenService()
1849 Generates an RPC server-skeleton (_svc.c) file
1850 from a specified RPC (.x) source file.
1851 Because rpcgen only builds output files
1852 in the local directory,
1853 the command will be executed
1854 in the source file's directory by default.
1855
1856 .ES
1857 # Builds src/rpcif_svc.c
1858 env.RPCGenClient('src/rpcif.x')
1859 .EE
1860
1861 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1862 .IP RPCGenXDR()
1863 .IP env.RPCGenXDR()
1864 Generates an RPC XDR routine (_xdr.c) file
1865 from a specified RPC (.x) source file.
1866 Because rpcgen only builds output files
1867 in the local directory,
1868 the command will be executed
1869 in the source file's directory by default.
1870
1871 .ES
1872 # Builds src/rpcif_xdr.c
1873 env.RPCGenClient('src/rpcif.x')
1874 .EE
1875
1876 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1877 .IP SharedLibrary()
1878 .IP env.SharedLibrary()
1879 Builds a shared library
1880 (.so on a POSIX system, .dll on WIN32)
1881 given one or more object files
1882 or C, C++, D or Fortran source files.
1883 If any source files are given,
1884 then they will be automatically
1885 compiled to object files.
1886 The static library prefix and suffix (if any)
1887 are automatically added to the target.
1888 The target library file prefix
1889 (specified by the $SHLIBPREFIX construction variable;
1890 by default, lib on POSIX systems, nothing on Windows systems)
1891 and suffix
1892 (specified by the $SHLIBSUFFIX construction variable;
1893 by default, .dll on Windows systems, .so on POSIX systems)
1894 are automatically added to the target if not already present.
1895 Example:
1896
1897 .ES
1898 env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
1899 .EE
1900 .IP
1901 On WIN32 systems, the
1902 .B SharedLibrary
1903 builder method will always build an import (.lib) library
1904 in addition to the shared (.dll) library,
1905 adding a .lib library with the same basename
1906 if there is not already a .lib file explicitly
1907 listed in the targets.
1908
1909 Any object files listed in the
1910 .B source
1911 must have been built for a shared library
1912 (that is, using the
1913 .B SharedObject
1914 builder method).
1915 .B scons
1916 will raise an error if there is any mismatch.
1917 .IP
1918 On WIN32 systems, specifying "register=1" will cause the dll to be
1919 registered after it is built using REGSVR32.  The command that is run
1920 ("regsvr32" by default) is determined by $REGSVR construction
1921 variable, and the flags passed are determined by $REGSVRFLAGS.  By
1922 default, $REGSVRFLAGS includes "/s", to prevent dialogs from popping
1923 up and requiring user attention when it is run.  If you change
1924 $REGSVRFLAGS, be sure to include "/s".  For example,
1925
1926 .ES
1927 env.SharedLibrary(target = 'bar',
1928                   source = ['bar.cxx', 'foo.obj'],
1929                   register=1)
1930 .EE
1931
1932 .IP
1933 will register "bar.dll" as a COM object when it is done linking it.
1934
1935 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1936 .IP SharedObject()
1937 .IP env.SharedObject()
1938 Builds an object file for
1939 inclusion in a shared library.
1940 Source files must have one of the same set of extensions
1941 specified above for the
1942 .B StaticObject
1943 builder method.
1944 On some platforms building a shared object requires additional
1945 compiler options (e.g. -fPIC for gcc) in addition to those needed to build a
1946 normal (static) object, but on some platforms there is no difference between a
1947 shared object and a normal (static) one. When there is a difference, SCons
1948 will only allow shared objects to be linked into a shared library, and will
1949 use a different suffix for shared objects. On platforms where there is no
1950 difference, SCons will allow both normal (static)
1951 and shared objects to be linked into a
1952 shared library, and will use the same suffix for shared and normal
1953 (static) objects.
1954 The target object file prefix
1955 (specified by the $SHOBJPREFIX construction variable;
1956 by default, the same as $OBJPREFIX)
1957 and suffix
1958 (specified by the $SHOBJSUFFIX construction variable)
1959 are automatically added to the target if not already present. 
1960 Examples:
1961
1962 .ES
1963 env.SharedObject(target = 'ddd', source = 'ddd.c')
1964 env.SharedObject(target = 'eee.o', source = 'eee.cpp')
1965 env.SharedObject(target = 'fff.obj', source = 'fff.for')
1966 .EE
1967
1968 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
1969 .IP StaticLibrary()
1970 .IP env.StaticLibrary()
1971 Builds a static library given one or more object files
1972 or C, C++, D or Fortran source files.
1973 If any source files are given,
1974 then they will be automatically
1975 compiled to object files.
1976 The static library prefix and suffix (if any)
1977 are automatically added to the target.
1978 The target library file prefix
1979 (specified by the $LIBPREFIX construction variable;
1980 by default, lib on POSIX systems, nothing on Windows systems)
1981 and suffix
1982 (specified by the $LIBSUFFIX construction variable;
1983 by default, .lib on Windows systems, .a on POSIX systems)
1984 are automatically added to the target if not already present.
1985 Example:
1986
1987 .ES
1988 env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
1989 .EE
1990
1991 .IP
1992 Any object files listed in the
1993 .B source
1994 must have been built for a static library
1995 (that is, using the
1996 .B StaticObject
1997 builder method).
1998 .B scons
1999 will raise an error if there is any mismatch.
2000
2001 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2002 .IP StaticObject()
2003 .IP env.StaticObject()
2004 Builds a static object file
2005 from one or more C, C++, D, or Fortran source files.
2006 Source files must have one of the following extensions:
2007
2008 .ES
2009   .asm    assembly language file
2010   .ASM    assembly language file
2011   .c      C file
2012   .C      WIN32:  C file
2013           POSIX:  C++ file
2014   .cc     C++ file
2015   .cpp    C++ file
2016   .cxx    C++ file
2017   .cxx    C++ file
2018   .c++    C++ file
2019   .C++    C++ file
2020   .d      D file
2021   .f      Fortran file
2022   .F      WIN32:  Fortran file
2023           POSIX:  Fortran file + C pre-processor
2024   .for    Fortran file
2025   .FOR    Fortran file
2026   .fpp    Fortran file + C pre-processor
2027   .FPP    Fortran file + C pre-processor
2028   .s      assembly language file
2029   .S      WIN32:  assembly language file
2030           POSIX:  assembly language file + C pre-processor
2031   .spp    assembly language file + C pre-processor
2032   .SPP    assembly language file + C pre-processor
2033 .EE
2034 .IP
2035 The target object file prefix
2036 (specified by the $OBJPREFIX construction variable; nothing by default)
2037 and suffix
2038 (specified by the $OBJSUFFIX construction variable;
2039 \.obj on Windows systems, .o on POSIX systems)
2040 are automatically added to the target if not already present.
2041 Examples:
2042
2043 .ES
2044 env.StaticObject(target = 'aaa', source = 'aaa.c')
2045 env.StaticObject(target = 'bbb.o', source = 'bbb.c++')
2046 env.StaticObject(target = 'ccc.obj', source = 'ccc.f')
2047 .EE
2048
2049 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2050 .IP Tar()
2051 .IP env.Tar()
2052 Builds a tar archive of the specified files
2053 and/or directories.
2054 Unlike most builder methods,
2055 the
2056 .B Tar
2057 builder method may be called multiple times
2058 for a given target;
2059 each additional call
2060 adds to the list of entries
2061 that will be built into the archive.
2062
2063 .ES
2064 env.Tar('src.tar', 'src')
2065
2066 # Create the stuff.tar file.
2067 env.Tar('stuff', ['subdir1', 'subdir2'])
2068 # Also add "another" to the stuff.tar file.
2069 env.Tar('stuff', 'another')
2070
2071 # Set TARFLAGS to create a gzip-filtered archive.
2072 env = Environment(TARFLAGS = '-c -z')
2073 env.Tar('foo.tar.gz', 'foo')
2074
2075 # Also set the suffix to .tgz.
2076 env = Environment(TARFLAGS = '-c -z',
2077                   TARSUFFIX = '.tgz')
2078 env.Tar('foo')
2079 .EE
2080
2081 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2082 .IP TypeLibrary()
2083 .IP env.TypeLibrary()
2084 Builds a Windows type library (.tlb) file from and input IDL file
2085 (.idl).  In addition, it will build the associated inteface stub and
2086 proxy source files.  It names them according to the base name of the .idl file.
2087 .IP
2088 For example,
2089
2090 .ES
2091 env.TypeLibrary(source="foo.idl")
2092 .EE
2093 .IP
2094 Will create foo.tlb, foo.h, foo_i.c, foo_p.c, and foo_data.c.
2095
2096 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2097 .IP Uic()
2098 .IP env.Uic()
2099 Builds a header file, an implementation file and a moc file from an ui file.
2100 and returns the corresponding nodes in the above order.
2101 This builder is only available after using the tool 'qt'. Note: you can 
2102 specify .ui files directly as inputs for Program, Library and SharedLibrary
2103 without using this builder. Using the builder lets you override the standard
2104 naming conventions (be careful: prefixes are always prepended to names of
2105 built files; if you don't want prefixes, you may set them to ``).
2106 See the QTDIR variable for more information.
2107 Example:
2108
2109 .ES
2110 env.Uic('foo.ui') # -> ['foo.h', 'uic_foo.cc', 'moc_foo.cc']
2111 env.Uic(target = Split('include/foo.h gen/uicfoo.cc gen/mocfoo.cc'),
2112         source = 'foo.ui') # -> ['include/foo.h', 'gen/uicfoo.cc', 'gen/mocfoo.cc']
2113 .EE
2114
2115 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2116 .IP Zip()
2117 .IP env.Zip()
2118 Builds a zip archive of the specified files
2119 and/or directories.
2120 Unlike most builder methods,
2121 the
2122 .B Zip
2123 builder method may be called multiple times
2124 for a given target;
2125 each additional call
2126 adds to the list of entries
2127 that will be built into the archive.
2128
2129 .ES
2130 env.Zip('src.zip', 'src')
2131
2132 # Create the stuff.zip file.
2133 env.Zip('stuff', ['subdir1', 'subdir2'])
2134 # Also add "another" to the stuff.tar file.
2135 env.Zip('stuff', 'another')
2136 .EE
2137
2138 .B scons
2139 automatically scans
2140 C source files, C++ source files,
2141 Fortran source files with
2142 .B .F
2143 (POSIX systems only),
2144 .B .fpp,
2145 or
2146 .B .FPP
2147 file extensions,
2148 and assembly language files with
2149 .B .S
2150 (POSIX systems only),
2151 .B .spp,
2152 or
2153 .B .SPP
2154 files extensions
2155 for C preprocessor dependencies,
2156 so the dependencies do not need to be specified explicitly.
2157 In addition, all
2158 targets of builder methods automatically depend on their sources.
2159 An explicit dependency can
2160 be specified using the 
2161 .B Depends 
2162 method of a construction environment (see below).
2163
2164 .SS Methods and Functions to Do Things
2165 In addition to Builder methods,
2166 .B scons
2167 provides a number of other construction environment methods
2168 and global functions to
2169 manipulate the build configuration.
2170
2171 Usually, a construction environment method
2172 and global function with the same name both exist
2173 so that you don't have to remember whether
2174 to a specific bit of functionality
2175 must be called with or without a construction environment.
2176 In the following list,
2177 if you call something as a global function
2178 it looks like:
2179 .ES
2180 .RI Function( arguments )
2181 .EE
2182 and if you call something through a construction
2183 environment it looks like:
2184 .ES
2185 .RI env.Function( arguments )
2186 .EE
2187 If you can call the functionality in both ways,
2188 then both forms are listed.
2189
2190 Except where otherwise noted,
2191 the same-named
2192 construction environment method
2193 and global function 
2194 provide the exact same functionality.
2195 The only difference is that,
2196 where appropriate,
2197 calling the functionality through a construction environment will
2198 substitute construction variables into
2199 any supplied strings.
2200 For example:
2201 .ES
2202 env = Environment(FOO = 'foo')
2203 Default('$FOO')
2204 env.Default('$FOO')
2205 .EE
2206 the first call to the global
2207 .B Default()
2208 function will actually add a target named
2209 .B $FOO
2210 to the list of default targets,
2211 while the second call to the
2212 .B env.Default()
2213 construction environment method
2214 will expand the value
2215 and add a target named
2216 .B foo
2217 to the list of default targets.
2218 For more on construction variable expansion,
2219 see the next section on
2220 construction variables.
2221
2222 Construction environment methods
2223 and global functions supported by
2224 .B scons
2225 include:
2226
2227 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2228 .TP 
2229 .RI Action( action ", [" strfunction ", " varlist ])
2230 .TP
2231 .RI env.Action( action ", [" strfunction ", " varlist ])
2232 Creates an Action object for
2233 the specified
2234 .IR action .
2235 See the section "Action Objects,"
2236 below, for a complete explanation of the arguments and behavior.
2237
2238 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2239 .TP 
2240 .RI AddPostAction( target ", " action )
2241 .TP
2242 .RI env.AddPostAction( target ", " action )
2243 Arranges for the specified
2244 .I action
2245 to be performed
2246 after the specified
2247 .I target
2248 has been built.
2249 The specified action(s) may be
2250 an Action object, or anything that
2251 can be converted into an Action object
2252 (see below).
2253
2254 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2255 .TP 
2256 .RI AddPreAction( target ", " action )
2257 .TP
2258 .RI env.AddPreAction( target ", " action )
2259 Arranges for the specified
2260 .I action
2261 to be performed
2262 before the specified
2263 .I target
2264 is built.
2265 The specified action(s) may be
2266 an Action object, or anything that
2267 can be converted into an Action object
2268 (see below).
2269
2270 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2271 .TP
2272 .RI Alias( alias ", [" targets ", [" action ]])
2273 .TP
2274 .RI env.Alias( alias ", [" targets ", [" action ]])
2275 Creates one or more phony targets that
2276 expand to one or more other targets.
2277 An optional
2278 .I action
2279 (command)
2280 or list of actions
2281 can be specified that will be executed
2282 whenever the any of the alias targets are out-of-date.
2283 Returns the Node object representing the alias,
2284 which exists outside of any file system.
2285 This Node object, or the alias name,
2286 may be used as a dependency of any other target,
2287 including another alias.
2288 .B Alias
2289 can be called multiple times for the same
2290 alias to add additional targets to the alias,
2291 or additional actions to the list for this alias.
2292
2293 .ES
2294 Alias('install')
2295 Alias('install', '/usr/bin')
2296 Alias(['install', 'install-lib'], '/usr/local/lib')
2297
2298 env.Alias('install', ['/usr/local/bin', '/usr/local/lib'])
2299 env.Alias('install', ['/usr/local/man'])
2300
2301 env.Alias('update', ['file1', 'file2'], "update_database $SOURCES")
2302 .EE
2303
2304 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2305 .TP
2306 .RI AlwaysBuild( target ", ...)"
2307 .TP
2308 .RI env.AlwaysBuild( target ", ...)"
2309 Marks each given
2310 .I target
2311 so that it is always assumed to be out of date,
2312 and will always be rebuilt if needed.
2313 Note, however, that
2314 .BR AlwaysBuild ()
2315 does not add its target(s) to the default target list,
2316 so the targets will only be built
2317 if they are specified on the command line,
2318 or are a dependent of a target specified on the command line--but
2319 they will
2320 .I always
2321 be built if so specified.
2322 Multiple targets can be passed in to a single call to
2323 .BR AlwaysBuild ().
2324
2325 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2326 .TP
2327 .RI env.Append( key = val ", [...])"
2328 Appends the specified keyword arguments
2329 to the end of construction variables in the environment.
2330 If the Environment does not have
2331 the specified construction variable,
2332 it is simply added to the environment.
2333 If the values of the construction variable
2334 and the keyword argument are the same type,
2335 then the two values will be simply added together.
2336 Otherwise, the construction variable
2337 and the value of the keyword argument
2338 are both coerced to lists,
2339 and the lists are added together.
2340 (See also the Prepend method, below.)
2341
2342 .ES
2343 env.Append(CCFLAGS = ' -g', FOO = ['foo.yyy'])
2344 .EE
2345
2346 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2347 .TP
2348 .RI env.AppendENVPath( name ", " newpath ", [" envname ", " sep ])
2349 This appends new path elements to the given path in the
2350 specified external environment
2351 .RB ( ENV
2352 by default).
2353 This will only add
2354 any particular path once (leaving the last one it encounters and
2355 ignoring the rest, to preserve path order),
2356 and to help assure this,
2357 will normalize all paths (using
2358 .B os.path.normpath
2359 and
2360 .BR os.path.normcase ).
2361 This can also handle the
2362 case where the given old path variable is a list instead of a
2363 string, in which case a list will be returned instead of a string.
2364 Example:
2365
2366 .ES
2367 print 'before:',env['ENV']['INCLUDE']
2368 include_path = '/foo/bar:/foo'
2369 env.PrependENVPath('INCLUDE', include_path)
2370 print 'after:',env['ENV']['INCLUDE']
2371
2372 yields:
2373 before: /foo:/biz
2374 after: /biz:/foo/bar:/foo
2375 .EE
2376
2377 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2378 .TP
2379 .RI env.AppendUnique( key = val ", [...])"
2380 Appends the specified keyword arguments
2381 to the end of construction variables in the environment.
2382 If the Environment does not have
2383 the specified construction variable,
2384 it is simply added to the environment.
2385 If the construction variable being appended to is a list,
2386 then any value(s) that already exist in the
2387 construction variable will
2388 .I not
2389 be added again to the list.
2390
2391 .ES
2392 env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy'])
2393 .EE
2394
2395 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2396 .TP
2397 env.BitKeeper()
2398 A factory function that
2399 returns a Builder object
2400 to be used to fetch source files
2401 using BitKeeper.
2402 The returned Builder
2403 is intended to be passed to the
2404 .B SourceCode
2405 function.
2406
2407 .ES
2408 env.SourceCode('.', env.BitKeeper())
2409 .EE
2410
2411 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2412 .TP
2413 .RI BuildDir( build_dir ", " src_dir ", [" duplicate ])
2414 .TP
2415 .RI env.BuildDir( build_dir ", " src_dir ", [" duplicate ])
2416 This specifies a build directory
2417 .I build_dir
2418 in which to build all derived files
2419 that would normally be built under
2420 .IR src_dir .
2421 Multiple build directories can be set up for multiple build variants, for
2422 example. 
2423 .I src_dir
2424 must be underneath the SConstruct file's directory,
2425 and
2426 .I build_dir
2427 may not be underneath the
2428 .I src_dir .
2429
2430 The default behavior is for
2431 .B scons
2432 to duplicate all of the files in the tree underneath
2433 .I src_dir
2434 into
2435 .IR build_dir ,
2436 and then build the derived files within the copied tree.
2437 (The duplication is performed by
2438 linking or copying,
2439 depending on the platform; see also the
2440 .IR --duplicate
2441 option.)
2442 This guarantees correct builds
2443 regardless of whether intermediate source files
2444 are generated during the build,
2445 where preprocessors or other scanners search
2446 for included files,
2447 or whether individual compilers or other invoked tools
2448 are hard-coded to put derived files in the same directory as source files.
2449
2450 This behavior of making a complete copy of the source tree
2451 may be disabled by setting
2452 .I duplicate
2453 to 0.
2454 This will cause
2455 .B scons
2456 to invoke Builders using the
2457 path names of source files in
2458 .I src_dir
2459 and the path names of derived files within
2460 .IR build_dir .
2461 This is always more efficient than
2462 .IR duplicate =1,
2463 and is usually safe for most builds.
2464 Specifying
2465 .IR duplicate =0,
2466 however,
2467 may cause build problems
2468 if source files are generated during the build,
2469 if any invoked tools are hard-coded to
2470 put derived files in the same directory as the source files.
2471
2472 Note that specifying a
2473 .B BuildDir
2474 works most naturally
2475 with a subsidiary SConscript file
2476 in the source directory.
2477 However,
2478 you would then call the subsidiary SConscript file
2479 not in the source directory,
2480 but in the
2481 .I build_dir ,
2482 as if
2483 .B scons
2484 had made a virtual copy of the source tree
2485 regardless of the value of 
2486 .IR duplicate .
2487 This is how you tell
2488 .B scons
2489 which variant of a source tree to build.
2490 For example:
2491
2492 .ES
2493 BuildDir('build-variant1', 'src')
2494 SConscript('build-variant1/SConscript')
2495 BuildDir('build-variant2', 'src')
2496 SConscript('build-variant2/SConscript')
2497 .EE
2498
2499 .IP
2500 See also the
2501 .BR SConscript ()
2502 function, described below,
2503 for another way to 
2504 specify a build directory
2505 in conjunction with calling a subsidiary
2506 SConscript file.)
2507
2508 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2509 .TP 
2510 .RI Builder( action ", [" arguments ])
2511 .TP 
2512 .RI env.Builder( action ", [" arguments ])
2513 Creates a Builder object for
2514 the specified
2515 .IR action .
2516 See the section "Builder Objects,"
2517 below, for a complete explanation of the arguments and behavior.
2518
2519 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2520 .TP 
2521 .RI CacheDir( cache_dir )
2522 .TP 
2523 .RI env.CacheDir( cache_dir )
2524 Specifies that
2525 .B scons
2526 will maintain a cache of derived files in
2527 .I cache_dir .
2528 The derived files in the cache will be shared
2529 among all the builds using the same
2530 .BR CacheDir ()
2531 call.
2532
2533 When a
2534 .BR CacheDir ()
2535 is being used and
2536 .B scons
2537 finds a derived file that needs to be rebuilt,
2538 it will first look in the cache to see if a
2539 derived file has already been built
2540 from identical input files and an identical build action
2541 (as incorporated into the MD5 build signature).
2542 If so,
2543 .B scons
2544 will retrieve the file from the cache.
2545 If the derived file is not present in the cache,
2546 .B scons
2547 will rebuild it and
2548 then place a copy of the built file in the cache
2549 (identified by its MD5 build signature),
2550 so that it may be retrieved by other
2551 builds that need to build the same derived file
2552 from identical inputs.
2553
2554 Use of a specified
2555 .BR CacheDir()
2556 may be disabled for any invocation
2557 by using the
2558 .B --cache-disable
2559 option.
2560
2561 If the
2562 .B --cache-force
2563 option is used,
2564 .B scons
2565 will place a copy of
2566 .I all
2567 derived files in the cache,
2568 even if they already existed
2569 and were not built by this invocation.
2570 This is useful to populate a cache
2571 the first time
2572 .BR CacheDir ()
2573 is added to a build,
2574 or after using the
2575 .B --cache-disable
2576 option.
2577
2578 When using
2579 .BR CacheDir (),
2580 .B scons
2581 will report,
2582 "Retrieved `file' from cache,"
2583 unless the
2584 .B --cache-show
2585 option is being used.
2586 When the
2587 .B --cache-show
2588 option is used,
2589 .B scons
2590 will print the action that
2591 .I would
2592 have been used to build the file,
2593 without any indication that
2594 the file was actually retrieved from the cache.
2595 This is useful to generate build logs
2596 that are equivalent regardless of whether
2597 a given derived file has been built in-place
2598 or retrieved from the cache.
2599
2600 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2601 .TP 
2602 .RI Clean( targets ", " files_or_dirs )
2603 .TP 
2604 .RI env.Clean( targets ", " files_or_dirs )
2605 This specifies a list of files or directories which should be removed
2606 whenever the targets are specified with the
2607 .B -c
2608 command line option.
2609 The specified targets may be a list
2610 or an individual target.
2611 Multiple calls to
2612 .BR Clean ()
2613 are legal,
2614 and create new targets or add files and directories to the
2615 clean list for the specified targets.
2616
2617 Multiple files or directories should be specified
2618 either as separate arguments to the
2619 .BR Clean ()
2620 method, or as a list.
2621 .BR Clean ()
2622 will also accept the return value of any of the construction environment
2623 Builder methods.
2624 Examples:
2625
2626 .ES
2627 Clean('foo', ['bar', 'baz'])
2628 Clean('dist', env.Program('hello', 'hello.c'))
2629 Clean(['foo', 'bar'], 'something_else_to_clean')
2630 .EE
2631
2632 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2633 .TP
2634 .RI Command( target ", " source ", " commands ", [" key = val ", ...])"
2635 .TP
2636 .RI env.Command( target ", " source ", " commands ", [" key = val ", ...])"
2637 Executes a specific action
2638 (or list of actions)
2639 to build a target file or files.
2640 This is more convenient
2641 than defining a separate Builder object
2642 for a single special-case build.
2643 Any keyword arguments specified override any
2644 same-named existing construction variables.
2645
2646 Note that an action can be an external command,
2647 specified as a string,
2648 or a callable Python object;
2649 see "Action Objects," below.
2650 Examples:
2651
2652 .ES
2653 env.Command('foo.out', 'foo.in',
2654             "$FOO_BUILD < $SOURCES > $TARGET")
2655
2656 env.Command('bar.out', 'bar.in',
2657             ["rm -f $TARGET",
2658              "$BAR_BUILD < $SOURCES > $TARGET"],
2659             ENV = {'PATH' : '/usr/local/bin/'})
2660
2661 def rename(env, target, source):
2662     import os
2663     os.rename('.tmp', str(target[0]))
2664
2665 env.Command('baz.out', 'baz.in',
2666             ["$BAZ_BUILD < $SOURCES > .tmp",
2667              rename ])
2668 .EE
2669
2670 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2671 .TP
2672 .RI Configure( env ", [" custom_tests ", " conf_dir ", " log_file ", " config_h ])
2673 .TP
2674 .RI env.Configure([ custom_tests ", " conf_dir ", " log_file ", " config_h ])
2675 Creates a Configure object for integrated
2676 functionality similar to GNU autoconf.
2677 See the section "Configure Contexts,"
2678 below, for a complete explanation of the arguments and behavior.
2679
2680 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2681 .TP
2682 .RI env.Copy([ key = val ", ...])"
2683 Return a separate copy of a construction environment.
2684 If there are any keyword arguments specified,
2685 they are added to the returned copy,
2686 overwriting any existing values
2687 for the keywords.
2688
2689 .ES
2690 env2 = env.Copy()
2691 env3 = env.Copy(CCFLAGS = '-g')
2692 .EE
2693 .IP
2694 Additionally, a list of tools and a toolpath may be specified, as in
2695 the Environment constructor:
2696
2697 .ES
2698 def MyTool(env): env['FOO'] = 'bar'
2699 env4 = env.Copy(tools = ['msvc', MyTool])
2700 .EE
2701
2702 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2703 .TP
2704 .RI env.CVS( repository ", " module )
2705 A factory function that
2706 returns a Builder object
2707 to be used to fetch source files
2708 from the specified
2709 CVS
2710 .IR repository .
2711 The returned Builder
2712 is intended to be passed to the
2713 .B SourceCode
2714 function.
2715
2716 The optional specified
2717 .I module
2718 will be added to the beginning
2719 of all repository path names;
2720 this can be used, in essence,
2721 to strip initial directory names
2722 from the repository path names,
2723 so that you only have to
2724 replicate part of the repository
2725 directory hierarchy in your
2726 local build directory:
2727
2728 .ES
2729 # Will fetch foo/bar/src.c
2730 # from /usr/local/CVSROOT/foo/bar/src.c.
2731 env.SourceCode('.', env.CVS('/usr/local/CVSROOT'))
2732
2733 # Will fetch bar/src.c
2734 # from /usr/local/CVSROOT/foo/bar/src.c.
2735 env.SourceCode('.', env.CVS('/usr/local/CVSROOT', 'foo'))
2736
2737 # Will fetch src.c
2738 # from /usr/local/CVSROOT/foo/bar/src.c.
2739 env.SourceCode('.', env.CVS('/usr/local/CVSROOT', 'foo/bar'))
2740 .EE
2741
2742 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2743 .TP 
2744 .RI Default( targets )
2745 .TP
2746 .RI env.Default( targets )
2747 This specifies a list of default targets,
2748 which will be built by
2749 .B scons
2750 if no explicit targets are given on the command line.
2751 Multiple calls to
2752 .BR Default ()
2753 are legal,
2754 and add to the list of default targets.
2755
2756 Multiple targets should be specified as
2757 separate arguments to the
2758 .BR Default ()
2759 method, or as a list.
2760 .BR Default ()
2761 will also accept the Node returned by any
2762 of a construction environment's
2763 builder methods.
2764 Examples:
2765
2766 .ES
2767 Default('foo', 'bar', 'baz')
2768 env.Default(['a', 'b', 'c'])
2769 hello = env.Program('hello', 'hello.c')
2770 env.Default(hello)
2771 .EE
2772 .IP
2773 An argument to
2774 .BR Default ()
2775 of
2776 .B None
2777 will clear all default targets.
2778 Later calls to
2779 .BR Default ()
2780 will add to the (now empty) default-target list
2781 like normal.
2782
2783 The current list of targets added using the
2784 .BR Default ()
2785 function or method is available in the
2786 .B DEFAULT_TARGETS
2787 list;
2788 see below.
2789
2790 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2791 .TP
2792 .RI DefaultEnvironment([ args ])
2793 Creates and returns a default construction environment object.
2794 This construction environment is used internally by SCons
2795 in order to execute many of the global functions in this list,
2796 and to fetch source files transparently
2797 from source code management systems.
2798
2799 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2800 .TP
2801 .RI Depends( target ", " dependency )
2802 .TP
2803 .RI env.Depends( target ", " dependency )
2804 Specifies an explicit dependency;
2805 the target file(s) will be rebuilt
2806 whenever the dependency file(s) has changed.
2807 This should only be necessary
2808 for cases where the dependency
2809 is not caught by a Scanner
2810 for the file.
2811
2812 .ES
2813 env.Depends('foo', 'other-input-file-for-foo')
2814 .EE
2815
2816 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2817 .TP
2818 .RI env.Dictionary([ vars ])
2819 Returns a dictionary object
2820 containing copies of all of the
2821 construction variables in the environment.
2822 If there are any variable names specified,
2823 only the specified construction
2824 variables are returned in the dictionary.
2825
2826 .ES
2827 dict = env.Dictionary()
2828 cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM')
2829 .EE
2830
2831 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2832 .TP
2833 .RI Dir( name ", [" directory ])
2834 .TP
2835 .RI env.Dir( name ", [" directory ])
2836 This returns a Directory Node,
2837 an object that represents the specified directory
2838 .IR name . 
2839 .I name
2840 can be a relative or absolute path. 
2841 .I directory
2842 is an optional directory that will be used as the parent directory. 
2843 If no
2844 .I directory
2845 is specified, the current script's directory is used as the parent.
2846
2847 Directory Nodes can be used anywhere you
2848 would supply a string as a directory name
2849 to a Builder method or function.
2850 Directory Nodes have attributes and methods
2851 that are useful in many situations;
2852 see "File and Directory Nodes," below.
2853
2854 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2855 .TP
2856 .RI env.Dump([ key ])
2857 Returns a pretty printable representation of the environment.
2858 .IR key ,
2859 if not
2860 .IR None ,
2861 should be a string containing the name of the variable of interest.
2862
2863 This SConstruct:
2864 .ES
2865 env=Environment()
2866 print env.Dump('CCCOM')
2867 .EE
2868 will print:
2869 .ES
2870 '$CC $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS -c -o $TARGET $SOURCES'
2871 .EE
2872
2873 .ES
2874 env=Environment()
2875 print env.Dump()
2876 .EE
2877 will print:
2878 .ES
2879 { 'AR': 'ar',
2880   'ARCOM': '$AR $ARFLAGS $TARGET $SOURCES\n$RANLIB $RANLIBFLAGS $TARGET',
2881   'ARFLAGS': ['r'],
2882   'AS': 'as',
2883   'ASCOM': '$AS $ASFLAGS -o $TARGET $SOURCES',
2884   'ASFLAGS': [],
2885   ...
2886 .EE
2887
2888 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2889 .TP
2890 .RI EnsurePythonVersion( major ", " minor )
2891 .TP
2892 .RI env.EnsurePythonVersion( major ", " minor )
2893 Ensure that the Python version is at least 
2894 .IR major . minor . 
2895 This function will
2896 print out an error message and exit SCons with a non-zero exit code if the
2897 actual Python version is not late enough.
2898
2899 .ES
2900 EnsurePythonVersion(2,2)
2901 .EE
2902
2903 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2904 .TP
2905 .RI EnsureSConsVersion( major ", " minor )
2906 .TP
2907 .RI env.EnsureSConsVersion( major ", " minor )
2908 Ensure that the SCons version is at least 
2909 .IR major . minor . 
2910 This function will
2911 print out an error message and exit SCons with a non-zero exit code if the
2912 actual SCons version is not late enough.
2913
2914 .ES
2915 EnsureSConsVersion(0,9)
2916 .EE
2917
2918 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2919 .TP
2920 .RI Environment([ key = value ", ...])"
2921 .TP
2922 .RI env.Environment([ key = value ", ...])"
2923 Return a new construction environment
2924 initialized with the specified
2925 .IR key = value
2926 pairs.
2927
2928 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2929 .TP 
2930 .RI Execute( action ", [" strfunction ", " varlist ])
2931 .TP
2932 .RI env.Execute( action ", [" strfunction ", " varlist ])
2933 Executes an Action object.
2934 The specified
2935 .IR action
2936 may be an Action object
2937 (see the section "Action Objects,"
2938 below, for a complete explanation of the arguments and behavior),
2939 or it may be a command-line string,
2940 list of commands,
2941 or executable Python function,
2942 each of which will be converted
2943 into an Action object
2944 and then executed.
2945 The exit value of the command
2946 or return value of the Python function
2947 will be returned.
2948
2949 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2950 .TP
2951 .RI Exit([ value ])
2952 .TP
2953 .RI env.Exit([ value ])
2954 This tells
2955 .B scons
2956 to exit immediately
2957 with the specified
2958 .IR value .
2959 A default exit value of
2960 .B 0
2961 (zero)
2962 is used if no value is specified.
2963
2964 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
2965 .TP
2966 .RI Export( vars )
2967 .TP
2968 .RI env.Export( vars )
2969 This tells 
2970 .B scons
2971 to export a list of variables from the current
2972 SConscript file to all other SConscript files.
2973 The exported variables are kept in a global collection,
2974 so subsequent calls to
2975 .BR Export ()
2976 will over-write previous exports that have the same name. 
2977 Multiple variable names can be passed to
2978 .BR Export ()
2979 as separate arguments or as a list. A dictionary can be used to map
2980 variables to a different name when exported. Both local variables and
2981 global variables can be exported.
2982 Examples:
2983
2984 .ES
2985 env = Environment()
2986 # Make env available for all SConscript files to Import().
2987 Export("env")
2988
2989 package = 'my_name'
2990 # Make env and package available for all SConscript files:.
2991 Export("env", "package")
2992
2993 # Make env and package available for all SConscript files:
2994 Export(["env", "package"])
2995
2996 # Make env available using the name debug:.
2997 Export({"debug":env})
2998 .EE
2999
3000 .IP
3001 Note that the
3002 .BR SConscript ()
3003 function supports an
3004 .I exports
3005 argument that makes it easier to to export a variable or
3006 set of variables to a single SConscript file.
3007 See the description of the
3008 .BR SConscript ()
3009 function, below.
3010
3011 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3012 .TP 
3013 .RI File( name ", [" directory ])
3014 .TP 
3015 .RI env.File( name ", [" directory ])
3016 This returns a
3017 File Node,
3018 an object that represents the specified file
3019 .IR name . 
3020 .I name
3021 can be a relative or absolute path. 
3022 .I directory
3023 is an optional directory that will be used as the parent directory. 
3024
3025 File Nodes can be used anywhere you
3026 would supply a string as a file name
3027 to a Builder method or function.
3028 File Nodes have attributes and methods
3029 that are useful in many situations;
3030 see "File and Directory Nodes," below.
3031
3032 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3033 .TP
3034 .RI FindFile( file ", " dirs )
3035 .TP
3036 .RI env.FindFile( file ", " dirs )
3037 Search for 
3038 .I file 
3039 in the path specified by 
3040 .IR dirs .
3041 .I file
3042 may be a list of file names or a single file name. In addition to searching
3043 for files that exist in the filesytem, this function also searches for
3044 derived files that have not yet been built.
3045
3046 .ES
3047 foo = env.FindFile('foo', ['dir1', 'dir2'])
3048 .EE
3049
3050 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3051 .TP
3052 .RI Flatten( sequence )
3053 .TP
3054 .RI env.Flatten( sequence )
3055 Takes a sequence (that is, a Python list or tuple)
3056 that may contain nested sequences
3057 and returns a flattened list containing
3058 all of the individual elements in any sequence.
3059 This can be helpful for collecting
3060 the lists returned by calls to Builders;
3061 other Builders will automatically
3062 flatten lists specified as input,
3063 but direct Python manipulation of
3064 these lists does not:
3065
3066 .ES
3067 foo = Object('foo.c')
3068 bar = Object('bar.c')
3069
3070 # Because `foo' and `bar' are lists returned by the Object() Builder,
3071 # `objects' will be a list containing nested lists:
3072 objects = ['f1.o', foo, 'f2.o', bar, 'f3.o']
3073
3074 # Passing such a list to another Builder is all right because
3075 # the Builder will flatten the list automatically:
3076 Program(source = objects)
3077
3078 # If you need to manipulate the list directly using Python, you need to
3079 # call Flatten() yourself, or otherwise handle nested lists:
3080 for object in Flatten(objects):
3081     print str(object)
3082 .EE
3083
3084 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3085 .TP
3086 .RI GetBuildPath( file ", [" ... ])
3087 .TP
3088 .RI env.GetBuildPath( file ", [" ... ])
3089 Returns the
3090 .B scons
3091 path name (or names) for the specified
3092 .I file
3093 (or files).
3094 The specified
3095 .I file
3096 or files
3097 may be
3098 .B scons
3099 Nodes or strings representing path names.
3100
3101 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3102 .TP
3103 .RI GetLaunchDir()
3104 .TP
3105 .RI env.GetLaunchDir()
3106 Returns the absolute path name of the directory from which
3107 .B
3108 scons
3109 was initially invoked.
3110 This can be useful when using the
3111 .BR \-u ,
3112 .BR \-U
3113 or
3114 .BR \-D
3115 options, which internally
3116 change to the directory in which the
3117 .B SConstruct
3118 file is found.
3119
3120 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3121 .TP
3122 .RI GetOption( name )
3123 .TP
3124 .RI env.GetOption( name )
3125 This function provides a way to query a select subset of the scons command line
3126 options from a SConscript file. See 
3127 .IR SetOption () 
3128 for a description of the options available.
3129
3130 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3131 '\".TP
3132 '\".RI GlobalBuilders( flag )
3133 '\"When
3134 '\".B flag
3135 '\"is non-zero,
3136 '\"adds the names of the default builders
3137 '\"(Program, Library, etc.)
3138 '\"to the global name space
3139 '\"so they can be called without an explicit construction environment.
3140 '\"(This is the default.)
3141 '\"When
3142 '\".B
3143 '\"flag is zero,
3144 '\"the names of the default builders are removed
3145 '\"from the global name space
3146 '\"so that an explicit construction environment is required
3147 '\"to call all builders.
3148
3149 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3150 .TP
3151 .RI Help( text )
3152 .TP
3153 .RI env.Help( text )
3154 This specifies help text to be printed if the 
3155 .B -h 
3156 argument is given to
3157 .BR scons .
3158 If
3159 .BR Help
3160 is called multiple times, the text is appended together in the order
3161 that
3162 .BR Help
3163 is called.
3164
3165 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3166 .TP
3167 .RI Ignore( target ", " dependency )
3168 .TP
3169 .RI env.Ignore( target ", " dependency )
3170 The specified dependency file(s)
3171 will be ignored when deciding if
3172 the target file(s) need to be rebuilt.
3173
3174 .ES
3175 env.Ignore('foo', 'foo.c')
3176 env.Ignore('bar', ['bar1.h', 'bar2.h'])
3177 .EE
3178
3179 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3180 .TP 
3181 .RI Import( vars )
3182 .TP 
3183 .RI env.Import( vars )
3184 This tells 
3185 .B scons
3186 to import a list of variables into the current SConscript file. This
3187 will import variables that were exported with
3188 .BR Export ()
3189 or in the 
3190 .I exports
3191 argument to 
3192 .BR SConscript ().
3193 Variables exported by 
3194 .BR SConscript ()
3195 have precedence.
3196 Multiple variable names can be passed to 
3197 .BR Import ()
3198 as separate arguments or as a list. The variable "*" can be used
3199 to import all variables.
3200 Examples:
3201
3202 .ES
3203 Import("env")
3204 Import("env", "variable")
3205 Import(["env", "variable"])
3206 Import("*")
3207 .EE
3208
3209 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3210 .TP
3211 .RI Install( dir ", " source )
3212 .TP
3213 .RI env.Install( dir ", " source )
3214 Installs one or more files in a destination directory.
3215 The file names remain the same.
3216
3217 .ES
3218 env.Install(dir = '/usr/local/bin', source = ['foo', 'bar'])
3219 .EE
3220
3221 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3222 .TP
3223 .RI InstallAs( target ", " source )
3224 .TP
3225 .RI env.InstallAs( target ", " source )
3226 Installs one or more files as specific file names,
3227 allowing changing a file name as part of the
3228 installation.
3229 It is an error if the target and source
3230 list different numbers of files.
3231
3232 .ES
3233 env.InstallAs(target = '/usr/local/bin/foo',
3234               source = 'foo_debug')
3235 env.InstallAs(target = ['../lib/libfoo.a', '../lib/libbar.a'],
3236               source = ['libFOO.a', 'libBAR.a'])
3237 .EE
3238
3239 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3240 .TP
3241 .RI Literal( string )
3242 .TP
3243 .RI env.Literal( string )
3244 The specified
3245 .I string
3246 will be preserved as-is
3247 and not have construction variables expanded.
3248
3249 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3250 .TP
3251 .RI Local( targets )
3252 .TP
3253 .RI env.Local( targets )
3254 The specified
3255 .I targets
3256 will have copies made in the local tree,
3257 even if an already up-to-date copy
3258 exists in a repository.
3259 Returns a list of the target Node or Nodes.
3260
3261 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3262 .TP
3263 .RI env.ParseConfig( command ", [" function ])
3264 Calls the specified
3265 .I function
3266 to modify the environment as specified by the output of
3267 .I command .
3268 The default
3269 .I function
3270 expects the output of a typical
3271 .I *-config command
3272 (for example,
3273 .BR gtk-config )
3274 and parses the returned
3275 .BR -L ,
3276 .BR -l ,
3277 .BR -Wa ,
3278 .BR -Wl ,
3279 .BR -Wp ,
3280 .B -I
3281 and other options
3282 into the
3283 .BR LIBPATH ,
3284 .BR LIBS ,
3285 .BR ASFLAGS ,
3286 .BR LINKFLAGS ,
3287 .BR CPPFLAGS ,
3288 .B CPPPATH
3289 and
3290 .B CCFLAGS
3291 variables,
3292 respectively.
3293 A returned
3294 .B -pthread
3295 option gets added to both the
3296 .B CCFLAGS
3297 and
3298 .B LINKFLAGS
3299 variables.
3300 A returned
3301 .B -framework
3302 option gets added to the
3303 .B LINKFLAGS
3304 variable.
3305 Any other strings not associated with options
3306 are assumed to be the names of libraries
3307 and added to the
3308 .B LIBS 
3309 construction variable.
3310
3311 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3312 .TP
3313 .RI ParseDepends( filename ", [" must_exist ])
3314 .TP
3315 .RI env.ParseDepends( filename ", [" must_exist ])
3316 Parses the contents of the specified
3317 .I filename
3318 as a list of dependencies in the style of
3319 .BR Make
3320 or
3321 .BR mkdep ,
3322 and explicitly establishes all of the listed dependencies.
3323 By default,
3324 it is not an error
3325 if the specified
3326 .I filename
3327 does not exist.
3328 The optional
3329 .I must_exit
3330 argument may be set to a non-zero
3331 value to have
3332 scons
3333 throw an exception and
3334 generate an error if the file does not exist,
3335 or is otherwise inaccessible.
3336 The
3337 .I filename
3338 and all of the files listed therein
3339 will be interpreted relative to
3340 the directory of the
3341 .I SConscript
3342 file which called the
3343 .B ParseDepends
3344 function.
3345
3346 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3347 .TP
3348 env.Perforce()
3349 A factory function that
3350 returns a Builder object
3351 to be used to fetch source files
3352 from the Perforce source code management system.
3353 The returned Builder
3354 is intended to be passed to the
3355 .B SourceCode
3356 function:
3357
3358 .ES
3359 env.SourceCode('.', env.Perforce())
3360 .EE
3361 .IP
3362 Perforce uses a number of external
3363 environment variables for its operation.
3364 Consequently, this function adds the
3365 following variables from the user's external environment
3366 to the construction environment's
3367 ENV dictionary:
3368 P4CHARSET,
3369 P4CLIENT,
3370 P4LANGUAGE,
3371 P4PASSWD,
3372 P4PORT,
3373 P4USER,
3374 SYSTEMROOT,
3375 USER,
3376 and
3377 USERNAME.
3378
3379 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3380 .TP
3381 .RI Platform( string )
3382 Returns a callable object
3383 that can be used to initialize
3384 a construction environment using the
3385 platform keyword of the Environment() method:
3386
3387 .ES
3388 env = Environment(platform = Platform('win32'))
3389 .EE
3390 .TP
3391 .RI env.Platform( string )
3392 Applies the callable object for the specified platform
3393 .I string
3394 to the environment through which the method was called.
3395
3396 .ES
3397 env.Platform('posix')
3398 .EE
3399 .IP
3400 Note that the
3401 .B win32
3402 platform adds the
3403 .B SYSTEMROOT
3404 variable from the user's external environment
3405 to the construction environment's
3406 .B ENV
3407 dictionary.
3408 This is so that any executed commands
3409 that use sockets to connect with other systems
3410 (such as fetching source files from
3411 external CVS repository specifications like 
3412 .BR :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons )
3413 will work on Win32 systems.
3414
3415 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3416 .TP
3417 .RI Precious( target ", ...)"
3418 .TP
3419 .RI env.Precious( target ", ...)"
3420 Marks each given
3421 .I target
3422 as precious so it is not deleted before it is rebuilt. Normally
3423 .B scons
3424 deletes a target before building it.
3425 Multiple targets can be passed in to a single call to
3426 .BR Precious ().
3427
3428 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3429 .TP
3430 .RI env.Prepend( key = val ", [...])"
3431 Appends the specified keyword arguments
3432 to the beginning of construction variables in the environment.
3433 If the Environment does not have
3434 the specified construction variable,
3435 it is simply added to the environment.
3436 If the values of the construction variable
3437 and the keyword argument are the same type,
3438 then the two values will be simply added together.
3439 Otherwise, the construction variable
3440 and the value of the keyword argument
3441 are both coerced to lists,
3442 and the lists are added together.
3443 (See also the Append method, above.)
3444
3445 .ES
3446 env.Prepend(CCFLAGS = '-g ', FOO = ['foo.yyy'])
3447 .EE
3448
3449 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3450 .TP
3451 .RI env.PrependENVPath( name ", " newpath ", [" envname ", " sep ])
3452 This appends new path elements to the given path in the
3453 specified external environment
3454 .RB ( ENV
3455 by default).
3456 This will only add
3457 any particular path once (leaving the first one it encounters and
3458 ignoring the rest, to preserve path order),
3459 and to help assure this,
3460 will normalize all paths (using
3461 .B os.path.normpath
3462 and
3463 .BR os.path.normcase ).
3464 This can also handle the
3465 case where the given old path variable is a list instead of a
3466 string, in which case a list will be returned instead of a string.
3467 Example:
3468
3469 .ES
3470 print 'before:',env['ENV']['INCLUDE']
3471 include_path = '/foo/bar:/foo'
3472 env.PrependENVPath('INCLUDE', include_path)
3473 print 'after:',env['ENV']['INCLUDE']
3474
3475 yields:
3476 before: /biz:/foo
3477 after: /foo/bar:/foo:/biz
3478 .EE
3479
3480 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3481 .TP
3482 .RI env.AppendUnique( key = val ", [...])"
3483 Appends the specified keyword arguments
3484 to the beginning of construction variables in the environment.
3485 If the Environment does not have
3486 the specified construction variable,
3487 it is simply added to the environment.
3488 If the construction variable being appended to is a list,
3489 then any value(s) that already exist in the
3490 construction variable will
3491 .I not
3492 be added again to the list.
3493
3494 .ES
3495 env.PrependUnique(CCFLAGS = '-g', FOO = ['foo.yyy'])
3496 .EE
3497
3498 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3499 .TP
3500 env.RCS()
3501 A factory function that
3502 returns a Builder object
3503 to be used to fetch source files
3504 from RCS.
3505 The returned Builder
3506 is intended to be passed to the
3507 .B SourceCode
3508 function:
3509
3510 .ES
3511 env.SourceCode('.', env.RCS())
3512 .EE
3513 .IP
3514 Note that
3515 .B scons
3516 will fetch source files
3517 from RCS subdirectories automatically,
3518 so configuring RCS
3519 as demonstrated in the above example
3520 should only be necessary if
3521 you are fetching from
3522 RCS,v
3523 files in the same
3524 directory as the source files,
3525 or if you need to explicitly specify RCS
3526 for a specific subdirectory.
3527
3528 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3529 .TP
3530 .RI env.Replace( key = val ", [...])"
3531 Replaces construction variables in the Environment
3532 with the specified keyword arguments.
3533
3534 .ES
3535 env.Replace(CCFLAGS = '-g', FOO = 'foo.xxx')
3536 .EE
3537
3538 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3539 .TP
3540 .RI Repository( directory )
3541 .TP
3542 .RI env.Repository( directory )
3543 Specifies that
3544 .I directory
3545 is a repository to be searched for files.
3546 Multiple calls to
3547 .BR Repository ()
3548 are legal,
3549 and each one adds to the list of
3550 repositories that will be searched.
3551
3552 To
3553 .BR scons ,
3554 a repository is a copy of the source tree,
3555 from the top-level directory on down,
3556 which may contain
3557 both source files and derived files
3558 that can be used to build targets in
3559 the local source tree.
3560 The canonical example would be an
3561 official source tree maintained by an integrator.
3562 If the repository contains derived files,
3563 then the derived files should have been built using
3564 .BR scons ,
3565 so that the repository contains the necessary
3566 signature information to allow
3567 .B scons
3568 to figure out when it is appropriate to
3569 use the repository copy of a derived file,
3570 instead of building one locally.
3571
3572 Note that if an up-to-date derived file
3573 already exists in a repository,
3574 .B scons
3575 will
3576 .I not
3577 make a copy in the local directory tree.
3578 In order to guarantee that a local copy
3579 will be made,
3580 use the
3581 .B Local()
3582 method.
3583
3584 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3585 .TP
3586 .RI Return( vars )
3587 This tells
3588 .B scons
3589 what variable(s) to use as the return value(s) of the current SConscript
3590 file. These variables will be returned to the "calling" SConscript file
3591 as the return value(s) of 
3592 .BR SConscript ().
3593 Multiple variable names should be passed to 
3594 .BR Return ()
3595 as a list. Example:
3596
3597 .ES
3598 Return("foo")
3599 Return(["foo", "bar"])
3600 .EE
3601
3602 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3603 .TP 
3604 .RI Scanner( function ", [" argument ", " keys ", " path_function ", " node_class ", " node_factory ", " scan_check ", " recursive ])
3605 .TP 
3606 .RI env.Scanner( function ", [" argument ", " keys ", " path_function ", " node_class ", " node_factory ", " scan_check ", " recursive ])
3607 Creates a Scanner object for
3608 the specified
3609 .IR function .
3610 See the section "Scanner Objects,"
3611 below, for a complete explanation of the arguments and behavior.
3612
3613 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3614 .TP
3615 env.SCCS()
3616 A factory function that
3617 returns a Builder object
3618 to be used to fetch source files
3619 from SCCS.
3620 The returned Builder
3621 is intended to be passed to the
3622 .B SourceCode
3623 function:
3624
3625 .ES
3626 env.SourceCode('.', env.SCCS())
3627 .EE
3628 .IP
3629 Note that
3630 .B scons
3631 will fetch source files
3632 from SCCS subdirectories automatically,
3633 so configuring SCCS
3634 as demonstrated in the above example
3635 should only be necessary if
3636 you are fetching from
3637 .I s.SCCS
3638 files in the same
3639 directory as the source files,
3640 or if you need to explicitly specify SCCS
3641 for a specific subdirectory.
3642
3643 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3644 .TP
3645 .RI SConscript( scripts ", [" exports ", " build_dir ", " src_dir ", " duplicate ])
3646 .TP
3647 .RI env.SConscript( scripts ", [" exports ", " build_dir ", " src_dir ", " duplicate ])
3648 .TP
3649 .RI SConscript(dirs= subdirs ", [name=" script ", " exports ", " build_dir ", " src_dir ", " duplicate ])
3650 .TP
3651 .RI env.SConscript(dirs= subdirs ", [name=" script ", " exports ", " build_dir ", " src_dir ", " duplicate ])
3652 This tells
3653 .B scons
3654 to execute
3655 one or more subsidiary SConscript (configuration) files.
3656 There are two ways to call the
3657 .BR SConscript ()
3658 function.
3659
3660 The first way you can call
3661 .BR SConscript ()
3662 is to explicitly specify one or more
3663 .I scripts
3664 as the first argument.
3665 A single script may be specified as a string;
3666 multiple scripts must be specified as a list
3667 (either explicitly or as created by
3668 a function like
3669 .BR Split ()).
3670
3671 The second way you can call
3672 .BR SConscript ()
3673 is to specify a list of (sub)directory names
3674 as a
3675 .RI dirs= subdirs
3676 keyword argument.
3677 In this case,
3678 .B scons
3679 will, by default,
3680 execute a subsidiary configuration file named
3681 .B SConscript
3682 in each of the specified directories.
3683 You may specify a name other than
3684 .B SConscript
3685 by supplying an optional
3686 .RI name= script
3687 keyword argument.
3688
3689 The optional 
3690 .I exports
3691 argument provides a list of variable names or a dictionary of
3692 named values to export to the
3693 .IR script(s) ". "
3694 These variables are locally exported only to the specified
3695 .IR script(s) ,
3696 and do not affect the
3697 global pool of variables used by
3698 the
3699 .BR Export ()
3700 function.
3701 '\"If multiple dirs are provided,
3702 '\"each script gets a fresh export.
3703 The subsidiary
3704 .I script(s)
3705 must use the
3706 .BR Import ()
3707 function to import the variables.
3708
3709 The optional
3710 .I build_dir
3711 argument specifies that all of the target files
3712 (for example, object files and executables)
3713 that would normally be built in the subdirectory in which
3714 .I script
3715 resides should actually
3716 be built in
3717 .IR build_dir .
3718 .I build_dir
3719 is interpreted relative to the directory
3720 of the calling SConscript file.
3721
3722 The optional
3723 .I src_dir
3724 argument specifies that the
3725 source files from which
3726 the target files should be built
3727 can be found in
3728 .IR src_dir .
3729 .I src_dir
3730 is interpreted relative to the directory
3731 of the calling SConscript file.
3732
3733 By default,
3734 .B scons
3735 will link or copy (depending on the platform)
3736 all the source files into the build directory.
3737 This behavior may be disabled by
3738 setting the optional
3739 .I duplicate
3740 argument to 0
3741 (it is set to 1 by default),
3742 in which case
3743 .B scons
3744 will refer directly to
3745 the source files in their source directory
3746 when building target files.
3747 (Setting
3748 .IR duplicate =0
3749 is usually safe, and always more efficient
3750 than the default of
3751 .IR duplicate =1,
3752 but it may cause build problems in certain end-cases,
3753 such as compiling from source files that
3754 are generated by the build.)
3755
3756 Any variables returned by 
3757 .I script 
3758 using 
3759 .BR Return ()
3760 will be returned by the call to
3761 .BR SConscript (). 
3762
3763 Examples:
3764
3765 .ES
3766 SConscript('subdir/SConscript')
3767 foo = SConscript('sub/SConscript', exports='env')
3768 SConscript('dir/SConscript', exports=['env', 'variable'])
3769 SConscript('src/SConscript', build_dir='build', duplicate=0)
3770 SConscript('bld/SConscript', src_dir='src', exports='env variable')
3771 SConscript(dirs=['sub1', 'sub2'])
3772 SConscript(dirs=['sub3', 'sub4'], name='MySConscript')
3773 .EE
3774
3775 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3776 .TP
3777 .RI SConscriptChdir( value )
3778 .TP
3779 .RI env.SConscriptChdir( value )
3780 By default,
3781 .B scons
3782 changes its working directory
3783 to the directory in which each
3784 subsidiary SConscript file lives.
3785 This behavior may be disabled
3786 by specifying either:
3787
3788 .ES
3789 SConscriptChdir(0)
3790 env.SConscriptChdir(0)
3791 .EE
3792 .IP
3793 in which case
3794 .B scons
3795 will stay in the top-level directory
3796 while reading all SConscript files.
3797 (This may be necessary when building from repositories,
3798 when all the directories in which SConscript files may be found
3799 don't necessarily exist locally.)
3800
3801 You may enable and disable
3802 this ability by calling
3803 SConscriptChdir()
3804 multiple times:
3805
3806 .ES
3807 env = Environment()
3808 SConscriptChdir(0)
3809 SConscript('foo/SConscript')    # will not chdir to foo
3810 env.SConscriptChdir(1)
3811 SConscript('bar/SConscript')    # will chdir to bar
3812 .EE
3813
3814 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3815 .TP
3816 .RI SConsignFile([ file , dbm_module ])
3817 .TP
3818 .RI env.SConsignFile([ file , dbm_module ])
3819 This tells
3820 .B scons
3821 to store all file signatures
3822 in the specified
3823 .IR file .
3824 If the
3825 .I file
3826 is omitted,
3827 .B .sconsign.dbm
3828 is used by default.
3829 If
3830 .I file
3831 is not an absolute path name,
3832 the file is placed in the same directory as the top-level
3833 .B SConstruct
3834 file.
3835
3836 The optional
3837 .I dbm_module
3838 argument can be used to specify
3839 which Python database module
3840 The default is to use a custom
3841 .B SCons.dblite
3842 module that uses pickled
3843 Python data structures,
3844 and which works on all Python versions from 1.5.2 on.
3845
3846 Examples:
3847
3848 .ES
3849 # Stores signatures in ".sconsign.dbm"
3850 # in the top-level SConstruct directory.
3851 SConsignFile()
3852
3853 # Stores signatures in the file "etc/scons-signatures"
3854 # relative to the top-level SConstruct directory.
3855 SConsignFile("etc/scons-signatures")
3856
3857 # Stores signatures in the specified absolute file name.
3858 SConsignFile("/home/me/SCons/signatures")
3859 .EE
3860
3861 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3862 .TP
3863 .RI env.SetDefault(key = val ", [...])"
3864 Sets construction variables to default values specified with the keyword
3865 arguments if (and only if) the variables are not already set.
3866 The following statements are equivalent:
3867
3868 .ES
3869 env.SetDefault(FOO = 'foo')
3870
3871 if not env.has_key('FOO'): env['FOO'] = 'foo'
3872 .EE
3873
3874 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3875 .TP
3876 .RI SetOption( name ", " value )
3877 .TP
3878 .RI env.SetOption( name ", " value )
3879 This function provides a way to set a select subset of the scons command
3880 line options from a SConscript file. The options supported are:
3881 .B clean
3882 which corresponds to -c, --clean, and --remove;
3883 .B duplicate
3884 which 
3885 corresponds to --duplicate;
3886 .B implicit_cache
3887 which corresponds to --implicit-cache;
3888 .B max_drift
3889 which corresponds to --max-drift;
3890 .B num_jobs
3891 which corresponds to -j and --jobs.
3892 See the documentation for the
3893 corresponding command line object for information about each specific
3894 option. Example:
3895
3896 .ES
3897 SetOption('max_drift', 1)
3898 .EE
3899
3900 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3901 .TP
3902 .RI SideEffect( side_effect ", " target )
3903 .TP
3904 .RI env.SideEffect( side_effect ", " target )
3905 Declares
3906 .I side_effect
3907 as a side effect of building
3908 .IR target . 
3909 Both 
3910 .I side_effect 
3911 and
3912 .I target
3913 can be a list, a file name, or a node.
3914 A side effect is a target that is created
3915 as a side effect of building other targets.
3916 For example, a Windows PDB
3917 file is created as a side effect of building the .obj
3918 files for a static library.
3919 If a target is a side effect of multiple build commands,
3920 .B scons
3921 will ensure that only one set of commands
3922 is executed at a time.
3923 Consequently, you only need to use this method
3924 for side-effect targets that are built as a result of
3925 multiple build commands.
3926
3927 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
3928 .TP
3929 .RI SourceCode( entries ", " builder )
3930 .TP
3931 .RI env.SourceCode( entries ", " builder )
3932 Arrange for non-existent source files to
3933 be fetched from a source code management system
3934 using the specified
3935 .IR builder .
3936 The specified
3937 .I entries
3938 may be a Node, string or list of both,
3939 and may represent either individual
3940 source files or directories in which
3941 source files can be found.
3942
3943 For any non-existent source files,
3944 .B scons
3945 will search up the directory tree
3946 and use the first
3947 .B SourceCode
3948 builder it finds.
3949 The specified
3950 .I builder
3951 may be
3952 .BR None ,
3953 in which case
3954 .B scons
3955 will not use a builder to fetch
3956 source files for the specified
3957 .IR entries ,
3958 even if a
3959 .B SourceCode
3960 builder has been specified
3961 for a directory higher up the tree.
3962
3963 .B scons
3964 will, by default,
3965 fetch files from SCCS or RCS subdirectories
3966 without explicit configuration.
3967 This takes some extra processing time
3968 to search for the necessary
3969 source code management files on disk.
3970 You can avoid these extra searches
3971 and speed up your build a little
3972 by disabling these searches as follows:
3973
3974 .ES
3975 env.SourceCode('.', None)
3976 .EE
3977
3978 .IP
3979 Note that if the specified
3980 .I builder
3981 is one you create by hand,
3982 it must have an associated
3983 construction environment to use
3984 when fetching a source file.
3985
3986 .B scons
3987 provides a set of canned factory
3988 functions that return appropriate
3989 Builders for various popular
3990 source code management systems.
3991 Canonical examples of invocation include:
3992
3993 .ES
3994 env.SourceCode('.', env.BitKeeper('/usr/local/BKsources'))
3995 env.SourceCode('src', env.CVS('/usr/local/CVSROOT'))
3996 env.SourceCode('/', env.RCS())
3997 env.SourceCode(['f1.c', 'f2.c'], env.SCCS())
3998 env.SourceCode('no_source.c', None)
3999 .EE
4000 '\"env.SourceCode('.', env.Subversion('file:///usr/local/Subversion'))
4001 '\"
4002 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4003 '\".TP
4004 '\".RI Subversion( repository ", " module )
4005 '\"A factory function that
4006 '\"returns a Builder object
4007 '\"to be used to fetch source files
4008 '\"from the specified Subversion
4009 '\".IR repository .
4010 '\"The returned Builder
4011 '\"is intended to be passed to the
4012 '\".B SourceCode
4013 '\"function.
4014 '\"
4015 '\"The optional specified
4016 '\".I module
4017 '\"will be added to the beginning
4018 '\"of all repository path names;
4019 '\"this can be used, in essence,
4020 '\"to strip initial directory names
4021 '\"from the repository path names,
4022 '\"so that you only have to
4023 '\"replicate part of the repository
4024 '\"directory hierarchy in your
4025 '\"local build directory:
4026 '\"
4027 '\".ES
4028 '\"# Will fetch foo/bar/src.c
4029 '\"# from /usr/local/Subversion/foo/bar/src.c.
4030 '\"env.SourceCode('.', env.Subversion('file:///usr/local/Subversion'))
4031 '\"
4032 '\"# Will fetch bar/src.c
4033 '\"# from /usr/local/Subversion/foo/bar/src.c.
4034 '\"env.SourceCode('.', env.Subversion('file:///usr/local/Subversion', 'foo'))
4035 '\"
4036 '\"# Will fetch src.c
4037 '\"# from /usr/local/Subversion/foo/bar/src.c.
4038 '\"env.SourceCode('.', env.Subversion('file:///usr/local/Subversion', 'foo/bar'))
4039 '\".EE
4040
4041 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4042 .TP
4043 .RI SourceSignatures( type )
4044 .TP
4045 .RI env.SourceSignatures( type )
4046 This function tells SCons what type of signature to use for source files:
4047 .B "MD5"
4048 or
4049 .BR "timestamp" .
4050 If the environment method is used,
4051 the specified type of source signature
4052 is only used when deciding whether targets
4053 built with that environment are up-to-date or must be rebuilt.
4054 If the global function is used,
4055 the specified type of source signature becomes the default
4056 used for all decisions
4057 about whether targets are up-to-date.
4058
4059 "MD5" means the signature of a source file
4060 is the MD5 checksum of its contents.
4061 "timestamp" means the signature of a source file
4062 is its timestamp (modification time).
4063 There is no different between the two behaviors
4064 for Python
4065 .BR Value ()
4066 node objects.
4067 "MD5" signatures take longer to compute,
4068 but are more accurate than "timestamp" signatures.
4069 The default is "MD5".
4070
4071 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4072 .TP
4073 .RI Split( arg )
4074 .TP
4075 .RI env.Split( arg )
4076 Returns a list of file names or other objects.
4077 If arg is a string,
4078 it will be split on strings of white-space characters
4079 within the string,
4080 making it easier to write long lists of file names.
4081 If arg is already a list,
4082 the list will be returned untouched.
4083 If arg is any other type of object,
4084 it will be returned as a list
4085 containing just the object.
4086
4087 .ES
4088 files = Split("f1.c f2.c f3.c")
4089 files = env.Split("f4.c f5.c f6.c")
4090 files = Split("""
4091         f7.c
4092         f8.c
4093         f9.c
4094 """)
4095 .EE
4096
4097 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4098 .TP
4099 .RI TargetSignatures( type )
4100 .TP
4101 .RI env.TargetSignatures( type )
4102 This function tells SCons what type of signatures to use
4103 for target files:
4104 .B "build"
4105 or
4106 .BR "content" .
4107 If the environment method is used,
4108 the specified type of signature is only used
4109 for targets built with that environment.
4110 If the global function is used,
4111 the specified type of signature becomes the default
4112 used for all target files that
4113 don't have an explicit target signature type
4114 specified for their environments.
4115
4116 "build" means the signature of a target file
4117 is made by concatenating all of the
4118 signatures of all its source files.
4119 "content" means the signature of a target
4120 file is an MD5 checksum of its contents.
4121 "build" signatures are usually faster to compute,
4122 but "content" signatures can prevent unnecessary rebuilds
4123 when a target file is rebuilt to the exact same contents
4124 as the previous build.
4125 The default is "build".
4126
4127 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4128 .TP
4129 .RI Tool( string [, toolpath ", " **kw ])
4130 Returns a callable object
4131 that can be used to initialize
4132 a construction environment using the
4133 tools keyword of the Environment() method.
4134 The object may be called with a construction
4135 environment as an argument,
4136 in which case the object will
4137 add the necessary variables
4138 to the construction environment
4139 and the name of the tool will be added to the
4140 .B $TOOLS
4141 construction variable.
4142
4143 Additional keyword arguments are passed to the tool's
4144 .B generate()
4145 method.
4146
4147 .ES
4148 env = Environment(tools = [ Tool('msvc') ])
4149
4150 env = Environment()
4151 t = Tool('msvc')
4152 t(env)  # adds 'msvc' to the TOOLS variable
4153 u = Tool('opengl', toolpath = ['tools'])
4154 u(env)  # adds 'opengl' to the TOOLS variable
4155 .EE
4156 .TP
4157 .RI env.Tool( string [, toolpath ", " **kw ])
4158 Applies the callable object for the specified tool
4159 .I string
4160 to the environment through which the method was called.
4161
4162 Additional keyword arguments are passed to the tool's
4163 .B generate()
4164 method.
4165
4166 .ES
4167 env.Tool('gcc')
4168 env.Tool('opengl', toolpath = ['build/tools'])
4169 .EE
4170
4171 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4172 .TP
4173 .RI Value( value )
4174 .TP
4175 .RI env.Value( value )
4176 Returns a Node object representing the specified Python value.  Value
4177 nodes can be used as dependencies of targets.  If the result of
4178 calling
4179 .BR str( value )
4180 changes between SCons runs, any targets depending on
4181 .BR Value( value )
4182 will be rebuilt.  When using timestamp source signatures, Value nodes'
4183 timestamps are equal to the system time when the node is created.
4184
4185 .ES
4186 def create(target, source, env):
4187     f = open(str(target[0]), 'wb')
4188     f.write('prefix=' + source[0].get_contents())
4189     
4190 prefix = ARGUMENTS.get('prefix', '/usr/local')
4191 env = Environment()
4192 env['BUILDERS']['Config'] = Builder(action = create)
4193 env.Config(target = 'package-config', source = Value(prefix))
4194 .EE
4195
4196 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4197 .TP
4198 .RI WhereIs( program ", [" path  ", " pathext ", " reject ])
4199 .TP
4200 .RI env.WhereIs( program ", [" path  ", " pathext ", " reject ])
4201
4202 Searches for the specified executable
4203 .I program,
4204 returning the full path name to the program
4205 if it is found,
4206 and returning None if not.
4207 Searches the specified
4208 .I path,
4209 the value of the calling environment's PATH
4210 (env['ENV']['PATH']),
4211 or the user's current external PATH
4212 (os.environ['PATH'])
4213 by default.
4214 On Win32 systems, searches for executable
4215 programs with any of the file extensions
4216 listed in the specified
4217 .I pathext,
4218 the calling environment's PATHEXT
4219 (env['ENV']['PATHEXT'])
4220 or the user's current PATHEXT
4221 (os.environ['PATHEXT'])
4222 by default.
4223 Will not select any
4224 path name or names
4225 in the specified
4226 .I reject
4227 list, if any.
4228
4229 .SS SConscript Variables
4230 In addition to the global functions and methods,
4231 .B scons
4232 supports a number of Python variables
4233 that can be used in SConscript files
4234 to affect how you want the build to be performed.
4235
4236 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4237 .TP
4238 ARGLIST
4239 A list
4240 .IR keyword = value
4241 arguments specified on the command line.
4242 Each element in the list is a tuple
4243 containing the
4244 .RI ( keyword , value )
4245 of the argument.
4246 The separate
4247 .I keyword
4248 and
4249 .I value
4250 elements of the tuple
4251 can be accessed by
4252 subscripting for element
4253 .B [0]
4254 and
4255 .B [1]
4256 of the tuple, respectively.
4257
4258 .ES
4259 print "first keyword, value =", ARGLIST[0][0], ARGLIST[0][1]
4260 print "second keyword, value =", ARGLIST[1][0], ARGLIST[1][1]
4261 third_tuple = ARGLIST[2]
4262 print "third keyword, value =", third_tuple[0], third_tuple[1]
4263 for key, value in ARGLIST:
4264     # process key and value
4265 .EE
4266
4267 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4268 .TP
4269 ARGUMENTS
4270 A dictionary of all the
4271 .IR keyword = value
4272 arguments specified on the command line.
4273 The dictionary is not in order,
4274 and if a given keyword has
4275 more than one value assigned to it
4276 on the command line,
4277 the last (right-most) value is
4278 the one in the
4279 .B ARGUMENTS
4280 dictionary.
4281
4282 .ES
4283 if ARGUMENTS.get('debug', 0):
4284     env = Environment(CCFLAGS = '-g')
4285 else:
4286     env = Environment()
4287 .EE
4288
4289 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4290 .TP
4291 BUILD_TARGETS
4292 A list of the targets which
4293 .B scons
4294 will actually try to build,
4295 regardless of whether they were specified on
4296 the command line or via the
4297 .BR Default ()
4298 function or method.
4299 The elements of this list may be strings
4300 .I or
4301 nodes, so you should run the list through the Python
4302 .B str
4303 function to make sure any Node path names
4304 are converted to strings.
4305
4306 Because this list may be taken from the
4307 list of targets specified using the
4308 .BR Default ()
4309 function or method,
4310 the contents of the list may change
4311 on each successive call to
4312 .BR Default ().
4313 See the
4314 .B DEFAULT_TARGETS
4315 list, below,
4316 for additional information.
4317
4318 .ES
4319 if 'foo' in BUILD_TARGETS:
4320     print "Don't forget to test the `foo' program!"
4321 if 'special/program' in BUILD_TARGETS:
4322     SConscript('special')
4323 .EE
4324 .IP
4325 Note that the
4326 .B BUILD_TARGETS
4327 list only contains targets expected listed
4328 on the command line or via calls to the
4329 .BR Default ()
4330 function or method.
4331 It does
4332 .I not
4333 contain all dependent targets that will be built as
4334 a result of making the sure the explicitly-specified
4335 targets are up to date.
4336
4337 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4338 .TP
4339 COMMAND_LINE_TARGETS
4340 A list of the targets explicitly specified on
4341 the command line.
4342 If there are no targets specified on the command line,
4343 the list is empty.
4344 This can be used, for example,
4345 to take specific actions only
4346 when a certain target or targets
4347 is explicitly being built:
4348
4349 .ES
4350 if 'foo' in COMMAND_LINE_TARGETS:
4351     print "Don't forget to test the `foo' program!"
4352 if 'special/program' in COMMAND_LINE_TARGETS:
4353     SConscript('special')
4354 .EE
4355
4356 '\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
4357 .TP
4358 DEFAULT_TARGETS
4359 A list of the target
4360 .I nodes
4361 that have been specified using the
4362 .BR Default ()
4363 function or method.
4364 The elements of the list are nodes,
4365 so you need to run them through the Python
4366 .B str
4367 function to get at the path name for each Node.
4368
4369 .ES
4370 print str(DEFAULT_TARGETS[0])
4371 if 'foo' in map(str, DEFAULT_TARGETS):
4372     print "Don't forget to test the `foo' program!"
4373 .EE
4374 .IP
4375 The contents of the
4376 .B DEFAULT_TARGETS
4377 list change on on each successive call to the
4378 .BR Default ()
4379 function:
4380
4381 .ES
4382 print map(str, DEFAULT_TARGETS)   # originally []
4383 Default('foo')
4384 print map(str, DEFAULT_TARGETS)   # now a node ['foo']
4385 Default('bar')
4386 print map(str, DEFAULT_TARGETS)   # now a node ['foo', 'bar']
4387 Default(None)
4388 print map(str, DEFAULT_TARGETS)   # back to []
4389 .EE
4390 .IP
4391 Consequently, be sure to use
4392 .B DEFAULT_TARGETS
4393 only after you've made all of your
4394 .BR Default ()
4395 calls,
4396 or else simply be careful of the order
4397 of these statements in your SConscript files
4398 so that you don't look for a specific
4399 default target before it's actually been added to the list.
4400
4401 .SS Construction Variables
4402 .\" XXX From Gary Ruben, 23 April 2002:
4403 .\" I think it would be good to have an example with each construction
4404 .\" variable description in the documentation.
4405 .\" eg.
4406 .\" CC     The C compiler
4407 .\"    Example: env["CC"] = "c68x"
4408 .\"    Default: env["CC"] = "cc"
4409 .\" 
4410 .\" CCCOM  The command line ...
4411 .\"    Example:
4412 .\"        To generate the compiler line c68x -ps -qq -mr -o $TARGET $SOURCES
4413 .\"        env["CC"] = "c68x"
4414 .\"        env["CFLAGS"] = "-ps -qq -mr"
4415 .\"        env["CCCOM"] = "$CC $CFLAGS -o $TARGET $SOURCES
4416 .\"    Default:
4417 .\"        (I dunno what this is ;-)
4418 A construction environment has an associated dictionary of
4419 .I construction variables
4420 that are used by built-in or user-supplied build rules.
4421 Construction variables must follow the same rules for
4422 Python identifiers:
4423 the initial character must be an underscore or letter,
4424 followed by any number of underscores, letters, or digits.
4425
4426 A number of useful construction variables are automatically defined by
4427 scons for each supported platform, and additional construction variables
4428 can be defined by the user. The following is a list of the automatically
4429 defined construction variables:
4430
4431 .IP AR
4432 The static library archiver.
4433
4434 .IP ARCOM
4435 The command line used to generate a static library from object files.
4436
4437 .IP ARCOMSTR
4438 The string displayed when an object file
4439 is generated from an assembly-language source file.
4440 If this is not set, then $ARCOM (the command line) is displayed.
4441
4442 .ES
4443 env = Environment(ARCOMSTR = "Archiving $TARGET")
4444 .EE
4445
4446 .IP ARFLAGS
4447 General options passed to the static library archiver.
4448
4449 .IP AS
4450 The assembler.
4451
4452 .IP ASCOM
4453 The command line used to generate an object file
4454 from an assembly-language source file.
4455
4456 .IP ASCOMSTR
4457 The string displayed when an object file
4458 is generated from an assembly-language source file.
4459 If this is not set, then $ASCOM (the command line) is displayed.
4460
4461 .ES
4462 env = Environment(ASCOMSTR = "Assembling $TARGET")
4463 .EE
4464
4465 .IP ASFLAGS
4466 General options passed to the assembler.
4467
4468 .IP ASPPCOM
4469 The command line used to assemble an assembly-language
4470 source file into an object file
4471 after first running the file through the C preprocessor.
4472 Any options specified in the $ASFLAGS and $CPPFLAGS construction variables
4473 are included on this command line.
4474
4475 .IP ASPPCOMSTR
4476 The string displayed when an object file
4477 is generated from an assembly-language source file
4478 after first running the file through the C preprocessor.
4479 If this is not set, then $ASPPCOM (the command line) is displayed.
4480
4481 .ES
4482 env = Environment(ASPPCOMSTR = "Assembling $TARGET")
4483 .EE
4484
4485 .IP ASPPFLAGS
4486 General options when an assembling an assembly-language
4487 source file into an object file
4488 after first running the file through the C preprocessor.
4489 The default is to use the value of $ASFLAGS.
4490
4491 .IP BIBTEX
4492 The bibliography generator for the TeX formatter and typesetter and the
4493 LaTeX structured formatter and typesetter.
4494
4495 .IP BIBTEXCOM
4496 The command line used to call the bibliography generator for the
4497 TeX formatter and typesetter and the LaTeX structured formatter and
4498 typesetter.
4499
4500 .IP BIBTEXFLAGS
4501 General options passed to the bibliography generator for the TeX formatter
4502 and typesetter and the LaTeX structured formatter and typesetter.
4503
4504 .IP BITKEEPER
4505 The BitKeeper executable.
4506
4507 .IP BITKEEPERCOM
4508 The command line for
4509 fetching source files using BitKEeper.
4510
4511 .IP BITKEEPERGET
4512 The command ($BITKEEPER) and subcommand
4513 for fetching source files using BitKeeper.
4514
4515 .IP BITKEEPERGETFLAGS
4516 Options that are passed to the BitKeeper
4517 .B get
4518 subcommand.
4519
4520 .IP BUILDERS
4521 A dictionary mapping the names of the builders
4522 available through this environment
4523 to underlying Builder objects.
4524 Builders named
4525 Alias, CFile, CXXFile, DVI, Library, Object, PDF, PostScript, and Program
4526 are available by default.
4527 If you initialize this variable when an
4528 Environment is created:
4529
4530 .ES
4531 env = Environment(BUILDERS = {'NewBuilder' : foo})
4532 .EE
4533 .IP
4534 the default Builders will no longer be available.
4535 To use a new Builder object in addition to the default Builders,
4536 add your new Builder object like this:
4537
4538 .ES
4539 env = Environment()
4540 env.Append(BUILDERS = {'NewBuilder' : foo})
4541 .EE
4542 .IP
4543 or this:
4544
4545 .ES
4546 env = Environment()
4547 env['BUILDERS]['NewBuilder'] = foo
4548 .EE
4549
4550 .IP CC 
4551 The C compiler.
4552
4553 .IP CCCOM 
4554 The command line used to compile a C source file to a (static) object file.
4555 Any options specified in the $CCFLAGS and $CPPFLAGS construction variables
4556 are included on this command line.
4557
4558 .IP CCCOMSTR
4559 The string displayed when a C source file
4560 is compiled to a (static) object file.
4561 If this is not set, then $CCCOM (the command line) is displayed.
4562
4563 .ES
4564 env = Environment(CCCOMSTR = "Compiling static object $TARGET")
4565 .EE
4566
4567 .IP CCFLAGS 
4568 General options that are passed to the C compiler.
4569
4570 .IP CFILESUFFIX
4571 The suffix for C source files.
4572 This is used by the internal CFile builder
4573 when generating C files from Lex (.l) or YACC (.y) input files.
4574 The default suffix, of course, is
4575 .I .c
4576 (lower case).
4577 On case-insensitive systems (like Win32),
4578 SCons also treats
4579 .I .C
4580 (upper case) files
4581 as C files.
4582
4583 .IP CCVERSION
4584 The version number of the C compiler.
4585 This may or may not be set,
4586 depending on the specific C compiler being used.
4587
4588 .IP _concat
4589 A function used to produce variables like $_CPPINCFLAGS. It takes
4590 four or five
4591 arguments: a prefix to concatenate onto each element, a list of
4592 elements, a suffix to concatenate onto each element, an environment
4593 for variable interpolation, and an optional function that will be
4594 called to transform the list before concatenation.
4595
4596 .ES
4597 env['_CPPINCFLAGS'] = '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)',
4598 .EE
4599
4600 .IP CPPDEFINES
4601 A platform independent specification of C preprocessor definitions.
4602 The definitions will be added to command lines
4603 through the automatically-generated
4604 $_CPPDEFFLAGS construction variable (see below),
4605 which is constructed according to
4606 the type of value of $CPPDEFINES:
4607
4608 .IP
4609 If $CPPDEFINES is a string,
4610 the values of the
4611 $CPPDEFPREFIX and $CPPDEFSUFFIX
4612 construction variables
4613 will be added to the beginning and end.
4614
4615 .ES
4616 # Will add -Dxyz to POSIX compiler command lines,
4617 # and /Dxyz to Microsoft Visual C++ command lines.
4618 env = Environment(CPPDEFINES='xyz')
4619 .EE
4620
4621 .IP
4622 If $CPPDEFINES is a list,
4623 the values of the
4624 $CPPDEFPREFIX and $CPPDEFSUFFIX
4625 construction variables
4626 will be appended to the beginning and end
4627 of each element in the list.
4628 If any element is a list or tuple,
4629 then the first item is the name being
4630 defined and the second item is its value:
4631
4632 .ES
4633 # Will add -DB=2 -DA to POSIX compiler command lines,
4634 # and /DB=2 /DA to Microsoft Visual C++ command lines.
4635 env = Environment(CPPDEFINES=[('B', 2), 'A'])
4636 .EE
4637
4638 .IP
4639 If $CPPDEFINES is a dictionary,
4640 the values of the
4641 $CPPDEFPREFIX and $CPPDEFSUFFIX
4642 construction variables
4643 will be appended to the beginning and end
4644 of each item from the dictionary.
4645 The key of each dictionary item
4646 is a name being defined
4647 to the dictionary item's corresponding value;
4648 if the value is
4649 .BR None ,
4650 then the name is defined without an explicit value.
4651 Note that the resulting flags are sorted by keyword
4652 to ensure that the order of the options on the
4653 command line is consistent each time
4654 .B scons
4655  is run.
4656
4657 .ES
4658 # Will add -DA -DB=2 to POSIX compiler command lines,
4659 # and /DA /DB=2 to Microsoft Visual C++ command lines.
4660 env = Environment(CPPDEFINES={'B':2, 'A':None})
4661 .EE
4662
4663 .IP _CPPDEFFLAGS
4664 An automatically-generated construction variable
4665 containing the C preprocessor command-line options
4666 to define values.
4667 The value of $_CPPDEFFLAGS is created
4668 by appending $CPPDEFPREFIX and $CPPDEFSUFFIX
4669 to the beginning and end
4670 of each directory in $CPPDEFINES.
4671
4672 .IP CPPDEFPREFIX
4673 The prefix used to specify preprocessor definitions
4674 on the C compiler command line.
4675 This will be appended to the beginning of each definition
4676 in the $CPPDEFINES construction variable
4677 when the $_CPPDEFFLAGS variable is automatically generated.
4678
4679 .IP CPPDEFSUFFIX
4680 The suffix used to specify preprocessor definitions
4681 on the C compiler command line.
4682 This will be appended to the end of each definition
4683 in the $CPPDEFINES construction variable
4684 when the $_CPPDEFFLAGS variable is automatically generated.
4685
4686 .IP CPPFLAGS
4687 User-specified C preprocessor options.
4688 These will be included in any command that uses the C preprocessor,
4689 including not just compilation of C and C++ source files
4690 via the $CCCOM, $SHCCCOM, $CXXCOM and $SHCXXCOM command lines,
4691 but also the $FORTRANPPCOM, $SHFORTRANPPCOM,
4692 $F77PPCOM and $SHF77PPCOM command lines
4693 used to compile a Fortran source file,
4694 and the $ASPPCOM command line
4695 used to assemble an assembly language source file,
4696 after first running each file through the C preprocessor.
4697 Note that this variable does
4698 .I not
4699 contain
4700 .B -I
4701 (or similar) include search path options
4702 that scons generates automatically from $CPPPATH.
4703 See
4704 .BR _CPPINCFLAGS ,
4705 below,
4706 for the variable that expands to those options.
4707
4708 .IP _CPPINCFLAGS
4709 An automatically-generated construction variable
4710 containing the C preprocessor command-line options
4711 for specifying directories to be searched for include files.
4712 The value of $_CPPINCFLAGS is created
4713 by appending $INCPREFIX and $INCSUFFIX
4714 to the beginning and end
4715 of each directory in $CPPPATH.
4716
4717 .IP CPPPATH
4718 The list of directories that the C preprocessor will search for include
4719 directories. The C/C++ implicit dependency scanner will search these
4720 directories for include files. Don't explicitly put include directory
4721 arguments in CCFLAGS or CXXFLAGS because the result will be non-portable
4722 and the directories will not be searched by the dependency scanner. Note:
4723 directory names in CPPPATH will be looked-up relative to the SConscript
4724 directory when they are used in a command. To force 
4725 .B scons
4726 to look-up a directory relative to the root of the source tree use #:
4727
4728 .ES
4729 env = Environment(CPPPATH='#/include')
4730 .EE
4731
4732 .IP
4733 The directory look-up can also be forced using the 
4734 .BR Dir ()
4735 function:
4736
4737 .ES
4738 include = Dir('include')
4739 env = Environment(CPPPATH=include)
4740 .EE
4741
4742 .IP
4743 The directory list will be added to command lines
4744 through the automatically-generated
4745 $_CPPINCFLAGS
4746 construction variable,
4747 which is constructed by
4748 appending the values of the
4749 $INCPREFIX and $INCSUFFIX
4750 construction variables
4751 to the beginning and end
4752 of each directory in $CPPPATH.
4753 Any command lines you define that need
4754 the CPPPATH directory list should
4755 include $_CPPINCFLAGS:
4756
4757 .ES
4758 env = Environment(CCCOM="my_compiler $_CPPINCFLAGS -c -o $TARGET $SOURCE")
4759 .EE
4760
4761 .IP CPPSUFFIXES
4762 The list of suffixes of files that will be scanned
4763 for C preprocessor implicit dependencies
4764 (#include lines).
4765 The default list is:
4766
4767 .ES
4768 [".c", ".C", ".cxx", ".cpp", ".c++", ".cc",
4769  ".h", ".H", ".hxx", ".hpp", ".hh",
4770  ".F", ".fpp", ".FPP",
4771  ".S", ".spp", ".SPP"]
4772 .EE
4773
4774 .IP CVS
4775 The CVS executable.
4776
4777 .IP CVSCOFLAGS
4778 Options that are passed to the CVS checkout subcommand.
4779
4780 .IP CVSCOM
4781 The command line used to
4782 fetch source files from a CVS repository.
4783
4784 .IP CVSFLAGS
4785 General options that are passed to CVS.
4786 By default, this is set to
4787 "-d $CVSREPOSITORY"
4788 to specify from where the files must be fetched.
4789
4790 .IP CVSREPOSITORY
4791 The path to the CVS repository.
4792 This is referenced in the default
4793 $CVSFLAGS value.
4794
4795 .IP CXX
4796 The C++ compiler.
4797
4798 .IP CXXFILESUFFIX
4799 The suffix for C++ source files.
4800 This is used by the internal CXXFile builder
4801 when generating C++ files from Lex (.ll) or YACC (.yy) input files.
4802 The default suffix is
4803 .IR .cc .
4804 SCons also treats files with the suffixes
4805 .IR .cpp ,
4806 .IR .cxx ,
4807 .IR .c++ ,
4808 and
4809 .I .C++
4810 as C++ files.
4811 On case-sensitive systems (Linux, UNIX, and other POSIX-alikes),
4812 SCons also treats
4813 .I .C
4814 (upper case) files
4815 as C++ files.
4816
4817 .IP CXXCOM
4818 The command line used to compile a C++ source file to an object file.
4819 Any options specified in the $CXXFLAGS and $CPPFLAGS construction variables
4820 are included on this command line.
4821
4822 .IP CXXCOMSTR
4823 The string displayed when a C++ source file
4824 is compiled to a (static) object file.
4825 If this is not set, then $CXXCOM (the command line) is displayed.
4826
4827 .ES
4828 env = Environment(CXXCOMSTR = "Compiling static object $TARGET")
4829 .EE
4830
4831 .IP CXXFLAGS 
4832 General options that are passed to the C++ compiler.
4833
4834 .IP CXXVERSION
4835 The version number of the C++ compiler.
4836 This may or may not be set,
4837 depending on the specific C++ compiler being used.
4838
4839 .IP Dir
4840 A function that converts a file name into a Dir instance relative to the
4841 target being built. 
4842
4843 .IP DSUFFIXES
4844 The list of suffixes of files that will be scanned
4845 for imported D package files.
4846 The default list is:
4847
4848 .ES
4849 ['.d']
4850 .EE
4851
4852 .IP DVIPDF
4853 The TeX DVI file to PDF file converter.
4854
4855 .IP DVIPDFFLAGS
4856 General options passed to the TeX DVI file to PDF file converter.
4857
4858 .IP DVIPDFCOM
4859 The command line used to convert TeX DVI files into a PDF file.
4860
4861 .IP DVIPS
4862 The TeX DVI file to PostScript converter.
4863
4864 .IP DVIPSFLAGS
4865 General options passed to the TeX DVI file to PostScript converter.
4866
4867 .IP ENV
4868 A dictionary of environment variables
4869 to use when invoking commands. When ENV is used in a command all list
4870 values will be joined using the path separator and any other non-string
4871 values will simply be coerced to a string.
4872 Note that, by default,
4873 .B scons
4874 does
4875 .I not
4876 propagate the environment in force when you
4877 execute
4878 .B scons
4879 to the commands used to build target files.
4880 This is so that builds will be guaranteed
4881 repeatable regardless of the environment
4882 variables set at the time
4883 .B scons
4884 is invoked.
4885
4886 If you want to propagate your
4887 environment variables
4888 to the commands executed
4889 to build target files,
4890 you must do so explicitly:
4891
4892 .ES
4893 import os
4894 env = Environment(ENV = os.environ)
4895 .EE
4896
4897 .RS
4898 Note that you can choose only to propagate
4899 certain environment variables.
4900 A common example is
4901 the system
4902 .B PATH
4903 environment variable,
4904 so that
4905 .B scons
4906 uses the same utilities
4907 as the invoking shell (or other process):
4908 .RE
4909
4910 .ES
4911 import os
4912 env = Environment(ENV = {'PATH' : os.environ['PATH']})
4913 .EE
4914
4915 .IP ESCAPE
4916 A function that will be called to escape shell special characters in
4917 command lines. The function should take one argument: the command line
4918 string to escape; and should return the escaped command line.
4919
4920 .IP F77
4921 The Fortran 77 compiler.
4922 You should normally set the $FORTRAN variable,
4923 which specifies the default Fortran compiler
4924 for all Fortran versions.
4925 You only need to set $F77 if you need to use a specific compiler
4926 or compiler version for Fortran 77 files.
4927
4928 .IP F77COM
4929 The command line used to compile a Fortran 77 source file to an object file.
4930 You only need to set $F77COM if you need to use a specific
4931 command line for Fortran 77 files.
4932 You should normally set the $FORTRANCOM variable,
4933 which specifies the default command line
4934 for all Fortran versions.
4935
4936 .IP F77COMSTR
4937 The string displayed when a Fortran 77 source file
4938 is compiled to an object file.
4939 If this is not set, then $F77COM or $FORTRANCOM (the command line) is displayed.
4940
4941 .IP F77FLAGS
4942 General user-specified options that are passed to the Fortran 77 compiler.
4943 Note that this variable does
4944 .I not
4945 contain
4946 .B -I
4947 (or similar) include search path options
4948 that scons generates automatically from $F77PATH.
4949 See
4950 .BR _F77INCFLAGS ,
4951 below,
4952 for the variable that expands to those options.
4953 You only need to set $F77FLAGS if you need to define specific
4954 user options for Fortran 77 files.
4955 You should normally set the $FORTRANFLAGS variable,
4956 which specifies the user-specified options
4957 passed to the default Fortran compiler
4958 for all Fortran versions.
4959
4960 .IP _F77INCFLAGS
4961 An automatically-generated construction variable
4962 containing the Fortran 77 compiler command-line options
4963 for specifying directories to be searched for include files.
4964 The value of $_F77INCFLAGS is created
4965 by appending $INCPREFIX and $INCSUFFIX
4966 to the beginning and end
4967 of each directory in $F77PATH.
4968
4969 .IP F77PATH
4970 The list of directories that the Fortran 77 compiler will search for include
4971 directories. The implicit dependency scanner will search these
4972 directories for include files. Don't explicitly put include directory
4973 arguments in $F77FLAGS because the result will be non-portable
4974 and the directories will not be searched by the dependency scanner. Note:
4975 directory names in $F77PATH will be looked-up relative to the SConscript
4976 directory when they are used in a command. To force
4977 .B scons
4978 to look-up a directory relative to the root of the source tree use #:
4979 You only need to set $F77PATH if you need to define a specific
4980 include path for Fortran 77 files.
4981 You should normally set the $FORTRANPATH variable,
4982 which specifies the include path
4983 for the default Fortran compiler
4984 for all Fortran versions.
4985
4986 .ES
4987 env = Environment(F77PATH='#/include')
4988 .EE
4989
4990 .IP
4991 The directory look-up can also be forced using the
4992 .BR Dir ()
4993 function:
4994
4995 .ES
4996 include = Dir('include')
4997 env = Environment(F77PATH=include)
4998 .EE
4999
5000 .IP
5001 The directory list will be added to command lines
5002 through the automatically-generated
5003 $_F77INCFLAGS
5004 construction variable,
5005 which is constructed by
5006 appending the values of the
5007 $INCPREFIX and $INCSUFFIX
5008 construction variables
5009 to the beginning and end
5010 of each directory in $F77PATH.
5011 Any command lines you define that need
5012 the F77PATH directory list should
5013 include $_F77INCFLAGS:
5014
5015 .ES
5016 env = Environment(F77COM="my_compiler $_F77INCFLAGS -c -o $TARGET $SOURCE")
5017 .EE
5018
5019 .IP F77PPCOM
5020 The command line used to compile a Fortran 77 source file to an object file
5021 after first running the file through the C preprocessor.
5022 Any options specified in the $F77FLAGS and $CPPFLAGS construction variables
5023 are included on this command line.
5024 You only need to set $F77PPCOM if you need to use a specific
5025 C-preprocessor command line for Fortran 77 files.
5026 You should normally set the $FORTRANPPCOM variable,
5027 which specifies the default C-preprocessor command line
5028 for all Fortran versions.
5029
5030 .IP F90
5031 The Fortran 90 compiler.
5032 You should normally set the $FORTRAN variable,
5033 which specifies the default Fortran compiler
5034 for all Fortran versions.
5035 You only need to set $F90 if you need to use a specific compiler
5036 or compiler version for Fortran 90 files.
5037
5038 .IP F90COM
5039 The command line used to compile a Fortran 90 source file to an object file.
5040 You only need to set $F90COM if you need to use a specific
5041 command line for Fortran 90 files.
5042 You should normally set the $FORTRANCOM variable,
5043 which specifies the default command line
5044 for all Fortran versions.
5045
5046 .IP F90COMSTR
5047 The string displayed when a Fortran 90 source file
5048 is compiled to an object file.
5049 If this is not set, then $F90COM or $FORTRANCOM
5050 (the command line) is displayed.
5051
5052 .IP F90FLAGS
5053 General user-specified options that are passed to the Fortran 90 compiler.
5054 Note that this variable does
5055 .I not
5056 contain
5057 .B -I
5058 (or similar) include search path options
5059 that scons generates automatically from $F90PATH.
5060 See
5061 .BR _F90INCFLAGS ,
5062 below,
5063 for the variable that expands to those options.
5064 You only need to set $F90FLAGS if you need to define specific
5065 user options for Fortran 90 files.
5066 You should normally set the $FORTRANFLAGS variable,
5067 which specifies the user-specified options
5068 passed to the default Fortran compiler
5069 for all Fortran versions.
5070
5071 .IP _F90INCFLAGS
5072 An automatically-generated construction variable
5073 containing the Fortran 90 compiler command-line options
5074 for specifying directories to be searched for include files.
5075 The value of $_F90INCFLAGS is created
5076 by appending $INCPREFIX and $INCSUFFIX
5077 to the beginning and end
5078 of each directory in $F90PATH.
5079
5080 .IP F90PATH
5081 The list of directories that the Fortran 90 compiler will search for include
5082 directories. The implicit dependency scanner will search these
5083 directories for include files. Don't explicitly put include directory
5084 arguments in $F90FLAGS because the result will be non-portable
5085 and the directories will not be searched by the dependency scanner. Note:
5086 directory names in $F90PATH will be looked-up relative to the SConscript
5087 directory when they are used in a command. To force
5088 .B scons
5089 to look-up a directory relative to the root of the source tree use #:
5090 You only need to set $F90PATH if you need to define a specific
5091 include path for Fortran 90 files.
5092 You should normally set the $FORTRANPATH variable,
5093 which specifies the include path
5094 for the default Fortran compiler
5095 for all Fortran versions.
5096
5097 .ES
5098 env = Environment(F90PATH='#/include')
5099 .EE
5100
5101 .IP
5102 The directory look-up can also be forced using the
5103 .BR Dir ()
5104 function:
5105
5106 .ES
5107 include = Dir('include')
5108 env = Environment(F90PATH=include)
5109 .EE
5110
5111 .IP
5112 The directory list will be added to command lines
5113 through the automatically-generated
5114 $_F90INCFLAGS
5115 construction variable,
5116 which is constructed by
5117 appending the values of the
5118 $INCPREFIX and $INCSUFFIX
5119 construction variables
5120 to the beginning and end
5121 of each directory in $F90PATH.
5122 Any command lines you define that need
5123 the F90PATH directory list should
5124 include $_F90INCFLAGS:
5125
5126 .ES
5127 env = Environment(F90COM="my_compiler $_F90INCFLAGS -c -o $TARGET $SOURCE")
5128 .EE
5129
5130 .IP F90PPCOM
5131 The command line used to compile a Fortran 90 source file to an object file
5132 after first running the file through the C preprocessor.
5133 Any options specified in the $F90FLAGS and $CPPFLAGS construction variables
5134 are included on this command line.
5135 You only need to set $F90PPCOM if you need to use a specific
5136 C-preprocessor command line for Fortran 90 files.
5137 You should normally set the $FORTRANPPCOM variable,
5138 which specifies the default C-preprocessor command line
5139 for all Fortran versions.
5140
5141 .IP F95
5142 The Fortran 95 compiler.
5143 You should normally set the $FORTRAN variable,
5144 which specifies the default Fortran compiler
5145 for all Fortran versions.
5146 You only need to set $F95 if you need to use a specific compiler
5147 or compiler version for Fortran 95 files.
5148
5149 .IP F95COM
5150 The command line used to compile a Fortran 95 source file to an object file.
5151 You only need to set $F95COM if you need to use a specific
5152 command line for Fortran 95 files.
5153 You should normally set the $FORTRANCOM variable,
5154 which specifies the default command line
5155 for all Fortran versions.
5156
5157 .IP F95COMSTR
5158 The string displayed when a Fortran 95 source file
5159 is compiled to an object file.
5160 If this is not set, then $F95COM or $FORTRANCOM
5161 (the command line) is displayed.
5162
5163 .IP F95FLAGS
5164 General user-specified options that are passed to the Fortran 95 compiler.
5165 Note that this variable does
5166 .I not
5167 contain
5168 .B -I
5169 (or similar) include search path options
5170 that scons generates automatically from $F95PATH.
5171 See
5172 .BR _F95INCFLAGS ,
5173 below,
5174 for the variable that expands to those options.
5175 You only need to set $F95FLAGS if you need to define specific
5176 user options for Fortran 95 files.
5177 You should normally set the $FORTRANFLAGS variable,
5178 which specifies the user-specified options
5179 passed to the default Fortran compiler
5180 for all Fortran versions.
5181
5182 .IP _F95INCFLAGS
5183 An automatically-generated construction variable
5184 containing the Fortran 95 compiler command-line options
5185 for specifying directories to be searched for include files.
5186 The value of $_F95INCFLAGS is created
5187 by appending $INCPREFIX and $INCSUFFIX
5188 to the beginning and end
5189 of each directory in $F95PATH.
5190
5191 .IP F95PATH
5192 The list of directories that the Fortran 95 compiler will search for include
5193 directories. The implicit dependency scanner will search these
5194 directories for include files. Don't explicitly put include directory
5195 arguments in $F95FLAGS because the result will be non-portable
5196 and the directories will not be searched by the dependency scanner. Note:
5197 directory names in $F95PATH will be looked-up relative to the SConscript
5198 directory when they are used in a command. To force
5199 .B scons
5200 to look-up a directory relative to the root of the source tree use #:
5201 You only need to set $F95PATH if you need to define a specific
5202 include path for Fortran 95 files.
5203 You should normally set the $FORTRANPATH variable,
5204 which specifies the include path
5205 for the default Fortran compiler
5206 for all Fortran versions.
5207
5208 .ES
5209 env = Environment(F95PATH='#/include')
5210 .EE
5211
5212 .IP
5213 The directory look-up can also be forced using the
5214 .BR Dir ()
5215 function:
5216
5217 .ES
5218 include = Dir('include')
5219 env = Environment(F95PATH=include)
5220 .EE
5221
5222 .IP
5223 The directory list will be added to command lines
5224 through the automatically-generated
5225 $_F95INCFLAGS
5226 construction variable,
5227 which is constructed by
5228 appending the values of the
5229 $INCPREFIX and $INCSUFFIX
5230 construction variables
5231 to the beginning and end
5232 of each directory in $F95PATH.
5233 Any command lines you define that need
5234 the F95PATH directory list should
5235 include $_F95INCFLAGS:
5236
5237 .ES
5238 env = Environment(F95COM="my_compiler $_F95INCFLAGS -c -o $TARGET $SOURCE")
5239 .EE
5240
5241 .IP F95PPCOM
5242 The command line used to compile a Fortran 95 source file to an object file
5243 after first running the file through the C preprocessor.
5244 Any options specified in the $F95FLAGS and $CPPFLAGS construction variables
5245 are included on this command line.
5246 You only need to set $F95PPCOM if you need to use a specific
5247 C-preprocessor command line for Fortran 95 files.
5248 You should normally set the $FORTRANPPCOM variable,
5249 which specifies the default C-preprocessor command line
5250 for all Fortran versions.
5251
5252 .IP FORTRAN
5253 The default Fortran compiler
5254 for all versions of Fortran.
5255
5256 .IP FORTRANCOM 
5257 The command line used to compile a Fortran source file to an object file.
5258 By default, any options specified
5259 in the $FORTRANFLAGS, $CPPFLAGS, $_CPPDEFFLAGS, 
5260 $_FORTRANMODFLAG, and $_FORTRANINCFLAGS construction variables
5261 are included on this command line.
5262
5263 .IP FORTRANCOMSTR
5264 The string displayed when a Fortran source file
5265 is compiled to an object file.
5266 If this is not set, then $FORTRANCOM
5267 (the command line) is displayed.
5268
5269 .IP FORTRANFLAGS
5270 General user-specified options that are passed to the Fortran compiler.
5271 Note that this variable does
5272 .I not
5273 contain
5274 .B -I
5275 (or similar) include or module search path options
5276 that scons generates automatically from $FORTRANPATH.
5277 See
5278 .BR _FORTRANINCFLAGS and _FORTRANMODFLAGS,
5279 below,
5280 for the variables that expand those options.
5281
5282 .IP _FORTRANINCFLAGS
5283 An automatically-generated construction variable
5284 containing the Fortran compiler command-line options
5285 for specifying directories to be searched for include 
5286 files and module files.
5287 The value of $_FORTRANINCFLAGS is created
5288 by prepending/appending $INCPREFIX and $INCSUFFIX
5289 to the beginning and end
5290 of each directory in $FORTRANPATH.
5291
5292 .IP FORTRANMODDIR
5293 Directory location where the Fortran compiler should place
5294 any module files it generates.  This variable is empty, by default. Some 
5295 Fortran compilers will internally append this directory in the search path 
5296 for module files, as well
5297
5298 .IP FORTRANMODDIRPREFIX
5299 The prefix used to specify a module directory on the Fortran compiler command
5300 line.
5301 This will be appended to the beginning of the directory
5302 in the $FORTRANMODDIR construction variables
5303 when the $_FORTRANMODFLAG variables is automatically generated.
5304
5305 .IP FORTRANMODDIRSUFFIX
5306 The suffix used to specify a module directory on the Fortran compiler command
5307 line.
5308 This will be appended to the beginning of the directory
5309 in the $FORTRANMODDIR construction variables
5310 when the $_FORTRANMODFLAG variables is automatically generated.
5311
5312 .IP FORTRANMODFLAG
5313 An automatically-generated construction variable
5314 containing the Fortran compiler command-line option
5315 for specifying the directory location where the Fortran
5316 compiler should place any module files that happen to get 
5317 generated during compilation.
5318 The value of $_FORTRANMODFLAG is created
5319 by prepending/appending $FORTRANMODDIRPREFIX and $FORTRANMODDIRSUFFIX
5320 to the beginning and end of the directory in $FORTRANMODDIR.
5321
5322 .IP FORTRANMODPREFIX
5323 The module file prefix used by the Fortran compiler.  SCons assumes that
5324 the Fortran compiler follows the quasi-standard naming convention for
5325 module files of
5326 .I <module_name>.mod.
5327 As a result, this variable is left empty, by default.  For situations in
5328 which the compiler does not necessarily follow the normal convention,
5329 the user may use this variable.  Its value will be appended to every
5330 module file name as scons attempts to resolve dependencies.
5331
5332 .IP FORTRANMODSUFFIX
5333 The module file suffix used by the Fortran compiler.  SCons assumes that
5334 the Fortran compiler follows the quasi-standard naming convention for
5335 module files of
5336 .I <module_name>.mod.
5337 As a result, this variable is set to ".mod", by default.  For situations
5338 in which the compiler does not necessarily follow the normal convention,
5339 the user may use this variable.  Its value will be appended to every
5340 module file name as scons attempts to resolve dependencies.
5341
5342 .IP FORTRANPATH
5343 The list of directories that the Fortran compiler will search for
5344 include files and (for some compilers) module files. The Fortran implicit
5345 dependency scanner will search these directories for include files (but
5346 not module files since they are autogenerated and, as such, may not
5347 actually exist at the time the scan takes place). Don't explicitly put
5348 include directory arguments in FORTRANFLAGS because the result will be
5349 non-portable and the directories will not be searched by the dependency
5350 scanner. Note: directory names in FORTRANPATH will be looked-up relative
5351 to the SConscript directory when they are used in a command. To force
5352 .B scons
5353 to look-up a directory relative to the root of the source tree use #:
5354
5355 .ES
5356 env = Environment(FORTRANPATH='#/include')
5357 .EE
5358
5359 .IP
5360 The directory look-up can also be forced using the 
5361 .BR Dir ()
5362 function:
5363
5364 .ES
5365 include = Dir('include')
5366 env = Environment(FORTRANPATH=include)
5367 .EE
5368
5369 .IP
5370 The directory list will be added to command lines
5371 through the automatically-generated
5372 $_FORTRANINCFLAGS
5373 construction variable,
5374 which is constructed by
5375 appending the values of the
5376 $INCPREFIX and $INCSUFFIX
5377 construction variables
5378 to the beginning and end
5379 of each directory in $FORTRANPATH.
5380 Any command lines you define that need
5381 the FORTRANPATH directory list should
5382 include $_FORTRANINCFLAGS:
5383
5384 .ES
5385 env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS -c -o $TARGET $SOURCE")
5386 .EE
5387
5388 .IP FORTRANPPCOM 
5389 The command line used to compile a Fortran source file to an object file
5390 after first running the file through the C preprocessor. 
5391 By default, any options specified in the $FORTRANFLAGS, $CPPFLAGS,
5392 _CPPDEFFLAGS, $_FORTRANMODFLAG, and $_FORTRANINCFLAGS
5393 construction variables are included on this command line.
5394
5395 .IP FORTRANSUFFIXES
5396 The list of suffixes of files that will be scanned
5397 for Fortran implicit dependencies
5398 (INCLUDE lines & USE statements).
5399 The default list is:
5400
5401 .ES
5402 [".f", ".F", ".for", ".FOR", ".ftn", ".FTN", ".fpp", ".FPP",
5403 ".f77", ".F77", ".f90", ".F90", ".f95", ".F95"]
5404 .EE
5405
5406 .IP File
5407 A function that converts a file name into a File instance relative to the
5408 target being built. 
5409
5410 .IP GS
5411 The Ghostscript program used to convert PostScript to PDF files.
5412
5413 .IP GSFLAGS
5414 General options passed to the Ghostscript program
5415 when converting PostScript to PDF files.
5416
5417 .IP GSCOM
5418 The Ghostscript command line used to convert PostScript to PDF files.
5419
5420 .IP IDLSUFFIXES
5421 The list of suffixes of files that will be scanned
5422 for IDL implicit dependencies
5423 (#include or import lines).
5424 The default list is:
5425
5426 .ES
5427 [".idl", ".IDL"]
5428 .EE
5429
5430 .IP INCPREFIX
5431 The prefix used to specify an include directory on the C compiler command
5432 line.
5433 This will be appended to the beginning of each directory
5434 in the $CPPPATH and $FORTRANPATH construction variables
5435 when the $_CPPINCFLAGS and $_FORTRANINCFLAGS
5436 variables are automatically generated.
5437
5438 .IP INCSUFFIX
5439 The suffix used to specify an include directory on the C compiler command
5440 line.
5441 This will be appended to the end of each directory
5442 in the $CPPPATH and $FORTRANPATH construction variables
5443 when the $_CPPINCFLAGS and $_FORTRANINCFLAGS
5444 variables are automatically generated.
5445
5446 .IP INSTALL
5447 A function to be called to install a file into a
5448 destination file name.
5449 The default function copies the file into the destination
5450 (and sets the destination file's mode and permission bits
5451 to match the source file's).
5452 The function takes the following arguments:
5453
5454 .ES
5455 def install(dest, source, env):
5456 .EE
5457 .IP
5458 .I dest
5459 is the path name of the destination file.
5460 .I source
5461 is the path name of the source file.
5462 .I env
5463 is the construction environment
5464 (a dictionary of construction values)
5465 in force for this file installation.
5466
5467 .IP JAR
5468 The Java archive tool.
5469
5470 .IP JARCHDIR
5471 The directory to which the Java archive tool should change
5472 (using the
5473 .B \-C
5474 option).
5475
5476 .IP JARCOM
5477 The command line used to call the Java archive tool.
5478
5479 .IP JARFLAGS
5480 General options passed to the Java archive tool.
5481 By default this is set to
5482 .B cf
5483 to create the necessary
5484 .I jar
5485 file.
5486
5487 .IP JARSUFFIX
5488 The suffix for Java archives:
5489 .B .jar
5490 by default.
5491
5492 .IP JAVAC
5493 The Java compiler.
5494
5495 .IP JAVACCOM
5496 The command line used to compile a directory tree containing
5497 Java source files to
5498 corresponding Java class files.
5499 Any options specified in the $JAVACFLAGS construction variable
5500 are included on this command line.
5501
5502 .IP JAVACFLAGS
5503 General options that are passed to the Java compiler.
5504
5505 .IP JAVACLASSDIR
5506 The directory in which Java class files may be found.
5507 This is stripped from the beginning of any Java .class
5508 file names supplied to the
5509 .B JavaH
5510 builder.
5511
5512 .IP JAVACLASSSUFFIX
5513 The suffix for Java class files;
5514 .B .class
5515 by default.
5516
5517 .IP JAVAH
5518 The Java generator for C header and stub files.
5519
5520 .IP JAVAHCOM
5521 The command line used to generate C header and stub files
5522 from Java classes.
5523 Any options specified in the $JAVAHFLAGS construction variable
5524 are included on this command line.
5525
5526 .IP JAVAHFLAGS
5527 General options passed to the C header and stub file generator
5528 for Java classes.
5529
5530 .IP JAVASUFFIX
5531 The suffix for Java files;
5532 .B .java
5533 by default.
5534
5535 .IP LATEX
5536 The LaTeX structured formatter and typesetter.
5537
5538 .IP LATEXCOM
5539 The command line used to call the LaTeX structured formatter and typesetter.
5540
5541 .IP LATEXFLAGS
5542 General options passed to the LaTeX structured formatter and typesetter.
5543
5544 .IP LEX
5545 The lexical analyzer generator.
5546
5547 .IP LEXFLAGS
5548 General options passed to the lexical analyzer generator.
5549
5550 .IP LEXCOM
5551 The command line used to call the lexical analyzer generator
5552 to generate a source file.
5553
5554 .IP LEXCOMSTR
5555 The string displayed when generating a source file
5556 using the lexical analyzer generator.
5557 If this is not set, then $LEXCOM (the command line) is displayed.
5558
5559 .ES
5560 env = Environment(LEXCOMSTR = "Lex'ing $TARGET from $SOURCES")
5561 .EE
5562
5563 .IP _LIBDIRFLAGS
5564 An automatically-generated construction variable
5565 containing the linker command-line options
5566 for specifying directories to be searched for library.
5567 The value of $_LIBDIRFLAGS is created
5568 by appending $LIBDIRPREFIX and $LIBDIRSUFFIX
5569 to the beginning and end
5570 of each directory in $LIBPATH.
5571
5572 .IP LIBDIRPREFIX
5573 The prefix used to specify a library directory on the linker command line.
5574 This will be appended to the beginning of each directory
5575 in the $LIBPATH construction variable
5576 when the $_LIBDIRFLAGS variable is automatically generated.
5577
5578 .IP LIBDIRSUFFIX
5579 The suffix used to specify a library directory on the linker command line.
5580 This will be appended to the end of each directory
5581 in the $LIBPATH construction variable
5582 when the $_LIBDIRFLAGS variable is automatically generated.
5583
5584 .IP _LIBFLAGS
5585 An automatically-generated construction variable
5586 containing the linker command-line options
5587 for specifying libraries to be linked with the resulting target.
5588 The value of $_LIBFLAGS is created
5589 by appending $LIBLINKPREFIX and $LIBLINKSUFFIX
5590 to the beginning and end
5591 of each directory in $LIBS.
5592
5593 .IP LIBLINKPREFIX
5594 The prefix used to specify a library to link on the linker command line.
5595 This will be appended to the beginning of each library
5596 in the $LIBS construction variable
5597 when the $_LIBFLAGS variable is automatically generated.
5598
5599 .IP LIBLINKSUFFIX
5600 The suffix used to specify a library to link on the linker command line.
5601 This will be appended to the end of each library
5602 in the $LIBS construction variable
5603 when the $_LIBFLAGS variable is automatically generated.
5604
5605 .IP LIBPATH
5606 The list of directories that will be searched for libraries.
5607 The implicit dependency scanner will search these
5608 directories for include files. Don't explicitly put include directory
5609 arguments in $LINKFLAGS or $SHLINKFLAGS
5610 because the result will be non-portable
5611 and the directories will not be searched by the dependency scanner. Note:
5612 directory names in LIBPATH will be looked-up relative to the SConscript
5613 directory when they are used in a command. To force 
5614 .B scons
5615 to look-up a directory relative to the root of the source tree use #:
5616
5617 .ES
5618 env = Environment(LIBPATH='#/libs')
5619 .EE
5620
5621 .IP
5622 The directory look-up can also be forced using the 
5623 .BR Dir ()
5624 function:
5625
5626 .ES
5627 libs = Dir('libs')
5628 env = Environment(LIBPATH=libs)
5629 .EE
5630
5631 .IP
5632 The directory list will be added to command lines
5633 through the automatically-generated
5634 $_LIBDIRFLAGS
5635 construction variable,
5636 which is constructed by
5637 appending the values of the
5638 $LIBDIRPREFIX and $LIBDIRSUFFIX
5639 construction variables
5640 to the beginning and end
5641 of each directory in $LIBPATH.
5642 Any command lines you define that need
5643 the LIBPATH directory list should
5644 include $_LIBDIRFLAGS:
5645
5646 .ES
5647 env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE")
5648 .EE
5649
5650 .IP LIBPREFIX
5651 The prefix used for (static) library file names.
5652 A default value is set for each platform
5653 (posix, win32, os2, etc.),
5654 but the value is overridden by individual tools
5655 (ar, mslib, sgiar, sunar, tlib, etc.)
5656 to reflect the names of the libraries they create.
5657
5658 .IP LIBPREFIXES
5659 An array of legal prefixes for library file names.
5660
5661 .IP LIBS
5662 A list of one or more libraries
5663 that will be linked with
5664 any executable programs
5665 created by this environment.
5666
5667 .IP
5668 The library list will be added to command lines
5669 through the automatically-generated
5670 $_LIBFLAGS
5671 construction variable,
5672 which is constructed by
5673 appending the values of the
5674 $LIBLINKPREFIX and $LIBLINKSUFFIX
5675 construction variables
5676 to the beginning and end
5677 of each directory in $LIBS.
5678 Any command lines you define that need
5679 the LIBS library list should
5680 include $_LIBFLAGS:
5681
5682 .ES
5683 env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS -o $TARGET $SOURCE")
5684 .EE
5685
5686 .IP LIBSUFFIX 
5687 The suffix used for (static) library file names.
5688 A default value is set for each platform
5689 (posix, win32, os2, etc.),
5690 but the value is overridden by individual tools
5691 (ar, mslib, sgiar, sunar, tlib, etc.)
5692 to reflect the names of the libraries they create.
5693
5694 .IP LIBSUFFIXES
5695 An array of legal suffixes for library file names.
5696
5697 .IP LINK
5698 The linker.
5699
5700 .IP LINKFLAGS
5701 General user options passed to the linker.
5702 Note that this variable should
5703 .I not
5704 contain
5705 .B -l
5706 (or similar) options for linking with the libraries listed in $LIBS,
5707 nor
5708 .B -L
5709 (or similar) library search path options
5710 that scons generates automatically from $LIBPATH.
5711 See
5712 .BR _LIBFLAGS ,
5713 above,
5714 for the variable that expands to library-link options,
5715 and
5716 .BR _LIBDIRFLAGS ,
5717 above,
5718 for the variable that expands to library search path options.
5719
5720 .IP LINKCOM
5721 The command line used to link object files into an executable.
5722
5723 .IP LINKCOMSTR
5724 The string displayed when object files
5725 are linked into an executable.
5726 If this is not set, then $LINKCOM (the command line) is displayed.
5727
5728 .ES
5729 env = Environment(LINKCOMSTR = "Linking $TARGET")
5730 .EE
5731
5732 .IP M4
5733 The M4 macro preprocessor.
5734
5735 .IP M4FLAGS
5736 General options passed to the M4 macro preprocessor.
5737
5738 .IP M4COM
5739 The command line used to pass files through the macro preprocessor.
5740
5741 .IP MAXLINELENGTH
5742 The maximum number of characters allowed on an external command line.
5743 On Win32 systems,
5744 link lines longer than this many characters
5745 are linke via a temporary file name.
5746
5747 .IP MSVS
5748 When the Microsoft Visual Studio tools are initialized, they set up
5749 this dictionary with the following keys:
5750
5751 .B VERSION:
5752 the version of MSVS being used (can be set via
5753 MSVS_VERSION)
5754
5755 .B VERSIONS:
5756 the available versions of MSVS installed
5757
5758 .B VCINSTALLDIR:
5759 installed directory of Visual C++
5760
5761 .B VSINSTALLDIR:
5762 installed directory of Visual Studio
5763
5764 .B FRAMEWORKDIR:
5765 installed directory of the .NET framework
5766
5767 .B FRAMEWORKVERSIONS:
5768 list of installed versions of the .NET framework, sorted latest to oldest.
5769
5770 .B FRAMEWORKVERSION:
5771 latest installed version of the .NET framework
5772
5773 .B FRAMEWORKSDKDIR:
5774 installed location of the .NET SDK.
5775
5776 .B PLATFORMSDKDIR:
5777 installed location of the Platform SDK.
5778
5779 .B PLATFORMSDK_MODULES:
5780 dictionary of installed Platform SDK modules,
5781 where the dictionary keys are keywords for the various modules, and
5782 the values are 2-tuples where the first is the release date, and the
5783 second is the version number.
5784
5785 If a value isn't set, it wasn't available in the registry.
5786
5787 .IP MSVS_IGNORE_IDE_PATHS
5788 Tells the MS Visual Studio tools to use minimal INCLUDE, LIB, and PATH settings,
5789 instead of the settings from the IDE.
5790
5791 For Visual Studio, SCons will (by default) automatically determine
5792 where MSVS is installed, and use the LIB, INCLUDE, and PATH variables
5793 set by the IDE.  You can override this behavior by setting these
5794 variables after Environment initialization, or by setting
5795 .B MSVS_IGNORE_IDE_PATHS = 1
5796 in the Environment initialization.
5797 Specifying this will not leave these unset, but will set them to a
5798 minimal set of paths needed to run the tools successfully.
5799
5800 .ES
5801 For VS6, the mininimal set is:
5802    INCLUDE:'<VSDir>\\VC98\\ATL\\include;<VSDir>\\VC98\\MFC\\include;<VSDir>\\VC98\\include'
5803    LIB:'<VSDir>\\VC98\\MFC\\lib;<VSDir>\\VC98\\lib'
5804    PATH:'<VSDir>\\Common\\MSDev98\\bin;<VSDir>\\VC98\\bin'
5805 For VS7, it is:
5806    INCLUDE:'<VSDir>\\Vc7\\atlmfc\\include;<VSDir>\\Vc7\\include'
5807    LIB:'<VSDir>\\Vc7\\atlmfc\\lib;<VSDir>\\Vc7\\lib'
5808    PATH:'<VSDir>\\Common7\\Tools\\bin;<VSDir>\\Common7\\Tools;<VSDir>\\Vc7\\bin'
5809 .EE
5810
5811 .IP
5812 Where '<VSDir>' is the installed location of Visual Studio.
5813
5814 .IP MSVS_USE_MFC_DIRS
5815 Tells the MS Visual Studio tool(s) to use
5816 the MFC directories in its default paths
5817 for compiling and linking.
5818 Under MSVS version 6,
5819 setting
5820 .B MSVS_USE_MFC_DIRS
5821 to a non-zero value
5822 adds the
5823 .B "ATL\\\\include"
5824 and
5825 .B "MFC\\\\include"
5826 directories to
5827 the default
5828 .B INCLUDE
5829 external environment variable,
5830 and adds the
5831 .B "MFC\\\\lib"
5832 directory to
5833 the default
5834 .B LIB
5835 external environment variable.
5836 Under MSVS version 7,
5837 setting
5838 .B MSVS_USE_MFC_DIRS
5839 to a non-zero value
5840 adds the
5841 .B "atlmfc\\\\include"
5842 directory to the default
5843 .B INCLUDE
5844 external environment variable,
5845 and adds the
5846 .B "atlmfc\\\\lib"
5847 directory to the default
5848 .B LIB
5849 external environment variable.
5850 The current default value is
5851 .BR 1 ,
5852 which means these directories
5853 are added to the paths by default.
5854 This default value is likely to change
5855 in a future release,
5856 so users who want the ATL and MFC
5857 values included in their paths
5858 are encouraged to enable the
5859 .B MSVS_USE_MFC_DIRS
5860 value explicitly
5861 to avoid future incompatibility.
5862 This variable has no effect if the
5863 .BR INCLUDE
5864 or
5865 .BR LIB
5866 environment variables are set explictly.
5867
5868 .IP MSVS_VERSION
5869 Sets the preferred version of MSVS to use.
5870
5871 SCons will (by default) select the latest version of MSVS
5872 installed on your machine.  So, if you have version 6 and version 7
5873 (MSVS .NET) installed, it will prefer version 7.  You can override this by
5874 specifying the 
5875 .B MSVS_VERSION
5876 variable in the Environment initialization, setting it to the
5877 appropriate version ('6.0' or '7.0', for example).
5878 If the given version isn't installed, tool initialization will fail.
5879
5880 .IP MSVSPROJECTCOM
5881 The action used to generate Microsoft Visual Studio
5882 project and solution files.
5883
5884 .IP MSVSPROJECTSUFFIX
5885 The suffix used for Microsoft Visual Studio project (DSP) files.
5886 The default value is
5887 .B .vcproj
5888 when using Visual Studio version 7.x (.NET),
5889 and
5890 .B .dsp
5891 when using earlier versions of Visual Studio.
5892
5893 .IP MSVSSOLUTIONSUFFIX
5894 The suffix used for Microsoft Visual Studio solution (DSW) files.
5895 The default value is
5896 .B .sln
5897 when using Visual Studio version 7.x (.NET),
5898 and
5899 .B .dsw
5900 when using earlier versions of Visual Studio.
5901
5902 .IP MWCW_VERSION
5903 The version number of the MetroWerks CodeWarrior C compiler
5904 to be used.
5905
5906 .IP MWCW_VERSIONS
5907 A list of installed versions of the MetroWerks CodeWarrior C compiler
5908 on this system.
5909
5910 .IP no_import_lib
5911 When set to non-zero,
5912 suppresses creation of a corresponding Win32 static import lib by the
5913 .B SharedLibrary
5914 builder when used with
5915 MinGW or Microsoft Visual Studio.
5916 This also suppresses creation
5917 of an export (.exp) file
5918 when using Microsoft Visual Studio.
5919
5920 .IP OBJPREFIX 
5921 The prefix used for (static) object file names.
5922
5923 .IP OBJSUFFIX 
5924 The suffix used for (static) object file names.
5925
5926 .IP P4
5927 The Perforce executable.
5928
5929 .IP P4COM
5930 The command line used to
5931 fetch source files from Perforce.
5932
5933 .IP P4FLAGS
5934 General options that are passed to Perforce.
5935
5936 .IP PCH
5937 The Microsoft Visual C++ precompiled header that will be used when compiling
5938 object files. This variable is ignored by tools other than Microsoft Visual C++.
5939 When this variable is
5940 defined SCons will add options to the compiler command line to
5941 cause it to use the precompiled header, and will also set up the
5942 dependencies for the PCH file. Example: 
5943
5944 .ES
5945 env['PCH'] = 'StdAfx.pch'
5946 .EE
5947
5948 .IP PCHSTOP
5949 This variable specifies how much of a source file is precompiled. This
5950 variable is ignored by tools other than Microsoft Visual C++, or when
5951 the PCH variable is not being used. When this variable is define it
5952 must be a string that is the name of the header that
5953 is included at the end of the precompiled portion of the source files, or
5954 the empty string if the "#pragma hrdstop" construct is being used:
5955
5956 .ES
5957 env['PCHSTOP'] = 'StdAfx.h'
5958 .EE
5959
5960 .IP PDB
5961 The Microsoft Visual C++ PDB file that will store debugging information for
5962 object files, shared libraries, and programs. This variable is ignored by
5963 tools other than Microsoft Visual C++.
5964 When this variable is
5965 defined SCons will add options to the compiler and linker command line to
5966 cause them to generate external debugging information, and will also set up the
5967 dependencies for the PDB file. Example:
5968
5969 .ES
5970 env['PDB'] = 'hello.pdb'
5971 .EE
5972
5973 .IP PDFCOM
5974 A deprecated synonym for $DVIPDFCOM.
5975
5976 .IP PDFPREFIX
5977 The prefix used for PDF file names.
5978
5979 .IP PDFSUFFIX
5980 The suffix used for PDF file names.
5981
5982 .IP PLATFORM
5983 The name of the platform used to create the Environment.  If no platform is
5984 specified when the Environment is created,
5985 .B SCons
5986 autodetects the platform.
5987
5988 .ES
5989 env = Environment(tools = [])
5990 if env['PLATFORM'] == 'cygwin':
5991     Tool('mingw')(env)
5992 else:
5993     Tool('msvc')(env)
5994 .EE
5995
5996 .IP PRINT_CMD_LINE_FUNC
5997 A Python function used to print the command lines as they are executed
5998 (assuming command printing is not disabled by the
5999 .B -q
6000 or
6001 .B -s
6002 options or their equivalents).
6003 The function should take four arguments:
6004 .IR s ,
6005 the command being executed (a string),
6006 .IR target ,
6007 the target being built (file node, list, or string name(s)),
6008 .IR source ,
6009 the source(s) used (file node, list, or string name(s)), and
6010 .IR env ,
6011 the environment being used.
6012
6013 The function must do the printing itself.  The default implementation,
6014 used if this variable is not set or is None, is:
6015 .ES
6016 def print_cmd_line(s, target, source, env):
6017   sys.stdout.write(s + "\n")
6018 .EE
6019
6020 Here's an example of a more interesting function:
6021 .ES
6022 def print_cmd_line(s, target, source, env):
6023    sys.stdout.write("Building %s -> %s...\n" %
6024     (' and '.join([str(x) for x in source]),
6025      ' and '.join([str(x) for x in target])))
6026 env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line)
6027 env.Program('foo', 'foo.c')
6028 .EE
6029
6030 This just prints "Building <targetname> from <sourcename>..." instead
6031 of the actual commands.
6032 Such a function could also log the actual commands to a log file,
6033 for example.
6034
6035 .IP PROGPREFIX
6036 The prefix used for executable file names.
6037
6038 .IP PROGSUFFIX
6039 The suffix used for executable file names.
6040
6041 .IP PSCOM
6042 The command line used to convert TeX DVI files into a PostScript file.
6043
6044 .IP PSPREFIX
6045 The prefix used for PostScript file names.
6046
6047 .IP PSSUFFIX
6048 The prefix used for PostScript file names.
6049
6050 .IP QTDIR
6051 The qt tool tries to take this from os.environ.
6052 It also initializes all QT_*
6053 construction variables listed below.
6054 (Note that all paths are constructed
6055 with python's os.path.join() method,
6056 but are listed here with the '/' separator
6057 for easier reading.)
6058 In addition, the construction environment
6059 variables CPPPATH, LIBPATH and LIBS may be modified
6060 and the variables
6061 PROGEMITTER, SHLIBEMITTER and LIBEMITTER
6062 are modified. Because the build-performance is affected when using this tool,
6063 you have to explicitly specify it at Environment creation:
6064
6065 .ES
6066 Environment(tools=['default','qt'])
6067 .EE
6068 .IP
6069 The qt tool supports the following operations:
6070
6071 .B Automatic moc file generation from header files.
6072 You do not have to specify moc files explicitly, the tool does it for you.
6073 However, there are a few preconditions to do so: Your header file must have
6074 the same filebase as your implementation file and must stay in the same
6075 directory. It must have one of the suffixes .h, .hpp, .H, .hxx, .hh. You 
6076 can turn off automatic moc file generation by setting QT_AUTOSCAN to 0.
6077 See also the corresponding builder method
6078 .B Moc()
6079
6080 .B Automatic moc file generation from cxx files.
6081 As stated in the qt documentation, include the moc file at the end of 
6082 the cxx file. Note that you have to include the file, which is generated
6083 by the transformation ${QT_MOCCXXPREFIX}<basename>${QT_MOCCXXSUFFIX}, by default
6084 <basename>.moc. A warning is generated after building the moc file, if you 
6085 do not include the correct file. If you are using BuildDir, you may 
6086 need to specify duplicate=1. You can turn off automatic moc file generation 
6087 by setting QT_AUTOSCAN to 0. See also the corresponding builder method
6088 .B Moc()
6089
6090 .B Automatic handling of .ui files.
6091 The implementation files generated from .ui files are handled much the same
6092 as yacc or lex files. Each .ui file given as a source of Program, Library or
6093 SharedLibrary will generate three files, the declaration file, the 
6094 implementation file and a moc file. Because there are also generated headers, 
6095 you may need to specify duplicate=1 in calls to BuildDir. See also the corresponding builder method
6096 .B Uic()
6097
6098 .IP QT_AUTOSCAN
6099 Turn off scanning for mocable files. Use the Moc Builder to explicitely 
6100 specify files to run moc on.
6101
6102 .IP QT_BINPATH
6103 The path where the qt binaries are installed.
6104 The default value is '$QTDIR/bin'.
6105
6106 .IP QT_CPPPATH
6107 The path where the qt header files are installed.
6108 The default value is '$QTDIR/include'.
6109 Note: If you set this variable to None, the tool won't change the CPPPATH
6110 construction variable.
6111
6112 .IP QT_DEBUG 
6113 Prints lots of debugging information while scanning for moc files.
6114
6115 .IP QT_LIBPATH
6116 The path where the qt libraries are installed.
6117 The default value is '$QTDIR/lib'. 
6118 Note: If you set this variable to None, the tool won't change the LIBPATH
6119 construction variable.
6120
6121 .IP QT_LIB
6122 Default value is 'qt'. You may want to set this to 'qt-mt'. Note: If you set
6123 this variable to None, the tool won't change the LIBS variable.
6124
6125 .IP QT_MOC
6126 Default value is '$QT_BINPATH/moc'.
6127
6128 .IP QT_MOCCXXPREFIX
6129 Default value is ''. Prefix for moc output files, when source is a cxx file.
6130
6131 .IP QT_MOCCXXSUFFIX
6132 Default value is '.moc'. Suffix for moc output files, when source is a cxx 
6133 file.
6134
6135 .IP QT_MOCFROMCPPFLAGS
6136 Default value is '-i'. These flags are passed to moc, when moccing a
6137 cpp file.
6138
6139 .IP QT_MOCFROMCXXCOM
6140 Command to generate a moc file from a cpp file.
6141
6142 .IP QT_MOCFROMHCOM
6143 Command to generate a moc file from a header.
6144
6145 .IP QT_MOCFROMHFLAGS
6146 Default value is ''. These flags are passed to moc, when moccing a header
6147 file.
6148
6149 .IP QT_MOCHPREFIX
6150 Default value is 'moc_'. Prefix for moc output files, when source is a header.
6151
6152 .IP QT_MOCHSUFFIX
6153 Default value is '$CXXFILESUFFIX'. Suffix for moc output files, when source is
6154 a header.
6155
6156 .IP QT_UIC
6157 Default value is '$QT_BINPATH/uic'.
6158
6159 .IP QT_UICDECLCOM
6160 Command to generate header files from .ui files.
6161
6162 .IP QT_UICDECLFLAGS
6163 Default value is ''. These flags are passed to uic, when creating a a h
6164 file from a .ui file.
6165
6166 .IP QT_UICDECLPREFIX
6167 Default value is ''. Prefix for uic generated header files.
6168
6169 .IP QT_UICDECLSUFFIX
6170 Default value is '.h'. Suffix for uic generated header files.
6171
6172 .IP QT_UICIMPLCOM
6173 Command to generate cxx files from .ui files.
6174
6175 .IP QT_UICIMPLFLAGS
6176 Default value is ''. These flags are passed to uic, when creating a cxx
6177 file from a .ui file.
6178
6179 .IP QT_UICIMPLPREFIX
6180 Default value is 'uic_'. Prefix for uic generated implementation files.
6181
6182 .IP QT_UICIMPLSUFFIX
6183 Default value is '$CXXFILESUFFIX'. Suffix for uic generated implementation 
6184 files.
6185
6186 .IP QT_UISUFFIX
6187 Default value is '.ui'. Suffix of designer input files.
6188
6189 .IP RANLIB
6190 The archive indexer.
6191
6192 .IP RANLIBFLAGS
6193 General options passed to the archive indexer.
6194
6195 .IP RC
6196 The resource compiler used by the RES builder.
6197
6198 .IP RCCOM
6199 The command line used by the RES builder.
6200
6201 .IP RCFLAGS
6202 The flags passed to the resource compiler by the RES builder.
6203
6204 .IP RCS
6205 The RCS executable.
6206 Note that this variable is not actually used
6207 for the command to fetch source files from RCS;
6208 see the
6209 .B RCS_CO
6210 construction variable, below.
6211
6212 .IP RCS_CO 
6213 The RCS "checkout" executable,
6214 used to fetch source files from RCS.
6215
6216 .IP RCS_COCOM
6217 The command line used to
6218 fetch (checkout) source files from RCS.
6219
6220 .IP RCS_COFLAGS
6221 Options that are passed to the $RCS_CO command.
6222
6223 .IP RDirs
6224 A function that converts a file name into a list of Dir instances by
6225 searching the repositories. 
6226
6227 .IP RMIC
6228 The Java RMI stub compiler.
6229
6230 .IP RMICCOM
6231 The command line used to compile stub
6232 and skeleton class files
6233 from Java classes that contain RMI implementations.
6234 Any options specified in the $RMICFLAGS construction variable
6235 are included on this command line.
6236
6237 .IP RMICFLAGS
6238 General options passed to the Java RMI stub compiler.
6239
6240 .IP RPCGEN
6241 The RPC protocol compiler.
6242
6243 .IP RPCGENCLIENTFLAGS
6244 Options passed to the RPC protocol compiler
6245 when generating client side stubs.
6246 These are in addition to any flags specified in the
6247 .B RPCGENFLAGS
6248 construction variable.
6249
6250 .IP RPCGENFLAGS
6251 General options passed to the RPC protocol compiler.
6252
6253 .IP RPCGENHEADERFLAGS
6254 Options passed to the RPC protocol compiler
6255 when generating a header file.
6256 These are in addition to any flags specified in the
6257 .B RPCGENFLAGS
6258 construction variable.
6259
6260 .IP RPCGENSERVICEFLAGS
6261 Options passed to the RPC protocol compiler
6262 when generating server side stubs.
6263 These are in addition to any flags specified in the
6264 .B RPCGENFLAGS
6265 construction variable.
6266
6267 .IP RPCGENXDRFLAGS
6268 Options passed to the RPC protocol compiler
6269 when generating XDR routines.
6270 These are in addition to any flags specified in the
6271 .B RPCGENFLAGS
6272 construction variable.
6273
6274 .IP RPATH
6275 A list of paths to search for shared libraries when running programs.
6276 Currently only used in the GNU linker (gnulink) and IRIX linker (sgilink).
6277 Ignored on platforms and toolchains that don't support it.
6278 Note that the paths added to RPATH
6279 are not transformed by
6280 .B scons
6281 in any way:  if you want an absolute
6282 path, you must make it absolute yourself.
6283
6284 .IP SCANNERS
6285 A list of the available implicit dependency scanners.
6286 New file scanners may be added by
6287 appending to this list,
6288 although the more flexible approach
6289 is to associate scanners
6290 with a specific Builder.
6291 See the sections "Builder Objects"
6292 and "Scanner Objects,"
6293 below, for more information.
6294
6295 .IP SCCS
6296 The SCCS executable.
6297
6298 .IP SCCSCOM
6299 The command line used to
6300 fetch source files from SCCS.
6301
6302 .IP SCCSFLAGS
6303 General options that are passed to SCCS.
6304
6305 .IP SCCSGETFLAGS
6306 Options that are passed specifically to the SCCS "get" subcommand.
6307 This can be set, for example, to
6308 .I -e
6309 to check out editable files from SCCS.
6310
6311 .IP SHCC
6312 The C compiler used for generating shared-library objects.
6313
6314 .IP SHCCCOM
6315 The command line used to compile a C source file
6316 to a shared-library object file.
6317 Any options specified in the $SHCCFLAGS and $CPPFLAGS construction variables
6318 are included on this command line.
6319
6320 .IP SHCCCOMSTR
6321 The string displayed when a C source file
6322 is compiled to a shared object file.
6323 If this is not set, then $SHCCCOM (the command line) is displayed.
6324
6325 .ES
6326 env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET")
6327 .EE
6328
6329 .IP SHCCFLAGS
6330 Options that are passed to the C compiler
6331 to generate shared-library objects.
6332
6333 .IP SHCXX
6334 The C++ compiler used for generating shared-library objects.
6335
6336 .IP SHCXXCOM
6337 The command line used to compile a C++ source file
6338 to a shared-library object file.
6339 Any options specified in the $SHCXXFLAGS and $CPPFLAGS construction variables
6340 are included on this command line.
6341
6342 .IP SHCXXCOMSTR
6343 The string displayed when a C++ source file
6344 is compiled to a shared object file.
6345 If this is not set, then $SHCXXCOM (the command line) is displayed.
6346
6347 .ES
6348 env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET")
6349 .EE
6350
6351 .IP SHCXXFLAGS
6352 Options that are passed to the C++ compiler
6353 to generate shared-library objects.
6354
6355 .IP SHELL
6356 A string naming the shell program that will be passed to the 
6357 .I SPAWN 
6358 function. 
6359 See the 
6360 .I SPAWN 
6361 construction variable for more information.
6362
6363 .IP SHF77
6364 The Fortran 77 compiler used for generating shared-library objects.
6365 You should normally set the $SHFORTRANC variable,
6366 which specifies the default Fortran compiler
6367 for all Fortran versions.
6368 You only need to set $SHF77 if you need to use a specific compiler
6369 or compiler version for Fortran 77 files.
6370
6371 .IP SHF77COM
6372 The command line used to compile a Fortran 77 source file
6373 to a shared-library object file.
6374 You only need to set $SHF77COM if you need to use a specific
6375 command line for Fortran 77 files.
6376 You should normally set the $SHFORTRANCOM variable,
6377 which specifies the default command line
6378 for all Fortran versions.
6379
6380 .IP SHF77COMSTR
6381 The string displayed when a Fortran 77 source file
6382 is compiled to a shared-library object file.
6383 If this is not set, then $SHF77COM or $SHFORTRANCOM
6384 (the command line) is displayed.
6385
6386 .IP SHF77FLAGS
6387 Options that are passed to the Fortran 77 compiler
6388 to generated shared-library objects.
6389 You only need to set $SHF77FLAGS if you need to define specific
6390 user options for Fortran 77 files.
6391 You should normally set the $SHFORTRANFLAGS variable,
6392 which specifies the user-specified options
6393 passed to the default Fortran compiler
6394 for all Fortran versions.
6395
6396 .IP SHF77PPCOM
6397 The command line used to compile a Fortran 77 source file to a
6398 shared-library object file
6399 after first running the file through the C preprocessor.
6400 Any options specified in the $SHF77FLAGS and $CPPFLAGS construction variables
6401 are included on this command line.
6402 You only need to set $SHF77PPCOM if you need to use a specific
6403 C-preprocessor command line for Fortran 77 files.
6404 You should normally set the $SHFORTRANPPCOM variable,
6405 which specifies the default C-preprocessor command line
6406 for all Fortran versions.
6407
6408 .IP SHF90
6409 The Fortran 90 compiler used for generating shared-library objects.
6410 You should normally set the $SHFORTRANC variable,
6411 which specifies the default Fortran compiler
6412 for all Fortran versions.
6413 You only need to set $SHF90 if you need to use a specific compiler
6414 or compiler version for Fortran 90 files.
6415
6416 .IP SHF90COM
6417 The command line used to compile a Fortran 90 source file
6418 to a shared-library object file.
6419 You only need to set $SHF90COM if you need to use a specific
6420 command line for Fortran 90 files.
6421 You should normally set the $SHFORTRANCOM variable,
6422 which specifies the default command line
6423 for all Fortran versions.
6424
6425 .IP SHF90COMSTR
6426 The string displayed when a Fortran 90 source file
6427 is compiled to a shared-library object file.
6428 If this is not set, then $SHF90COM or $SHFORTRANCOM
6429 (the command line) is displayed.
6430
6431 .IP SHF90FLAGS
6432 Options that are passed to the Fortran 90 compiler
6433 to generated shared-library objects.
6434 You only need to set $SHF90FLAGS if you need to define specific
6435 user options for Fortran 90 files.
6436 You should normally set the $SHFORTRANFLAGS variable,
6437 which specifies the user-specified options
6438 passed to the default Fortran compiler
6439 for all Fortran versions.
6440
6441 .IP SHF90PPCOM
6442 The command line used to compile a Fortran 90 source file to a
6443 shared-library object file
6444 after first running the file through the C preprocessor.
6445 Any options specified in the $SHF90FLAGS and $CPPFLAGS construction variables
6446 are included on this command line.
6447 You only need to set $SHF90PPCOM if you need to use a specific
6448 C-preprocessor command line for Fortran 90 files.
6449 You should normally set the $SHFORTRANPPCOM variable,
6450 which specifies the default C-preprocessor command line
6451 for all Fortran versions.
6452
6453 .IP SHF95
6454 The Fortran 95 compiler used for generating shared-library objects.
6455 You should normally set the $SHFORTRANC variable,
6456 which specifies the default Fortran compiler
6457 for all Fortran versions.
6458 You only need to set $SHF95 if you need to use a specific compiler
6459 or compiler version for Fortran 95 files.
6460
6461 .IP SHF95COM
6462 The command line used to compile a Fortran 95 source file
6463 to a shared-library object file.
6464 You only need to set $SHF95COM if you need to use a specific
6465 command line for Fortran 95 files.
6466 You should normally set the $SHFORTRANCOM variable,
6467 which specifies the default command line
6468 for all Fortran versions.
6469
6470 .IP SHF95COMSTR
6471 The string displayed when a Fortran 95 source file
6472 is compiled to a shared-library object file.
6473 If this is not set, then $SHF95COM or $SHFORTRANCOM
6474 (the command line) is displayed.
6475
6476 .IP SHF95FLAGS
6477 Options that are passed to the Fortran 95 compiler
6478 to generated shared-library objects.
6479 You only need to set $SHF95FLAGS if you need to define specific
6480 user options for Fortran 95 files.
6481 You should normally set the $SHFORTRANFLAGS variable,
6482 which specifies the user-specified options
6483 passed to the default Fortran compiler
6484 for all Fortran versions.
6485
6486 .IP SHF95PPCOM
6487 The command line used to compile a Fortran 95 source file to a
6488 shared-library object file
6489 after first running the file through the C preprocessor.
6490 Any options specified in the $SHF95FLAGS and $CPPFLAGS construction variables
6491 are included on this command line.
6492 You only need to set $SHF95PPCOM if you need to use a specific
6493 C-preprocessor command line for Fortran 95 files.
6494 You should normally set the $SHFORTRANPPCOM variable,
6495 which specifies the default C-preprocessor command line
6496 for all Fortran versions.
6497
6498 .IP SHFORTRAN
6499 The default Fortran compiler used for generating shared-library objects.
6500
6501 .IP SHFORTRANCOM
6502 The command line used to compile a Fortran source file
6503 to a shared-library object file.
6504
6505 .IP FORTRANCOMSTR
6506 The string displayed when a Fortran source file
6507 is compiled to a shared-library object file.
6508 If this is not set, then $SHFORTRANCOM
6509 (the command line) is displayed.
6510
6511 .IP SHFORTRANFLAGS
6512 Options that are passed to the Fortran compiler
6513 to generate shared-library objects.
6514
6515 .IP SHFORTRANPPCOM
6516 The command line used to compile a Fortran source file to a
6517 shared-library object file
6518 after first running the file through the C preprocessor.
6519 Any options specified
6520 in the $SHFORTRANFLAGS and $CPPFLAGS construction variables
6521 are included on this command line.
6522
6523 .IP SHLIBPREFIX
6524 The prefix used for shared library file names.
6525
6526 .IP SHLIBSUFFIX
6527 The suffix used for shared library file names.
6528
6529 .IP SHLINK
6530 The linker for programs that use shared libraries.
6531
6532 .IP SHLINKCOM
6533 The command line used to link programs using shared libaries.
6534
6535 .IP SHLINKCOMSTR
6536 The string displayed when programs using shared libraries are linked.
6537 If this is not set, then $SHLINKCOM (the command line) is displayed.
6538
6539 .ES
6540 env = Environment(SHLINKCOMSTR = "Linking shared $TARGET")
6541 .EE
6542
6543 .IP SHLINKFLAGS
6544 General user options passed to the linker for programs using shared libraries.
6545 Note that this variable should
6546 .I not
6547 contain
6548 .B -l
6549 (or similar) options for linking with the libraries listed in $LIBS,
6550 nor
6551 .B -L
6552 (or similar) include search path options
6553 that scons generates automatically from $LIBPATH.
6554 See
6555 .BR _LIBFLAGS ,
6556 above,
6557 for the variable that expands to library-link options,
6558 and
6559 .BR _LIBDIRFLAGS ,
6560 above,
6561 for the variable that expands to library search path options.
6562
6563 .IP SHOBJPREFIX 
6564 The prefix used for shared object file names.
6565
6566 .IP SHOBJSUFFIX 
6567 The suffix used for shared object file names.
6568
6569 .IP SOURCE
6570 A reserved variable name
6571 that may not be set or used in a construction environment.
6572 (See "Variable Substitution," below.)
6573
6574 .IP SOURCES
6575 A reserved variable name
6576 that may not be set or used in a construction environment.
6577 (See "Variable Substitution," below.)
6578
6579 .IP SPAWN
6580 A command interpreter function that will be called to execute command line
6581 strings. The function must expect the following arguments:
6582
6583 .ES
6584 def spawn(shell, escape, cmd, args, env):
6585 .EE
6586 .IP
6587 .I sh
6588 is a string naming the shell program to use.
6589 .I escape
6590 is a function that can be called to escape shell special characters in
6591 the command line. 
6592 .I cmd
6593 is the path to the command to be executed.
6594 .I args
6595 is the arguments to the command.
6596 .I env
6597 is a dictionary of the environment variables
6598 in which the command should be executed.
6599 '\"
6600 '\".IP SVN
6601 '\"The Subversion executable (usually named
6602 '\".BR svn ).
6603 '\"
6604 '\".IP SVNCOM
6605 '\"The command line used to
6606 '\"fetch source files from a Subversion repository.
6607 '\"
6608 '\".IP SVNFLAGS
6609 '\"General options that are passed to Subversion.
6610
6611 .IP SWIG
6612 The scripting language wrapper and interface generator.
6613
6614 .IP SWIGCFILESUFFIX
6615 The suffix that will be used for intermediate C
6616 source files generated by
6617 the scripting language wrapper and interface generator.
6618 The default value is
6619 .BR _wrap$CFILESUFFIX .
6620 By default, this value is used whenever the
6621 .B -c++
6622 option is
6623 .I not
6624 specified as part of the
6625 .B SWIGFLAGS
6626 construction variable.
6627
6628 .IP SWIGCOM
6629 The command line used to call
6630 the scripting language wrapper and interface generator.
6631
6632 .IP SWIGCXXFILESUFFIX
6633 The suffix that will be used for intermediate C++
6634 source files generated by
6635 the scripting language wrapper and interface generator.
6636 The default value is
6637 .BR _wrap$CFILESUFFIX .
6638 By default, this value is used whenever the
6639 .B -c++
6640 option is specified as part of the
6641 .B SWIGFLAGS
6642 construction variable.
6643
6644 .IP SWIGFLAGS
6645 General options passed to
6646 the scripting language wrapper and interface generator.
6647 This is where you should set
6648 .BR -python ,
6649 .BR -perl5 ,
6650 .BR -tcl ,
6651 or whatever other options you want to specify to SWIG.
6652 If you set the
6653 .B -c++
6654 option in this variable,
6655 .B scons
6656 will, by default,
6657 generate a C++ intermediate source file
6658 with the extension that is specified as the
6659 .B $CXXFILESUFFIX
6660 variable.
6661
6662 .IP TAR
6663 The tar archiver.
6664
6665 .IP TARCOM
6666 The command line used to call the tar archiver.
6667
6668 .IP TARFLAGS
6669 General options passed to the tar archiver.
6670
6671 .IP TARGET
6672 A reserved variable name
6673 that may not be set or used in a construction environment.
6674 (See "Variable Substitution," below.)
6675
6676 .IP TARGETS
6677 A reserved variable name
6678 that may not be set or used in a construction environment.
6679 (See "Variable Substitution," below.)
6680
6681 .IP TARSUFFIX 
6682 The suffix used for tar file names.
6683
6684 .IP TEX
6685 The TeX formatter and typesetter.
6686
6687 .IP TEXCOM
6688 The command line used to call the TeX formatter and typesetter.
6689
6690 .IP TEXFLAGS
6691 General options passed to the TeX formatter and typesetter.
6692
6693 .IP TOOLS
6694 A list of the names of the Tool specifications
6695 that are part of this construction environment.
6696
6697 .IP WIN32_INSERT_DEF
6698 When this is set to true,
6699 a library build of a WIN32 shared library (.dll file)
6700 will also build a corresponding .def file at the same time,
6701 if a .def file is not already listed as a build target.
6702 The default is 0 (do not build a .def file).
6703
6704 .IP WIN32DEFPREFIX
6705 The prefix used for WIN32 .def file names.
6706
6707 .IP WIN32DEFSUFFIX
6708 The suffix used for WIN32 .def file names.
6709
6710 .IP YACC
6711 The parser generator.
6712
6713 .IP YACCCOM
6714 The command line used to call the parser generator
6715 to generate a source file.
6716
6717 .IP YACCCOMSTR
6718 The string displayed when generating a source file
6719 using the parser generator.
6720 If this is not set, then $YACCCOM (the command line) is displayed.
6721
6722 .ES
6723 env = Environment(YACCCOMSTR = "Yacc'ing $TARGET from $SOURCES")
6724 .EE
6725
6726 .IP YACCFLAGS
6727 General options passed to the parser generator.
6728 If $YACCFLAGS contains a \-d option,
6729 SCons assumes that the call will also create a .h file
6730 (if the yacc source file ends in a .y suffix)
6731 or a .hpp file
6732 (if the yacc source file ends in a .yy suffix)
6733
6734 .IP ZIP
6735 The zip compression and file packaging utility.
6736
6737 .IP ZIPCOM
6738 The command line used to call the zip utility,
6739 or the internal Python function used to create a
6740 zip archive.
6741
6742 .IP ZIPCOMPRESSION
6743 The
6744 .I compression
6745 flag
6746 from the Python
6747 .B zipfile
6748 module used by the internal Python function
6749 to control whether the zip archive
6750 is compressed or not.
6751 The default value is
6752 .BR zipfile.ZIP_DEFLATED ,
6753 which creates a compressed zip archive.
6754 This value has no effect when using Python 1.5.2
6755 or if the
6756 .B zipfile
6757 module is otherwise unavailable.
6758
6759 .IP ZIPFLAGS
6760 General options passed to the zip utility.
6761
6762 .LP
6763 Construction variables can be retrieved and set using the 
6764 .B Dictionary 
6765 method of the construction environment:
6766
6767 .ES
6768 dict = env.Dictionary()
6769 dict["CC"] = "cc"
6770 .EE
6771
6772 or using the [] operator:
6773
6774 .ES
6775 env["CC"] = "cc"
6776 .EE
6777
6778 Construction variables can also be passed to the construction environment
6779 constructor:
6780
6781 .ES
6782 env = Environment(CC="cc")
6783 .EE
6784
6785 or when copying a construction environment using the 
6786 .B Copy 
6787 method:
6788
6789 .ES
6790 env2 = env.Copy(CC="cl.exe")
6791 .EE
6792
6793 .SS Configure Contexts
6794
6795 .B scons
6796 supports
6797 .I configure contexts,
6798 an integrated mechanism similar to the
6799 various AC_CHECK macros in GNU autoconf
6800 for testing for the existence of C header
6801 files, libraries, etc.
6802 In contrast to autoconf,
6803 .B scons
6804 does not maintain an explicit cache of the tested values,
6805 but uses its normal dependency tracking to keep the checked values
6806 up to date. However, users may override this behaviour with the 
6807 .B --config
6808 command line option.
6809
6810 The following methods can be used to perform checks:
6811
6812 .TP
6813 .RI Configure( env ", [" custom_tests ", " conf_dir ", " log_file ", " config_h ])
6814 .TP
6815 .RI env.Configure([ custom_tests ", " conf_dir ", " log_file ", " config_h ])
6816 This creates a configure context, which can be used to perform checks.
6817 .I env
6818 specifies the environment for building the tests.
6819 This environment may be modified when performing checks.
6820 .I custom_tests
6821 is a dictionary containing custom tests.
6822 See also the section about custom tests below. 
6823 By default, no custom tests are added to the configure context.
6824 .I conf_dir
6825 specifies a directory where the test cases are built.
6826 Note that this directory is not used for building
6827 normal targets.
6828 The default value is the directory
6829 #/.sconf_temp.
6830 .I log_file
6831 specifies a file which collects the output from commands
6832 that are executed to check for the existence of header files, libraries, etc.
6833 The default is the file #/config.log.
6834 If you are using the
6835 .B BuildDir
6836 method,
6837 you may want to specify a subdirectory under your build directory.
6838 .I config_h
6839 specifies a C header file where the results of tests 
6840 will be written, e.g. #define HAVE_STDIO_H, #define HAVE_LIBM, etc. 
6841 The default is to not write a
6842 .B config.h
6843 file.
6844 You can specify the same
6845 .B config.h
6846 file in multiple calls to Configure,
6847 in which case
6848 .B scons
6849 will concatenate all results in the specified file.
6850 Note that SCons
6851 uses its normal dependency checking
6852 to decide if it's necessary to rebuild
6853 the specified
6854 .I config_h
6855 file.
6856 This means that the file is not necessarily re-built each
6857 time scons is run,
6858 but is only rebuilt if its contents will have changed
6859 and some target that depends on the
6860 .I config_h
6861 file is being built.
6862
6863 .EE
6864 A created
6865 .B Configure
6866 instance has the following associated methods:
6867
6868 .TP 
6869 .RI Configure.Finish( self )
6870 This method should be called after configuration is done.
6871 It returns the environment as modified
6872 by the configuration checks performed.
6873 After this method is called, no further checks can be performed
6874 with this configuration context.
6875 However, you can create a new 
6876 .RI Configure 
6877 context to perform additional checks.
6878 Only one context should be active at a time.
6879
6880 The following Checks are predefined.
6881 (This list will likely grow larger as time
6882 goes by and developers contribute new useful tests.)
6883
6884 .TP
6885 .RI Configure.CheckHeader( self ", " header ", [" include_quotes ", " language ])
6886 Checks if 
6887 .I header
6888 is usable in the specified language.
6889 .I header
6890 may be a list,
6891 in which case the last item in the list
6892 is the header file to be checked,
6893 and the previous list items are
6894 header files whose
6895 .B #include
6896 lines should precede the
6897 header line being checked for.
6898 The optional argument 
6899 .I include_quotes 
6900 must be
6901 a two character string, where the first character denotes the opening
6902 quote and the second character denotes the closing quote.
6903 By default, both characters  are " (double quote).
6904 The optional argument
6905 .I language
6906 should be either
6907 .B C
6908 or
6909 .B C++
6910 and selects the compiler to be used for the check.
6911 Returns 1 on success and 0 on failure.
6912
6913 .TP
6914 .RI Configure.CheckCHeader( self ", " header ", [" include_quotes ])
6915 This is a wrapper around
6916 .B Configure.CheckHeader
6917 which checks if 
6918 .I header
6919 is usable in the C language.
6920 .I header
6921 may be a list,
6922 in which case the last item in the list
6923 is the header file to be checked,
6924 and the previous list items are
6925 header files whose
6926 .B #include
6927 lines should precede the
6928 header line being checked for.
6929 The optional argument 
6930 .I include_quotes 
6931 must be
6932 a two character string, where the first character denotes the opening
6933 quote and the second character denotes the closing quote (both default
6934 to \N'34').
6935 Returns 1 on success and 0 on failure.
6936
6937 .TP
6938 .RI Configure.CheckCXXHeader( self ", " header ", [" include_quotes ])
6939 This is a wrapper around
6940 .B Configure.CheckHeader
6941 which checks if 
6942 .I header
6943 is usable in the C++ language.
6944 .I header
6945 may be a list,
6946 in which case the last item in the list
6947 is the header file to be checked,
6948 and the previous list items are
6949 header files whose
6950 .B #include
6951 lines should precede the
6952 header line being checked for.
6953 The optional argument 
6954 .I include_quotes 
6955 must be
6956 a two character string, where the first character denotes the opening
6957 quote and the second character denotes the closing quote (both default
6958 to \N'34').
6959 Returns 1 on success and 0 on failure. 
6960
6961 .TP
6962 .RI Configure.CheckFunc( self ", " function_name ", [" header ", " language ])
6963 Checks if the specified
6964 C or C++ function is available.
6965 .I function_name
6966 is the name of the function to check for.
6967 The optional
6968 .I header
6969 argument is a string
6970 that will be
6971 placed at the top
6972 of the test file
6973 that will be compiled
6974 to check if the function exists;
6975 the default is:
6976 .ES
6977 #ifdef __cplusplus
6978 extern "C"
6979 #endif
6980 char function_name();
6981 .EE
6982 The optional
6983 .I language
6984 argument should be
6985 .B C
6986 or
6987 .B C++
6988 and selects the compiler to be used for the check;
6989 the default is "C".
6990
6991 .TP 
6992 .RI Configure.CheckLib( self ", [" library ", " symbol ", " header ", " language ", " autoadd ])
6993 Checks if 
6994 .I library 
6995 provides 
6996 .IR symbol .
6997 If the value of
6998 .I autoadd
6999 is 1 and the library provides the specified
7000 .IR symbol ,
7001 appends the library to the LIBS construction environment variable.
7002 .I library 
7003 may also be None (the default),
7004 in which case 
7005 .I symbol 
7006 is checked with the current LIBS variable,
7007 or a list of library names,
7008 in which case each library in the list
7009 will be checked for
7010 .IR symbol .
7011 The default
7012 .I symbol
7013 is "main",
7014 which just check if
7015 you can link against the specified
7016 .IR library .
7017 The optional
7018 .I language
7019 argument should be
7020 .B C
7021 or
7022 .B C++
7023 and selects the compiler to be used for the check;
7024 the default is "C".
7025 The default value for
7026 .I autoadd
7027 is 1.
7028 It is assumed, that the C-language is used.
7029 This method returns 1 on success and 0 on error.
7030
7031 .TP 
7032 .RI Configure.CheckLibWithHeader( self ", " library ", " header ", " language ", [" call ", " autoadd ])
7033
7034 In contrast to the 
7035 .RI Configure.CheckLib 
7036 call, this call provides a more sophisticated way to check against libraries.
7037 Again, 
7038 .I library
7039 specifies the library or a list of libraries to check. 
7040 .I header
7041 specifies a header to check for.
7042 .I header
7043 may be a list,
7044 in which case the last item in the list
7045 is the header file to be checked,
7046 and the previous list items are
7047 header files whose
7048 .B #include
7049 lines should precede the
7050 header line being checked for.
7051 .I language
7052 may be one of 'C','c','CXX','cxx','C++' and 'c++'.
7053 .I call
7054 can be any valid expression (with a trailing ';'). The default is 'main();'.
7055 .I autoadd
7056 specifies whether to add the library to the environment (only if the check 
7057 succeeds). This method returns 1 on success and 0 on error.
7058
7059 .TP
7060 .RI Configure.CheckType( self ", " type_name ", [" includes ", " language ])
7061 Checks for the existence of a type defined by
7062 .BR typedef .
7063 .I type_name
7064 specifies the typedef name to check for.
7065 .I includes
7066 is a string containing one or more
7067 .B #include
7068 lines that will be inserted into the program
7069 that will be run to test for the existence of the type.
7070 The optional
7071 .I language
7072 argument should be
7073 .B C
7074 or
7075 .B C++
7076 and selects the compiler to be used for the check;
7077 the default is "C".
7078
7079 .EE
7080 Example of a typical Configure usage:
7081
7082 .ES
7083 env = Environment()
7084 conf = Configure( env )
7085 if not conf.CheckCHeader( 'math.h' ):
7086     print 'We really need math.h!'
7087     Exit(1)
7088 if conf.CheckLibWithHeader( 'qt', 'qapp.h', 'c++', 'QApplication qapp(0,0);' ):
7089     # do stuff for qt - usage, e.g.
7090     conf.env.Append( CPPFLAGS = '-DWITH_QT' )
7091 env = conf.Finish() 
7092 .EE
7093
7094 .EE
7095 You can define your own custom checks. 
7096 in addition to the predefined checks.
7097 These are passed in a dictionary to the Configure function.
7098 This dictionary maps the names of the checks
7099 to user defined Python callables 
7100 (either Python functions or class instances implementing the
7101 .I __call__
7102 method).
7103 The first argument of the call is always a 
7104 .I CheckContext
7105 instance followed by the arguments,
7106 which must be supplied by the user of the check.
7107 These CheckContext instances define the following methods:
7108
7109 .TP 
7110 .RI CheckContext.Message( self ", " text )
7111
7112 Usually called before the check is started. 
7113 .I text
7114 will be displayed to the user, e.g. 'Checking for library X...'
7115
7116 .TP
7117 .RI CheckContext.Result( self, ", " res )
7118
7119 Usually called after the check is done. 
7120 .I res
7121 can be either an integer or a string. In the former case, 'ok' (res != 0) 
7122 or 'failed' (res == 0) is displayed to the user, in the latter case the 
7123 given string is displayed.
7124
7125 .TP
7126 .RI CheckContext.TryCompile( self ", " text ", " extension )
7127 Checks if a file with the specified 
7128 .I extension
7129 (e.g. '.c') containing 
7130 .I text 
7131 can be compiled using the environment's
7132 .B Object 
7133 builder. Returns 1 on success and 0 on failure.
7134
7135 .TP 
7136 .RI CheckContext.TryLink( self ", " text ", " extension )
7137 Checks, if a file with the specified
7138 .I extension
7139 (e.g. '.c') containing 
7140 .I text 
7141 can be compiled using the environment's
7142 .B Program
7143 builder. Returns 1 on success and 0 on failure.
7144
7145 .TP
7146 .RI CheckContext.TryRun( self ", " text ", " extension )
7147 Checks, if a file with the specified
7148 .I extension
7149 (e.g. '.c') containing 
7150 .I text 
7151 can be compiled using the environment's
7152 .B Program
7153 builder. On success, the program is run. If the program
7154 executes successfully
7155 (that is, its return status is 0),
7156 a tuple
7157 .I (1, outputStr)
7158 is returned, where
7159 .I outputStr
7160 is the standard output of the
7161 program.
7162 If the program fails execution
7163 (its return status is non-zero),
7164 then (0, '') is returned.
7165
7166 .TP
7167 .RI CheckContext.TryAction( self ", " action ", [" text ", " extension ])
7168 Checks if the specified
7169 .I action 
7170 with an optional source file (contents
7171 .I text
7172 , extension 
7173 .I extension
7174 = ''
7175 ) can be executed. 
7176 .I action 
7177 may be anything which can be converted to a 
7178 .B scons
7179 .RI Action.
7180 On success,
7181 .I (1, outputStr)
7182 is returned, where
7183 .I outputStr
7184 is the content of the target file.
7185 On failure
7186 .I (0, '')
7187 is returned.
7188
7189 .TP
7190 .RI CheckContext.TryBuild( self ", " builder ", [" text ", " extension ])
7191 Low level implementation for testing specific builds;
7192 the methods above are based on this method.
7193 Given the Builder instance
7194 .I builder
7195 and the optional 
7196 .I text
7197 of a source file with optional
7198 .IR extension ,
7199 this method returns 1 on success and 0 on failure. In addition, 
7200 .I self.lastTarget 
7201 is set to the build target node, if the build was successful.
7202
7203 .EE
7204 Example for implementing and using custom tests:
7205
7206 .ES
7207 def CheckQt(context, qtdir):
7208     context.Message( 'Checking for qt ...' )
7209     lastLIBS = context.env['LIBS']
7210     lastLIBPATH = context.env['LIBPATH']
7211     lastCPPPATH= context.env['CPPPATH']
7212     context.env.Append(LIBS = 'qt', LIBPATH = qtdir + '/lib', CPPPATH = qtdir + '/include' )
7213     ret = context.TryLink("""
7214 #include <qapp.h>
7215 int main(int argc, char **argv) { 
7216   QApplication qapp(argc, argv);
7217   return 0;
7218 }
7219 """)
7220     if not ret:
7221         context.env.Replace(LIBS = lastLIBS, LIBPATH=lastLIBPATH, CPPPATH=lastCPPPATH)
7222     context.Result( ret )
7223     return ret
7224
7225 env = Environment()
7226 conf = Configure( env, custom_tests = { 'CheckQt' : CheckQt } )
7227 if not conf.CheckQt('/usr/lib/qt'):
7228     print 'We really need qt!'
7229     Exit(1)
7230 env = conf.Finish() 
7231 .EE
7232
7233 .SS Construction Variable Options
7234
7235 Often when building software, various options need to be specified at build
7236 time that are not known when the SConstruct/SConscript files are
7237 written. For example, libraries needed for the build may be in non-standard
7238 locations, or site-specific compiler options may need to be passed to the
7239 compiler. 
7240 .B scons
7241 provides a mechanism for overridding construction variables from the
7242 command line or a text-based SConscript file through an Options
7243 object. To create an Options object, call the Options() function:
7244
7245 .TP
7246 .RI Options([ files "], [" args ])
7247 This creates an Options object that will read construction variables from
7248 the file or list of filenames specified in
7249 .IR files .
7250 If no files are specified,
7251 or the
7252 .I files
7253 argument is
7254 .BR None ,
7255 then no files will be read.
7256 The optional argument
7257 .I args
7258 is a dictionary of
7259 values that will override anything read from the specified files;
7260 it is primarily intended to be passed the
7261 .B ARGUMENTS
7262 dictionary that holds variables
7263 specified on the command line.
7264 Example:
7265
7266 .ES
7267 opts = Options('custom.py')
7268 opts = Options('overrides.py', ARGUMENTS)
7269 opts = Options(None, {FOO:'expansion', BAR:7})
7270 .EE
7271
7272 Options objects have the following methods:
7273
7274 .TP
7275 .RI Add( key ", [" help ", " default ", " validator ", " converter ])
7276 This adds a customizable construction variable to the Options object. 
7277 .I key
7278 is the name of the variable. 
7279 .I help 
7280 is the help text for the variable.
7281 .I default 
7282 is the default value of the variable;
7283 if the default value is
7284 .B None
7285 and there is no explicit value specified,
7286 the construction variable will
7287 .I not
7288 be added to the construction environment.
7289 .I validator
7290 is called to validate the value of the variable, and should take three
7291 arguments: key, value, and environment
7292 .I converter
7293 is called to convert the value before putting it in the environment, and
7294 should take a single argument: value. Example:
7295
7296 .ES
7297 opts.Add('CC', 'The C compiler')
7298 .EE
7299
7300 .TP
7301 .RI AddOptions( list )
7302 A wrapper script that adds
7303 multiple customizable construction variables
7304 to an Options object.
7305 .I list
7306 is a list of tuple or list objects
7307 that contain the arguments
7308 for an individual call to the
7309 .B Add
7310 method.
7311
7312 .ES
7313 opt.AddOptions(
7314        ('debug', '', 0),
7315        ('CC', 'The C compiler'),
7316        ('VALIDATE', 'An option for testing validation',
7317         'notset', validator, None),
7318     )
7319 .EE
7320
7321 .TP
7322 .RI Update( env ", [" args ])
7323 This updates a construction environment
7324 .I env
7325 with the customized construction variables. Normally this method is not
7326 called directly, but is called indirectly by passing the Options object to
7327 the Environment() function:
7328
7329 .ES
7330 env = Environment(options=opts)
7331 .EE
7332
7333 .TP
7334 .RI Save( filename ", " env )
7335 This saves the currently set options into a script file named  
7336 .I filename
7337 that can be used on the next invocation to automatically load the current
7338 settings.  This method combined with the Options method can be used to
7339 support caching of options between runs.
7340
7341 .ES
7342 env = Environment()
7343 opts = Options(['options.cache', 'custom.py'])
7344 opts.Add(...)
7345 opts.Update(env)
7346 opts.Save('options.cache', env)
7347 .EE
7348
7349 .TP
7350 .RI GenerateHelpText( env ", [" sort ])
7351 This generates help text documenting the customizable construction
7352 variables suitable to passing in to the Help() function. 
7353 .I env
7354 is the construction environment that will be used to get the actual values
7355 of customizable variables. Calling with 
7356 an optional
7357 .I sort
7358 function
7359 will cause the output to be sorted
7360 by the specified argument.
7361 The specific
7362 .I sort
7363 function
7364 should take two arguments
7365 and return
7366 -1, 0 or 1
7367 (like the standard Python
7368 .I cmp
7369 function).
7370
7371 .ES
7372 Help(opts.GenerateHelpText(env))
7373 Help(opts.GenerateHelpText(env, sort=cmp))
7374 .EE
7375
7376 The text based SConscript file is executed as a Python script, and the
7377 global variables are queried for customizable construction
7378 variables. Example:
7379
7380 .ES
7381 CC = 'my_cc'
7382 .EE
7383
7384 To make it more convenient to work with customizable Options,
7385 .B scons
7386 provides a number of functions
7387 that make it easy to set up
7388 various types of Options:
7389
7390 .TP
7391 .RI BoolOption( key ", " help ", " default )
7392 Return a tuple of arguments
7393 to set up a Boolean option.
7394 The option will use
7395 the specified name
7396 .IR key ,
7397 have a default value of
7398 .IR default ,
7399 and display the specified
7400 .I help
7401 text.
7402 The option will interpret the values
7403 .BR y ,
7404 .BR yes ,
7405 .BR t ,
7406 .BR true ,
7407 .BR 1 ,
7408 .B on
7409 and
7410 .B all
7411 as true,
7412 and the values
7413 .BR n ,
7414 .BR no ,
7415 .BR f ,
7416 .BR false ,
7417 .BR 0 ,
7418 .B off
7419 and
7420 .B none
7421 as false.
7422
7423 .TP
7424 .RI EnumOption( key ", " help ", " default ", " allowed_values ", [" map ", " ignorecase ])
7425 Return a tuple of arguments
7426 to set up an option
7427 whose value may be one
7428 of a specified list of legal enumerated values.
7429 The option will use
7430 the specified name
7431 .IR key ,
7432 have a default value of
7433 .IR default ,
7434 and display the specified
7435 .I help
7436 text.
7437 The option will only support those
7438 values in the
7439 .I allowed_values
7440 list.
7441 The optional
7442 .I map
7443 argument is a dictionary
7444 that can be used to convert
7445 input values into specific legal values
7446 in the
7447 .I allowed_values
7448 list.
7449 If the value of
7450 .I ignore_case
7451 is
7452 .B 0
7453 (the default),
7454 then the values are case-sensitive.
7455 If the value of
7456 .I ignore_case
7457 is
7458 .BR 1 ,
7459 then values will be matched
7460 case-insensitive.
7461 If the value of
7462 .I ignore_case
7463 is
7464 .BR 1 ,
7465 then values will be matched
7466 case-insensitive,
7467 and all input values will be
7468 converted to lower case.
7469
7470 .TP
7471 .RI ListOption( key ", " help ", " default ", " names )
7472 Return a tuple of arguments
7473 to set up an option
7474 whose value may be one or more
7475 of a specified list of legal enumerated values.
7476 The option will use
7477 the specified name
7478 .IR key ,
7479 have a default value of
7480 .IR default ,
7481 and display the specified
7482 .I help
7483 text.
7484 The option will only support the values
7485 .BR all ,
7486 .BR none ,
7487 or the values in the
7488 .I names
7489 list.
7490 More than one value may be specified,
7491 with all values separated by commas.
7492 The default may be a string of
7493 comma-separated default values,
7494 or a list of the default values.
7495
7496 .TP
7497 .RI PackageOption( key ", " help ", " default )
7498 Return a tuple of arguments
7499 to set up an option
7500 whose value is a path name
7501 of a package that may be
7502 enabled, disabled or 
7503 given an explicit path name.
7504 The option will use
7505 the specified name
7506 .IR key ,
7507 have a default value of
7508 .IR default ,
7509 and display the specified
7510 .I help
7511 text.
7512 The option will support the values
7513 .BR yes ,
7514 .BR true ,
7515 .BR on ,
7516 .BR enable
7517 or
7518 .BR search ,
7519 in which case the specified
7520 .I default
7521 will be used,
7522 or the option may be set to an
7523 arbitrary string
7524 (typically the path name to a package
7525 that is being enabled).
7526 The option will also support the values
7527 .BR no ,
7528 .BR false ,
7529 .BR off
7530 or
7531 .BR disable
7532 to disable use of the specified option.
7533
7534 .TP
7535 .RI PathOption( key ", " help ", " default ", [" validator ])
7536 Return a tuple of arguments
7537 to set up an option
7538 whose value is expected to be a path name.
7539 The option will use
7540 the specified name
7541 .IR key ,
7542 have a default value of
7543 .IR default ,
7544 and display the specified
7545 .I help
7546 text.
7547 An additional
7548 .I validator
7549 may be specified
7550 that will be called to
7551 verify that the specified path
7552 is acceptable.
7553 SCons supplies the
7554 following ready-made validators:
7555 .BR PathOption.PathExists
7556 (the default),
7557 which verifies that the specified path exists;
7558 .BR PathOption.PathIsFile ,
7559 which verifies that the specified path is an existing file;
7560 .BR PathOption.PathIsDir ,
7561 which verifies that the specified path is an existing directory;
7562 and
7563 .BR PathOption.PathIsDirCreate ,
7564 which verifies that the specified path is a directory,
7565 and will create the specified directory if the path exist.
7566 You may supply your own
7567 .I validator
7568 function,
7569 which must take three arguments
7570 .RI ( key ,
7571 the name of the options variable to be set;
7572 .IR val ,
7573 the specified value being checked;
7574 and
7575 .IR env ,
7576 the construction environment)
7577 and should raise an exception
7578 if the specified value is not acceptable.
7579
7580 .RE
7581 These functions make it
7582 convenient to create a number
7583 of options with consistent behavior
7584 in a single call to the
7585 .B AddOptions
7586 method:
7587
7588 .ES
7589 opts.AddOptions(
7590     BoolOption('warnings', 'compilation with -Wall and similiar', 1),
7591     EnumOption('debug', 'debug output and symbols', 'no'
7592                allowed_values=('yes', 'no', 'full'),
7593                map={}, ignorecase=0),  # case sensitive
7594     ListOption('shared',
7595                'libraries to build as shared libraries',
7596                'all',
7597                names = list_of_libs),
7598     PackageOption('x11',
7599                   'use X11 installed here (yes = search some places)',
7600                   'yes'),
7601     PathOption('qtdir', 'where the root of Qt is installed', qtdir),
7602     PathOption('foopath', 'where the foo library is installed', foopath,
7603                PathOption.PathIsDir),
7604
7605 )
7606 .EE
7607
7608 .SS File and Directory Nodes
7609
7610 The
7611 .IR File ()
7612 and
7613 .IR Dir ()
7614 functions return
7615 .I File
7616 and
7617 .I Dir
7618 Nodes, respectively.
7619 python objects, respectively.
7620 Those objects have several user-visible attributes
7621 and methods that are often useful:
7622
7623 .IP path
7624 The build path
7625 of the given
7626 file or directory.
7627 This path is relative to the top-level directory
7628 (where the
7629 .B SConstruct
7630 file is found).
7631 The build path is the same as the source path if
7632 .I build_dir
7633 is not being used.
7634
7635 .IP abspath
7636 The absolute build path of the given file or directory.
7637
7638 .IP srcnode()
7639 The
7640 .IR srcnode ()
7641 method
7642 returns another
7643 .I File
7644 or
7645 .I Dir
7646 object representing the
7647 .I source
7648 path of the given
7649 .I File
7650 or
7651 .IR Dir .
7652 The 
7653
7654 .ES
7655 # Get the current build dir's path, relative to top.
7656 Dir('.').path
7657 # Current dir's absolute path
7658 Dir('.').abspath
7659 # Next line is always '.', because it is the top dir's path relative to itself.
7660 Dir('#.').path
7661 File('foo.c').srcnode().path   # source path of the given source file.
7662
7663 # Builders also return File objects:
7664 foo = env.Program('foo.c')
7665 print "foo will be built in %s"%foo.path
7666 .EE
7667
7668 .SH EXTENDING SCONS
7669 .SS Builder Objects
7670 .B scons
7671 can be extended to build different types of targets
7672 by adding new Builder objects
7673 to a construction environment.
7674 .IR "In general" ,
7675 you should only need to add a new Builder object
7676 when you want to build a new type of file or other external target.
7677 If you just want to invoke a different compiler or other tool
7678 to build a Program, Object, Library, or any other
7679 type of output file for which
7680 .B scons
7681 already has an existing Builder,
7682 it is generally much easier to
7683 use those existing Builders
7684 in a construction environment
7685 that sets the appropriate construction variables
7686 (CC, LINK, etc.).
7687
7688 Builder objects are created
7689 using the
7690 .B Builder 
7691 function.
7692 The
7693 .B Builder
7694 function accepts the following arguments:
7695
7696 .IP action
7697 The command line string used to build the target from the source. 
7698 .B action
7699 can also be:
7700 a list of strings representing the command
7701 to be executed and its arguments
7702 (suitable for enclosing white space in an argument),
7703 a dictionary
7704 mapping source file name suffixes to
7705 any combination of command line strings
7706 (if the builder should accept multiple source file extensions),
7707 a Python function;
7708 an Action object
7709 (see the next section);
7710 or a list of any of the above.
7711
7712 An action function
7713 takes three arguments:
7714 .I source 
7715 - a list of source nodes, 
7716 .I target
7717 - a list of target nodes,
7718 .I env
7719 - the construction environment.
7720
7721 .IP prefix 
7722 The prefix that will be prepended to the target file name.
7723 This may be specified as a:
7724
7725 .RS 10
7726 .HP 6
7727
7728 .IR string ,
7729
7730 .HP 6
7731
7732 .I callable object
7733 - a function or other callable that takes
7734 two arguments (a construction environment and a list of sources)
7735 and returns a prefix,
7736
7737 .HP 6
7738
7739 .I dictionary
7740 - specifies a mapping from a specific source suffix (of the first 
7741 source specified) to a corresponding target prefix.  Both the source
7742 suffix and target prefix specifications may use environment variable
7743 substitution, and the target prefix (the 'value' entries in the
7744 dictionary) may also be a callable object.  The default target prefix
7745 may be indicated by a dictionary entry with a key value of None.
7746 .RE
7747 .P
7748
7749 .ES
7750 b = Builder("build_it < $SOURCE > $TARGET"
7751             prefix = "file-")
7752
7753 def gen_prefix(env, sources):
7754     return "file-" + env['PLATFORM'] + '-'
7755 b = Builder("build_it < $SOURCE > $TARGET",
7756             prefix = gen_prefix)
7757
7758 b = Builder("build_it < $SOURCE > $TARGET",
7759             suffix = { None: "file-",
7760                        "$SRC_SFX_A": gen_prefix })
7761 .EE
7762
7763 .IP suffix
7764 The suffix that will be appended to the target file name.
7765 This may be specified in the same manner as the prefix above.
7766 If the suffix is a string, then
7767 .B scons
7768 will append a '.' to the beginning of the suffix if it's not already
7769 there.  The string returned by callable object (or obtained from the
7770 dictionary) is untouched and must append its own '.'  to the beginning
7771 if one is desired.
7772
7773 .ES
7774 b = Builder("build_it < $SOURCE > $TARGET"
7775             suffix = "-file")
7776
7777 def gen_suffix(env, sources):
7778     return "." + env['PLATFORM'] + "-file"
7779 b = Builder("build_it < $SOURCE > $TARGET",
7780             suffix = gen_suffix)
7781
7782 b = Builder("build_it < $SOURCE > $TARGET",
7783             suffix = { None: ".sfx1",
7784                        "$SRC_SFX_A": gen_suffix })
7785 .EE
7786
7787 .IP src_suffix
7788 The expected source file name suffix.  This may be a string or a list
7789 of strings.
7790
7791 .IP target_scanner
7792 A Scanner object that
7793 will be invoked to find
7794 implicit dependencies for this target file.
7795 This keyword argument should be used
7796 for Scanner objects that find
7797 implicit dependencies
7798 based only on the target file
7799 and the construction environment,
7800 .I not 
7801 for implicit
7802 (See the section "Scanner Objects," below,
7803 for information about creating Scanner objects.)
7804
7805 .IP source_scanner
7806 A Scanner object that
7807 will be invoked to
7808 find implicit dependences in
7809 any source files
7810 used to build this target file.
7811 This is where you would
7812 specify a scanner to
7813 find things like
7814 .B #include
7815 lines in source files.
7816 (See the section "Scanner Objects," below,
7817 for information about creating Scanner objects.)
7818
7819 .IP target_factory
7820 A factory function that the Builder will use
7821 to turn any targets specified as strings into SCons Nodes.
7822 By default,
7823 SCons assumes that all targets are files.
7824 Other useful target_factory
7825 values include
7826 .BR Dir ,
7827 for when a Builder creates a directory target,
7828 and
7829 .BR Entry ,
7830 for when a Builder can create either a file
7831 or directory target.
7832
7833 Example:
7834
7835 .ES
7836 MakeDirectoryBuilder = Builder(action=my_mkdir, target_factory=Dir)
7837 env = Environment()
7838 env.Append(BUILDERS = {'MakeDirectory':MakeDirectoryBuilder})
7839 env.MakeDirectory('new_directory', [])
7840 .EE
7841
7842 .IP source_factory
7843 A factory function that the Builder will use
7844 to turn any sources specified as strings into SCons Nodes.
7845 By default,
7846 SCons assumes that all source are files.
7847 Other useful source_factory
7848 values include
7849 .BR Dir ,
7850 for when a Builder uses a directory as a source,
7851 and
7852 .BR Entry ,
7853 for when a Builder can use files
7854 or directories (or both) as sources.
7855
7856 Example:
7857
7858 .ES
7859 CollectBuilder = Builder(action=my_mkdir, source_factory=Entry)
7860 env = Environment()
7861 env.Append(BUILDERS = {'Collect':CollectBuilder})
7862 env.Collect('archive', ['directory_name', 'file_name'])
7863 .EE
7864
7865 .IP emitter
7866 A function or list of functions to manipulate the target and source
7867 lists before dependencies are established
7868 and the target(s) are actually built.
7869 .B emitter
7870 can also be a string containing a construction variable to expand
7871 to an emitter function or list of functions,
7872 or a dictionary mapping source file suffixes
7873 to emitter functions.
7874 (Only the suffix of the first source file
7875 is used to select the actual emitter function
7876 from an emitter dictionary.)
7877
7878 An emitter function
7879 takes three arguments:
7880 .I source 
7881 - a list of source nodes, 
7882 .I target
7883 - a list of target nodes,
7884 .I env
7885 - the construction environment.
7886 An emitter must return a tuple containing two lists,
7887 the list of targets to be built by this builder,
7888 and the list of sources for this builder.
7889
7890 Example:
7891
7892 .ES
7893 def e(target, source, env):
7894     return (target + ['foo.foo'], source + ['foo.src'])
7895
7896 # Simple association of an emitter function with a Builder.
7897 b = Builder("my_build < $TARGET > $SOURCE",
7898             emitter = e)
7899
7900 def e2(target, source, env):
7901     return (target + ['bar.foo'], source + ['bar.src'])
7902
7903 # Simple association of a list of emitter functions with a Builder.
7904 b = Builder("my_build < $TARGET > $SOURCE",
7905             emitter = [e, e2])
7906
7907 # Calling an emitter function through a construction variable.
7908 env = Environment(MY_EMITTER = e)
7909 b = Builder("my_build < $TARGET > $SOURCE",
7910             emitter = '$MY_EMITTER')
7911
7912 # Calling a list of emitter functions through a construction variable.
7913 env = Environment(EMITTER_LIST = [e, e2])
7914 b = Builder("my_build < $TARGET > $SOURCE",
7915             emitter = '$EMITTER_LIST')
7916
7917 # Associating multiple emitters with different file
7918 # suffixes using a dictionary.
7919 def e_suf1(target, source, env):
7920     return (target + ['another_target_file'], source)
7921 def e_suf2(target, source, env):
7922     return (target, source + ['another_source_file'])
7923 b = Builder("my_build < $TARGET > $SOURCE",
7924             emitter = {'.suf1' : e_suf1,
7925                        '.suf2' : e_suf2})
7926 .EE
7927 .IP
7928 The 
7929 .I generator
7930 and
7931 .I action
7932 arguments must not both be used for the same Builder.
7933
7934 .IP multi
7935 Specifies whether this builder is allowed to be called multiple times for
7936 the same target file(s). The default is 0, which means the builder
7937 can not be called multiple times for the same target file(s). Calling a
7938 builder multiple times for the same target simply adds additional source
7939 files to the target; it is not allowed to change the environment associated
7940 with the target, specify addition environment overrides, or associate a different
7941 builder with the target. 
7942
7943 .IP env
7944 A construction environment that can be used
7945 to fetch source code using this Builder.
7946 (Note that this environment is
7947 .I not
7948 used for normal builds of normal target files,
7949 which use the environment that was
7950 used to call the Builder for the target file.)
7951
7952 .IP generator
7953 A function that returns a list of actions that will be executed to build
7954 the target(s) from the source(s).
7955 The returned action(s) may be
7956 an Action object, or anything that
7957 can be converted into an Action object
7958 (see the next section).
7959
7960 The generator function
7961 takes four arguments:
7962 .I source 
7963 - a list of source nodes, 
7964 .I target
7965 - a list of target nodes,
7966 .I env
7967 - the construction environment,
7968 .I for_signature
7969 - a Boolean value that specifies
7970 whether the generator is being called
7971 for generating a build signature
7972 (as opposed to actually executing the command).
7973 Example:
7974
7975 .ES
7976 def g(source, target, env, for_signature):
7977     return [["gcc", "-c", "-o"] + target + source] 
7978
7979 b = Builder(generator=g)
7980 .EE
7981
7982 .IP src_builder
7983 Specifies a builder to use when a source file name suffix does not match
7984 any of the suffixes of the builder. Using this argument produces a
7985 multi-stage builder.
7986
7987 .IP single_source
7988 Specifies that this builder expects exactly one source file per call. Giving
7989 more than one source files without target files results in implicitely calling
7990 the builder multiple times (once for each source given). Giving multiple 
7991 source files together with target files results in a UserError exception.
7992
7993 .RE
7994 .IP
7995 The 
7996 .I generator
7997 and
7998 .I action
7999 arguments must not both be used for the same Builder.
8000
8001 .IP env
8002 A construction environment that can be used
8003 to fetch source code using this Builder.
8004 (Note that this environment is
8005 .I not
8006 used for normal builds of normal target files,
8007 which use the environment that was
8008 used to call the Builder for the target file.)
8009
8010 .ES
8011 b = Builder(action="build < $SOURCE > $TARGET")
8012 env = Environment(BUILDERS = {'MyBuild' : b})
8013 env.MyBuild('foo.out', 'foo.in', my_arg = 'xyzzy')
8014 .EE
8015
8016 .IP chdir
8017 A directory from which scons
8018 will execute the
8019 action(s) specified
8020 for this Builder.
8021 If the
8022 .B chdir
8023 argument is
8024 a string or a directory Node,
8025 scons will change to the specified directory.
8026 If the
8027 .B chdir
8028 is not a string or Node
8029 and is non-zero,
8030 then scons will change to the
8031 target file's directory.
8032
8033 Note that scons will
8034 .I not
8035 automatically modify
8036 its expansion of
8037 construction variables like
8038 .B $TARGET
8039 and
8040 .B $SOURCE
8041 when using the chdir
8042 keyword argument--that is,
8043 the expanded file names
8044 will still be relative to
8045 the top-level SConstruct directory,
8046 and consequently incorrect
8047 relative to the chdir directory.
8048 Builders created using chdir keyword argument,
8049 will need to use construction variable
8050 expansions like
8051 .B ${TARGET.file}
8052 and
8053 .B ${SOURCE.file}
8054 to use just the filename portion of the
8055 targets and source.
8056
8057 .ES
8058 b = Builder(action="build < ${SOURCE.file} > ${TARGET.file}",
8059             chdir=1)
8060 env = Environment(BUILDERS = {'MyBuild' : b})
8061 env.MyBuild('sub/dir/foo.out', 'sub/dir/foo.in')
8062 .EE
8063
8064 .RE
8065 Any additional keyword arguments supplied
8066 when a Builder object is created
8067 (that is, when the Builder() function is called)
8068 will be set in the executing construction
8069 environment when the Builder object is called.
8070 The canonical example here would be
8071 to set a construction variable to 
8072 the repository of a source code system.
8073
8074 Any additional keyword arguments supplied
8075 when a Builder
8076 .I object
8077 is called
8078 will only be associated with the target
8079 created by that particular Builder call
8080 (and any other files built as a
8081 result of the call).
8082
8083 These extra keyword arguments are passed to the
8084 following functions:
8085 command generator functions,
8086 function Actions,
8087 and emitter functions.
8088
8089 .SS Action Objects
8090
8091 The
8092 .BR Builder()
8093 function will turn its
8094 .B action
8095 keyword argument into an appropriate
8096 internal Action object.
8097 You can also explicity create Action objects
8098 using the
8099 .BR Action ()
8100 global function,
8101 which can then be passed to the
8102 .BR Builder ()
8103 function.
8104 This can be used to configure
8105 an Action object more flexibly,
8106 or it may simply be more efficient
8107 than letting each separate Builder object
8108 create a separate Action
8109 when multiple
8110 Builder objects need to do the same thing.
8111
8112 The
8113 .BR Action ()
8114 global function
8115 returns an appropriate object for the action
8116 represented by the type of the first argument:
8117
8118 .IP Action
8119 If the first argument is already an Action object,
8120 the object is simply returned.
8121
8122 .IP String
8123 If the first argument is a string,
8124 a command-line Action is returned.
8125
8126 .ES
8127 Action('$CC -c -o $TARGET $SOURCES')
8128 .EE
8129
8130 .\" XXX From Gary Ruben, 23 April 2002:
8131 .\" What would be useful is a discussion of how you execute command
8132 .\" shell commands ie. what is the process used to spawn the shell, pass
8133 .\" environment variables to it etc., whether there is one shell per
8134 .\" environment or one per command etc.  It might help to look at the Gnu
8135 .\" make documentation to see what they think is important to discuss about
8136 .\" a build system. I'm sure you can do a better job of organising the
8137 .\" documentation than they have :-)
8138
8139
8140 .IP List
8141 If the first argument is a list,
8142 then a list of Action objects is returned.
8143 An Action object is created as necessary
8144 for each element in the list.
8145 If an element
8146 .I within
8147 the list is itself a list,
8148 the internal list is the
8149 command and arguments to be executed via
8150 the command line.
8151 This allows white space to be enclosed
8152 in an argument by defining
8153 a command in a list within a list:
8154
8155 .ES
8156 Action([['cc', '-c', '-DWHITE SPACE', '-o', '$TARGET', '$SOURCES']])
8157 .EE
8158
8159 .IP Function
8160 If the first argument is a Python function,
8161 a function Action is returned.
8162 The Python function takes three keyword arguments,
8163 .B target
8164 (a Node object representing the target file),
8165 .B source
8166 (a Node object representing the source file)
8167 and
8168 .B env
8169 (the construction environment
8170 used for building the target file).
8171 The
8172 .B target
8173 and
8174 .B source
8175 arguments may be lists of Node objects if there is
8176 more than one target file or source file.
8177 The actual target and source file name(s) may
8178 be retrieved from their Node objects
8179 via the built-in Python str() function:
8180
8181 .ES
8182 target_file_name = str(target)
8183 source_file_names = map(lambda x: str(x), source)
8184 .EE
8185 .IP
8186 The function should return
8187 .B 0
8188 or
8189 .B None
8190 to indicate a successful build of the target file(s).
8191 The function may raise an exception
8192 or return a non-zero exit status
8193 to indicate an unsuccessful build.
8194
8195 .ES
8196 def build_it(target = None, source = None, env = None):
8197     # build the target from the source
8198     return 0
8199  
8200 a = Action(build_it)
8201 .EE
8202
8203 If the action argument is not one of the above,
8204 None is returned.
8205
8206 The second, optional argument
8207 is a Python function that returns
8208 a string to be printed to describe the action being executed.
8209 Like a function to build a file,
8210 this function takes three arguments:
8211 .B target
8212 (a Node object representing the target file),
8213 .B source
8214 (a Node object representing the source file)
8215 and
8216 .BR env
8217 (a construction environment).
8218 The
8219 .B target
8220 and
8221 .B source
8222 arguments may be lists of Node objects if there is
8223 more than one target file or source file.
8224 Examples:
8225
8226 .ES
8227 def build_it(target, source, env):
8228     # build the target from the source
8229     return 0
8230
8231 def string_it(target, source, env):
8232     return "building '%s' from '%s'" % (target[0], source[0])
8233
8234 # Use a positional argument.
8235 a = Action(build_it, string_it)
8236
8237 # Alternatively, use a keyword argument.
8238 a = Action(build_it, strfunction=string_it)
8239 .EE
8240
8241 The third, also optional argument
8242 is a list of construction variables
8243 whose values will be included
8244 in the signature of the Action
8245 when deciding whether a target should
8246 be rebuilt because the action changed.
8247 This is necessary whenever you want a target to
8248 be rebuilt when a specific
8249 construction variable changes,
8250 because the underlying Python code for a function
8251 will not change when the value of the construction variable does.
8252
8253 .ES
8254 def build_it(target, source, env):
8255     # build the target from the 'XXX' construction variable
8256     open(target[0], 'w').write(env['XXX'])
8257     return 0
8258
8259 def string_it(target, source):
8260     return "building '%s' from '%s'" % (target[0], source[0])
8261
8262 # Use positional arguments.
8263 a = Action(build_it, string_it, ['XXX'])
8264
8265 # Alternatively, use a keyword argument.
8266 a = Action(build_it, varlist=['XXX'])
8267 .EE
8268 .PP
8269
8270 The
8271 .BR Action ()
8272 global function
8273 also takes a
8274 .B chdir
8275 keyword argument
8276 which specifies that
8277 scons will execute the action
8278 after changing to the specified directory.
8279 If the chdir argument is
8280 a string or a directory Node,
8281 scons will change to the specified directory.
8282 If the chdir argument
8283 is not a string or Node
8284 and is non-zero,
8285 then scons will change to the
8286 target file's directory.
8287
8288 Note that scons will
8289 .I not
8290 automatically modify
8291 its expansion of
8292 construction variables like
8293 .B $TARGET
8294 and
8295 .B $SOURCE
8296 when using the chdir
8297 keyword argument--that is,
8298 the expanded file names
8299 will still be relative to
8300 the top-level SConstruct directory,
8301 and consequently incorrect
8302 relative to the chdir directory.
8303 Builders created using chdir keyword argument,
8304 will need to use construction variable
8305 expansions like
8306 .B ${TARGET.file}
8307 and
8308 .B ${SOURCE.file}
8309 to use just the filename portion of the
8310 targets and source.
8311
8312 .ES
8313 a = Action("build < ${SOURCE.file} > ${TARGET.file}",
8314            chdir=1)
8315 .EE
8316
8317 .SS Miscellaneous Action Functions
8318
8319 .B scons
8320 supplies a number of functions
8321 that arrange for various common
8322 file and directory manipulations
8323 to be performed.
8324 These are similar in concept to "tasks" in the 
8325 Ant build tool,
8326 although the implementation is slightly different.
8327 These functions do not actually
8328 perform the specified action
8329 at the time the function is called,
8330 but instead return an Action object
8331 that can be executed at the
8332 appropriate time.
8333 (In Object-Oriented terminology,
8334 these are actually
8335 Action
8336 .I Factory
8337 functions
8338 that return Action objects.)
8339
8340 In practice,
8341 there are two natural ways
8342 that these
8343 Action Functions
8344 are intended to be used.
8345
8346 First,
8347 if you need
8348 to perform the action
8349 at the time the SConscript
8350 file is being read,
8351 you can use the
8352 .B Execute
8353 global function to do so:
8354 .ES
8355 Execute(Touch('file'))
8356 .EE
8357
8358 Second,
8359 you can use these functions
8360 to supply Actions in a list
8361 for use by the
8362 .B Command
8363 method.
8364 This can allow you to
8365 perform more complicated
8366 sequences of file manipulation
8367 without relying
8368 on platform-specific
8369 external commands:
8370 that 
8371 .ES
8372 env = Environment(TMPBUILD = '/tmp/builddir')
8373 env.Command('foo.out', 'foo.in',
8374             [Mkdir('$TMPBUILD'),
8375              Copy('${SOURCE.dir}', '$TMPBUILD')
8376              "cd $TMPBUILD && make",
8377              Delete('$TMPBUILD')])
8378 .EE
8379
8380 .TP
8381 .RI Chmod( dest ", " mode )
8382 Returns an Action object that
8383 changes the permissions on the specified
8384 .I dest
8385 file or directory to the specified
8386 .IR mode .
8387 Examples:
8388
8389 .ES
8390 Execute(Chmod('file', 0755))
8391
8392 env.Command('foo.out', 'foo.in',
8393             [Copy('$TARGET', '$SOURCE'),
8394              Chmod('$TARGET', 0755)])
8395 .EE
8396
8397 .TP
8398 .RI Copy( dest ", " src )
8399 Returns an Action object
8400 that will copy the
8401 .I src
8402 source file or directory to the
8403 .I dest
8404 destination file or directory.
8405 Examples:
8406
8407 .ES
8408 Execute(Copy('foo.output', 'foo.input'))
8409
8410 env.Command('bar.out', 'bar.in',
8411             Copy('$TARGET', '$SOURCE'))
8412 .EE
8413
8414 .TP
8415 .RI Delete( entry ", [" must_exist ])
8416 Returns an Action that
8417 deletes the specified
8418 .IR entry ,
8419 which may be a file or a directory tree.
8420 If a directory is specified,
8421 the entire directory tree
8422 will be removed.
8423 If the
8424 .I must_exist
8425 flag is set,
8426 then a Python error will be thrown
8427 if the specified entry does not exist;
8428 the default is
8429 .BR must_exist=0 ,
8430 that is, the Action will silently do nothing
8431 if the entry does not exist.
8432 Examples:
8433
8434 .ES
8435 Execute(Delete('/tmp/buildroot'))
8436
8437 env.Command('foo.out', 'foo.in',
8438             [Delete('${TARGET.dir}'),
8439              MyBuildAction])
8440
8441 Execute(Delete('file_that_must_exist', must_exist=1))
8442 .EE
8443
8444 .TP
8445 .RI Mkdir( dir )
8446 Returns an Action
8447 that creates the specified
8448 directory
8449 .I dir .
8450 Examples:
8451
8452 .ES
8453 Execute(Mkdir('/tmp/outputdir'))
8454
8455 env.Command('foo.out', 'foo.in',
8456             [Mkdir('/tmp/builddir',
8457              Copy('$SOURCE', '/tmp/builddir')
8458              "cd /tmp/builddir && ])
8459
8460 .EE
8461
8462 .TP
8463 .RI Move( dest ", " src )
8464 Returns an Action
8465 that moves the specified
8466 .I src
8467 file or directory to
8468 the specified
8469 .I dest
8470 file or directory.
8471 Examples:
8472
8473 .ES
8474 Execute(Move('file.destination', 'file.source'))
8475
8476 env.Command('output_file', 'input_file',
8477             [MyBuildAction,
8478              Move('$TARGET', 'file_created_by_MyBuildAction')])
8479 .EE
8480
8481 .TP
8482 .RI Touch( file )
8483 Returns an Action
8484 that updates the modification time
8485 on the specified
8486 .IR file .
8487 Examples:
8488
8489 .ES
8490 Execute(Touch('file_to_be_touched'))
8491
8492 env.Command('marker', 'input_file',
8493             [MyBuildAction,
8494              Touch('$TARGET')])
8495 .EE
8496
8497 .SS Variable Substitution
8498
8499 Before executing a command,
8500 .B scons
8501 performs construction variable interpolation on the strings that make up
8502 the command line of builders.
8503 Variables are introduced by a
8504 .B $
8505 prefix.
8506 Besides construction variables, scons provides the following
8507 variables for each command execution:
8508
8509 .IP TARGET
8510 The file name of the target being built, or the file name of the first 
8511 target if multiple targets are being built.
8512
8513 .IP TARGETS
8514 The file names of all targets being built.
8515
8516 .IP SOURCE
8517 The file name of the source of the build command, or the file name of the
8518 first source if multiple sources are being built.
8519
8520 .IP SOURCES
8521 The file names of the sources of the build command.
8522
8523 (Note that the above variables are reserved
8524 and may not be set in a construction environment.)
8525
8526 .LP 
8527 For example, given the construction variable CC='cc', targets=['foo'], and
8528 sources=['foo.c', 'bar.c']:
8529
8530 .ES
8531 action='$CC -c -o $TARGET $SOURCES'
8532 .EE
8533
8534 would produce the command line:
8535
8536 .ES
8537 cc -c -o foo foo.c bar.c
8538 .EE
8539
8540 Variable names may be surrounded by curly braces ({})
8541 to separate the name from the trailing characters.
8542 Within the curly braces, a variable name may have
8543 a Python slice subscript appended to select one
8544 or more items from a list.
8545 In the previous example, the string:
8546
8547 .ES
8548 ${SOURCES[1]}
8549 .EE
8550
8551 would produce:
8552
8553 .ES
8554 bar.c
8555 .EE
8556
8557 Additionally, a variable name may
8558 have the following special
8559 modifiers appended within the enclosing curly braces
8560 to modify the interpolated string:
8561
8562 .IP base
8563 The base path of the file name,
8564 including the directory path
8565 but excluding any suffix.
8566
8567 .IP dir
8568 The name of the directory in which the file exists.
8569
8570 .IP file
8571 The file name,
8572 minus any directory portion.
8573
8574 .IP filebase
8575 Just the basename of the file,
8576 minus any suffix
8577 and minus the directory.
8578
8579 .IP suffix
8580 Just the file suffix.
8581
8582 .IP abspath
8583 The absolute path name of the file.
8584
8585 .IP posix
8586 The POSIX form of the path,
8587 with directories separated by
8588 .B /
8589 (forward slashes)
8590 not backslashes.
8591 This is sometimes necessary on Win32 systems
8592 when a path references a file on other (POSIX) systems.
8593
8594 .IP srcpath
8595 The directory and file name to the source file linked to this file
8596 through BuildDir.  If this file isn't linked, it just returns the
8597 directory and filename unchanged.
8598
8599 .IP srcdir
8600 The directory containing the source file linked to this file
8601 through BuildDir.  If this file isn't linked, it just returns the
8602 directory part of the filename.
8603
8604 .IP rsrcpath
8605 The directory and file name to the source file linked to this file
8606 through BuildDir.  If the file does not exist locally but exists in
8607 a Repository, the path in the Repository is returned.
8608 If this file isn't linked, it just returns the
8609 directory and filename unchanged.
8610
8611 .IP rsrcdir
8612 The Repository directory containing the source file linked to this file
8613 through BuildDir.  If this file isn't linked, it just returns the
8614 directory part of the filename.
8615
8616 .LP
8617 For example, the specified target will
8618 expand as follows for the corresponding modifiers:
8619
8620 .ES
8621 $TARGET              => sub/dir/file.x
8622 ${TARGET.base}       => sub/dir/file
8623 ${TARGET.dir}        => sub/dir
8624 ${TARGET.file}       => file.x
8625 ${TARGET.filebase}   => file
8626 ${TARGET.suffix}     => .x
8627 ${TARGET.abspath}    => /top/dir/sub/dir/file.x
8628
8629 BuildDir('sub/dir','src')
8630 $SOURCE              => sub/dir/file.x
8631 ${SOURCE.srcpath}    => src/file.x
8632 ${SOURCE.srcdir}     => src
8633
8634 Repository('/usr/repository')
8635 $SOURCE              => sub/dir/file.x
8636 ${SOURCE.rsrcpath}   => /usr/repository/src/file.x
8637 ${SOURCE.rsrcdir}    => /usr/repository/src
8638 .EE
8639
8640 Lastly, a variable name
8641 may be a callable Python function
8642 associated with a
8643 construction variable in the environment.
8644 The function should
8645 take four arguments:
8646 .I target
8647 - a list of target nodes,
8648 .I source 
8649 - a list of source nodes, 
8650 .I env
8651 - the construction environment,
8652 .I for_signature
8653 - a Boolean value that specifies
8654 whether the function is being called
8655 for generating a build signature.
8656 SCons will insert whatever
8657 the called function returns
8658 into the expanded string:
8659
8660 .ES
8661 def foo(target, source, env, for_signature):
8662     return "bar"
8663
8664 # Will expand $BAR to "bar baz"
8665 env=Environment(FOO=foo, BAR="$FOO baz")
8666 .EE
8667
8668 You can use this feature to pass arguments to a
8669 Python function by creating a callable class
8670 that stores one or more arguments in an object,
8671 and then uses them when the
8672 .B __call__()
8673 method is called.
8674 Note that in this case,
8675 the entire variable expansion must
8676 be enclosed by curly braces
8677 so that the arguments will
8678 be associated with the
8679 instantiation of the class:
8680
8681 .ES
8682 class foo:
8683     def __init__(self, arg):
8684         self.arg = arg
8685
8686     def __call__(self, target, source, env, for_signature):
8687         return arg + " bar"
8688
8689 # Will expand $BAR to "my argument bar baz"
8690 env=Environment(FOO=foo, BAR="${FOO('my argument')} baz")
8691 .EE
8692
8693 .LP
8694 The special pseudo-variables
8695 .B "$("
8696 and
8697 .B "$)"
8698 may be used to surround parts of a command line
8699 that may change
8700 .I without
8701 causing a rebuild--that is,
8702 which are not included in the signature
8703 of target files built with this command.
8704 All text between
8705 .B "$("
8706 and
8707 .B "$)"
8708 will be removed from the command line
8709 before it is added to file signatures,
8710 and the
8711 .B "$("
8712 and
8713 .B "$)"
8714 will be removed before the command is executed.
8715 For example, the command line:
8716
8717 .ES
8718 echo Last build occurred $( $TODAY $). > $TARGET
8719 .EE
8720
8721 .LP
8722 would execute the command:
8723
8724 .ES
8725 echo Last build occurred $TODAY. > $TARGET
8726 .EE
8727
8728 .LP
8729 but the command signature added to any target files would be:
8730
8731 .ES
8732 echo Last build occurred  . > $TARGET
8733 .EE
8734
8735 SCons uses the following rules when converting construction variables into
8736 command lines:
8737
8738 .IP String
8739 When the value is a string it is interpreted as a space delimited list of
8740 command line arguments. 
8741
8742 .IP List
8743 When the value is a list it is interpreted as a list of command line
8744 arguments. Each element of the list is converted to a string.
8745
8746 .IP Other
8747 Anything that is not a list or string is converted to a string and
8748 interpreted as a single command line argument.
8749
8750 .IP Newline
8751 Newline characters (\\n) delimit lines. The newline parsing is done after
8752 all other parsing, so it is not possible for arguments (e.g. file names) to
8753 contain embedded newline characters. This limitation will likely go away in
8754 a future version of SCons.
8755
8756 .SS Scanner Objects
8757
8758 You can use the
8759 .B Scanner
8760 function to define
8761 objects to scan
8762 new file types for implicit dependencies.
8763 Scanner accepts the following arguments:
8764
8765 .IP function
8766 A Python function that will process
8767 the Node (file)
8768 and return a list of strings (file names)
8769 representing the implicit
8770 dependencies found in the contents.
8771 The function takes three or four arguments:
8772
8773     def scanner_function(node, env, path):
8774
8775     def scanner_function(node, env, path, arg):
8776
8777 The
8778 .B node
8779 argument is the internal
8780 SCons node representing the file.
8781 Use
8782 .B str(node)
8783 to fetch the name of the file, and
8784 .B node.get_contents()
8785 to fetch contents of the file.
8786
8787 The
8788 .B env
8789 argument is the construction environment for the scan.
8790 Fetch values from it using the
8791 .B env.Dictionary()
8792 method.
8793
8794 The
8795 .B path
8796 argument is a tuple (or list)
8797 of directories that can be searched
8798 for files.
8799 This will usually be the tuple returned by the
8800 .B path_function
8801 argument (see below).
8802
8803 The
8804 .B arg
8805 argument is the argument supplied
8806 when the scanner was created, if any.
8807
8808 .IP name
8809 The name of the Scanner.
8810 This is mainly used
8811 to identify the Scanner internally.
8812
8813 .IP argument
8814 An optional argument that, if specified,
8815 will be passed to the scanner function
8816 (described above)
8817 and the path function
8818 (specified below).
8819
8820 .IP skeys
8821 An optional list that can be used to
8822 determine which scanner should be used for
8823 a given Node.
8824 In the usual case of scanning for file names,
8825 this argument will be a list of suffixes
8826 for the different file types that this
8827 Scanner knows how to scan.
8828 If the argument is a string,
8829 then it will be expanded 
8830 into a list by the current environment.
8831
8832 .IP path_function
8833 A Python function that takes
8834 two or three arguments:
8835 a construction environment, directory Node,
8836 and optional argument supplied
8837 when the scanner was created.
8838 The
8839 .B path_function
8840 returns a tuple of directories
8841 that can be searched for files to be returned
8842 by this Scanner object.
8843
8844 .IP node_class
8845 The class of Node that should be returned
8846 by this Scanner object.
8847 Any strings or other objects returned
8848 by the scanner function
8849 that are not of this class
8850 will be run through the
8851 .B node_factory
8852 function.
8853
8854 .IP node_factory
8855 A Python function that will take a string
8856 or other object
8857 and turn it into the appropriate class of Node
8858 to be returned by this Scanner object.
8859
8860 .IP scan_check
8861 An optional Python function that takes two arguments,
8862 a Node (file) and a construction environment,
8863 and returns whether the
8864 Node should, in fact,
8865 be scanned for dependencies.
8866 This check can be used to eliminate unnecessary
8867 calls to the scanner function when,
8868 for example, the underlying file
8869 represented by a Node does not yet exist.
8870
8871 .IP recursive
8872 An optional flag that
8873 specifies whether this scanner should be re-invoked
8874 on the dependency files returned by the scanner.
8875 When this flag is not set,
8876 the Node subsystem will
8877 only invoke the scanner on the file being scanned,
8878 and not (for example) also on the files
8879 specified by the #include lines
8880 in the file being scanned.
8881
8882 .SH SYSTEM-SPECIFIC BEHAVIOR
8883 SCons and its configuration files are very portable,
8884 due largely to its implementation in Python.
8885 There are, however, a few portability
8886 issues waiting to trap the unwary.
8887 .SS .C file suffix
8888 SCons handles the upper-case
8889 .B .C
8890 file suffix differently,
8891 depending on the capabilities of
8892 the underlying system.
8893 On a case-sensitive system
8894 such as Linux or UNIX,
8895 SCons treats a file with a 
8896 .B .C
8897 suffix as a C++ source file.
8898 On a case-insensitive system
8899 such as Windows,
8900 SCons treats a file with a 
8901 .B .C
8902 suffix as a C source file.
8903 .SS .F file suffix
8904 SCons handles the upper-case
8905 .B .F
8906 file suffix differently,
8907 depending on the capabilities of
8908 the underlying system.
8909 On a case-sensitive system
8910 such as Linux or UNIX,
8911 SCons treats a file with a 
8912 .B .F
8913 suffix as a Fortran source file
8914 that is to be first run through
8915 the standard C preprocessor.
8916 On a case-insensitive system
8917 such as Windows,
8918 SCons treats a file with a 
8919 .B .F
8920 suffix as a Fortran source file that should
8921 .I not
8922 be run through the C preprocessor.
8923 .SS WIN32:  Cygwin Tools and Cygwin Python vs. Windows Pythons
8924 Cygwin supplies a set of tools and utilities
8925 that let users work on a
8926 Windows system using a more POSIX-like environment.
8927 The Cygwin tools, including Cygwin Python,
8928 do this, in part,
8929 by sharing an ability to interpret UNIX-like path names.
8930 For example, the Cygwin tools
8931 will internally translate a Cygwin path name
8932 like /cygdrive/c/mydir
8933 to an equivalent Windows pathname
8934 of C:/mydir (equivalent to C:\\mydir).
8935
8936 Versions of Python
8937 that are built for native Windows execution,
8938 such as the python.org and ActiveState versions,
8939 do not have the Cygwin path name semantics.
8940 This means that using a native Windows version of Python
8941 to build compiled programs using Cygwin tools
8942 (such as gcc, bison, and flex)
8943 may yield unpredictable results.
8944 "Mixing and matching" in this way
8945 can be made to work,
8946 but it requires careful attention to the use of path names
8947 in your SConscript files.
8948
8949 In practice, users can sidestep
8950 the issue by adopting the following rules:
8951 When using gcc,
8952 use the Cygwin-supplied Python interpreter
8953 to run SCons;
8954 when using Microsoft Visual C/C++
8955 (or some other Windows compiler)
8956 use the python.org or ActiveState version of Python
8957 to run SCons.
8958 .SS WIN32:  scons.bat file
8959 On WIN32 systems,
8960 SCons is executed via a wrapper
8961 .B scons.bat
8962 file.
8963 This has (at least) two ramifications:
8964
8965 First, Windows command-line users
8966 that want to use variable assignment
8967 on the command line
8968 may have to put double quotes
8969 around the assignments:
8970
8971 .ES
8972 scons "FOO=BAR" "BAZ=BLEH"
8973 .EE
8974
8975 Second, the Cygwin shell does not
8976 recognize this file as being the same
8977 as an
8978 .B scons
8979 command issued at the command-line prompt.
8980 You can work around this either by
8981 executing
8982 .B scons.bat
8983 from the Cygwin command line,
8984 or by creating a wrapper shell
8985 script named
8986 .B scons .
8987
8988 .SS MinGW
8989
8990 The MinGW bin directory must be in your PATH environment variable or the
8991 PATH variable under the ENV construction variable for SCons
8992 to detect and use the MinGW tools. When running under the native Windows
8993 Python interpreter, SCons will prefer the MinGW tools over the Cygwin
8994 tools, if they are both installed, regardless of the order of the bin
8995 directories in the PATH variable. If you have both MSVC and MinGW
8996 installed and you want to use MinGW instead of MSVC,
8997 then you must explictly tell SCons to use MinGW by passing 
8998
8999 .ES
9000 tools=['mingw']
9001 .EE
9002
9003 to the Environment() function, because SCons will prefer the MSVC tools
9004 over the MinGW tools.
9005
9006 .SH EXAMPLES
9007
9008 To help you get started using SCons,
9009 this section contains a brief overview of some common tasks.
9010
9011 .SS Basic Compilation From a Single Source File
9012
9013 .ES
9014 env = Environment()
9015 env.Program(target = 'foo', source = 'foo.c')
9016 .EE
9017
9018 Note:  Build the file by specifying
9019 the target as an argument
9020 ("scons foo" or "scons foo.exe").
9021 or by specifying a dot ("scons .").
9022
9023 .SS Basic Compilation From Multiple Source Files
9024
9025 .ES
9026 env = Environment()
9027 env.Program(target = 'foo', source = Split('f1.c f2.c f3.c'))
9028 .EE
9029
9030 .SS Setting a Compilation Flag
9031
9032 .ES
9033 env = Environment(CCFLAGS = '-g')
9034 env.Program(target = 'foo', source = 'foo.c')
9035 .EE
9036
9037 .SS Search The Local Directory For .h Files
9038
9039 Note:  You do
9040 .I not
9041 need to set CCFLAGS to specify -I options by hand.
9042 SCons will construct the right -I options from CPPPATH.
9043
9044 .ES
9045 env = Environment(CPPPATH = ['.'])
9046 env.Program(target = 'foo', source = 'foo.c')
9047 .EE
9048
9049 .SS Search Multiple Directories For .h Files
9050
9051 .ES
9052 env = Environment(CPPPATH = ['include1', 'include2'])
9053 env.Program(target = 'foo', source = 'foo.c')
9054 .EE
9055
9056 .SS Building a Static Library
9057
9058 .ES
9059 env = Environment()
9060 env.StaticLibrary(target = 'foo', source = Split('l1.c l2.c'))
9061 env.StaticLibrary(target = 'bar', source = ['l3.c', 'l4.c'])
9062 .EE
9063
9064 .SS Building a Shared Library
9065
9066 .ES
9067 env = Environment()
9068 env.SharedLibrary(target = 'foo', source = ['l5.c', 'l6.c'])
9069 env.SharedLibrary(target = 'bar', source = Split('l7.c l8.c'))
9070 .EE
9071
9072 .SS Linking a Local Library Into a Program
9073
9074 .ES
9075 env = Environment(LIBS = 'mylib', LIBPATH = ['.'])
9076 env.Library(target = 'mylib', source = Split('l1.c l2.c'))
9077 env.Program(target = 'prog', source = ['p1.c', 'p2.c'])
9078 .EE
9079
9080 .SS Defining Your Own Builder Object
9081
9082 Notice that when you invoke the Builder,
9083 you can leave off the target file suffix,
9084 and SCons will add it automatically.
9085
9086 .ES
9087 bld = Builder(action = 'pdftex < $SOURCES > $TARGET'
9088               suffix = '.pdf',
9089               src_suffix = '.tex')
9090 env = Environment(BUILDERS = {'PDFBuilder' : bld})
9091 env.PDFBuilder(target = 'foo.pdf', source = 'foo.tex')
9092
9093 # The following creates "bar.pdf" from "bar.tex"
9094 env.PDFBuilder(target = 'bar', source = 'bar')
9095 .EE
9096
9097 Note also that the above initialization
9098 overwrites the default Builder objects,
9099 so the Environment created above
9100 can not be used call Builders like env.Program(),
9101 env.Object(), env.StaticLibrary(), etc.
9102
9103 .SS Adding Your Own Builder Object to an Environment
9104
9105 .ES
9106 bld = Builder(action = 'pdftex < $SOURCES > $TARGET'
9107               suffix = '.pdf',
9108               src_suffix = '.tex')
9109 env = Environment()
9110 env.Append(BUILDERS = {'PDFBuilder' : bld})
9111 env.PDFBuilder(target = 'foo.pdf', source = 'foo.tex')
9112 env.Program(target = 'bar', source = 'bar.c')
9113 .EE
9114
9115 You also can use other Pythonic techniques to add
9116 to the BUILDERS construction variable, such as:
9117
9118 .ES
9119 env = Environment()
9120 env['BUILDERS]['PDFBuilder'] = bld
9121 .EE
9122
9123 .SS Defining Your Own Scanner Object
9124
9125 .ES
9126 import re
9127
9128 include_re = re.compile(r'^include\\s+(\\S+)$', re.M)
9129
9130 def kfile_scan(node, env, path, arg):
9131     contents = node.get_contents()
9132     includes = include_re.findall(contents)
9133     return includes
9134
9135 kscan = Scanner(name = 'kfile',
9136                 function = kfile_scan,
9137                 argument = None,
9138                 skeys = ['.k'])
9139 scanners = Environment().Dictionary('SCANNERS')
9140 env = Environment(SCANNERS = scanners + [kscan])
9141
9142 env.Command('foo', 'foo.k', 'kprocess < $SOURCES > $TARGET')
9143
9144 bar_in = File('bar.in')
9145 env.Command('bar', bar_in, 'kprocess $SOURCES > $TARGET')
9146 bar_in.target_scanner = kscan
9147 .EE
9148
9149 .SS Creating a Hierarchical Build
9150
9151 Notice that the file names specified in a subdirectory's
9152 SConscript
9153 file are relative to that subdirectory.
9154
9155 .ES
9156 SConstruct:
9157
9158     env = Environment()
9159     env.Program(target = 'foo', source = 'foo.c')
9160
9161     SConscript('sub/SConscript')
9162
9163 sub/SConscript:
9164
9165     env = Environment()
9166     # Builds sub/foo from sub/foo.c
9167     env.Program(target = 'foo', source = 'foo.c')
9168
9169     SConscript('dir/SConscript')
9170
9171 sub/dir/SConscript:
9172
9173     env = Environment()
9174     # Builds sub/dir/foo from sub/dir/foo.c
9175     env.Program(target = 'foo', source = 'foo.c')
9176 .EE
9177
9178 .SS Sharing Variables Between SConscript Files
9179
9180 You must explicitly Export() and Import() variables that
9181 you want to share between SConscript files.
9182
9183 .ES
9184 SConstruct:
9185
9186     env = Environment()
9187     env.Program(target = 'foo', source = 'foo.c')
9188
9189     Export("env")
9190     SConscript('subdirectory/SConscript')
9191
9192 subdirectory/SConscript:
9193
9194     Import("env")
9195     env.Program(target = 'foo', source = 'foo.c')
9196 .EE
9197
9198 .SS Building Multiple Variants From the Same Source
9199
9200 Use the BuildDir() method to establish
9201 one or more separate build directories for
9202 a given source directory,
9203 then use the SConscript() method
9204 to specify the SConscript files
9205 in the build directories:
9206
9207 .ES
9208 SConstruct:
9209
9210     ccflags = '-DFOO'
9211     Export("ccflags")
9212     BuildDir('foo', 'src')
9213     SConscript('foo/SConscript')
9214
9215     ccflags = '-DBAR'
9216     Export("ccflags")
9217     BuildDir('bar', 'src')
9218     SConscript('bar/SConscript')
9219
9220 src/SConscript:
9221
9222     Import("ccflags")
9223     env = Environment(CCFLAGS = ccflags)
9224     env.Program(target = 'src', source = 'src.c')
9225 .EE
9226
9227 Note the use of the Export() method
9228 to set the "ccflags" variable to a different
9229 value for each variant build.
9230
9231 .SS Hierarchical Build of Two Libraries Linked With a Program
9232
9233 .ES
9234 SConstruct:
9235
9236     env = Environment(LIBPATH = ['#libA', '#libB'])
9237     Export('env')
9238     SConscript('libA/SConscript')
9239     SConscript('libB/SConscript')
9240     SConscript('Main/SConscript')
9241
9242 libA/SConscript:
9243
9244     Import('env')
9245     env.Library('a', Split('a1.c a2.c a3.c'))
9246
9247 libB/SConscript:                                                  
9248
9249     Import('env')
9250     env.Library('b', Split('b1.c b2.c b3.c'))
9251
9252 Main/SConscript:
9253
9254     Import('env')
9255     e = env.Copy(LIBS = ['a', 'b'])
9256     e.Program('foo', Split('m1.c m2.c m3.c'))
9257 .EE
9258
9259 The '#' in the LIBPATH directories specify that they're relative to the
9260 top-level directory, so they don't turn into "Main/libA" when they're
9261 used in Main/SConscript.
9262
9263 Specifying only 'a' and 'b' for the library names
9264 allows SCons to append the appropriate library
9265 prefix and suffix for the current platform
9266 (for example, 'liba.a' on POSIX systems,
9267 'a.lib' on Windows).
9268
9269 .SS Customizing contruction variables from the command line.
9270
9271 The following would allow the C compiler to be specified on the command
9272 line or in the file custom.py. 
9273
9274 .ES
9275 opts = Options('custom.py')
9276 opts.Add('CC', 'The C compiler.')
9277 env = Environment(options=opts)
9278 Help(opts.GenerateHelpText(env))
9279 .EE
9280
9281 The user could specify the C compiler on the command line:
9282
9283 .ES
9284 scons "CC=my_cc"
9285 .EE
9286
9287 or in the custom.py file:
9288
9289 .ES
9290 CC = 'my_cc'
9291 .EE
9292
9293 or get documentation on the options:
9294
9295 .ES
9296 $ scons -h
9297
9298 CC: The C compiler.
9299     default: None
9300     actual: cc
9301
9302 .EE
9303
9304 .SS Using Microsoft Visual C++ precompiled headers
9305
9306 Since windows.h includes everything and the kitchen sink, it can take quite
9307 some time to compile it over and over again for a bunch of object files, so
9308 Microsoft provides a mechanism to compile a set of headers once and then
9309 include the previously compiled headers in any object file. This
9310 technology is called precompiled headers. The general recipe is to create a
9311 file named "StdAfx.cpp" that includes a single header named "StdAfx.h", and
9312 then include every header you want to precompile in "StdAfx.h", and finally
9313 include "StdAfx.h" as the first header in all the source files you are
9314 compiling to object files. For example:
9315
9316 StdAfx.h:
9317 .ES
9318 #include <windows.h>
9319 #include <my_big_header.h>
9320 .EE
9321
9322 StdAfx.cpp:
9323 .ES
9324 #include <StdAfx.h>
9325 .EE
9326
9327 Foo.cpp:
9328 .ES
9329 #include <StdAfx.h>
9330
9331 /* do some stuff */
9332 .EE
9333
9334 Bar.cpp:
9335 .ES
9336 #include <StdAfx.h>
9337
9338 /* do some other stuff */
9339 .EE
9340
9341 SConstruct:
9342 .ES
9343 env=Environment()
9344 env['PCHSTOP'] = 'StdAfx.h'
9345 env['PCH'] = env.PCH('StdAfx.cpp')[0]
9346 env.Program('MyApp', ['Foo.cpp', 'Bar.cpp'])
9347 .EE
9348
9349 For more information see the document for the PCH builder, and the PCH and
9350 PCHSTOP construction variables. To learn about the details of precompiled
9351 headers consult the MSDN documention for /Yc, /Yu, and /Yp.
9352
9353 .SS Using Microsoft Visual C++ external debugging information
9354
9355 Since including debugging information in programs and shared libraries can
9356 cause their size to increase significantly, Microsoft provides a mechanism
9357 for including the debugging information in an external file called a PDB
9358 file. SCons supports PDB files through the PDB construction
9359 variable. 
9360
9361 SConstruct:
9362 .ES
9363 env=Environment()
9364 env['PDB'] = 'MyApp.pdb'
9365 env.Program('MyApp', ['Foo.cpp', 'Bar.cpp'])
9366 .EE
9367
9368 For more information see the document for the PDB construction variable.
9369
9370 .SH ENVIRONMENT
9371
9372 .IP SCONS_LIB_DIR
9373 Specifies the directory that contains the SCons Python module directory
9374 (e.g. /home/aroach/scons-src-0.01/src/engine).
9375
9376 .IP SCONSFLAGS
9377 A string of options that will be used by scons in addition to those passed
9378 on the command line.
9379
9380 .SH "SEE ALSO"
9381 .B scons
9382 User Manual,
9383 .B scons
9384 Design Document,
9385 .B scons
9386 source code.
9387
9388 .SH AUTHORS
9389 Steven Knight <knight@baldmt.com>
9390 .br
9391 Anthony Roach <aroach@electriceyeball.com>
9392