'\" t .\" Title: SCONS .\" Author: Steven Knight .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 2004 - 2020 .\" Manual: SCons __VERSION__ .\" Source: SCons __VERSION__ version 4.0.0 .\" Language: English .\" .TH "SCONS" "1" "2004 - 2020" "SCons __VERSION__ version 4.0." "SCons __VERSION__" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" scons \- a software construction tool .SH "SYNOPSIS" .HP \w'\fBscons\fR\ 'u \fBscons\fR [\fIoptions\fR...] [\fIname\fR=\fIval\fR...] [\fItargets\fR...] .SH "DESCRIPTION" .PP \fBscons\fR orchestrates the construction of software (and other tangible products such as documentation files) by determining which component pieces must be built or rebuilt and invoking the necessary commands to build them\&. .PP You instruct \fBscons\fR by writing a configuration file which specifies the files to be built (targets), and, if necessary, the rules to build those files\&. Premade rules exist for building many common software components such as executable programs, object files, libraries, so that for many software projects, only the target and input files need be specified\&. .PP When invoked, \fBscons\fR searches for a file named SConstruct (it also checks alternate spellings Sconstruct, sconstruct, SConstruct\&.py Sconstruct\&.py and sconstruct\&.py in that order) in the current directory and reads its configuration from that file\&. An alternate file name may be specified via the \fB\-f\fR option\&. The SConstruct file can specify subsidiary configuration files by calling the \fBSConscript\fR function\&. By convention, these subsidiary files are named SConscript, although any name may be used\&. As a result of this naming convention, the term SConscript files is often used to refer generically to the complete set of configuration files for a project (including the SConstruct file), regardless of the actual file names or number of such files\&. .PP Before reading the SConscript files, \fBscons\fR looks for a directory named site_scons in various system directories and in the directory containing the SConstruct file and prepends the ones it finds to the Python module search path (\fIsys\&.path\fR), thus allowing modules in such directories to be imported in the normal Python way in SConscript files\&. For each found site directory, if it contains a file site_init\&.py it is evaluated, and if it contains a directory site_tools the path to it is prepended to the default toolpath\&. See the \fB\-\-site\-dir\fR and \fB\-\-no\-site\-dir\fR options for details on default paths and controlling the site directories\&. .PP \fBscons\fR configuration files are written in the Python programming language, although it is normally not necessary to be a Python programmer to use \fBscons\fR effectively\&. Standard Python scripting capabilities such as flow control, data manipulation, and imported Python libraries are available to use to handle complicated build situations\&. .PP \fBscons\fR reads and executes all of the SConscript files \fIbefore\fR it begins building any targets\&. To make this clear, \fBscons\fR prints the following messages about what it is doing: .sp .if n \{\ .RS 4 .\} .nf $ \fBscons foo\&.out\fR scons: Reading SConscript files \&.\&.\&. scons: done reading SConscript files\&. scons: Building targets \&.\&.\&. cp foo\&.in foo\&.out scons: done building targets\&. $ .fi .if n \{\ .RE .\} .PP The status messages (lines beginning with the scons: tag) may be suppressed using the \fB\-Q\fR option\&. .PP \fBscons\fR does not automatically propagate the external environment used to execute \fBscons\fR to the commands used to build target files\&. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time \fBscons\fR is invoked\&. This also means that if the compiler or other commands that you want to use to build your target files are not in standard system locations, \fBscons\fR will not find them unless you explicitly include the locations into the value of \fIPATH\fR in the \fIENV\fR variable in the internal construction environment\&. Whenever you create a construction environment, you can propagate the value of \fBPATH\fR from your external environment as follows: .sp .if n \{\ .RS 4 .\} .nf import os env = Environment(ENV={\*(AqPATH\*(Aq: os\&.environ[\*(AqPATH\*(Aq]}) .fi .if n \{\ .RE .\} .PP Similarly, if the commands use specific external environment variables that \fBscons\fR does not recognize, they can be propagated into the internal environment: .sp .if n \{\ .RS 4 .\} .nf import os env = Environment(ENV={\*(AqPATH\*(Aq: os\&.environ[\*(AqPATH\*(Aq], \*(AqANDROID_HOME\*(Aq: os\&.environ[\*(AqANDROID_HOME\*(Aq], \*(AqANDROID_NDK_HOME\*(Aq: os\&.environ[\*(AqANDROID_NDK_HOME\*(Aq]}) .fi .if n \{\ .RE .\} .PP Or you may explicitly propagate the invoking user\*(Aqs complete external environment: .sp .if n \{\ .RS 4 .\} .nf import os env = Environment(ENV=os\&.environ) .fi .if n \{\ .RE .\} .PP This comes at the expense of making your build dependent on the user\*(Aqs environment being set correctly, but it may be more convenient for many configurations\&. It should not cause problems if done in a build setup which tightly controls how the environment is set up before invoking \fBscons\fR, as in many continuous integration setups\&. .PP \fBscons\fR can scan known input files automatically for dependency information (for example, #include preprocessor directives in C or C++ files) and will rebuild dependent files appropriately whenever any "included" input file changes\&. \fBscons\fR supports the ability to define new scanners for unknown input file types\&. .PP \fBscons\fR is normally executed in a top\-level directory containing an SConstruct file\&. When \fBscons\fR is invoked, the command line (including the contents of the \fISCONSFLAGS\fR environment variable, if set) is processed\&. Command\-line options (see the section called \(lqOPTIONS\(rq) are consumed\&. Any variable argument assignments are collected, and remaining arguments are taken as the targets to build\&. .PP Values of variables to be passed to the SConscript files may be specified on the command line: .sp .if n \{\ .RS 4 .\} .nf \fBscons debug=1\fR .fi .if n \{\ .RE .\} .PP These variables are available through the \fIARGUMENTS\fR dictionary, and can be used in the SConscript files to modify the build in any way: .sp .if n \{\ .RS 4 .\} .nf if ARGUMENTS\&.get(\*(Aqdebug\*(Aq, 0): env = Environment(CCFLAGS=\*(Aq\-g\*(Aq) else: env = Environment() .fi .if n \{\ .RE .\} .PP The command\-line variable arguments are also available in the \fIARGLIST\fR list, indexed by their order on the command line\&. This allows you to process them in order rather than by name, if necessary\&. Each \fIARGLIST\fR entry is a tuple containing (\fIargname\fR, \fIargvalue\fR)\&. .PP Targets on the command line may be files, directories, or phony targets defined using the \fBAlias\fR function\&. The command line targets are made available in the \fICOMMAND_LINE_TARGETS\fR list\&. .PP If no targets are specified on the command line, \fBscons\fR will build the default targets\&. The default targets are those specified in the SConscript files via calls to the \fBDefault\fR function; if none, the default targets are those target files in or below the current directory\&. Targets specified via the \fBDefault\fR function are available in the \fIDEFAULT_TARGETS\fR list\&. .PP To ignore the default targets specified through calls to \fBDefault\fR and instead build all target files in or below the current directory specify the current directory (\&.) as a command\-line target: .sp .if n \{\ .RS 4 .\} .nf \fBscons \&.\fR .fi .if n \{\ .RE .\} .PP To build all target files, including any files outside of the current directory, supply a command\-line target of the root directory (on POSIX systems): .sp .if n \{\ .RS 4 .\} .nf \fBscons /\fR .fi .if n \{\ .RE .\} .PP or the path name(s) of the volume(s) in which all the targets should be built (on Windows systems): .sp .if n \{\ .RS 4 .\} .nf \fBscons C:\e D:\e\fR .fi .if n \{\ .RE .\} .PP A subset of a hierarchical tree may be built by remaining at the top\-level directory (where the SConstruct file lives) and specifying the subdirectory as the target to build: .sp .if n \{\ .RS 4 .\} .nf \fBscons src/subdir\fR .fi .if n \{\ .RE .\} .PP or by changing directory and invoking scons with the \fB\-u\fR option, which traverses up the directory hierarchy until it finds the SConstruct file, and then builds targets relatively to the current subdirectory (see also the related \fB\-D\fR and \fB\-U\fR options): .sp .if n \{\ .RS 4 .\} .nf \fBcd src/subdir\fR \fBscons \-u \&.\fR .fi .if n \{\ .RE .\} .PP In all cases, more files may be built than are requested, as \fBscons\fR needs to make sure any dependent files are built\&. .PP Specifying "cleanup" targets in SConscript files is not usually necessary\&. The \fB\-c\fR flag removes all files necessary to build the specified target: .sp .if n \{\ .RS 4 .\} .nf \fBscons \-c \&.\fR .fi .if n \{\ .RE .\} .PP to remove all target files in or under the current directory, or: .sp .if n \{\ .RS 4 .\} .nf \fBscons \-c build export\fR .fi .if n \{\ .RE .\} .PP to remove target files under build and export\&. .PP Additional files or directories to remove can be specified using the \fBClean\fR function in the SConscript files\&. Conversely, targets that would normally be removed by the \fB\-c\fR invocation can be retained by calling the \fBNoClean\fR function with those targets\&. .PP \fBscons\fR supports building multiple targets in parallel via a \fB\-j\fR option that takes, as its argument, the number of simultaneous tasks that may be spawned: .sp .if n \{\ .RS 4 .\} .nf \fBscons \-j 4\fR .fi .if n \{\ .RE .\} .PP builds four targets in parallel, for example\&. .PP \fBscons\fR can maintain a cache of target (derived) files that can be shared between multiple builds\&. When caching is enabled in a SConscript file, any target files built by \fBscons\fR will be copied to the cache\&. If an up\-to\-date target file is found in the cache, it will be retrieved from the cache instead of being rebuilt locally\&. Caching behavior may be disabled and controlled in other ways by the \fB\-\-cache\-force\fR, \fB\-\-cache\-disable\fR, \fB\-\-cache\-readonly\fR, and \fB\-\-cache\-show\fR command\-line options\&. The \fB\-\-random\fR option is useful to prevent multiple builds from trying to update the cache simultaneously\&. .PP By default, \fBscons\fR searches for known programming tools on various systems and initializes itself based on what is found\&. On Windows systems which identify as \fIwin32\fR, \fBscons\fR searches in order for the Microsoft Visual C++ tools, the MinGW tool chain, the Intel compiler tools, and the PharLap ETS compiler\&. On Windows system which identify as \fIcygwin\fR (that is, if \fBscons\fR is invoked from a cygwin shell), the order changes to prefer the GCC toolchain over the MSVC tools\&. On OS/2 systems, \fBscons\fR searches in order for the OS/2 compiler, the GCC tool chain, and the Microsoft Visual C++ tools, On SGI IRIX, IBM AIX, Hewlett Packard HP\-UX, and Oracle Solaris systems, \fBscons\fR searches for the native compiler tools (MIPSpro, Visual Age, aCC, and Forte tools respectively) and the GCC tool chain\&. On all other platforms, including POSIX (Linux and UNIX) platforms, \fBscons\fR searches in order for the GCC tool chain, and the Intel compiler tools\&. These default values may be overridden by appropriate setting of construction variables\&. .PP \fBscons\fR requires Python 3\&.5 or higher\&. There should be no other dependencies or requirements to run \fBscons\fR, although the pywin32 Python package is strongly recommended if running on Windows systems\&. .SH "OPTIONS" .PP In general, \fBscons\fR supports the same command\-line options as GNU Make and many of those supported by cons\&. .PP \fB\-b\fR .RS 4 Ignored for compatibility with non\-GNU versions of Make .RE .PP \fB\-c\fR, \fB\-\-clean\fR, \fB\-\-remove\fR .RS 4 Clean up by removing all target files for which a construction command is specified\&. Also remove any files or directories associated to the construction command using the \fBClean\fR function\&. Will not remove any targets specified by the \fBNoClean\fR function\&. .RE .PP \-\fB\-cache\-debug=\fR\fB\fIfile\fR\fR .RS 4 Write debug information about derived\-file caching to the specified \fIfile\fR\&. If \fIfile\fR is a hyphen (\-), the debug information is printed to the standard output\&. The printed messages describe what signature\-file names are being looked for in, retrieved from, or written to the derived\-file cache specified by \fBCacheDir\fR\&. .RE .PP \fB\-\-cache\-disable\fR, \fB\-\-no\-cache\fR .RS 4 Disable derived\-file caching\&. \fBscons\fR will neither retrieve files from the cache nor copy files to the cache\&. This option can be used to temporarily disable the cache without modifying the build scripts\&. .RE .PP \fB\-\-cache\-force\fR, \fB\-\-cache\-populate\fR .RS 4 When using \fBCacheDir\fR, populate a derived\-file cache by copying any already\-existing, up\-to\-date derived files to the cache, in addition to files built by this invocation\&. This is useful to populate a new cache with all the current derived files, or to add to the cache any derived files recently built with caching disabled via the \fB\-\-cache\-disable\fR option\&. .RE .PP \fB\-\-cache\-readonly\fR .RS 4 Use the derived\-file cache, if enabled, to retrieve files, but do not not update the cache with any files actually built during this invocation\&. .RE .PP \fB\-\-cache\-show\fR .RS 4 When using a derived\-file cache and retrieving a file from it, show the command that would have been executed to build the file\&. Without this option, \fBscons\fR reports "Retrieved `file\*(Aq from cache\&."\&. This allows producing consistent output for build logs, regardless of whether a target file was rebuilt or retrieved from the cache\&. .RE .PP \fB\-\-config=\fR\fB\fImode\fR\fR .RS 4 Control how the \fBConfigure\fR call should use or generate the results of configuration tests\&. \fImode\fRshould be specified from among the following choices: .PP \fBauto\fR .RS 4 scons will use its normal dependency mechanisms to decide if a test must be rebuilt or not\&. This saves time by not running the same configuration tests every time you invoke scons, but will overlook changes in system header files or external commands (such as compilers) if you don\*(Aqt specify those dependecies explicitly\&. This is the default behavior\&. .RE .PP \fBforce\fR .RS 4 If this option is specified, all configuration tests will be re\-run regardless of whether the cached results are out of date\&. This can be used to explicitly force the configuration tests to be updated in response to an otherwise unconfigured change in a system header file or compiler\&. .RE .PP \fBcache\fR .RS 4 If this option is specified, no configuration tests will be rerun and all results will be taken from cache\&. \fBscons\fR will report an error if \fB\-\-config=cache\fR is specified and a necessary test does not have any results in the cache\&. .RE .sp .RE .PP \fB\-C \fR\fB\fIdirectory\fR\fR, \fB\-\-directory=\fR\fB\fIdirectory\fR\fR .RS 4 Run as if \fBscons\fR was started in \fIdirectory\fR instead of the current working directory\&. That is, change directory before searching for the SConstruct, Sconstruct, sconstruct, SConstruct\&.py, Sconstruct\&.py or sconstruct\&.py file or doing anything else\&. When multiple \fB\-C\fR options are given, each subsequent non\-absolute \fB\-C\fR \fIdirectory\fR is interpreted relative to the preceding one\&. This option is similar to using \fB\-f \fR\fB\fIdirectory\fR\fR\fB/SConstruct\fR, but \fB\-f\fR does not search for any of the predefined SConstruct names in the specified directory\&. See also options \fB\-u\fR, \fB\-U\fR and \fB\-D\fR to change the SConstruct search behavior when this option is used\&. .RE .PP \fB\-D\fR .RS 4 Works exactly the same way as the \fB\-u\fR option except for the way default targets are handled\&. When this option is used and no targets are specified on the command line, all default targets are built, whether or not they are below the current directory\&. .RE .PP \fB\-\-debug=\fR\fB\fItype\fR\fR\fB[\fR\fB\fI,type\fR\fR\fB\&.\&.\&.]\fR .RS 4 Debug the build process\&. \fItype\fR specifies the kind of debugging info to emit\&. Multiple types may be specified, separated by commas\&. The following entries show the recognized types: .PP \fBaction\-timestamps\fR .RS 4 Prints additional time profiling information\&. For each command, shows the absolute start and end times\&. This may be useful in debugging parallel builds\&. Implies the \fB\-\-debug=time\fR option\&. .sp \fIAvailable since \fR\fI\fBscons\fR\fR\fI 3\&.1\&.\fR .RE .PP \fBcount\fR .RS 4 Print how many objects are created of the various classes used internally by SCons before and after reading the SConscript files and before and after building targets\&. This is not supported when SCons is executed with the Python \fB\-O\fR (optimized) option or when the SCons modules have been compiled with optimization (that is, when executing from *\&.pyo files)\&. .RE .PP \fBduplicate\fR .RS 4 Print a line for each unlink/relink (or copy) of a variant file from its source file\&. Includes debugging info for unlinking stale variant files, as well as unlinking old targets before building them\&. .RE .PP \fBexplain\fR .RS 4 Print an explanation of why \fBscons\fR is deciding to (re\-)build the targets it selects for building\&. .RE .PP \fBfindlibs\fR .RS 4 Instruct the scanner that searches for libraries to print a message about each potential library name it is searching for, and about the actual libraries it finds\&. .RE .PP \fBincludes\fR .RS 4 Print the include tree after each top\-level target is built\&. This is generally used to find out what files are included by the sources of a given derived file: .sp .if n \{\ .RS 4 .\} .nf $ \fBscons \-\-debug=includes foo\&.o\fR .fi .if n \{\ .RE .\} .RE .PP \fBmemoizer\fR .RS 4 Prints a summary of hits and misses using the Memoizer, an internal subsystem that counts how often SCons uses cached values in memory instead of recomputing them each time they\*(Aqre needed\&. .RE .PP \fBmemory\fR .RS 4 Prints how much memory SCons uses before and after reading the SConscript files and before and after building targets\&. .RE .PP \fBobjects\fR .RS 4 Prints a list of the various objects of the various classes used internally by SCons\&. .RE .PP \fBpdb\fR .RS 4 Re\-run \fBscons\fR under the control of the \fBpdb\fR Python debugger\&. .RE .PP \fBprepare\fR .RS 4 Print a line each time any target (internal or external) is prepared for building\&. \fBscons\fR prints this for each target it considers, even if that target is up to date (see also \fB\-\-debug=explain\fR)\&. This can help debug problems with targets that aren\*(Aqt being built; it shows whether \fBscons\fR is at least considering them or not\&. .RE .PP \fBpresub\fR .RS 4 Print the raw command line used to build each target before the construction environment variables are substituted\&. Also shows which targets are being built by this command\&. Output looks something like this: .sp .if n \{\ .RS 4 .\} .nf $ \fBscons \-\-debug=presub\fR Building myprog\&.o with action(s): $SHCC $SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPINCFLAGS \-c \-o $TARGET $SOURCES \&.\&.\&. .fi .if n \{\ .RE .\} .RE .PP \fBstacktrace\fR .RS 4 Prints an internal Python stack trace when encountering an otherwise unexplained error\&. .RE .PP \fBtime\fR .RS 4 Prints various time profiling information: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The time spent executing each individual build command .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The total build time (time SCons ran from beginning to end) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The total time spent reading and executing SConscript files .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The total time SCons itself spent running (that is, not counting reading and executing SConscript files) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The total time spent executing all build commands .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The elapsed wall\-clock time spent executing those build commands .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} The time spent processing each file passed to the \fBSConscript\fR function .RE .sp (When \fBscons\fR is executed without the \fB\-j\fR option, the elapsed wall\-clock time will typically be slightly longer than the total time spent executing all the build commands, due to the SCons processing that takes place in between executing each command\&. When \fBscons\fR is executed \fIwith\fR the \fB\-j\fR option, and your build configuration allows good parallelization, the elapsed wall\-clock time should be significantly smaller than the total time spent executing all the build commands, since multiple build commands and intervening SCons processing should take place in parallel\&.) .RE .sp .RE .PP \fB\-\-diskcheck=\fR\fB\fItype\fR\fR\fB[\fR\fB\fI,type\fR\fR\fB\&.\&.\&.]\fR .RS 4 Enable specific checks for whether or not there is a file on disk where the SCons configuration expects a directory (or vice versa), and whether or not RCS or SCCS sources exist when searching for source and include files\&. The \fItype\fR argument can be set to: .PP \fBall\fR .RS 4 Enable all checks explicitly (the default behavior)\&. .RE .PP \fBnone\fR .RS 4 Disable all such checks\&. .RE .PP \fBmatch\fR .RS 4 to check that files and directories on disk match SCons\*(Aq expected configuration\&. .RE .PP \fBrcs\fR .RS 4 Check for the existence of an RCS source for any missing source or include files\&. .RE .PP \fBsccs\fR .RS 4 Check for the existence of an SCCS source for any missing source or include files\&. .RE .sp Multiple checks can be specified separated by commas\&. for example, \fB\-\-diskcheck=sccs,rcs\fR would still check for SCCS and RCS sources, but disable the check for on\-disk matches of files and directories\&. Disabling some or all of these checks can provide a performance boost for large configurations, or when the configuration will check for files and/or directories across networked or shared file systems, at the slight increased risk of an incorrect build or of not handling errors gracefully (if include files really should be found in SCCS or RCS, for example, or if a file really does exist where the SCons configuration expects a directory)\&. .RE .PP \fB\-\-duplicate=\fR\fB\fIORDER\fR\fR .RS 4 There are three ways to duplicate files in a build tree: hard links, soft (symbolic) links and copies\&. The default behaviour of SCons is to prefer hard links to soft links to copies\&. You can specify different behaviours with this option\&. \fIORDER\fR must be one of \fIhard\-soft\-copy\fR (the default), \fIsoft\-hard\-copy\fR, \fIhard\-copy\fR, \fIsoft\-copy\fR or \fIcopy\fR\&. SCons will attempt to duplicate files using the mechanisms in the specified order\&. .RE .PP \fB\-\-enable\-virtualenv\fR .RS 4 Import virtualenv\-related variables to SCons\&. .RE .PP \fB\-f \fR\fB\fIfile\fR\fR, \fB\-\-file=\fR\fB\fIfile\fR\fR, \fB\-\-makefile=\fR\fB\fIfile\fR\fR, \fB\-\-sconstruct=\fR\fB\fIfile\fR\fR .RS 4 Use \fIfile\fR as the initial SConscript file\&. Multiple \fB\-f\fR options may be specified, in which case \fBscons\fR will read all of the specified files\&. .RE .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a local help message for this project, if one is defined in the SConscript files (see the \fBHelp\fR function), plus a line that refers to the standard SCons help message\&. If no local help message is defined, prints the standard SCons help message (as for the \fB\-H\fR option) plus help for any local options defined through \fBAddOption\fR\&. Exits after displaying the appropriate message\&. .sp Note that use of this option requires SCons to process the SConscript files, so syntax errors may cause the help message not to be displayed\&. .RE .PP \fB\-H\fR, \fB\-\-help\-options\fR .RS 4 Print the standard help message about SCons command\-line options and exit\&. .RE .PP \fB\-i\fR, \fB\-\-ignore\-errors\fR .RS 4 Ignore all errors from commands executed to rebuild files\&. .RE .PP \fB\-I \fR\fB\fIdirectory\fR\fR, \fB\-\-include\-dir=\fR\fB\fIdirectory\fR\fR .RS 4 Specifies a \fIdirectory\fR to search for imported Python modules\&. If several \fB\-I\fR options are used, the directories are searched in the order specified\&. .RE .PP \fB\-\-ignore\-virtualenv\fR .RS 4 Suppress importing virtualenv\-related variables to SCons\&. .RE .PP \fB\-\-implicit\-cache\fR .RS 4 Cache implicit dependencies\&. This causes \fBscons\fR to use the implicit (scanned) dependencies from the last time it was run instead of scanning the files for implicit dependencies\&. This can significantly speed up SCons, but with the following limitations: .sp \fBscons\fR will not detect changes to implicit dependency search paths (e\&.g\&. \fBCPPPATH\fR, \fBLIBPATH\fR) that would ordinarily cause different versions of same\-named files to be used\&. .sp \fBscons\fR will miss changes in the implicit dependencies in cases where a new implicit dependency is added earlier in the implicit dependency search path (e\&.g\&. \fBCPPPATH\fR, \fBLIBPATH\fR) than a current implicit dependency with the same name\&. .RE .PP \fB\-\-implicit\-deps\-changed\fR .RS 4 Forces SCons to ignore the cached implicit dependencies\&. This causes the implicit dependencies to be rescanned and recached\&. This implies \fB\-\-implicit\-cache\fR\&. .RE .PP \fB\-\-implicit\-deps\-unchanged\fR .RS 4 Force SCons to ignore changes in the implicit dependencies\&. This causes cached implicit dependencies to always be used\&. This implies \fB\-\-implicit\-cache\fR\&. .RE .PP \fB\-\-install\-sandbox=\fR\fB\fIpath\fR\fR .RS 4 When using the \fBInstall\fR functions, prepend \fIpath\fR to the installation paths such that all installed files will be placed underneath \fIpath\fR\&. .RE .PP \fB\-\-interactive\fR .RS 4 Starts SCons in interactive mode\&. The SConscript files are read once and a scons>>> prompt is printed\&. Targets may now be rebuilt by typing commands at interactive prompt without having to re\-read the SConscript files and re\-initialize the dependency graph from scratch\&. .sp SCons interactive mode supports the following commands: .PP \fBbuild \fR\fB\fI[OPTIONS] [TARGETS] \&.\&.\&.\fR\fR .RS 4 Builds the specified \fITARGETS\fR (and their dependencies) with the specified SCons command\-line \fIOPTIONS\fR\&. \fBb\fR and \fBscons\fR are synonyms for \fBbuild\fR\&. .sp The following SCons command\-line options affect the \fBbuild\fR command: .sp .if n \{\ .RS 4 .\} .nf \-\-cache\-debug=FILE \-\-cache\-disable, \-\-no\-cache \-\-cache\-force, \-\-cache\-populate \-\-cache\-readonly \-\-cache\-show \-\-debug=TYPE \-i, \-\-ignore\-errors \-j N, \-\-jobs=N \-k, \-\-keep\-going \-n, \-\-no\-exec, \-\-just\-print, \-\-dry\-run, \-\-recon \-Q \-s, \-\-silent, \-\-quiet \-\-taskmastertrace=FILE \-\-tree=OPTIONS .fi .if n \{\ .RE .\} .sp Any other SCons command\-line options that are specified do not cause errors but have no effect on the \fBbuild\fR command (mainly because they affect how the SConscript files are read, which only happens once at the beginning of interactive mode)\&. .RE .PP \fBclean \fR\fB\fI[OPTIONS] [TARGETS] \&.\&.\&.\fR\fR .RS 4 Cleans the specified \fITARGETS\fR (and their dependencies) with the specified \fIOPTIONS\fR\&. \fBc\fR is a synonym\&. This command is itself a synonym for \fBbuild \-\-clean\fR .RE .PP \fBexit\fR .RS 4 Exits SCons interactive mode\&. You can also exit by terminating input (Ctrl+D UNIX or Linux systems, (Ctrl+Z on Windows systems)\&. .RE .PP \fBhelp \fR\fB\fI[COMMAND]\fR\fR .RS 4 Provides a help message about the commands available in SCons interactive mode\&. If \fICOMMAND\fR is specified, \fBh\fR and \fB?\fR are synonyms\&. .RE .PP \fBshell \fR\fB\fI[COMMANDLINE]\fR\fR .RS 4 Executes the specified \fICOMMANDLINE\fR in a subshell\&. If no \fICOMMANDLINE\fR is specified, executes the interactive command interpreter specified in the \fBSHELL\fR environment variable (on UNIX and Linux systems) or the \fBCOMSPEC\fR environment variable (on Windows systems)\&. \fBsh\fR and \fB!\fR are synonyms\&. .RE .PP \fBversion\fR .RS 4 Prints SCons version information\&. .RE .sp An empty line repeats the last typed command\&. Command\-line editing can be used if the \fBreadline\fR module is available\&. .sp .if n \{\ .RS 4 .\} .nf $ \fBscons \-\-interactive\fR scons: Reading SConscript files \&.\&.\&. scons: done reading SConscript files\&. scons>>> build \-n prog scons>>> exit .fi .if n \{\ .RE .\} .RE .PP \fB\-j \fR\fB\fIN\fR\fR, \fB\-\-jobs=\fR\fB\fIN\fR\fR .RS 4 Specifies the maximum number of comcurrent jobs (commands) to run\&. If there is more than one \fB\-j\fR option, the last one is effective\&. .RE .PP \fB\-k\fR, \fB\-\-keep\-going\fR .RS 4 Continue as much as possible after an error\&. The target that failed and those that depend on it will not be remade, but other targets specified on the command line will still be processed\&. .RE .PP \fB\-m\fR .RS 4 Ignored for compatibility with non\-GNU versions of Make\&. .RE .PP \fB\-\-max\-drift=\fR\fB\fISECONDS\fR\fR .RS 4 Set the maximum expected drift in the modification time of files to \fISECONDS\fR\&. This value determines how long a file must be unmodified before its cached content signature will be used instead of calculating a new content signature (MD5 checksum) of the file\*(Aqs contents\&. The default value is 2 days, which means a file must have a modification time of at least two days ago in order to have its cached content signature used\&. A negative value means to never cache the content signature and to ignore the cached value if there already is one\&. A value of 0 means to always use the cached signature, no matter how old the file is\&. .RE .PP \fB\-\-md5\-chunksize=\fR\fB\fIKILOBYTES\fR\fR .RS 4 Set the block size used to compute MD5 signatures to \fIKILOBYTES\fR\&. This value determines the size of the chunks which are read in at once when computing MD5 signatures\&. Files below that size are fully stored in memory before performing the signature computation while bigger files are read in block\-by\-block\&. A huge block\-size leads to high memory consumption while a very small block\-size slows down the build considerably\&. .sp The default value is to use a chunk size of 64 kilobytes, which should be appropriate for most uses\&. .RE .PP \fB\-n\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR, \fB\-\-recon\fR .RS 4 No execute\&. Print the commands that would be executed to build any out\-of\-date target files, but do not execute the commands\&. .RE .PP \fB\-\-no\-site\-dir\fR .RS 4 Prevents the automatic addition of the standard \fIsite_scons\fR dirs to \fIsys\&.path\fR\&. Also prevents loading the site_scons/site_init\&.py modules if they exist, and prevents adding their site_scons/site_tools dirs to the toolpath\&. .RE .PP \fB\-\-profile=\fR\fB\fIfile\fR\fR .RS 4 Run SCons under the Python profiler and save the results in the specified \fIfile\fR\&. The results may be analyzed using the Python pstats module\&. .RE .PP \fB\-q\fR, \fB\-\-question\fR .RS 4 Do not run any commands, or print anything\&. Just return an exit status that is zero if the specified targets are already up to date, non\-zero otherwise\&. .RE .PP \fB\-Q\fR .RS 4 Quiets SCons status messages about reading SConscript files, building targets and entering directories\&. Commands that are executed to rebuild target files are still printed\&. .RE .PP \fB\-\-random\fR .RS 4 Build dependencies in a random order\&. This is useful when building multiple trees simultaneously with caching enabled, to prevent multiple builds from simultaneously trying to build or retrieve the same target files\&. .RE .PP \fB\-s\fR, \fB\-\-silent\fR, \fB\-\-quiet\fR .RS 4 Silent\&. Do not print commands that are executed to rebuild target files\&. Also suppresses SCons status messages\&. .RE .PP \fB\-S\fR, \fB\-\-no\-keep\-going\fR, \fB\-\-stop\fR .RS 4 Ignored for compatibility with GNU Make .RE .PP \fB\-\-site\-dir=\fR\fB\fIdir\fR\fR .RS 4 Uses the named \fIdir\fR as the site directory rather than the default \fIsite_scons\fR directories\&. This directory will be prepended to \fIsys\&.path\fR, the module \fIdir\fR/site_init\&.py will be loaded if it exists, and \fIdir\fR/site_tools will be added to the default toolpath\&. .sp The default set of \fIsite_scons\fR directories used when \fB\-\-site\-dir\fR is not specified depends on the system platform, as follows\&. Directories are examined in the order given, from most generic to most specific, so the last\-executed site_init\&.py file is the most specific one (which gives it the chance to override everything else), and the directories are prepended to the paths, again so the last directory examined comes first in the resulting path\&. .PP Windows: .RS 4 .sp .if n \{\ .RS 4 .\} .nf %ALLUSERSPROFILE/Application Data/scons/site_scons %USERPROFILE%/Local Settings/Application Data/scons/site_scons %APPDATA%/scons/site_scons %HOME%/\&.scons/site_scons \&./site_scons .fi .if n \{\ .RE .\} .RE .PP Mac OS X: .RS 4 .sp .if n \{\ .RS 4 .\} .nf /Library/Application Support/SCons/site_scons /opt/local/share/scons/site_scons (for MacPorts) /sw/share/scons/site_scons (for Fink) $HOME/Library/Application Support/SCons/site_scons $HOME/\&.scons/site_scons \&./site_scons .fi .if n \{\ .RE .\} .RE .PP Solaris: .RS 4 .sp .if n \{\ .RS 4 .\} .nf /opt/sfw/scons/site_scons /usr/share/scons/site_scons $HOME/\&.scons/site_scons \&./site_scons .fi .if n \{\ .RE .\} .RE .PP Linux, HPUX, and other Posix\-like systems: .RS 4 .sp .if n \{\ .RS 4 .\} .nf /usr/share/scons/site_scons $HOME/\&.scons/site_scons \&./site_scons .fi .if n \{\ .RE .\} .RE .RE .PP \fB\-\-stack\-size=\fR\fB\fIKILOBYTES\fR\fR .RS 4 Set the size stack used to run threads to \fIKILOBYTES\fR\&. This value determines the stack size of the threads used to run jobs\&. These threads execute the actions of the builders for the nodes that are out\-of\-date\&. This option has no effect unless the number of concurrent build jobs is larger than one (as set by \fB\-j N\fR or \fB\-\-jobs=N\fR on the command line or \fBSetOption\fR in a script)\&. .sp Using a stack size that is too small may cause stack overflow errors\&. This usually shows up as segmentation faults that cause scons to abort before building anything\&. Using a stack size that is too large will cause scons to use more memory than required and may slow down the entire build process\&. The default value is to use a stack size of 256 kilobytes, which should be appropriate for most uses\&. You should not need to increase this value unless you encounter stack overflow errors\&. .RE .PP \fB\-t\fR, \fB\-\-touch\fR .RS 4 Ignored for compatibility with GNU Make\&. (Touching a file to make it appear up\-to\-date is unnecessary when using \fBscons\fR\&.) .RE .PP \fB\-\-taskmastertrace=\fR\fB\fIfile\fR\fR .RS 4 Prints trace information to the specified \fIfile\fR about how the internal Taskmaster object evaluates and controls the order in which Nodes are built\&. A file name of \fB\-\fR may be used to specify the standard output\&. .RE .PP \fB\-\-tree=\fR\fB\fItype\fR\fR\fB[\fR\fB\fI,type\fR\fR\fB\&.\&.\&.]\fR .RS 4 Prints a tree of the dependencies after each top\-level target is built\&. This prints out some or all of the tree, in various formats, depending on the \fItype\fR specified: .PP \fBall\fR .RS 4 Print the entire dependency tree after each top\-level target is built\&. This prints out the complete dependency tree, including implicit dependencies and ignored dependencies\&. .RE .PP \fBderived\fR .RS 4 Restricts the tree output to only derived (target) files, not source files\&. .RE .PP \fBlinedraw\fR .RS 4 Draw the tree output using Unicode line\-drawing characters instead of plain ASCII text\&. This option acts as a modifier to the selected \fItype\fR(s)\&. If specified alone, without any \fItype\fR, it behaves as if \fBall\fR had been specified\&. .sp \fIAvailable since \fR\fI\fBscons\fR\fR\fI 4\&.0\&.\fR .RE .PP \fBstatus\fR .RS 4 Prints status information for each displayed node\&. .RE .PP \fBprune\fR .RS 4 Prunes the tree to avoid repeating dependency information for nodes that have already been displayed\&. Any node that has already been displayed will have its name printed in \fB[square brackets]\fR, as an indication that the dependencies for that node can be found by searching for the relevant output higher up in the tree\&. .RE .sp Multiple \fItype\fR choices may be specified, separated by commas: .sp .if n \{\ .RS 4 .\} .nf # Prints only derived files, with status information: \fBscons \-\-tree=derived,status\fR # Prints all dependencies of target, with status information # and pruning dependencies of already\-visited Nodes: \fBscons \-\-tree=all,prune,status target\fR .fi .if n \{\ .RE .\} .RE .PP \fB\-u\fR, \fB\-\-up\fR, \fB\-\-search\-up\fR .RS 4 Walks up the directory structure until an SConstruct, Sconstruct, sconstruct, SConstruct\&.py, Sconstruct\&.py or sconstruct\&.py file is found, and uses that as the top of the directory tree\&. If no targets are specified on the command line, only targets at or below the current directory will be built\&. .RE .PP \fB\-U\fR .RS 4 Works exactly the same way as the \fB\-u\fR option except for the way default targets are handled\&. When this option is used and no targets are specified on the command line, all default targets that are defined in the SConscript(s) in the current directory are built, regardless of what directory the resultant targets end up in\&. .RE .PP \fB\-v\fR, \fB\-\-version\fR .RS 4 Print the \fBscons\fR version, copyright information, list of authors, and any other relevant information\&. Then exit\&. .RE .PP \fB\-w\fR, \fB\-\-print\-directory\fR .RS 4 Print a message containing the working directory before and after other processing\&. .RE .PP \fB\-\-no\-print\-directory\fR .RS 4 Turn off \-w, even if it was turned on implicitly\&. .RE .PP \fB\-\-warn=\fR\fB\fItype\fR\fR, \fB\-\-warn=no\-\fR\fB\fItype\fR\fR .RS 4 Enable or disable (with the no\- prefix) warnings\&. \fItype\fR specifies the type of warnings to be enabled or disabled: .PP \fBall\fR .RS 4 All warnings\&. .RE .PP \fBcache\-version\fR .RS 4 Warnings about the derived\-file cache directory specified by \fBCacheDir\fR not using the latest configuration information\&. These warnings are enabled by default\&. .RE .PP \fBcache\-write\-error\fR .RS 4 Warnings about errors trying to write a copy of a built file to a specified derived\-file cache specified by \fBCacheDir\fR\&. These warnings are disabled by default\&. .RE .PP \fBcorrupt\-sconsign\fR .RS 4 Warnings about unfamiliar signature data in \&.sconsign files\&. These warnings are enabled by default\&. .RE .PP \fBdependency\fR .RS 4 Warnings about dependencies\&. These warnings are disabled by default\&. .RE .PP \fBdeprecated\fR .RS 4 Warnings about use of currently deprecated features\&. These warnings are enabled by default\&. Not all deprecation warnings can be disabled with the \fB\-\-warn=no\-deprecated\fR option as some deprecated features which are late in the deprecation cycle may have been designated as mandatory warnings, and these will still display\&. Warnings for certain deprecated features may also be enabled or disabled individually; see below\&. .RE .PP \fBduplicate\-environment\fR .RS 4 Warnings about attempts to specify a build of a target with two different construction environments that use the same action\&. These warnings are enabled by default\&. .RE .PP \fBfortran\-cxx\-mix\fR .RS 4 Warnings about linking Fortran and C++ object files in a single executable, which can yield unpredictable behavior with some compilers\&. .RE .PP \fBfuture\-deprecated\fR .RS 4 Warnings about features that will be deprecated in the future\&. Such warnings are disabled by default\&. Enabling future deprecation warnings is recommended for projects that redistribute SCons configurations for other users to build, so that the project can be warned as soon as possible about to\-be\-deprecated features that may require changes to the configuration\&. .RE .PP \fBlink\fR .RS 4 Warnings about link steps\&. .RE .PP \fBmisleading\-keywords\fR .RS 4 Warnings about the use of two commonly misspelled keywords \fItargets\fR and \fIsources\fR to \fBBuilder\fR calls\&. The correct spelling is the singular form, even though \fItarget\fR and \fIsource\fR can themselves refer to lists of names or nodes\&. .RE .PP \fBmissing\-sconscript\fR .RS 4 Warnings about missing SConscript files\&. These warnings are enabled by default\&. .RE .PP \fBno\-object\-count\fR .RS 4 Warnings about the \fB\-\-debug=object\fR feature not working when \fBscons\fR is run with the Python \fB\-O\fR option or from optimized Python (\&.pyo) modules\&. .RE .PP \fBno\-parallel\-support\fR .RS 4 Warnings about the version of Python not being able to support parallel builds when the \fB\-j\fR option is used\&. These warnings are enabled by default\&. .RE .PP \fBpython\-version\fR .RS 4 Warnings about running SCons with a deprecated version of Python\&. These warnings are enabled by default\&. .RE .PP \fBreserved\-variable\fR .RS 4 Warnings about attempts to set the reserved construction variable names \fB$CHANGED_SOURCES\fR, \fB$CHANGED_TARGETS\fR, \fB$TARGET\fR, \fB$TARGETS\fR, \fB$SOURCE\fR, \fB$SOURCES\fR, \fB$UNCHANGED_SOURCES\fR or \fB$UNCHANGED_TARGETS\fR\&. These warnings are disabled by default\&. .RE .PP \fBstack\-size\fR .RS 4 Warnings about requests to set the stack size that could not be honored\&. These warnings are enabled by default\&. .RE .PP \fBtarget_not_build\fR .RS 4 Warnings about a build rule not building the expected targets\&. These warnings are disabled by default\&. .RE .sp .RE .PP \fB\-Y \fR\fB\fIrepository\fR\fR, \fB\-\-repository=\fR\fB\fIrepository\fR\fR, \fB\-\-srcdir=\fR\fB\fIrepository\fR\fR .RS 4 Search the specified \fIrepository\fR for any input and target files not found in the local directory hierarchy\&. Multiple \fB\-Y\fR options may be specified, in which case the repositories are searched in the order specified\&. .RE .SH "CONFIGURATION FILE REFERENCE" .SS "Construction Environments" .PP A Construction Environment is the basic means by which SConscript files communicate build information to \fBscons\fR\&. A new construction environment is created using the \fBEnvironment\fR function: .sp .if n \{\ .RS 4 .\} .nf env = Environment() .fi .if n \{\ .RE .\} .PP Construction environment attributes called Construction Variables may be set either by specifying them as keyword arguments when the object is created or by assigning them a value after the object is created: .sp .if n \{\ .RS 4 .\} .nf env = Environment(FOO=\*(Aqfoo\*(Aq) env[\*(AqBAR\*(Aq] = \*(Aqbar\*(Aq .fi .if n \{\ .RE .\} .PP An existing construction environment can be duplicated by calling the \fBenv\&.Clone\fR method\&. Without arguments, it will be a copy with the same settings\&. Otherwise, \fBenv\&.Clone\fR takes the same arguments as \fBEnvironment\fR, and uses the arguments to create a modified copy\&. .PP SCons also provides a special construction environment called the Default Environment\&. The default environment is used only for global functions, that is, construction activities called without the context of a regular construction environment\&. See \fBDefaultEnvironment\fR for more information\&. .PP As a convenience, construction variables may also be set or modified by the \fIparse_flags\fR keyword argument, which applies the \fBenv\&.MergeFlags\fR method (described below) to the argument value after all other processing is completed\&. This is useful either if the exact content of the flags is unknown (for example, read from a control file) or if the flags need to be distributed to a number of construction variables\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(parse_flags=\*(Aq\-Iinclude \-DEBUG \-lm\*(Aq) .fi .if n \{\ .RE .\} .PP This example adds \*(Aqinclude\*(Aq to the \fBCPPPATH\fR construction variable \*(AqEBUG\*(Aq to \fBCPPDEFINES\fR, and \*(Aqm\*(Aq to \fBLIBS\fR\&. \fBenv\&.ParseFlags\fR describes how these arguments are distributed to construction variables\&. .PP By default, a new construction environment is initialized with a set of builder methods and construction variables that are appropriate for the current platform\&. An optional \fIplatform\fR keyword argument may be used to specify that the construction environment should be initialized for a different platform: .sp .if n \{\ .RS 4 .\} .nf env = Environment(platform=\*(Aqcygwin\*(Aq) env = Environment(platform=\*(Aqos2\*(Aq) env = Environment(platform=\*(Aqposix\*(Aq) env = Environment(platform=\*(Aqwin32\*(Aq) .fi .if n \{\ .RE .\} .PP Specifying a platform initializes the appropriate construction variables in the environment to use and generate file names with prefixes and suffixes appropriate for that platform\&. .PP Note that the \fBwin32\fR platform adds the \fBSystemDrive\fR and \fBSystemRoot\fR variables from the user\*(Aqs external environment to the construction environment\*(Aqs \fBENV\fR dictionary\&. This is so that any executed commands that use sockets to connect with other systems (such as fetching source files from external CVS repository specifications like :pserver:anonymous@cvs\&.sourceforge\&.net:/cvsroot/scons) will work on Windows systems\&. .PP The \fIplatform\fR argument may be a function or callable object, in which case the \fBEnvironment\fR method will call it to update the new construction environment: .sp .if n \{\ .RS 4 .\} .nf def my_platform(env): env[\*(AqVAR\*(Aq] = \*(Aqxyzzy\*(Aq env = Environment(platform=my_platform) .fi .if n \{\ .RE .\} .SS "Tools" .PP SCons has a large number of predefined tools which are used to help initialize the construction environment, and additional tools can be added\&. An \fBscons\fR tool specification is only responsible for setup\&. For example, if the SConscript file declares the need to construct an object file from a C\-language source file by calling the \fBObject\fR builder, then a tool representing an available C compiler needs to have run first, to set up the builder and all the construction variables it needs, in that construction environment\&. Normally this happens invisibly: \fBscons\fR has per\-platform lists of default tools, and it runs through those tools, calling the ones which are actually applicable (skipping those where necessary programs are not installed on the build system, etc\&.)\&. .PP A specific set of tools with which to initialize the environment when creating it may be specified using the optional keyword argument \fItools\fR\&. This is useful to override the defaults, to specify non\-default built\-in tools, and to supply added tools: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqmsvc\*(Aq, \*(Aqlex\*(Aq]) .fi .if n \{\ .RE .\} .PP Tools can also be called by using the \fBTool\fR method (see below)\&. .PP The \fItools\fR argument overrides the default tool list, it does not add to it, so be sure to include all the tools you need\&. For example if you are building a c/c++ program you must specify a tool for at least a compiler and a linker, as in tools=[\*(Aqclang\*(Aq, \*(Aqlink\*(Aq]\&. The tool name \*(Aqdefault\*(Aq can be used to retain the default list\&. .PP If no \fItools\fR list is specified, or the list includes \*(Aqdefault\*(Aq, then \fBscons\fR will detect usable tools, using the value of \fIPATH\fR in the \fIENV\fR construction variable (\fInot\fR the external \fBPATH\fR from \fIos\&.environ\fR) for looking up any backing programs, and the platform name in effect to determine the default tools for that platform\&. Changing the \fIPATH\fR variable after the construction environment is constructed will not cause the tools to be redetected\&. .PP To help locate added tools, specify the \fItoolpath\fR keyword argument: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdefault\*(Aq, \*(Aqfoo\*(Aq], toolpath=[\*(Aqtools\*(Aq]) .fi .if n \{\ .RE .\} .PP This looks for a tool specification in tools/foo\&.py as well as using the ordinary default tools for the platform\&. .PP Tools in the toolpath are used in preference to any of the built\-in ones\&. For example, adding a tool gcc\&.py to the toolpath directory would override the built\-in gcc tool\&. The toolpath is stored in the environment and will be picked up by subsequent calls to the \fBClone\fR and \fBTool\fR methods: .sp .if n \{\ .RS 4 .\} .nf base = Environment(toolpath=[\*(Aqcustom_path\*(Aq]) derived = base\&.Clone(tools=[\*(Aqcustom_tool\*(Aq]) derived\&.CustomBuilder() .fi .if n \{\ .RE .\} .PP A tool specification must include two functions: .PP \fBgenerate\fR(\fIenv, **kwargs\fR) .RS 4 Modifies the environment referenced by \fIenv\fR to set up variables so that the facilities represented by the tool can be executed\&. It may use any keyword arguments that the user supplies in \fIkwargs\fR to vary its initialization\&. .RE .PP \fBexists\fR(\fIenv\fR) .RS 4 Return \fBTrue\fR if the tool can be called\&. Usually this means looking up one or more known programs using the \fBPATH\fR from the supplied \fIenv\fR, but the tool can make the "exists" decision in any way it chooses\&. .RE .PP The elements of the \fItools\fR list may also be functions or callable objects, in which case the \fBEnvironment\fR method will call those objects to update the new construction environment (see \fBTool\fR for more details): .sp .if n \{\ .RS 4 .\} .nf def my_tool(env): env[\*(AqXYZZY\*(Aq] = \*(Aqxyzzy\*(Aq env = Environment(tools=[my_tool]) .fi .if n \{\ .RE .\} .PP The individual elements of the \fItools\fR list may also themselves be lists or tuples of the form (\fItoolname\fR, \fIkw_dict\fR)\&. SCons searches for the \fItoolname\fR specification file as described above, and passes \fIkw_dict\fR, which must be a dictionary, as keyword arguments to the tool\*(Aqs \fBgenerate\fR function\&. The \fBgenerate\fR function can use the arguments to modify the tool\*(Aqs behavior by setting up the environment in different ways or otherwise changing its initialization\&. .sp .if n \{\ .RS 4 .\} .nf # in tools/my_tool\&.py: def generate(env, **kwargs): # Sets MY_TOOL to the value of keyword \*(Aqarg1\*(Aq \*(Aq1\*(Aq if not supplied env[\*(AqMY_TOOL\*(Aq] = kwargs\&.get(\*(Aqarg1\*(Aq, \*(Aq1\*(Aq) def exists(env): return True # in SConstruct: env = Environment(tools=[\*(Aqdefault\*(Aq, (\*(Aqmy_tool\*(Aq, {\*(Aqarg1\*(Aq: \*(Aqabc\*(Aq})], toolpath=[\*(Aqtools\*(Aq]) .fi .if n \{\ .RE .\} .PP The tool definition (\fBmy_tool\fR in the example) can use the \fBPLATFORM\fR variable from the construction environment it is passed to customize the tool for different platforms\&. .PP Tools can be "nested" \- that is, they can be located within a subdirectory in the toolpath\&. A nested tool name uses a dot to represent a directory separator .sp .if n \{\ .RS 4 .\} .nf # namespaced builder env = Environment(ENV=os\&.environ, tools=[\*(AqSubDir1\&.SubDir2\&.SomeTool\*(Aq]) env\&.SomeTool(targets, sources) # Search Paths # SCons\eTool\eSubDir1\eSubDir2\eSomeTool\&.py # SCons\eTool\eSubDir1\eSubDir2\eSomeTool\e__init__\&.py # \&.\esite_scons\esite_tools\eSubDir1\eSubDir2\eSomeTool\&.py # \&.\esite_scons\esite_tools\eSubDir1\eSubDir2\eSomeTool\e__init__\&.py .fi .if n \{\ .RE .\} .PP SCons supports the following tool specifications out of the box: .PP 386asm .RS 4 Sets construction variables for the 386ASM assembler for the Phar Lap ETS embedded operating system\&. .sp Sets: \fB$AS\fR, \fB$ASCOM\fR, \fB$ASFLAGS\fR, \fB$ASPPCOM\fR, \fB$ASPPFLAGS\fR\&. .sp Uses: \fB$CC\fR, \fB$CPPFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_CPPINCFLAGS\fR\&. .RE .PP aixc++ .RS 4 Sets construction variables for the IMB xlc / Visual Age C++ compiler\&. .sp Sets: \fB$CXX\fR, \fB$CXXVERSION\fR, \fB$SHCXX\fR, \fB$SHOBJSUFFIX\fR\&. .RE .PP aixcc .RS 4 Sets construction variables for the IBM xlc / Visual Age C compiler\&. .sp Sets: \fB$CC\fR, \fB$CCVERSION\fR, \fB$SHCC\fR\&. .RE .PP aixf77 .RS 4 Sets construction variables for the IBM Visual Age f77 Fortran compiler\&. .sp Sets: \fB$F77\fR, \fB$SHF77\fR\&. .RE .PP aixlink .RS 4 Sets construction variables for the IBM Visual Age linker\&. .sp Sets: \fB$LINKFLAGS\fR, \fB$SHLIBSUFFIX\fR, \fB$SHLINKFLAGS\fR\&. .RE .PP applelink .RS 4 Sets construction variables for the Apple linker (similar to the GNU linker)\&. .sp Sets: \fB$APPLELINK_COMPATIBILITY_VERSION\fR, \fB$APPLELINK_CURRENT_VERSION\fR, \fB$APPLELINK_NO_COMPATIBILITY_VERSION\fR, \fB$APPLELINK_NO_CURRENT_VERSION\fR, \fB$FRAMEWORKPATHPREFIX\fR, \fB$LDMODULECOM\fR, \fB$LDMODULEFLAGS\fR, \fB$LDMODULEPREFIX\fR, \fB$LDMODULESUFFIX\fR, \fB$LINKCOM\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR, \fB$_APPLELINK_COMPATIBILITY_VERSION\fR, \fB$_APPLELINK_CURRENT_VERSION\fR, \fB$_FRAMEWORKPATH\fR, \fB$_FRAMEWORKS\fR\&. .sp Uses: \fB$FRAMEWORKSFLAGS\fR\&. .RE .PP ar .RS 4 Sets construction variables for the ar library archiver\&. .sp Sets: \fB$AR\fR, \fB$ARCOM\fR, \fB$ARFLAGS\fR, \fB$LIBPREFIX\fR, \fB$LIBSUFFIX\fR, \fB$RANLIB\fR, \fB$RANLIBCOM\fR, \fB$RANLIBFLAGS\fR\&. .RE .PP as .RS 4 Sets construction variables for the as assembler\&. .sp Sets: \fB$AS\fR, \fB$ASCOM\fR, \fB$ASFLAGS\fR, \fB$ASPPCOM\fR, \fB$ASPPFLAGS\fR\&. .sp Uses: \fB$CC\fR, \fB$CPPFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_CPPINCFLAGS\fR\&. .RE .PP bcc32 .RS 4 Sets construction variables for the bcc32 compiler\&. .sp Sets: \fB$CC\fR, \fB$CCCOM\fR, \fB$CCFLAGS\fR, \fB$CFILESUFFIX\fR, \fB$CFLAGS\fR, \fB$CPPDEFPREFIX\fR, \fB$CPPDEFSUFFIX\fR, \fB$INCPREFIX\fR, \fB$INCSUFFIX\fR, \fB$SHCC\fR, \fB$SHCCCOM\fR, \fB$SHCCFLAGS\fR, \fB$SHCFLAGS\fR, \fB$SHOBJSUFFIX\fR\&. .sp Uses: \fB$_CPPDEFFLAGS\fR, \fB$_CPPINCFLAGS\fR\&. .RE .PP cc .RS 4 Sets construction variables for generic POSIX C compilers\&. .sp Sets: \fB$CC\fR, \fB$CCCOM\fR, \fB$CCFLAGS\fR, \fB$CFILESUFFIX\fR, \fB$CFLAGS\fR, \fB$CPPDEFPREFIX\fR, \fB$CPPDEFSUFFIX\fR, \fB$FRAMEWORKPATH\fR, \fB$FRAMEWORKS\fR, \fB$INCPREFIX\fR, \fB$INCSUFFIX\fR, \fB$SHCC\fR, \fB$SHCCCOM\fR, \fB$SHCCFLAGS\fR, \fB$SHCFLAGS\fR, \fB$SHOBJSUFFIX\fR\&. .sp Uses: \fB$CCCOMSTR\fR, \fB$PLATFORM\fR, \fB$SHCCCOMSTR\fR\&. .RE .PP clang .RS 4 Set construction variables for the Clang C compiler\&. .sp Sets: \fB$CC\fR, \fB$CCVERSION\fR, \fB$SHCCFLAGS\fR\&. .RE .PP clangxx .RS 4 Set construction variables for the Clang C++ compiler\&. .sp Sets: \fB$CXX\fR, \fB$CXXVERSION\fR, \fB$SHCXXFLAGS\fR, \fB$SHOBJSUFFIX\fR, \fB$STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME\fR\&. .RE .PP compilation_db .RS 4 Sets up \fBCompilationDatabase\fR builder which generates a clang tooling compatible compilation database\&. .sp Sets: \fB$COMPILATIONDB_COMSTR\fR, \fB$COMPILATIONDB_USE_ABSPATH\fR\&. .RE .PP cvf .RS 4 Sets construction variables for the Compaq Visual Fortran compiler\&. .sp Sets: \fB$FORTRAN\fR, \fB$FORTRANCOM\fR, \fB$FORTRANMODDIR\fR, \fB$FORTRANMODDIRPREFIX\fR, \fB$FORTRANMODDIRSUFFIX\fR, \fB$FORTRANPPCOM\fR, \fB$OBJSUFFIX\fR, \fB$SHFORTRANCOM\fR, \fB$SHFORTRANPPCOM\fR\&. .sp Uses: \fB$CPPFLAGS\fR, \fB$FORTRANFLAGS\fR, \fB$SHFORTRANFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_FORTRANINCFLAGS\fR, \fB$_FORTRANMODFLAG\fR\&. .RE .PP cXX .RS 4 Sets construction variables for generic POSIX C++ compilers\&. .sp Sets: \fB$CPPDEFPREFIX\fR, \fB$CPPDEFSUFFIX\fR, \fB$CXX\fR, \fB$CXXCOM\fR, \fB$CXXFILESUFFIX\fR, \fB$CXXFLAGS\fR, \fB$INCPREFIX\fR, \fB$INCSUFFIX\fR, \fB$OBJSUFFIX\fR, \fB$SHCXX\fR, \fB$SHCXXCOM\fR, \fB$SHCXXFLAGS\fR, \fB$SHOBJSUFFIX\fR\&. .sp Uses: \fB$CXXCOMSTR\fR, \fB$SHCXXCOMSTR\fR\&. .RE .PP cyglink .RS 4 Set construction variables for cygwin linker/loader\&. .sp Sets: \fB$IMPLIBPREFIX\fR, \fB$IMPLIBSUFFIX\fR, \fB$LDMODULEVERSIONFLAGS\fR, \fB$LINKFLAGS\fR, \fB$RPATHPREFIX\fR, \fB$RPATHSUFFIX\fR, \fB$SHLIBPREFIX\fR, \fB$SHLIBSUFFIX\fR, \fB$SHLIBVERSIONFLAGS\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR, \fB$_LDMODULEVERSIONFLAGS\fR, \fB$_SHLIBVERSIONFLAGS\fR\&. .RE .PP default .RS 4 Sets construction variables for a default list of Tool modules\&. Use \fBdefault\fR in the tools list to retain the original defaults, since the \fItools\fR parameter is treated as a literal statement of the tools to be made available in that construction environment, not an addition\&. .sp The list of tools selected by default is not static, but is dependent both on the platform and on the software installed on the platform\&. Some tools will not initialize if an underlying command is not found, and some tools are selected from a list of choices on a first\-found basis\&. The finished tool list can be examined by inspecting the \fBTOOLS\fR construction variable in the construction environment\&. .sp On all platforms, all tools from the following list are selected whose respective conditions are met: filesystem, wix, lex, yacc, rpcgen, swig, jar, javac, javah, rmic, dvipdf, dvips, gs, tex, latex, pdflatex, pdftex, tar, zip, textfile\&. .sp On Linux systems, the default tools list selects (first\-found): a C compiler from gcc, intelc, icc, cc; a C++ compiler from g++, intelc, icc, cxx; an assembler from gas, nasm, masm; a linker from gnulink, ilink; a Fortran compiler from gfortran, g77, ifort, ifl, f95, f90, f77; and a static archiver \*(Aqar\*(Aq\&. It also selects all found from the list m4, rpm\&. .sp On Windows systems, the default tools list selects (first\-found): a C compiler from msvc, mingw, gcc, intelc, icl, icc, cc, bcc32; a C++ compiler from msvc, intelc, icc, g++, cxx, bcc32; an assembler from masm, nasm, gas, 386asm; a linker from mslink, gnulink, ilink, linkloc, ilink32; a Fortran compiler from gfortran, g77, ifl, cvf, f95, f90, fortran; and a static archiver from mslib, ar, tlib; It also selects all found from the list msvs, midl\&. .sp On MacOS systems, the default tools list selects (first\-found): a C compiler from gcc, cc; a C++ compiler from g++, cxx; an assembler \*(Aqas\*(Aq; a linker from applelink, gnulink; a Fortran compiler from gfortran, f95, f90, g77; and a static archiver ar\&. It also selects all found from the list m4, rpm\&. .sp Default lists for other platforms can be found by examining the \fBscons\fR source code (see SCons/Tool/__init__\&.py)\&. .RE .PP dmd .RS 4 Sets construction variables for D language compiler DMD\&. .sp Sets: \fB$DC\fR, \fB$DCOM\fR, \fB$DDEBUG\fR, \fB$DDEBUGPREFIX\fR, \fB$DDEBUGSUFFIX\fR, \fB$DFILESUFFIX\fR, \fB$DFLAGPREFIX\fR, \fB$DFLAGS\fR, \fB$DFLAGSUFFIX\fR, \fB$DINCPREFIX\fR, \fB$DINCSUFFIX\fR, \fB$DLIB\fR, \fB$DLIBCOM\fR, \fB$DLIBDIRPREFIX\fR, \fB$DLIBDIRSUFFIX\fR, \fB$DLIBFLAGPREFIX\fR, \fB$DLIBFLAGSUFFIX\fR, \fB$DLIBLINKPREFIX\fR, \fB$DLIBLINKSUFFIX\fR, \fB$DLINK\fR, \fB$DLINKCOM\fR, \fB$DLINKFLAGPREFIX\fR, \fB$DLINKFLAGS\fR, \fB$DLINKFLAGSUFFIX\fR, \fB$DPATH\fR, \fB$DRPATHPREFIX\fR, \fB$DRPATHSUFFIX\fR, \fB$DShLibSonameGenerator\fR, \fB$DVERPREFIX\fR, \fB$DVERSIONS\fR, \fB$DVERSUFFIX\fR, \fB$SHDC\fR, \fB$SHDCOM\fR, \fB$SHDLIBVERSION\fR, \fB$SHDLIBVERSIONFLAGS\fR, \fB$SHDLINK\fR, \fB$SHDLINKCOM\fR, \fB$SHDLINKFLAGS\fR\&. .RE .PP docbook .RS 4 This tool tries to make working with Docbook in SCons a little easier\&. It provides several toolchains for creating different output formats, like HTML or PDF\&. Contained in the package is a distribution of the Docbook XSL stylesheets as of version 1\&.76\&.1\&. As long as you don\*(Aqt specify your own stylesheets for customization, these official versions are picked as default\&.\&.\&.which should reduce the inevitable setup hassles for you\&. .sp Implicit dependencies to images and XIncludes are detected automatically if you meet the HTML requirements\&. The additional stylesheet utils/xmldepend\&.xsl by Paul DuBois is used for this purpose\&. .sp Note, that there is no support for XML catalog resolving offered! This tool calls the XSLT processors and PDF renderers with the stylesheets you specified, that\*(Aqs it\&. The rest lies in your hands and you still have to know what you\*(Aqre doing when resolving names via a catalog\&. .sp For activating the tool "docbook", you have to add its name to the Environment constructor, like this .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) .fi .if n \{\ .RE .\} .sp On its startup, the Docbook tool tries to find a required xsltproc processor, and a PDF renderer, e\&.g\&. fop\&. So make sure that these are added to your system\*(Aqs environment PATH and can be called directly, without specifying their full path\&. .sp For the most basic processing of Docbook to HTML, you need to have installed .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} the Python lxml binding to libxml2, or .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} a standalone XSLT processor, currently detected are xsltproc, saxon, saxon\-xslt and xalan\&. .RE .sp Rendering to PDF requires you to have one of the applications fop or xep installed\&. .sp Creating a HTML or PDF document is very simple and straightforward\&. Say .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtml(\*(Aqmanual\&.html\*(Aq, \*(Aqmanual\&.xml\*(Aq) env\&.DocbookPdf(\*(Aqmanual\&.pdf\*(Aq, \*(Aqmanual\&.xml\*(Aq) .fi .if n \{\ .RE .\} .sp to get both outputs from your XML source manual\&.xml\&. As a shortcut, you can give the stem of the filenames alone, like this: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtml(\*(Aqmanual\*(Aq) env\&.DocbookPdf(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .sp and get the same result\&. Target and source lists are also supported: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtml([\*(Aqmanual\&.html\*(Aq,\*(Aqreference\&.html\*(Aq], [\*(Aqmanual\&.xml\*(Aq,\*(Aqreference\&.xml\*(Aq]) .fi .if n \{\ .RE .\} .sp or even .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtml([\*(Aqmanual\*(Aq,\*(Aqreference\*(Aq]) .fi .if n \{\ .RE .\} .sp .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBImportant\fR .ps -1 .br Whenever you leave out the list of sources, you may not specify a file extension! The Tool uses the given names as file stems, and adds the suffixes for target and source files accordingly\&. .sp .5v .RE The rules given above are valid for the Builders \fBDocbookHtml\fR, \fBDocbookPdf\fR, \fBDocbookEpub\fR, \fBDocbookSlidesPdf\fR and \fBDocbookXInclude\fR\&. For the \fBDocbookMan\fR transformation you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source\&. .sp The Builders \fBDocbookHtmlChunked\fR, \fBDocbookHtmlhelp\fR and \fBDocbookSlidesHtml\fR are special, in that: .sp .RS 4 .ie n \{\ \h'-04' 1.\h'+01'\c .\} .el \{\ .sp -1 .IP " 1." 4.2 .\} they create a large set of files, where the exact names and their number depend on the content of the source file, and .RE .sp .RS 4 .ie n \{\ \h'-04' 2.\h'+01'\c .\} .el \{\ .sp -1 .IP " 2." 4.2 .\} the main target is always named index\&.html, i\&.e\&. the output name for the XSL transformation is not picked up by the stylesheets\&. .RE .sp As a result, there is simply no use in specifying a target HTML name\&. So the basic syntax for these builders is always: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlhelp(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .sp If you want to use a specific XSL file, you can set the additional xsl parameter to your Builder call as follows: .sp .if n \{\ .RS 4 .\} .nf env\&.DocbookHtml(\*(Aqother\&.html\*(Aq, \*(Aqmanual\&.xml\*(Aq, xsl=\*(Aqhtml\&.xsl\*(Aq) .fi .if n \{\ .RE .\} .sp Since this may get tedious if you always use the same local naming for your customized XSL files, e\&.g\&. html\&.xsl for HTML and pdf\&.xsl for PDF output, a set of variables for setting the default XSL name is provided\&. These are: .sp .if n \{\ .RS 4 .\} .nf DOCBOOK_DEFAULT_XSL_HTML DOCBOOK_DEFAULT_XSL_HTMLCHUNKED DOCBOOK_DEFAULT_XSL_HTMLHELP DOCBOOK_DEFAULT_XSL_PDF DOCBOOK_DEFAULT_XSL_EPUB DOCBOOK_DEFAULT_XSL_MAN DOCBOOK_DEFAULT_XSL_SLIDESPDF DOCBOOK_DEFAULT_XSL_SLIDESHTML .fi .if n \{\ .RE .\} .sp and you can set them when constructing your environment: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq], DOCBOOK_DEFAULT_XSL_HTML=\*(Aqhtml\&.xsl\*(Aq, DOCBOOK_DEFAULT_XSL_PDF=\*(Aqpdf\&.xsl\*(Aq) env\&.DocbookHtml(\*(Aqmanual\*(Aq) # now uses html\&.xsl .fi .if n \{\ .RE .\} .sp Sets: \fB$DOCBOOK_DEFAULT_XSL_EPUB\fR, \fB$DOCBOOK_DEFAULT_XSL_HTML\fR, \fB$DOCBOOK_DEFAULT_XSL_HTMLCHUNKED\fR, \fB$DOCBOOK_DEFAULT_XSL_HTMLHELP\fR, \fB$DOCBOOK_DEFAULT_XSL_MAN\fR, \fB$DOCBOOK_DEFAULT_XSL_PDF\fR, \fB$DOCBOOK_DEFAULT_XSL_SLIDESHTML\fR, \fB$DOCBOOK_DEFAULT_XSL_SLIDESPDF\fR, \fB$DOCBOOK_FOP\fR, \fB$DOCBOOK_FOPCOM\fR, \fB$DOCBOOK_FOPFLAGS\fR, \fB$DOCBOOK_XMLLINT\fR, \fB$DOCBOOK_XMLLINTCOM\fR, \fB$DOCBOOK_XMLLINTFLAGS\fR, \fB$DOCBOOK_XSLTPROC\fR, \fB$DOCBOOK_XSLTPROCCOM\fR, \fB$DOCBOOK_XSLTPROCFLAGS\fR, \fB$DOCBOOK_XSLTPROCPARAMS\fR\&. .sp Uses: \fB$DOCBOOK_FOPCOMSTR\fR, \fB$DOCBOOK_XMLLINTCOMSTR\fR, \fB$DOCBOOK_XSLTPROCCOMSTR\fR\&. .RE .PP dvi .RS 4 Attaches the \fBDVI\fR builder to the construction environment\&. .RE .PP dvipdf .RS 4 Sets construction variables for the dvipdf utility\&. .sp Sets: \fB$DVIPDF\fR, \fB$DVIPDFCOM\fR, \fB$DVIPDFFLAGS\fR\&. .sp Uses: \fB$DVIPDFCOMSTR\fR\&. .RE .PP dvips .RS 4 Sets construction variables for the dvips utility\&. .sp Sets: \fB$DVIPS\fR, \fB$DVIPSFLAGS\fR, \fB$PSCOM\fR, \fB$PSPREFIX\fR, \fB$PSSUFFIX\fR\&. .sp Uses: \fB$PSCOMSTR\fR\&. .RE .PP f03 .RS 4 Set construction variables for generic POSIX Fortran 03 compilers\&. .sp Sets: \fB$F03\fR, \fB$F03COM\fR, \fB$F03FLAGS\fR, \fB$F03PPCOM\fR, \fB$SHF03\fR, \fB$SHF03COM\fR, \fB$SHF03FLAGS\fR, \fB$SHF03PPCOM\fR, \fB$_F03INCFLAGS\fR\&. .sp Uses: \fB$F03COMSTR\fR, \fB$F03PPCOMSTR\fR, \fB$SHF03COMSTR\fR, \fB$SHF03PPCOMSTR\fR\&. .RE .PP f08 .RS 4 Set construction variables for generic POSIX Fortran 08 compilers\&. .sp Sets: \fB$F08\fR, \fB$F08COM\fR, \fB$F08FLAGS\fR, \fB$F08PPCOM\fR, \fB$SHF08\fR, \fB$SHF08COM\fR, \fB$SHF08FLAGS\fR, \fB$SHF08PPCOM\fR, \fB$_F08INCFLAGS\fR\&. .sp Uses: \fB$F08COMSTR\fR, \fB$F08PPCOMSTR\fR, \fB$SHF08COMSTR\fR, \fB$SHF08PPCOMSTR\fR\&. .RE .PP f77 .RS 4 Set construction variables for generic POSIX Fortran 77 compilers\&. .sp Sets: \fB$F77\fR, \fB$F77COM\fR, \fB$F77FILESUFFIXES\fR, \fB$F77FLAGS\fR, \fB$F77PPCOM\fR, \fB$F77PPFILESUFFIXES\fR, \fB$FORTRAN\fR, \fB$FORTRANCOM\fR, \fB$FORTRANFLAGS\fR, \fB$SHF77\fR, \fB$SHF77COM\fR, \fB$SHF77FLAGS\fR, \fB$SHF77PPCOM\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANCOM\fR, \fB$SHFORTRANFLAGS\fR, \fB$SHFORTRANPPCOM\fR, \fB$_F77INCFLAGS\fR\&. .sp Uses: \fB$F77COMSTR\fR, \fB$F77PPCOMSTR\fR, \fB$FORTRANCOMSTR\fR, \fB$FORTRANPPCOMSTR\fR, \fB$SHF77COMSTR\fR, \fB$SHF77PPCOMSTR\fR, \fB$SHFORTRANCOMSTR\fR, \fB$SHFORTRANPPCOMSTR\fR\&. .RE .PP f90 .RS 4 Set construction variables for generic POSIX Fortran 90 compilers\&. .sp Sets: \fB$F90\fR, \fB$F90COM\fR, \fB$F90FLAGS\fR, \fB$F90PPCOM\fR, \fB$SHF90\fR, \fB$SHF90COM\fR, \fB$SHF90FLAGS\fR, \fB$SHF90PPCOM\fR, \fB$_F90INCFLAGS\fR\&. .sp Uses: \fB$F90COMSTR\fR, \fB$F90PPCOMSTR\fR, \fB$SHF90COMSTR\fR, \fB$SHF90PPCOMSTR\fR\&. .RE .PP f95 .RS 4 Set construction variables for generic POSIX Fortran 95 compilers\&. .sp Sets: \fB$F95\fR, \fB$F95COM\fR, \fB$F95FLAGS\fR, \fB$F95PPCOM\fR, \fB$SHF95\fR, \fB$SHF95COM\fR, \fB$SHF95FLAGS\fR, \fB$SHF95PPCOM\fR, \fB$_F95INCFLAGS\fR\&. .sp Uses: \fB$F95COMSTR\fR, \fB$F95PPCOMSTR\fR, \fB$SHF95COMSTR\fR, \fB$SHF95PPCOMSTR\fR\&. .RE .PP fortran .RS 4 Set construction variables for generic POSIX Fortran compilers\&. .sp Sets: \fB$FORTRAN\fR, \fB$FORTRANCOM\fR, \fB$FORTRANFLAGS\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANCOM\fR, \fB$SHFORTRANFLAGS\fR, \fB$SHFORTRANPPCOM\fR\&. .sp Uses: \fB$FORTRANCOMSTR\fR, \fB$FORTRANPPCOMSTR\fR, \fB$SHFORTRANCOMSTR\fR, \fB$SHFORTRANPPCOMSTR\fR\&. .RE .PP g++ .RS 4 Set construction variables for the gXX C++ compiler\&. .sp Sets: \fB$CXX\fR, \fB$CXXVERSION\fR, \fB$SHCXXFLAGS\fR, \fB$SHOBJSUFFIX\fR\&. .RE .PP g77 .RS 4 Set construction variables for the g77 Fortran compiler\&. Calls the f77 Tool module to set variables\&. .RE .PP gas .RS 4 Sets construction variables for the gas assembler\&. Calls the as module\&. .sp Sets: \fB$AS\fR\&. .RE .PP gcc .RS 4 Set construction variables for the gcc C compiler\&. .sp Sets: \fB$CC\fR, \fB$CCVERSION\fR, \fB$SHCCFLAGS\fR\&. .RE .PP gdc .RS 4 Sets construction variables for the D language compiler GDC\&. .sp Sets: \fB$DC\fR, \fB$DCOM\fR, \fB$DDEBUG\fR, \fB$DDEBUGPREFIX\fR, \fB$DDEBUGSUFFIX\fR, \fB$DFILESUFFIX\fR, \fB$DFLAGPREFIX\fR, \fB$DFLAGS\fR, \fB$DFLAGSUFFIX\fR, \fB$DINCPREFIX\fR, \fB$DINCSUFFIX\fR, \fB$DLIB\fR, \fB$DLIBCOM\fR, \fB$DLIBDIRPREFIX\fR, \fB$DLIBDIRSUFFIX\fR, \fB$DLIBFLAGPREFIX\fR, \fB$DLIBFLAGSUFFIX\fR, \fB$DLIBLINKPREFIX\fR, \fB$DLIBLINKSUFFIX\fR, \fB$DLINK\fR, \fB$DLINKCOM\fR, \fB$DLINKFLAGPREFIX\fR, \fB$DLINKFLAGS\fR, \fB$DLINKFLAGSUFFIX\fR, \fB$DPATH\fR, \fB$DRPATHPREFIX\fR, \fB$DRPATHSUFFIX\fR, \fB$DShLibSonameGenerator\fR, \fB$DVERPREFIX\fR, \fB$DVERSIONS\fR, \fB$DVERSUFFIX\fR, \fB$SHDC\fR, \fB$SHDCOM\fR, \fB$SHDLIBVERSION\fR, \fB$SHDLIBVERSIONFLAGS\fR, \fB$SHDLINK\fR, \fB$SHDLINKCOM\fR, \fB$SHDLINKFLAGS\fR\&. .RE .PP gettext .RS 4 This is actually a toolset, which supports internationalization and localization of software being constructed with SCons\&. The toolset loads following tools: .sp .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} xgettext \- to extract internationalized messages from source code to POT file(s), .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} msginit \- may be optionally used to initialize PO files, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} msgmerge \- to update PO files, that already contain translated messages, .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} msgfmt \- to compile textual PO file to binary installable MO file\&. .RE .sp When you enable gettext, it internally loads all abovementioned tools, so you\*(Aqre encouraged to see their individual documentation\&. .sp Each of the above tools provides its own builder(s) which may be used to perform particular activities related to software internationalization\&. You may be however interested in \fItop\-level\fR builder \fBTranslate\fR described few paragraphs later\&. .sp To use gettext tools add \*(Aqgettext\*(Aq tool to your environment: .sp .if n \{\ .RS 4 .\} .nf env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqgettext\*(Aq] ) .fi .if n \{\ .RE .\} .RE .PP gfortran .RS 4 Sets construction variables for the GNU F95/F2003 GNU compiler\&. .sp Sets: \fB$F77\fR, \fB$F90\fR, \fB$F95\fR, \fB$FORTRAN\fR, \fB$SHF77\fR, \fB$SHF77FLAGS\fR, \fB$SHF90\fR, \fB$SHF90FLAGS\fR, \fB$SHF95\fR, \fB$SHF95FLAGS\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANFLAGS\fR\&. .RE .PP gnulink .RS 4 Set construction variables for GNU linker/loader\&. .sp Sets: \fB$LDMODULEVERSIONFLAGS\fR, \fB$RPATHPREFIX\fR, \fB$RPATHSUFFIX\fR, \fB$SHLIBVERSIONFLAGS\fR, \fB$SHLINKFLAGS\fR, \fB$_LDMODULESONAME\fR, \fB$_SHLIBSONAME\fR\&. .RE .PP gs .RS 4 This Tool sets the required construction variables for working with the Ghostscript command\&. It also registers an appropriate Action with the PDF Builder (\fBPDF\fR), such that the conversion from PS/EPS to PDF happens automatically for the TeX/LaTeX toolchain\&. Finally, it adds an explicit Ghostscript Builder (\fBGs\fR) to the environment\&. .sp Sets: \fB$GS\fR, \fB$GSCOM\fR, \fB$GSFLAGS\fR\&. .sp Uses: \fB$GSCOMSTR\fR\&. .RE .PP hpc++ .RS 4 Set construction variables for the compilers aCC on HP/UX systems\&. .RE .PP hpcc .RS 4 Set construction variables for the aCC on HP/UX systems\&. Calls the cXX tool for additional variables\&. .sp Sets: \fB$CXX\fR, \fB$CXXVERSION\fR, \fB$SHCXXFLAGS\fR\&. .RE .PP hplink .RS 4 Sets construction variables for the linker on HP/UX systems\&. .sp Sets: \fB$LINKFLAGS\fR, \fB$SHLIBSUFFIX\fR, \fB$SHLINKFLAGS\fR\&. .RE .PP icc .RS 4 Sets construction variables for the icc compiler on OS/2 systems\&. .sp Sets: \fB$CC\fR, \fB$CCCOM\fR, \fB$CFILESUFFIX\fR, \fB$CPPDEFPREFIX\fR, \fB$CPPDEFSUFFIX\fR, \fB$CXXCOM\fR, \fB$CXXFILESUFFIX\fR, \fB$INCPREFIX\fR, \fB$INCSUFFIX\fR\&. .sp Uses: \fB$CCFLAGS\fR, \fB$CFLAGS\fR, \fB$CPPFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_CPPINCFLAGS\fR\&. .RE .PP icl .RS 4 Sets construction variables for the Intel C/C++ compiler\&. Calls the intelc Tool module to set its variables\&. .RE .PP ifl .RS 4 Sets construction variables for the Intel Fortran compiler\&. .sp Sets: \fB$FORTRAN\fR, \fB$FORTRANCOM\fR, \fB$FORTRANPPCOM\fR, \fB$SHFORTRANCOM\fR, \fB$SHFORTRANPPCOM\fR\&. .sp Uses: \fB$CPPFLAGS\fR, \fB$FORTRANFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_FORTRANINCFLAGS\fR\&. .RE .PP ifort .RS 4 Sets construction variables for newer versions of the Intel Fortran compiler for Linux\&. .sp Sets: \fB$F77\fR, \fB$F90\fR, \fB$F95\fR, \fB$FORTRAN\fR, \fB$SHF77\fR, \fB$SHF77FLAGS\fR, \fB$SHF90\fR, \fB$SHF90FLAGS\fR, \fB$SHF95\fR, \fB$SHF95FLAGS\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANFLAGS\fR\&. .RE .PP ilink .RS 4 Sets construction variables for the ilink linker on OS/2 systems\&. .sp Sets: \fB$LIBDIRPREFIX\fR, \fB$LIBDIRSUFFIX\fR, \fB$LIBLINKPREFIX\fR, \fB$LIBLINKSUFFIX\fR, \fB$LINK\fR, \fB$LINKCOM\fR, \fB$LINKFLAGS\fR\&. .RE .PP ilink32 .RS 4 Sets construction variables for the Borland ilink32 linker\&. .sp Sets: \fB$LIBDIRPREFIX\fR, \fB$LIBDIRSUFFIX\fR, \fB$LIBLINKPREFIX\fR, \fB$LIBLINKSUFFIX\fR, \fB$LINK\fR, \fB$LINKCOM\fR, \fB$LINKFLAGS\fR\&. .RE .PP install .RS 4 Sets construction variables for file and directory installation\&. .sp Sets: \fB$INSTALL\fR, \fB$INSTALLSTR\fR\&. .RE .PP intelc .RS 4 Sets construction variables for the Intel C/C++ compiler (Linux and Windows, version 7 and later)\&. Calls the gcc or msvc (on Linux and Windows, respectively) to set underlying variables\&. .sp Sets: \fB$AR\fR, \fB$CC\fR, \fB$CXX\fR, \fB$INTEL_C_COMPILER_VERSION\fR, \fB$LINK\fR\&. .RE .PP jar .RS 4 Sets construction variables for the jar utility\&. .sp Sets: \fB$JAR\fR, \fB$JARCOM\fR, \fB$JARFLAGS\fR, \fB$JARSUFFIX\fR\&. .sp Uses: \fB$JARCOMSTR\fR\&. .RE .PP javac .RS 4 Sets construction variables for the javac compiler\&. .sp Sets: \fB$JAVABOOTCLASSPATH\fR, \fB$JAVAC\fR, \fB$JAVACCOM\fR, \fB$JAVACFLAGS\fR, \fB$JAVACLASSPATH\fR, \fB$JAVACLASSSUFFIX\fR, \fB$JAVAINCLUDES\fR, \fB$JAVASOURCEPATH\fR, \fB$JAVASUFFIX\fR\&. .sp Uses: \fB$JAVACCOMSTR\fR\&. .RE .PP javah .RS 4 Sets construction variables for the javah tool\&. .sp Sets: \fB$JAVACLASSSUFFIX\fR, \fB$JAVAH\fR, \fB$JAVAHCOM\fR, \fB$JAVAHFLAGS\fR\&. .sp Uses: \fB$JAVACLASSPATH\fR, \fB$JAVAHCOMSTR\fR\&. .RE .PP latex .RS 4 Sets construction variables for the latex utility\&. .sp Sets: \fB$LATEX\fR, \fB$LATEXCOM\fR, \fB$LATEXFLAGS\fR\&. .sp Uses: \fB$LATEXCOMSTR\fR\&. .RE .PP ldc .RS 4 Sets construction variables for the D language compiler LDC2\&. .sp Sets: \fB$DC\fR, \fB$DCOM\fR, \fB$DDEBUG\fR, \fB$DDEBUGPREFIX\fR, \fB$DDEBUGSUFFIX\fR, \fB$DFILESUFFIX\fR, \fB$DFLAGPREFIX\fR, \fB$DFLAGS\fR, \fB$DFLAGSUFFIX\fR, \fB$DINCPREFIX\fR, \fB$DINCSUFFIX\fR, \fB$DLIB\fR, \fB$DLIBCOM\fR, \fB$DLIBDIRPREFIX\fR, \fB$DLIBDIRSUFFIX\fR, \fB$DLIBFLAGPREFIX\fR, \fB$DLIBFLAGSUFFIX\fR, \fB$DLIBLINKPREFIX\fR, \fB$DLIBLINKSUFFIX\fR, \fB$DLINK\fR, \fB$DLINKCOM\fR, \fB$DLINKFLAGPREFIX\fR, \fB$DLINKFLAGS\fR, \fB$DLINKFLAGSUFFIX\fR, \fB$DPATH\fR, \fB$DRPATHPREFIX\fR, \fB$DRPATHSUFFIX\fR, \fB$DShLibSonameGenerator\fR, \fB$DVERPREFIX\fR, \fB$DVERSIONS\fR, \fB$DVERSUFFIX\fR, \fB$SHDC\fR, \fB$SHDCOM\fR, \fB$SHDLIBVERSION\fR, \fB$SHDLIBVERSIONFLAGS\fR, \fB$SHDLINK\fR, \fB$SHDLINKCOM\fR, \fB$SHDLINKFLAGS\fR\&. .RE .PP lex .RS 4 Sets construction variables for the lex lexical analyser\&. .sp Sets: \fB$LEX\fR, \fB$LEXCOM\fR, \fB$LEXFLAGS\fR, \fB$LEXUNISTD\fR\&. .sp Uses: \fB$LEXCOMSTR\fR\&. .RE .PP link .RS 4 Sets construction variables for generic POSIX linkers\&. This is a "smart" linker tool which selects a compiler to complete the linking based on the types of source files\&. .sp Sets: \fB$LDMODULE\fR, \fB$LDMODULECOM\fR, \fB$LDMODULEFLAGS\fR, \fB$LDMODULENOVERSIONSYMLINKS\fR, \fB$LDMODULEPREFIX\fR, \fB$LDMODULESUFFIX\fR, \fB$LDMODULEVERSION\fR, \fB$LDMODULEVERSIONFLAGS\fR, \fB$LIBDIRPREFIX\fR, \fB$LIBDIRSUFFIX\fR, \fB$LIBLINKPREFIX\fR, \fB$LIBLINKSUFFIX\fR, \fB$LINK\fR, \fB$LINKCOM\fR, \fB$LINKFLAGS\fR, \fB$SHLIBSUFFIX\fR, \fB$SHLINK\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR, \fB$__LDMODULEVERSIONFLAGS\fR, \fB$__SHLIBVERSIONFLAGS\fR\&. .sp Uses: \fB$LDMODULECOMSTR\fR, \fB$LINKCOMSTR\fR, \fB$SHLINKCOMSTR\fR\&. .RE .PP linkloc .RS 4 Sets construction variables for the LinkLoc linker for the Phar Lap ETS embedded operating system\&. .sp Sets: \fB$LIBDIRPREFIX\fR, \fB$LIBDIRSUFFIX\fR, \fB$LIBLINKPREFIX\fR, \fB$LIBLINKSUFFIX\fR, \fB$LINK\fR, \fB$LINKCOM\fR, \fB$LINKFLAGS\fR, \fB$SHLINK\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR\&. .sp Uses: \fB$LINKCOMSTR\fR, \fB$SHLINKCOMSTR\fR\&. .RE .PP m4 .RS 4 Sets construction variables for the m4 macro processor\&. .sp Sets: \fB$M4\fR, \fB$M4COM\fR, \fB$M4FLAGS\fR\&. .sp Uses: \fB$M4COMSTR\fR\&. .RE .PP masm .RS 4 Sets construction variables for the Microsoft assembler\&. .sp Sets: \fB$AS\fR, \fB$ASCOM\fR, \fB$ASFLAGS\fR, \fB$ASPPCOM\fR, \fB$ASPPFLAGS\fR\&. .sp Uses: \fB$ASCOMSTR\fR, \fB$ASPPCOMSTR\fR, \fB$CPPFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_CPPINCFLAGS\fR\&. .RE .PP midl .RS 4 Sets construction variables for the Microsoft IDL compiler\&. .sp Sets: \fB$MIDL\fR, \fB$MIDLCOM\fR, \fB$MIDLFLAGS\fR\&. .sp Uses: \fB$MIDLCOMSTR\fR\&. .RE .PP mingw .RS 4 Sets construction variables for MinGW (Minimal Gnu on Windows)\&. .sp Sets: \fB$AS\fR, \fB$CC\fR, \fB$CXX\fR, \fB$LDMODULECOM\fR, \fB$LIBPREFIX\fR, \fB$LIBSUFFIX\fR, \fB$OBJSUFFIX\fR, \fB$RC\fR, \fB$RCCOM\fR, \fB$RCFLAGS\fR, \fB$RCINCFLAGS\fR, \fB$RCINCPREFIX\fR, \fB$RCINCSUFFIX\fR, \fB$SHCCFLAGS\fR, \fB$SHCXXFLAGS\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR, \fB$SHOBJSUFFIX\fR, \fB$WINDOWSDEFPREFIX\fR, \fB$WINDOWSDEFSUFFIX\fR\&. .sp Uses: \fB$RCCOMSTR\fR, \fB$SHLINKCOMSTR\fR\&. .RE .PP msgfmt .RS 4 This scons tool is a part of scons gettext toolset\&. It provides scons interface to \fBmsgfmt(1)\fR command, which generates binary message catalog (MO) from a textual translation description (PO)\&. .sp Sets: \fB$MOSUFFIX\fR, \fB$MSGFMT\fR, \fB$MSGFMTCOM\fR, \fB$MSGFMTCOMSTR\fR, \fB$MSGFMTFLAGS\fR, \fB$POSUFFIX\fR\&. .sp Uses: \fB$LINGUAS_FILE\fR\&. .RE .PP msginit .RS 4 This scons tool is a part of scons gettext toolset\&. It provides scons interface to \fBmsginit(1)\fR program, which creates new PO file, initializing the meta information with values from user\*(Aqs environment (or options)\&. .sp Sets: \fB$MSGINIT\fR, \fB$MSGINITCOM\fR, \fB$MSGINITCOMSTR\fR, \fB$MSGINITFLAGS\fR, \fB$POAUTOINIT\fR, \fB$POCREATE_ALIAS\fR, \fB$POSUFFIX\fR, \fB$POTSUFFIX\fR, \fB$_MSGINITLOCALE\fR\&. .sp Uses: \fB$LINGUAS_FILE\fR, \fB$POAUTOINIT\fR, \fB$POTDOMAIN\fR\&. .RE .PP msgmerge .RS 4 This scons tool is a part of scons gettext toolset\&. It provides scons interface to \fBmsgmerge(1)\fR command, which merges two Uniform style \&.po files together\&. .sp Sets: \fB$MSGMERGE\fR, \fB$MSGMERGECOM\fR, \fB$MSGMERGECOMSTR\fR, \fB$MSGMERGEFLAGS\fR, \fB$POSUFFIX\fR, \fB$POTSUFFIX\fR, \fB$POUPDATE_ALIAS\fR\&. .sp Uses: \fB$LINGUAS_FILE\fR, \fB$POAUTOINIT\fR, \fB$POTDOMAIN\fR\&. .RE .PP mslib .RS 4 Sets construction variables for the Microsoft mslib library archiver\&. .sp Sets: \fB$AR\fR, \fB$ARCOM\fR, \fB$ARFLAGS\fR, \fB$LIBPREFIX\fR, \fB$LIBSUFFIX\fR\&. .sp Uses: \fB$ARCOMSTR\fR\&. .RE .PP mslink .RS 4 Sets construction variables for the Microsoft linker\&. .sp Sets: \fB$LDMODULE\fR, \fB$LDMODULECOM\fR, \fB$LDMODULEFLAGS\fR, \fB$LDMODULEPREFIX\fR, \fB$LDMODULESUFFIX\fR, \fB$LIBDIRPREFIX\fR, \fB$LIBDIRSUFFIX\fR, \fB$LIBLINKPREFIX\fR, \fB$LIBLINKSUFFIX\fR, \fB$LINK\fR, \fB$LINKCOM\fR, \fB$LINKFLAGS\fR, \fB$REGSVR\fR, \fB$REGSVRCOM\fR, \fB$REGSVRFLAGS\fR, \fB$SHLINK\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR, \fB$WIN32DEFPREFIX\fR, \fB$WIN32DEFSUFFIX\fR, \fB$WIN32EXPPREFIX\fR, \fB$WIN32EXPSUFFIX\fR, \fB$WINDOWSDEFPREFIX\fR, \fB$WINDOWSDEFSUFFIX\fR, \fB$WINDOWSEXPPREFIX\fR, \fB$WINDOWSEXPSUFFIX\fR, \fB$WINDOWSPROGMANIFESTPREFIX\fR, \fB$WINDOWSPROGMANIFESTSUFFIX\fR, \fB$WINDOWSSHLIBMANIFESTPREFIX\fR, \fB$WINDOWSSHLIBMANIFESTSUFFIX\fR, \fB$WINDOWS_INSERT_DEF\fR\&. .sp Uses: \fB$LDMODULECOMSTR\fR, \fB$LINKCOMSTR\fR, \fB$REGSVRCOMSTR\fR, \fB$SHLINKCOMSTR\fR\&. .RE .PP mssdk .RS 4 Sets variables for Microsoft Platform SDK and/or Windows SDK\&. Note that unlike most other Tool modules, mssdk does not set construction variables, but sets the \fIenvironment variables\fR in the environment SCons uses to execute the Microsoft toolchain: %INCLUDE%, %LIB%, %LIBPATH% and %PATH%\&. .sp Uses: \fB$MSSDK_DIR\fR, \fB$MSSDK_VERSION\fR, \fB$MSVS_VERSION\fR\&. .RE .PP msvc .RS 4 Sets construction variables for the Microsoft Visual C/C++ compiler\&. .sp Sets: \fB$BUILDERS\fR, \fB$CC\fR, \fB$CCCOM\fR, \fB$CCFLAGS\fR, \fB$CCPCHFLAGS\fR, \fB$CCPDBFLAGS\fR, \fB$CFILESUFFIX\fR, \fB$CFLAGS\fR, \fB$CPPDEFPREFIX\fR, \fB$CPPDEFSUFFIX\fR, \fB$CXX\fR, \fB$CXXCOM\fR, \fB$CXXFILESUFFIX\fR, \fB$CXXFLAGS\fR, \fB$INCPREFIX\fR, \fB$INCSUFFIX\fR, \fB$OBJPREFIX\fR, \fB$OBJSUFFIX\fR, \fB$PCHCOM\fR, \fB$PCHPDBFLAGS\fR, \fB$RC\fR, \fB$RCCOM\fR, \fB$RCFLAGS\fR, \fB$SHCC\fR, \fB$SHCCCOM\fR, \fB$SHCCFLAGS\fR, \fB$SHCFLAGS\fR, \fB$SHCXX\fR, \fB$SHCXXCOM\fR, \fB$SHCXXFLAGS\fR, \fB$SHOBJPREFIX\fR, \fB$SHOBJSUFFIX\fR\&. .sp Uses: \fB$CCCOMSTR\fR, \fB$CXXCOMSTR\fR, \fB$PCH\fR, \fB$PCHSTOP\fR, \fB$PDB\fR, \fB$SHCCCOMSTR\fR, \fB$SHCXXCOMSTR\fR\&. .RE .PP msvs .RS 4 Sets construction variables for Microsoft Visual Studio\&. .sp Sets: \fB$MSVSBUILDCOM\fR, \fB$MSVSCLEANCOM\fR, \fB$MSVSENCODING\fR, \fB$MSVSPROJECTCOM\fR, \fB$MSVSREBUILDCOM\fR, \fB$MSVSSCONS\fR, \fB$MSVSSCONSCOM\fR, \fB$MSVSSCONSCRIPT\fR, \fB$MSVSSCONSFLAGS\fR, \fB$MSVSSOLUTIONCOM\fR\&. .RE .PP mwcc .RS 4 Sets construction variables for the Metrowerks CodeWarrior compiler\&. .sp Sets: \fB$CC\fR, \fB$CCCOM\fR, \fB$CFILESUFFIX\fR, \fB$CPPDEFPREFIX\fR, \fB$CPPDEFSUFFIX\fR, \fB$CXX\fR, \fB$CXXCOM\fR, \fB$CXXFILESUFFIX\fR, \fB$INCPREFIX\fR, \fB$INCSUFFIX\fR, \fB$MWCW_VERSION\fR, \fB$MWCW_VERSIONS\fR, \fB$SHCC\fR, \fB$SHCCCOM\fR, \fB$SHCCFLAGS\fR, \fB$SHCFLAGS\fR, \fB$SHCXX\fR, \fB$SHCXXCOM\fR, \fB$SHCXXFLAGS\fR\&. .sp Uses: \fB$CCCOMSTR\fR, \fB$CXXCOMSTR\fR, \fB$SHCCCOMSTR\fR, \fB$SHCXXCOMSTR\fR\&. .RE .PP mwld .RS 4 Sets construction variables for the Metrowerks CodeWarrior linker\&. .sp Sets: \fB$AR\fR, \fB$ARCOM\fR, \fB$LIBDIRPREFIX\fR, \fB$LIBDIRSUFFIX\fR, \fB$LIBLINKPREFIX\fR, \fB$LIBLINKSUFFIX\fR, \fB$LINK\fR, \fB$LINKCOM\fR, \fB$SHLINK\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR\&. .RE .PP nasm .RS 4 Sets construction variables for the nasm Netwide Assembler\&. .sp Sets: \fB$AS\fR, \fB$ASCOM\fR, \fB$ASFLAGS\fR, \fB$ASPPCOM\fR, \fB$ASPPFLAGS\fR\&. .sp Uses: \fB$ASCOMSTR\fR, \fB$ASPPCOMSTR\fR\&. .RE .PP packaging .RS 4 A framework for building binary and source packages\&. .RE .PP Packaging .RS 4 Sets construction variables for the \fBPackage\fR Builder\&. .RE .PP pdf .RS 4 Sets construction variables for the Portable Document Format builder\&. .sp Sets: \fB$PDFPREFIX\fR, \fB$PDFSUFFIX\fR\&. .RE .PP pdflatex .RS 4 Sets construction variables for the pdflatex utility\&. .sp Sets: \fB$LATEXRETRIES\fR, \fB$PDFLATEX\fR, \fB$PDFLATEXCOM\fR, \fB$PDFLATEXFLAGS\fR\&. .sp Uses: \fB$PDFLATEXCOMSTR\fR\&. .RE .PP pdftex .RS 4 Sets construction variables for the pdftex utility\&. .sp Sets: \fB$LATEXRETRIES\fR, \fB$PDFLATEX\fR, \fB$PDFLATEXCOM\fR, \fB$PDFLATEXFLAGS\fR, \fB$PDFTEX\fR, \fB$PDFTEXCOM\fR, \fB$PDFTEXFLAGS\fR\&. .sp Uses: \fB$PDFLATEXCOMSTR\fR, \fB$PDFTEXCOMSTR\fR\&. .RE .PP python .RS 4 Loads the Python source scanner into the invoking environment\&. When loaded, the scanner will attempt to find implicit dependencies for any Python source files in the list of sources provided to an Action that uses this environment\&. .sp \fIAvailable since \fR\fI\fBscons\fR\fR\fI 4\&.0\&.\fR\&. .RE .PP qt .RS 4 Sets construction variables for building Qt applications\&. .sp Sets: \fB$QTDIR\fR, \fB$QT_AUTOSCAN\fR, \fB$QT_BINPATH\fR, \fB$QT_CPPPATH\fR, \fB$QT_LIB\fR, \fB$QT_LIBPATH\fR, \fB$QT_MOC\fR, \fB$QT_MOCCXXPREFIX\fR, \fB$QT_MOCCXXSUFFIX\fR, \fB$QT_MOCFROMCXXCOM\fR, \fB$QT_MOCFROMCXXFLAGS\fR, \fB$QT_MOCFROMHCOM\fR, \fB$QT_MOCFROMHFLAGS\fR, \fB$QT_MOCHPREFIX\fR, \fB$QT_MOCHSUFFIX\fR, \fB$QT_UIC\fR, \fB$QT_UICCOM\fR, \fB$QT_UICDECLFLAGS\fR, \fB$QT_UICDECLPREFIX\fR, \fB$QT_UICDECLSUFFIX\fR, \fB$QT_UICIMPLFLAGS\fR, \fB$QT_UICIMPLPREFIX\fR, \fB$QT_UICIMPLSUFFIX\fR, \fB$QT_UISUFFIX\fR\&. .RE .PP rmic .RS 4 Sets construction variables for the rmic utility\&. .sp Sets: \fB$JAVACLASSSUFFIX\fR, \fB$RMIC\fR, \fB$RMICCOM\fR, \fB$RMICFLAGS\fR\&. .sp Uses: \fB$RMICCOMSTR\fR\&. .RE .PP rpcgen .RS 4 Sets construction variables for building with RPCGEN\&. .sp Sets: \fB$RPCGEN\fR, \fB$RPCGENCLIENTFLAGS\fR, \fB$RPCGENFLAGS\fR, \fB$RPCGENHEADERFLAGS\fR, \fB$RPCGENSERVICEFLAGS\fR, \fB$RPCGENXDRFLAGS\fR\&. .RE .PP sgiar .RS 4 Sets construction variables for the SGI library archiver\&. .sp Sets: \fB$AR\fR, \fB$ARCOMSTR\fR, \fB$ARFLAGS\fR, \fB$LIBPREFIX\fR, \fB$LIBSUFFIX\fR, \fB$SHLINK\fR, \fB$SHLINKFLAGS\fR\&. .sp Uses: \fB$ARCOMSTR\fR, \fB$SHLINKCOMSTR\fR\&. .RE .PP sgic++ .RS 4 Sets construction variables for the SGI C++ compiler\&. .sp Sets: \fB$CXX\fR, \fB$CXXFLAGS\fR, \fB$SHCXX\fR, \fB$SHOBJSUFFIX\fR\&. .RE .PP sgicc .RS 4 Sets construction variables for the SGI C compiler\&. .sp Sets: \fB$CXX\fR, \fB$SHOBJSUFFIX\fR\&. .RE .PP sgilink .RS 4 Sets construction variables for the SGI linker\&. .sp Sets: \fB$LINK\fR, \fB$RPATHPREFIX\fR, \fB$RPATHSUFFIX\fR, \fB$SHLINKFLAGS\fR\&. .RE .PP sunar .RS 4 Sets construction variables for the Sun library archiver\&. .sp Sets: \fB$AR\fR, \fB$ARCOM\fR, \fB$ARFLAGS\fR, \fB$LIBPREFIX\fR, \fB$LIBSUFFIX\fR\&. .sp Uses: \fB$ARCOMSTR\fR\&. .RE .PP sunc++ .RS 4 Sets construction variables for the Sun C++ compiler\&. .sp Sets: \fB$CXX\fR, \fB$CXXVERSION\fR, \fB$SHCXX\fR, \fB$SHCXXFLAGS\fR, \fB$SHOBJPREFIX\fR, \fB$SHOBJSUFFIX\fR\&. .RE .PP suncc .RS 4 Sets construction variables for the Sun C compiler\&. .sp Sets: \fB$CXX\fR, \fB$SHCCFLAGS\fR, \fB$SHOBJPREFIX\fR, \fB$SHOBJSUFFIX\fR\&. .RE .PP sunf77 .RS 4 Set construction variables for the Sun f77 Fortran compiler\&. .sp Sets: \fB$F77\fR, \fB$FORTRAN\fR, \fB$SHF77\fR, \fB$SHF77FLAGS\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANFLAGS\fR\&. .RE .PP sunf90 .RS 4 Set construction variables for the Sun f90 Fortran compiler\&. .sp Sets: \fB$F90\fR, \fB$FORTRAN\fR, \fB$SHF90\fR, \fB$SHF90FLAGS\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANFLAGS\fR\&. .RE .PP sunf95 .RS 4 Set construction variables for the Sun f95 Fortran compiler\&. .sp Sets: \fB$F95\fR, \fB$FORTRAN\fR, \fB$SHF95\fR, \fB$SHF95FLAGS\fR, \fB$SHFORTRAN\fR, \fB$SHFORTRANFLAGS\fR\&. .RE .PP sunlink .RS 4 Sets construction variables for the Sun linker\&. .sp Sets: \fB$RPATHPREFIX\fR, \fB$RPATHSUFFIX\fR, \fB$SHLINKFLAGS\fR\&. .RE .PP swig .RS 4 Sets construction variables for the SWIG interface generator\&. .sp Sets: \fB$SWIG\fR, \fB$SWIGCFILESUFFIX\fR, \fB$SWIGCOM\fR, \fB$SWIGCXXFILESUFFIX\fR, \fB$SWIGDIRECTORSUFFIX\fR, \fB$SWIGFLAGS\fR, \fB$SWIGINCPREFIX\fR, \fB$SWIGINCSUFFIX\fR, \fB$SWIGPATH\fR, \fB$SWIGVERSION\fR, \fB$_SWIGINCFLAGS\fR\&. .sp Uses: \fB$SWIGCOMSTR\fR\&. .RE .PP tar .RS 4 Sets construction variables for the tar archiver\&. .sp Sets: \fB$TAR\fR, \fB$TARCOM\fR, \fB$TARFLAGS\fR, \fB$TARSUFFIX\fR\&. .sp Uses: \fB$TARCOMSTR\fR\&. .RE .PP tex .RS 4 Sets construction variables for the TeX formatter and typesetter\&. .sp Sets: \fB$BIBTEX\fR, \fB$BIBTEXCOM\fR, \fB$BIBTEXFLAGS\fR, \fB$LATEX\fR, \fB$LATEXCOM\fR, \fB$LATEXFLAGS\fR, \fB$MAKEINDEX\fR, \fB$MAKEINDEXCOM\fR, \fB$MAKEINDEXFLAGS\fR, \fB$TEX\fR, \fB$TEXCOM\fR, \fB$TEXFLAGS\fR\&. .sp Uses: \fB$BIBTEXCOMSTR\fR, \fB$LATEXCOMSTR\fR, \fB$MAKEINDEXCOMSTR\fR, \fB$TEXCOMSTR\fR\&. .RE .PP textfile .RS 4 Set construction variables for the \fBTextfile\fR and \fBSubstfile\fR builders\&. .sp Sets: \fB$LINESEPARATOR\fR, \fB$SUBSTFILEPREFIX\fR, \fB$SUBSTFILESUFFIX\fR, \fB$TEXTFILEPREFIX\fR, \fB$TEXTFILESUFFIX\fR\&. .sp Uses: \fB$SUBST_DICT\fR\&. .RE .PP tlib .RS 4 Sets construction variables for the Borlan tib library archiver\&. .sp Sets: \fB$AR\fR, \fB$ARCOM\fR, \fB$ARFLAGS\fR, \fB$LIBPREFIX\fR, \fB$LIBSUFFIX\fR\&. .sp Uses: \fB$ARCOMSTR\fR\&. .RE .PP xgettext .RS 4 This scons tool is a part of scons gettext toolset\&. It provides scons interface to \fBxgettext(1)\fR program, which extracts internationalized messages from source code\&. The tool provides \fBPOTUpdate\fR builder to make PO \fITemplate\fR files\&. .sp Sets: \fB$POTSUFFIX\fR, \fB$POTUPDATE_ALIAS\fR, \fB$XGETTEXTCOM\fR, \fB$XGETTEXTCOMSTR\fR, \fB$XGETTEXTFLAGS\fR, \fB$XGETTEXTFROM\fR, \fB$XGETTEXTFROMPREFIX\fR, \fB$XGETTEXTFROMSUFFIX\fR, \fB$XGETTEXTPATH\fR, \fB$XGETTEXTPATHPREFIX\fR, \fB$XGETTEXTPATHSUFFIX\fR, \fB$_XGETTEXTDOMAIN\fR, \fB$_XGETTEXTFROMFLAGS\fR, \fB$_XGETTEXTPATHFLAGS\fR\&. .sp Uses: \fB$POTDOMAIN\fR\&. .RE .PP yacc .RS 4 Sets construction variables for the yacc parse generator\&. .sp Sets: \fB$YACC\fR, \fB$YACCCOM\fR, \fB$YACCFLAGS\fR, \fB$YACCHFILESUFFIX\fR, \fB$YACCHXXFILESUFFIX\fR, \fB$YACCVCGFILESUFFIX\fR\&. .sp Uses: \fB$YACCCOMSTR\fR\&. .RE .PP zip .RS 4 Sets construction variables for the zip archiver\&. .sp Sets: \fB$ZIP\fR, \fB$ZIPCOM\fR, \fB$ZIPCOMPRESSION\fR, \fB$ZIPFLAGS\fR, \fB$ZIPSUFFIX\fR\&. .sp Uses: \fB$ZIPCOMSTR\fR\&. .RE .SS "Builder Methods" .PP You tell \fBscons\fR what to build by calling Builders, functions which know to take a particular action to produce a particular result type when given source files of a particular type\&. \fBscons\fR defines a number of builders, and you can also write your own\&. Builders are attached to a construction environment as methods, and the available builder methods are listed as key\-value pairs in the \fBBUILDERS\fR attribute of the construction environment\&. The available builders can be displayed like this for debugging purposes: .sp .if n \{\ .RS 4 .\} .nf print("Builders:", list(env[\*(AqBUILDERS\*(Aq])) .fi .if n \{\ .RE .\} .PP Builder methods always take two arguments: \fItarget\fR (a target or a list of targets to be built) and \fIsource\fR (a source or list of sources to be used as input when building), although in some circumstances, the target argument can actually be omitted (see below)\&. Builder methods also take a variety of keyword arguments, described below\&. .PP Because long lists of file names can lead to a lot of quoting, \fBscons\fR supplies a \fBSplit\fR global function and a same\-named environment method that splits a single string into a list, using strings of white\-space characters as the delimiter\&. (similar to the Python string \fBsplit\fR method, but succeeds even if the input isn\*(Aqt a string\&.) .PP The target and source arguments to a builder method can be specified either as positional arguments, in which case the target comes first, or as keyword arguments, using \fItarget=\fR and \fIsource=\fR\&. The following are equivalent examples of calling the \fBProgram\fR builder method: .sp .if n \{\ .RS 4 .\} .nf env\&.Program(\*(Aqbar\*(Aq, [\*(Aqbar\&.c\*(Aq, \*(Aqfoo\&.c\*(Aq]) env\&.Program(\*(Aqbar\*(Aq, Split(\*(Aqbar\&.c foo\&.c\*(Aq)) env\&.Program(\*(Aqbar\*(Aq, env\&.Split(\*(Aqbar\&.c foo\&.c\*(Aq)) env\&.Program(source=[\*(Aqbar\&.c\*(Aq, \*(Aqfoo\&.c\*(Aq], target=\*(Aqbar\*(Aq) env\&.Program(target=\*(Aqbar\*(Aq, source=Split(\*(Aqbar\&.c foo\&.c\*(Aq)) env\&.Program(target=\*(Aqbar\*(Aq, source=env\&.Split(\*(Aqbar\&.c foo\&.c\*(Aq)) env\&.Program(\*(Aqbar\*(Aq, source=\*(Aqbar\&.c foo\&.c\*(Aq\&.split()) .fi .if n \{\ .RE .\} .PP Python follows the POSIX pathname convention for path strings: if a string begins with the operating system pathname separator (on Windows both the slash and backslash separator work, and any leading drive specifier is ignored for the determination) it is considered an absolute path, otherwise it is a relative path\&. If the path string contains no separator characters, it is searched for as a file in the current directory\&. If it contains separator characters, the search follows down from the starting point, which is the top of the directory tree for an absolute path and the current directory for a relative path\&. .PP \fBscons\fR recognizes a third way to specify path strings: if the string begins with the \fB#\fR character it is top\-relative \- it works like a relative path but the search follows down from the directory containing the top\-level SConstruct rather than from the current directory\&. The \fB#\fR is allowed to be followed by a pathname separator, which is ignored if found in that position\&. Top\-relative paths only work in places where \fBscons\fR will interpret the path (see some examples below)\&. To be used in other contexts the string will need to be converted to a relative or absolute path first\&. .PP Target and source pathnames can be absolute, relative, or top\-relative\&. Relative pathnames are searched considering the directory of the SConscript file currently being processed as the "current directory"\&. .PP Examples: .sp .if n \{\ .RS 4 .\} .nf # The comments describing the targets that will be built # assume these calls are in a SConscript file in the # a subdirectory named "subdir"\&. # Builds the program "subdir/foo" from "subdir/foo\&.c": env\&.Program(\*(Aqfoo\*(Aq, \*(Aqfoo\&.c\*(Aq) # Builds the program "/tmp/bar" from "subdir/bar\&.c": env\&.Program(\*(Aq/tmp/bar\*(Aq, \*(Aqbar\&.c\*(Aq) # An initial \*(Aq#\*(Aq or \*(Aq#/\*(Aq are equivalent; the following # calls build the programs "foo" and "bar" (in the # top\-level SConstruct directory) from "subdir/foo\&.c" and # "subdir/bar\&.c", respectively: env\&.Program(\*(Aq#foo\*(Aq, \*(Aqfoo\&.c\*(Aq) env\&.Program(\*(Aq#/bar\*(Aq, \*(Aqbar\&.c\*(Aq) # Builds the program "other/foo" (relative to the top\-level # SConstruct directory) from "subdir/foo\&.c": env\&.Program(\*(Aq#other/foo\*(Aq, \*(Aqfoo\&.c\*(Aq) # This will not work, only SCons interfaces understand \*(Aq#\*(Aq, # os\&.path\&.exists is pure Python: if os\&.path\&.exists(\*(Aq#inc/foo\&.h\*(Aq): env\&.Append(CPPPATH=\*(Aq#inc\*(Aq) .fi .if n \{\ .RE .\} .PP When the target shares the same base name as the source and only the suffix varies, and if the builder method has a suffix defined for the target file type, then the target argument may be omitted completely, and \fBscons\fR will deduce the target file name from the source file name\&. The following examples all build the executable program \fBbar\fR (on POSIX systems) or \fBbar\&.exe\fR (on Windows systems) from the bar\&.c source file: .sp .if n \{\ .RS 4 .\} .nf env\&.Program(target=\*(Aqbar\*(Aq, source=\*(Aqbar\&.c\*(Aq) env\&.Program(\*(Aqbar\*(Aq, source=\*(Aqbar\&.c\*(Aq) env\&.Program(source=\*(Aqbar\&.c\*(Aq) env\&.Program(\*(Aqbar\&.c\*(Aq) .fi .if n \{\ .RE .\} .PP As a convenience, a \fIsrcdir\fR keyword argument may be specified when calling a Builder\&. When specified, all source file strings that are not absolute paths or top\-relative paths will be interpreted relative to the specified \fIsrcdir\fR\&. The following example will build the build/prog (or build/prog\&.exe on Windows) program from the files src/f1\&.c and src/f2\&.c: .sp .if n \{\ .RS 4 .\} .nf env\&.Program(\*(Aqbuild/prog\*(Aq, [\*(Aqf1\&.c\*(Aq, \*(Aqf2\&.c\*(Aq], srcdir=\*(Aqsrc\*(Aq) .fi .if n \{\ .RE .\} .PP It is possible to override (replace or add) construction variables when calling a builder method by passing them as keyword arguments\&. These overrides will only be in effect when building that target, and will not affect other parts of the build\&. For example, if you want to specify some libraries needed by just one program: .sp .if n \{\ .RS 4 .\} .nf env\&.Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq, LIBS=[\*(Aqgl\*(Aq, \*(Aqglut\*(Aq]) .fi .if n \{\ .RE .\} .PP or generate a shared library with a non\-standard suffix: .sp .if n \{\ .RS 4 .\} .nf env\&.SharedLibrary(\*(Aqword\*(Aq, \*(Aqword\&.cpp\*(Aq, SHLIBSUFFIX=\*(Aq\&.ocx\*(Aq, LIBSUFFIXES=[\*(Aq\&.ocx\*(Aq]) .fi .if n \{\ .RE .\} .PP Note that both the \fB$SHLIBSUFFIX\fR and \fB$LIBSUFFIXES\fR variables must be set if you want \fBscons\fR to search automatically for dependencies on the non\-standard library names; see the descriptions below of these variables for more information\&. .PP It is also possible to use the \fIparse_flags\fR keyword argument in an override, to merge command\-line style arguments into the appropriate construction variables (see \fBenv\&.MergeFlags\fR)\&. .sp .if n \{\ .RS 4 .\} .nf env = Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq, parse_flags=\*(Aq\-Iinclude \-DEBUG \-lm\*(Aq) .fi .if n \{\ .RE .\} .PP This example adds \*(Aqinclude\*(Aq to \fBCPPPATH\fR, \*(AqEBUG\*(Aq to \fBCPPDEFINES\fR, and \*(Aqm\*(Aq to \fBLIBS\fR\&. .PP Although the builder methods defined by \fBscons\fR are, in fact, methods of a construction environment object, they may also be called without an explicit environment: .sp .if n \{\ .RS 4 .\} .nf Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq) SharedLibrary(\*(Aqword\*(Aq, \*(Aqword\&.cpp\*(Aq) .fi .if n \{\ .RE .\} .PP In this case, the methods are called internally using a default construction environment that consists of the tools and values that \fBscons\fR has determined are appropriate for the local system\&. .PP Builder methods that can be called without an explicit environment may be called from custom Python modules that you import into an SConscript file by adding the following to the Python module: .sp .if n \{\ .RS 4 .\} .nf from SCons\&.Script import * .fi .if n \{\ .RE .\} .PP All builder methods return a list\-like object containing Nodes that will be built\&. A Node is an internal SCons object which represents build targets or sources\&. .PP The returned Node\-list object can be passed to other builder methods as source(s) or passed to any SCons function or method where a filename would normally be accepted\&. For example, if it were necessary to add a specific preprocessor define when compiling one specific object file: .sp .if n \{\ .RS 4 .\} .nf bar_obj_list = env\&.StaticObject(\*(Aqbar\&.c\*(Aq, CPPDEFINES=\*(Aq\-DBAR\*(Aq) env\&.Program(source=[\*(Aqfoo\&.c\*(Aq, bar_obj_list, \*(Aqmain\&.c\*(Aq]) .fi .if n \{\ .RE .\} .PP Using a Node in this way makes for a more portable build by avoiding having to specify a platform\-specific object suffix when calling the \fBProgram\fR builder method\&. .PP Builder calls will automatically "flatten" lists passed as source and target, so they are free to contain elements which are themselves lists, such as \fIbar_obj_list\fR returned by the \fBStaticObject\fR call above\&. If you need to manipulate a list of lists returned by builders directly in Python code, you can either build a new list by hand: .sp .if n \{\ .RS 4 .\} .nf foo = Object(\*(Aqfoo\&.c\*(Aq) bar = Object(\*(Aqbar\&.c\*(Aq) objects = [\*(Aqbegin\&.o\*(Aq] + foo + [\*(Aqmiddle\&.o\*(Aq] + bar + [\*(Aqend\&.o\*(Aq] for obj in objects: print(str(obj)) .fi .if n \{\ .RE .\} .PP Or you can use the \fBFlatten\fR function supplied by \fBscons\fR to create a list containing just the Nodes, which may be more convenient: .sp .if n \{\ .RS 4 .\} .nf foo = Object(\*(Aqfoo\&.c\*(Aq) bar = Object(\*(Aqbar\&.c\*(Aq) objects = Flatten([\*(Aqbegin\&.o\*(Aq, foo, \*(Aqmiddle\&.o\*(Aq, bar, \*(Aqend\&.o\*(Aq]) for obj in objects: print(str(obj)) .fi .if n \{\ .RE .\} .PP SCons builder calls return a list\-like object, not an actual Python list, so it is not appropriate to use the Python add operator (+ or +=) to append builder results to a Python list\&. Because the list and the object are different types, Python will not update the original list in place, but will instead create a new Node\-list object containing the concatenation of the list elements and the builder results\&. This will cause problems for any other Python variables in your SCons configuration that still hold on to a reference to the original list\&. Instead, use the Python list \fBextend\fR method to make sure the list is updated in\-place\&. Example: .sp .if n \{\ .RS 4 .\} .nf object_files = [] # Do NOT use += here: # object_files += Object(\*(Aqbar\&.c\*(Aq) # # It will not update the object_files list in place\&. # # Instead, use the list extend method: object_files\&.extend(Object(\*(Aqbar\&.c\*(Aq)) .fi .if n \{\ .RE .\} .PP The path name for a Node\*(Aqs file may be used by passing the Node to Python\*(Aqs builtin \fBstr\fR function: .sp .if n \{\ .RS 4 .\} .nf bar_obj_list = env\&.StaticObject(\*(Aqbar\&.c\*(Aq, CPPDEFINES=\*(Aq\-DBAR\*(Aq) print("The path to bar_obj is:", str(bar_obj_list[0])) .fi .if n \{\ .RE .\} .PP Note again that because the Builder call returns a list, we have to access the first element in the list ((bar_obj_list[0])) to get at the Node that actually represents the object file\&. .PP Builder calls support a \fIchdir\fR keyword argument that specifies that the Builder\*(Aqs action(s) should be executed after changing directory\&. If the \fIchdir\fR argument is a string or a directory Node, scons will change to the specified directory\&. If the \fIchdir\fR is not a string or Node and is non\-zero, then scons will change to the target file\*(Aqs directory\&. .sp .if n \{\ .RS 4 .\} .nf # scons will change to the "sub" subdirectory # before executing the "cp" command\&. env\&.Command(\*(Aqsub/dir/foo\&.out\*(Aq, \*(Aqsub/dir/foo\&.in\*(Aq, "cp dir/foo\&.in dir/foo\&.out", chdir=\*(Aqsub\*(Aq) # Because chdir is not a string, scons will change to the # target\*(Aqs directory ("sub/dir") before executing the # "cp" command\&. env\&.Command(\*(Aqsub/dir/foo\&.out\*(Aq, \*(Aqsub/dir/foo\&.in\*(Aq, "cp foo\&.in foo\&.out", chdir=1) .fi .if n \{\ .RE .\} .PP Note that SCons will \fInot\fR automatically modify its expansion of construction variables like \fB$TARGET\fR and \fB$SOURCE\fR when using the \fIchdir\fR keyword argument\-\-that is, the expanded file names will still be relative to the top\-level directory where SConstruct was found, and consequently incorrect relative to the chdir directory\&. If you use the \fIchdir\fR keyword argument, you will typically need to supply a different command line using expansions like ${TARGET\&.file} and ${SOURCE\&.file} to use just the filename portion of the targets and source\&. .PP \fBscons\fR predefines the following builder methods\&. Depending on the setup of a particular construction environment and on the type and software installation status of the underlying system, not all builders may be available to that construction environment\&. .PP \fBCFile\fR(), \fIenv\fR\&.CFile() .RS 4 Builds a C source file given a lex (\&.l) or yacc (\&.y) input file\&. The suffix specified by the \fB$CFILESUFFIX\fR construction variable (\&.c by default) is automatically added to the target if it is not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf # builds foo\&.c env\&.CFile(target = \*(Aqfoo\&.c\*(Aq, source = \*(Aqfoo\&.l\*(Aq) # builds bar\&.c env\&.CFile(target = \*(Aqbar\*(Aq, source = \*(Aqbar\&.y\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBCommand\fR(), \fIenv\fR\&.Command() .RS 4 The \fBCommand\fR "Builder" is actually a function that looks like a Builder, but takes a required third argument, which is the action to take to construct the target from the source, used for "one\-off" builds where a full builder is not needed\&. Thus it does not follow the builder calling rules described at the start of this section\&. See instead the \fBCommand\fR function description for the calling syntax and details\&. .RE .PP \fBCompilationDatabase\fR(), \fIenv\fR\&.CompilationDatabase() .RS 4 The \fBCompilationDatabase\fR builder writes a JSON formatted compilation database according to the \m[blue]\fBLLVM specification\fR\m[]\&\s-2\u[1]\d\s+2 which is consumed by a number of clang tools, editors, and other tools\&. .sp If you don\*(Aqt specify any files, the builder will default to compile_commands\&.json\&. .sp If you specify a single file as below .sp .if n \{\ .RS 4 .\} .nf env\&.CompilationDatabase(\*(Aqmy_output\&.json\*(Aq) .fi .if n \{\ .RE .\} .sp SCons will automatically use that as the target file\&. If you specify more than one source, the source list will be ignored\&. .sp You should not specify source files\&. The \fBCompilationDatabase\fR builder instruments SCons to collect them from all the C, C++, assembly source/target pairs\&. .sp NOTE: You must load the compilation_db tool prior to specifying any part of your build or some source/target files will not show up in your output file\&. .sp \fIAvailable since \fR\fI\fBscons\fR\fR\fI 4\&.0\&.\fR .RE .PP \fBCXXFile\fR(), \fIenv\fR\&.CXXFile() .RS 4 Builds a C++ source file given a lex (\&.ll) or yacc (\&.yy) input file\&. The suffix specified by the \fB$CXXFILESUFFIX\fR construction variable (\&.cc by default) is automatically added to the target if it is not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf # builds foo\&.cc env\&.CXXFile(target = \*(Aqfoo\&.cc\*(Aq, source = \*(Aqfoo\&.ll\*(Aq) # builds bar\&.cc env\&.CXXFile(target = \*(Aqbar\*(Aq, source = \*(Aqbar\&.yy\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDocbookEpub\fR(), \fIenv\fR\&.DocbookEpub() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for EPUB output\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookEpub(\*(Aqmanual\&.epub\*(Aq, \*(Aqmanual\&.xml\*(Aq) .fi .if n \{\ .RE .\} .sp or simply .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookEpub(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDocbookHtml\fR(), \fIenv\fR\&.DocbookHtml() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for HTML output\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtml(\*(Aqmanual\&.html\*(Aq, \*(Aqmanual\&.xml\*(Aq) .fi .if n \{\ .RE .\} .sp or simply .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtml(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDocbookHtmlChunked\fR(), \fIenv\fR\&.DocbookHtmlChunked() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for chunked HTML output\&. It supports the base\&.dir parameter\&. The chunkfast\&.xsl file (requires "EXSLT") is used as the default stylesheet\&. Basic syntax: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlChunked(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .sp where manual\&.xml is the input file\&. .sp If you use the root\&.filename parameter in your own stylesheets you have to specify the new target name\&. This ensures that the dependencies get correct, especially for the cleanup via \(lqscons \-c\(rq: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlChunked(\*(Aqmymanual\&.html\*(Aq, \*(Aqmanual\*(Aq, xsl=\*(Aqhtmlchunk\&.xsl\*(Aq) .fi .if n \{\ .RE .\} .sp Some basic support for the base\&.dir is provided\&. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlChunked(\*(Aqmanual\*(Aq, xsl=\*(Aqhtmlchunk\&.xsl\*(Aq, base_dir=\*(Aqoutput/\*(Aq) .fi .if n \{\ .RE .\} .sp Make sure that you don\*(Aqt forget the trailing slash for the base folder, else your files get renamed only! .RE .PP \fBDocbookHtmlhelp\fR(), \fIenv\fR\&.DocbookHtmlhelp() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for HTMLHELP output\&. Its basic syntax is: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlhelp(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .sp where manual\&.xml is the input file\&. .sp If you use the root\&.filename parameter in your own stylesheets you have to specify the new target name\&. This ensures that the dependencies get correct, especially for the cleanup via \(lqscons \-c\(rq: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlhelp(\*(Aqmymanual\&.html\*(Aq, \*(Aqmanual\*(Aq, xsl=\*(Aqhtmlhelp\&.xsl\*(Aq) .fi .if n \{\ .RE .\} .sp Some basic support for the base\&.dir parameter is provided\&. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookHtmlhelp(\*(Aqmanual\*(Aq, xsl=\*(Aqhtmlhelp\&.xsl\*(Aq, base_dir=\*(Aqoutput/\*(Aq) .fi .if n \{\ .RE .\} .sp Make sure that you don\*(Aqt forget the trailing slash for the base folder, else your files get renamed only! .RE .PP \fBDocbookMan\fR(), \fIenv\fR\&.DocbookMan() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for Man page output\&. Its basic syntax is: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookMan(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .sp where manual\&.xml is the input file\&. Note, that you can specify a target name, but the actual output names are automatically set from the refname entries in your XML source\&. .RE .PP \fBDocbookPdf\fR(), \fIenv\fR\&.DocbookPdf() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for PDF output\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookPdf(\*(Aqmanual\&.pdf\*(Aq, \*(Aqmanual\&.xml\*(Aq) .fi .if n \{\ .RE .\} .sp or simply .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookPdf(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDocbookSlidesHtml\fR(), \fIenv\fR\&.DocbookSlidesHtml() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for HTML slides output\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookSlidesHtml(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .sp If you use the titlefoil\&.html parameter in your own stylesheets you have to give the new target name\&. This ensures that the dependencies get correct, especially for the cleanup via \(lqscons \-c\(rq: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookSlidesHtml(\*(Aqmymanual\&.html\*(Aq,\*(Aqmanual\*(Aq, xsl=\*(Aqslideshtml\&.xsl\*(Aq) .fi .if n \{\ .RE .\} .sp Some basic support for the base\&.dir parameter is provided\&. You can add the base_dir keyword to your Builder call, and the given prefix gets prepended to all the created filenames: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookSlidesHtml(\*(Aqmanual\*(Aq, xsl=\*(Aqslideshtml\&.xsl\*(Aq, base_dir=\*(Aqoutput/\*(Aq) .fi .if n \{\ .RE .\} .sp Make sure that you don\*(Aqt forget the trailing slash for the base folder, else your files get renamed only! .RE .PP \fBDocbookSlidesPdf\fR(), \fIenv\fR\&.DocbookSlidesPdf() .RS 4 A pseudo\-Builder, providing a Docbook toolchain for PDF slides output\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookSlidesPdf(\*(Aqmanual\&.pdf\*(Aq, \*(Aqmanual\&.xml\*(Aq) .fi .if n \{\ .RE .\} .sp or simply .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookSlidesPdf(\*(Aqmanual\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDocbookXInclude\fR(), \fIenv\fR\&.DocbookXInclude() .RS 4 A pseudo\-Builder, for resolving XIncludes in a separate processing step\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookXInclude(\*(Aqmanual_xincluded\&.xml\*(Aq, \*(Aqmanual\&.xml\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDocbookXslt\fR(), \fIenv\fR\&.DocbookXslt() .RS 4 A pseudo\-Builder, applying a given XSL transformation to the input file\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdocbook\*(Aq]) env\&.DocbookXslt(\*(Aqmanual_transformed\&.xml\*(Aq, \*(Aqmanual\&.xml\*(Aq, xsl=\*(Aqtransform\&.xslt\*(Aq) .fi .if n \{\ .RE .\} .sp Note, that this builder requires the xsl parameter to be set\&. .RE .PP \fBDVI\fR(), \fIenv\fR\&.DVI() .RS 4 Builds a \&.dvi file from a \&.tex, \&.ltx or \&.latex input file\&. If the source file suffix is \&.tex, \fBscons\fR will examine the contents of the file; if the string \edocumentclass or \edocumentstyle is found, the file is assumed to be a LaTeX file and the target is built by invoking the \fB$LATEXCOM\fR command line; otherwise, the \fB$TEXCOM\fR command line is used\&. If the file is a LaTeX file, the \fBDVI\fR builder method will also examine the contents of the \&.aux file and invoke the \fB$BIBTEX\fR command line if the string bibdata is found, start \fB$MAKEINDEX\fR to generate an index if a \&.ind file is found and will examine the contents \&.log file and re\-run the \fB$LATEXCOM\fR command if the log file says it is necessary\&. .sp The suffix \&.dvi (hard\-coded within TeX itself) is automatically added to the target if it is not already present\&. Examples: .sp .if n \{\ .RS 4 .\} .nf # builds from aaa\&.tex env\&.DVI(target = \*(Aqaaa\&.dvi\*(Aq, source = \*(Aqaaa\&.tex\*(Aq) # builds bbb\&.dvi env\&.DVI(target = \*(Aqbbb\*(Aq, source = \*(Aqbbb\&.ltx\*(Aq) # builds from ccc\&.latex env\&.DVI(target = \*(Aqccc\&.dvi\*(Aq, source = \*(Aqccc\&.latex\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBGs\fR(), \fIenv\fR\&.Gs() .RS 4 A Builder for explicitly calling the gs executable\&. Depending on the underlying OS, the different names gs, gsos2 and gswin32c are tried\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqgs\*(Aq]) env\&.Gs(\*(Aqcover\&.jpg\*(Aq,\*(Aqscons\-scons\&.pdf\*(Aq, GSFLAGS=\*(Aq\-dNOPAUSE \-dBATCH \-sDEVICE=jpeg \-dFirstPage=1 \-dLastPage=1 \-q\*(Aq) ) .fi .if n \{\ .RE .\} .RE .PP \fBInstall\fR(), \fIenv\fR\&.Install() .RS 4 Installs one or more source files or directories in the specified target, which must be a directory\&. The names of the specified source files or directories remain the same within the destination directory\&. The sources may be given as a string or as a node returned by a builder\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Install(target=\*(Aq/usr/local/bin\*(Aq, source=[\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq]) .fi .if n \{\ .RE .\} .sp Note that if target paths chosen for the \fBInstall\fR builder (and the related \fBInstallAs\fR and \fBInstallVersionedLib\fR builders) are outside the project tree, such as in the example above, they may not be selected for "building" by default, since in the absence of other instructions \fBscons\fR builds targets that are underneath the top directory (the directory that contains the SConstruct file, usually the current directory)\&. Use command line targets or the \fBDefault\fR function in this case\&. .sp If the \fB\-\-install\-sandbox\fR command line option is given, the target directory will be prefixed by the directory path specified\&. This is useful to test installs without installing to a "live" location in the system\&. .sp See also \fBFindInstalledFiles\fR\&. For more thoughts on installation, see the User Guide (particularly the section on Command\-Line Targets and the chapters on Installing Files and on Alias Targets)\&. .RE .PP \fBInstallAs\fR(), \fIenv\fR\&.InstallAs() .RS 4 Installs one or more source files or directories to specific names, allowing changing a file or directory name as part of the installation\&. It is an error if the target and source arguments list different numbers of files or directories\&. .sp .if n \{\ .RS 4 .\} .nf env\&.InstallAs(target=\*(Aq/usr/local/bin/foo\*(Aq, source=\*(Aqfoo_debug\*(Aq) env\&.InstallAs(target=[\*(Aq\&.\&./lib/libfoo\&.a\*(Aq, \*(Aq\&.\&./lib/libbar\&.a\*(Aq], source=[\*(AqlibFOO\&.a\*(Aq, \*(AqlibBAR\&.a\*(Aq]) .fi .if n \{\ .RE .\} .sp See the note under \fBInstall\fR\&. .RE .PP \fBInstallVersionedLib\fR(), \fIenv\fR\&.InstallVersionedLib() .RS 4 Installs a versioned shared library\&. The symlinks appropriate to the architecture will be generated based on symlinks of the source library\&. .sp .if n \{\ .RS 4 .\} .nf env\&.InstallVersionedLib(target=\*(Aq/usr/local/bin/foo\*(Aq, source=\*(Aqlibxyz\&.1\&.5\&.2\&.so\*(Aq) .fi .if n \{\ .RE .\} .sp See the note under \fBInstall\fR\&. .RE .PP \fBJar\fR(), \fIenv\fR\&.Jar() .RS 4 Builds a Java archive (\&.jar) file from the specified list of sources\&. Any directories in the source list will be searched for \&.class files)\&. Any \&.java files in the source list will be compiled to \&.class files by calling the \fBJava\fR Builder\&. .sp If the \fB$JARCHDIR\fR value is set, the jar command will change to the specified directory using the \fB\-C\fR option\&. If \fB$JARCHDIR\fR is not set explicitly, SCons will use the top of any subdirectory tree in which Java \&.class were built by the \fBJava\fR Builder\&. .sp If the contents any of the source files begin with the string Manifest\-Version, the file is assumed to be a manifest and is passed to the jar command with the \fBm\fR option set\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Jar(target = \*(Aqfoo\&.jar\*(Aq, source = \*(Aqclasses\*(Aq) env\&.Jar(target = \*(Aqbar\&.jar\*(Aq, source = [\*(Aqbar1\&.java\*(Aq, \*(Aqbar2\&.java\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fBJava\fR(), \fIenv\fR\&.Java() .RS 4 Builds one or more Java class files\&. The sources may be any combination of explicit \&.java files, or directory trees which will be scanned for \&.java files\&. .sp SCons will parse each source \&.java file to find the classes (including inner classes) defined within that file, and from that figure out the target \&.class files that will be created\&. The class files will be placed underneath the specified target directory\&. .sp SCons will also search each Java file for the Java package name, which it assumes can be found on a line beginning with the string package in the first column; the resulting \&.class files will be placed in a directory reflecting the specified package name\&. For example, the file Foo\&.java defining a single public Foo class and containing a package name of sub\&.dir will generate a corresponding sub/dir/Foo\&.class class file\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.Java(target = \*(Aqclasses\*(Aq, source = \*(Aqsrc\*(Aq) env\&.Java(target = \*(Aqclasses\*(Aq, source = [\*(Aqsrc1\*(Aq, \*(Aqsrc2\*(Aq]) env\&.Java(target = \*(Aqclasses\*(Aq, source = [\*(AqFile1\&.java\*(Aq, \*(AqFile2\&.java\*(Aq]) .fi .if n \{\ .RE .\} .sp Java source files can use the native encoding for the underlying OS\&. Since SCons compiles in simple ASCII mode by default, the compiler will generate warnings about unmappable characters, which may lead to errors as the file is processed further\&. In this case, the user must specify the LANG environment variable to tell the compiler what encoding is used\&. For portibility, it\*(Aqs best if the encoding is hard\-coded so that the compile will work if it is done on a system with a different encoding\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment() env[\*(AqENV\*(Aq][\*(AqLANG\*(Aq] = \*(Aqen_GB\&.UTF\-8\*(Aq .fi .if n \{\ .RE .\} .RE .PP \fBJavaH\fR(), \fIenv\fR\&.JavaH() .RS 4 Builds C header and source files for implementing Java native methods\&. The target can be either a directory in which the header files will be written, or a header file name which will contain all of the definitions\&. The source can be the names of \&.class files, the names of \&.java files to be compiled into \&.class files by calling the \fBJava\fR builder method, or the objects returned from the \fBJava\fR builder method\&. .sp If the construction variable \fB$JAVACLASSDIR\fR is set, either in the environment or in the call to the \fBJavaH\fR builder method itself, then the value of the variable will be stripped from the beginning of any \&.class file names\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # builds java_native\&.h classes = env\&.Java(target="classdir", source="src") env\&.JavaH(target="java_native\&.h", source=classes) # builds include/package_foo\&.h and include/package_bar\&.h env\&.JavaH(target="include", source=["package/foo\&.class", "package/bar\&.class"]) # builds export/foo\&.h and export/bar\&.h env\&.JavaH( target="export", source=["classes/foo\&.class", "classes/bar\&.class"], JAVACLASSDIR="classes", ) .fi .if n \{\ .RE .\} .RE .PP \fBLibrary\fR(), \fIenv\fR\&.Library() .RS 4 A synonym for the \fBStaticLibrary\fR builder method\&. .RE .PP \fBLoadableModule\fR(), \fIenv\fR\&.LoadableModule() .RS 4 On most systems, this is the same as \fBSharedLibrary\fR\&. On Mac OS X (Darwin) platforms, this creates a loadable module bundle\&. .RE .PP \fBM4\fR(), \fIenv\fR\&.M4() .RS 4 Builds an output file from an M4 input file\&. This uses a default \fB$M4FLAGS\fR value of \fB\-E\fR, which considers all warnings to be fatal and stops on the first warning when using the GNU version of m4\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.M4(target = \*(Aqfoo\&.c\*(Aq, source = \*(Aqfoo\&.c\&.m4\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBMoc\fR(), \fIenv\fR\&.Moc() .RS 4 Builds an output file from a moc input file\&. Moc input files are either header files or cxx files\&. This builder is only available after using the tool \*(Aqqt\*(Aq\&. See the \fB$QTDIR\fR variable for more information\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Moc(\*(Aqfoo\&.h\*(Aq) # generates moc_foo\&.cc env\&.Moc(\*(Aqfoo\&.cpp\*(Aq) # generates foo\&.moc .fi .if n \{\ .RE .\} .RE .PP \fBMOFiles\fR(), \fIenv\fR\&.MOFiles() .RS 4 This builder belongs to msgfmt tool\&. The builder compiles PO files to MO files\&. .sp \fIExample 1\fR\&. Create pl\&.mo and en\&.mo by compiling pl\&.po and en\&.po: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.MOFiles([\*(Aqpl\*(Aq, \*(Aqen\*(Aq]) .fi .if n \{\ .RE .\} .sp \fIExample 2\fR\&. Compile files for languages defined in LINGUAS file: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.MOFiles(LINGUAS_FILE = 1) .fi .if n \{\ .RE .\} .sp \fIExample 3\fR\&. Create pl\&.mo and en\&.mo by compiling pl\&.po and en\&.po plus files for languages defined in LINGUAS file: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.MOFiles([\*(Aqpl\*(Aq, \*(Aqen\*(Aq], LINGUAS_FILE = 1) .fi .if n \{\ .RE .\} .sp \fIExample 4\fR\&. Compile files for languages defined in LINGUAS file (another version): .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env[\*(AqLINGUAS_FILE\*(Aq] = 1 env\&.MOFiles() .fi .if n \{\ .RE .\} .RE .PP \fBMSVSProject\fR(), \fIenv\fR\&.MSVSProject() .RS 4 Builds a Microsoft Visual Studio project file, and by default builds a solution file as well\&. .sp This builds a Visual Studio project file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by \fB$MSVS_VERSION\fR in the Environment constructor)\&. For Visual Studio 6, it will generate a \&.dsp file\&. For Visual Studio 7, 8, and 9, it will generate a \&.vcproj file\&. For Visual Studio 10 and later, it will generate a \&.vcxproj file\&. .sp By default, this also generates a solution file for the specified project, a \&.dsw file for Visual Studio 6 or a \&.sln file for Visual Studio 7 and later\&. This behavior may be disabled by specifying auto_build_solution=0 when you call \fBMSVSProject\fR, in which case you presumably want to build the solution file(s) by calling the \fBMSVSSolution\fR Builder (see below)\&. .sp The \fBMSVSProject\fR builder takes several lists of filenames to be placed into the project file\&. These are currently limited to srcs, incs, localincs, resources, and misc\&. These are pretty self\-explanatory, but it should be noted that these lists are added to the \fB$SOURCES\fR construction variable as strings, NOT as SCons File Nodes\&. This is because they represent file names to be added to the project file, not the source files used to build the project file\&. .sp The above filename lists are all optional, although at least one must be specified for the resulting project file to be non\-empty\&. .sp In addition to the above lists of values, the following values may be specified: .PP target .RS 4 The name of the target \&.dsp or \&.vcproj file\&. The correct suffix for the version of Visual Studio must be used, but the \fB$MSVSPROJECTSUFFIX\fR construction variable will be defined to the correct value (see example below)\&. .RE .PP variant .RS 4 The name of this particular variant\&. For Visual Studio 7 projects, this can also be a list of variant names\&. These are typically things like "Debug" or "Release", but really can be anything you want\&. For Visual Studio 7 projects, they may also specify a target platform separated from the variant name by a | (vertical pipe) character: Debug|Xbox\&. The default target platform is Win32\&. Multiple calls to \fBMSVSProject\fR with different variants are allowed; all variants will be added to the project file with their appropriate build targets and sources\&. .RE .PP cmdargs .RS 4 Additional command line arguments for the different variants\&. The number of cmdargs entries must match the number of variant entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. .RE .PP cppdefines .RS 4 Preprocessor definitions for the different variants\&. The number of cppdefines entries must match the number of variant entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. If you don\*(Aqt give this parameter, SCons will use the invoking environment\*(Aqs CPPDEFINES entry for all variants\&. .RE .PP cppflags .RS 4 Compiler flags for the different variants\&. If a /std:c++ flag is found then /Zc:__cplusplus is appended to the flags if not already found, this ensures that intellisense uses the /std:c++ switch\&. The number of cppflags entries must match the number of variant entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. If you don\*(Aqt give this parameter, SCons will combine the invoking environment\*(Aqs CCFLAGS, CXXFLAGS, CPPFLAGS entries for all variants\&. .RE .PP cpppaths .RS 4 Compiler include paths for the different variants\&. The number of cpppaths entries must match the number of variant entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. If you don\*(Aqt give this parameter, SCons will use the invoking environment\*(Aqs CPPPATH entry for all variants\&. .RE .PP buildtarget .RS 4 An optional string, node, or list of strings or nodes (one per build variant), to tell the Visual Studio debugger what output target to use in what build variant\&. The number of buildtarget entries must match the number of variant entries\&. .RE .PP runfile .RS 4 The name of the file that Visual Studio 7 and later will run and debug\&. This appears as the value of the Output field in the resulting Visual Studio project file\&. If this is not specified, the default is the same as the specified buildtarget value\&. .RE .sp Note that because SCons always executes its build commands from the directory in which the SConstruct file is located, if you generate a project file in a different directory than the SConstruct directory, users will not be able to double\-click on the file name in compilation error messages displayed in the Visual Studio console output window\&. This can be remedied by adding the Visual C/C++ /FC compiler option to the \fB$CCFLAGS\fR variable so that the compiler will print the full path name of any files that cause compilation errors\&. .sp Example usage: .sp .if n \{\ .RS 4 .\} .nf barsrcs = [\*(Aqbar\&.cpp\*(Aq] barincs = [\*(Aqbar\&.h\*(Aq] barlocalincs = [\*(AqStdAfx\&.h\*(Aq] barresources = [\*(Aqbar\&.rc\*(Aq,\*(Aqresource\&.h\*(Aq] barmisc = [\*(Aqbar_readme\&.txt\*(Aq] dll = env\&.SharedLibrary(target=\*(Aqbar\&.dll\*(Aq, source=barsrcs) buildtarget = [s for s in dll if str(s)\&.endswith(\*(Aqdll\*(Aq)] env\&.MSVSProject(target=\*(AqBar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq], srcs=barsrcs, incs=barincs, localincs=barlocalincs, resources=barresources, misc=barmisc, buildtarget=buildtarget, variant=\*(AqRelease\*(Aq) .fi .if n \{\ .RE .\} .sp Starting with version 2\&.4 of SCons it is also possible to specify the optional argument \fIDebugSettings\fR, which creates files for debugging under Visual Studio: .PP DebugSettings .RS 4 A dictionary of debug settings that get written to the \&.vcproj\&.user or the \&.vcxproj\&.user file, depending on the version installed\&. As it is done for cmdargs (see above), you can specify a \fIDebugSettings\fR dictionary per variant\&. If you give only one, it will be propagated to all variants\&. .RE .sp Currently, only Visual Studio v9\&.0 and Visual Studio version v11 are implemented, for other versions no file is generated\&. To generate the user file, you just need to add a \fIDebugSettings\fR dictionary to the environment with the right parameters for your MSVS version\&. If the dictionary is empty, or does not contain any good value, no file will be generated\&. .sp Following is a more contrived example, involving the setup of a project for variants and DebugSettings: .sp .if n \{\ .RS 4 .\} .nf # Assuming you store your defaults in a file vars = Variables(\*(Aqvariables\&.py\*(Aq) msvcver = vars\&.args\&.get(\*(Aqvc\*(Aq, \*(Aq9\*(Aq) # Check command args to force one Microsoft Visual Studio version if msvcver == \*(Aq9\*(Aq or msvcver == \*(Aq11\*(Aq: env = Environment(MSVC_VERSION=msvcver+\*(Aq\&.0\*(Aq, MSVC_BATCH=False) else: env = Environment() AddOption(\*(Aq\-\-userfile\*(Aq, action=\*(Aqstore_true\*(Aq, dest=\*(Aquserfile\*(Aq, default=False, help="Create Visual Studio Project user file") # # 1\&. Configure your Debug Setting dictionary with options you want in the list # of allowed options, for instance if you want to create a user file to launch # a specific application for testing your dll with Microsoft Visual Studio 2008 (v9): # V9DebugSettings = { \*(AqCommand\*(Aq:\*(Aqc:\e\emyapp\e\eusing\e\ethisdll\&.exe\*(Aq, \*(AqWorkingDirectory\*(Aq: \*(Aqc:\e\emyapp\e\eusing\e\e\*(Aq, \*(AqCommandArguments\*(Aq: \*(Aq\-p password\*(Aq, # \*(AqAttach\*(Aq:\*(Aqfalse\*(Aq, # \*(AqDebuggerType\*(Aq:\*(Aq3\*(Aq, # \*(AqRemote\*(Aq:\*(Aq1\*(Aq, # \*(AqRemoteMachine\*(Aq: None, # \*(AqRemoteCommand\*(Aq: None, # \*(AqHttpUrl\*(Aq: None, # \*(AqPDBPath\*(Aq: None, # \*(AqSQLDebugging\*(Aq: None, # \*(AqEnvironment\*(Aq: \*(Aq\*(Aq, # \*(AqEnvironmentMerge\*(Aq:\*(Aqtrue\*(Aq, # \*(AqDebuggerFlavor\*(Aq: None, # \*(AqMPIRunCommand\*(Aq: None, # \*(AqMPIRunArguments\*(Aq: None, # \*(AqMPIRunWorkingDirectory\*(Aq: None, # \*(AqApplicationCommand\*(Aq: None, # \*(AqApplicationArguments\*(Aq: None, # \*(AqShimCommand\*(Aq: None, # \*(AqMPIAcceptMode\*(Aq: None, # \*(AqMPIAcceptFilter\*(Aq: None, } # # 2\&. Because there are a lot of different options depending on the Microsoft # Visual Studio version, if you use more than one version you have to # define a dictionary per version, for instance if you want to create a user # file to launch a specific application for testing your dll with Microsoft # Visual Studio 2012 (v11): # V10DebugSettings = { \*(AqLocalDebuggerCommand\*(Aq: \*(Aqc:\e\emyapp\e\eusing\e\ethisdll\&.exe\*(Aq, \*(AqLocalDebuggerWorkingDirectory\*(Aq: \*(Aqc:\e\emyapp\e\eusing\e\e\*(Aq, \*(AqLocalDebuggerCommandArguments\*(Aq: \*(Aq\-p password\*(Aq, # \*(AqLocalDebuggerEnvironment\*(Aq: None, # \*(AqDebuggerFlavor\*(Aq: \*(AqWindowsLocalDebugger\*(Aq, # \*(AqLocalDebuggerAttach\*(Aq: None, # \*(AqLocalDebuggerDebuggerType\*(Aq: None, # \*(AqLocalDebuggerMergeEnvironment\*(Aq: None, # \*(AqLocalDebuggerSQLDebugging\*(Aq: None, # \*(AqRemoteDebuggerCommand\*(Aq: None, # \*(AqRemoteDebuggerCommandArguments\*(Aq: None, # \*(AqRemoteDebuggerWorkingDirectory\*(Aq: None, # \*(AqRemoteDebuggerServerName\*(Aq: None, # \*(AqRemoteDebuggerConnection\*(Aq: None, # \*(AqRemoteDebuggerDebuggerType\*(Aq: None, # \*(AqRemoteDebuggerAttach\*(Aq: None, # \*(AqRemoteDebuggerSQLDebugging\*(Aq: None, # \*(AqDeploymentDirectory\*(Aq: None, # \*(AqAdditionalFiles\*(Aq: None, # \*(AqRemoteDebuggerDeployDebugCppRuntime\*(Aq: None, # \*(AqWebBrowserDebuggerHttpUrl\*(Aq: None, # \*(AqWebBrowserDebuggerDebuggerType\*(Aq: None, # \*(AqWebServiceDebuggerHttpUrl\*(Aq: None, # \*(AqWebServiceDebuggerDebuggerType\*(Aq: None, # \*(AqWebServiceDebuggerSQLDebugging\*(Aq: None, } # # 3\&. Select the dictionary you want depending on the version of visual Studio # Files you want to generate\&. # if not env\&.GetOption(\*(Aquserfile\*(Aq): dbgSettings = None elif env\&.get(\*(AqMSVC_VERSION\*(Aq, None) == \*(Aq9\&.0\*(Aq: dbgSettings = V9DebugSettings elif env\&.get(\*(AqMSVC_VERSION\*(Aq, None) == \*(Aq11\&.0\*(Aq: dbgSettings = V10DebugSettings else: dbgSettings = None # # 4\&. Add the dictionary to the DebugSettings keyword\&. # barsrcs = [\*(Aqbar\&.cpp\*(Aq, \*(Aqdllmain\&.cpp\*(Aq, \*(Aqstdafx\&.cpp\*(Aq] barincs = [\*(Aqtargetver\&.h\*(Aq] barlocalincs = [\*(AqStdAfx\&.h\*(Aq] barresources = [\*(Aqbar\&.rc\*(Aq,\*(Aqresource\&.h\*(Aq] barmisc = [\*(AqReadMe\&.txt\*(Aq] dll = env\&.SharedLibrary(target=\*(Aqbar\&.dll\*(Aq, source=barsrcs) env\&.MSVSProject(target=\*(AqBar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq], srcs=barsrcs, incs=barincs, localincs=barlocalincs, resources=barresources, misc=barmisc, buildtarget=[dll[0]] * 2, variant=(\*(AqDebug|Win32\*(Aq, \*(AqRelease|Win32\*(Aq), cmdargs=\*(Aqvc=%s\*(Aq % msvcver, DebugSettings=(dbgSettings, {})) .fi .if n \{\ .RE .\} .RE .PP \fBMSVSSolution\fR(), \fIenv\fR\&.MSVSSolution() .RS 4 Builds a Microsoft Visual Studio solution file\&. .sp This builds a Visual Studio solution file, based on the version of Visual Studio that is configured (either the latest installed version, or the version specified by \fB$MSVS_VERSION\fR in the construction environment)\&. For Visual Studio 6, it will generate a \&.dsw file\&. For Visual Studio 7 (\&.NET), it will generate a \&.sln file\&. .sp The following values must be specified: .PP target .RS 4 The name of the target \&.dsw or \&.sln file\&. The correct suffix for the version of Visual Studio must be used, but the value \fB$MSVSSOLUTIONSUFFIX\fR will be defined to the correct value (see example below)\&. .RE .PP variant .RS 4 The name of this particular variant, or a list of variant names (the latter is only supported for MSVS 7 solutions)\&. These are typically things like "Debug" or "Release", but really can be anything you want\&. For MSVS 7 they may also specify target platform, like this "Debug|Xbox"\&. Default platform is Win32\&. .RE .PP projects .RS 4 A list of project file names, or Project nodes returned by calls to the \fBMSVSProject\fR Builder, to be placed into the solution file\&. It should be noted that these file names are NOT added to the $SOURCES environment variable in form of files, but rather as strings\&. This is because they represent file names to be added to the solution file, not the source files used to build the solution file\&. .RE .sp Example Usage: .sp .if n \{\ .RS 4 .\} .nf env\&.MSVSSolution( target="Bar" + env["MSVSSOLUTIONSUFFIX"], projects=["bar" + env["MSVSPROJECTSUFFIX"]], variant="Release", ) .fi .if n \{\ .RE .\} .RE .PP \fBObject\fR(), \fIenv\fR\&.Object() .RS 4 A synonym for the \fBStaticObject\fR builder method\&. .RE .PP \fBPackage\fR(), \fIenv\fR\&.Package() .RS 4 Builds a Binary Package of the given source files\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Package(source = FindInstalledFiles()) .fi .if n \{\ .RE .\} .sp Builds software distribution packages\&. Packages consist of files to install and packaging information\&. The former may be specified with the \fIsource\fR parameter and may be left out, in which case the \fBFindInstalledFiles\fR function will collect all files that have an \fBInstall\fR or \fBInstallAs\fR Builder attached\&. If the \fItarget\fR is not specified it will be deduced from additional information given to this Builder\&. .sp The packaging information is specified with the help of construction variables documented below\&. This information is called a tag to stress that some of them can also be attached to files with the \fBTag\fR function\&. The mandatory ones will complain if they were not specified\&. They vary depending on chosen target packager\&. .sp The target packager may be selected with the "PACKAGETYPE" command line option or with the \fB$PACKAGETYPE\fR construction variable\&. Currently the following packagers available: .RS 4 msi \- Microsoft Installer .RE .RS 4 rpm \- RPM Package Manger .RE .RS 4 ipkg \- Itsy Package Management System .RE .RS 4 tarbz2 \- bzip2 compressed tar .RE .RS 4 targz \- gzip compressed tar .RE .RS 4 tarxz \- xz compressed tar .RE .RS 4 zip \- zip file .RE .RS 4 src_tarbz2 \- bzip2 compressed tar source .RE .RS 4 src_targz \- gzip compressed tar source .RE .RS 4 src_tarxz \- xz compressed tar source .RE .RS 4 src_zip \- zip file source .RE An updated list is always available under the \fIpackage_type\fR option when running \fBscons \-\-help\fR on a project that has packaging activated\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=["default", "packaging"]) env\&.Install("/bin/", "my_program") env\&.Package( NAME="foo", VERSION="1\&.2\&.3", PACKAGEVERSION=0, PACKAGETYPE="rpm", LICENSE="gpl", SUMMARY="balalalalal", DESCRIPTION="this should be really really long", X_RPM_GROUP="Application/fu", SOURCE_URL="http://foo\&.org/foo\-1\&.2\&.3\&.tar\&.gz", ) .fi .if n \{\ .RE .\} .RE .PP \fBPCH\fR(), \fIenv\fR\&.PCH() .RS 4 Builds a Microsoft Visual C++ precompiled header\&. Calling this builder method returns a list of two targets: the PCH as the first element, and the object file as the second element\&. Normally the object file is ignored\&. This builder method is only provided when Microsoft Visual C++ is being used as the compiler\&. The PCH builder method is generally used in conjunction with the PCH construction variable to force object files to use the precompiled header: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqPCH\*(Aq] = env\&.PCH(\*(AqStdAfx\&.cpp\*(Aq)[0] .fi .if n \{\ .RE .\} .RE .PP \fBPDF\fR(), \fIenv\fR\&.PDF() .RS 4 Builds a \&.pdf file from a \&.dvi input file (or, by extension, a \&.tex, \&.ltx, or \&.latex input file)\&. The suffix specified by the \fB$PDFSUFFIX\fR construction variable (\&.pdf by default) is added automatically to the target if it is not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf # builds from aaa\&.tex env\&.PDF(target = \*(Aqaaa\&.pdf\*(Aq, source = \*(Aqaaa\&.tex\*(Aq) # builds bbb\&.pdf from bbb\&.dvi env\&.PDF(target = \*(Aqbbb\*(Aq, source = \*(Aqbbb\&.dvi\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBPOInit\fR(), \fIenv\fR\&.POInit() .RS 4 This builder belongs to msginit tool\&. The builder initializes missing PO file(s) if \fB$POAUTOINIT\fR is set\&. If \fB$POAUTOINIT\fR is not set (default), \fBPOInit\fR prints instruction for user (that is supposed to be a translator), telling how the PO file should be initialized\&. In normal projects \fIyou should not use \fR\fI\fBPOInit\fR\fR\fI and use \fR\fI\fBPOUpdate\fR\fR\fI instead\fR\&. \fBPOUpdate\fR chooses intelligently between \fBmsgmerge(1)\fR and \fBmsginit(1)\fR\&. \fBPOInit\fR always uses \fBmsginit(1)\fR and should be regarded as builder for special purposes or for temporary use (e\&.g\&. for quick, one time initialization of a bunch of PO files) or for tests\&. .sp Target nodes defined through \fBPOInit\fR are not built by default (they\*(Aqre Ignored from \*(Aq\&.\*(Aq node) but are added to special Alias (\*(Aqpo\-create\*(Aq by default)\&. The alias name may be changed through the \fB$POCREATE_ALIAS\fR construction variable\&. All PO files defined through \fBPOInit\fR may be easily initialized by \fBscons po\-create\fR\&. .sp \fIExample 1\fR\&. Initialize en\&.po and pl\&.po from messages\&.pot: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POInit([\*(Aqen\*(Aq, \*(Aqpl\*(Aq]) # messages\&.pot \-\-> [en\&.po, pl\&.po] .fi .if n \{\ .RE .\} .sp \fIExample 2\fR\&. Initialize en\&.po and pl\&.po from foo\&.pot: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POInit([\*(Aqen\*(Aq, \*(Aqpl\*(Aq], [\*(Aqfoo\*(Aq]) # foo\&.pot \-\-> [en\&.po, pl\&.po] .fi .if n \{\ .RE .\} .sp \fIExample 3\fR\&. Initialize en\&.po and pl\&.po from foo\&.pot but using \fB$POTDOMAIN\fR construction variable: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POInit([\*(Aqen\*(Aq, \*(Aqpl\*(Aq], POTDOMAIN=\*(Aqfoo\*(Aq) # foo\&.pot \-\-> [en\&.po, pl\&.po] .fi .if n \{\ .RE .\} .sp \fIExample 4\fR\&. Initialize PO files for languages defined in LINGUAS file\&. The files will be initialized from template messages\&.pot: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POInit(LINGUAS_FILE = 1) # needs \*(AqLINGUAS\*(Aq file .fi .if n \{\ .RE .\} .sp \fIExample 5\fR\&. Initialize en\&.po and pl\&.pl PO files plus files for languages defined in LINGUAS file\&. The files will be initialized from template messages\&.pot: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POInit([\*(Aqen\*(Aq, \*(Aqpl\*(Aq], LINGUAS_FILE = 1) .fi .if n \{\ .RE .\} .sp \fIExample 6\fR\&. You may preconfigure your environment first, and then initialize PO files: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env[\*(AqPOAUTOINIT\*(Aq] = 1 env[\*(AqLINGUAS_FILE\*(Aq] = 1 env[\*(AqPOTDOMAIN\*(Aq] = \*(Aqfoo\*(Aq env\&.POInit() .fi .if n \{\ .RE .\} .sp which has same efect as: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POInit(POAUTOINIT = 1, LINGUAS_FILE = 1, POTDOMAIN = \*(Aqfoo\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBPostScript\fR(), \fIenv\fR\&.PostScript() .RS 4 Builds a \&.ps file from a \&.dvi input file (or, by extension, a \&.tex, \&.ltx, or \&.latex input file)\&. The suffix specified by the \fB$PSSUFFIX\fR construction variable (\&.ps by default) is added automatically to the target if it is not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf # builds from aaa\&.tex env\&.PostScript(target = \*(Aqaaa\&.ps\*(Aq, source = \*(Aqaaa\&.tex\*(Aq) # builds bbb\&.ps from bbb\&.dvi env\&.PostScript(target = \*(Aqbbb\*(Aq, source = \*(Aqbbb\&.dvi\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBPOTUpdate\fR(), \fIenv\fR\&.POTUpdate() .RS 4 The builder belongs to xgettext tool\&. The builder updates target POT file if exists or creates one if it doesn\*(Aqt\&. The node is not built by default (i\&.e\&. it is Ignored from \*(Aq\&.\*(Aq), but only on demand (i\&.e\&. when given POT file is required or when special alias is invoked)\&. This builder adds its targe node (messages\&.pot, say) to a special alias (pot\-update by default, see \fB$POTUPDATE_ALIAS\fR) so you can update/create them easily with \fBscons pot\-update\fR\&. The file is not written until there is no real change in internationalized messages (or in comments that enter POT file)\&. .sp .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br You may see \fBxgettext(1)\fR being invoked by the xgettext tool even if there is no real change in internationalized messages (so the POT file is not being updated)\&. This happens every time a source file has changed\&. In such case we invoke \fBxgettext(1)\fR and compare its output with the content of POT file to decide whether the file should be updated or not\&. .sp .5v .RE .sp \fIExample 1\&.\fR Let\*(Aqs create po/ directory and place following SConstruct script there: .sp .if n \{\ .RS 4 .\} .nf # SConstruct in \*(Aqpo/\*(Aq subdir env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqxgettext\*(Aq] ) env\&.POTUpdate([\*(Aqfoo\*(Aq], [\*(Aq\&.\&./a\&.cpp\*(Aq, \*(Aq\&.\&./b\&.cpp\*(Aq]) env\&.POTUpdate([\*(Aqbar\*(Aq], [\*(Aq\&.\&./c\&.cpp\*(Aq, \*(Aq\&.\&./d\&.cpp\*(Aq]) .fi .if n \{\ .RE .\} .sp Then invoke scons few times: .sp .if n \{\ .RS 4 .\} .nf user@host:$ scons # Does not create foo\&.pot nor bar\&.pot user@host:$ scons foo\&.pot # Updates or creates foo\&.pot user@host:$ scons pot\-update # Updates or creates foo\&.pot and bar\&.pot user@host:$ scons \-c # Does not clean foo\&.pot nor bar\&.pot\&. .fi .if n \{\ .RE .\} .sp the results shall be as the comments above say\&. .sp \fIExample 2\&.\fR The \fBPOTUpdate\fR builder may be used with no target specified, in which case default target messages\&.pot will be used\&. The default target may also be overridden by setting \fB$POTDOMAIN\fR construction variable or providing it as an override to \fBPOTUpdate\fR builder: .sp .if n \{\ .RS 4 .\} .nf # SConstruct script env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqxgettext\*(Aq] ) env[\*(AqPOTDOMAIN\*(Aq] = "foo" env\&.POTUpdate(source = ["a\&.cpp", "b\&.cpp"]) # Creates foo\&.pot \&.\&.\&. env\&.POTUpdate(POTDOMAIN = "bar", source = ["c\&.cpp", "d\&.cpp"]) # and bar\&.pot .fi .if n \{\ .RE .\} .sp \fIExample 3\&.\fR The sources may be specified within separate file, for example POTFILES\&.in: .sp .if n \{\ .RS 4 .\} .nf # POTFILES\&.in in \*(Aqpo/\*(Aq subdirectory \&.\&./a\&.cpp \&.\&./b\&.cpp # end of file .fi .if n \{\ .RE .\} .sp The name of the file (POTFILES\&.in) containing the list of sources is provided via \fB$XGETTEXTFROM\fR: .sp .if n \{\ .RS 4 .\} .nf # SConstruct file in \*(Aqpo/\*(Aq subdirectory env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqxgettext\*(Aq] ) env\&.POTUpdate(XGETTEXTFROM = \*(AqPOTFILES\&.in\*(Aq) .fi .if n \{\ .RE .\} .sp \fIExample 4\&.\fR You may use \fB$XGETTEXTPATH\fR to define source search path\&. Assume, for example, that you have files a\&.cpp, b\&.cpp, po/SConstruct, po/POTFILES\&.in\&. Then your POT\-related files could look as below: .sp .if n \{\ .RS 4 .\} .nf # POTFILES\&.in in \*(Aqpo/\*(Aq subdirectory a\&.cpp b\&.cpp # end of file .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # SConstruct file in \*(Aqpo/\*(Aq subdirectory env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqxgettext\*(Aq] ) env\&.POTUpdate(XGETTEXTFROM = \*(AqPOTFILES\&.in\*(Aq, XGETTEXTPATH=\*(Aq\&.\&./\*(Aq) .fi .if n \{\ .RE .\} .sp \fIExample 5\&.\fR Multiple search directories may be defined within a list, i\&.e\&. XGETTEXTPATH = [\*(Aqdir1\*(Aq, \*(Aqdir2\*(Aq, \&.\&.\&.]\&. The order in the list determines the search order of source files\&. The path to the first file found is used\&. .sp Let\*(Aqs create 0/1/po/SConstruct script: .sp .if n \{\ .RS 4 .\} .nf # SConstruct file in \*(Aq0/1/po/\*(Aq subdirectory env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqxgettext\*(Aq] ) env\&.POTUpdate(XGETTEXTFROM = \*(AqPOTFILES\&.in\*(Aq, XGETTEXTPATH=[\*(Aq\&.\&./\*(Aq, \*(Aq\&.\&./\&.\&./\*(Aq]) .fi .if n \{\ .RE .\} .sp and 0/1/po/POTFILES\&.in: .sp .if n \{\ .RS 4 .\} .nf # POTFILES\&.in in \*(Aq0/1/po/\*(Aq subdirectory a\&.cpp # end of file .fi .if n \{\ .RE .\} .sp Write two *\&.cpp files, the first one is 0/a\&.cpp: .sp .if n \{\ .RS 4 .\} .nf /* 0/a\&.cpp */ gettext("Hello from \&.\&./\&.\&./a\&.cpp") .fi .if n \{\ .RE .\} .sp and the second is 0/1/a\&.cpp: .sp .if n \{\ .RS 4 .\} .nf /* 0/1/a\&.cpp */ gettext("Hello from \&.\&./a\&.cpp") .fi .if n \{\ .RE .\} .sp then run scons\&. You\*(Aqll obtain 0/1/po/messages\&.pot with the message "Hello from \&.\&./a\&.cpp"\&. When you reverse order in \fI$XGETTEXTFOM\fR, i\&.e\&. when you write SConscript as .sp .if n \{\ .RS 4 .\} .nf # SConstruct file in \*(Aq0/1/po/\*(Aq subdirectory env = Environment( tools = [\*(Aqdefault\*(Aq, \*(Aqxgettext\*(Aq] ) env\&.POTUpdate(XGETTEXTFROM = \*(AqPOTFILES\&.in\*(Aq, XGETTEXTPATH=[\*(Aq\&.\&./\&.\&./\*(Aq, \*(Aq\&.\&./\*(Aq]) .fi .if n \{\ .RE .\} .sp then the messages\&.pot will contain msgid "Hello from \&.\&./\&.\&./a\&.cpp" line and not msgid "Hello from \&.\&./a\&.cpp"\&. .RE .PP \fBPOUpdate\fR(), \fIenv\fR\&.POUpdate() .RS 4 The builder belongs to msgmerge tool\&. The builder updates PO files with \fBmsgmerge(1)\fR, or initializes missing PO files as described in documentation of msginit tool and \fBPOInit\fR builder (see also \fB$POAUTOINIT\fR)\&. Note, that \fBPOUpdate\fR \fIdoes not add its targets to \fR\fIpo\-create\fR\fI alias\fR as \fBPOInit\fR does\&. .sp Target nodes defined through \fBPOUpdate\fR are not built by default (they\*(Aqre Ignored from \*(Aq\&.\*(Aq node)\&. Instead, they are added automatically to special Alias (\*(Aqpo\-update\*(Aq by default)\&. The alias name may be changed through the \fB$POUPDATE_ALIAS\fR construction variable\&. You can easily update PO files in your project by \fBscons po\-update\fR\&. .sp \fIExample 1\&.\fR Update en\&.po and pl\&.po from messages\&.pot template (see also \fB$POTDOMAIN\fR), assuming that the later one exists or there is rule to build it (see \fBPOTUpdate\fR): .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POUpdate([\*(Aqen\*(Aq,\*(Aqpl\*(Aq]) # messages\&.pot \-\-> [en\&.po, pl\&.po] .fi .if n \{\ .RE .\} .sp \fIExample 2\&.\fR Update en\&.po and pl\&.po from foo\&.pot template: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POUpdate([\*(Aqen\*(Aq, \*(Aqpl\*(Aq], [\*(Aqfoo\*(Aq]) # foo\&.pot \-\-> [en\&.po, pl\&.pl] .fi .if n \{\ .RE .\} .sp \fIExample 3\&.\fR Update en\&.po and pl\&.po from foo\&.pot (another version): .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POUpdate([\*(Aqen\*(Aq, \*(Aqpl\*(Aq], POTDOMAIN=\*(Aqfoo\*(Aq) # foo\&.pot \-\- > [en\&.po, pl\&.pl] .fi .if n \{\ .RE .\} .sp \fIExample 4\&.\fR Update files for languages defined in LINGUAS file\&. The files are updated from messages\&.pot template: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POUpdate(LINGUAS_FILE = 1) # needs \*(AqLINGUAS\*(Aq file .fi .if n \{\ .RE .\} .sp \fIExample 5\&.\fR Same as above, but update from foo\&.pot template: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POUpdate(LINGUAS_FILE = 1, source = [\*(Aqfoo\*(Aq]) .fi .if n \{\ .RE .\} .sp \fIExample 6\&.\fR Update en\&.po and pl\&.po plus files for languages defined in LINGUAS file\&. The files are updated from messages\&.pot template: .sp .if n \{\ .RS 4 .\} .nf # produce \*(Aqen\&.po\*(Aq, \*(Aqpl\&.po\*(Aq + files defined in \*(AqLINGUAS\*(Aq: env\&.POUpdate([\*(Aqen\*(Aq, \*(Aqpl\*(Aq ], LINGUAS_FILE = 1) .fi .if n \{\ .RE .\} .sp \fIExample 7\&.\fR Use \fB$POAUTOINIT\fR to automatically initialize PO file if it doesn\*(Aqt exist: .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env\&.POUpdate(LINGUAS_FILE = 1, POAUTOINIT = 1) .fi .if n \{\ .RE .\} .sp \fIExample 8\&.\fR Update PO files for languages defined in LINGUAS file\&. The files are updated from foo\&.pot template\&. All necessary settings are pre\-configured via environment\&. .sp .if n \{\ .RS 4 .\} .nf # \&.\&.\&. env[\*(AqPOAUTOINIT\*(Aq] = 1 env[\*(AqLINGUAS_FILE\*(Aq] = 1 env[\*(AqPOTDOMAIN\*(Aq] = \*(Aqfoo\*(Aq env\&.POUpdate() .fi .if n \{\ .RE .\} .RE .PP \fBProgram\fR(), \fIenv\fR\&.Program() .RS 4 Builds an executable given one or more object files or C, C++, D, or Fortran source files\&. If any C, C++, D or Fortran source files are specified, then they will be automatically compiled to object files using the \fBObject\fR builder method; see that builder method\*(Aqs description for a list of legal source file suffixes and how they are interpreted\&. The target executable file prefix, specified by the \fB$PROGPREFIX\fR construction variable (nothing by default), and suffix, specified by the \fB$PROGSUFFIX\fR construction variable (by default, \&.exe on Windows systems, nothing on POSIX systems), are automatically added to the target if not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Program(target=\*(Aqfoo\*(Aq, source=[\*(Aqfoo\&.o\*(Aq, \*(Aqbar\&.c\*(Aq, \*(Aqbaz\&.f\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fBProgramAllAtOnce\fR(), \fIenv\fR\&.ProgramAllAtOnce() .RS 4 Builds an executable from D sources without first creating individual objects for each file\&. .sp D sources can be compiled file\-by\-file as C and C++ source are, and D is integrated into the \fBscons\fR Object and Program builders for this model of build\&. D codes can though do whole source meta\-programming (some of the testing frameworks do this)\&. For this it is imperative that all sources are compiled and linked in a single call to the D compiler\&. This builder serves that purpose\&. .sp .if n \{\ .RS 4 .\} .nf env\&.ProgramAllAtOnce(\*(Aqexecutable\*(Aq, [\*(Aqmod_a\&.d, mod_b\&.d\*(Aq, \*(Aqmod_c\&.d\*(Aq]) .fi .if n \{\ .RE .\} .sp This command will compile the modules mod_a, mod_b, and mod_c in a single compilation process without first creating object files for the modules\&. Some of the D compilers will create executable\&.o others will not\&. .RE .PP \fBRES\fR(), \fIenv\fR\&.RES() .RS 4 Builds a Microsoft Visual C++ resource file\&. This builder method is only provided when Microsoft Visual C++ or MinGW is being used as the compiler\&. The \&.res (or \&.o for MinGW) suffix is added to the target name if no other suffix is given\&. The source file is scanned for implicit dependencies as though it were a C file\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.RES(\*(Aqresource\&.rc\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBRMIC\fR(), \fIenv\fR\&.RMIC() .RS 4 Builds stub and skeleton class files for remote objects from Java \&.class files\&. The target is a directory relative to which the stub and skeleton class files will be written\&. The source can be the names of \&.class files, or the objects return from the \fBJava\fR builder method\&. .sp If the construction variable \fB$JAVACLASSDIR\fR is set, either in the environment or in the call to the \fBRMIC\fR builder method itself, then the value of the variable will be stripped from the beginning of any \&.class file names\&. .sp .if n \{\ .RS 4 .\} .nf classes = env\&.Java(target = \*(Aqclassdir\*(Aq, source = \*(Aqsrc\*(Aq) env\&.RMIC(target = \*(Aqoutdir1\*(Aq, source = classes) env\&.RMIC(target = \*(Aqoutdir2\*(Aq, source = [\*(Aqpackage/foo\&.class\*(Aq, \*(Aqpackage/bar\&.class\*(Aq]) env\&.RMIC(target = \*(Aqoutdir3\*(Aq, source = [\*(Aqclasses/foo\&.class\*(Aq, \*(Aqclasses/bar\&.class\*(Aq], JAVACLASSDIR = \*(Aqclasses\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBRPCGenClient\fR(), \fIenv\fR\&.RPCGenClient() .RS 4 Generates an RPC client stub (_clnt\&.c) file from a specified RPC (\&.x) source file\&. Because rpcgen only builds output files in the local directory, the command will be executed in the source file\*(Aqs directory by default\&. .sp .if n \{\ .RS 4 .\} .nf # Builds src/rpcif_clnt\&.c env\&.RPCGenClient(\*(Aqsrc/rpcif\&.x\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBRPCGenHeader\fR(), \fIenv\fR\&.RPCGenHeader() .RS 4 Generates an RPC header (\&.h) file from a specified RPC (\&.x) source file\&. Because rpcgen only builds output files in the local directory, the command will be executed in the source file\*(Aqs directory by default\&. .sp .if n \{\ .RS 4 .\} .nf # Builds src/rpcif\&.h env\&.RPCGenHeader(\*(Aqsrc/rpcif\&.x\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBRPCGenService\fR(), \fIenv\fR\&.RPCGenService() .RS 4 Generates an RPC server\-skeleton (_svc\&.c) file from a specified RPC (\&.x) source file\&. Because rpcgen only builds output files in the local directory, the command will be executed in the source file\*(Aqs directory by default\&. .sp .if n \{\ .RS 4 .\} .nf # Builds src/rpcif_svc\&.c env\&.RPCGenClient(\*(Aqsrc/rpcif\&.x\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBRPCGenXDR\fR(), \fIenv\fR\&.RPCGenXDR() .RS 4 Generates an RPC XDR routine (_xdr\&.c) file from a specified RPC (\&.x) source file\&. Because rpcgen only builds output files in the local directory, the command will be executed in the source file\*(Aqs directory by default\&. .sp .if n \{\ .RS 4 .\} .nf # Builds src/rpcif_xdr\&.c env\&.RPCGenClient(\*(Aqsrc/rpcif\&.x\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBSharedLibrary\fR(), \fIenv\fR\&.SharedLibrary() .RS 4 Builds a shared library (\&.so on a POSIX system, \&.dll on Windows) given one or more object files or C, C++, D or Fortran source files\&. If any source files are given, then they will be automatically compiled to object files\&. The target library file prefix, specified by the \fB$SHLIBPREFIX\fR construction variable (by default, lib on POSIX systems, nothing on Windows systems), and suffix, specified by the \fB$SHLIBSUFFIX\fR construction variable (by default, \&.dll on Windows systems, \&.so on POSIX systems), are automatically added to the target if not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.SharedLibrary(target=\*(Aqbar\*(Aq, source=[\*(Aqbar\&.c\*(Aq, \*(Aqfoo\&.o\*(Aq]) .fi .if n \{\ .RE .\} .sp On Windows systems, the \fBSharedLibrary\fR builder method will always build an import library (\&.lib) in addition to the shared library (\&.dll), adding a \&.lib library with the same basename if there is not already a \&.lib file explicitly listed in the targets\&. .sp On Cygwin systems, the \fBSharedLibrary\fR builder method will always build an import library (\&.dll\&.a) in addition to the shared library (\&.dll), adding a \&.dll\&.a library with the same basename if there is not already a \&.dll\&.a file explicitly listed in the targets\&. .sp Any object files listed in the \fIsource\fR must have been built for a shared library (that is, using the \fBSharedObject\fR builder method)\&. \fBscons\fR will raise an error if there is any mismatch\&. .sp On some platforms, there is a distinction between a shared library (loaded automatically by the system to resolve external references) and a loadable module (explicitly loaded by user action)\&. For maximum portability, use the \fBLoadableModule\fR builder for the latter\&. .sp When the \fB$SHLIBVERSION\fR construction variable is defined, a versioned shared library is created\&. This modifies \fB$SHLINKFLAGS\fR as required, adds the version number to the library name, and creates any symbolic links that are needed\&. .sp .if n \{\ .RS 4 .\} .nf env\&.SharedLibrary(target=\*(Aqbar\*(Aq, source=[\*(Aqbar\&.c\*(Aq, \*(Aqfoo\&.o\*(Aq], SHLIBVERSION=\*(Aq1\&.5\&.2\*(Aq) .fi .if n \{\ .RE .\} .sp On a POSIX system, versions with a single token create exactly one symlink: libbar\&.so\&.6 would have symlink libbar\&.so only\&. On a POSIX system, versions with two or more tokens create exactly two symlinks: libbar\&.so\&.2\&.3\&.1 would have symlinks libbar\&.so and libbar\&.so\&.2; on a Darwin (OSX) system the library would be libbar\&.2\&.3\&.1\&.dylib and the link would be libbar\&.dylib\&. .sp On Windows systems, specifying \fIregister=1\fR will cause the \&.dll to be registered after it is built\&. The command that is run is determined by the \fB$REGSVR\fR construction variable (\fBregsvr32\fR by default), and the flags passed are determined by \fB$REGSVRFLAGS\fR\&. By default, \fB$REGSVRFLAGS\fR includes the \fB/s\fR option, to prevent dialogs from popping up and requiring user attention when it is run\&. If you change \fB$REGSVRFLAGS\fR, be sure to include the \fB/s\fR option\&. For example, .sp .if n \{\ .RS 4 .\} .nf env\&.SharedLibrary(target=\*(Aqbar\*(Aq, source=[\*(Aqbar\&.cxx\*(Aq, \*(Aqfoo\&.obj\*(Aq], register=1) .fi .if n \{\ .RE .\} .sp will register bar\&.dll as a COM object when it is done linking it\&. .RE .PP \fBSharedObject\fR(), \fIenv\fR\&.SharedObject() .RS 4 Builds an object file intended for inclusion in a shared library\&. Source files must have one of the same set of extensions specified above for the \fBStaticObject\fR builder method\&. On some platforms building a shared object requires additional compiler option (e\&.g\&. \fB\-fPIC\fR for \fBgcc\fR) in addition to those needed to build a normal (static) object, but on some platforms there is no difference between a shared object and a normal (static) one\&. When there is a difference, SCons will only allow shared objects to be linked into a shared library, and will use a different suffix for shared objects\&. On platforms where there is no difference, SCons will allow both normal (static) and shared objects to be linked into a shared library, and will use the same suffix for shared and normal (static) objects\&. The target object file prefix, specified by the \fB$SHOBJPREFIX\fR construction variable (by default, the same as \fB$OBJPREFIX\fR), and suffix, specified by the \fB$SHOBJSUFFIX\fR construction variable, are automatically added to the target if not already present\&. Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.SharedObject(target=\*(Aqddd\*(Aq, source=\*(Aqddd\&.c\*(Aq) env\&.SharedObject(target=\*(Aqeee\&.o\*(Aq, source=\*(Aqeee\&.cpp\*(Aq) env\&.SharedObject(target=\*(Aqfff\&.obj\*(Aq, source=\*(Aqfff\&.for\*(Aq) .fi .if n \{\ .RE .\} .sp Note that the source files will be scanned according to the suffix mappings in the SourceFileScanner object\&. See the section "Scanner Objects," below, for more information\&. .RE .PP \fBStaticLibrary\fR(), \fIenv\fR\&.StaticLibrary() .RS 4 Builds a static library given one or more object files or C, C++, D or Fortran source files\&. If any source files are given, then they will be automatically compiled to object files\&. The static library file prefix, specified by the \fB$LIBPREFIX\fR construction variable (by default, lib on POSIX systems, nothing on Windows systems), and suffix, specified by the \fB$LIBSUFFIX\fR construction variable (by default, \&.lib on Windows systems, \&.a on POSIX systems), are automatically added to the target if not already present\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.StaticLibrary(target=\*(Aqbar\*(Aq, source=[\*(Aqbar\&.c\*(Aq, \*(Aqfoo\&.o\*(Aq]) .fi .if n \{\ .RE .\} .sp Any object files listed in the \fIsource\fR must have been built for a static library (that is, using the \fBStaticObject\fR builder method)\&. \fBscons\fR will raise an error if there is any mismatch\&. .RE .PP \fBStaticObject\fR(), \fIenv\fR\&.StaticObject() .RS 4 Builds a static object file from one or more C, C++, D, or Fortran source files\&. Source files must have one of the following extensions: .sp .if n \{\ .RS 4 .\} .nf \&.asm assembly language file \&.ASM assembly language file \&.c C file \&.C Windows: C file POSIX: C++ file \&.cc C++ file \&.cpp C++ file \&.cxx C++ file \&.cxx C++ file \&.c++ C++ file \&.C++ C++ file \&.d D file \&.f Fortran file \&.F Windows: Fortran file POSIX: Fortran file + C pre\-processor \&.for Fortran file \&.FOR Fortran file \&.fpp Fortran file + C pre\-processor \&.FPP Fortran file + C pre\-processor \&.m Object C file \&.mm Object C++ file \&.s assembly language file \&.S Windows: assembly language file ARM: CodeSourcery Sourcery Lite \&.sx assembly language file + C pre\-processor POSIX: assembly language file + C pre\-processor \&.spp assembly language file + C pre\-processor \&.SPP assembly language file + C pre\-processor .fi .if n \{\ .RE .\} .sp The target object file prefix, specified by the \fB$OBJPREFIX\fR construction variable (nothing by default), and suffix, specified by the \fB$OBJSUFFIX\fR construction variable (\&.obj on Windows systems, \&.o on POSIX systems), are automatically added to the target if not already present\&. Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.StaticObject(target=\*(Aqaaa\*(Aq, source=\*(Aqaaa\&.c\*(Aq) env\&.StaticObject(target=\*(Aqbbb\&.o\*(Aq, source=\*(Aqbbb\&.c++\*(Aq) env\&.StaticObject(target=\*(Aqccc\&.obj\*(Aq, source=\*(Aqccc\&.f\*(Aq) .fi .if n \{\ .RE .\} .sp Note that the source files will be scanned according to the suffix mappings in the SourceFileScanner object\&. See the section "Scanner Objects," below, for more information\&. .RE .PP \fBSubstfile\fR(), \fIenv\fR\&.Substfile() .RS 4 The \fBSubstfile\fR builder creates a single text file from a template consisting of a file or set of files (or nodes), replacing text using the \fB$SUBST_DICT\fR construction variable (if set)\&. If a set, they are concatenated into the target file using the value of the \fB$LINESEPARATOR\fR construction variable as a separator between contents; the separator is not emitted after the contents of the last file\&. Nested lists of source files are flattened\&. See also \fBTextfile\fR\&. .sp If a single source file name is specified and has a \&.in suffix, the suffix is stripped and the remainder of the name is used as the default target name\&. .sp The prefix and suffix specified by the \fB$SUBSTFILEPREFIX\fR and \fB$SUBSTFILESUFFIX\fR construction variables (an empty string by default in both cases) are automatically added to the target if they are not already present\&. .sp If a construction variable named \fB$SUBST_DICT\fR is present, it may be either a Python dictionary or a sequence of (\fIkey\fR, \fIvalue\fR) tuples\&. If it is a dictionary it is converted into a list of tuples with unspecified order, so if one key is a prefix of another key or if one substitution could be further expanded by another subsitition, it is unpredictable whether the expansion will occur\&. .sp Any occurrences of a key in the source are replaced by the corresponding value, which may be a Python callable function or a string\&. If the value is a callable, it is called with no arguments to get a string\&. Strings are \fIsubst\fR\-expanded and the result replaces the key\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[\*(Aqdefault\*(Aq]) env[\*(Aqprefix\*(Aq] = \*(Aq/usr/bin\*(Aq script_dict = {\*(Aq@prefix@\*(Aq: \*(Aq/bin\*(Aq, \*(Aq@exec_prefix@\*(Aq: \*(Aq$prefix\*(Aq} env\&.Substfile(\*(Aqscript\&.in\*(Aq, SUBST_DICT=script_dict) conf_dict = {\*(Aq%VERSION%\*(Aq: \*(Aq1\&.2\&.3\*(Aq, \*(Aq%BASE%\*(Aq: \*(AqMyProg\*(Aq} env\&.Substfile(\*(Aqconfig\&.h\&.in\*(Aq, conf_dict, SUBST_DICT=conf_dict) # UNPREDICTABLE \- one key is a prefix of another bad_foo = {\*(Aq$foo\*(Aq: \*(Aq$foo\*(Aq, \*(Aq$foobar\*(Aq: \*(Aq$foobar\*(Aq} env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBST_DICT=bad_foo) # PREDICTABLE \- keys are applied longest first good_foo = [(\*(Aq$foobar\*(Aq, \*(Aq$foobar\*(Aq), (\*(Aq$foo\*(Aq, \*(Aq$foo\*(Aq)] env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBST_DICT=good_foo) # UNPREDICTABLE \- one substitution could be futher expanded bad_bar = {\*(Aq@bar@\*(Aq: \*(Aq@soap@\*(Aq, \*(Aq@soap@\*(Aq: \*(Aqlye\*(Aq} env\&.Substfile(\*(Aqbar\&.in\*(Aq, SUBST_DICT=bad_bar) # PREDICTABLE \- substitutions are expanded in order good_bar = ((\*(Aq@bar@\*(Aq, \*(Aq@soap@\*(Aq), (\*(Aq@soap@\*(Aq, \*(Aqlye\*(Aq)) env\&.Substfile(\*(Aqbar\&.in\*(Aq, SUBST_DICT=good_bar) # the SUBST_DICT may be in common (and not an override) substutions = {} subst = Environment(tools=[\*(Aqtextfile\*(Aq], SUBST_DICT=substitutions) substitutions[\*(Aq@foo@\*(Aq] = \*(Aqfoo\*(Aq subst[\*(AqSUBST_DICT\*(Aq][\*(Aq@bar@\*(Aq] = \*(Aqbar\*(Aq subst\&.Substfile( \*(Aqpgm1\&.c\*(Aq, [Value(\*(Aq#include "@foo@\&.h"\*(Aq), Value(\*(Aq#include "@bar@\&.h"\*(Aq), "common\&.in", "pgm1\&.in"], ) subst\&.Substfile( \*(Aqpgm2\&.c\*(Aq, [Value(\*(Aq#include "@foo@\&.h"\*(Aq), Value(\*(Aq#include "@bar@\&.h"\*(Aq), "common\&.in", "pgm2\&.in"], ) .fi .if n \{\ .RE .\} .RE .PP \fBTar\fR(), \fIenv\fR\&.Tar() .RS 4 Builds a tar archive of the specified files and/or directories\&. Unlike most builder methods, the \fBTar\fR builder method may be called multiple times for a given target; each additional call adds to the list of entries that will be built into the archive\&. Any source directories will be scanned for changes to any on\-disk files, regardless of whether or not \fBscons\fR knows about them from other Builder or function calls\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Tar(\*(Aqsrc\&.tar\*(Aq, \*(Aqsrc\*(Aq) # Create the stuff\&.tar file\&. env\&.Tar(\*(Aqstuff\*(Aq, [\*(Aqsubdir1\*(Aq, \*(Aqsubdir2\*(Aq]) # Also add "another" to the stuff\&.tar file\&. env\&.Tar(\*(Aqstuff\*(Aq, \*(Aqanother\*(Aq) # Set TARFLAGS to create a gzip\-filtered archive\&. env = Environment(TARFLAGS = \*(Aq\-c \-z\*(Aq) env\&.Tar(\*(Aqfoo\&.tar\&.gz\*(Aq, \*(Aqfoo\*(Aq) # Also set the suffix to \&.tgz\&. env = Environment(TARFLAGS = \*(Aq\-c \-z\*(Aq, TARSUFFIX = \*(Aq\&.tgz\*(Aq) env\&.Tar(\*(Aqfoo\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBTextfile\fR(), \fIenv\fR\&.Textfile() .RS 4 The \fBTextfile\fR builder generates a single text file from a template consisting of a list of strings, replacing text using the \fB$SUBST_DICT\fR construction variable (if set) \- see \fBSubstfile\fR for a description of replacement\&. The strings will be separated in the target file using the value of the \fB$LINESEPARATOR\fR construction variable; the line separator is not emitted after the last string\&. Nested lists of source strings are flattened\&. Source strings need not literally be Python strings: they can be Nodes or Python objects that convert cleanly to \fBValue\fR nodes .sp The prefix and suffix specified by the \fB$TEXTFILEPREFIX\fR and \fB$TEXTFILESUFFIX\fR construction variables (by default an empty string and \&.txt, respectively) are automatically added to the target if they are not already present\&. Examples: .sp .if n \{\ .RS 4 .\} .nf # builds/writes foo\&.txt env\&.Textfile(target=\*(Aqfoo\&.txt\*(Aq, source=[\*(AqGoethe\*(Aq, 42, \*(AqSchiller\*(Aq]) # builds/writes bar\&.txt env\&.Textfile(target=\*(Aqbar\*(Aq, source=[\*(Aqlalala\*(Aq, \*(Aqtanteratei\*(Aq], LINESEPARATOR=\*(Aq|*\*(Aq) # nested lists are flattened automatically env\&.Textfile(target=\*(Aqblob\*(Aq, source=[\*(Aqlalala\*(Aq, [\*(AqGoethe\*(Aq, 42, \*(AqSchiller\*(Aq], \*(Aqtanteratei\*(Aq]) # files may be used as input by wraping them in File() env\&.Textfile( target=\*(Aqconcat\*(Aq, # concatenate files with a marker between source=[File(\*(Aqconcat1\*(Aq), File(\*(Aqconcat2\*(Aq)], LINESEPARATOR=\*(Aq====================\en\*(Aq, ) .fi .if n \{\ .RE .\} .sp Results: .sp foo\&.txt .sp .if n \{\ .RS 4 .\} .nf Goethe 42 Schiller .fi .if n \{\ .RE .\} .sp bar\&.txt .sp .if n \{\ .RS 4 .\} .nf lalala|*tanteratei .fi .if n \{\ .RE .\} .sp blob\&.txt .sp .if n \{\ .RS 4 .\} .nf lalala Goethe 42 Schiller tanteratei .fi .if n \{\ .RE .\} .RE .PP \fBTranslate\fR(), \fIenv\fR\&.Translate() .RS 4 This pseudo\-builder belongs to gettext toolset\&. The builder extracts internationalized messages from source files, updates POT template (if necessary) and then updates PO translations (if necessary)\&. If \fB$POAUTOINIT\fR is set, missing PO files will be automatically created (i\&.e\&. without translator person intervention)\&. The variables \fB$LINGUAS_FILE\fR and \fB$POTDOMAIN\fR are taken into acount too\&. All other construction variables used by \fBPOTUpdate\fR, and \fBPOUpdate\fR work here too\&. .sp \fIExample 1\fR\&. The simplest way is to specify input files and output languages inline in a SCons script when invoking \fBTranslate\fR .sp .if n \{\ .RS 4 .\} .nf # SConscript in \*(Aqpo/\*(Aq directory env = Environment( tools = ["default", "gettext"] ) env[\*(AqPOAUTOINIT\*(Aq] = 1 env\&.Translate([\*(Aqen\*(Aq,\*(Aqpl\*(Aq], [\*(Aq\&.\&./a\&.cpp\*(Aq,\*(Aq\&.\&./b\&.cpp\*(Aq]) .fi .if n \{\ .RE .\} .sp \fIExample 2\fR\&. If you wish, you may also stick to conventional style known from autotools, i\&.e\&. using POTFILES\&.in and LINGUAS files .sp .if n \{\ .RS 4 .\} .nf # LINGUAS en pl #end .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # POTFILES\&.in a\&.cpp b\&.cpp # end .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # SConscript env = Environment( tools = ["default", "gettext"] ) env[\*(AqPOAUTOINIT\*(Aq] = 1 env[\*(AqXGETTEXTPATH\*(Aq] = [\*(Aq\&.\&./\*(Aq] env\&.Translate(LINGUAS_FILE = 1, XGETTEXTFROM = \*(AqPOTFILES\&.in\*(Aq) .fi .if n \{\ .RE .\} .sp The last approach is perhaps the recommended one\&. It allows easily split internationalization/localization onto separate SCons scripts, where a script in source tree is responsible for translations (from sources to PO files) and script(s) under variant directories are responsible for compilation of PO to MO files to and for installation of MO files\&. The "gluing factor" synchronizing these two scripts is then the content of LINGUAS file\&. Note, that the updated POT and PO files are usually going to be committed back to the repository, so they must be updated within the source directory (and not in variant directories)\&. Additionaly, the file listing of po/ directory contains LINGUAS file, so the source tree looks familiar to translators, and they may work with the project in their usual way\&. .sp \fIExample 3\fR\&. Let\*(Aqs prepare a development tree as below .sp .if n \{\ .RS 4 .\} .nf project/ + SConstruct + build/ + src/ + po/ + SConscript + SConscript\&.i18n + POTFILES\&.in + LINGUAS .fi .if n \{\ .RE .\} .sp with build being variant directory\&. Write the top\-level SConstruct script as follows .sp .if n \{\ .RS 4 .\} .nf # SConstruct env = Environment( tools = ["default", "gettext"] ) VariantDir(\*(Aqbuild\*(Aq, \*(Aqsrc\*(Aq, duplicate = 0) env[\*(AqPOAUTOINIT\*(Aq] = 1 SConscript(\*(Aqsrc/po/SConscript\&.i18n\*(Aq, exports = \*(Aqenv\*(Aq) SConscript(\*(Aqbuild/po/SConscript\*(Aq, exports = \*(Aqenv\*(Aq) .fi .if n \{\ .RE .\} .sp the src/po/SConscript\&.i18n as .sp .if n \{\ .RS 4 .\} .nf # src/po/SConscript\&.i18n Import(\*(Aqenv\*(Aq) env\&.Translate(LINGUAS_FILE=1, XGETTEXTFROM=\*(AqPOTFILES\&.in\*(Aq, XGETTEXTPATH=[\*(Aq\&.\&./\*(Aq]) .fi .if n \{\ .RE .\} .sp and the src/po/SConscript .sp .if n \{\ .RS 4 .\} .nf # src/po/SConscript Import(\*(Aqenv\*(Aq) env\&.MOFiles(LINGUAS_FILE = 1) .fi .if n \{\ .RE .\} .sp Such setup produces POT and PO files under source tree in src/po/ and binary MO files under variant tree in build/po/\&. This way the POT and PO files are separated from other output files, which must not be committed back to source repositories (e\&.g\&. MO files)\&. .sp .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br In above example, the PO files are not updated, nor created automatically when you issue \fBscons \*(Aq\&.\*(Aq\fR command\&. The files must be updated (created) by hand via \fBscons po\-update\fR and then MO files can be compiled by running \fBscons \*(Aq\&.\*(Aq\fR\&. .sp .5v .RE .RE .PP \fBTypeLibrary\fR(), \fIenv\fR\&.TypeLibrary() .RS 4 Builds a Windows type library (\&.tlb) file from an input IDL file (\&.idl)\&. In addition, it will build the associated interface stub and proxy source files, naming them according to the base name of the \&.idl file\&. For example, .sp .if n \{\ .RS 4 .\} .nf env\&.TypeLibrary(source="foo\&.idl") .fi .if n \{\ .RE .\} .sp Will create foo\&.tlb, foo\&.h, foo_i\&.c, foo_p\&.c and foo_data\&.c files\&. .RE .PP \fBUic\fR(), \fIenv\fR\&.Uic() .RS 4 Builds a header file, an implementation file and a moc file from an ui file\&. and returns the corresponding nodes in the above order\&. This builder is only available after using the tool \*(Aqqt\*(Aq\&. Note: you can specify \&.ui files directly as source files to the \fBProgram\fR, \fBLibrary\fR and \fBSharedLibrary\fR builders without using this builder\&. Using this builder lets you override the standard naming conventions (be careful: prefixes are always prepended to names of built files; if you don\*(Aqt want prefixes, you may set them to ``)\&. See the \fB$QTDIR\fR variable for more information\&. Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Uic(\*(Aqfoo\&.ui\*(Aq) # \-> [\*(Aqfoo\&.h\*(Aq, \*(Aquic_foo\&.cc\*(Aq, \*(Aqmoc_foo\&.cc\*(Aq] env\&.Uic(target = Split(\*(Aqinclude/foo\&.h gen/uicfoo\&.cc gen/mocfoo\&.cc\*(Aq), source = \*(Aqfoo\&.ui\*(Aq) # \-> [\*(Aqinclude/foo\&.h\*(Aq, \*(Aqgen/uicfoo\&.cc\*(Aq, \*(Aqgen/mocfoo\&.cc\*(Aq] .fi .if n \{\ .RE .\} .RE .PP \fBZip\fR(), \fIenv\fR\&.Zip() .RS 4 Builds a zip archive of the specified files and/or directories\&. Unlike most builder methods, the \fBZip\fR builder method may be called multiple times for a given target; each additional call adds to the list of entries that will be built into the archive\&. Any source directories will be scanned for changes to any on\-disk files, regardless of whether or not \fBscons\fR knows about them from other Builder or function calls\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Zip(\*(Aqsrc\&.zip\*(Aq, \*(Aqsrc\*(Aq) # Create the stuff\&.zip file\&. env\&.Zip(\*(Aqstuff\*(Aq, [\*(Aqsubdir1\*(Aq, \*(Aqsubdir2\*(Aq]) # Also add "another" to the stuff\&.tar file\&. env\&.Zip(\*(Aqstuff\*(Aq, \*(Aqanother\*(Aq) .fi .if n \{\ .RE .\} .RE .PP All targets of builder methods automatically depend on their sources\&. An explicit dependency can be specified using the \fBenv\&.Depends\fR method of a construction environment (see below)\&. .PP In addition, \fBscons\fR automatically scans source files for various programming languages, so the dependencies do not need to be specified explicitly\&. By default, SCons can C source files, C++ source files, Fortran source files with \&.F (POSIX systems only), \&.fpp, or \&.FPP file extensions, and assembly language files with \&.S (POSIX systems only), \&.spp, or \&.SPP files extensions for C preprocessor dependencies\&. SCons also has default support for scanning D source files, You can also write your own Scanners to add support for additional source file types\&. These can be added to the default Scanner object used by the \fBObject\fR, \fBStaticObject\fR and \fBSharedObject\fR Builders by adding them to the SourceFileScanner object\&. See the section called \(lqScanner Objects\(rq for more information about defining your own Scanner objects and using the SourceFileScanner object\&. .SS "Methods and Functions To Do Things" .PP In addition to Builder methods, \fBscons\fR provides a number of other construction environment methods and global functions to manipulate the build configuration\&. .PP Usually, a construction environment method and global function with the same name both exist for convenience\&. In the following list, the global function is documented in this style: .sp .if n \{\ .RS 4 .\} .nf \fBFunction\fR(\fIarguments, [optional arguments]\fR) .fi .if n \{\ .RE .\} .PP and the construction environment method looks like: .sp .if n \{\ .RS 4 .\} .nf \fIenv\fR\&.Function(\fIarguments, [optional arguments]\fR) .fi .if n \{\ .RE .\} .PP If the function can be called both ways, then both forms are listed\&. .PP The global function and same\-named construction environment method provide almost identical functionality, with a couple of exceptions\&. First, many of the construction environment methods affect only that construction environment, while the global function has a global effect\&. Second, where appropriate, calling the functionality through a construction environment will substitute construction variables into any supplied string arguments, while the global function doesn\*(Aqt have the context of a construction environment to pick variables from, so it cannot perform the substitution\&. For example: .sp .if n \{\ .RS 4 .\} .nf Default(\*(Aq$FOO\*(Aq) env = Environment(FOO=\*(Aqfoo\*(Aq) env\&.Default(\*(Aq$FOO\*(Aq) .fi .if n \{\ .RE .\} .PP In the above example, the call to the global \fBDefault\fR function will add a target named \fB$FOO\fR to the list of default targets, while the call to the \fBenv\&.Default\fR construction environment method will expand the value and add a target named \fBfoo\fR to the list of default targets\&. For more on construction variable expansion, see the next section on construction variables\&. .PP Global functions may be called from custom Python modules that you import into an SConscript file by adding the following import to the Python module: .sp .if n \{\ .RS 4 .\} .nf from SCons\&.Script import * .fi .if n \{\ .RE .\} .PP Construction environment methods and global functions provided by \fBscons\fR include: .PP \fBAction\fR(\fIaction, [cmd/str/fun, [var, \&.\&.\&.]] [option=value, \&.\&.\&.]\fR), \fIenv\fR\&.Action(\fIaction, [cmd/str/fun, [var, \&.\&.\&.]] [option=value, \&.\&.\&.]\fR) .RS 4 A factory function to create an Action object for the specified \fIaction\fR\&. See the manpage section "Action Objects" for a complete explanation of the arguments and behavior\&. .sp Note that the \fBenv\&.Action\fR form of the invocation will expand construction variables in any argument strings, including the \fIaction\fR argument, at the time it is called using the construction variables in the \fIenv\fR construction environment through which \fBenv\&.Action\fR was called\&. The \fBAction\fR global function form delays all variable expansion until the Action object is actually used\&. .RE .PP \fBAddMethod\fR(\fIobject, function, [name]\fR), \fIenv\fR\&.AddMethod(\fIfunction, [name]\fR) .RS 4 When called with the \fBAddMethod\fR() form, adds the specified \fIfunction\fR to the specified \fIobject\fR as the specified method \fIname\fR\&. When called using the \fBenv\&.AddMethod\fR form, adds the specified \fIfunction\fR to the construction environment \fIenv\fR as the specified method \fIname\fR\&. In both cases, if \fIname\fR is omitted or \fBNone\fR, the name of the specified \fIfunction\fR itself is used for the method name\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Note that the first argument to the function to # be attached as a method must be the object through # which the method will be called; the Python # convention is to call it \*(Aqself\*(Aq\&. def my_method(self, arg): print("my_method() got", arg) # Use the global AddMethod() function to add a method # to the Environment class\&. This AddMethod(Environment, my_method) env = Environment() env\&.my_method(\*(Aqarg\*(Aq) # Add the function as a method, using the function # name for the method call\&. env = Environment() env\&.AddMethod(my_method, \*(Aqother_method_name\*(Aq) env\&.other_method_name(\*(Aqanother arg\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBAddOption\fR(\fIarguments\fR) .RS 4 Adds a local (project\-specific) command\-line option\&. \fIarguments\fR are the same as those supported by the \fBadd_option\fR method in the standard Python library module optparse, with a few additional capabilities noted below\&. See the documentation for \fIoptparse\fR for a thorough discussion of its option\-processing capabities\&. .sp In addition to the arguments and values supported by the \fIoptparse\fR \fBadd_option\fR method, \fBAddOption\fR allows setting the \fInargs\fR keyword value to a string consisting of a question mark (\*(Aq?\*(Aq) to indicate that the option argument for that option string is optional\&. If the option string is present on the command line but has no matching option argument, the value of the \fIconst\fR keyword argument is produced as the value of the option\&. If the option string is omitted from the command line, the value of the \fIdefault\fR keyword argument is produced, as usual; if there is no \fIdefault\fR keyword argument in the \fBAddOption\fR call, \fBNone\fR is produced\&. .sp optparse recognizes abbreviations of long option names, as long as they can be unambiguously resolved\&. For example, if \fBadd_option\fR is called to define a \fB\-\-devicename\fR option, it will recognize \fB\-\-device\fR, \fB\-\-dev\fR and so forth as long as there is no other option which could also match to the same abbreviation\&. Options added via \fBAddOption\fR do not support the automatic recognition of abbreviations\&. Instead, to allow specific abbreviations, include them in the \fBAddOption\fR call\&. .sp Once a new command\-line option has been added with \fBAddOption\fR, the option value may be accessed using \fBGetOption\fR or \fBenv\&.GetOption\fR\&. \fBSetOption\fR is not currently supported for options added with \fBAddOption\fR\&. .sp Help text for an option is a combination of the string supplied in the \fIhelp\fR keyword argument to \fBAddOption\fR and information collected from the other keyword arguments\&. Such help is displayed if the \fB\-h\fR command line option is used (but not with \fB\-H\fR)\&. Help for all local options is displayed under the separate heading \fBLocal Options\fR\&. The options are unsorted \- they will appear in the help text in the order in which the \fBAddOption\fR calls occur\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf AddOption( \*(Aq\-\-prefix\*(Aq, dest=\*(Aqprefix\*(Aq, nargs=1, type=\*(Aqstring\*(Aq, action=\*(Aqstore\*(Aq, metavar=\*(AqDIR\*(Aq, help=\*(Aqinstallation prefix\*(Aq, ) env = Environment(PREFIX=GetOption(\*(Aqprefix\*(Aq)) .fi .if n \{\ .RE .\} .sp For that example, the following help text would be produced: .sp .if n \{\ .RS 4 .\} .nf Local Options: \-\-prefix=DIR installation prefix .fi .if n \{\ .RE .\} .sp Help text for local options may be unavailable if the \fBHelp\fR function has been called, see the \fBHelp\fR documentation for details\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br As an artifact of the internal implementation, the behavior of options added by \fBAddOption\fR which take option arguments is undefined \fIif\fR whitespace (rather than an = sign) is used as the separator on the command line\&. Users should avoid such usage; it is recommended to add a note to this effect to project documentation if the situation is likely to arise\&. In addition, if the \fInargs\fR keyword is used to specify more than one following option argument (that is, with a value of \fB2\fR or greater), such arguments would necessarily be whitespace separated, triggering the issue\&. Developers should not use \fBAddOption\fR this way\&. Future versions of SCons will likely forbid such usage\&. .sp .5v .RE .RE .PP \fBAddPostAction\fR(\fItarget, action\fR), \fIenv\fR\&.AddPostAction(\fItarget, action\fR) .RS 4 Arranges for the specified \fIaction\fR to be performed after the specified \fItarget\fR has been built\&. The specified action(s) may be an Action object, or anything that can be converted into an Action object See the manpage section "Action Objects" for a complete explanation\&. .sp When multiple targets are supplied, the action may be called multiple times, once after each action that generates one or more targets in the list\&. .RE .PP \fBAddPreAction\fR(\fItarget, action\fR), \fIenv\fR\&.AddPreAction(\fItarget, action\fR) .RS 4 Arranges for the specified \fIaction\fR to be performed before the specified \fItarget\fR is built\&. The specified action(s) may be an Action object, or anything that can be converted into an Action object See the manpage section "Action Objects" for a complete explanation\&. .sp When multiple targets are specified, the action(s) may be called multiple times, once before each action that generates one or more targets in the list\&. .sp Note that if any of the targets are built in multiple steps, the action will be invoked just before the "final" action that specifically generates the specified target(s)\&. For example, when building an executable program from a specified source \&.c file via an intermediate object file: .sp .if n \{\ .RS 4 .\} .nf foo = Program(\*(Aqfoo\&.c\*(Aq) AddPreAction(foo, \*(Aqpre_action\*(Aq) .fi .if n \{\ .RE .\} .sp The specified pre_action would be executed before \fBscons\fR calls the link command that actually generates the executable program binary foo, not before compiling the foo\&.c file into an object file\&. .RE .PP \fBAlias\fR(\fIalias, [targets, [action]]\fR), \fIenv\fR\&.Alias(\fIalias, [targets, [action]]\fR) .RS 4 Creates one or more phony targets that expand to one or more other targets\&. An optional \fIaction\fR (command) or list of actions can be specified that will be executed whenever the any of the alias targets are out\-of\-date\&. Returns the Node object representing the alias, which exists outside of any file system\&. This Node object, or the alias name, may be used as a dependency of any other target, including another alias\&. \fBAlias\fR can be called multiple times for the same alias to add additional targets to the alias, or additional actions to the list for this alias\&. Aliases are global even if set through the construction environment method\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf Alias(\*(Aqinstall\*(Aq) Alias(\*(Aqinstall\*(Aq, \*(Aq/usr/bin\*(Aq) Alias([\*(Aqinstall\*(Aq, \*(Aqinstall\-lib\*(Aq], \*(Aq/usr/local/lib\*(Aq) env\&.Alias(\*(Aqinstall\*(Aq, [\*(Aq/usr/local/bin\*(Aq, \*(Aq/usr/local/lib\*(Aq]) env\&.Alias(\*(Aqinstall\*(Aq, [\*(Aq/usr/local/man\*(Aq]) env\&.Alias(\*(Aqupdate\*(Aq, [\*(Aqfile1\*(Aq, \*(Aqfile2\*(Aq], "update_database $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBAllowSubstExceptions\fR(\fI[exception, \&.\&.\&.]\fR) .RS 4 Specifies the exceptions that will be allowed when expanding construction variables\&. By default, any construction variable expansions that generate a NameError or IndexError exception will expand to a \*(Aq\*(Aq (an empty string) and not cause scons to fail\&. All exceptions not in the specified list will generate an error message and terminate processing\&. .sp If \fBAllowSubstExceptions\fR is called multiple times, each call completely overwrites the previous list of allowed exceptions\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf # Requires that all construction variable names exist\&. # (You may wish to do this if you want to enforce strictly # that all construction variables must be defined before use\&.) AllowSubstExceptions() # Also allow a string containing a zero\-division expansion # like \*(Aq${1 / 0}\*(Aq to evalute to \*(Aq\*(Aq\&. AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) .fi .if n \{\ .RE .\} .RE .PP \fBAlwaysBuild\fR(\fItarget, \&.\&.\&.\fR), \fIenv\fR\&.AlwaysBuild(\fItarget, \&.\&.\&.\fR) .RS 4 Marks each given \fItarget\fR so that it is always assumed to be out of date, and will always be rebuilt if needed\&. Note, however, that \fBAlwaysBuild\fR does not add its target(s) to the default target list, so the targets will only be built if they are specified on the command line, or are a dependent of a target specified on the command line\-\-but they will \fIalways\fR be built if so specified\&. Multiple targets can be passed in to a single call to \fBAlwaysBuild\fR\&. .RE .PP \fIenv\fR\&.Append(\fIkey=val, [\&.\&.\&.]\fR) .RS 4 Appends the specified keyword arguments to the end of construction variables in the environment\&. If the Environment does not have the specified construction variable, it is simply added to the environment\&. If the values of the construction variable and the keyword argument are the same type, then the two values will be simply added together\&. Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together\&. (See also the \fBPrepend\fR method)\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Append(CCFLAGS = \*(Aq \-g\*(Aq, FOO = [\*(Aqfoo\&.yyy\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.AppendENVPath(\fIname, newpath, [envname, sep, delete_existing]\fR) .RS 4 This appends new path elements to the given path in the specified external environment (ENV by default)\&. This will only add any particular path once (leaving the last one it encounters and ignoring the rest, to preserve path order), and to help assure this, will normalize all paths (using \fBos\&.path\&.normpath\fR and \fBos\&.path\&.normcase\fR)\&. This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string\&. .sp If \fIdelete_existing\fR is 0, then adding a path that already exists will not move it to the end; it will stay where it is in the list\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf print \*(Aqbefore:\*(Aq,env[\*(AqENV\*(Aq][\*(AqINCLUDE\*(Aq] include_path = \*(Aq/foo/bar:/foo\*(Aq env\&.AppendENVPath(\*(AqINCLUDE\*(Aq, include_path) print \*(Aqafter:\*(Aq,env[\*(AqENV\*(Aq][\*(AqINCLUDE\*(Aq] yields: before: /foo:/biz after: /biz:/foo/bar:/foo .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.AppendUnique(\fIkey=val, [\&.\&.\&.], delete_existing=0\fR) .RS 4 Appends the specified keyword arguments to the end of construction variables in the environment\&. If the Environment does not have the specified construction variable, it is simply added to the environment\&. If the construction variable being appended to is a list, then any value(s) that already exist in the construction variable will \fInot\fR be added again to the list\&. However, if delete_existing is 1, existing matching values are removed first, so existing values in the arg list move to the end of the list\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.AppendUnique(CCFLAGS = \*(Aq\-g\*(Aq, FOO = [\*(Aqfoo\&.yyy\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fBBuilder\fR(\fIaction, [arguments]\fR), \fIenv\fR\&.Builder(\fIaction, [arguments]\fR) .RS 4 Creates a Builder object for the specified \fIaction\fR\&. See the manpage section "Builder Objects" for a complete explanation of the arguments and behavior\&. .sp Note that the \fBenv\&.Builder\fR() form of the invocation will expand construction variables in any arguments strings, including the \fIaction\fR argument, at the time it is called using the construction variables in the \fIenv\fR construction environment through which \fBenv\&.Builder\fR was called\&. The \fBBuilder\fR form delays all variable expansion until after the Builder object is actually called\&. .RE .PP \fBCacheDir\fR(\fIcache_dir\fR), \fIenv\fR\&.CacheDir(\fIcache_dir\fR) .RS 4 Direct \fBscons\fR to maintain a derived\-file cache in \fIcache_dir\fR\&. The derived files in the cache will be shared among all the builds specifying the same \fIcache_dir\fR\&. Specifying a \fIcache_dir\fR of \fBNone\fR disables derived file caching\&. .sp Calling the environment method \fBenv\&.CacheDir\fR limits the effect to targets built through the specified construction environment\&. Calling the global function \fBCacheDir\fR sets a global default that will be used by all targets built through construction environments that do not set up environment\-specific caching by calling \fBenv\&.CacheDir\fR\&. .sp When derived\-file caching is being used and \fBscons\fR finds a derived file that needs to be rebuilt, it will first look in the cache to see if a file with matching build signature exists (indicating the input file(s) and build action(s) were identical to those for the current target), and if so, will retrieve the file from the cache\&. \fBscons\fR will report Retrieved `file\*(Aq from cache instead of the normal build message\&. If the derived file is not present in the cache, \fBscons\fR will build it and then place a copy of the built file in the cache, identified by its build signature, for future use\&. .sp The Retrieved `file\*(Aq from cache messages are useful for human consumption, but less so when comparing log files between \fBscons\fR runs which will show differences that are noisy and not actually significant\&. To disable, use the \fB\-\-cache\-show\fR option\&. With this option, \fBscons\fR will print the action that would have been used to build the file without considering cache retrieval\&. .sp Derived\-file caching may be disabled for any invocation of \fBscons\fR by giving the \fB\-\-cache\-disable\fR command line option\&. Cache updating may be disabled, leaving cache fetching enabled, by giving the \fB\-\-cache\-readonly\fR\&. .sp If the \fB\-\-cache\-force\fR option is used, \fBscons\fR will place a copy of \fIall\fR derived files in the cache, even if they already existed and were not built by this invocation\&. This is useful to populate a cache the first time a \fIcache_dir\fR is used for a build, or to bring a cache up to date after a build with cache updating disabled (\fB\-\-cache\-disable\fR or \fB\-\-cache\-readonly\fR) has been done\&. .sp The \fBNoCache\fR method can be used to disable caching of specific files\&. This can be useful if inputs and/or outputs of some tool are impossible to predict or prohibitively large\&. .RE .PP \fBClean\fR(\fItargets, files_or_dirs\fR), \fIenv\fR\&.Clean(\fItargets, files_or_dirs\fR) .RS 4 This specifies a list of files or directories which should be removed whenever the targets are specified with the \fB\-c\fR command line option\&. The specified targets may be a list or an individual target\&. Multiple calls to \fBClean\fR are legal, and create new targets or add files and directories to the clean list for the specified targets\&. .sp Multiple files or directories should be specified either as separate arguments to the \fBClean\fR method, or as a list\&. \fBClean\fR will also accept the return value of any of the construction environment Builder methods\&. Examples: .sp The related \fBNoClean\fR function overrides calling \fBClean\fR for the same target, and any targets passed to both functions will \fInot\fR be removed by the \fB\-c\fR option\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf Clean(\*(Aqfoo\*(Aq, [\*(Aqbar\*(Aq, \*(Aqbaz\*(Aq]) Clean(\*(Aqdist\*(Aq, env\&.Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq)) Clean([\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq], \*(Aqsomething_else_to_clean\*(Aq) .fi .if n \{\ .RE .\} .sp In this example, installing the project creates a subdirectory for the documentation\&. This statement causes the subdirectory to be removed if the project is deinstalled\&. .sp .if n \{\ .RS 4 .\} .nf Clean(docdir, os\&.path\&.join(docdir, projectname)) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.Clone(\fI[key=val, \&.\&.\&.]\fR) .RS 4 Returns a separate copy of a construction environment\&. If there are any keyword arguments specified, they are added to the returned copy, overwriting any existing values for the keywords\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env2 = env\&.Clone() env3 = env\&.Clone(CCFLAGS = \*(Aq\-g\*(Aq) .fi .if n \{\ .RE .\} .sp Additionally, a list of tools and a toolpath may be specified, as in the \fBEnvironment\fR constructor: .sp .if n \{\ .RS 4 .\} .nf def MyTool(env): env[\*(AqFOO\*(Aq] = \*(Aqbar\*(Aq env4 = env\&.Clone(tools = [\*(Aqmsvc\*(Aq, MyTool]) .fi .if n \{\ .RE .\} .sp The \fIparse_flags\fR keyword argument is also recognized to allow merging command\-line style arguments into the appropriate construction variables (see \fBenv\&.MergeFlags\fR)\&. .sp .if n \{\ .RS 4 .\} .nf # create an environment for compiling programs that use wxWidgets wx_env = env\&.Clone(parse_flags=\*(Aq!wx\-config \-\-cflags \-\-cxxflags\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBCommand\fR(\fItarget, source, action, [key=val, \&.\&.\&.]\fR), \fIenv\fR\&.Command(\fItarget, source, action, [key=val, \&.\&.\&.]\fR) .RS 4 Executes a specific \fIaction\fR (or list of actions) to build a \fItarget\fR file or files from a \fIsource\fR file or files\&. This is more convenient than defining a separate Builder object for a single special\-case build\&. .sp The \fBCommand\fR function accepts \fIsource_scanner\fR, \fItarget_scanner\fR, \fIsource_factory\fR, and \fItarget_factory\fR keyword arguments\&. These arguments can be used to specify a Scanner object that will be used to apply a custom scanner for a source or target\&. For example, the global DirScanner object can be used if any of the sources will be directories that must be scanned on\-disk for changes to files that aren\*(Aqt already specified in other Builder of function calls\&. The \fI*_factory\fR arguments take a factory function that \fBCommand\fR will use to turn any sources or targets specified as strings into SCons Nodes\&. See the manpage section "Builder Objects" for more information about how these arguments work in a Builder\&. .sp Any other keyword arguments specified override any same\-named existing construction variables\&. .sp An action can be an external command, specified as a string, or a callable Python object; see the manpage section "Action Objects" for more complete information\&. Also note that a string specifying an external command may be preceded by an at\-sign (@) to suppress printing the command in question, or by a hyphen (\-) to ignore the exit status of the external command\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.Command( target=\*(Aqfoo\&.out\*(Aq, source=\*(Aqfoo\&.in\*(Aq, action="$FOO_BUILD < $SOURCES > $TARGET" ) env\&.Command( target=\*(Aqbar\&.out\*(Aq, source=\*(Aqbar\&.in\*(Aq, action=["rm \-f $TARGET", "$BAR_BUILD < $SOURCES > $TARGET"], ENV={\*(AqPATH\*(Aq: \*(Aq/usr/local/bin/\*(Aq}, ) import os def rename(env, target, source): os\&.rename(\*(Aq\&.tmp\*(Aq, str(target[0])) env\&.Command( target=\*(Aqbaz\&.out\*(Aq, source=\*(Aqbaz\&.in\*(Aq, action=["$BAZ_BUILD < $SOURCES > \&.tmp", rename], ) .fi .if n \{\ .RE .\} .sp Note that the \fBCommand\fR function will usually assume, by default, that the specified targets and/or sources are Files, if no other part of the configuration identifies what type of entries they are\&. If necessary, you can explicitly specify that targets or source nodes should be treated as directories by using the \fBDir\fR or \fBenv\&.Dir\fR functions\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.Command(\*(Aqddd\&.list\*(Aq, Dir(\*(Aqddd\*(Aq), \*(Aqls \-l $SOURCE > $TARGET\*(Aq) env[\*(AqDISTDIR\*(Aq] = \*(Aqdestination/directory\*(Aq env\&.Command(env\&.Dir(\*(Aq$DISTDIR\*(Aq)), None, make_distdir) .fi .if n \{\ .RE .\} .sp Also note that SCons will usually automatically create any directory necessary to hold a target file, so you normally don\*(Aqt need to create directories by hand\&. .RE .PP \fBConfigure\fR(\fIenv, [custom_tests, conf_dir, log_file, config_h]\fR), \fIenv\fR\&.Configure(\fI[custom_tests, conf_dir, log_file, config_h]\fR) .RS 4 Creates a Configure object for integrated functionality similar to GNU autoconf\&. See the manpage section "Configure Contexts" for a complete explanation of the arguments and behavior\&. .RE .PP \fBDecider\fR(\fIfunction\fR), \fIenv\fR\&.Decider(\fIfunction\fR) .RS 4 Specifies that all up\-to\-date decisions for targets built through this construction environment will be handled by the specified \fIfunction\fR\&. \fIfunction\fR can be the name of a function or one of the following strings that specify the predefined decision function that will be applied: .PP "timestamp\-newer" .RS 4 Specifies that a target shall be considered out of date and rebuilt if the dependency\*(Aqs timestamp is newer than the target file\*(Aqs timestamp\&. This is the behavior of the classic Make utility, and make can be used a synonym for timestamp\-newer\&. .RE .PP "timestamp\-match" .RS 4 Specifies that a target shall be considered out of date and rebuilt if the dependency\*(Aqs timestamp is different than the timestamp recorded the last time the target was built\&. This provides behavior very similar to the classic Make utility (in particular, files are not opened up so that their contents can be checksummed) except that the target will also be rebuilt if a dependency file has been restored to a version with an \fIearlier\fR timestamp, such as can happen when restoring files from backup archives\&. .RE .PP "MD5" .RS 4 Specifies that a target shall be considered out of date and rebuilt if the dependency\*(Aqs content has changed since the last time the target was built, as determined be performing an MD5 checksum on the dependency\*(Aqs contents and comparing it to the checksum recorded the last time the target was built\&. content can be used as a synonym for MD5\&. .RE .PP "MD5\-timestamp" .RS 4 Specifies that a target shall be considered out of date and rebuilt if the dependency\*(Aqs content has changed since the last time the target was built, except that dependencies with a timestamp that matches the last time the target was rebuilt will be assumed to be up\-to\-date and \fInot\fR rebuilt\&. This provides behavior very similar to the MD5 behavior of always checksumming file contents, with an optimization of not checking the contents of files whose timestamps haven\*(Aqt changed\&. The drawback is that SCons will \fInot\fR detect if a file\*(Aqs content has changed but its timestamp is the same, as might happen in an automated script that runs a build, updates a file, and runs the build again, all within a single second\&. .RE .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Use exact timestamp matches by default\&. Decider(\*(Aqtimestamp\-match\*(Aq) # Use MD5 content signatures for any targets built # with the attached construction environment\&. env\&.Decider(\*(Aqcontent\*(Aq) .fi .if n \{\ .RE .\} .sp In addition to the above already\-available functions, the \fIfunction\fR argument may be a Python function you supply\&. Such a function must accept the following four arguments: .PP \fIdependency\fR .RS 4 The Node (file) which should cause the \fItarget\fR to be rebuilt if it has "changed" since the last tme \fItarget\fR was built\&. .RE .PP \fItarget\fR .RS 4 The Node (file) being built\&. In the normal case, this is what should get rebuilt if the \fIdependency\fR has "changed\&." .RE .PP \fIprev_ni\fR .RS 4 Stored information about the state of the \fIdependency\fR the last time the \fItarget\fR was built\&. This can be consulted to match various file characteristics such as the timestamp, size, or content signature\&. .RE .PP \fIrepo_node\fR .RS 4 If set, use this Node instead of the one specified by \fIdependency\fR to determine if the dependency has changed\&. This argument is optional so should be written as a default argument (typically it would be written as \fIrepo_node=None\fR)\&. A caller will normally only set this if the target only exists in a Repository\&. .RE .sp The \fIfunction\fR should return a value which evaluates \fBTrue\fR if the \fIdependency\fR has "changed" since the last time the \fItarget\fR was built (indicating that the target \fIshould\fR be rebuilt), and a value which evaluates \fBFalse\fR otherwise (indicating that the target should \fInot\fR be rebuilt)\&. Note that the decision can be made using whatever criteria are appopriate\&. Ignoring some or all of the function arguments is perfectly normal\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf def my_decider(dependency, target, prev_ni, repo_node=None): return not os\&.path\&.exists(str(target)) env\&.Decider(my_decider) .fi .if n \{\ .RE .\} .RE .PP \fBDefault\fR(\fItargets\&.\&.\&.\fR), \fIenv\fR\&.Default(\fItargets\&.\&.\&.\fR) .RS 4 This specifies a list of default targets, which will be built by \fBscons\fR if no explicit targets are given on the command line\&. Multiple calls to \fBDefault\fR are legal, and add to the list of default targets\&. As noted above, both forms of this call affect the same global list of default targets; the construction environment method applies construction variable expansion to the targets\&. .sp Multiple targets should be specified as separate arguments to the \fBDefault\fR method, or as a list\&. \fBDefault\fR will also accept the Node returned by any of a construction environment\*(Aqs builder methods\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf Default(\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq, \*(Aqbaz\*(Aq) env\&.Default([\*(Aqa\*(Aq, \*(Aqb\*(Aq, \*(Aqc\*(Aq]) hello = env\&.Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq) env\&.Default(hello) .fi .if n \{\ .RE .\} .sp An argument to \fBDefault\fR of None will clear all default targets\&. Later calls to \fBDefault\fR will add to the (now empty) default\-target list like normal\&. .sp The current list of targets added using the \fBDefault\fR function or method is available in the DEFAULT_TARGETS list; see below\&. .RE .PP \fBDefaultEnvironment\fR(\fI[**kwargs]\fR) .RS 4 Instantiates and returns the default construction environment object\&. The default environment is used internally by SCons in order to execute many of the global functions in this list (that is, those not called as methods of a specific construction environment)\&. It is not mandatory to call \fBDefaultEnvironment\fR: the default environment will be instantiated automatically when the build phase begins if the function has not been called, however calling it explicitly gives the opportunity to affect and examine the contents of the default environment\&. .sp The default environment is a singleton, so the keyword arguments affect it only on the first call, on subsequent calls the already\-constructed object is returned and any keyword arguments are silently ignored\&. The default environment can be modified after instantiation in the same way as any construction environment\&. Modifying the default environment has no effect on the construction environment constructed by an \fBEnvironment\fR or \fBClone\fR call\&. .RE .PP \fBDepends\fR(\fItarget, dependency\fR), \fIenv\fR\&.Depends(\fItarget, dependency\fR) .RS 4 Specifies an explicit dependency; the \fItarget\fR will be rebuilt whenever the \fIdependency\fR has changed\&. Both the specified \fItarget\fR and \fIdependency\fR can be a string (usually the path name of a file or directory) or Node objects, or a list of strings or Node objects (such as returned by a Builder call)\&. This should only be necessary for cases where the dependency is not caught by a Scanner for the file\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Depends(\*(Aqfoo\*(Aq, \*(Aqother\-input\-file\-for\-foo\*(Aq) mylib = env\&.Library(\*(Aqmylib\&.c\*(Aq) installed_lib = env\&.Install(\*(Aqlib\*(Aq, mylib) bar = env\&.Program(\*(Aqbar\&.c\*(Aq) # Arrange for the library to be copied into the installation # directory before trying to build the "bar" program\&. # (Note that this is for example only\&. A "real" library # dependency would normally be configured through the $LIBS # and $LIBPATH variables, not using an env\&.Depends() call\&.) env\&.Depends(bar, installed_lib) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.Detect(\fIprogs\fR) .RS 4 Find an executable from one or more choices: \fIprogs\fR may be a string or a list of strings\&. Returns the first value from \fIprogs\fR that was found, or \fBNone\fR\&. Executable is searched by checking the paths specified by \fIenv\fR[\*(AqENV\*(Aq][\*(AqPATH\*(Aq]\&. On Windows systems, additionally applies the filename suffixes found in \fIenv\fR[\*(AqENV\*(Aq][\*(AqPATHEXT\*(Aq] but will not include any such extension in the return value\&. \fBenv\&.Detect\fR is a wrapper around \fBenv\&.WhereIs\fR\&. .RE .PP \fIenv\fR\&.Dictionary(\fI[vars]\fR) .RS 4 Returns a dictionary object containing the construction variables in the construction environment\&. If there are any arguments specified, the values of the specified construction variables are returned as a string (if one argument) or as a list of strings\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf cvars = env\&.Dictionary() cc_values = env\&.Dictionary(\*(AqCC\*(Aq, \*(AqCCFLAGS\*(Aq, \*(AqCCCOM\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBDir\fR(\fIname, [directory]\fR), \fIenv\fR\&.Dir(\fIname, [directory]\fR) .RS 4 Returns Directory Node(s)\&. A Directory Node is an object that represents a directory\&. \fIname\fR can be a relative or absolute path or a list of such paths\&. \fIdirectory\fR is an optional directory that will be used as the parent directory\&. If no \fIdirectory\fR is specified, the current script\*(Aqs directory is used as the parent\&. .sp If \fIname\fR is a single pathname, the corresponding node is returned\&. If \fIname\fR is a list, SCons returns a list of nodes\&. Construction variables are expanded in \fIname\fR\&. .sp Directory Nodes can be used anywhere you would supply a string as a directory name to a Builder method or function\&. Directory Nodes have attributes and methods that are useful in many situations; see manpage section "File and Directory Nodes" for more information\&. .RE .PP \fIenv\fR\&.Dump(\fI[key], [format]\fR) .RS 4 Serializes construction variables to a string\&. The method supports the following formats specified by \fIformat\fR: .PP pretty .RS 4 Returns a pretty printed representation of the environment (if \fIformat\fR is not specified, this is the default)\&. .RE .PP json .RS 4 Returns a JSON\-formatted string representation of the environment\&. .RE .sp If \fIkey\fR is \fBNone\fR (the default) the entire dictionary of construction variables is serialized\&. If supplied, it is taken as the name of a construction variable whose value is serialized\&. .sp This SConstruct: .sp .if n \{\ .RS 4 .\} .nf env=Environment() print(env\&.Dump(\*(AqCCCOM\*(Aq)) .fi .if n \{\ .RE .\} .sp will print: .sp .if n \{\ .RS 4 .\} .nf \*(Aq$CC \-c \-o $TARGET $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS $SOURCES\*(Aq .fi .if n \{\ .RE .\} .sp While this SConstruct: .sp .if n \{\ .RS 4 .\} .nf env=Environment() print(env\&.Dump()) .fi .if n \{\ .RE .\} .sp will print: .sp .if n \{\ .RS 4 .\} .nf { \*(AqAR\*(Aq: \*(Aqar\*(Aq, \*(AqARCOM\*(Aq: \*(Aq$AR $ARFLAGS $TARGET $SOURCES\en$RANLIB $RANLIBFLAGS $TARGET\*(Aq, \*(AqARFLAGS\*(Aq: [\*(Aqr\*(Aq], \*(AqAS\*(Aq: \*(Aqas\*(Aq, \*(AqASCOM\*(Aq: \*(Aq$AS $ASFLAGS \-o $TARGET $SOURCES\*(Aq, \*(AqASFLAGS\*(Aq: [], \&.\&.\&. .fi .if n \{\ .RE .\} .RE .PP \fBEnsurePythonVersion\fR(\fImajor, minor\fR), \fIenv\fR\&.EnsurePythonVersion(\fImajor, minor\fR) .RS 4 Ensure that the Python version is at least \fImajor\fR\&.\fIminor\fR\&. This function will print out an error message and exit SCons with a non\-zero exit code if the actual Python version is not late enough\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf EnsurePythonVersion(2,2) .fi .if n \{\ .RE .\} .RE .PP \fBEnsureSConsVersion\fR(\fImajor, minor, [revision]\fR), \fIenv\fR\&.EnsureSConsVersion(\fImajor, minor, [revision]\fR) .RS 4 Ensure that the SCons version is at least \fImajor\&.minor\fR, or \fImajor\&.minor\&.revision\fR\&. if \fIrevision\fR is specified\&. This function will print out an error message and exit SCons with a non\-zero exit code if the actual SCons version is not late enough\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf EnsureSConsVersion(0,14) EnsureSConsVersion(0,96,90) .fi .if n \{\ .RE .\} .RE .PP \fBEnvironment\fR(\fI[key=value, \&.\&.\&.]\fR), \fIenv\fR\&.Environment(\fI[key=value, \&.\&.\&.]\fR) .RS 4 Return a new construction environment initialized with the specified \fIkey\fR=\fIvalue\fR pairs\&. .RE .PP \fBExecute\fR(\fIaction, [strfunction, varlist]\fR), \fIenv\fR\&.Execute(\fIaction, [strfunction, varlist]\fR) .RS 4 Executes an Action object\&. The specified \fIaction\fR may be an Action object (see manpage section "Action Objects" for an explanation of behavior), or it may be a command\-line string, list of commands, or executable Python function, each of which will be converted into an Action object and then executed\&. Any additional arguments to \fBExecute\fR (\fIstrfunction\fR, \fIvarlist\fR) are passed on to the \fBAction\fR factory function which actually creates the Action object\&. The exit value of the command or return value of the Python function will be returned\&. .sp Note that \fBscons\fR will print an error message if the executed \fIaction\fR fails\-\-that is, exits with or returns a non\-zero value\&. \fBscons\fR will \fInot\fR, however, automatically terminate the build if the specified \fIaction\fR fails\&. If you want the build to stop in response to a failed \fBExecute\fR call, you must explicitly check for a non\-zero return value: .sp .if n \{\ .RS 4 .\} .nf Execute(Copy(\*(Aqfile\&.out\*(Aq, \*(Aqfile\&.in\*(Aq)) if Execute("mkdir sub/dir/ectory"): # The mkdir failed, don\*(Aqt try to build\&. Exit(1) .fi .if n \{\ .RE .\} .RE .PP \fBExit\fR(\fI[value]\fR), \fIenv\fR\&.Exit(\fI[value]\fR) .RS 4 This tells \fBscons\fR to exit immediately with the specified \fIvalue\fR\&. A default exit value of 0 (zero) is used if no value is specified\&. .RE .PP \fBExport\fR(\fI[vars\&.\&.\&.], [key=value\&.\&.\&.]\fR), \fIenv\fR\&.Export(\fI[vars\&.\&.\&.], [key=value\&.\&.\&.]\fR) .RS 4 Exports variables from the current SConscript file to a global collection where they can be imported by other SConscript files\&. \fIvars\fR may be one or more strings representing variable names to be exported\&. If a string contains whitespace, it is split into separate strings, as if multiple string arguments had been given\&. A \fIvars\fR argument may also be a dictionary, which can be used to map variables to different names when exported\&. Keyword arguments can be used to provide names and their values\&. .sp \fBExport\fR calls are cumulative\&. Specifying a previously exported variable will overwrite the earlier value\&. Both local variables and global variables can be exported\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env = Environment() # Make env available for all SConscript files to Import()\&. Export("env") package = \*(Aqmy_name\*(Aq # Make env and package available for all SConscript files:\&. Export("env", "package") # Make env and package available for all SConscript files: Export(["env", "package"]) # Make env available using the name debug: Export(debug=env) # Make env available using the name debug: Export({"debug": env}) .fi .if n \{\ .RE .\} .sp Note that the \fBSConscript\fR function supports an \fIexports\fR argument that allows exporting a variable or set of variables to a specific SConscript file or files\&. See the description below\&. .RE .PP \fBFile\fR(\fIname, [directory]\fR), \fIenv\fR\&.File(\fIname, [directory]\fR) .RS 4 Returns File Node(s)\&. A File Node is an object that represents a file\&. \fIname\fR can be a relative or absolute path or a list of such paths\&. \fIdirectory\fR is an optional directory that will be used as the parent directory\&. If no \fIdirectory\fR is specified, the current script\*(Aqs directory is used as the parent\&. .sp If \fIname\fR is a single pathname, the corresponding node is returned\&. If \fIname\fR is a list, SCons returns a list of nodes\&. Construction variables are expanded in \fIname\fR\&. .sp File Nodes can be used anywhere you would supply a string as a file name to a Builder method or function\&. File Nodes have attributes and methods that are useful in many situations; see manpage section "File and Directory Nodes" for more information\&. .RE .PP \fBFindFile\fR(\fIfile, dirs\fR), \fIenv\fR\&.FindFile(\fIfile, dirs\fR) .RS 4 Search for \fIfile\fR in the path specified by \fIdirs\fR\&. \fIdirs\fR may be a list of directory names or a single directory name\&. In addition to searching for files that exist in the filesystem, this function also searches for derived files that have not yet been built\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf foo = env\&.FindFile(\*(Aqfoo\*(Aq, [\*(Aqdir1\*(Aq, \*(Aqdir2\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fBFindInstalledFiles\fR(), \fIenv\fR\&.FindInstalledFiles() .RS 4 Returns the list of targets set up by the \fBInstall\fR or \fBInstallAs\fR builders\&. .sp This function serves as a convenient method to select the contents of a binary package\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf Install( \*(Aq/bin\*(Aq, [ \*(Aqexecutable_a\*(Aq, \*(Aqexecutable_b\*(Aq ] ) # will return the file node list # [ \*(Aq/bin/executable_a\*(Aq, \*(Aq/bin/executable_b\*(Aq ] FindInstalledFiles() Install( \*(Aq/lib\*(Aq, [ \*(Aqsome_library\*(Aq ] ) # will return the file node list # [ \*(Aq/bin/executable_a\*(Aq, \*(Aq/bin/executable_b\*(Aq, \*(Aq/lib/some_library\*(Aq ] FindInstalledFiles() .fi .if n \{\ .RE .\} .RE .PP \fBFindPathDirs\fR(\fIvariable\fR) .RS 4 Returns a function (actually a callable Python object) intended to be used as the \fIpath_function\fR of a Scanner object\&. The returned object will look up the specified \fIvariable\fR in a construction environment and treat the construction variable\*(Aqs value as a list of directory paths that should be searched (like \fB$CPPPATH\fR, \fB$LIBPATH\fR, etc\&.)\&. .sp Note that use of \fBFindPathDirs\fR is generally preferable to writing your own \fIpath_function\fR for the following reasons: 1) The returned list will contain all appropriate directories found in source trees (when \fBVariantDir\fR is used) or in code repositories (when \fBRepository\fR or the \fB\-Y\fR option are used)\&. 2) scons will identify expansions of \fIvariable\fR that evaluate to the same list of directories as, in fact, the same list, and avoid re\-scanning the directories for files, when possible\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf def my_scan(node, env, path, arg): # Code to scan file contents goes here\&.\&.\&. return include_files scanner = Scanner(name = \*(Aqmyscanner\*(Aq, function = my_scan, path_function = FindPathDirs(\*(AqMYPATH\*(Aq)) .fi .if n \{\ .RE .\} .RE .PP \fBFindSourceFiles\fR(\fInode=\*(Aq"\&."\*(Aq\fR), \fIenv\fR\&.FindSourceFiles(\fInode=\*(Aq"\&."\*(Aq\fR) .RS 4 Returns the list of nodes which serve as the source of the built files\&. It does so by inspecting the dependency tree starting at the optional argument \fInode\fR which defaults to the \*(Aq"\&."\*(Aq\-node\&. It will then return all leaves of \fInode\fR\&. These are all children which have no further children\&. .sp This function is a convenient method to select the contents of a Source Package\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf Program( \*(Aqsrc/main_a\&.c\*(Aq ) Program( \*(Aqsrc/main_b\&.c\*(Aq ) Program( \*(Aqmain_c\&.c\*(Aq ) # returns [\*(Aqmain_c\&.c\*(Aq, \*(Aqsrc/main_a\&.c\*(Aq, \*(AqSConstruct\*(Aq, \*(Aqsrc/main_b\&.c\*(Aq] FindSourceFiles() # returns [\*(Aqsrc/main_b\&.c\*(Aq, \*(Aqsrc/main_a\&.c\*(Aq ] FindSourceFiles( \*(Aqsrc\*(Aq ) .fi .if n \{\ .RE .\} .sp As you can see build support files (SConstruct in the above example) will also be returned by this function\&. .RE .PP \fBFlatten\fR(\fIsequence\fR), \fIenv\fR\&.Flatten(\fIsequence\fR) .RS 4 Takes a sequence (that is, a Python list or tuple) that may contain nested sequences and returns a flattened list containing all of the individual elements in any sequence\&. This can be helpful for collecting the lists returned by calls to Builders; other Builders will automatically flatten lists specified as input, but direct Python manipulation of these lists does not\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf foo = Object(\*(Aqfoo\&.c\*(Aq) bar = Object(\*(Aqbar\&.c\*(Aq) # Because `foo\*(Aq and `bar\*(Aq are lists returned by the Object() Builder, # `objects\*(Aq will be a list containing nested lists: objects = [\*(Aqf1\&.o\*(Aq, foo, \*(Aqf2\&.o\*(Aq, bar, \*(Aqf3\&.o\*(Aq] # Passing such a list to another Builder is all right because # the Builder will flatten the list automatically: Program(source = objects) # If you need to manipulate the list directly using Python, you need to # call Flatten() yourself, or otherwise handle nested lists: for object in Flatten(objects): print(str(object)) .fi .if n \{\ .RE .\} .RE .PP \fBGetBuildFailures\fR() .RS 4 Returns a list of exceptions for the actions that failed while attempting to build targets\&. Each element in the returned list is a BuildError object with the following attributes that record various aspects of the build failure: .sp \&.node The node that was being built when the build failure occurred\&. .sp \&.status The numeric exit status returned by the command or Python function that failed when trying to build the specified Node\&. .sp \&.errstr The SCons error string describing the build failure\&. (This is often a generic message like "Error 2" to indicate that an executed command exited with a status of 2\&.) .sp \&.filename The name of the file or directory that actually caused the failure\&. This may be different from the \&.node attribute\&. For example, if an attempt to build a target named sub/dir/target fails because the sub/dir directory could not be created, then the \&.node attribute will be sub/dir/target but the \&.filename attribute will be sub/dir\&. .sp \&.executor The SCons Executor object for the target Node being built\&. This can be used to retrieve the construction environment used for the failed action\&. .sp \&.action The actual SCons Action object that failed\&. This will be one specific action out of the possible list of actions that would have been executed to build the target\&. .sp \&.command The actual expanded command that was executed and failed, after expansion of \fB$TARGET\fR, \fB$SOURCE\fR, and other construction variables\&. .sp Note that the \fBGetBuildFailures\fR function will always return an empty list until any build failure has occurred, which means that \fBGetBuildFailures\fR will always return an empty list while the SConscript files are being read\&. Its primary intended use is for functions that will be executed before SCons exits by passing them to the standard Python \fBatexit\&.register\fR() function\&. Example: .sp .if n \{\ .RS 4 .\} .nf import atexit def print_build_failures(): from SCons\&.Script import GetBuildFailures for bf in GetBuildFailures(): print("%s failed: %s" % (bf\&.node, bf\&.errstr)) atexit\&.register(print_build_failures) .fi .if n \{\ .RE .\} .RE .PP \fBGetBuildPath\fR(\fIfile, [\&.\&.\&.]\fR), \fIenv\fR\&.GetBuildPath(\fIfile, [\&.\&.\&.]\fR) .RS 4 Returns the \fBscons\fR path name (or names) for the specified \fIfile\fR (or files)\&. The specified \fIfile\fR or files may be \fBscons\fR Nodes or strings representing path names\&. .RE .PP \fBGetLaunchDir\fR(), \fIenv\fR\&.GetLaunchDir() .RS 4 Returns the absolute path name of the directory from which \fBscons\fR was initially invoked\&. This can be useful when using the \fB\-u\fR, \fB\-U\fR or \fB\-D\fR options, which internally change to the directory in which the SConstruct file is found\&. .RE .PP \fBGetOption\fR(\fIname\fR), \fIenv\fR\&.GetOption(\fIname\fR) .RS 4 This function provides a way to query the value of SCons options set on scons command line (or set using the \fBSetOption\fR function)\&. The options supported are: .PP cache_debug .RS 4 which corresponds to \fB\-\-cache\-debug\fR; .RE .PP cache_disable .RS 4 which corresponds to \fB\-\-cache\-disable\fR; .RE .PP cache_force .RS 4 which corresponds to \fB\-\-cache\-force\fR; .RE .PP cache_show .RS 4 which corresponds to \fB\-\-cache\-show\fR; .RE .PP clean .RS 4 which corresponds to \fB\-c\fR, \fB\-\-clean\fR and \fB\-\-remove\fR; .RE .PP config .RS 4 which corresponds to \fB\-\-config\fR; .RE .PP directory .RS 4 which corresponds to \fB\-C\fR and \fB\-\-directory\fR; .RE .PP diskcheck .RS 4 which corresponds to \fB\-\-diskcheck\fR; .RE .PP duplicate .RS 4 which corresponds to \fB\-\-duplicate\fR; .RE .PP file .RS 4 which corresponds to \fB\-f\fR, \fB\-\-file\fR, \fB\-\-makefile\fR and \fB\-\-sconstruct\fR; .RE .PP help .RS 4 which corresponds to \fB\-h\fR and \fB\-\-help\fR; .RE .PP ignore_errors .RS 4 which corresponds to \fB\-\-ignore\-errors\fR; .RE .PP implicit_cache .RS 4 which corresponds to \fB\-\-implicit\-cache\fR; .RE .PP implicit_deps_changed .RS 4 which corresponds to \fB\-\-implicit\-deps\-changed\fR; .RE .PP implicit_deps_unchanged .RS 4 which corresponds to \fB\-\-implicit\-deps\-unchanged\fR; .RE .PP interactive .RS 4 which corresponds to \fB\-\-interact\fR and \fB\-\-interactive\fR; .RE .PP keep_going .RS 4 which corresponds to \fB\-k\fR and \fB\-\-keep\-going\fR; .RE .PP max_drift .RS 4 which corresponds to \fB\-\-max\-drift\fR; .RE .PP no_exec .RS 4 which corresponds to \fB\-n\fR, \fB\-\-no\-exec\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR and \fB\-\-recon\fR; .RE .PP no_site_dir .RS 4 which corresponds to \fB\-\-no\-site\-dir\fR; .RE .PP num_jobs .RS 4 which corresponds to \fB\-j\fR and \fB\-\-jobs\fR; .RE .PP profile_file .RS 4 which corresponds to \fB\-\-profile\fR; .RE .PP question .RS 4 which corresponds to \fB\-q\fR and \fB\-\-question\fR; .RE .PP random .RS 4 which corresponds to \fB\-\-random\fR; .RE .PP repository .RS 4 which corresponds to \fB\-Y\fR, \fB\-\-repository\fR and \fB\-\-srcdir\fR; .RE .PP silent .RS 4 which corresponds to \fB\-s\fR, \fB\-\-silent\fR and \fB\-\-quiet\fR; .RE .PP site_dir .RS 4 which corresponds to \fB\-\-site\-dir\fR; .RE .PP stack_size .RS 4 which corresponds to \fB\-\-stack\-size\fR; .RE .PP taskmastertrace_file .RS 4 which corresponds to \fB\-\-taskmastertrace\fR; and .RE .PP warn .RS 4 which corresponds to \fB\-\-warn\fR and \fB\-\-warning\fR\&. .RE .sp See the documentation for the corresponding command line option for information about each specific option\&. .RE .PP \fBGlob\fR(\fIpattern, [ondisk, source, strings, exclude]\fR), \fIenv\fR\&.Glob(\fIpattern, [ondisk, source, strings, exclude]\fR) .RS 4 Returns Nodes (or strings) that match the specified \fIpattern\fR, relative to the directory of the current SConscript file\&. The evironment method form (\fBenv\&.Glob\fR) performs string substition on \fIpattern\fR and returns whatever matches the resulting expanded pattern\&. .sp The specified \fIpattern\fR uses Unix shell style metacharacters for matching: .sp .if n \{\ .RS 4 .\} .nf * matches everything ? matches any single character [seq] matches any character in seq [!seq] matches any char not in seq .fi .if n \{\ .RE .\} .sp If the first character of a filename is a dot, it must be matched explicitly\&. Character matches do \fInot\fR span directory separators\&. .sp The \fBGlob\fR knows about repositories (see the \fBRepository\fR function) and source directories (see the \fBVariantDir\fR function) and returns a Node (or string, if so configured) in the local (SConscript) directory if a matching Node is found anywhere in a corresponding repository or source directory\&. .sp The \fIondisk\fR argument may be set to a value which evaluates \fBFalse\fR to disable the search for matches on disk, thereby only returning matches among already\-configured File or Dir Nodes\&. The default behavior is to return corresponding Nodes for any on\-disk matches found\&. .sp The \fIsource\fR argument may be set to a value which evaluates \fBTrue\fR to specify that, when the local directory is a \fBVariantDir\fR, the returned Nodes should be from the corresponding source directory, not the local directory\&. .sp The \fIstrings\fR argument may be set to a value which evaluates \fBTrue\fR to have the \fBGlob\fR function return strings, not Nodes, that represent the matched files or directories\&. The returned strings will be relative to the local (SConscript) directory\&. (Note that This may make it easier to perform arbitrary manipulation of file names, but if the returned strings are passed to a different SConscript file, any Node translation will be relative to the other SConscript directory, not the original SConscript directory\&.) .sp The \fIexclude\fR argument may be set to a pattern or a list of patterns (following the same Unix shell semantics) which must be filtered out of returned elements\&. Elements matching a least one pattern of this list will be excluded\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf Program("foo", Glob("*\&.c")) Zip("/tmp/everything", Glob("\&.??*") + Glob("*")) sources = Glob("*\&.cpp", exclude=["os_*_specific_*\&.cpp"]) + \e Glob( "os_%s_specific_*\&.cpp" % currentOS) .fi .if n \{\ .RE .\} .RE .PP \fBHelp\fR(\fItext, append=False\fR), \fIenv\fR\&.Help(\fItext, append=False\fR) .RS 4 Specifies a local help message to be printed if the \fB\-h\fR argument is given to \fBscons\fR\&. Subsequent calls to \fBHelp\fR append \fItext\fR to the previously defined local help text\&. .sp For the first call to \fBHelp\fR only, if \fIappend\fR is \fBFalse\fR (the default) any local help message generated through \fBAddOption\fR calls is replaced\&. If \fIappend\fR is \fBTrue\fR, \fItext\fR is appended to the existing help text\&. .RE .PP \fBIgnore\fR(\fItarget, dependency\fR), \fIenv\fR\&.Ignore(\fItarget, dependency\fR) .RS 4 The specified dependency file(s) will be ignored when deciding if the target file(s) need to be rebuilt\&. .sp You can also use \fBIgnore\fR to remove a target from the default build\&. In order to do this you must specify the directory the target will be built in as the target, and the file you want to skip building as the dependency\&. .sp Note that this will only remove the dependencies listed from the files built by default\&. It will still be built if that dependency is needed by another object being built\&. See the third and forth examples below\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.Ignore(\*(Aqfoo\*(Aq, \*(Aqfoo\&.c\*(Aq) env\&.Ignore(\*(Aqbar\*(Aq, [\*(Aqbar1\&.h\*(Aq, \*(Aqbar2\&.h\*(Aq]) env\&.Ignore(\*(Aq\&.\*(Aq,\*(Aqfoobar\&.obj\*(Aq) env\&.Ignore(\*(Aqbar\*(Aq,\*(Aqbar/foobar\&.obj\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBImport\fR(\fIvars\&.\&.\&.\fR), \fIenv\fR\&.Import(\fIvars\&.\&.\&.\fR) .RS 4 Imports variables into the current SConscript file\&. \fIvars\fR must be strings representing names of variables which have been previously exported either by the \fBExport\fR function or by the \fIexports\fR argument to \fBSConscript\fR\&. Variables exported by \fBSConscript\fR take precedence\&. Multiple variable names can be passed to \fBImport\fR as separate arguments or as words in a space\-separated string\&. The wildcard "*" can be used to import all available variables\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf Import("env") Import("env", "variable") Import(["env", "variable"]) Import("*") .fi .if n \{\ .RE .\} .RE .PP \fBLiteral\fR(\fIstring\fR), \fIenv\fR\&.Literal(\fIstring\fR) .RS 4 The specified \fIstring\fR will be preserved as\-is and not have construction variables expanded\&. .RE .PP \fBLocal\fR(\fItargets\fR), \fIenv\fR\&.Local(\fItargets\fR) .RS 4 The specified \fItargets\fR will have copies made in the local tree, even if an already up\-to\-date copy exists in a repository\&. Returns a list of the target Node or Nodes\&. .RE .PP \fIenv\fR\&.MergeFlags(\fIarg, [unique]\fR) .RS 4 Merges the specified \fIarg\fR values to the construction environment\*(Aqs construction variables\&. If the \fIarg\fR argument is not a dictionary, it is converted to one by calling \fBenv\&.ParseFlags\fR on the argument before the values are merged\&. Note that \fIarg\fR must be a single value, so multiple strings must be passed in as a list, not as separate arguments to \fBenv\&.MergeFlags\fR\&. .sp By default, duplicate values are eliminated; you can, however, specify unique=0 to allow duplicate values to be added\&. When eliminating duplicate values, any construction variables that end with the string PATH keep the left\-most unique value\&. All other construction variables keep the right\-most unique value\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Add an optimization flag to $CCFLAGS\&. env\&.MergeFlags(\*(Aq\-O3\*(Aq) # Combine the flags returned from running pkg\-config with an optimization # flag and merge the result into the construction variables\&. env\&.MergeFlags([\*(Aq!pkg\-config gtk+\-2\&.0 \-\-cflags\*(Aq, \*(Aq\-O3\*(Aq]) # Combine an optimization flag with the flags returned from running pkg\-config # twice and merge the result into the construction variables\&. env\&.MergeFlags([\*(Aq\-O3\*(Aq, \*(Aq!pkg\-config gtk+\-2\&.0 \-\-cflags \-\-libs\*(Aq, \*(Aq!pkg\-config libpng12 \-\-cflags \-\-libs\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fBNoCache\fR(\fItarget, \&.\&.\&.\fR), \fIenv\fR\&.NoCache(\fItarget, \&.\&.\&.\fR) .RS 4 Specifies a list of files which should \fInot\fR be cached whenever the \fBCacheDir\fR method has been activated\&. The specified targets may be a list or an individual target\&. .sp Multiple files should be specified either as separate arguments to the \fBNoCache\fR method, or as a list\&. \fBNoCache\fR will also accept the return value of any of the construction environment Builder methods\&. .sp Calling \fBNoCache\fR on directories and other non\-File Node types has no effect because only File Nodes are cached\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf NoCache(\*(Aqfoo\&.elf\*(Aq) NoCache(env\&.Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq)) .fi .if n \{\ .RE .\} .RE .PP \fBNoClean\fR(\fItarget, \&.\&.\&.\fR), \fIenv\fR\&.NoClean(\fItarget, \&.\&.\&.\fR) .RS 4 Specifies a list of files or directories which should \fInot\fR be removed whenever the targets (or their dependencies) are specified with the \fB\-c\fR command line option\&. The specified targets may be a list or an individual target\&. Multiple calls to \fBNoClean\fR are legal, and prevent each specified target from being removed by calls to the \fB\-c\fR option\&. .sp Multiple files or directories should be specified either as separate arguments to the \fBNoClean\fR method, or as a list\&. \fBNoClean\fR will also accept the return value of any of the construction environment Builder methods\&. .sp Calling \fBNoClean\fR for a target overrides calling \fBClean\fR for the same target, and any targets passed to both functions will \fInot\fR be removed by the \fB\-c\fR option\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf NoClean(\*(Aqfoo\&.elf\*(Aq) NoClean(env\&.Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq)) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.ParseConfig(\fIcommand, [function, unique]\fR) .RS 4 Calls the specified \fIfunction\fR to modify the environment as specified by the output of \fIcommand\fR\&. The default \fIfunction\fR is \fBenv\&.MergeFlags\fR, which expects the output of a typical *\-config command (for example, gtk\-config) and adds the options to the appropriate construction variables\&. By default, duplicate values are not added to any construction variables; you can specify unique=0 to allow duplicate values to be added\&. .sp Interpreted options and the construction variables they affect are as specified for the \fBenv\&.ParseFlags\fR method (which this method calls)\&. See that method\*(Aqs description for a table of options and construction variables\&. .RE .PP \fBParseDepends\fR(\fIfilename, [must_exist, only_one]\fR), \fIenv\fR\&.ParseDepends(\fIfilename, [must_exist, only_one]\fR) .RS 4 Parses the contents of the specified \fIfilename\fR as a list of dependencies in the style of Make or mkdep, and explicitly establishes all of the listed dependencies\&. .sp By default, it is not an error if the specified \fIfilename\fR does not exist\&. The optional \fImust_exist\fR argument may be set to a non\-zero value to have scons throw an exception and generate an error if the file does not exist, or is otherwise inaccessible\&. .sp The optional \fIonly_one\fR argument may be set to a non\-zero value to have scons thrown an exception and generate an error if the file contains dependency information for more than one target\&. This can provide a small sanity check for files intended to be generated by, for example, the gcc \-M flag, which should typically only write dependency information for one output file into a corresponding \&.d file\&. .sp The \fIfilename\fR and all of the files listed therein will be interpreted relative to the directory of the SConscript file which calls the \fBParseDepends\fR function\&. .RE .PP \fIenv\fR\&.ParseFlags(\fIflags, \&.\&.\&.\fR) .RS 4 Parses one or more strings containing typical command\-line flags for GCC tool chains and returns a dictionary with the flag values separated into the appropriate SCons construction variables\&. This is intended as a companion to the \fBenv\&.MergeFlags\fR method, but allows for the values in the returned dictionary to be modified, if necessary, before merging them into the construction environment\&. (Note that \fBenv\&.MergeFlags\fR will call this method if its argument is not a dictionary, so it is usually not necessary to call \fBenv\&.ParseFlags\fR directly unless you want to manipulate the values\&.) .sp If the first character in any string is an exclamation mark (!), the rest of the string is executed as a command, and the output from the command is parsed as GCC tool chain command\-line flags and added to the resulting dictionary\&. .sp Flag values are translated accordig to the prefix found, and added to the following construction variables: .sp .if n \{\ .RS 4 .\} .nf \-arch CCFLAGS, LINKFLAGS \-D CPPDEFINES \-framework FRAMEWORKS \-frameworkdir= FRAMEWORKPATH \-fmerge\-all\-constants CCFLAGS, LINKFLAGS \-fopenmp CCFLAGS, LINKFLAGS \-include CCFLAGS \-imacros CCFLAGS \-isysroot CCFLAGS, LINKFLAGS \-isystem CCFLAGS \-iquote CCFLAGS \-idirafter CCFLAGS \-I CPPPATH \-l LIBS \-L LIBPATH \-mno\-cygwin CCFLAGS, LINKFLAGS \-mwindows LINKFLAGS \-openmp CCFLAGS, LINKFLAGS \-pthread CCFLAGS, LINKFLAGS \-std= CFLAGS \-Wa, ASFLAGS, CCFLAGS \-Wl,\-rpath= RPATH \-Wl,\-R, RPATH \-Wl,\-R RPATH \-Wl, LINKFLAGS \-Wp, CPPFLAGS \- CCFLAGS + CCFLAGS, LINKFLAGS .fi .if n \{\ .RE .\} .sp Any other strings not associated with options are assumed to be the names of libraries and added to the \fB$LIBS\fR construction variable\&. .sp Examples (all of which produce the same result): .sp .if n \{\ .RS 4 .\} .nf dict = env\&.ParseFlags(\*(Aq\-O2 \-Dfoo \-Dbar=1\*(Aq) dict = env\&.ParseFlags(\*(Aq\-O2\*(Aq, \*(Aq\-Dfoo\*(Aq, \*(Aq\-Dbar=1\*(Aq) dict = env\&.ParseFlags([\*(Aq\-O2\*(Aq, \*(Aq\-Dfoo \-Dbar=1\*(Aq]) dict = env\&.ParseFlags(\*(Aq\-O2\*(Aq, \*(Aq!echo \-Dfoo \-Dbar=1\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBPlatform\fR(\fIstring\fR) .RS 4 The \fBPlatform\fR form returns a callable object that can be used to initialize a construction environment using the platform keyword of the \fBEnvironment\fR function\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env = Environment(platform = Platform(\*(Aqwin32\*(Aq)) .fi .if n \{\ .RE .\} .sp The \fBenv\&.Platform\fR form applies the callable object for the specified platform \fIstring\fR to the environment through which the method was called\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Platform(\*(Aqposix\*(Aq) .fi .if n \{\ .RE .\} .sp Note that the win32 platform adds the SystemDrive and SystemRoot variables from the user\*(Aqs external environment to the construction environment\*(Aqs \fB$ENV\fR dictionary\&. This is so that any executed commands that use sockets to connect with other systems (such as fetching source files from external CVS repository specifications like :pserver:anonymous@cvs\&.sourceforge\&.net:/cvsroot/scons) will work on Windows systems\&. .RE .PP \fBPrecious\fR(\fItarget, \&.\&.\&.\fR), \fIenv\fR\&.Precious(\fItarget, \&.\&.\&.\fR) .RS 4 Marks each given \fItarget\fR as precious so it is not deleted before it is rebuilt\&. Normally \fBscons\fR deletes a target before building it\&. Multiple targets can be passed in to a single call to \fBPrecious\fR\&. .RE .PP \fIenv\fR\&.Prepend(\fIkey=val, [\&.\&.\&.]\fR) .RS 4 Appends the specified keyword arguments to the beginning of construction variables in the environment\&. If the Environment does not have the specified construction variable, it is simply added to the environment\&. If the values of the construction variable and the keyword argument are the same type, then the two values will be simply added together\&. Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together\&. (See also the Append method, above\&.) .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Prepend(CCFLAGS = \*(Aq\-g \*(Aq, FOO = [\*(Aqfoo\&.yyy\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.PrependENVPath(\fIname, newpath, [envname, sep, delete_existing]\fR) .RS 4 This appends new path elements to the given path in the specified external environment (\fB$ENV\fR by default)\&. This will only add any particular path once (leaving the first one it encounters and ignoring the rest, to preserve path order), and to help assure this, will normalize all paths (using os\&.path\&.normpath and os\&.path\&.normcase)\&. This can also handle the case where the given old path variable is a list instead of a string, in which case a list will be returned instead of a string\&. .sp If \fIdelete_existing\fR is 0, then adding a path that already exists will not move it to the beginning; it will stay where it is in the list\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf print \*(Aqbefore:\*(Aq,env[\*(AqENV\*(Aq][\*(AqINCLUDE\*(Aq] include_path = \*(Aq/foo/bar:/foo\*(Aq env\&.PrependENVPath(\*(AqINCLUDE\*(Aq, include_path) print \*(Aqafter:\*(Aq,env[\*(AqENV\*(Aq][\*(AqINCLUDE\*(Aq] .fi .if n \{\ .RE .\} .sp The above example will print: .sp .if n \{\ .RS 4 .\} .nf before: /biz:/foo after: /foo/bar:/foo:/biz .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.PrependUnique(\fIkey=val, delete_existing=0, [\&.\&.\&.]\fR) .RS 4 Appends the specified keyword arguments to the beginning of construction variables in the environment\&. If the Environment does not have the specified construction variable, it is simply added to the environment\&. If the construction variable being appended to is a list, then any value(s) that already exist in the construction variable will \fInot\fR be added again to the list\&. However, if delete_existing is 1, existing matching values are removed first, so existing values in the arg list move to the front of the list\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.PrependUnique(CCFLAGS = \*(Aq\-g\*(Aq, FOO = [\*(Aqfoo\&.yyy\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fBProgress\fR(\fIcallable, [interval]\fR), \fBProgress\fR(\fIstring, [interval, file, overwrite]\fR), \fBProgress\fR(\fIlist_of_strings, [interval, file, overwrite]\fR) .RS 4 Allows SCons to show progress made during the build by displaying a string or calling a function while evaluating Nodes (e\&.g\&. files)\&. .sp If the first specified argument is a Python callable (a function or an object that has a __call__ method), the function will be called once every \fIinterval\fR times a Node is evaluated (default \fB1\fR)\&. The callable will be passed the evaluated Node as its only argument\&. (For future compatibility, it\*(Aqs a good idea to also add \fI*args\fR and \fI**kwargs\fR as arguments to your function or method signatures\&. This will prevent the code from breaking if SCons ever changes the interface to call the function with additional arguments in the future\&.) .sp An example of a simple custom progress function that prints a string containing the Node name every 10 Nodes: .sp .if n \{\ .RS 4 .\} .nf def my_progress_function(node, *args, **kwargs): print(\*(AqEvaluating node %s!\*(Aq % node) Progress(my_progress_function, interval=10) .fi .if n \{\ .RE .\} .sp A more complicated example of a custom progress display object that prints a string containing a count every 100 evaluated Nodes\&. Note the use of \er (a carriage return) at the end so that the string will overwrite itself on a display: .sp .if n \{\ .RS 4 .\} .nf import sys class ProgressCounter(object): count = 0 def __call__(self, node, *args, **kw): self\&.count += 100 sys\&.stderr\&.write(\*(AqEvaluated %s nodes\er\*(Aq % self\&.count) Progress(ProgressCounter(), interval=100) .fi .if n \{\ .RE .\} .sp If the first argument to \fBProgress\fR is a string or list of strings, it is taken as text to be displayed every \fIinterval\fR evaluated Nodes\&. If the first argument is a list of strings, then each string in the list will be displayed in rotating fashion every \fIinterval\fR evaluated Nodes\&. .sp The default is to print the string on standard output\&. An alternate output stream may be specified with the \fIfile\fR keyword argument, which the caller must pass already opened\&. .sp The following will print a series of dots on the error output, one dot for every 100 evaluated Nodes: .sp .if n \{\ .RS 4 .\} .nf import sys Progress(\*(Aq\&.\*(Aq, interval=100, file=sys\&.stderr) .fi .if n \{\ .RE .\} .sp If the string contains the verbatim substring $TARGET;, it will be replaced with the Node\&. Note that, for performance reasons, this is \fInot\fR a regular SCons variable substition, so you can not use other variables or use curly braces\&. The following example will print the name of every evaluated Node, using a carriage return) (\er) to cause each line to overwritten by the next line, and the \fIoverwrite\fR keyword argument (default False) to make sure the previously\-printed file name is overwritten with blank spaces: .sp .if n \{\ .RS 4 .\} .nf import sys Progress(\*(Aq$TARGET\er\*(Aq, overwrite=True) .fi .if n \{\ .RE .\} .sp A list of strings can be used to implement a "spinner" on the user\*(Aqs screen as follows, changing every five evaluated Nodes: .sp .if n \{\ .RS 4 .\} .nf Progress([\*(Aq\-\er\*(Aq, \*(Aq\e\e\er\*(Aq, \*(Aq|\er\*(Aq, \*(Aq/\er\*(Aq], interval=5) .fi .if n \{\ .RE .\} .RE .PP \fBPseudo\fR(\fItarget, \&.\&.\&.\fR), \fIenv\fR\&.Pseudo(\fItarget, \&.\&.\&.\fR) .RS 4 This indicates that each given \fItarget\fR should not be created by the build rule, and if the target is created, an error will be generated\&. This is similar to the gnu make \&.PHONY target\&. However, in the vast majority of cases, an \fBAlias\fR is more appropriate\&. Multiple targets can be passed in to a single call to \fBPseudo\fR\&. .RE .PP \fBPyPackageDir\fR(\fImodulename\fR), \fIenv\fR\&.PyPackageDir(\fImodulename\fR) .RS 4 This returns a Directory Node similar to Dir\&. The python module / package is looked up and if located the directory is returned for the location\&. \fImodulename\fR Is a named python package / module to lookup the directory for it\*(Aqs location\&. .sp If \fImodulename\fR is a list, SCons returns a list of Dir nodes\&. Construction variables are expanded in \fImodulename\fR\&. .RE .PP \fIenv\fR\&.Replace(\fIkey=val, [\&.\&.\&.]\fR) .RS 4 Replaces construction variables in the Environment with the specified keyword arguments\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Replace(CCFLAGS = \*(Aq\-g\*(Aq, FOO = \*(Aqfoo\&.xxx\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBRepository\fR(\fIdirectory\fR), \fIenv\fR\&.Repository(\fIdirectory\fR) .RS 4 Specifies that \fIdirectory\fR is a repository to be searched for files\&. Multiple calls to \fBRepository\fR are legal, and each one adds to the list of repositories that will be searched\&. .sp To \fBscons\fR, a repository is a copy of the source tree, from the top\-level directory on down, which may contain both source files and derived files that can be used to build targets in the local source tree\&. The canonical example would be an official source tree maintained by an integrator\&. If the repository contains derived files, then the derived files should have been built using \fBscons\fR, so that the repository contains the necessary signature information to allow \fBscons\fR to figure out when it is appropriate to use the repository copy of a derived file, instead of building one locally\&. .sp Note that if an up\-to\-date derived file already exists in a repository, \fBscons\fR will \fInot\fR make a copy in the local directory tree\&. In order to guarantee that a local copy will be made, use the \fBLocal\fR method\&. .RE .PP \fBRequires\fR(\fItarget, prerequisite\fR), \fIenv\fR\&.Requires(\fItarget, prerequisite\fR) .RS 4 Specifies an order\-only relationship between the specified target file(s) and the specified prerequisite file(s)\&. The prerequisite file(s) will be (re)built, if necessary, \fIbefore\fR the target file(s), but the target file(s) do not actually depend on the prerequisites and will not be rebuilt simply because the prerequisite file(s) change\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env\&.Requires(\*(Aqfoo\*(Aq, \*(Aqfile\-that\-must\-be\-built\-before\-foo\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBReturn\fR(\fI[vars\&.\&.\&., stop=True]\fR) .RS 4 Return to the calling SConscript, optionally returning the values of variables named in \fIvars\fR\&. Multiple strings contaning variable names may be passed to \fBReturn\fR\&. A string containing white space is split into individual variable names\&. Returns the value if one variable is specified, else returns a tuple of values\&. Returns an empty tuple if \fIvars\fR is omitted\&. .sp By default \fBReturn\fR stops processing the current SConscript and returns immediately\&. The optional stop keyword argument may be set to a false value to continue processing the rest of the SConscript file after the \fBReturn\fR call (this was the default behavior prior to SCons 0\&.98\&.) However, the values returned are still the values of the variables in the named \fIvars\fR at the point \fBReturn\fR was called\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Returns no values (evaluates False) Return() # Returns the value of the \*(Aqfoo\*(Aq Python variable\&. Return("foo") # Returns the values of the Python variables \*(Aqfoo\*(Aq and \*(Aqbar\*(Aq\&. Return("foo", "bar") # Returns the values of Python variables \*(Aqval1\*(Aq and \*(Aqval2\*(Aq\&. Return(\*(Aqval1 val2\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fBScanner\fR(\fIfunction, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]\fR), \fIenv\fR\&.Scanner(\fIfunction, [argument, keys, path_function, node_class, node_factory, scan_check, recursive]\fR) .RS 4 Creates a Scanner object for the specified \fIfunction\fR\&. See manpage section "Scanner Objects" for a complete explanation of the arguments and behavior\&. .RE .PP \fBSConscript\fR(\fIscripts, [exports, variant_dir, duplicate, must_exist]\fR), \fIenv\fR\&.SConscript(\fIscripts, [exports, variant_dir, duplicate, must_exist]\fR), \fBSConscript\fR(\fIdirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]\fR), \fIenv\fR\&.SConscript(\fIdirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]\fR) .RS 4 Execute one or more subsidiary SConscript (configuration) files\&. There are two ways to call the \fBSConscript\fR function\&. .sp The first calling style is to explicitly specify one or more \fIscripts\fR as the first argument\&. A single script may be specified as a string; multiple scripts must be specified as a list (either explicitly or as created by a function like \fBSplit\fR)\&. Examples: .sp .if n \{\ .RS 4 .\} .nf SConscript(\*(AqSConscript\*(Aq) # run SConscript in the current directory SConscript(\*(Aqsrc/SConscript\*(Aq) # run SConscript in the src directory SConscript([\*(Aqsrc/SConscript\*(Aq, \*(Aqdoc/SConscript\*(Aq]) config = SConscript(\*(AqMyConfig\&.py\*(Aq) .fi .if n \{\ .RE .\} .sp The second way to call \fBSConscript\fR is to specify a list of (sub)directory names as a \fIdirs\fR=\fIsubdirs\fR keyword argument\&. In this case, \fBscons\fR will execute a subsidiary configuration file named SConscript in each of the specified directories\&. You may specify a name other than SConscript by supplying an optional \fIname\fR=\fIscript\fR keyword argument\&. The first three examples below have the same effect as the first three examples above: .sp .if n \{\ .RS 4 .\} .nf SConscript(dirs=\*(Aq\&.\*(Aq) # run SConscript in the current directory SConscript(dirs=\*(Aqsrc\*(Aq) # run SConscript in the src directory SConscript(dirs=[\*(Aqsrc\*(Aq, \*(Aqdoc\*(Aq]) SConscript(dirs=[\*(Aqsub1\*(Aq, \*(Aqsub2\*(Aq], name=\*(AqMySConscript\*(Aq) .fi .if n \{\ .RE .\} .sp The optional \fIexports\fR argument provides a string or list of strings representing variable names, or a dictionary of named values, to export\&. These variables are locally exported only to the called SConscript file(s) and do not affect the global pool of variables managed by the \fBExport\fR function\&. The subsidiary SConscript files must use the \fBImport\fR function to import the variables\&. Examples: .sp .if n \{\ .RS 4 .\} .nf foo = SConscript(\*(Aqsub/SConscript\*(Aq, exports=\*(Aqenv\*(Aq) SConscript(\*(Aqdir/SConscript\*(Aq, exports=[\*(Aqenv\*(Aq, \*(Aqvariable\*(Aq]) SConscript(dirs=\*(Aqsubdir\*(Aq, exports=\*(Aqenv variable\*(Aq) SConscript(dirs=[\*(Aqone\*(Aq, \*(Aqtwo\*(Aq, \*(Aqthree\*(Aq], exports=\*(Aqshared_info\*(Aq) .fi .if n \{\ .RE .\} .sp If the optional \fIvariant_dir\fR argument is present, it causes an effect equivalent to the \fBVariantDir\fR function\&. The \fIvariant_dir\fR argument is interpreted relative to the directory of the calling SConscript file\&. The optional \fIduplicate\fR argument is interpreted as for \fBVariantDir\fR\&. If \fIvariant_dir\fR is omitted, the \fIduplicate\fR argument is ignored\&. See the description of \fBVariantDir\fR below for additional details and restrictions\&. .sp If \fIvariant_dir\fR is present, the source directory is the directory in which the SConscript file resides and the SConscript file is evaluated as if it were in the \fIvariant_dir\fR directory: .sp .if n \{\ .RS 4 .\} .nf SConscript(\*(Aqsrc/SConscript\*(Aq, variant_dir=\*(Aqbuild\*(Aq) .fi .if n \{\ .RE .\} .sp is equivalent to .sp .if n \{\ .RS 4 .\} .nf VariantDir(\*(Aqbuild\*(Aq, \*(Aqsrc\*(Aq) SConscript(\*(Aqbuild/SConscript\*(Aq) .fi .if n \{\ .RE .\} .sp This later paradigm is often used when the sources are in the same directory as the SConstruct: .sp .if n \{\ .RS 4 .\} .nf SConscript(\*(AqSConscript\*(Aq, variant_dir=\*(Aqbuild\*(Aq) .fi .if n \{\ .RE .\} .sp is equivalent to .sp .if n \{\ .RS 4 .\} .nf VariantDir(\*(Aqbuild\*(Aq, \*(Aq\&.\*(Aq) SConscript(\*(Aqbuild/SConscript\*(Aq) .fi .if n \{\ .RE .\} .sp .sp If the optional \fImust_exist\fR is \fBTrue\fR, causes an exception to be raised if a requested SConscript file is not found\&. The current default is \fBFalse\fR, causing only a warning to be emitted, but this default is deprecated (\fIsince 3\&.1\fR)\&. For scripts which truly intend to be optional, transition to explicitly supplying must_exist=False to the \fBSConscript\fR call\&. .sp Here are some composite examples: .sp .if n \{\ .RS 4 .\} .nf # collect the configuration information and use it to build src and doc shared_info = SConscript(\*(AqMyConfig\&.py\*(Aq) SConscript(\*(Aqsrc/SConscript\*(Aq, exports=\*(Aqshared_info\*(Aq) SConscript(\*(Aqdoc/SConscript\*(Aq, exports=\*(Aqshared_info\*(Aq) .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # build debugging and production versions\&. SConscript # can use Dir(\*(Aq\&.\*(Aq)\&.path to determine variant\&. SConscript(\*(AqSConscript\*(Aq, variant_dir=\*(Aqdebug\*(Aq, duplicate=0) SConscript(\*(AqSConscript\*(Aq, variant_dir=\*(Aqprod\*(Aq, duplicate=0) .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # build debugging and production versions\&. SConscript # is passed flags to use\&. opts = { \*(AqCPPDEFINES\*(Aq : [\*(AqDEBUG\*(Aq], \*(AqCCFLAGS\*(Aq : \*(Aq\-pgdb\*(Aq } SConscript(\*(AqSConscript\*(Aq, variant_dir=\*(Aqdebug\*(Aq, duplicate=0, exports=opts) opts = { \*(AqCPPDEFINES\*(Aq : [\*(AqNODEBUG\*(Aq], \*(AqCCFLAGS\*(Aq : \*(Aq\-O\*(Aq } SConscript(\*(AqSConscript\*(Aq, variant_dir=\*(Aqprod\*(Aq, duplicate=0, exports=opts) .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # build common documentation and compile for different architectures SConscript(\*(Aqdoc/SConscript\*(Aq, variant_dir=\*(Aqbuild/doc\*(Aq, duplicate=0) SConscript(\*(Aqsrc/SConscript\*(Aq, variant_dir=\*(Aqbuild/x86\*(Aq, duplicate=0) SConscript(\*(Aqsrc/SConscript\*(Aq, variant_dir=\*(Aqbuild/ppc\*(Aq, duplicate=0) .fi .if n \{\ .RE .\} .sp \fBSConscript\fR returns the values of any variables named by the executed SConscript(s) in arguments to the \fBReturn\fR function (see above for details)\&. If a single \fBSConscript\fR call causes multiple scripts to be executed, the return value is a tuple containing the returns of all of the scripts\&. If an executed script does not explicitly call \fBReturn\fR, it returns \fBNone\fR\&. .RE .PP \fBSConscriptChdir\fR(\fIvalue\fR), \fIenv\fR\&.SConscriptChdir(\fIvalue\fR) .RS 4 By default, \fBscons\fR changes its working directory to the directory in which each subsidiary SConscript file lives\&. This behavior may be disabled by specifying either: .sp .if n \{\ .RS 4 .\} .nf SConscriptChdir(0) env\&.SConscriptChdir(0) .fi .if n \{\ .RE .\} .sp in which case \fBscons\fR will stay in the top\-level directory while reading all SConscript files\&. (This may be necessary when building from repositories, when all the directories in which SConscript files may be found don\*(Aqt necessarily exist locally\&.) You may enable and disable this ability by calling SConscriptChdir() multiple times\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf env = Environment() SConscriptChdir(0) SConscript(\*(Aqfoo/SConscript\*(Aq) # will not chdir to foo env\&.SConscriptChdir(1) SConscript(\*(Aqbar/SConscript\*(Aq) # will chdir to bar .fi .if n \{\ .RE .\} .RE .PP \fBSConsignFile\fR(\fI[file, dbm_module]\fR), \fIenv\fR\&.SConsignFile(\fI[file, dbm_module]\fR) .RS 4 This tells \fBscons\fR to store all file signatures in the specified database \fIfile\fR\&. If the \fIfile\fR name is omitted, \&.sconsign is used by default\&. (The actual file name(s) stored on disk may have an appropriated suffix appended by the \fIdbm_module\fR\&.) If \fIfile\fR is not an absolute path name, the file is placed in the same directory as the top\-level SConstruct file\&. .sp If \fIfile\fR is \fBNone\fR, then \fBscons\fR will store file signatures in a separate \&.sconsign file in each directory, not in one global database file\&. (This was the default behavior prior to SCons 0\&.96\&.91 and 0\&.97\&.) .sp The optional \fIdbm_module\fR argument can be used to specify which Python database module The default is to use a custom SCons\&.dblite module that uses pickled Python data structures, and which works on all Python versions\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # Explicitly stores signatures in "\&.sconsign\&.dblite" # in the top\-level SConstruct directory (the # default behavior)\&. SConsignFile() # Stores signatures in the file "etc/scons\-signatures" # relative to the top\-level SConstruct directory\&. SConsignFile("etc/scons\-signatures") # Stores signatures in the specified absolute file name\&. SConsignFile("/home/me/SCons/signatures") # Stores signatures in a separate \&.sconsign file # in each directory\&. SConsignFile(None) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.SetDefault(\fIkey=val, [\&.\&.\&.]\fR) .RS 4 Sets construction variables to default values specified with the keyword arguments if (and only if) the variables are not already set\&. The following statements are equivalent: .sp .if n \{\ .RS 4 .\} .nf env\&.SetDefault(FOO = \*(Aqfoo\*(Aq) if \*(AqFOO\*(Aq not in env: env[\*(AqFOO\*(Aq] = \*(Aqfoo\*(Aq .fi .if n \{\ .RE .\} .RE .PP \fBSetOption\fR(\fIname, value\fR), \fIenv\fR\&.SetOption(\fIname, value\fR) .RS 4 This function provides a way to set a select subset of the scons command line options from a SConscript file\&. The options supported are: .PP clean .RS 4 which corresponds to \fB\-c\fR, \fB\-\-clean\fR and \fB\-\-remove\fR; .RE .PP duplicate .RS 4 which corresponds to \fB\-\-duplicate\fR; .RE .PP help .RS 4 which corresponds to \fB\-h\fR and \fB\-\-help\fR; .RE .PP implicit_cache .RS 4 which corresponds to \fB\-\-implicit\-cache\fR; .RE .PP max_drift .RS 4 which corresponds to \fB\-\-max\-drift\fR; .RE .PP no_exec .RS 4 which corresponds to \fB\-n\fR, \fB\-\-no\-exec\fR, \fB\-\-just\-print\fR, \fB\-\-dry\-run\fR and \fB\-\-recon\fR; .RE .PP num_jobs .RS 4 which corresponds to \fB\-j\fR and \fB\-\-jobs\fR; .RE .PP random .RS 4 which corresponds to \fB\-\-random\fR; and .RE .PP silent .RS 4 which corresponds to \fB\-\-silent\fR\&. .RE .PP no_progress .RS 4 which corresponds to \-Q\&. .sp Note: The initial progress output will still be output as this is done before the SConstruct/SConscript which contains the SetOption is processed scons: Reading SConscript files \&.\&.\&. .sp \fIAvailable since \fR\fI\fBscons\fR\fR\fI 4\&.0\&.\fR .RE .PP stack_size .RS 4 which corresponds to \-\-stack\-size\&. .RE .sp See the documentation for the corresponding command line option for information about each specific option\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf SetOption(\*(Aqmax_drift\*(Aq, 1) .fi .if n \{\ .RE .\} .RE .PP \fBSideEffect\fR(\fIside_effect, target\fR), \fIenv\fR\&.SideEffect(\fIside_effect, target\fR) .RS 4 Declares \fIside_effect\fR as a side effect of building \fItarget\fR\&. Both \fIside_effect\fR and \fItarget\fR can be a list, a file name, or a node\&. A side effect is a target file that is created or updated as a side effect of building other targets\&. For example, a Windows PDB file is created as a side effect of building the \&.obj files for a static library, and various log files are created updated as side effects of various TeX commands\&. If a target is a side effect of multiple build commands, \fBscons\fR will ensure that only one set of commands is executed at a time\&. Consequently, you only need to use this method for side\-effect targets that are built as a result of multiple build commands\&. .sp Because multiple build commands may update the same side effect file, by default the \fIside_effect\fR target is \fInot\fR automatically removed when the \fItarget\fR is removed by the \fB\-c\fR option\&. (Note, however, that the \fIside_effect\fR might be removed as part of cleaning the directory in which it lives\&.) If you want to make sure the \fIside_effect\fR is cleaned whenever a specific \fItarget\fR is cleaned, you must specify this explicitly with the \fBClean\fR or \fBenv\&.Clean\fR function\&. .RE .PP \fBSplit\fR(\fIarg\fR), \fIenv\fR\&.Split(\fIarg\fR) .RS 4 Returns a list of file names or other objects\&. If \fIarg\fR is a string, it will be split on strings of white\-space characters within the string, making it easier to write long lists of file names\&. If \fIarg\fR is already a list, the list will be returned untouched\&. If \fIarg\fR is any other type of object, it will be returned as a list containing just the object\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf files = Split("f1\&.c f2\&.c f3\&.c") files = env\&.Split("f4\&.c f5\&.c f6\&.c") files = Split(""" f7\&.c f8\&.c f9\&.c """) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR\&.subst(\fIinput, [raw, target, source, conv]\fR) .RS 4 Performs construction variable interpolation on the specified string or sequence argument \fIinput\fR\&. .sp By default, leading or trailing white space will be removed from the result\&. and all sequences of white space will be compressed to a single space character\&. Additionally, any $( and $) character sequences will be stripped from the returned string, The optional \fIraw\fR argument may be set to 1 if you want to preserve white space and $(\-$) sequences\&. The \fIraw\fR argument may be set to 2 if you want to strip all characters between any $( and $) pairs (as is done for signature calculation)\&. .sp If the input is a sequence (list or tuple), the individual elements of the sequence will be expanded, and the results will be returned as a list\&. .sp The optional \fItarget\fR and \fIsource\fR keyword arguments must be set to lists of target and source nodes, respectively, if you want the \fB$TARGET\fR, \fB$TARGETS\fR, \fB$SOURCE\fR and \fB$SOURCES\fR to be available for expansion\&. This is usually necessary if you are calling \fBenv\&.subst\fR from within a Python function used as an SCons action\&. .sp Returned string values or sequence elements are converted to their string representation by default\&. The optional \fIconv\fR argument may specify a conversion function that will be used in place of the default\&. For example, if you want Python objects (including SCons Nodes) to be returned as Python objects, you can use the Python Λ idiom to pass in an unnamed function that simply returns its unconverted argument\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf print(env\&.subst("The C compiler is: $CC")) def compile(target, source, env): sourceDir = env\&.subst("${SOURCE\&.srcdir}", target=target, source=source) source_nodes = env\&.subst(\*(Aq$EXPAND_TO_NODELIST\*(Aq, conv=lambda x: x) .fi .if n \{\ .RE .\} .RE .PP \fBTag\fR(\fInode, tags\fR) .RS 4 Annotates file or directory Nodes with information about how the \fBPackage\fR Builder should package those files or directories\&. All tags are optional\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # makes sure the built library will be installed with 0o644 file # access mode Tag( Library( \*(Aqlib\&.c\*(Aq ), UNIX_ATTR="0o644" ) # marks file2\&.txt to be a documentation file Tag( \*(Aqfile2\&.txt\*(Aq, DOC ) .fi .if n \{\ .RE .\} .RE .PP \fBTool\fR(\fIname, [toolpath, **kwargs]\fR), \fIenv\fR\&.Tool(\fIname, [toolpath, **kwargs]\fR) .RS 4 Runs the tool identified by \fIname\fR, which is searched for in standard locations and any paths specified by the optional \fItoolpath\fR, to update a construction environment with construction variables needed to use the mechanisms that tool describes\&. Any additional keyword arguments \fIkwargs\fR are passed on to the tool module\*(Aqs \fBgenerate\fR function\&. .sp When called as a construction environment method, the tool module is called to update the construction environment and the name of the tool is appended to the \fB$TOOLS\fR construction variable in that environment\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env\&.Tool(\*(Aqgcc\*(Aq) env\&.Tool(\*(Aqopengl\*(Aq, toolpath=[\*(Aqbuild/tools\*(Aq]) .fi .if n \{\ .RE .\} .sp When called as a global function, returns a callable tool object; the tool is not called at this time, as it lacks the context of an environment to update\&. This tool object can be passed to an \fBEnvironment\fR or \fBClone\fR call as part of the \fItools\fR keyword argument, or it can be called directly, passing a construction environment to update as the argument\&. Either approach will also update the \fB$TOOLS\fR construction variable\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[Tool(\*(Aqmsvc\*(Aq)]) env = Environment() t = Tool(\*(Aqmsvc\*(Aq) t(env) # adds \*(Aqmsvc\*(Aq to the TOOLS variable u = Tool(\*(Aqopengl\*(Aq, toolpath = [\*(Aqtools\*(Aq]) u(env) # adds \*(Aqopengl\*(Aq to the TOOLS variable .fi .if n \{\ .RE .\} .RE .PP \fBValue\fR(\fIvalue, [built_value], [name]\fR), \fIenv\fR\&.Value(\fIvalue, [built_value], [name]\fR) .RS 4 Returns a Node object representing the specified Python value\&. Value Nodes can be used as dependencies of targets\&. If the result of calling \fBstr\fR(\fIvalue\fR) changes between SCons runs, any targets depending on \fBValue\fR(\fIvalue\fR) will be rebuilt\&. (This is true even when using timestamps to decide if files are up\-to\-date\&.) When using timestamp source signatures, Value Nodes\*(Aq timestamps are equal to the system time when the Node is created\&. \fIname\fR can be provided as an alternative name for the resulting Value node; this is advised if the \fIvalue\fR parameter can\*(Aqt be converted to a string\&. .sp The returned Value Node object has a \fBwrite\fR() method that can be used to "build" a Value Node by setting a new value\&. The optional \fIbuilt_value\fR argument can be specified when the Value Node is created to indicate the Node should already be considered "built\&." There is a corresponding \fBread\fR() method that will return the built value of the Node\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf env = Environment() def create(target, source, env): # A function that will write a \*(Aqprefix=$SOURCE\*(Aq # string into the file name specified as the # $TARGET\&. f = open(str(target[0]), \*(Aqwb\*(Aq) f\&.write(\*(Aqprefix=\*(Aq + source[0]\&.get_contents()) # Fetch the prefix= argument, if any, from the command # line, and use /usr/local as the default\&. prefix = ARGUMENTS\&.get(\*(Aqprefix\*(Aq, \*(Aq/usr/local\*(Aq) # Attach a \&.Config() builder for the above function action # to the construction environment\&. env[\*(AqBUILDERS\*(Aq][\*(AqConfig\*(Aq] = Builder(action = create) env\&.Config(target = \*(Aqpackage\-config\*(Aq, source = Value(prefix)) def build_value(target, source, env): # A function that "builds" a Python Value by updating # the the Python value with the contents of the file # specified as the source of the Builder call ($SOURCE)\&. target[0]\&.write(source[0]\&.get_contents()) output = env\&.Value(\*(Aqbefore\*(Aq) input = env\&.Value(\*(Aqafter\*(Aq) # Attach a \&.UpdateValue() builder for the above function # action to the construction environment\&. env[\*(AqBUILDERS\*(Aq][\*(AqUpdateValue\*(Aq] = Builder(action = build_value) env\&.UpdateValue(target = Value(output), source = Value(input)) .fi .if n \{\ .RE .\} .RE .PP \fBVariantDir\fR(\fIvariant_dir, src_dir, [duplicate]\fR), \fIenv\fR\&.VariantDir(\fIvariant_dir, src_dir, [duplicate]\fR) .RS 4 Use the \fBVariantDir\fR function to create a copy of your sources in another location: if a name under \fIvariant_dir\fR is not found but exists under \fIsrc_dir\fR, the file or directory is copied to \fIvariant_dir\fR\&. Target files can be built in a different directory than the original sources by simply refering to the sources (and targets) within the variant tree\&. .sp \fBVariantDir\fR can be called multiple times with the same \fIsrc_dir\fR to set up multiple builds with different options (\fIvariants\fR)\&. The \fIsrc_dir\fR location must be in or underneath the SConstruct file\*(Aqs directory, and \fIvariant_dir\fR may not be underneath \fIsrc_dir\fR\&. .sp The default behavior is for \fBscons\fR to physically duplicate the source files in the variant tree\&. Thus, a build performed in the variant tree is guaranteed to be identical to a build performed in the source tree even if intermediate source files are generated during the build, or preprocessors or other scanners search for included files relative to the source file, or individual compilers or other invoked tools are hard\-coded to put derived files in the same directory as source files\&. .sp If possible on the platform, the duplication is performed by linking rather than copying; see also the \fB\-\-duplicate\fR command\-line option\&. Moreover, only the files needed for the build are duplicated; files and directories that are not used are not present in \fIvariant_dir\fR\&. .sp Duplicating the source tree may be disabled by setting the duplicate argument to 0 (zero)\&. This will cause \fBscons\fR to invoke Builders using the path names of source files in \fIsrc_dir\fR and the path names of derived files within \fIvariant_dir\fR\&. This is always more efficient than duplicate=1, and is usually safe for most builds (but see above for cases that may cause problems)\&. .sp Note that \fBVariantDir\fR works most naturally with a subsidiary SConscript file\&. However, you would then call the subsidiary SConscript file not in the source directory, but in the \fIvariant_dir\fR, regardless of the value of duplicate\&. This is how you tell \fBscons\fR which variant of a source tree to build: .sp .if n \{\ .RS 4 .\} .nf # run src/SConscript in two variant directories VariantDir(\*(Aqbuild/variant1\*(Aq, \*(Aqsrc\*(Aq) SConscript(\*(Aqbuild/variant1/SConscript\*(Aq) VariantDir(\*(Aqbuild/variant2\*(Aq, \*(Aqsrc\*(Aq) SConscript(\*(Aqbuild/variant2/SConscript\*(Aq) .fi .if n \{\ .RE .\} .sp See also the \fBSConscript\fR function, described above, for another way to specify a variant directory in conjunction with calling a subsidiary SConscript file\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf # use names in the build directory, not the source directory VariantDir(\*(Aqbuild\*(Aq, \*(Aqsrc\*(Aq, duplicate=0) Program(\*(Aqbuild/prog\*(Aq, \*(Aqbuild/source\&.c\*(Aq) .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # this builds both the source and docs in a separate subtree VariantDir(\*(Aqbuild\*(Aq, \*(Aq\&.\*(Aq, duplicate=0) SConscript(dirs=[\*(Aqbuild/src\*(Aq,\*(Aqbuild/doc\*(Aq]) .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf # same as previous example, but only uses SConscript SConscript(dirs=\*(Aqsrc\*(Aq, variant_dir=\*(Aqbuild/src\*(Aq, duplicate=0) SConscript(dirs=\*(Aqdoc\*(Aq, variant_dir=\*(Aqbuild/doc\*(Aq, duplicate=0) .fi .if n \{\ .RE .\} .RE .PP \fBWhereIs\fR(\fIprogram, [path, pathext, reject]\fR), \fIenv\fR\&.WhereIs(\fIprogram, [path, pathext, reject]\fR) .RS 4 Searches for the specified executable \fIprogram\fR, returning the full path to the program or \fBNone\fR\&. .sp When called as a construction environment method, searches the paths in the \fIpath\fR keyword argument, or if \fBNone\fR (the default) the paths listed in the construction environment (\fIenv\fR[\*(AqENV\*(Aq][\*(AqPATH\*(Aq])\&. The external environment\*(Aqs path list (os\&.environ[\*(AqPATH\*(Aq]) is used as a fallback if the key \fIenv\fR[\*(AqENV\*(Aq][\*(AqPATH\*(Aq] does not exist\&. .sp On Windows systems, searches for executable programs with any of the file extensions listed in the \fIpathext\fR keyword argument, or if \fBNone\fR (the default) the pathname extensions listed in the construction environment (\fIenv\fR[\*(AqENV\*(Aq][\*(AqPATHEXT\*(Aq])\&. The external environment\*(Aqs pathname extensions list (os\&.environ[\*(AqPATHEXT\*(Aq]) is used as a fallback if the key \fIenv\fR[\*(AqENV\*(Aq][\*(AqPATHEXT\*(Aq] does not exist\&. .sp When called as a global function, uses the external environment\*(Aqs path os\&.environ[\*(AqPATH\*(Aq] and path extensions os\&.environ[\*(AqPATHEXT\*(Aq], respectively, if \fIpath\fR and \fIpathext\fR are \fBNone\fR\&. .sp Will not select any path name or names in the optional \fIreject\fR list\&. .RE .SS "SConscript Variables" .PP In addition to the global functions and methods, \fBscons\fR supports a number of variables that can be used in SConscript files to affect how you want the build to be performed\&. .PP \fIARGLIST\fR .RS 4 A list of the \fIkeyword\fR=\fIvalue\fR arguments specified on the command line\&. Each element in the list is a tuple containing the argument\&. The separate \fIkeyword\fR and \fIvalue\fR elements of the tuple can be accessed by subscripting for elements \fB[0]\fR and \fB[1]\fR of the tuple, or, more readably, by using tuple unpacking\&. Example: .sp .if n \{\ .RS 4 .\} .nf print("first keyword, value =", ARGLIST[0][0], ARGLIST[0][1]) print("second keyword, value =", ARGLIST[1][0], ARGLIST[1][1]) key, value = ARGLIST[2] print("third keyword, value =", key, value) for key, value in ARGLIST: # process key and value .fi .if n \{\ .RE .\} .RE .PP \fIARGUMENTS\fR .RS 4 A dictionary of all the \fIkeyword\fR=\fIvalue\fR arguments specified on the command line\&. The dictionary is not in order, and if a given keyword has more than one value assigned to it on the command line, the last (right\-most) value is the one in the \fIARGUMENTS\fR dictionary\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf if ARGUMENTS\&.get(\*(Aqdebug\*(Aq, 0): env = Environment(CCFLAGS=\*(Aq\-g\*(Aq) else: env = Environment() .fi .if n \{\ .RE .\} .RE .PP \fIBUILD_TARGETS\fR .RS 4 A list of the targets which \fBscons\fR has been asked to build\&. The contents will be either those targets listed on the command line, or, if none, those targets set via calls to the \fBDefault\fR function\&. It does \fInot\fR contain any dependent targets that \fBscons\fR selects for building as a result of making the sure the specified targets are up to date, if those targets did not appear on the command line\&. The list is empty if neither command line targets or \fBDefault\fR calls are present\&. .sp The elements of this list may be strings \fIor\fR nodes, so you should run the list through the Python \fBstr\fR function to make sure any Node path names are converted to strings\&. .sp Because this list may be taken from the list of targets specified using the \fBDefault\fR function, the contents of the list may change on each successive call to \fBDefault\fR\&. See the \fIDEFAULT_TARGETS\fR list, below, for additional information\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf if \*(Aqfoo\*(Aq in BUILD_TARGETS: print("Don\*(Aqt forget to test the `foo\*(Aq program!") if \*(Aqspecial/program\*(Aq in BUILD_TARGETS: SConscript(\*(Aqspecial\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fICOMMAND_LINE_TARGETS\fR .RS 4 A list of the targets explicitly specified on the command line\&. If there are command line targets, this list will have the same contents as \fIBUILD_TARGETS\fR\&. If there are no targets specified on the command line, the list is empty\&. The elements of this list are strings\&. This can be used, for example, to take specific actions only when certain targets are explicitly being built\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf if \*(Aqfoo\*(Aq in COMMAND_LINE_TARGETS: print("Don\*(Aqt forget to test the `foo\*(Aq program!") if \*(Aqspecial/program\*(Aq in COMMAND_LINE_TARGETS: SConscript(\*(Aqspecial\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fIDEFAULT_TARGETS\fR .RS 4 A list of the target \fInodes\fR that have been specified using the \fBDefault\fR function\&. If there are no command line targets, this list will have the same contents as \fIBUILD_TARGETS\fR\&. Since the elements of the list are nodes, you need to call the Python \fBstr\fR function on them to get the path name for each Node\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf print(str(DEFAULT_TARGETS[0])) if \*(Aqfoo\*(Aq in [str(t) for t in DEFAULT_TARGETS]: print("Don\*(Aqt forget to test the `foo\*(Aq program!") .fi .if n \{\ .RE .\} .sp The contents of the \fIDEFAULT_TARGETS\fR list change on on each successive call to the \fBDefault\fR function: .sp .if n \{\ .RS 4 .\} .nf print([str(t) for t in DEFAULT_TARGETS]) # originally [] Default(\*(Aqfoo\*(Aq) print([str(t) for t in DEFAULT_TARGETS]) # now a node [\*(Aqfoo\*(Aq] Default(\*(Aqbar\*(Aq) print([str(t) for t in DEFAULT_TARGETS]) # now a node [\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq] Default(None) print([str(t) for t in DEFAULT_TARGETS]) # back to [] .fi .if n \{\ .RE .\} .sp Consequently, be sure to use \fIDEFAULT_TARGETS\fR only after you\*(Aqve made all of your \fBDefault\fR() calls, or else simply be careful of the order of these statements in your SConscript files so that you don\*(Aqt look for a specific default target before it\*(Aqs actually been added to the list\&. .RE .PP These variables may be accessed from custom Python modules that you import into an SConscript file by adding the following to the Python module: .sp .if n \{\ .RS 4 .\} .nf from SCons\&.Script import * .fi .if n \{\ .RE .\} .SS "Construction Variables" .PP A construction environment has an associated dictionary of construction variables that are used by built\-in or user\-supplied build rules\&. Construction variable naming must follow the same rules as for Python identifiers: the initial character must be an underscore or letter, followed by any number of underscores, letters, or digits\&. .PP A construction environment is not a Python dictionary, but it can be indexed like one to access a construction variable: .sp .if n \{\ .RS 4 .\} .nf env["CC"] = "cc" .fi .if n \{\ .RE .\} .PP Construction variables can also be retrieved and set by using the \fBDictionary\fR method of the construction environment to create an actual dictionary: .sp .if n \{\ .RS 4 .\} .nf cvars = env\&.Dictionary() cvars["CC"] = "cc" .fi .if n \{\ .RE .\} .PP Construction variables can also be passed to the construction environment constructor: .sp .if n \{\ .RS 4 .\} .nf env = Environment(CC="cc") .fi .if n \{\ .RE .\} .PP or when copying a construction environment using the \fBClone\fR method: .sp .if n \{\ .RS 4 .\} .nf env2 = env\&.Clone(CC="cl\&.exe") .fi .if n \{\ .RE .\} .PP A number of useful construction variables are automatically defined by scons for each supported platform, and additional construction variables can be defined by the user\&. The following is a list of the possible automatically defined construction variables\&. The actual list available at execution time will not include all of these, as the ones detected as not being useful (wrong platform, necessary external command or files not installed, etc\&.) will not be set up\&. : .PP \fB__LDMODULEVERSIONFLAGS\fR .RS 4 This construction variable automatically introduces \fB$_LDMODULEVERSIONFLAGS\fR if \fB$LDMODULEVERSION\fR is set\&. Othervise it evaluates to an empty string\&. .RE .PP \fB__SHLIBVERSIONFLAGS\fR .RS 4 This construction variable automatically introduces \fB$_SHLIBVERSIONFLAGS\fR if \fB$SHLIBVERSION\fR is set\&. Othervise it evaluates to an empty string\&. .RE .PP \fBAPPLELINK_COMPATIBILITY_VERSION\fR .RS 4 On Mac OS X this is used to set the linker flag: \-compatibility_version .sp The value is specified as X[\&.Y[\&.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and 255, Z can be omitted or between 1 and 255\&. This value will be derived from \fB$SHLIBVERSION\fR if not specified\&. The lowest digit will be dropped and replaced by a 0\&. .sp If the \fB$APPLELINK_NO_COMPATIBILITY_VERSION\fR is set then no \-compatibility_version will be output\&. .sp See MacOS\*(Aqs ld manpage for more details .RE .PP \fB_APPLELINK_COMPATIBILITY_VERSION\fR .RS 4 A macro (by default a generator function) used to create the linker flags to specify apple\*(Aqs linker\*(Aqs \-compatibility_version flag\&. The default generator uses \fB$APPLELINK_COMPATIBILITY_VERSION\fR and \fB$APPLELINK_NO_COMPATIBILITY_VERSION\fR and \fB$SHLIBVERSION\fR to determine the correct flag\&. .RE .PP \fBAPPLELINK_CURRENT_VERSION\fR .RS 4 On Mac OS X this is used to set the linker flag: \-current_version .sp The value is specified as X[\&.Y[\&.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and 255, Z can be omitted or between 1 and 255\&. This value will be set to \fB$SHLIBVERSION\fR if not specified\&. .sp If the \fB$APPLELINK_NO_CURRENT_VERSION\fR is set then no \-current_version will be output\&. .sp See MacOS\*(Aqs ld manpage for more details .RE .PP \fB_APPLELINK_CURRENT_VERSION\fR .RS 4 A macro (by default a generator function) used to create the linker flags to specify apple\*(Aqs linker\*(Aqs \-current_version flag\&. The default generator uses \fB$APPLELINK_CURRENT_VERSION\fR and \fB$APPLELINK_NO_CURRENT_VERSION\fR and \fB$SHLIBVERSION\fR to determine the correct flag\&. .RE .PP \fBAPPLELINK_NO_COMPATIBILITY_VERSION\fR .RS 4 Set this to any True (1|True|non\-empty string) value to disable adding \-compatibility_version flag when generating versioned shared libraries\&. .sp This overrides \fB$APPLELINK_COMPATIBILITY_VERSION\fR\&. .RE .PP \fBAPPLELINK_NO_CURRENT_VERSION\fR .RS 4 Set this to any True (1|True|non\-empty string) value to disable adding \-current_version flag when generating versioned shared libraries\&. .sp This overrides \fB$APPLELINK_CURRENT_VERSION\fR\&. .RE .PP \fBAR\fR .RS 4 The static library archiver\&. .RE .PP \fBARCHITECTURE\fR .RS 4 Specifies the system architecture for which the package is being built\&. The default is the system architecture of the machine on which SCons is running\&. This is used to fill in the Architecture: field in an Ipkg control file, and the BuildArch: field in the RPM \&.spec file, as well as forming part of the name of a generated RPM package file\&. .RE .PP \fBARCOM\fR .RS 4 The command line used to generate a static library from object files\&. .RE .PP \fBARCOMSTR\fR .RS 4 The string displayed when a static library is generated from object files\&. If this is not set, then \fB$ARCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(ARCOMSTR = "Archiving $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBARFLAGS\fR .RS 4 General options passed to the static library archiver\&. .RE .PP \fBAS\fR .RS 4 The assembler\&. .RE .PP \fBASCOM\fR .RS 4 The command line used to generate an object file from an assembly\-language source file\&. .RE .PP \fBASCOMSTR\fR .RS 4 The string displayed when an object file is generated from an assembly\-language source file\&. If this is not set, then \fB$ASCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(ASCOMSTR = "Assembling $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBASFLAGS\fR .RS 4 General options passed to the assembler\&. .RE .PP \fBASPPCOM\fR .RS 4 The command line used to assemble an assembly\-language source file into an object file after first running the file through the C preprocessor\&. Any options specified in the \fB$ASFLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. .RE .PP \fBASPPCOMSTR\fR .RS 4 The string displayed when an object file is generated from an assembly\-language source file after first running the file through the C preprocessor\&. If this is not set, then \fB$ASPPCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(ASPPCOMSTR = "Assembling $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBASPPFLAGS\fR .RS 4 General options when an assembling an assembly\-language source file into an object file after first running the file through the C preprocessor\&. The default is to use the value of \fB$ASFLAGS\fR\&. .RE .PP \fBBIBTEX\fR .RS 4 The bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. .RE .PP \fBBIBTEXCOM\fR .RS 4 The command line used to call the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. .RE .PP \fBBIBTEXCOMSTR\fR .RS 4 The string displayed when generating a bibliography for TeX or LaTeX\&. If this is not set, then \fB$BIBTEXCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBBIBTEXFLAGS\fR .RS 4 General options passed to the bibliography generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. .RE .PP \fBBUILDERS\fR .RS 4 A dictionary mapping the names of the builders available through this environment to underlying Builder objects\&. Builders named Alias, CFile, CXXFile, DVI, Library, Object, PDF, PostScript, and Program are available by default\&. If you initialize this variable when an Environment is created: .sp .if n \{\ .RS 4 .\} .nf env = Environment(BUILDERS = {\*(AqNewBuilder\*(Aq : foo}) .fi .if n \{\ .RE .\} .sp the default Builders will no longer be available\&. To use a new Builder object in addition to the default Builders, add your new Builder object like this: .sp .if n \{\ .RS 4 .\} .nf env = Environment() env\&.Append(BUILDERS = {\*(AqNewBuilder\*(Aq : foo}) .fi .if n \{\ .RE .\} .sp or this: .sp .if n \{\ .RS 4 .\} .nf env = Environment() env[\*(AqBUILDERS\*(Aq][\*(AqNewBuilder\*(Aq] = foo .fi .if n \{\ .RE .\} .RE .PP \fBCC\fR .RS 4 The C compiler\&. .RE .PP \fBCCCOM\fR .RS 4 The command line used to compile a C source file to a (static) object file\&. Any options specified in the \fB$CFLAGS\fR, \fB$CCFLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. See also \fB$SHCCCOM\fR for compiling to shared objects\&. .RE .PP \fBCCCOMSTR\fR .RS 4 If set, the string displayed when a C source file is compiled to a (static) object file\&. If not set, then \fB$CCCOM\fR (the command line) is displayed\&. See also \fB$SHCCCOMSTR\fR for compiling to shared objects\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(CCCOMSTR = "Compiling static object $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBCCFLAGS\fR .RS 4 General options that are passed to the C and C++ compilers\&. See also \fB$SHCCFLAGS\fR for compiling to shared objects\&. .RE .PP \fBCCPCHFLAGS\fR .RS 4 Options added to the compiler command line to support building with precompiled headers\&. The default value expands expands to the appropriate Microsoft Visual C++ command\-line options when the \fB$PCH\fR construction variable is set\&. .RE .PP \fBCCPDBFLAGS\fR .RS 4 Options added to the compiler command line to support storing debugging information in a Microsoft Visual C++ PDB file\&. The default value expands expands to appropriate Microsoft Visual C++ command\-line options when the \fB$PDB\fR construction variable is set\&. .sp The Visual C++ compiler option that SCons uses by default to generate PDB information is \fB/Z7\fR\&. This works correctly with parallel (\fB\-j\fR) builds because it embeds the debug information in the intermediate object files, as opposed to sharing a single PDB file between multiple object files\&. This is also the only way to get debug information embedded into a static library\&. Using the \fB/Zi\fR instead may yield improved link\-time performance, although parallel builds will no longer work\&. .sp You can generate PDB files with the \fB/Zi\fR switch by overriding the default \fB$CCPDBFLAGS\fR variable as follows: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqCCPDBFLAGS\*(Aq] = [\*(Aq${(PDB and "/Zi /Fd%s" % File(PDB)) or ""}\*(Aq] .fi .if n \{\ .RE .\} .sp An alternative would be to use the \fB/Zi\fR to put the debugging information in a separate \&.pdb file for each object file by overriding the \fB$CCPDBFLAGS\fR variable as follows: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqCCPDBFLAGS\*(Aq] = \*(Aq/Zi /Fd${TARGET}\&.pdb\*(Aq .fi .if n \{\ .RE .\} .RE .PP \fBCCVERSION\fR .RS 4 The version number of the C compiler\&. This may or may not be set, depending on the specific C compiler being used\&. .RE .PP \fBCFILESUFFIX\fR .RS 4 The suffix for C source files\&. This is used by the internal CFile builder when generating C files from Lex (\&.l) or YACC (\&.y) input files\&. The default suffix, of course, is \&.c (lower case)\&. On case\-insensitive systems (like Windows), SCons also treats \&.C (upper case) files as C files\&. .RE .PP \fBCFLAGS\fR .RS 4 General options that are passed to the C compiler (C only; not C++)\&. See also \fB$SHCFLAGS\fR for compiling to shared objects\&. .RE .PP \fBCHANGE_SPECFILE\fR .RS 4 A hook for modifying the file that controls the packaging build (the \&.spec for RPM, the control for Ipkg, the \&.wxs for MSI)\&. If set, the function will be called after the SCons template for the file has been written\&. .RE .PP \fBCHANGED_SOURCES\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBCHANGED_TARGETS\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBCHANGELOG\fR .RS 4 The name of a file containing the change log text to be included in the package\&. This is included as the %changelog section of the RPM \&.spec file\&. .RE .PP \fBCOMPILATIONDB_COMSTR\fR .RS 4 The string displayed when CompilationDatabase builder\*(Aqs action is run\&. .RE .PP \fBCOMPILATIONDB_USE_ABSPATH\fR .RS 4 This is a boolean flag to instruct \fBCompilationDatabase\fR to write the file and target members in the compilation database with absolute or relative paths\&. .sp The default value is False (use relative paths) .RE .PP \fB_concat\fR .RS 4 A function used to produce variables like \fB$_CPPINCFLAGS\fR\&. It takes four or five arguments: a prefix to concatenate onto each element, a list of elements, a suffix to concatenate onto each element, an environment for variable interpolation, and an optional function that will be called to transform the list before concatenation\&. .sp .if n \{\ .RS 4 .\} .nf env[\*(Aq_CPPINCFLAGS\*(Aq] = \*(Aq$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs)} $)\*(Aq, .fi .if n \{\ .RE .\} .RE .PP \fBCONFIGUREDIR\fR .RS 4 The name of the directory in which Configure context test files are written\&. The default is \&.sconf_temp in the top\-level directory containing the SConstruct file\&. .RE .PP \fBCONFIGURELOG\fR .RS 4 The name of the Configure context log file\&. The default is config\&.log in the top\-level directory containing the SConstruct file\&. .RE .PP \fB_CPPDEFFLAGS\fR .RS 4 An automatically\-generated construction variable containing the C preprocessor command\-line options to define values\&. The value of \fB$_CPPDEFFLAGS\fR is created by respectively prepending and appending \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR to the beginning and end of each definition in \fB$CPPDEFINES\fR\&. .RE .PP \fBCPPDEFINES\fR .RS 4 A platform independent specification of C preprocessor definitions\&. The definitions will be added to command lines through the automatically\-generated \fB$_CPPDEFFLAGS\fR construction variable (see above), which is constructed according to the type of value of \fB$CPPDEFINES\fR: .sp If \fB$CPPDEFINES\fR is a string, the values of the \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR construction variables will be respectively prepended and appended to the beginning and end of each definition in \fB$CPPDEFINES\fR\&. .sp .if n \{\ .RS 4 .\} .nf # Will add \-Dxyz to POSIX compiler command lines, # and /Dxyz to Microsoft Visual C++ command lines\&. env = Environment(CPPDEFINES=\*(Aqxyz\*(Aq) .fi .if n \{\ .RE .\} .sp If \fB$CPPDEFINES\fR is a list, the values of the \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR construction variables will be respectively prepended and appended to the beginning and end of each element in the list\&. If any element is a list or tuple, then the first item is the name being defined and the second item is its value: .sp .if n \{\ .RS 4 .\} .nf # Will add \-DB=2 \-DA to POSIX compiler command lines, # and /DB=2 /DA to Microsoft Visual C++ command lines\&. env = Environment(CPPDEFINES=[(\*(AqB\*(Aq, 2), \*(AqA\*(Aq]) .fi .if n \{\ .RE .\} .sp If \fB$CPPDEFINES\fR is a dictionary, the values of the \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR construction variables will be respectively prepended and appended to the beginning and end of each item from the dictionary\&. The key of each dictionary item is a name being defined to the dictionary item\*(Aqs corresponding value; if the value is None, then the name is defined without an explicit value\&. Note that the resulting flags are sorted by keyword to ensure that the order of the options on the command line is consistent each time \fBscons\fR is run\&. .sp .if n \{\ .RS 4 .\} .nf # Will add \-DA \-DB=2 to POSIX compiler command lines, # and /DA /DB=2 to Microsoft Visual C++ command lines\&. env = Environment(CPPDEFINES={\*(AqB\*(Aq:2, \*(AqA\*(Aq:None}) .fi .if n \{\ .RE .\} .RE .PP \fBCPPDEFPREFIX\fR .RS 4 The prefix used to specify preprocessor definitions on the C compiler command line\&. This will be prepended to the beginning of each definition in the \fB$CPPDEFINES\fR construction variable when the \fB$_CPPDEFFLAGS\fR variable is automatically generated\&. .RE .PP \fBCPPDEFSUFFIX\fR .RS 4 The suffix used to specify preprocessor definitions on the C compiler command line\&. This will be appended to the end of each definition in the \fB$CPPDEFINES\fR construction variable when the \fB$_CPPDEFFLAGS\fR variable is automatically generated\&. .RE .PP \fBCPPFLAGS\fR .RS 4 User\-specified C preprocessor options\&. These will be included in any command that uses the C preprocessor, including not just compilation of C and C++ source files via the \fB$CCCOM\fR, \fB$SHCCCOM\fR, \fB$CXXCOM\fR and \fB$SHCXXCOM\fR command lines, but also the \fB$FORTRANPPCOM\fR, \fB$SHFORTRANPPCOM\fR, \fB$F77PPCOM\fR and \fB$SHF77PPCOM\fR command lines used to compile a Fortran source file, and the \fB$ASPPCOM\fR command line used to assemble an assembly language source file, after first running each file through the C preprocessor\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include search path options that scons generates automatically from \fB$CPPPATH\fR\&. See \fB$_CPPINCFLAGS\fR, below, for the variable that expands to those options\&. .RE .PP \fB_CPPINCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the C preprocessor command\-line options for specifying directories to be searched for include files\&. The value of \fB$_CPPINCFLAGS\fR is created by respectively prepending and appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$CPPPATH\fR\&. .RE .PP \fBCPPPATH\fR .RS 4 The list of directories that the C preprocessor will search for include directories\&. The C/C++ implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in CCFLAGS or CXXFLAGS because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in CPPPATH will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: .sp .if n \{\ .RS 4 .\} .nf env = Environment(CPPPATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(CPPPATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_CPPINCFLAGS\fR construction variable, which is constructed by respectively prepending and appending the value of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$CPPPATH\fR\&. Any command lines you define that need the CPPPATH directory list should include \fB$_CPPINCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(CCCOM="my_compiler $_CPPINCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBCPPSUFFIXES\fR .RS 4 The list of suffixes of files that will be scanned for C preprocessor implicit dependencies (#include lines)\&. The default list is: .sp .if n \{\ .RS 4 .\} .nf ["\&.c", "\&.C", "\&.cxx", "\&.cpp", "\&.c++", "\&.cc", "\&.h", "\&.H", "\&.hxx", "\&.hpp", "\&.hh", "\&.F", "\&.fpp", "\&.FPP", "\&.m", "\&.mm", "\&.S", "\&.spp", "\&.SPP"] .fi .if n \{\ .RE .\} .RE .PP \fBCXX\fR .RS 4 The C++ compiler\&. See also \fB$SHCXX\fR for compiling to shared objects\&.\&. .RE .PP \fBCXXCOM\fR .RS 4 The command line used to compile a C++ source file to an object file\&. Any options specified in the \fB$CXXFLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. See also \fB$SHCXXCOM\fR for compiling to shared objects\&.\&. .RE .PP \fBCXXCOMSTR\fR .RS 4 If set, the string displayed when a C++ source file is compiled to a (static) object file\&. If not set, then \fB$CXXCOM\fR (the command line) is displayed\&. See also \fB$SHCXXCOMSTR\fR for compiling to shared objects\&.\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(CXXCOMSTR = "Compiling static object $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBCXXFILESUFFIX\fR .RS 4 The suffix for C++ source files\&. This is used by the internal CXXFile builder when generating C++ files from Lex (\&.ll) or YACC (\&.yy) input files\&. The default suffix is \&.cc\&. SCons also treats files with the suffixes \&.cpp, \&.cxx, \&.c++, and \&.C++ as C++ files, and files with \&.mm suffixes as Objective C++ files\&. On case\-sensitive systems (Linux, UNIX, and other POSIX\-alikes), SCons also treats \&.C (upper case) files as C++ files\&. .RE .PP \fBCXXFLAGS\fR .RS 4 General options that are passed to the C++ compiler\&. By default, this includes the value of \fB$CCFLAGS\fR, so that setting \fB$CCFLAGS\fR affects both C and C++ compilation\&. If you want to add C++\-specific flags, you must set or override the value of \fB$CXXFLAGS\fR\&. See also \fB$SHCXXFLAGS\fR for compiling to shared objects\&.\&. .RE .PP \fBCXXVERSION\fR .RS 4 The version number of the C++ compiler\&. This may or may not be set, depending on the specific C++ compiler being used\&. .RE .PP \fBDC\fR .RS 4 The D compiler to use\&. See also \fB$SHDC\fR for compiling to shared objects\&. .RE .PP \fBDCOM\fR .RS 4 The command line used to compile a D file to an object file\&. Any options specified in the \fB$DFLAGS\fR construction variable is included on this command line\&. See also \fB$SHDCOM\fR for compiling to shared objects\&. .RE .PP \fBDCOMSTR\fR .RS 4 If set, the string displayed when a D source file is compiled to a (static) object file\&. If not set, then \fB$DCOM\fR (the command line) is displayed\&. See also \fB$SHDCOMSTR\fR for compiling to shared objects\&. .RE .PP \fBDDEBUG\fR .RS 4 List of debug tags to enable when compiling\&. .RE .PP \fBDDEBUGPREFIX\fR .RS 4 DDEBUGPREFIX\&. .RE .PP \fBDDEBUGSUFFIX\fR .RS 4 DDEBUGSUFFIX\&. .RE .PP \fBDESCRIPTION\fR .RS 4 A long description of the project being packaged\&. This is included in the relevant section of the file that controls the packaging build\&. .RE .PP \fBDESCRIPTION_lang\fR .RS 4 A language\-specific long description for the specified \fIlang\fR\&. This is used to populate a %description \-l section of an RPM \&.spec file\&. .RE .PP \fBDFILESUFFIX\fR .RS 4 DFILESUFFIX\&. .RE .PP \fBDFLAGPREFIX\fR .RS 4 DFLAGPREFIX\&. .RE .PP \fBDFLAGS\fR .RS 4 General options that are passed to the D compiler\&. .RE .PP \fBDFLAGSUFFIX\fR .RS 4 DFLAGSUFFIX\&. .RE .PP \fBDINCPREFIX\fR .RS 4 DINCPREFIX\&. .RE .PP \fBDINCSUFFIX\fR .RS 4 DLIBFLAGSUFFIX\&. .RE .PP \fBDir\fR .RS 4 A function that converts a string into a Dir instance relative to the target being built\&. .RE .PP \fBDirs\fR .RS 4 A function that converts a list of strings into a list of Dir instances relative to the target being built\&. .RE .PP \fBDLIB\fR .RS 4 Name of the lib tool to use for D codes\&. .RE .PP \fBDLIBCOM\fR .RS 4 The command line to use when creating libraries\&. .RE .PP \fBDLIBDIRPREFIX\fR .RS 4 DLIBLINKPREFIX\&. .RE .PP \fBDLIBDIRSUFFIX\fR .RS 4 DLIBLINKSUFFIX\&. .RE .PP \fBDLIBFLAGPREFIX\fR .RS 4 DLIBFLAGPREFIX\&. .RE .PP \fBDLIBFLAGSUFFIX\fR .RS 4 DLIBFLAGSUFFIX\&. .RE .PP \fBDLIBLINKPREFIX\fR .RS 4 DLIBLINKPREFIX\&. .RE .PP \fBDLIBLINKSUFFIX\fR .RS 4 DLIBLINKSUFFIX\&. .RE .PP \fBDLINK\fR .RS 4 Name of the linker to use for linking systems including D sources\&. See also \fB$SHDLINK\fR for linking shared objects\&. .RE .PP \fBDLINKCOM\fR .RS 4 The command line to use when linking systems including D sources\&. See also \fB$SHDLINKCOM\fR for linking shared objects\&. .RE .PP \fBDLINKFLAGPREFIX\fR .RS 4 DLINKFLAGPREFIX\&. .RE .PP \fBDLINKFLAGS\fR .RS 4 List of linker flags\&. See also \fB$SHDLINKFLAGS\fR for linking shared objects\&. .RE .PP \fBDLINKFLAGSUFFIX\fR .RS 4 DLINKFLAGSUFFIX\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_EPUB\fR .RS 4 The default XSLT file for the \fBDocbookEpub\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_HTML\fR .RS 4 The default XSLT file for the \fBDocbookHtml\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_HTMLCHUNKED\fR .RS 4 The default XSLT file for the \fBDocbookHtmlChunked\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_HTMLHELP\fR .RS 4 The default XSLT file for the \fBDocbookHtmlhelp\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_MAN\fR .RS 4 The default XSLT file for the \fBDocbookMan\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_PDF\fR .RS 4 The default XSLT file for the \fBDocbookPdf\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_SLIDESHTML\fR .RS 4 The default XSLT file for the \fBDocbookSlidesHtml\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_DEFAULT_XSL_SLIDESPDF\fR .RS 4 The default XSLT file for the \fBDocbookSlidesPdf\fR builder within the current environment, if no other XSLT gets specified via keyword\&. .RE .PP \fBDOCBOOK_FOP\fR .RS 4 The path to the PDF renderer fop or xep, if one of them is installed (fop gets checked first)\&. .RE .PP \fBDOCBOOK_FOPCOM\fR .RS 4 The full command\-line for the PDF renderer fop or xep\&. .RE .PP \fBDOCBOOK_FOPCOMSTR\fR .RS 4 The string displayed when a renderer like fop or xep is used to create PDF output from an XML file\&. .RE .PP \fBDOCBOOK_FOPFLAGS\fR .RS 4 Additonal command\-line flags for the PDF renderer fop or xep\&. .RE .PP \fBDOCBOOK_XMLLINT\fR .RS 4 The path to the external executable xmllint, if it\*(Aqs installed\&. Note, that this is only used as last fallback for resolving XIncludes, if no lxml Python binding can be imported in the current system\&. .RE .PP \fBDOCBOOK_XMLLINTCOM\fR .RS 4 The full command\-line for the external executable xmllint\&. .RE .PP \fBDOCBOOK_XMLLINTCOMSTR\fR .RS 4 The string displayed when xmllint is used to resolve XIncludes for a given XML file\&. .RE .PP \fBDOCBOOK_XMLLINTFLAGS\fR .RS 4 Additonal command\-line flags for the external executable xmllint\&. .RE .PP \fBDOCBOOK_XSLTPROC\fR .RS 4 The path to the external executable xsltproc (or saxon, xalan), if one of them is installed\&. Note, that this is only used as last fallback for XSL transformations, if no lxml Python binding can be imported in the current system\&. .RE .PP \fBDOCBOOK_XSLTPROCCOM\fR .RS 4 The full command\-line for the external executable xsltproc (or saxon, xalan)\&. .RE .PP \fBDOCBOOK_XSLTPROCCOMSTR\fR .RS 4 The string displayed when xsltproc is used to transform an XML file via a given XSLT stylesheet\&. .RE .PP \fBDOCBOOK_XSLTPROCFLAGS\fR .RS 4 Additonal command\-line flags for the external executable xsltproc (or saxon, xalan)\&. .RE .PP \fBDOCBOOK_XSLTPROCPARAMS\fR .RS 4 Additonal parameters that are not intended for the XSLT processor executable, but the XSL processing itself\&. By default, they get appended at the end of the command line for saxon and saxon\-xslt, respectively\&. .RE .PP \fBDPATH\fR .RS 4 List of paths to search for import modules\&. .RE .PP \fBDRPATHPREFIX\fR .RS 4 DRPATHPREFIX\&. .RE .PP \fBDRPATHSUFFIX\fR .RS 4 DRPATHSUFFIX\&. .RE .PP \fBDShLibSonameGenerator\fR .RS 4 DShLibSonameGenerator\&. .RE .PP \fBDSUFFIXES\fR .RS 4 The list of suffixes of files that will be scanned for imported D package files\&. The default list is [\*(Aq\&.d\*(Aq]\&. .RE .PP \fBDVERPREFIX\fR .RS 4 DVERPREFIX\&. .RE .PP \fBDVERSIONS\fR .RS 4 List of version tags to enable when compiling\&. .RE .PP \fBDVERSUFFIX\fR .RS 4 DVERSUFFIX\&. .RE .PP \fBDVIPDF\fR .RS 4 The TeX DVI file to PDF file converter\&. .RE .PP \fBDVIPDFCOM\fR .RS 4 The command line used to convert TeX DVI files into a PDF file\&. .RE .PP \fBDVIPDFCOMSTR\fR .RS 4 The string displayed when a TeX DVI file is converted into a PDF file\&. If this is not set, then \fB$DVIPDFCOM\fR (the command line) is displayed\&. .RE .PP \fBDVIPDFFLAGS\fR .RS 4 General options passed to the TeX DVI file to PDF file converter\&. .RE .PP \fBDVIPS\fR .RS 4 The TeX DVI file to PostScript converter\&. .RE .PP \fBDVIPSFLAGS\fR .RS 4 General options passed to the TeX DVI file to PostScript converter\&. .RE .PP \fBENV\fR .RS 4 A dictionary of environment variables to use when invoking commands\&. When \fB$ENV\fR is used in a command all list values will be joined using the path separator and any other non\-string values will simply be coerced to a string\&. Note that, by default, \fBscons\fR does \fInot\fR propagate the environment in force when you execute \fBscons\fR to the commands used to build target files\&. This is so that builds will be guaranteed repeatable regardless of the environment variables set at the time \fBscons\fR is invoked\&. .sp If you want to propagate your environment variables to the commands executed to build target files, you must do so explicitly: .sp .if n \{\ .RS 4 .\} .nf import os env = Environment(ENV = os\&.environ) .fi .if n \{\ .RE .\} .sp Note that you can choose only to propagate certain environment variables\&. A common example is the system \fBPATH\fR environment variable, so that \fBscons\fR uses the same utilities as the invoking shell (or other process): .sp .if n \{\ .RS 4 .\} .nf import os env = Environment(ENV = {\*(AqPATH\*(Aq : os\&.environ[\*(AqPATH\*(Aq]}) .fi .if n \{\ .RE .\} .RE .PP \fBESCAPE\fR .RS 4 A function that will be called to escape shell special characters in command lines\&. The function should take one argument: the command line string to escape; and should return the escaped command line\&. .RE .PP \fBF03\fR .RS 4 The Fortran 03 compiler\&. You should normally set the \fB$FORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$F03\fR if you need to use a specific compiler or compiler version for Fortran 03 files\&. .RE .PP \fBF03COM\fR .RS 4 The command line used to compile a Fortran 03 source file to an object file\&. You only need to set \fB$F03COM\fR if you need to use a specific command line for Fortran 03 files\&. You should normally set the \fB$FORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBF03COMSTR\fR .RS 4 If set, the string displayed when a Fortran 03 source file is compiled to an object file\&. If not set, then \fB$F03COM\fR or \fB$FORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBF03FILESUFFIXES\fR .RS 4 The list of file extensions for which the F03 dialect will be used\&. By default, this is [\*(Aq\&.f03\*(Aq] .RE .PP \fBF03FLAGS\fR .RS 4 General user\-specified options that are passed to the Fortran 03 compiler\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include search path options that scons generates automatically from \fB$F03PATH\fR\&. See \fB$_F03INCFLAGS\fR below, for the variable that expands to those options\&. You only need to set \fB$F03FLAGS\fR if you need to define specific user options for Fortran 03 files\&. You should normally set the \fB$FORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fB_F03INCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the Fortran 03 compiler command\-line options for specifying directories to be searched for include files\&. The value of \fB$_F03INCFLAGS\fR is created by appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$F03PATH\fR\&. .RE .PP \fBF03PATH\fR .RS 4 The list of directories that the Fortran 03 compiler will search for include directories\&. The implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in \fB$F03FLAGS\fR because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in \fB$F03PATH\fR will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: You only need to set \fB$F03PATH\fR if you need to define a specific include path for Fortran 03 files\&. You should normally set the \fB$FORTRANPATH\fR variable, which specifies the include path for the default Fortran compiler for all Fortran versions\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(F03PATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(F03PATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_F03INCFLAGS\fR construction variable, which is constructed by appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$F03PATH\fR\&. Any command lines you define that need the F03PATH directory list should include \fB$_F03INCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(F03COM="my_compiler $_F03INCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBF03PPCOM\fR .RS 4 The command line used to compile a Fortran 03 source file to an object file after first running the file through the C preprocessor\&. Any options specified in the \fB$F03FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$F03PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 03 files\&. You should normally set the \fB$FORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBF03PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 03 source file is compiled to an object file after first running the file through the C preprocessor\&. If not set, then \fB$F03PPCOM\fR or \fB$FORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBF03PPFILESUFFIXES\fR .RS 4 The list of file extensions for which the compilation + preprocessor pass for F03 dialect will be used\&. By default, this is empty .RE .PP \fBF08\fR .RS 4 The Fortran 08 compiler\&. You should normally set the \fB$FORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$F08\fR if you need to use a specific compiler or compiler version for Fortran 08 files\&. .RE .PP \fBF08COM\fR .RS 4 The command line used to compile a Fortran 08 source file to an object file\&. You only need to set \fB$F08COM\fR if you need to use a specific command line for Fortran 08 files\&. You should normally set the \fB$FORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBF08COMSTR\fR .RS 4 If set, the string displayed when a Fortran 08 source file is compiled to an object file\&. If not set, then \fB$F08COM\fR or \fB$FORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBF08FILESUFFIXES\fR .RS 4 The list of file extensions for which the F08 dialect will be used\&. By default, this is [\*(Aq\&.f08\*(Aq] .RE .PP \fBF08FLAGS\fR .RS 4 General user\-specified options that are passed to the Fortran 08 compiler\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include search path options that scons generates automatically from \fB$F08PATH\fR\&. See \fB$_F08INCFLAGS\fR below, for the variable that expands to those options\&. You only need to set \fB$F08FLAGS\fR if you need to define specific user options for Fortran 08 files\&. You should normally set the \fB$FORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fB_F08INCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the Fortran 08 compiler command\-line options for specifying directories to be searched for include files\&. The value of \fB$_F08INCFLAGS\fR is created by appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$F08PATH\fR\&. .RE .PP \fBF08PATH\fR .RS 4 The list of directories that the Fortran 08 compiler will search for include directories\&. The implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in \fB$F08FLAGS\fR because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in \fB$F08PATH\fR will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: You only need to set \fB$F08PATH\fR if you need to define a specific include path for Fortran 08 files\&. You should normally set the \fB$FORTRANPATH\fR variable, which specifies the include path for the default Fortran compiler for all Fortran versions\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(F08PATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(F08PATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_F08INCFLAGS\fR construction variable, which is constructed by appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$F08PATH\fR\&. Any command lines you define that need the F08PATH directory list should include \fB$_F08INCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(F08COM="my_compiler $_F08INCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBF08PPCOM\fR .RS 4 The command line used to compile a Fortran 08 source file to an object file after first running the file through the C preprocessor\&. Any options specified in the \fB$F08FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$F08PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 08 files\&. You should normally set the \fB$FORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBF08PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 08 source file is compiled to an object file after first running the file through the C preprocessor\&. If not set, then \fB$F08PPCOM\fR or \fB$FORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBF08PPFILESUFFIXES\fR .RS 4 The list of file extensions for which the compilation + preprocessor pass for F08 dialect will be used\&. By default, this is empty .RE .PP \fBF77\fR .RS 4 The Fortran 77 compiler\&. You should normally set the \fB$FORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$F77\fR if you need to use a specific compiler or compiler version for Fortran 77 files\&. .RE .PP \fBF77COM\fR .RS 4 The command line used to compile a Fortran 77 source file to an object file\&. You only need to set \fB$F77COM\fR if you need to use a specific command line for Fortran 77 files\&. You should normally set the \fB$FORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBF77COMSTR\fR .RS 4 If set, the string displayed when a Fortran 77 source file is compiled to an object file\&. If not set, then \fB$F77COM\fR or \fB$FORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBF77FILESUFFIXES\fR .RS 4 The list of file extensions for which the F77 dialect will be used\&. By default, this is [\*(Aq\&.f77\*(Aq] .RE .PP \fBF77FLAGS\fR .RS 4 General user\-specified options that are passed to the Fortran 77 compiler\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include search path options that scons generates automatically from \fB$F77PATH\fR\&. See \fB$_F77INCFLAGS\fR below, for the variable that expands to those options\&. You only need to set \fB$F77FLAGS\fR if you need to define specific user options for Fortran 77 files\&. You should normally set the \fB$FORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fB_F77INCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the Fortran 77 compiler command\-line options for specifying directories to be searched for include files\&. The value of \fB$_F77INCFLAGS\fR is created by appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$F77PATH\fR\&. .RE .PP \fBF77PATH\fR .RS 4 The list of directories that the Fortran 77 compiler will search for include directories\&. The implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in \fB$F77FLAGS\fR because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in \fB$F77PATH\fR will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: You only need to set \fB$F77PATH\fR if you need to define a specific include path for Fortran 77 files\&. You should normally set the \fB$FORTRANPATH\fR variable, which specifies the include path for the default Fortran compiler for all Fortran versions\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(F77PATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(F77PATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_F77INCFLAGS\fR construction variable, which is constructed by appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$F77PATH\fR\&. Any command lines you define that need the F77PATH directory list should include \fB$_F77INCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(F77COM="my_compiler $_F77INCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBF77PPCOM\fR .RS 4 The command line used to compile a Fortran 77 source file to an object file after first running the file through the C preprocessor\&. Any options specified in the \fB$F77FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$F77PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 77 files\&. You should normally set the \fB$FORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBF77PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 77 source file is compiled to an object file after first running the file through the C preprocessor\&. If not set, then \fB$F77PPCOM\fR or \fB$FORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBF77PPFILESUFFIXES\fR .RS 4 The list of file extensions for which the compilation + preprocessor pass for F77 dialect will be used\&. By default, this is empty .RE .PP \fBF90\fR .RS 4 The Fortran 90 compiler\&. You should normally set the \fB$FORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$F90\fR if you need to use a specific compiler or compiler version for Fortran 90 files\&. .RE .PP \fBF90COM\fR .RS 4 The command line used to compile a Fortran 90 source file to an object file\&. You only need to set \fB$F90COM\fR if you need to use a specific command line for Fortran 90 files\&. You should normally set the \fB$FORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBF90COMSTR\fR .RS 4 If set, the string displayed when a Fortran 90 source file is compiled to an object file\&. If not set, then \fB$F90COM\fR or \fB$FORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBF90FILESUFFIXES\fR .RS 4 The list of file extensions for which the F90 dialect will be used\&. By default, this is [\*(Aq\&.f90\*(Aq] .RE .PP \fBF90FLAGS\fR .RS 4 General user\-specified options that are passed to the Fortran 90 compiler\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include search path options that scons generates automatically from \fB$F90PATH\fR\&. See \fB$_F90INCFLAGS\fR below, for the variable that expands to those options\&. You only need to set \fB$F90FLAGS\fR if you need to define specific user options for Fortran 90 files\&. You should normally set the \fB$FORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fB_F90INCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the Fortran 90 compiler command\-line options for specifying directories to be searched for include files\&. The value of \fB$_F90INCFLAGS\fR is created by appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$F90PATH\fR\&. .RE .PP \fBF90PATH\fR .RS 4 The list of directories that the Fortran 90 compiler will search for include directories\&. The implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in \fB$F90FLAGS\fR because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in \fB$F90PATH\fR will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: You only need to set \fB$F90PATH\fR if you need to define a specific include path for Fortran 90 files\&. You should normally set the \fB$FORTRANPATH\fR variable, which specifies the include path for the default Fortran compiler for all Fortran versions\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(F90PATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(F90PATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_F90INCFLAGS\fR construction variable, which is constructed by appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$F90PATH\fR\&. Any command lines you define that need the F90PATH directory list should include \fB$_F90INCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(F90COM="my_compiler $_F90INCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBF90PPCOM\fR .RS 4 The command line used to compile a Fortran 90 source file to an object file after first running the file through the C preprocessor\&. Any options specified in the \fB$F90FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$F90PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 90 files\&. You should normally set the \fB$FORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBF90PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 90 source file is compiled after first running the file through the C preprocessor\&. If not set, then \fB$F90PPCOM\fR or \fB$FORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBF90PPFILESUFFIXES\fR .RS 4 The list of file extensions for which the compilation + preprocessor pass for F90 dialect will be used\&. By default, this is empty .RE .PP \fBF95\fR .RS 4 The Fortran 95 compiler\&. You should normally set the \fB$FORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$F95\fR if you need to use a specific compiler or compiler version for Fortran 95 files\&. .RE .PP \fBF95COM\fR .RS 4 The command line used to compile a Fortran 95 source file to an object file\&. You only need to set \fB$F95COM\fR if you need to use a specific command line for Fortran 95 files\&. You should normally set the \fB$FORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBF95COMSTR\fR .RS 4 If set, the string displayed when a Fortran 95 source file is compiled to an object file\&. If not set, then \fB$F95COM\fR or \fB$FORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBF95FILESUFFIXES\fR .RS 4 The list of file extensions for which the F95 dialect will be used\&. By default, this is [\*(Aq\&.f95\*(Aq] .RE .PP \fBF95FLAGS\fR .RS 4 General user\-specified options that are passed to the Fortran 95 compiler\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include search path options that scons generates automatically from \fB$F95PATH\fR\&. See \fB$_F95INCFLAGS\fR below, for the variable that expands to those options\&. You only need to set \fB$F95FLAGS\fR if you need to define specific user options for Fortran 95 files\&. You should normally set the \fB$FORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fB_F95INCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the Fortran 95 compiler command\-line options for specifying directories to be searched for include files\&. The value of \fB$_F95INCFLAGS\fR is created by appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$F95PATH\fR\&. .RE .PP \fBF95PATH\fR .RS 4 The list of directories that the Fortran 95 compiler will search for include directories\&. The implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in \fB$F95FLAGS\fR because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in \fB$F95PATH\fR will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: You only need to set \fB$F95PATH\fR if you need to define a specific include path for Fortran 95 files\&. You should normally set the \fB$FORTRANPATH\fR variable, which specifies the include path for the default Fortran compiler for all Fortran versions\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(F95PATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(F95PATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_F95INCFLAGS\fR construction variable, which is constructed by appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$F95PATH\fR\&. Any command lines you define that need the F95PATH directory list should include \fB$_F95INCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(F95COM="my_compiler $_F95INCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBF95PPCOM\fR .RS 4 The command line used to compile a Fortran 95 source file to an object file after first running the file through the C preprocessor\&. Any options specified in the \fB$F95FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$F95PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 95 files\&. You should normally set the \fB$FORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBF95PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 95 source file is compiled to an object file after first running the file through the C preprocessor\&. If not set, then \fB$F95PPCOM\fR or \fB$FORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBF95PPFILESUFFIXES\fR .RS 4 The list of file extensions for which the compilation + preprocessor pass for F95 dialect will be used\&. By default, this is empty .RE .PP \fBFile\fR .RS 4 A function that converts a string into a File instance relative to the target being built\&. .RE .PP \fBFORTRAN\fR .RS 4 The default Fortran compiler for all versions of Fortran\&. .RE .PP \fBFORTRANCOM\fR .RS 4 The command line used to compile a Fortran source file to an object file\&. By default, any options specified in the \fB$FORTRANFLAGS\fR, \fB$CPPFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_FORTRANMODFLAG\fR, and \fB$_FORTRANINCFLAGS\fR construction variables are included on this command line\&. .RE .PP \fBFORTRANCOMSTR\fR .RS 4 If set, the string displayed when a Fortran source file is compiled to an object file\&. If not set, then \fB$FORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBFORTRANFILESUFFIXES\fR .RS 4 The list of file extensions for which the FORTRAN dialect will be used\&. By default, this is [\*(Aq\&.f\*(Aq, \*(Aq\&.for\*(Aq, \*(Aq\&.ftn\*(Aq] .RE .PP \fBFORTRANFLAGS\fR .RS 4 General user\-specified options that are passed to the Fortran compiler\&. Note that this variable does \fInot\fR contain \fB\-I\fR (or similar) include or module search path options that scons generates automatically from \fB$FORTRANPATH\fR\&. See \fB$_FORTRANINCFLAGS\fR and \fB$_FORTRANMODFLAG\fR, below, for the variables that expand those options\&. .RE .PP \fB_FORTRANINCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the Fortran compiler command\-line options for specifying directories to be searched for include files and module files\&. The value of \fB$_FORTRANINCFLAGS\fR is created by respectively prepending and appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR to the beginning and end of each directory in \fB$FORTRANPATH\fR\&. .RE .PP \fBFORTRANMODDIR\fR .RS 4 Directory location where the Fortran compiler should place any module files it generates\&. This variable is empty, by default\&. Some Fortran compilers will internally append this directory in the search path for module files, as well\&. .RE .PP \fBFORTRANMODDIRPREFIX\fR .RS 4 The prefix used to specify a module directory on the Fortran compiler command line\&. This will be prepended to the beginning of the directory in the \fB$FORTRANMODDIR\fR construction variables when the \fB$_FORTRANMODFLAG\fR variables is automatically generated\&. .RE .PP \fBFORTRANMODDIRSUFFIX\fR .RS 4 The suffix used to specify a module directory on the Fortran compiler command line\&. This will be appended to the end of the directory in the \fB$FORTRANMODDIR\fR construction variables when the \fB$_FORTRANMODFLAG\fR variables is automatically generated\&. .RE .PP \fB_FORTRANMODFLAG\fR .RS 4 An automatically\-generated construction variable containing the Fortran compiler command\-line option for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation\&. The value of \fB$_FORTRANMODFLAG\fR is created by respectively prepending and appending \fB$FORTRANMODDIRPREFIX\fR and \fB$FORTRANMODDIRSUFFIX\fR to the beginning and end of the directory in \fB$FORTRANMODDIR\fR\&. .RE .PP \fBFORTRANMODPREFIX\fR .RS 4 The module file prefix used by the Fortran compiler\&. SCons assumes that the Fortran compiler follows the quasi\-standard naming convention for module files of module_name\&.mod\&. As a result, this variable is left empty, by default\&. For situations in which the compiler does not necessarily follow the normal convention, the user may use this variable\&. Its value will be appended to every module file name as scons attempts to resolve dependencies\&. .RE .PP \fBFORTRANMODSUFFIX\fR .RS 4 The module file suffix used by the Fortran compiler\&. SCons assumes that the Fortran compiler follows the quasi\-standard naming convention for module files of module_name\&.mod\&. As a result, this variable is set to "\&.mod", by default\&. For situations in which the compiler does not necessarily follow the normal convention, the user may use this variable\&. Its value will be appended to every module file name as scons attempts to resolve dependencies\&. .RE .PP \fBFORTRANPATH\fR .RS 4 The list of directories that the Fortran compiler will search for include files and (for some compilers) module files\&. The Fortran implicit dependency scanner will search these directories for include files (but not module files since they are autogenerated and, as such, may not actually exist at the time the scan takes place)\&. Don\*(Aqt explicitly put include directory arguments in FORTRANFLAGS because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in FORTRANPATH will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: .sp .if n \{\ .RS 4 .\} .nf env = Environment(FORTRANPATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(FORTRANPATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_FORTRANINCFLAGS\fR construction variable, which is constructed by respectively prepending and appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$FORTRANPATH\fR\&. Any command lines you define that need the FORTRANPATH directory list should include \fB$_FORTRANINCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(FORTRANCOM="my_compiler $_FORTRANINCFLAGS \-c \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBFORTRANPPCOM\fR .RS 4 The command line used to compile a Fortran source file to an object file after first running the file through the C preprocessor\&. By default, any options specified in the \fB$FORTRANFLAGS\fR, \fB$CPPFLAGS\fR, \fB$_CPPDEFFLAGS\fR, \fB$_FORTRANMODFLAG\fR, and \fB$_FORTRANINCFLAGS\fR construction variables are included on this command line\&. .RE .PP \fBFORTRANPPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran source file is compiled to an object file after first running the file through the C preprocessor\&. If not set, then \fB$FORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBFORTRANPPFILESUFFIXES\fR .RS 4 The list of file extensions for which the compilation + preprocessor pass for FORTRAN dialect will be used\&. By default, this is [\*(Aq\&.fpp\*(Aq, \*(Aq\&.FPP\*(Aq] .RE .PP \fBFORTRANSUFFIXES\fR .RS 4 The list of suffixes of files that will be scanned for Fortran implicit dependencies (INCLUDE lines and USE statements)\&. The default list is: .sp .if n \{\ .RS 4 .\} .nf ["\&.f", "\&.F", "\&.for", "\&.FOR", "\&.ftn", "\&.FTN", "\&.fpp", "\&.FPP", "\&.f77", "\&.F77", "\&.f90", "\&.F90", "\&.f95", "\&.F95"] .fi .if n \{\ .RE .\} .RE .PP \fBFRAMEWORKPATH\fR .RS 4 On Mac OS X with gcc, a list containing the paths to search for frameworks\&. Used by the compiler to find framework\-style includes like #include \&. Used by the linker to find user\-specified frameworks when linking (see \fB$FRAMEWORKS\fR)\&. For example: .sp .if n \{\ .RS 4 .\} .nf env\&.AppendUnique(FRAMEWORKPATH=\*(Aq#myframeworkdir\*(Aq) .fi .if n \{\ .RE .\} .sp will add .sp .if n \{\ .RS 4 .\} .nf \&.\&.\&. \-Fmyframeworkdir .fi .if n \{\ .RE .\} .sp to the compiler and linker command lines\&. .RE .PP \fB_FRAMEWORKPATH\fR .RS 4 On Mac OS X with gcc, an automatically\-generated construction variable containing the linker command\-line options corresponding to \fB$FRAMEWORKPATH\fR\&. .RE .PP \fBFRAMEWORKPATHPREFIX\fR .RS 4 On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries\&. (see \fB$FRAMEWORKPATH\fR)\&. The default value is \fB\-F\fR\&. .RE .PP \fBFRAMEWORKPREFIX\fR .RS 4 On Mac OS X with gcc, the prefix to be used for linking in frameworks (see \fB$FRAMEWORKS\fR)\&. The default value is \fB\-framework\fR\&. .RE .PP \fBFRAMEWORKS\fR .RS 4 On Mac OS X with gcc, a list of the framework names to be linked into a program or shared library or bundle\&. The default value is the empty list\&. For example: .sp .if n \{\ .RS 4 .\} .nf env\&.AppendUnique(FRAMEWORKS=Split(\*(AqSystem Cocoa SystemConfiguration\*(Aq)) .fi .if n \{\ .RE .\} .RE .PP \fB_FRAMEWORKS\fR .RS 4 On Mac OS X with gcc, an automatically\-generated construction variable containing the linker command\-line options for linking with FRAMEWORKS\&. .RE .PP \fBFRAMEWORKSFLAGS\fR .RS 4 On Mac OS X with gcc, general user\-supplied frameworks options to be added at the end of a command line building a loadable module\&. (This has been largely superseded by the \fB$FRAMEWORKPATH\fR, \fB$FRAMEWORKPATHPREFIX\fR, \fB$FRAMEWORKPREFIX\fR and \fB$FRAMEWORKS\fR variables described above\&.) .RE .PP \fBGS\fR .RS 4 The Ghostscript program used, e\&.g\&. to convert PostScript to PDF files\&. .RE .PP \fBGSCOM\fR .RS 4 The full Ghostscript command line used for the conversion process\&. Its default value is \(lq$GS $GSFLAGS \-sOutputFile=$TARGET $SOURCES\(rq\&. .RE .PP \fBGSCOMSTR\fR .RS 4 The string displayed when Ghostscript is called for the conversion process\&. If this is not set (the default), then \fB$GSCOM\fR (the command line) is displayed\&. .RE .PP \fBGSFLAGS\fR .RS 4 General options passed to the Ghostscript program, when converting PostScript to PDF files for example\&. Its default value is \(lq\-dNOPAUSE \-dBATCH \-sDEVICE=pdfwrite\(rq .RE .PP \fBHOST_ARCH\fR .RS 4 The name of the host hardware architecture used to create the Environment\&. If a platform is specified when creating the Environment, then that Platform\*(Aqs logic will handle setting this value\&. This value is immutable, and should not be changed by the user after the Environment is initialized\&. Currently only set for Win32\&. .sp Sets the host architecture for Visual Studio compiler\&. If not set, default to the detected host architecture: note that this may depend on the python you are using\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. .sp Valid values are the same as for \fB$TARGET_ARCH\fR\&. .sp This is currently only used on Windows, but in the future it may be used on other OSes as well\&. .RE .PP \fBHOST_OS\fR .RS 4 The name of the host operating system used to create the Environment\&. If a platform is specified when creating the Environment, then that Platform\*(Aqs logic will handle setting this value\&. This value is immutable, and should not be changed by the user after the Environment is initialized\&. Currently only set for Win32\&. .RE .PP \fBIDLSUFFIXES\fR .RS 4 The list of suffixes of files that will be scanned for IDL implicit dependencies (#include or import lines)\&. The default list is: .sp .if n \{\ .RS 4 .\} .nf ["\&.idl", "\&.IDL"] .fi .if n \{\ .RE .\} .RE .PP \fBIMPLIBNOVERSIONSYMLINKS\fR .RS 4 Used to override \fB$SHLIBNOVERSIONSYMLINKS\fR/\fB$LDMODULENOVERSIONSYMLINKS\fR when creating versioned import library for a shared library/loadable module\&. If not defined, then \fB$SHLIBNOVERSIONSYMLINKS\fR/\fB$LDMODULENOVERSIONSYMLINKS\fR is used to determine whether to disable symlink generation or not\&. .RE .PP \fBIMPLIBPREFIX\fR .RS 4 The prefix used for import library names\&. For example, cygwin uses import libraries (libfoo\&.dll\&.a) in pair with dynamic libraries (cygfoo\&.dll)\&. The cyglink linker sets \fB$IMPLIBPREFIX\fR to \*(Aqlib\*(Aq and \fB$SHLIBPREFIX\fR to \*(Aqcyg\*(Aq\&. .RE .PP \fBIMPLIBSUFFIX\fR .RS 4 The suffix used for import library names\&. For example, cygwin uses import libraries (libfoo\&.dll\&.a) in pair with dynamic libraries (cygfoo\&.dll)\&. The cyglink linker sets \fB$IMPLIBSUFFIX\fR to \*(Aq\&.dll\&.a\*(Aq and \fB$SHLIBSUFFIX\fR to \*(Aq\&.dll\*(Aq\&. .RE .PP \fBIMPLIBVERSION\fR .RS 4 Used to override \fB$SHLIBVERSION\fR/\fB$LDMODULEVERSION\fR when generating versioned import library for a shared library/loadable module\&. If undefined, the \fB$SHLIBVERSION\fR/\fB$LDMODULEVERSION\fR is used to determine the version of versioned import library\&. .RE .PP \fBIMPLICIT_COMMAND_DEPENDENCIES\fR .RS 4 Controls whether or not SCons will add implicit dependencies for the commands executed to build targets\&. .sp By default, SCons will add to each target an implicit dependency on the command represented by the first argument of any command line it executes (which is typically the command itself)\&. By setting such a dependency, SCons can determine that a target should be rebuilt if the command changes, such as when a compiler is upgraded to a new version\&. The specific file for the dependency is found by searching the \fIPATH\fR variable in the \fIENV\fR dictionary in the construction environment used to execute the command\&. The default is the same as setting the construction variable \fB$IMPLICIT_COMMAND_DEPENDENCIES\fR to a True\-like value (\(lqtrue\(rq, \(lqyes\(rq, or \(lq1\(rq \- but not a number greater than one, as that has a different meaning)\&. .sp Action strings can be segmented by the use of an AND operator, &&\&. In a segemented string, each segment is a separate \(lqcommand line\(rq, these are run sequentially until one fails or the entire sequence has been executed\&. If an action string is segmented, then the selected behavior of \fB$IMPLICIT_COMMAND_DEPENDENCIES\fR is applied to each segment\&. .sp If \fB$IMPLICIT_COMMAND_DEPENDENCIES\fR is set to a False\-like value (\(lqnone\(rq, \(lqfalse\(rq, \(lqno\(rq, \(lq0\(rq, etc\&.), then the implicit dependency will not be added to the targets built with that construction environment\&. .sp If \fB$IMPLICIT_COMMAND_DEPENDENCIES\fR is set to \(lq2\(rq or higher, then that number of arguments in the command line will be scanned for relative or absolute paths\&. If any are present, they will be added as implicit dependencies to the targets built with that construction environment\&. The first argument in the command line will be searched for using the \fIPATH\fR variable in the \fIENV\fR dictionary in the construction environment used to execute the command\&. The other arguments will only be found if they are absolute paths or valid paths relative to the working directory\&. .sp If \fB$IMPLICIT_COMMAND_DEPENDENCIES\fR is set to \(lqall\(rq, then all arguments in the command line will be scanned for relative or absolute paths\&. If any are present, they will be added as implicit dependencies to the targets built with that construction environment\&. The first argument in the command line will be searched for using the \fIPATH\fR variable in the \fIENV\fR dictionary in the construction environment used to execute the command\&. The other arguments will only be found if they are absolute paths or valid paths relative to the working directory\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(IMPLICIT_COMMAND_DEPENDENCIES=False) .fi .if n \{\ .RE .\} .RE .PP \fBINCPREFIX\fR .RS 4 The prefix used to specify an include directory on the C compiler command line\&. This will be prepended to the beginning of each directory in the \fB$CPPPATH\fR and \fB$FORTRANPATH\fR construction variables when the \fB$_CPPINCFLAGS\fR and \fB$_FORTRANINCFLAGS\fR variables are automatically generated\&. .RE .PP \fBINCSUFFIX\fR .RS 4 The suffix used to specify an include directory on the C compiler command line\&. This will be appended to the end of each directory in the \fB$CPPPATH\fR and \fB$FORTRANPATH\fR construction variables when the \fB$_CPPINCFLAGS\fR and \fB$_FORTRANINCFLAGS\fR variables are automatically generated\&. .RE .PP \fBINSTALL\fR .RS 4 A function to be called to install a file into a destination file name\&. The default function copies the file into the destination (and sets the destination file\*(Aqs mode and permission bits to match the source file\*(Aqs)\&. The function takes the following arguments: .sp .if n \{\ .RS 4 .\} .nf def install(dest, source, env): .fi .if n \{\ .RE .\} .sp \fIdest\fR is the path name of the destination file\&. \fIsource\fR is the path name of the source file\&. \fIenv\fR is the construction environment (a dictionary of construction values) in force for this file installation\&. .RE .PP \fBINSTALLSTR\fR .RS 4 The string displayed when a file is installed into a destination file name\&. The default is: .sp .if n \{\ .RS 4 .\} .nf Install file: "$SOURCE" as "$TARGET" .fi .if n \{\ .RE .\} .RE .PP \fBINTEL_C_COMPILER_VERSION\fR .RS 4 Set by the "intelc" Tool to the major version number of the Intel C compiler selected for use\&. .RE .PP \fBJAR\fR .RS 4 The Java archive tool\&. .RE .PP \fBJARCHDIR\fR .RS 4 The directory to which the Java archive tool should change (using the \fB\-C\fR option)\&. .RE .PP \fBJARCOM\fR .RS 4 The command line used to call the Java archive tool\&. .RE .PP \fBJARCOMSTR\fR .RS 4 The string displayed when the Java archive tool is called If this is not set, then \fB$JARCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(JARCOMSTR="JARchiving $SOURCES into $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBJARFLAGS\fR .RS 4 General options passed to the Java archive tool\&. By default this is set to \fBcf\fR to create the necessary \fBjar\fR file\&. .RE .PP \fBJARSUFFIX\fR .RS 4 The suffix for Java archives: \&.jar by default\&. .RE .PP \fBJAVABOOTCLASSPATH\fR .RS 4 Specifies the list of directories that will be added to the javac command line via the \fB\-bootclasspath\fR option\&. The individual directory names will be separated by the operating system\*(Aqs path separate character (: on UNIX/Linux/POSIX, ; on Windows)\&. .RE .PP \fBJAVAC\fR .RS 4 The Java compiler\&. .RE .PP \fBJAVACCOM\fR .RS 4 The command line used to compile a directory tree containing Java source files to corresponding Java class files\&. Any options specified in the \fB$JAVACFLAGS\fR construction variable are included on this command line\&. .RE .PP \fBJAVACCOMSTR\fR .RS 4 The string displayed when compiling a directory tree of Java source files to corresponding Java class files\&. If this is not set, then \fB$JAVACCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(JAVACCOMSTR="Compiling class files $TARGETS from $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBJAVACFLAGS\fR .RS 4 General options that are passed to the Java compiler\&. .RE .PP \fBJAVACLASSDIR\fR .RS 4 The directory in which Java class files may be found\&. This is stripped from the beginning of any Java \&.class file names supplied to the JavaH builder\&. .RE .PP \fBJAVACLASSPATH\fR .RS 4 Specifies the list of directories that will be searched for Java \&.class file\&. The directories in this list will be added to the javac and javah command lines via the \fB\-classpath\fR option\&. The individual directory names will be separated by the operating system\*(Aqs path separate character (: on UNIX/Linux/POSIX, ; on Windows)\&. .sp Note that this currently just adds the specified directory via the \fB\-classpath\fR option\&. SCons does not currently search the \fB$JAVACLASSPATH\fR directories for dependency \&.class files\&. .RE .PP \fBJAVACLASSSUFFIX\fR .RS 4 The suffix for Java class files; \&.class by default\&. .RE .PP \fBJAVAH\fR .RS 4 The Java generator for C header and stub files\&. .RE .PP \fBJAVAHCOM\fR .RS 4 The command line used to generate C header and stub files from Java classes\&. Any options specified in the \fB$JAVAHFLAGS\fR construction variable are included on this command line\&. .RE .PP \fBJAVAHCOMSTR\fR .RS 4 The string displayed when C header and stub files are generated from Java classes\&. If this is not set, then \fB$JAVAHCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(JAVAHCOMSTR="Generating header/stub file(s) $TARGETS from $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBJAVAHFLAGS\fR .RS 4 General options passed to the C header and stub file generator for Java classes\&. .RE .PP \fBJAVAINCLUDES\fR .RS 4 Include path for Java header files (such as jni\&.h) .RE .PP \fBJAVASOURCEPATH\fR .RS 4 Specifies the list of directories that will be searched for input \&.java file\&. The directories in this list will be added to the javac command line via the \fB\-sourcepath\fR option\&. The individual directory names will be separated by the operating system\*(Aqs path separate character (: on UNIX/Linux/POSIX, ; on Windows)\&. .sp Note that this currently just adds the specified directory via the \fB\-sourcepath\fR option\&. SCons does not currently search the \fB$JAVASOURCEPATH\fR directories for dependency \&.java files\&. .RE .PP \fBJAVASUFFIX\fR .RS 4 The suffix for Java files; \&.java by default\&. .RE .PP \fBJAVAVERSION\fR .RS 4 Specifies the Java version being used by the \fBJava\fR builder\&. This is \fInot\fR currently used to select one version of the Java compiler vs\&. another\&. Instead, you should set this to specify the version of Java supported by your javac compiler\&. The default is 1\&.4\&. .sp This is sometimes necessary because Java 1\&.5 changed the file names that are created for nested anonymous inner classes, which can cause a mismatch with the files that SCons expects will be generated by the javac compiler\&. Setting \fB$JAVAVERSION\fR to 1\&.5 (or 1\&.6, as appropriate) can make SCons realize that a Java 1\&.5 or 1\&.6 build is actually up to date\&. .RE .PP \fBLATEX\fR .RS 4 The LaTeX structured formatter and typesetter\&. .RE .PP \fBLATEXCOM\fR .RS 4 The command line used to call the LaTeX structured formatter and typesetter\&. .RE .PP \fBLATEXCOMSTR\fR .RS 4 The string displayed when calling the LaTeX structured formatter and typesetter\&. If this is not set, then \fB$LATEXCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBLATEXFLAGS\fR .RS 4 General options passed to the LaTeX structured formatter and typesetter\&. .RE .PP \fBLATEXRETRIES\fR .RS 4 The maximum number of times that LaTeX will be re\-run if the \&.log generated by the \fB$LATEXCOM\fR command indicates that there are undefined references\&. The default is to try to resolve undefined references by re\-running LaTeX up to three times\&. .RE .PP \fBLATEXSUFFIXES\fR .RS 4 The list of suffixes of files that will be scanned for LaTeX implicit dependencies (\einclude or \eimport files)\&. The default list is: .sp .if n \{\ .RS 4 .\} .nf ["\&.tex", "\&.ltx", "\&.latex"] .fi .if n \{\ .RE .\} .RE .PP \fBLDMODULE\fR .RS 4 The linker for building loadable modules\&. By default, this is the same as \fB$SHLINK\fR\&. .RE .PP \fBLDMODULECOM\fR .RS 4 The command line for building loadable modules\&. On Mac OS X, this uses the \fB$LDMODULE\fR, \fB$LDMODULEFLAGS\fR and \fB$FRAMEWORKSFLAGS\fR variables\&. On other systems, this is the same as \fB$SHLINK\fR\&. .RE .PP \fBLDMODULECOMSTR\fR .RS 4 If set, the string displayed when building loadable modules\&. If not set, then \fB$LDMODULECOM\fR (the command line) is displayed\&. .RE .PP \fBLDMODULEEMITTER\fR .RS 4 Contains the emitter specification for the \fBLoadableModule\fR builder\&. The manpage section "Builder Objects" contains general information on specifying emitters\&. .RE .PP \fBLDMODULEFLAGS\fR .RS 4 General user options passed to the linker for building loadable modules\&. .RE .PP \fBLDMODULENOVERSIONSYMLINKS\fR .RS 4 Instructs the \fBLoadableModule\fR builder to not automatically create symlinks for versioned modules\&. Defaults to $SHLIBNOVERSIONSYMLINKS .RE .PP \fBLDMODULEPREFIX\fR .RS 4 The prefix used for loadable module file names\&. On Mac OS X, this is null; on other systems, this is the same as \fB$SHLIBPREFIX\fR\&. .RE .PP \fB_LDMODULESONAME\fR .RS 4 A macro that automatically generates loadable module\*(Aqs SONAME based on $TARGET, $LDMODULEVERSION and $LDMODULESUFFIX\&. Used by \fBLoadableModule\fR builder when the linker tool supports SONAME (e\&.g\&. gnulink)\&. .RE .PP \fBLDMODULESUFFIX\fR .RS 4 The suffix used for loadable module file names\&. On Mac OS X, this is null; on other systems, this is the same as $SHLIBSUFFIX\&. .RE .PP \fBLDMODULEVERSION\fR .RS 4 When this construction variable is defined, a versioned loadable module is created by \fBLoadableModule\fR builder\&. This activates the \fB$_LDMODULEVERSIONFLAGS\fR and thus modifies the \fB$LDMODULECOM\fR as required, adds the version number to the library name, and creates the symlinks that are needed\&. \fB$LDMODULEVERSION\fR versions should exist in the same format as \fB$SHLIBVERSION\fR\&. .RE .PP \fB_LDMODULEVERSIONFLAGS\fR .RS 4 This macro automatically introduces extra flags to \fB$LDMODULECOM\fR when building versioned \fBLoadableModule\fR (that is when \fB$LDMODULEVERSION\fR is set)\&. _LDMODULEVERSIONFLAGS usually adds \fB$SHLIBVERSIONFLAGS\fR and some extra dynamically generated options (such as \-Wl,\-soname=$_LDMODULESONAME)\&. It is unused by plain (unversioned) loadable modules\&. .RE .PP \fBLDMODULEVERSIONFLAGS\fR .RS 4 Extra flags added to \fB$LDMODULECOM\fR when building versioned \fBLoadableModule\fR\&. These flags are only used when \fB$LDMODULEVERSION\fR is set\&. .RE .PP \fBLEX\fR .RS 4 The lexical analyzer generator\&. .RE .PP \fBLEXCOM\fR .RS 4 The command line used to call the lexical analyzer generator to generate a source file\&. .RE .PP \fBLEXCOMSTR\fR .RS 4 The string displayed when generating a source file using the lexical analyzer generator\&. If this is not set, then \fB$LEXCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(LEXCOMSTR = "Lex\*(Aqing $TARGET from $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBLEXFLAGS\fR .RS 4 General options passed to the lexical analyzer generator\&. .RE .PP \fBLEXUNISTD\fR .RS 4 Used only on windows environments to set a lex flag to prevent \*(Aqunistd\&.h\*(Aq from being included\&. The default value is \*(Aq\-\-nounistd\*(Aq\&. .RE .PP \fB_LIBDIRFLAGS\fR .RS 4 An automatically\-generated construction variable containing the linker command\-line options for specifying directories to be searched for library\&. The value of \fB$_LIBDIRFLAGS\fR is created by respectively prepending and appending \fB$LIBDIRPREFIX\fR and \fB$LIBDIRSUFFIX\fR to the beginning and end of each directory in \fB$LIBPATH\fR\&. .RE .PP \fBLIBDIRPREFIX\fR .RS 4 The prefix used to specify a library directory on the linker command line\&. This will be prepended to the beginning of each directory in the \fB$LIBPATH\fR construction variable when the \fB$_LIBDIRFLAGS\fR variable is automatically generated\&. .RE .PP \fBLIBDIRSUFFIX\fR .RS 4 The suffix used to specify a library directory on the linker command line\&. This will be appended to the end of each directory in the \fB$LIBPATH\fR construction variable when the \fB$_LIBDIRFLAGS\fR variable is automatically generated\&. .RE .PP \fBLIBEMITTER\fR .RS 4 Contains the emitter specification for the \fBStaticLibrary\fR builder\&. The manpage section "Builder Objects" contains general information on specifying emitters\&. .RE .PP \fB_LIBFLAGS\fR .RS 4 An automatically\-generated construction variable containing the linker command\-line options for specifying libraries to be linked with the resulting target\&. The value of \fB$_LIBFLAGS\fR is created by respectively prepending and appending \fB$LIBLINKPREFIX\fR and \fB$LIBLINKSUFFIX\fR to the beginning and end of each filename in \fB$LIBS\fR\&. .RE .PP \fBLIBLINKPREFIX\fR .RS 4 The prefix used to specify a library to link on the linker command line\&. This will be prepended to the beginning of each library in the \fB$LIBS\fR construction variable when the \fB$_LIBFLAGS\fR variable is automatically generated\&. .RE .PP \fBLIBLINKSUFFIX\fR .RS 4 The suffix used to specify a library to link on the linker command line\&. This will be appended to the end of each library in the \fB$LIBS\fR construction variable when the \fB$_LIBFLAGS\fR variable is automatically generated\&. .RE .PP \fBLIBPATH\fR .RS 4 The list of directories that will be searched for libraries\&. The implicit dependency scanner will search these directories for include files\&. Don\*(Aqt explicitly put include directory arguments in \fB$LINKFLAGS\fR or \fB$SHLINKFLAGS\fR because the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in LIBPATH will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: .sp .if n \{\ .RS 4 .\} .nf env = Environment(LIBPATH=\*(Aq#/libs\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf libs = Dir(\*(Aqlibs\*(Aq) env = Environment(LIBPATH=libs) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_LIBDIRFLAGS\fR construction variable, which is constructed by respectively prepending and appending the values of the \fB$LIBDIRPREFIX\fR and \fB$LIBDIRSUFFIX\fR construction variables to the beginning and end of each directory in \fB$LIBPATH\fR\&. Any command lines you define that need the LIBPATH directory list should include \fB$_LIBDIRFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .RE .PP \fBLIBPREFIX\fR .RS 4 The prefix used for (static) library file names\&. A default value is set for each platform (posix, win32, os2, etc\&.), but the value is overridden by individual tools (ar, mslib, sgiar, sunar, tlib, etc\&.) to reflect the names of the libraries they create\&. .RE .PP \fBLIBPREFIXES\fR .RS 4 A list of all legal prefixes for library file names\&. When searching for library dependencies, SCons will look for files with these prefixes, the base library name, and suffixes in the \fB$LIBSUFFIXES\fR list\&. .RE .PP \fBLIBS\fR .RS 4 A list of one or more libraries that will be linked with any executable programs created by this environment\&. .sp The library list will be added to command lines through the automatically\-generated \fB$_LIBFLAGS\fR construction variable, which is constructed by respectively prepending and appending the values of the \fB$LIBLINKPREFIX\fR and \fB$LIBLINKSUFFIX\fR construction variables to the beginning and end of each filename in \fB$LIBS\fR\&. Any command lines you define that need the LIBS library list should include \fB$_LIBFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(LINKCOM="my_linker $_LIBDIRFLAGS $_LIBFLAGS \-o $TARGET $SOURCE") .fi .if n \{\ .RE .\} .sp If you add a File object to the \fB$LIBS\fR list, the name of that file will be added to \fB$_LIBFLAGS\fR, and thus the link line, as is, without \fB$LIBLINKPREFIX\fR or \fB$LIBLINKSUFFIX\fR\&. For example: .sp .if n \{\ .RS 4 .\} .nf env\&.Append(LIBS=File(\*(Aq/tmp/mylib\&.so\*(Aq)) .fi .if n \{\ .RE .\} .sp In all cases, scons will add dependencies from the executable program to all the libraries in this list\&. .RE .PP \fBLIBSUFFIX\fR .RS 4 The suffix used for (static) library file names\&. A default value is set for each platform (posix, win32, os2, etc\&.), but the value is overridden by individual tools (ar, mslib, sgiar, sunar, tlib, etc\&.) to reflect the names of the libraries they create\&. .RE .PP \fBLIBSUFFIXES\fR .RS 4 A list of all legal suffixes for library file names\&. When searching for library dependencies, SCons will look for files with prefixes, in the \fB$LIBPREFIXES\fR list, the base library name, and these suffixes\&. .RE .PP \fBLICENSE\fR .RS 4 The abbreviated name, preferably the SPDX code, of the license under which this project is released (GPL\-3\&.0, LGPL\-2\&.1, BSD\-2\-Clause etc\&.)\&. See http://www\&.opensource\&.org/licenses/alphabetical for a list of license names and SPDX codes\&. .RE .PP \fBLINESEPARATOR\fR .RS 4 The separator used by the \fBSubstfile\fR and \fBTextfile\fR builders\&. This value is used between sources when constructing the target\&. It defaults to the current system line separator\&. .RE .PP \fBLINGUAS_FILE\fR .RS 4 The \fB$LINGUAS_FILE\fR defines file(s) containing list of additional linguas to be processed by \fBPOInit\fR, \fBPOUpdate\fR or \fBMOFiles\fR builders\&. It also affects \fBTranslate\fR builder\&. If the variable contains a string, it defines name of the list file\&. The \fB$LINGUAS_FILE\fR may be a list of file names as well\&. If \fB$LINGUAS_FILE\fR is set to True (or non\-zero numeric value), the list will be read from default file named LINGUAS\&. .RE .PP \fBLINK\fR .RS 4 The linker\&. See also \fB$SHLINK\fR for linking shared objects\&. .RE .PP \fBLINKCOM\fR .RS 4 The command line used to link object files into an executable\&. See also \fB$SHLINKCOM\fR for linking shared objects\&. .RE .PP \fBLINKCOMSTR\fR .RS 4 If set, the string displayed when object files are linked into an executable\&. If not set, then \fB$LINKCOM\fR (the command line) is displayed\&. See also \fB$SHLINKCOMSTR\fR\&. for linking shared objects\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(LINKCOMSTR = "Linking $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBLINKFLAGS\fR .RS 4 General user options passed to the linker\&. Note that this variable should \fInot\fR contain \fB\-l\fR (or similar) options for linking with the libraries listed in \fB$LIBS\fR, nor \fB\-L\fR (or similar) library search path options that scons generates automatically from \fB$LIBPATH\fR\&. See \fB$_LIBFLAGS\fR above, for the variable that expands to library\-link options, and \fB$_LIBDIRFLAGS\fR above, for the variable that expands to library search path options\&. See also \fB$SHLINKFLAGS\fR\&. for linking shared objects\&. .RE .PP \fBM4\fR .RS 4 The M4 macro preprocessor\&. .RE .PP \fBM4COM\fR .RS 4 The command line used to pass files through the M4 macro preprocessor\&. .RE .PP \fBM4COMSTR\fR .RS 4 The string displayed when a file is passed through the M4 macro preprocessor\&. If this is not set, then \fB$M4COM\fR (the command line) is displayed\&. .RE .PP \fBM4FLAGS\fR .RS 4 General options passed to the M4 macro preprocessor\&. .RE .PP \fBMAKEINDEX\fR .RS 4 The makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. .RE .PP \fBMAKEINDEXCOM\fR .RS 4 The command line used to call the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. .RE .PP \fBMAKEINDEXCOMSTR\fR .RS 4 The string displayed when calling the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. If this is not set, then \fB$MAKEINDEXCOM\fR (the command line) is displayed\&. .RE .PP \fBMAKEINDEXFLAGS\fR .RS 4 General options passed to the makeindex generator for the TeX formatter and typesetter and the LaTeX structured formatter and typesetter\&. .RE .PP \fBMAXLINELENGTH\fR .RS 4 The maximum number of characters allowed on an external command line\&. On Win32 systems, link lines longer than this many characters are linked via a temporary file name\&. .RE .PP \fBMIDL\fR .RS 4 The Microsoft IDL compiler\&. .RE .PP \fBMIDLCOM\fR .RS 4 The command line used to pass files to the Microsoft IDL compiler\&. .RE .PP \fBMIDLCOMSTR\fR .RS 4 The string displayed when the Microsoft IDL compiler is called\&. If this is not set, then \fB$MIDLCOM\fR (the command line) is displayed\&. .RE .PP \fBMIDLFLAGS\fR .RS 4 General options passed to the Microsoft IDL compiler\&. .RE .PP \fBMOSUFFIX\fR .RS 4 Suffix used for MO files (default: \*(Aq\&.mo\*(Aq)\&. See msgfmt tool and \fBMOFiles\fR builder\&. .RE .PP \fBMSGFMT\fR .RS 4 Absolute path to \fBmsgfmt(1)\fR binary, found by \fBDetect()\fR\&. See msgfmt tool and \fBMOFiles\fR builder\&. .RE .PP \fBMSGFMTCOM\fR .RS 4 Complete command line to run \fBmsgfmt(1)\fR program\&. See msgfmt tool and \fBMOFiles\fR builder\&. .RE .PP \fBMSGFMTCOMSTR\fR .RS 4 String to display when \fBmsgfmt(1)\fR is invoked (default: \*(Aq\*(Aq, which means ``print \fB$MSGFMTCOM\fR\*(Aq\*(Aq)\&. See msgfmt tool and \fBMOFiles\fR builder\&. .RE .PP \fBMSGFMTFLAGS\fR .RS 4 Additional flags to \fBmsgfmt(1)\fR\&. See msgfmt tool and \fBMOFiles\fR builder\&. .RE .PP \fBMSGINIT\fR .RS 4 Path to \fBmsginit(1)\fR program (found via Detect())\&. See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fBMSGINITCOM\fR .RS 4 Complete command line to run \fBmsginit(1)\fR program\&. See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fBMSGINITCOMSTR\fR .RS 4 String to display when \fBmsginit(1)\fR is invoked (default: \*(Aq\*(Aq, which means ``print \fB$MSGINITCOM\fR\*(Aq\*(Aq)\&. See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fBMSGINITFLAGS\fR .RS 4 List of additional flags to \fBmsginit(1)\fR (default: [])\&. See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fB_MSGINITLOCALE\fR .RS 4 Internal ``macro\*(Aq\*(Aq\&. Computes locale (language) name based on target filename (default: \*(Aq${TARGET\&.filebase}\*(Aq)\&. .sp See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fBMSGMERGE\fR .RS 4 Absolute path to \fBmsgmerge(1)\fR binary as found by \fBDetect()\fR\&. See msgmerge tool and \fBPOUpdate\fR builder\&. .RE .PP \fBMSGMERGECOM\fR .RS 4 Complete command line to run \fBmsgmerge(1)\fR command\&. See msgmerge tool and \fBPOUpdate\fR builder\&. .RE .PP \fBMSGMERGECOMSTR\fR .RS 4 String to be displayed when \fBmsgmerge(1)\fR is invoked (default: \*(Aq\*(Aq, which means ``print \fB$MSGMERGECOM\fR\*(Aq\*(Aq)\&. See msgmerge tool and \fBPOUpdate\fR builder\&. .RE .PP \fBMSGMERGEFLAGS\fR .RS 4 Additional flags to \fBmsgmerge(1)\fR command\&. See msgmerge tool and \fBPOUpdate\fR builder\&. .RE .PP \fBMSSDK_DIR\fR .RS 4 The directory containing the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation\&. .RE .PP \fBMSSDK_VERSION\fR .RS 4 The version string of the Microsoft SDK (either Platform SDK or Windows SDK) to be used for compilation\&. Supported versions include 6\&.1, 6\&.0A, 6\&.0, 2003R2 and 2003R1\&. .RE .PP \fBMSVC_BATCH\fR .RS 4 When set to any true value, specifies that SCons should batch compilation of object files when calling the Microsoft Visual C/C++ compiler\&. All compilations of source files from the same source directory that generate target files in a same output directory and were configured in SCons using the same construction environment will be built in a single call to the compiler\&. Only source files that have changed since their object files were built will be passed to each compiler invocation (via the \fB$CHANGED_SOURCES\fR construction variable)\&. Any compilations where the object (target) file base name (minus the \&.obj) does not match the source file base name will be compiled separately\&. .RE .PP \fBMSVC_USE_SCRIPT\fR .RS 4 Use a batch script to set up Microsoft Visual Studio compiler\&. .sp If set to the name of a Visual Studio \&.bat file (e\&.g\&. vcvars\&.bat), SCons will run that batch file instead of the auto\-detected one, and extract the relevant variables from the result (typically \fB%INCLUDE%\fR, \fB%LIB%\fR, and \fB%PATH%\fR) for supplying to the build\&. This can be useful to force the use of a compiler version that SCons does not detect\&. .sp Setting \fB$MSVC_USE_SCRIPT\fR to \fBNone\fR bypasses the Visual Studio autodetection entirely; use this if you are running SCons in a Visual Studio cmd window and importing the shell\*(Aqs environment variables \- that is, if you are sure everything is set correctly already and you don\*(Aqt want SCons to change anything\&. .sp \fB$MSVC_USE_SCRIPT\fR overrides \fB$MSVC_VERSION\fR and \fB$TARGET_ARCH\fR\&. .RE .PP \fBMSVC_UWP_APP\fR .RS 4 Build libraries for a Universal Windows Platform (UWP) Application\&. .sp If \fB$MSVC_UWP_APP\fR is set, the Visual Studio environment will be set up to point to the Windows Store compatible libraries and Visual Studio runtimes\&. In doing so, any libraries that are built will be able to be used in a UWP App and published to the Windows Store\&. This flag will only have an effect with Visual Studio 2015 or later\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. .sp Valid values are \*(Aq1\*(Aq or \*(Aq0\*(Aq .RE .PP \fBMSVC_VERSION\fR .RS 4 Sets the preferred version of Microsoft Visual C/C++ to use\&. .sp If \fB$MSVC_VERSION\fR is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system\&. If the specified version isn\*(Aqt installed, tool initialization will fail\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. .sp Valid values for Windows are 14\&.2, 14\&.1, 14\&.1Exp, 14\&.0, 14\&.0Exp, 12\&.0, 12\&.0Exp, 11\&.0, 11\&.0Exp, 10\&.0, 10\&.0Exp, 9\&.0, 9\&.0Exp, 8\&.0, 8\&.0Exp, 7\&.1, 7\&.0, and 6\&.0\&. Versions ending in Exp refer to "Express" or "Express for Desktop" editions\&. .RE .PP \fBMSVS\fR .RS 4 When the Microsoft Visual Studio tools are initialized, they set up this dictionary with the following keys: .PP VERSION .RS 4 the version of MSVS being used (can be set via \fB$MSVS_VERSION\fR) .RE .PP VERSIONS .RS 4 the available versions of MSVS installed .RE .PP VCINSTALLDIR .RS 4 installed directory of Visual C++ .RE .PP VSINSTALLDIR .RS 4 installed directory of Visual Studio .RE .PP FRAMEWORKDIR .RS 4 installed directory of the \&.NET framework .RE .PP FRAMEWORKVERSIONS .RS 4 list of installed versions of the \&.NET framework, sorted latest to oldest\&. .RE .PP FRAMEWORKVERSION .RS 4 latest installed version of the \&.NET framework .RE .PP FRAMEWORKSDKDIR .RS 4 installed location of the \&.NET SDK\&. .RE .PP PLATFORMSDKDIR .RS 4 installed location of the Platform SDK\&. .RE .PP PLATFORMSDK_MODULES .RS 4 dictionary of installed Platform SDK modules, where the dictionary keys are keywords for the various modules, and the values are 2\-tuples where the first is the release date, and the second is the version number\&. .RE .sp If a value is not set, it was not available in the registry\&. .RE .PP \fBMSVS_ARCH\fR .RS 4 Sets the architecture for which the generated project(s) should build\&. .sp The default value is x86\&. amd64 is also supported by SCons for most Visual Studio versions\&. Since Visual Studio 2015 arm is supported, and since Visual Studio 2017 arm64 is supported\&. Trying to set \fB$MSVS_ARCH\fR to an architecture that\*(Aqs not supported for a given Visual Studio version will generate an error\&. .RE .PP \fBMSVS_PROJECT_GUID\fR .RS 4 The string placed in a generated Microsoft Visual Studio project file as the value of the ProjectGUID attribute\&. There is no default value\&. If not defined, a new GUID is generated\&. .RE .PP \fBMSVS_SCC_AUX_PATH\fR .RS 4 The path name placed in a generated Microsoft Visual Studio project file as the value of the SccAuxPath attribute if the \fBMSVS_SCC_PROVIDER\fR construction variable is also set\&. There is no default value\&. .RE .PP \fBMSVS_SCC_CONNECTION_ROOT\fR .RS 4 The root path of projects in your SCC workspace, i\&.e the path under which all project and solution files will be generated\&. It is used as a reference path from which the relative paths of the generated Microsoft Visual Studio project and solution files are computed\&. The relative project file path is placed as the value of the SccLocalPath attribute of the project file and as the values of the SccProjectFilePathRelativizedFromConnection[i] (where [i] ranges from 0 to the number of projects in the solution) attributes of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file\&. Similarly the relative solution file path is placed as the values of the SccLocalPath[i] (where [i] ranges from 0 to the number of projects in the solution) attributes of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file\&. This is used only if the \fBMSVS_SCC_PROVIDER\fR construction variable is also set\&. The default value is the current working directory\&. .RE .PP \fBMSVS_SCC_PROJECT_NAME\fR .RS 4 The project name placed in a generated Microsoft Visual Studio project file as the value of the SccProjectName attribute if the \fBMSVS_SCC_PROVIDER\fR construction variable is also set\&. In this case the string is also placed in the SccProjectName0 attribute of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file\&. There is no default value\&. .RE .PP \fBMSVS_SCC_PROVIDER\fR .RS 4 The string placed in a generated Microsoft Visual Studio project file as the value of the SccProvider attribute\&. The string is also placed in the SccProvider0 attribute of the GlobalSection(SourceCodeControl) section of the Microsoft Visual Studio solution file\&. There is no default value\&. .RE .PP \fBMSVS_VERSION\fR .RS 4 Sets the preferred version of Microsoft Visual Studio to use\&. .sp If \fB$MSVS_VERSION\fR is not set, SCons will (by default) select the latest version of Visual Studio installed on your system\&. So, if you have version 6 and version 7 (MSVS \&.NET) installed, it will prefer version 7\&. You can override this by specifying the \fBMSVS_VERSION\fR variable in the Environment initialization, setting it to the appropriate version (\*(Aq6\&.0\*(Aq or \*(Aq7\&.0\*(Aq, for example)\&. If the specified version isn\*(Aqt installed, tool initialization will fail\&. .sp This is obsolete: use \fB$MSVC_VERSION\fR instead\&. If \fB$MSVS_VERSION\fR is set and \fB$MSVC_VERSION\fR is not, \fB$MSVC_VERSION\fR will be set automatically to \fB$MSVS_VERSION\fR\&. If both are set to different values, scons will raise an error\&. .RE .PP \fBMSVSBUILDCOM\fR .RS 4 The build command line placed in a generated Microsoft Visual Studio project file\&. The default is to have Visual Studio invoke SCons with any specified build targets\&. .RE .PP \fBMSVSCLEANCOM\fR .RS 4 The clean command line placed in a generated Microsoft Visual Studio project file\&. The default is to have Visual Studio invoke SCons with the \-c option to remove any specified targets\&. .RE .PP \fBMSVSENCODING\fR .RS 4 The encoding string placed in a generated Microsoft Visual Studio project file\&. The default is encoding Windows\-1252\&. .RE .PP \fBMSVSPROJECTCOM\fR .RS 4 The action used to generate Microsoft Visual Studio project files\&. .RE .PP \fBMSVSPROJECTSUFFIX\fR .RS 4 The suffix used for Microsoft Visual Studio project (DSP) files\&. The default value is \&.vcproj when using Visual Studio version 7\&.x (\&.NET) or later version, and \&.dsp when using earlier versions of Visual Studio\&. .RE .PP \fBMSVSREBUILDCOM\fR .RS 4 The rebuild command line placed in a generated Microsoft Visual Studio project file\&. The default is to have Visual Studio invoke SCons with any specified rebuild targets\&. .RE .PP \fBMSVSSCONS\fR .RS 4 The SCons used in generated Microsoft Visual Studio project files\&. The default is the version of SCons being used to generate the project file\&. .RE .PP \fBMSVSSCONSCOM\fR .RS 4 The default SCons command used in generated Microsoft Visual Studio project files\&. .RE .PP \fBMSVSSCONSCRIPT\fR .RS 4 The sconscript file (that is, SConstruct or SConscript file) that will be invoked by Visual Studio project files (through the \fB$MSVSSCONSCOM\fR variable)\&. The default is the same sconscript file that contains the call to \fBMSVSProject\fR to build the project file\&. .RE .PP \fBMSVSSCONSFLAGS\fR .RS 4 The SCons flags used in generated Microsoft Visual Studio project files\&. .RE .PP \fBMSVSSOLUTIONCOM\fR .RS 4 The action used to generate Microsoft Visual Studio solution files\&. .RE .PP \fBMSVSSOLUTIONSUFFIX\fR .RS 4 The suffix used for Microsoft Visual Studio solution (DSW) files\&. The default value is \&.sln when using Visual Studio version 7\&.x (\&.NET), and \&.dsw when using earlier versions of Visual Studio\&. .RE .PP \fBMT\fR .RS 4 The program used on Windows systems to embed manifests into DLLs and EXEs\&. See also \fB$WINDOWS_EMBED_MANIFEST\fR\&. .RE .PP \fBMTEXECOM\fR .RS 4 The Windows command line used to embed manifests into executables\&. See also \fB$MTSHLIBCOM\fR\&. .RE .PP \fBMTFLAGS\fR .RS 4 Flags passed to the \fB$MT\fR manifest embedding program (Windows only)\&. .RE .PP \fBMTSHLIBCOM\fR .RS 4 The Windows command line used to embed manifests into shared libraries (DLLs)\&. See also \fB$MTEXECOM\fR\&. .RE .PP \fBMWCW_VERSION\fR .RS 4 The version number of the MetroWerks CodeWarrior C compiler to be used\&. .RE .PP \fBMWCW_VERSIONS\fR .RS 4 A list of installed versions of the MetroWerks CodeWarrior C compiler on this system\&. .RE .PP \fBNAME\fR .RS 4 Specfies the name of the project to package\&. .RE .PP \fBno_import_lib\fR .RS 4 When set to non\-zero, suppresses creation of a corresponding Windows static import lib by the SharedLibrary builder when used with MinGW, Microsoft Visual Studio or Metrowerks\&. This also suppresses creation of an export (\&.exp) file when using Microsoft Visual Studio\&. .RE .PP \fBOBJPREFIX\fR .RS 4 The prefix used for (static) object file names\&. .RE .PP \fBOBJSUFFIX\fR .RS 4 The suffix used for (static) object file names\&. .RE .PP \fBPACKAGEROOT\fR .RS 4 Specifies the directory where all files in resulting archive will be placed if applicable\&. The default value is "$NAME\-$VERSION"\&. .RE .PP \fBPACKAGETYPE\fR .RS 4 Selects the package type to build\&. Currently these are available: .RS 4 msi \- Microsoft Installer .RE .RS 4 rpm \- RPM Package Manger .RE .RS 4 ipkg \- Itsy Package Management System .RE .RS 4 tarbz2 \- bzip2 compressed tar .RE .RS 4 targz \- gzip compressed tar .RE .RS 4 tarxz \- xz compressed tar .RE .RS 4 zip \- zip file .RE .RS 4 src_tarbz2 \- bzip2 compressed tar source .RE .RS 4 src_targz \- gzip compressed tar source .RE .RS 4 src_tarxz \- xz compressed tar source .RE .RS 4 src_zip \- zip file source .RE This may be overridden with the \fBpackage_type\fR command line option\&. .RE .PP \fBPACKAGEVERSION\fR .RS 4 The version of the package (not the underlying project)\&. This is currently only used by the rpm packager and should reflect changes in the packaging, not the underlying project code itself\&. .RE .PP \fBPCH\fR .RS 4 The Microsoft Visual C++ precompiled header that will be used when compiling object files\&. This variable is ignored by tools other than Microsoft Visual C++\&. When this variable is defined SCons will add options to the compiler command line to cause it to use the precompiled header, and will also set up the dependencies for the PCH file\&. Example: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqPCH\*(Aq] = \*(AqStdAfx\&.pch\*(Aq .fi .if n \{\ .RE .\} .RE .PP \fBPCHCOM\fR .RS 4 The command line used by the \fBPCH\fR builder to generated a precompiled header\&. .RE .PP \fBPCHCOMSTR\fR .RS 4 The string displayed when generating a precompiled header\&. If this is not set, then \fB$PCHCOM\fR (the command line) is displayed\&. .RE .PP \fBPCHPDBFLAGS\fR .RS 4 A construction variable that, when expanded, adds the /yD flag to the command line only if the \fB$PDB\fR construction variable is set\&. .RE .PP \fBPCHSTOP\fR .RS 4 This variable specifies how much of a source file is precompiled\&. This variable is ignored by tools other than Microsoft Visual C++, or when the PCH variable is not being used\&. When this variable is define it must be a string that is the name of the header that is included at the end of the precompiled portion of the source files, or the empty string if the "#pragma hrdstop" construct is being used: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqPCHSTOP\*(Aq] = \*(AqStdAfx\&.h\*(Aq .fi .if n \{\ .RE .\} .RE .PP \fBPDB\fR .RS 4 The Microsoft Visual C++ PDB file that will store debugging information for object files, shared libraries, and programs\&. This variable is ignored by tools other than Microsoft Visual C++\&. When this variable is defined SCons will add options to the compiler and linker command line to cause them to generate external debugging information, and will also set up the dependencies for the PDB file\&. Example: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqPDB\*(Aq] = \*(Aqhello\&.pdb\*(Aq .fi .if n \{\ .RE .\} .sp The Visual C++ compiler switch that SCons uses by default to generate PDB information is \fB/Z7\fR\&. This works correctly with parallel (\fB\-j\fR) builds because it embeds the debug information in the intermediate object files, as opposed to sharing a single PDB file between multiple object files\&. This is also the only way to get debug information embedded into a static library\&. Using the \fB/Zi\fR instead may yield improved link\-time performance, although parallel builds will no longer work\&. You can generate PDB files with the \fB/Zi\fR switch by overriding the default \fB$CCPDBFLAGS\fR variable; see the entry for that variable for specific examples\&. .RE .PP \fBPDFCOM\fR .RS 4 A deprecated synonym for \fB$DVIPDFCOM\fR\&. .RE .PP \fBPDFLATEX\fR .RS 4 The pdflatex utility\&. .RE .PP \fBPDFLATEXCOM\fR .RS 4 The command line used to call the pdflatex utility\&. .RE .PP \fBPDFLATEXCOMSTR\fR .RS 4 The string displayed when calling the pdflatex utility\&. If this is not set, then \fB$PDFLATEXCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(PDFLATEX;COMSTR = "Building $TARGET from LaTeX input $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBPDFLATEXFLAGS\fR .RS 4 General options passed to the pdflatex utility\&. .RE .PP \fBPDFPREFIX\fR .RS 4 The prefix used for PDF file names\&. .RE .PP \fBPDFSUFFIX\fR .RS 4 The suffix used for PDF file names\&. .RE .PP \fBPDFTEX\fR .RS 4 The pdftex utility\&. .RE .PP \fBPDFTEXCOM\fR .RS 4 The command line used to call the pdftex utility\&. .RE .PP \fBPDFTEXCOMSTR\fR .RS 4 The string displayed when calling the pdftex utility\&. If this is not set, then \fB$PDFTEXCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(PDFTEXCOMSTR = "Building $TARGET from TeX input $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBPDFTEXFLAGS\fR .RS 4 General options passed to the pdftex utility\&. .RE .PP \fBPKGCHK\fR .RS 4 On Solaris systems, the package\-checking program that will be used (along with \fB$PKGINFO\fR) to look for installed versions of the Sun PRO C++ compiler\&. The default is /usr/sbin/pgkchk\&. .RE .PP \fBPKGINFO\fR .RS 4 On Solaris systems, the package information program that will be used (along with \fB$PKGCHK\fR) to look for installed versions of the Sun PRO C++ compiler\&. The default is pkginfo\&. .RE .PP \fBPLATFORM\fR .RS 4 The name of the platform used to create the Environment\&. If no platform is specified when the Environment is created, \fBscons\fR autodetects the platform\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools = []) if env[\*(AqPLATFORM\*(Aq] == \*(Aqcygwin\*(Aq: Tool(\*(Aqmingw\*(Aq)(env) else: Tool(\*(Aqmsvc\*(Aq)(env) .fi .if n \{\ .RE .\} .RE .PP \fBPOAUTOINIT\fR .RS 4 The \fB$POAUTOINIT\fR variable, if set to True (on non\-zero numeric value), let the msginit tool to automatically initialize \fImissing\fR PO files with \fBmsginit(1)\fR\&. This applies to both, \fBPOInit\fR and \fBPOUpdate\fR builders (and others that use any of them)\&. .RE .PP \fBPOCREATE_ALIAS\fR .RS 4 Common alias for all PO files created with \fBPOInit\fR builder (default: \*(Aqpo\-create\*(Aq)\&. See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fBPOSUFFIX\fR .RS 4 Suffix used for PO files (default: \*(Aq\&.po\*(Aq) See msginit tool and \fBPOInit\fR builder\&. .RE .PP \fBPOTDOMAIN\fR .RS 4 The \fB$POTDOMAIN\fR defines default domain, used to generate POT filename as \fB$POTDOMAIN\fR\&.pot when no POT file name is provided by the user\&. This applies to \fBPOTUpdate\fR, \fBPOInit\fR and \fBPOUpdate\fR builders (and builders, that use them, e\&.g\&. \fBTranslate\fR)\&. Normally (if \fB$POTDOMAIN\fR is not defined), the builders use messages\&.pot as default POT file name\&. .RE .PP \fBPOTSUFFIX\fR .RS 4 Suffix used for PO Template files (default: \*(Aq\&.pot\*(Aq)\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fBPOTUPDATE_ALIAS\fR .RS 4 Name of the common phony target for all PO Templates created with \fBPOUpdate\fR (default: \*(Aqpot\-update\*(Aq)\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fBPOUPDATE_ALIAS\fR .RS 4 Common alias for all PO files being defined with \fBPOUpdate\fR builder (default: \*(Aqpo\-update\*(Aq)\&. See msgmerge tool and \fBPOUpdate\fR builder\&. .RE .PP \fBPRINT_CMD_LINE_FUNC\fR .RS 4 A Python function used to print the command lines as they are executed (assuming command printing is not disabled by the \fB\-q\fR or \fB\-s\fR options or their equivalents)\&. The function should take four arguments: \fIs\fR, the command being executed (a string), \fItarget\fR, the target being built (file node, list, or string name(s)), \fIsource\fR, the source(s) used (file node, list, or string name(s)), and \fIenv\fR, the environment being used\&. .sp The function must do the printing itself\&. The default implementation, used if this variable is not set or is None, is: .sp .if n \{\ .RS 4 .\} .nf def print_cmd_line(s, target, source, env): sys\&.stdout\&.write(s + "\en") .fi .if n \{\ .RE .\} .sp Here\*(Aqs an example of a more interesting function: .sp .if n \{\ .RS 4 .\} .nf def print_cmd_line(s, target, source, env): sys\&.stdout\&.write("Building %s \-> %s\&.\&.\&.\en" % (\*(Aq and \*(Aq\&.join([str(x) for x in source]), \*(Aq and \*(Aq\&.join([str(x) for x in target]))) env=Environment(PRINT_CMD_LINE_FUNC=print_cmd_line) env\&.Program(\*(Aqfoo\*(Aq, \*(Aqfoo\&.c\*(Aq) .fi .if n \{\ .RE .\} .sp This just prints "Building \fItargetname\fR from \fIsourcename\fR\&.\&.\&." instead of the actual commands\&. Such a function could also log the actual commands to a log file, for example\&. .RE .PP \fBPROGEMITTER\fR .RS 4 Contains the emitter specification for the \fBProgram\fR builder\&. The manpage section "Builder Objects" contains general information on specifying emitters\&. .RE .PP \fBPROGPREFIX\fR .RS 4 The prefix used for executable file names\&. .RE .PP \fBPROGSUFFIX\fR .RS 4 The suffix used for executable file names\&. .RE .PP \fBPSCOM\fR .RS 4 The command line used to convert TeX DVI files into a PostScript file\&. .RE .PP \fBPSCOMSTR\fR .RS 4 The string displayed when a TeX DVI file is converted into a PostScript file\&. If this is not set, then \fB$PSCOM\fR (the command line) is displayed\&. .RE .PP \fBPSPREFIX\fR .RS 4 The prefix used for PostScript file names\&. .RE .PP \fBPSSUFFIX\fR .RS 4 The prefix used for PostScript file names\&. .RE .PP \fBQT_AUTOSCAN\fR .RS 4 Turn off scanning for mocable files\&. Use the Moc Builder to explicitly specify files to run moc on\&. .RE .PP \fBQT_BINPATH\fR .RS 4 The path where the qt binaries are installed\&. The default value is \*(Aq\fB$QTDIR\fR/bin\*(Aq\&. .RE .PP \fBQT_CPPPATH\fR .RS 4 The path where the qt header files are installed\&. The default value is \*(Aq\fB$QTDIR\fR/include\*(Aq\&. Note: If you set this variable to None, the tool won\*(Aqt change the \fB$CPPPATH\fR construction variable\&. .RE .PP \fBQT_DEBUG\fR .RS 4 Prints lots of debugging information while scanning for moc files\&. .RE .PP \fBQT_LIB\fR .RS 4 Default value is \*(Aqqt\*(Aq\&. You may want to set this to \*(Aqqt\-mt\*(Aq\&. Note: If you set this variable to None, the tool won\*(Aqt change the \fB$LIBS\fR variable\&. .RE .PP \fBQT_LIBPATH\fR .RS 4 The path where the qt libraries are installed\&. The default value is \*(Aq\fB$QTDIR\fR/lib\*(Aq\&. Note: If you set this variable to None, the tool won\*(Aqt change the \fB$LIBPATH\fR construction variable\&. .RE .PP \fBQT_MOC\fR .RS 4 Default value is \*(Aq\fB$QT_BINPATH\fR/moc\*(Aq\&. .RE .PP \fBQT_MOCCXXPREFIX\fR .RS 4 Default value is \*(Aq\*(Aq\&. Prefix for moc output files, when source is a cxx file\&. .RE .PP \fBQT_MOCCXXSUFFIX\fR .RS 4 Default value is \*(Aq\&.moc\*(Aq\&. Suffix for moc output files, when source is a cxx file\&. .RE .PP \fBQT_MOCFROMCXXCOM\fR .RS 4 Command to generate a moc file from a cpp file\&. .RE .PP \fBQT_MOCFROMCXXCOMSTR\fR .RS 4 The string displayed when generating a moc file from a cpp file\&. If this is not set, then \fB$QT_MOCFROMCXXCOM\fR (the command line) is displayed\&. .RE .PP \fBQT_MOCFROMCXXFLAGS\fR .RS 4 Default value is \*(Aq\-i\*(Aq\&. These flags are passed to moc, when moccing a C++ file\&. .RE .PP \fBQT_MOCFROMHCOM\fR .RS 4 Command to generate a moc file from a header\&. .RE .PP \fBQT_MOCFROMHCOMSTR\fR .RS 4 The string displayed when generating a moc file from a cpp file\&. If this is not set, then \fB$QT_MOCFROMHCOM\fR (the command line) is displayed\&. .RE .PP \fBQT_MOCFROMHFLAGS\fR .RS 4 Default value is \*(Aq\*(Aq\&. These flags are passed to moc, when moccing a header file\&. .RE .PP \fBQT_MOCHPREFIX\fR .RS 4 Default value is \*(Aqmoc_\*(Aq\&. Prefix for moc output files, when source is a header\&. .RE .PP \fBQT_MOCHSUFFIX\fR .RS 4 Default value is \*(Aq\fB$CXXFILESUFFIX\fR\*(Aq\&. Suffix for moc output files, when source is a header\&. .RE .PP \fBQT_UIC\fR .RS 4 Default value is \*(Aq\fB$QT_BINPATH\fR/uic\*(Aq\&. .RE .PP \fBQT_UICCOM\fR .RS 4 Command to generate header files from \&.ui files\&. .RE .PP \fBQT_UICCOMSTR\fR .RS 4 The string displayed when generating header files from \&.ui files\&. If this is not set, then \fB$QT_UICCOM\fR (the command line) is displayed\&. .RE .PP \fBQT_UICDECLFLAGS\fR .RS 4 Default value is \*(Aq\*(Aq\&. These flags are passed to uic, when creating a a h file from a \&.ui file\&. .RE .PP \fBQT_UICDECLPREFIX\fR .RS 4 Default value is \*(Aq\*(Aq\&. Prefix for uic generated header files\&. .RE .PP \fBQT_UICDECLSUFFIX\fR .RS 4 Default value is \*(Aq\&.h\*(Aq\&. Suffix for uic generated header files\&. .RE .PP \fBQT_UICIMPLFLAGS\fR .RS 4 Default value is \*(Aq\*(Aq\&. These flags are passed to uic, when creating a cxx file from a \&.ui file\&. .RE .PP \fBQT_UICIMPLPREFIX\fR .RS 4 Default value is \*(Aquic_\*(Aq\&. Prefix for uic generated implementation files\&. .RE .PP \fBQT_UICIMPLSUFFIX\fR .RS 4 Default value is \*(Aq\fB$CXXFILESUFFIX\fR\*(Aq\&. Suffix for uic generated implementation files\&. .RE .PP \fBQT_UISUFFIX\fR .RS 4 Default value is \*(Aq\&.ui\*(Aq\&. Suffix of designer input files\&. .RE .PP \fBQTDIR\fR .RS 4 The qt tool tries to take this from os\&.environ\&. It also initializes all QT_* construction variables listed below\&. (Note that all paths are constructed with python\*(Aqs os\&.path\&.join() method, but are listed here with the \*(Aq/\*(Aq separator for easier reading\&.) In addition, the construction environment variables \fB$CPPPATH\fR, \fB$LIBPATH\fR and \fB$LIBS\fR may be modified and the variables \fB$PROGEMITTER\fR, \fB$SHLIBEMITTER\fR and \fB$LIBEMITTER\fR are modified\&. Because the build\-performance is affected when using this tool, you have to explicitly specify it at Environment creation: .sp .if n \{\ .RS 4 .\} .nf Environment(tools=[\*(Aqdefault\*(Aq,\*(Aqqt\*(Aq]) .fi .if n \{\ .RE .\} .sp The qt tool supports the following operations: .sp \fBAutomatic moc file generation from header files\&.\fR You do not have to specify moc files explicitly, the tool does it for you\&. However, there are a few preconditions to do so: Your header file must have the same filebase as your implementation file and must stay in the same directory\&. It must have one of the suffixes \&.h, \&.hpp, \&.H, \&.hxx, \&.hh\&. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0\&. See also the corresponding \fBMoc\fR() builder method\&. .sp \fBAutomatic moc file generation from cxx files\&.\fR As stated in the qt documentation, include the moc file at the end of the cxx file\&. Note that you have to include the file, which is generated by the transformation ${QT_MOCCXXPREFIX}${QT_MOCCXXSUFFIX}, by default \&.moc\&. A warning is generated after building the moc file, if you do not include the correct file\&. If you are using VariantDir, you may need to specify duplicate=1\&. You can turn off automatic moc file generation by setting QT_AUTOSCAN to 0\&. See also the corresponding \fBMoc\fR builder method\&. .sp \fBAutomatic handling of \&.ui files\&.\fR The implementation files generated from \&.ui files are handled much the same as yacc or lex files\&. Each \&.ui file given as a source of Program, Library or SharedLibrary will generate three files, the declaration file, the implementation file and a moc file\&. Because there are also generated headers, you may need to specify duplicate=1 in calls to VariantDir\&. See also the corresponding \fBUic\fR builder method\&. .RE .PP \fBRANLIB\fR .RS 4 The archive indexer\&. .RE .PP \fBRANLIBCOM\fR .RS 4 The command line used to index a static library archive\&. .RE .PP \fBRANLIBCOMSTR\fR .RS 4 The string displayed when a static library archive is indexed\&. If this is not set, then \fB$RANLIBCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(RANLIBCOMSTR = "Indexing $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBRANLIBFLAGS\fR .RS 4 General options passed to the archive indexer\&. .RE .PP \fBRC\fR .RS 4 The resource compiler used to build a Microsoft Visual C++ resource file\&. .RE .PP \fBRCCOM\fR .RS 4 The command line used to build a Microsoft Visual C++ resource file\&. .RE .PP \fBRCCOMSTR\fR .RS 4 The string displayed when invoking the resource compiler to build a Microsoft Visual C++ resource file\&. If this is not set, then \fB$RCCOM\fR (the command line) is displayed\&. .RE .PP \fBRCFLAGS\fR .RS 4 The flags passed to the resource compiler by the RES builder\&. .RE .PP \fBRCINCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the command\-line options for specifying directories to be searched by the resource compiler\&. The value of \fB$RCINCFLAGS\fR is created by respectively prepending and appending \fB$RCINCPREFIX\fR and \fB$RCINCSUFFIX\fR to the beginning and end of each directory in \fB$CPPPATH\fR\&. .RE .PP \fBRCINCPREFIX\fR .RS 4 The prefix (flag) used to specify an include directory on the resource compiler command line\&. This will be prepended to the beginning of each directory in the \fB$CPPPATH\fR construction variable when the \fB$RCINCFLAGS\fR variable is expanded\&. .RE .PP \fBRCINCSUFFIX\fR .RS 4 The suffix used to specify an include directory on the resource compiler command line\&. This will be appended to the end of each directory in the \fB$CPPPATH\fR construction variable when the \fB$RCINCFLAGS\fR variable is expanded\&. .RE .PP \fBRDirs\fR .RS 4 A function that converts a string into a list of Dir instances by searching the repositories\&. .RE .PP \fBREGSVR\fR .RS 4 The program used on Windows systems to register a newly\-built DLL library whenever the \fBSharedLibrary\fR builder is passed a keyword argument of register=1\&. .RE .PP \fBREGSVRCOM\fR .RS 4 The command line used on Windows systems to register a newly\-built DLL library whenever the \fBSharedLibrary\fR builder is passed a keyword argument of register=1\&. .RE .PP \fBREGSVRCOMSTR\fR .RS 4 The string displayed when registering a newly\-built DLL file\&. If this is not set, then \fB$REGSVRCOM\fR (the command line) is displayed\&. .RE .PP \fBREGSVRFLAGS\fR .RS 4 Flags passed to the DLL registration program on Windows systems when a newly\-built DLL library is registered\&. By default, this includes the \fB/s\fR that prevents dialog boxes from popping up and requiring user attention\&. .RE .PP \fBRMIC\fR .RS 4 The Java RMI stub compiler\&. .RE .PP \fBRMICCOM\fR .RS 4 The command line used to compile stub and skeleton class files from Java classes that contain RMI implementations\&. Any options specified in the \fB$RMICFLAGS\fR construction variable are included on this command line\&. .RE .PP \fBRMICCOMSTR\fR .RS 4 The string displayed when compiling stub and skeleton class files from Java classes that contain RMI implementations\&. If this is not set, then \fB$RMICCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(RMICCOMSTR = "Generating stub/skeleton class files $TARGETS from $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBRMICFLAGS\fR .RS 4 General options passed to the Java RMI stub compiler\&. .RE .PP \fBRPATH\fR .RS 4 A list of paths to search for shared libraries when running programs\&. Currently only used in the GNU (gnulink), IRIX (sgilink) and Sun (sunlink) linkers\&. Ignored on platforms and toolchains that don\*(Aqt support it\&. Note that the paths added to RPATH are not transformed by \fBscons\fR in any way: if you want an absolute path, you must make it absolute yourself\&. .RE .PP \fB_RPATH\fR .RS 4 An automatically\-generated construction variable containing the rpath flags to be used when linking a program with shared libraries\&. The value of \fB$_RPATH\fR is created by respectively prepending \fB$RPATHPREFIX\fR and appending \fB$RPATHSUFFIX\fR to the beginning and end of each directory in \fB$RPATH\fR\&. .RE .PP \fBRPATHPREFIX\fR .RS 4 The prefix used to specify a directory to be searched for shared libraries when running programs\&. This will be prepended to the beginning of each directory in the \fB$RPATH\fR construction variable when the \fB$_RPATH\fR variable is automatically generated\&. .RE .PP \fBRPATHSUFFIX\fR .RS 4 The suffix used to specify a directory to be searched for shared libraries when running programs\&. This will be appended to the end of each directory in the \fB$RPATH\fR construction variable when the \fB$_RPATH\fR variable is automatically generated\&. .RE .PP \fBRPCGEN\fR .RS 4 The RPC protocol compiler\&. .RE .PP \fBRPCGENCLIENTFLAGS\fR .RS 4 Options passed to the RPC protocol compiler when generating client side stubs\&. These are in addition to any flags specified in the \fB$RPCGENFLAGS\fR construction variable\&. .RE .PP \fBRPCGENFLAGS\fR .RS 4 General options passed to the RPC protocol compiler\&. .RE .PP \fBRPCGENHEADERFLAGS\fR .RS 4 Options passed to the RPC protocol compiler when generating a header file\&. These are in addition to any flags specified in the \fB$RPCGENFLAGS\fR construction variable\&. .RE .PP \fBRPCGENSERVICEFLAGS\fR .RS 4 Options passed to the RPC protocol compiler when generating server side stubs\&. These are in addition to any flags specified in the \fB$RPCGENFLAGS\fR construction variable\&. .RE .PP \fBRPCGENXDRFLAGS\fR .RS 4 Options passed to the RPC protocol compiler when generating XDR routines\&. These are in addition to any flags specified in the \fB$RPCGENFLAGS\fR construction variable\&. .RE .PP \fBSCANNERS\fR .RS 4 A list of the available implicit dependency scanners\&. New file scanners may be added by appending to this list, although the more flexible approach is to associate scanners with a specific Builder\&. See the manpage sections "Builder Objects" and "Scanner Objects" for more information\&. .RE .PP \fBSCONS_HOME\fR .RS 4 The (optional) path to the SCons library directory, initialized from the external environment\&. If set, this is used to construct a shorter and more efficient search path in the \fB$MSVSSCONS\fR command line executed from Microsoft Visual Studio project files\&. .RE .PP \fBSHCC\fR .RS 4 The C compiler used for generating shared\-library objects\&. See also \fB$CC\fR for compiling to static objects\&. .RE .PP \fBSHCCCOM\fR .RS 4 The command line used to compile a C source file to a shared\-library object file\&. Any options specified in the \fB$SHCFLAGS\fR, \fB$SHCCFLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. See also \fB$CCCOM\fR for compiling to static objects\&. .RE .PP \fBSHCCCOMSTR\fR .RS 4 If set, the string displayed when a C source file is compiled to a shared object file\&. If not set, then \fB$SHCCCOM\fR (the command line) is displayed\&. See also \fB$CCCOMSTR\fR for compiling to static objects\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(SHCCCOMSTR = "Compiling shared object $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBSHCCFLAGS\fR .RS 4 Options that are passed to the C and C++ compilers to generate shared\-library objects\&. See also \fB$CCFLAGS\fR for compiling to static objects\&. .RE .PP \fBSHCFLAGS\fR .RS 4 Options that are passed to the C compiler (only; not C++) to generate shared\-library objects\&. See also \fB$CFLAGS\fR for compiling to static objects\&. .RE .PP \fBSHCXX\fR .RS 4 The C++ compiler used for generating shared\-library objects\&. See also \fB$CXX\fR for compiling to static objects\&. .RE .PP \fBSHCXXCOM\fR .RS 4 The command line used to compile a C++ source file to a shared\-library object file\&. Any options specified in the \fB$SHCXXFLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. See also \fB$CXXCOM\fR for compiling to static objects\&. .RE .PP \fBSHCXXCOMSTR\fR .RS 4 If set, the string displayed when a C++ source file is compiled to a shared object file\&. If not set, then \fB$SHCXXCOM\fR (the command line) is displayed\&. See also \fB$CXXCOMSTR\fR for compiling to static objects\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(SHCXXCOMSTR = "Compiling shared object $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBSHCXXFLAGS\fR .RS 4 Options that are passed to the C++ compiler to generate shared\-library objects\&. See also \fB$CXXFLAGS\fR for compiling to static objects\&. .RE .PP \fBSHDC\fR .RS 4 The name of the compiler to use when compiling D source destined to be in a shared objects\&. See also \fB$DC\fR for compiling to static objects\&. .RE .PP \fBSHDCOM\fR .RS 4 The command line to use when compiling code to be part of shared objects\&. See also \fB$DCOM\fR for compiling to static objects\&. .RE .PP \fBSHDCOMSTR\fR .RS 4 If set, the string displayed when a D source file is compiled to a (shared) object file\&. If not set, then \fB$SHDCOM\fR (the command line) is displayed\&. See also \fB$DCOMSTR\fR for compiling to static objects\&. .RE .PP \fBSHDLIBVERSION\fR .RS 4 SHDLIBVERSION\&. .RE .PP \fBSHDLIBVERSIONFLAGS\fR .RS 4 SHDLIBVERSIONFLAGS\&. .RE .PP \fBSHDLINK\fR .RS 4 The linker to use when creating shared objects for code bases include D sources\&. See also \fB$DLINK\fR for linking static objects\&. .RE .PP \fBSHDLINKCOM\fR .RS 4 The command line to use when generating shared objects\&. See also \fB$DLINKCOM\fR for linking static objects\&. .RE .PP \fBSHDLINKFLAGS\fR .RS 4 The list of flags to use when generating a shared object\&. See also \fB$DLINKFLAGS\fR for linking static objects\&. .RE .PP \fBSHELL\fR .RS 4 A string naming the shell program that will be passed to the \fB$SPAWN\fR function\&. See the \fB$SPAWN\fR construction variable for more information\&. .RE .PP \fBSHF03\fR .RS 4 The Fortran 03 compiler used for generating shared\-library objects\&. You should normally set the \fB$SHFORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$SHF03\fR if you need to use a specific compiler or compiler version for Fortran 03 files\&. .RE .PP \fBSHF03COM\fR .RS 4 The command line used to compile a Fortran 03 source file to a shared\-library object file\&. You only need to set \fB$SHF03COM\fR if you need to use a specific command line for Fortran 03 files\&. You should normally set the \fB$SHFORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBSHF03COMSTR\fR .RS 4 If set, the string displayed when a Fortran 03 source file is compiled to a shared\-library object file\&. If not set, then \fB$SHF03COM\fR or \fB$SHFORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF03FLAGS\fR .RS 4 Options that are passed to the Fortran 03 compiler to generated shared\-library objects\&. You only need to set \fB$SHF03FLAGS\fR if you need to define specific user options for Fortran 03 files\&. You should normally set the \fB$SHFORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fBSHF03PPCOM\fR .RS 4 The command line used to compile a Fortran 03 source file to a shared\-library object file after first running the file through the C preprocessor\&. Any options specified in the \fB$SHF03FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$SHF03PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 03 files\&. You should normally set the \fB$SHFORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBSHF03PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 03 source file is compiled to a shared\-library object file after first running the file through the C preprocessor\&. If not set, then \fB$SHF03PPCOM\fR or \fB$SHFORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF08\fR .RS 4 The Fortran 08 compiler used for generating shared\-library objects\&. You should normally set the \fB$SHFORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$SHF08\fR if you need to use a specific compiler or compiler version for Fortran 08 files\&. .RE .PP \fBSHF08COM\fR .RS 4 The command line used to compile a Fortran 08 source file to a shared\-library object file\&. You only need to set \fB$SHF08COM\fR if you need to use a specific command line for Fortran 08 files\&. You should normally set the \fB$SHFORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBSHF08COMSTR\fR .RS 4 If set, the string displayed when a Fortran 08 source file is compiled to a shared\-library object file\&. If not set, then \fB$SHF08COM\fR or \fB$SHFORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF08FLAGS\fR .RS 4 Options that are passed to the Fortran 08 compiler to generated shared\-library objects\&. You only need to set \fB$SHF08FLAGS\fR if you need to define specific user options for Fortran 08 files\&. You should normally set the \fB$SHFORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fBSHF08PPCOM\fR .RS 4 The command line used to compile a Fortran 08 source file to a shared\-library object file after first running the file through the C preprocessor\&. Any options specified in the \fB$SHF08FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$SHF08PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 08 files\&. You should normally set the \fB$SHFORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBSHF08PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 08 source file is compiled to a shared\-library object file after first running the file through the C preprocessor\&. If not set, then \fB$SHF08PPCOM\fR or \fB$SHFORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF77\fR .RS 4 The Fortran 77 compiler used for generating shared\-library objects\&. You should normally set the \fB$SHFORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$SHF77\fR if you need to use a specific compiler or compiler version for Fortran 77 files\&. .RE .PP \fBSHF77COM\fR .RS 4 The command line used to compile a Fortran 77 source file to a shared\-library object file\&. You only need to set \fB$SHF77COM\fR if you need to use a specific command line for Fortran 77 files\&. You should normally set the \fB$SHFORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBSHF77COMSTR\fR .RS 4 If set, the string displayed when a Fortran 77 source file is compiled to a shared\-library object file\&. If not set, then \fB$SHF77COM\fR or \fB$SHFORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF77FLAGS\fR .RS 4 Options that are passed to the Fortran 77 compiler to generated shared\-library objects\&. You only need to set \fB$SHF77FLAGS\fR if you need to define specific user options for Fortran 77 files\&. You should normally set the \fB$SHFORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fBSHF77PPCOM\fR .RS 4 The command line used to compile a Fortran 77 source file to a shared\-library object file after first running the file through the C preprocessor\&. Any options specified in the \fB$SHF77FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$SHF77PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 77 files\&. You should normally set the \fB$SHFORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBSHF77PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 77 source file is compiled to a shared\-library object file after first running the file through the C preprocessor\&. If not set, then \fB$SHF77PPCOM\fR or \fB$SHFORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF90\fR .RS 4 The Fortran 90 compiler used for generating shared\-library objects\&. You should normally set the \fB$SHFORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$SHF90\fR if you need to use a specific compiler or compiler version for Fortran 90 files\&. .RE .PP \fBSHF90COM\fR .RS 4 The command line used to compile a Fortran 90 source file to a shared\-library object file\&. You only need to set \fB$SHF90COM\fR if you need to use a specific command line for Fortran 90 files\&. You should normally set the \fB$SHFORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBSHF90COMSTR\fR .RS 4 If set, the string displayed when a Fortran 90 source file is compiled to a shared\-library object file\&. If not set, then \fB$SHF90COM\fR or \fB$SHFORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF90FLAGS\fR .RS 4 Options that are passed to the Fortran 90 compiler to generated shared\-library objects\&. You only need to set \fB$SHF90FLAGS\fR if you need to define specific user options for Fortran 90 files\&. You should normally set the \fB$SHFORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fBSHF90PPCOM\fR .RS 4 The command line used to compile a Fortran 90 source file to a shared\-library object file after first running the file through the C preprocessor\&. Any options specified in the \fB$SHF90FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$SHF90PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 90 files\&. You should normally set the \fB$SHFORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBSHF90PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 90 source file is compiled to a shared\-library object file after first running the file through the C preprocessor\&. If not set, then \fB$SHF90PPCOM\fR or \fB$SHFORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF95\fR .RS 4 The Fortran 95 compiler used for generating shared\-library objects\&. You should normally set the \fB$SHFORTRAN\fR variable, which specifies the default Fortran compiler for all Fortran versions\&. You only need to set \fB$SHF95\fR if you need to use a specific compiler or compiler version for Fortran 95 files\&. .RE .PP \fBSHF95COM\fR .RS 4 The command line used to compile a Fortran 95 source file to a shared\-library object file\&. You only need to set \fB$SHF95COM\fR if you need to use a specific command line for Fortran 95 files\&. You should normally set the \fB$SHFORTRANCOM\fR variable, which specifies the default command line for all Fortran versions\&. .RE .PP \fBSHF95COMSTR\fR .RS 4 If set, the string displayed when a Fortran 95 source file is compiled to a shared\-library object file\&. If not set, then \fB$SHF95COM\fR or \fB$SHFORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBSHF95FLAGS\fR .RS 4 Options that are passed to the Fortran 95 compiler to generated shared\-library objects\&. You only need to set \fB$SHF95FLAGS\fR if you need to define specific user options for Fortran 95 files\&. You should normally set the \fB$SHFORTRANFLAGS\fR variable, which specifies the user\-specified options passed to the default Fortran compiler for all Fortran versions\&. .RE .PP \fBSHF95PPCOM\fR .RS 4 The command line used to compile a Fortran 95 source file to a shared\-library object file after first running the file through the C preprocessor\&. Any options specified in the \fB$SHF95FLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. You only need to set \fB$SHF95PPCOM\fR if you need to use a specific C\-preprocessor command line for Fortran 95 files\&. You should normally set the \fB$SHFORTRANPPCOM\fR variable, which specifies the default C\-preprocessor command line for all Fortran versions\&. .RE .PP \fBSHF95PPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran 95 source file is compiled to a shared\-library object file after first running the file through the C preprocessor\&. If not set, then \fB$SHF95PPCOM\fR or \fB$SHFORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBSHFORTRAN\fR .RS 4 The default Fortran compiler used for generating shared\-library objects\&. .RE .PP \fBSHFORTRANCOM\fR .RS 4 The command line used to compile a Fortran source file to a shared\-library object file\&. .RE .PP \fBSHFORTRANCOMSTR\fR .RS 4 If set, the string displayed when a Fortran source file is compiled to a shared\-library object file\&. If not set, then \fB$SHFORTRANCOM\fR (the command line) is displayed\&. .RE .PP \fBSHFORTRANFLAGS\fR .RS 4 Options that are passed to the Fortran compiler to generate shared\-library objects\&. .RE .PP \fBSHFORTRANPPCOM\fR .RS 4 The command line used to compile a Fortran source file to a shared\-library object file after first running the file through the C preprocessor\&. Any options specified in the \fB$SHFORTRANFLAGS\fR and \fB$CPPFLAGS\fR construction variables are included on this command line\&. .RE .PP \fBSHFORTRANPPCOMSTR\fR .RS 4 If set, the string displayed when a Fortran source file is compiled to a shared\-library object file after first running the file through the C preprocessor\&. If not set, then \fB$SHFORTRANPPCOM\fR (the command line) is displayed\&. .RE .PP \fBSHLIBEMITTER\fR .RS 4 Contains the emitter specification for the \fBSharedLibrary\fR builder\&. The manpage section "Builder Objects" contains general information on specifying emitters\&. .RE .PP \fBSHLIBNOVERSIONSYMLINKS\fR .RS 4 Instructs the \fBSharedLibrary\fR builder to not create symlinks for versioned shared libraries\&. .RE .PP \fBSHLIBPREFIX\fR .RS 4 The prefix used for shared library file names\&. .RE .PP \fB_SHLIBSONAME\fR .RS 4 A macro that automatically generates shared library\*(Aqs SONAME based on $TARGET, $SHLIBVERSION and $SHLIBSUFFIX\&. Used by \fBSharedLibrary\fR builder when the linker tool supports SONAME (e\&.g\&. gnulink)\&. .RE .PP \fBSHLIBSUFFIX\fR .RS 4 The suffix used for shared library file names\&. .RE .PP \fBSHLIBVERSION\fR .RS 4 When this construction variable is defined, a versioned shared library is created by the \fBSharedLibrary\fR builder\&. This activates the \fB$_SHLIBVERSIONFLAGS\fR and thus modifies the \fB$SHLINKCOM\fR as required, adds the version number to the library name, and creates the symlinks that are needed\&. \fB$SHLIBVERSION\fR versions should exist as alpha\-numeric, decimal\-delimited values as defined by the regular expression "\ew+[\e\&.\ew+]*"\&. Example \fB$SHLIBVERSION\fR values include \*(Aq1\*(Aq, \*(Aq1\&.2\&.3\*(Aq, and \*(Aq1\&.2\&.gitaa412c8b\*(Aq\&. .RE .PP \fB_SHLIBVERSIONFLAGS\fR .RS 4 This macro automatically introduces extra flags to \fB$SHLINKCOM\fR when building versioned \fBSharedLibrary\fR (that is when \fB$SHLIBVERSION\fR is set)\&. _SHLIBVERSIONFLAGS usually adds \fB$SHLIBVERSIONFLAGS\fR and some extra dynamically generated options (such as \-Wl,\-soname=$_SHLIBSONAME\&. It is unused by "plain" (unversioned) shared libraries\&. .RE .PP \fBSHLIBVERSIONFLAGS\fR .RS 4 Extra flags added to \fB$SHLINKCOM\fR when building versioned \fBSharedLibrary\fR\&. These flags are only used when \fB$SHLIBVERSION\fR is set\&. .RE .PP \fBSHLINK\fR .RS 4 The linker for programs that use shared libraries\&. See also \fB$LINK\fR for linking static objects\&. .RE .PP \fBSHLINKCOM\fR .RS 4 The command line used to link programs using shared libraries\&. See also \fB$LINKCOM\fR for linking static objects\&. .RE .PP \fBSHLINKCOMSTR\fR .RS 4 The string displayed when programs using shared libraries are linked\&. If this is not set, then \fB$SHLINKCOM\fR (the command line) is displayed\&. See also \fB$LINKCOMSTR\fR for linking static objects\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(SHLINKCOMSTR = "Linking shared $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBSHLINKFLAGS\fR .RS 4 General user options passed to the linker for programs using shared libraries\&. Note that this variable should \fInot\fR contain \fB\-l\fR (or similar) options for linking with the libraries listed in \fB$LIBS\fR, nor \fB\-L\fR (or similar) include search path options that scons generates automatically from \fB$LIBPATH\fR\&. See \fB$_LIBFLAGS\fR above, for the variable that expands to library\-link options, and \fB$_LIBDIRFLAGS\fR above, for the variable that expands to library search path options\&. See also \fB$LINKFLAGS\fR for linking static objects\&. .RE .PP \fBSHOBJPREFIX\fR .RS 4 The prefix used for shared object file names\&. .RE .PP \fBSHOBJSUFFIX\fR .RS 4 The suffix used for shared object file names\&. .RE .PP \fBSONAME\fR .RS 4 Variable used to hard\-code SONAME for versioned shared library/loadable module\&. .sp .if n \{\ .RS 4 .\} .nf env\&.SharedLibrary(\*(Aqtest\*(Aq, \*(Aqtest\&.c\*(Aq, SHLIBVERSION=\*(Aq0\&.1\&.2\*(Aq, SONAME=\*(Aqlibtest\&.so\&.2\*(Aq) .fi .if n \{\ .RE .\} .sp The variable is used, for example, by gnulink linker tool\&. .RE .PP \fBSOURCE\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBSOURCE_URL\fR .RS 4 The URL (web address) of the location from which the project was retrieved\&. This is used to fill in the Source: field in the controlling information for Ipkg and RPM packages\&. .RE .PP \fBSOURCES\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBSPAWN\fR .RS 4 A command interpreter function that will be called to execute command line strings\&. The function must expect the following arguments: .sp .if n \{\ .RS 4 .\} .nf def spawn(shell, escape, cmd, args, env): .fi .if n \{\ .RE .\} .sp \fIsh\fR is a string naming the shell program to use\&. \fIescape\fR is a function that can be called to escape shell special characters in the command line\&. \fIcmd\fR is the path to the command to be executed\&. \fIargs\fR is the arguments to the command\&. \fIenv\fR is a dictionary of the environment variables in which the command should be executed\&. .RE .PP \fBSTATIC_AND_SHARED_OBJECTS_ARE_THE_SAME\fR .RS 4 When this variable is true, static objects and shared objects are assumed to be the same; that is, SCons does not check for linking static objects into a shared library\&. .RE .PP \fBSUBST_DICT\fR .RS 4 The dictionary used by the \fBSubstfile\fR or \fBTextfile\fR builders for substitution values\&. It can be anything acceptable to the \fBdict()\fR constructor, so in addition to a dictionary, lists of tuples are also acceptable\&. .RE .PP \fBSUBSTFILEPREFIX\fR .RS 4 The prefix used for \fBSubstfile\fR file names, an empty string by default\&. .RE .PP \fBSUBSTFILESUFFIX\fR .RS 4 The suffix used for \fBSubstfile\fR file names, an empty string by default\&. .RE .PP \fBSUMMARY\fR .RS 4 A short summary of what the project is about\&. This is used to fill in the Summary: field in the controlling information for Ipkg and RPM packages, and as the Description: field in MSI packages\&. .RE .PP \fBSWIG\fR .RS 4 The scripting language wrapper and interface generator\&. .RE .PP \fBSWIGCFILESUFFIX\fR .RS 4 The suffix that will be used for intermediate C source files generated by the scripting language wrapper and interface generator\&. The default value is _wrap\fB$CFILESUFFIX\fR\&. By default, this value is used whenever the \fB\-c++\fR option is \fInot\fR specified as part of the \fB$SWIGFLAGS\fR construction variable\&. .RE .PP \fBSWIGCOM\fR .RS 4 The command line used to call the scripting language wrapper and interface generator\&. .RE .PP \fBSWIGCOMSTR\fR .RS 4 The string displayed when calling the scripting language wrapper and interface generator\&. If this is not set, then \fB$SWIGCOM\fR (the command line) is displayed\&. .RE .PP \fBSWIGCXXFILESUFFIX\fR .RS 4 The suffix that will be used for intermediate C++ source files generated by the scripting language wrapper and interface generator\&. The default value is _wrap\fB$CFILESUFFIX\fR\&. By default, this value is used whenever the \-c++ option is specified as part of the \fB$SWIGFLAGS\fR construction variable\&. .RE .PP \fBSWIGDIRECTORSUFFIX\fR .RS 4 The suffix that will be used for intermediate C++ header files generated by the scripting language wrapper and interface generator\&. These are only generated for C++ code when the SWIG \*(Aqdirectors\*(Aq feature is turned on\&. The default value is _wrap\&.h\&. .RE .PP \fBSWIGFLAGS\fR .RS 4 General options passed to the scripting language wrapper and interface generator\&. This is where you should set \fB\-python\fR, \fB\-perl5\fR, \fB\-tcl\fR, or whatever other options you want to specify to SWIG\&. If you set the \fB\-c++\fR option in this variable, \fBscons\fR will, by default, generate a C++ intermediate source file with the extension that is specified as the \fB$CXXFILESUFFIX\fR variable\&. .RE .PP \fB_SWIGINCFLAGS\fR .RS 4 An automatically\-generated construction variable containing the SWIG command\-line options for specifying directories to be searched for included files\&. The value of \fB$_SWIGINCFLAGS\fR is created by respectively prepending and appending \fB$SWIGINCPREFIX\fR and \fB$SWIGINCSUFFIX\fR to the beginning and end of each directory in \fB$SWIGPATH\fR\&. .RE .PP \fBSWIGINCPREFIX\fR .RS 4 The prefix used to specify an include directory on the SWIG command line\&. This will be prepended to the beginning of each directory in the \fB$SWIGPATH\fR construction variable when the \fB$_SWIGINCFLAGS\fR variable is automatically generated\&. .RE .PP \fBSWIGINCSUFFIX\fR .RS 4 The suffix used to specify an include directory on the SWIG command line\&. This will be appended to the end of each directory in the \fB$SWIGPATH\fR construction variable when the \fB$_SWIGINCFLAGS\fR variable is automatically generated\&. .RE .PP \fBSWIGOUTDIR\fR .RS 4 Specifies the output directory in which the scripting language wrapper and interface generator should place generated language\-specific files\&. This will be used by SCons to identify the files that will be generated by the swig call, and translated into the swig \-outdir option on the command line\&. .RE .PP \fBSWIGPATH\fR .RS 4 The list of directories that the scripting language wrapper and interface generate will search for included files\&. The SWIG implicit dependency scanner will search these directories for include files\&. The default value is an empty list\&. .sp Don\*(Aqt explicitly put include directory arguments in SWIGFLAGS; the result will be non\-portable and the directories will not be searched by the dependency scanner\&. Note: directory names in SWIGPATH will be looked\-up relative to the SConscript directory when they are used in a command\&. To force \fBscons\fR to look\-up a directory relative to the root of the source tree use #: .sp .if n \{\ .RS 4 .\} .nf env = Environment(SWIGPATH=\*(Aq#/include\*(Aq) .fi .if n \{\ .RE .\} .sp The directory look\-up can also be forced using the \fBDir\fR() function: .sp .if n \{\ .RS 4 .\} .nf include = Dir(\*(Aqinclude\*(Aq) env = Environment(SWIGPATH=include) .fi .if n \{\ .RE .\} .sp The directory list will be added to command lines through the automatically\-generated \fB$_SWIGINCFLAGS\fR construction variable, which is constructed by respectively prepending and appending the values of the \fB$SWIGINCPREFIX\fR and \fB$SWIGINCSUFFIX\fR construction variables to the beginning and end of each directory in \fB$SWIGPATH\fR\&. Any command lines you define that need the SWIGPATH directory list should include \fB$_SWIGINCFLAGS\fR: .sp .if n \{\ .RS 4 .\} .nf env = Environment(SWIGCOM="my_swig \-o $TARGET $_SWIGINCFLAGS $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBSWIGVERSION\fR .RS 4 The version number of the SWIG tool\&. .RE .PP \fBTAR\fR .RS 4 The tar archiver\&. .RE .PP \fBTARCOM\fR .RS 4 The command line used to call the tar archiver\&. .RE .PP \fBTARCOMSTR\fR .RS 4 The string displayed when archiving files using the tar archiver\&. If this is not set, then \fB$TARCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(TARCOMSTR = "Archiving $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBTARFLAGS\fR .RS 4 General options passed to the tar archiver\&. .RE .PP \fBTARGET\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBTARGET_ARCH\fR .RS 4 The name of the target hardware architecture for the compiled objects created by this Environment\&. This defaults to the value of HOST_ARCH, and the user can override it\&. Currently only set for Win32\&. .sp Sets the target architecture for Visual Studio compiler (i\&.e\&. the arch of the binaries generated by the compiler)\&. If not set, default to \fB$HOST_ARCH\fR, or, if that is unset, to the architecture of the running machine\*(Aqs OS (note that the python build or architecture has no effect)\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. This is currently only used on Windows, but in the future it will be used on other OSes as well\&. If this is set and \fB$MSVC_VERSION\fR is not set, this will search for all installed MSVC\*(Aqs that support the \fB$TARGET_ARCH\fR, selecting the latest version for use\&. .sp On Windows, valid target values are x86, arm, i386 for 32\-bit targets and amd64, arm64, em64t, x86_64 and ia64 (Itanium) for 64\-bit targets\&. Note that not all target architectures are supported for all Visual Studio / MSVC versions check the relevant Microsoft documentation\&. .sp For example, if you want to compile 64\-bit binaries, you would set TARGET_ARCH=\*(Aqx86_64\*(Aq in your SCons environment\&. .RE .PP \fBTARGET_OS\fR .RS 4 The name of the target operating system for the compiled objects created by this Environment\&. This defaults to the value of HOST_OS, and the user can override it\&. Currently only set for Win32\&. .RE .PP \fBTARGETS\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBTARSUFFIX\fR .RS 4 The suffix used for tar file names\&. .RE .PP \fBTEMPFILEARGJOIN\fR .RS 4 The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by \fB$MAXLINELENGTH\fR\&. The default value is a space\&. However for MSVC, MSLINK the default is a line seperator characters as defined by os\&.linesep\&. Note this value is used literally and not expanded by the subst logic\&. .RE .PP \fBTEMPFILEDIR\fR .RS 4 The directory to create the tempfile in\&. .RE .PP \fBTEMPFILEPREFIX\fR .RS 4 The prefix for a temporary file used to store lines lines longer than $MAXLINELENGTH as operations which call out to a shell will fail if the line is too long, which particularly impacts linking\&. The default is \*(Aq@\*(Aq, which works for the Microsoft and GNU toolchains on Windows\&. Set this appropriately for other toolchains, for example \*(Aq\-@\*(Aq for the diab compiler or \*(Aq\-via\*(Aq for ARM toolchain\&. .RE .PP \fBTEMPFILESUFFIX\fR .RS 4 The suffix used for the temporary file name used for long command lines\&. The name should include the dot (\*(Aq\&.\*(Aq) if one is wanted as it will not be added automatically\&. The default is \*(Aq\&.lnk\*(Aq\&. .RE .PP \fBTEX\fR .RS 4 The TeX formatter and typesetter\&. .RE .PP \fBTEXCOM\fR .RS 4 The command line used to call the TeX formatter and typesetter\&. .RE .PP \fBTEXCOMSTR\fR .RS 4 The string displayed when calling the TeX formatter and typesetter\&. If this is not set, then \fB$TEXCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBTEXFLAGS\fR .RS 4 General options passed to the TeX formatter and typesetter\&. .RE .PP \fBTEXINPUTS\fR .RS 4 List of directories that the LaTeX program will search for include directories\&. The LaTeX implicit dependency scanner will search these directories for \einclude and \eimport files\&. .RE .PP \fBTEXTFILEPREFIX\fR .RS 4 The prefix used for \fBTextfile\fR file names, an empty string by default\&. .RE .PP \fBTEXTFILESUFFIX\fR .RS 4 The suffix used for \fBTextfile\fR file names; \&.txt by default\&. .RE .PP \fBTOOLS\fR .RS 4 A list of the names of the Tool specifications that are part of this construction environment\&. .RE .PP \fBUNCHANGED_SOURCES\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBUNCHANGED_TARGETS\fR .RS 4 A reserved variable name that may not be set or used in a construction environment\&. (See the manpage section "Variable Substitution" for more information)\&. .RE .PP \fBVENDOR\fR .RS 4 The person or organization who supply the packaged software\&. This is used to fill in the Vendor: field in the controlling information for RPM packages, and the Manufacturer: field in the controlling information for MSI packages\&. .RE .PP \fBVERSION\fR .RS 4 The version of the project, specified as a string\&. .RE .PP \fBVSWHERE\fR .RS 4 Specify the location of vswhere\&.exe\&. .sp The vswhere\&.exe executable is distributed with Microsoft Visual Studio and Build Tools since the 2017 edition, but is also available standalone\&. It provides full information about installations of 2017 and later editions\&. With the \fB\-legacy\fR argument, vswhere\&.exe can detect installations of the 2010 through 2015 editions with limited data returned\&. If \fBVSWHERE\fR is set, SCons will use that location\&. .sp Otherwise SCons will look in the following locations and set \fBVSWHERE\fR to the path of the first vswhere\&.exe located\&. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} %ProgramFiles(x86)%\eMicrosoft Visual Studio\eInstaller .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} %ProgramFiles%\eMicrosoft Visual Studio\eInstaller .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} %ChocolateyInstall%\ebin .RE .sp Note that \fBVSWHERE\fR must be set at the same time or prior to any of msvc, msvs , and/or mslink \fBTool\fR being initialized\&. Either set it as follows .sp .if n \{\ .RS 4 .\} .nf env = Environment(VSWHERE=\*(Aqc:/my/path/to/vswhere\*(Aq) .fi .if n \{\ .RE .\} .sp or if your construction environment is created specifying an empty tools list (or a list of tools which omits all of default, msvs, msvc, and mslink), and also before \fBenv\&.Tool\fR is called to ininitialize any of those tools: .sp .if n \{\ .RS 4 .\} .nf env = Environment(tools=[]) env[\*(AqVSWHERE\*(Aq] = r\*(Aqc:/my/vswhere/install/location/vswhere\&.exe\*(Aq env\&.Tool(\*(Aqmsvc\*(Aq) env\&.Tool(\*(Aqmslink\*(Aq) env\&.Tool(\*(Aqmsvs\*(Aq) .fi .if n \{\ .RE .\} .sp .RE .PP \fBWIN32_INSERT_DEF\fR .RS 4 A deprecated synonym for \fB$WINDOWS_INSERT_DEF\fR\&. .RE .PP \fBWIN32DEFPREFIX\fR .RS 4 A deprecated synonym for \fB$WINDOWSDEFPREFIX\fR\&. .RE .PP \fBWIN32DEFSUFFIX\fR .RS 4 A deprecated synonym for \fB$WINDOWSDEFSUFFIX\fR\&. .RE .PP \fBWIN32EXPPREFIX\fR .RS 4 A deprecated synonym for \fB$WINDOWSEXPSUFFIX\fR\&. .RE .PP \fBWIN32EXPSUFFIX\fR .RS 4 A deprecated synonym for \fB$WINDOWSEXPSUFFIX\fR\&. .RE .PP \fBWINDOWS_EMBED_MANIFEST\fR .RS 4 Set this variable to True or 1 to embed the compiler\-generated manifest (normally ${TARGET}\&.manifest) into all Windows exes and DLLs built with this environment, as a resource during their link step\&. This is done using \fB$MT\fR and \fB$MTEXECOM\fR and \fB$MTSHLIBCOM\fR\&. .RE .PP \fBWINDOWS_INSERT_DEF\fR .RS 4 When this is set to true, a library build of a Windows shared library (\&.dll file) will also build a corresponding \&.def file at the same time, if a \&.def file is not already listed as a build target\&. The default is 0 (do not build a \&.def file)\&. .RE .PP \fBWINDOWS_INSERT_MANIFEST\fR .RS 4 When this is set to true, \fBscons\fR will be aware of the \&.manifest files generated by Microsoft Visua C/C++ 8\&. .RE .PP \fBWINDOWSDEFPREFIX\fR .RS 4 The prefix used for Windows \&.def file names\&. .RE .PP \fBWINDOWSDEFSUFFIX\fR .RS 4 The suffix used for Windows \&.def file names\&. .RE .PP \fBWINDOWSEXPPREFIX\fR .RS 4 The prefix used for Windows \&.exp file names\&. .RE .PP \fBWINDOWSEXPSUFFIX\fR .RS 4 The suffix used for Windows \&.exp file names\&. .RE .PP \fBWINDOWSPROGMANIFESTPREFIX\fR .RS 4 The prefix used for executable program \&.manifest files generated by Microsoft Visual C/C++\&. .RE .PP \fBWINDOWSPROGMANIFESTSUFFIX\fR .RS 4 The suffix used for executable program \&.manifest files generated by Microsoft Visual C/C++\&. .RE .PP \fBWINDOWSSHLIBMANIFESTPREFIX\fR .RS 4 The prefix used for shared library \&.manifest files generated by Microsoft Visual C/C++\&. .RE .PP \fBWINDOWSSHLIBMANIFESTSUFFIX\fR .RS 4 The suffix used for shared library \&.manifest files generated by Microsoft Visual C/C++\&. .RE .PP \fBX_IPK_DEPENDS\fR .RS 4 This is used to fill in the Depends: field in the controlling information for Ipkg packages\&. .RE .PP \fBX_IPK_DESCRIPTION\fR .RS 4 This is used to fill in the Description: field in the controlling information for Ipkg packages\&. The default value is $SUMMARY\en$DESCRIPTION .RE .PP \fBX_IPK_MAINTAINER\fR .RS 4 This is used to fill in the Maintainer: field in the controlling information for Ipkg packages\&. .RE .PP \fBX_IPK_PRIORITY\fR .RS 4 This is used to fill in the Priority: field in the controlling information for Ipkg packages\&. .RE .PP \fBX_IPK_SECTION\fR .RS 4 This is used to fill in the Section: field in the controlling information for Ipkg packages\&. .RE .PP \fBX_MSI_LANGUAGE\fR .RS 4 This is used to fill in the Language: attribute in the controlling information for MSI packages\&. .RE .PP \fBX_MSI_LICENSE_TEXT\fR .RS 4 The text of the software license in RTF format\&. Carriage return characters will be replaced with the RTF equivalent \e\epar\&. .RE .PP \fBX_MSI_UPGRADE_CODE\fR .RS 4 TODO .RE .PP \fBX_RPM_AUTOREQPROV\fR .RS 4 This is used to fill in the AutoReqProv: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_BUILD\fR .RS 4 internal, but overridable .RE .PP \fBX_RPM_BUILDREQUIRES\fR .RS 4 This is used to fill in the BuildRequires: field in the RPM \&.spec file\&. Note this should only be used on a host managed by rpm as the dependencies will not be resolvable at build time otherwise\&. .RE .PP \fBX_RPM_BUILDROOT\fR .RS 4 internal, but overridable .RE .PP \fBX_RPM_CLEAN\fR .RS 4 internal, but overridable .RE .PP \fBX_RPM_CONFLICTS\fR .RS 4 This is used to fill in the Conflicts: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_DEFATTR\fR .RS 4 This value is used as the default attributes for the files in the RPM package\&. The default value is (\-,root,root)\&. .RE .PP \fBX_RPM_DISTRIBUTION\fR .RS 4 This is used to fill in the Distribution: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_EPOCH\fR .RS 4 This is used to fill in the Epoch: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_EXCLUDEARCH\fR .RS 4 This is used to fill in the ExcludeArch: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_EXLUSIVEARCH\fR .RS 4 This is used to fill in the ExclusiveArch: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_EXTRADEFS\fR .RS 4 A list used to supply extra defintions or flags to be added to the RPM \&.spec file\&. Each item is added as\-is with a carriage return appended\&. This is useful if some specific RPM feature not otherwise anticipated by SCons needs to be turned on or off\&. Note if this variable is omitted, SCons will by default supply the value \*(Aq%global debug_package %{nil}\*(Aq to disable debug package generation\&. To enable debug package generation, include this variable set either to None, or to a custom list that does not include the default line\&. Added in version 3\&.1\&. .sp .if n \{\ .RS 4 .\} .nf env\&.Package( NAME="foo", \&.\&.\&. X_RPM_EXTRADEFS=[ "%define _unpackaged_files_terminate_build 0" "%define _missing_doc_files_terminate_build 0" ], \&.\&.\&. ) .fi .if n \{\ .RE .\} .RE .PP \fBX_RPM_GROUP\fR .RS 4 This is used to fill in the Group: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_GROUP_lang\fR .RS 4 This is used to fill in the Group(lang): field in the RPM \&.spec file\&. Note that \fIlang\fR is not literal and should be replaced by the appropriate language code\&. .RE .PP \fBX_RPM_ICON\fR .RS 4 This is used to fill in the Icon: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_INSTALL\fR .RS 4 internal, but overridable .RE .PP \fBX_RPM_PACKAGER\fR .RS 4 This is used to fill in the Packager: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_POSTINSTALL\fR .RS 4 This is used to fill in the %post: section in the RPM \&.spec file\&. .RE .PP \fBX_RPM_POSTUNINSTALL\fR .RS 4 This is used to fill in the %postun: section in the RPM \&.spec file\&. .RE .PP \fBX_RPM_PREFIX\fR .RS 4 This is used to fill in the Prefix: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_PREINSTALL\fR .RS 4 This is used to fill in the %pre: section in the RPM \&.spec file\&. .RE .PP \fBX_RPM_PREP\fR .RS 4 internal, but overridable .RE .PP \fBX_RPM_PREUNINSTALL\fR .RS 4 This is used to fill in the %preun: section in the RPM \&.spec file\&. .RE .PP \fBX_RPM_PROVIDES\fR .RS 4 This is used to fill in the Provides: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_REQUIRES\fR .RS 4 This is used to fill in the Requires: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_SERIAL\fR .RS 4 This is used to fill in the Serial: field in the RPM \&.spec file\&. .RE .PP \fBX_RPM_URL\fR .RS 4 This is used to fill in the Url: field in the RPM \&.spec file\&. .RE .PP \fBXGETTEXT\fR .RS 4 Path to \fBxgettext(1)\fR program (found via \fBDetect()\fR)\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fBXGETTEXTCOM\fR .RS 4 Complete xgettext command line\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fBXGETTEXTCOMSTR\fR .RS 4 A string that is shown when \fBxgettext(1)\fR command is invoked (default: \*(Aq\*(Aq, which means "print \fB$XGETTEXTCOM\fR")\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fB_XGETTEXTDOMAIN\fR .RS 4 Internal "macro"\&. Generates \fBxgettext\fR domain name form source and target (default: \*(Aq${TARGET\&.filebase}\*(Aq)\&. .RE .PP \fBXGETTEXTFLAGS\fR .RS 4 Additional flags to \fBxgettext(1)\fR\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fBXGETTEXTFROM\fR .RS 4 Name of file containing list of \fBxgettext(1)\fR\*(Aqs source files\&. Autotools\*(Aq users know this as POTFILES\&.in so they will in most cases set XGETTEXTFROM="POTFILES\&.in" here\&. The \fB$XGETTEXTFROM\fR files have same syntax and semantics as the well known GNU POTFILES\&.in\&. See xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fB_XGETTEXTFROMFLAGS\fR .RS 4 Internal "macro"\&. Genrates list of \-D flags from the \fB$XGETTEXTPATH\fR list\&. .RE .PP \fBXGETTEXTFROMPREFIX\fR .RS 4 This flag is used to add single \fB$XGETTEXTFROM\fR file to \fBxgettext(1)\fR\*(Aqs commandline (default: \*(Aq\-f\*(Aq)\&. .RE .PP \fBXGETTEXTFROMSUFFIX\fR .RS 4 (default: \*(Aq\*(Aq) .RE .PP \fBXGETTEXTPATH\fR .RS 4 List of directories, there \fBxgettext(1)\fR will look for source files (default: [])\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br This variable works only together with \fB$XGETTEXTFROM\fR .sp .5v .RE See also xgettext tool and \fBPOTUpdate\fR builder\&. .RE .PP \fB_XGETTEXTPATHFLAGS\fR .RS 4 Internal "macro"\&. Generates list of \-f flags from \fB$XGETTEXTFROM\fR\&. .RE .PP \fBXGETTEXTPATHPREFIX\fR .RS 4 This flag is used to add single search path to \fBxgettext(1)\fR\*(Aqs commandline (default: \*(Aq\-D\*(Aq)\&. .RE .PP \fBXGETTEXTPATHSUFFIX\fR .RS 4 (default: \*(Aq\*(Aq) .RE .PP \fBYACC\fR .RS 4 The parser generator\&. .RE .PP \fBYACCCOM\fR .RS 4 The command line used to call the parser generator to generate a source file\&. .RE .PP \fBYACCCOMSTR\fR .RS 4 The string displayed when generating a source file using the parser generator\&. If this is not set, then \fB$YACCCOM\fR (the command line) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(YACCCOMSTR = "Yacc\*(Aqing $TARGET from $SOURCES") .fi .if n \{\ .RE .\} .RE .PP \fBYACCFLAGS\fR .RS 4 General options passed to the parser generator\&. If \fB$YACCFLAGS\fR contains a \fB\-d\fR option, SCons assumes that the call will also create a \&.h file (if the yacc source file ends in a \&.y suffix) or a \&.hpp file (if the yacc source file ends in a \&.yy suffix) .RE .PP \fBYACCHFILESUFFIX\fR .RS 4 The suffix of the C header file generated by the parser generator when the \fB\-d\fR option is used\&. Note that setting this variable does not cause the parser generator to generate a header file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord\&. The default value is \&.h\&. .RE .PP \fBYACCHXXFILESUFFIX\fR .RS 4 The suffix of the C++ header file generated by the parser generator when the \fB\-d\fR option is used\&. Note that setting this variable does not cause the parser generator to generate a header file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord\&. The default value is \&.hpp, except on Mac OS X, where the default is ${TARGET\&.suffix}\&.h\&. because the default bison parser generator just appends \&.h to the name of the generated C++ file\&. .RE .PP \fBYACCVCGFILESUFFIX\fR .RS 4 The suffix of the file containing the VCG grammar automaton definition when the \fB\-\-graph=\fR option is used\&. Note that setting this variable does not cause the parser generator to generate a VCG file with the specified suffix, it exists to allow you to specify what suffix the parser generator will use of its own accord\&. The default value is \&.vcg\&. .RE .PP \fBZIP\fR .RS 4 The zip compression and file packaging utility\&. .RE .PP \fBZIPCOM\fR .RS 4 The command line used to call the zip utility, or the internal Python function used to create a zip archive\&. .RE .PP \fBZIPCOMPRESSION\fR .RS 4 The \fIcompression\fR flag from the Python zipfile module used by the internal Python function to control whether the zip archive is compressed or not\&. The default value is zipfile\&.ZIP_DEFLATED, which creates a compressed zip archive\&. This value has no effect if the zipfile module is unavailable\&. .RE .PP \fBZIPCOMSTR\fR .RS 4 The string displayed when archiving files using the zip utility\&. If this is not set, then \fB$ZIPCOM\fR (the command line or internal Python function) is displayed\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(ZIPCOMSTR = "Zipping $TARGET") .fi .if n \{\ .RE .\} .RE .PP \fBZIPFLAGS\fR .RS 4 General options passed to the zip utility\&. .RE .PP \fBZIPROOT\fR .RS 4 An optional zip root directory (default empty)\&. The filenames stored in the zip file will be relative to this directory, if given\&. Otherwise the filenames are relative to the current directory of the command\&. For instance: .sp .if n \{\ .RS 4 .\} .nf env = Environment() env\&.Zip(\*(Aqfoo\&.zip\*(Aq, \*(Aqsubdir1/subdir2/file1\*(Aq, ZIPROOT=\*(Aqsubdir1\*(Aq) .fi .if n \{\ .RE .\} .sp will produce a zip file foo\&.zip containing a file with the name subdir2/file1 rather than subdir1/subdir2/file1\&. .RE .PP \fBZIPSUFFIX\fR .RS 4 The suffix used for zip file names\&. .RE .SS "Configure Contexts" .PP SCons supports a configure context, an integrated mechanism similar to the various \fBAC_CHECK\fR macros in GNU Autoconf for testing the existence of external items needed for the build, such as C header files, libraries, etc\&. The mechanism is portable across platforms\&. .PP \fBscons\fR does not maintain an explicit cache of the tested values (this is different than Autoconf), but uses its normal dependency tracking to keep the checked values up to date\&. However, users may override this behaviour with the \fB\-\-config\fR command line option\&. .PP \fBConfigure\fR(\fIenv, [custom_tests, conf_dir, log_file, config_h, clean, help]\fR), \fIenv\fR\&.Configure(\fI[custom_tests, conf_dir, log_file, config_h, clean, help]\fR) .RS 4 Create a configure context, which tracks information discovered while running tests\&. The context includes a local construction environment (available as \fIcontext\fR\&.\fIenv\fR) which is used when running the tests and which can be updated with the check results\&. Only one context may be active at a time (\fIsince 4\&.0, \fR\fI\fBscons\fR\fR\fI will raise an exception on an attempt to create a new context when there is an active context\fR), but a new context can be created after the active one is completed\&. For the global function form, the required \fIenv\fR describes the initial values for the context\*(Aqs local construction environment; for the construction environment method form the instance provides the values\&. .sp \fIcustom_tests\fR specifies a dictionary containing custom tests (see the section on custom tests below)\&. The default value is \fBNone\fR, meaning no custom tests are added to the configure context\&. .sp \fIconf_dir\fR specifies a directory where the test cases are built\&. This directory is not used for building normal targets\&. The default value is \(lq#/\&.sconf_temp\(rq\&. .sp \fIlog_file\fR specifies a file which collects the output from commands that are executed to check for the existence of header files, libraries, etc\&. The default is \(lq#/config\&.log\(rq\&. If you are using the \fBVariantDir\fR function, you may want to specify a subdirectory under your variant directory\&. .sp \fIconfig_h\fR specifies a C header file where the results of tests will be written\&. The results will consist of lines like #define HAVE_STDIO_H, #define HAVE_LIBM, etc\&. Customarily, the name chosen is \(lqconfig\&.h\(rq\&. The default is to not write a \fIconfig_h\fR file\&. You can specify the same \fIconfig_h\fR file in multiple calls to \fBConfigure\fR, in which case SCons will concatenate all results in the specified file\&. Note that SCons uses its normal dependency checking to decide if it\*(Aqs necessary to rebuild the specified \fIconfig_h\fR file\&. This means that the file is not necessarily re\-built each time scons is run, but is only rebuilt if its contents will have changed and some target that depends on the \fIconfig_h\fR file is being built\&. .sp The \fIclean\fR and \fIhelp\fR arguments can be used to suppress execution of the configuration tests when the \fB\-c\fR/\fB\-\-clean\fR or \fB\-H\fR/\fB\-h\fR/\fB\-\-help\fR options are used, respectively\&. The default behavior is always to execute configure context tests, since the results of the tests may affect the list of targets to be cleaned or the help text\&. If the configure tests do not affect these, then you may add the \fBclean=False\fR or \fBhelp=False\fR arguments (or both) to avoid unnecessary test execution\&. .RE .PP SConf\&.\fBFinish\fR(\fIcontext\fR), \fIcontext\fR\&.Finish() .RS 4 This method must be called after configuration is done\&. Though required, this is not enforced except if \fBConfigure\fR is called again while there is still an active context, in which case an exception is raised\&. \fBFinish\fR returns the environment as modified during the course of running the configuration checks\&. After this method is called, no further checks can be performed with this configuration context\&. However, you can create a new configure context to perform additional checks\&. .RE .PP Example of a typical Configure usage: .sp .if n \{\ .RS 4 .\} .nf env = Environment() conf = Configure(env) if not conf\&.CheckCHeader("math\&.h"): print("We really need math\&.h!") Exit(1) if conf\&.CheckLibWithHeader("qt", "qapp\&.h", "c++", "QApplication qapp(0,0);"): # do stuff for qt \- usage, e\&.g\&. conf\&.env\&.Append(CPPFLAGS="\-DWITH_QT") env = conf\&.Finish() .fi .if n \{\ .RE .\} .PP A configure context has the following predefined methods which can be used to perform checks\&. Where \fIlanguage\fR is a required or optional parameter, the choice can currently be C or C++\&. The spellings accepted for C are \(lqC\(rq or \(lqc\(rq; for C++ the value can be \(lqCXX\(rq, \(lqcxx\(rq, \(lqC++\(rq or \(lqc++\(rq\&. .PP SConf\&.\fBCheckHeader\fR(\fIcontext, header, [include_quotes, language]\fR), \fIcontext\fR\&.CheckHeader(\fIheader, [include_quotes, language]\fR) .RS 4 Checks if \fIheader\fR is usable in the specified language\&. \fIheader\fR may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for\&. The optional argument \fIinclude_quotes\fR must be a two character string, where the first character denotes the opening quote and the second character denotes the closing quote\&. By default, both characters are \fB"\fR (double quote)\&. The optional argument \fIlanguage\fR should be either \fBC\fR or \fBC++\fR and selects the compiler to be used for the check\&. Returns a boolean indicating success or failure\&. .RE .PP SConf\&.\fBCheckCHeader\fR(\fIcontext, header, [include_quotes]\fR), \fIcontext\fR\&.CheckCHeader(\fIheader, [include_quotes]\fR) .RS 4 This is a wrapper around \fBSConf\&.CheckHeader\fR which checks if \fIheader\fR is usable in the C language\&. \fIheader\fR may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for\&. The optional argument \fIinclude_quotes\fR must be a two character string, where the first character denotes the opening quote and the second character denotes the closing quote\&. By default, both characters are \fB"\fR (double quote)\&. Returns a boolean indicating success or failure\&. .RE .PP SConf\&.\fBCheckCXXHeader\fR(\fIcontext, header, [include_quotes]\fR), \fIcontext\fR\&.CheckCXXHeader(\fIheader, [include_quotes]\fR) .RS 4 This is a wrapper around \fBSConf\&.CheckHeader\fR which checks if \fIheader\fR is usable in the C++ language\&. \fIheader\fR may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for\&. The optional argument \fIinclude_quotes\fR must be a two character string, where the first character denotes the opening quote and the second character denotes the closing quote\&. By default, both characters are \fB"\fR (double quote)\&. Returns a boolean indicating success or failure\&. .RE .PP SConf\&.\fBCheckFunc\fR(\fIcontext, function_name, [header, language]\fR), \fIcontext\fR\&.CheckFunc(\fIfunction_name, [header, language]\fR) .RS 4 Checks if the specified C or C++ library function is available based on the context\*(Aqs local environment settings (that is, using the values of \fICFLAGS\fR, \fICPPFLAGS\fR, \fILIBS\fR or other relevant construction variables)\&. .sp \fIfunction_name\fR is the name of the function to check for\&. The optional \fIheader\fR argument is a string that will be placed at the top of the test file that will be compiled to check if the function exists; the default is: .sp .if n \{\ .RS 4 .\} .nf #ifdef __cplusplus extern "C" #endif char function_name(); .fi .if n \{\ .RE .\} .sp Returns an empty string on success, a string containing an error message on failure\&. .RE .PP SConf\&.\fBCheckLib\fR(\fIcontext, [library, symbol, header, language, autoadd=True]\fR), \fIcontext\fR\&.CheckLib(\fI[library, symbol, header, language, autoadd=True]\fR) .RS 4 Checks if \fIlibrary\fR provides \fIsymbol\fR\&. If \fIautoadd\fR is true (the default) and the library provides the specified \fIsymbol\fR, appends the library to the \fILIBS\fR construction variable \fIlibrary\fR may also be \fBNone\fR (the default), in which case \fIsymbol\fR is checked with the current \fILIBS\fR variable, or a list of library names, in which case each library in the list will be checked for \fIsymbol\fR\&. If \fIsymbol\fR is not set or is \fBNone\fR, then \fBSConf\&.CheckLib\fR just checks if you can link against the specified \fIlibrary\fR\&. Note though it is legal syntax, it would not be very useful to call this method with \fIlibrary\fR and \fIsymbol\fR both omitted or \fBNone\fR\&. Returns a boolean indicating success or failure\&. .RE .PP SConf\&.\fBCheckLibWithHeader\fR(\fIcontext, library, header, language, [call, autoadd=True]\fR), \fIcontext\fR\&.CheckLibWithHeader(\fIlibrary, header, language, [call, autoadd=True]\fR) .RS 4 Provides a more sophisticated way to check against libraries then the \fBSConf\&.CheckLib\fR call\&. \fIlibrary\fR specifies the library or a list of libraries to check\&. \fIheader\fR specifies a header to check for\&. \fIheader\fR may be a list, in which case the last item in the list is the header file to be checked, and the previous list items are header files whose #include lines should precede the header line being checked for\&. \fIcall\fR can be any valid expression (with a trailing \*(Aq;\*(Aq)\&. If \fIcall\fR is not set, the default simply checks that you can link against the specified \fIlibrary\fR\&. \fIautoadd\fR (default true) specifies whether to add the library to the environment if the check succeeds\&. Returns a boolean indicating success or failure\&. .RE .PP SConf\&.\fBCheckType\fR(\fIcontext, type_name, [includes, language]\fR), \fIcontext\fR\&.CheckType(\fItype_name, [includes, language]\fR) .RS 4 Checks for the existence of a type defined by typedef\&. \fItype_name\fR specifies the typedef name to check for\&. \fIincludes\fR is a string containing one or more #include lines that will be inserted into the program that will be run to test for the existence of the type\&. Example: .sp .if n \{\ .RS 4 .\} .nf sconf\&.CheckType(\*(Aqfoo_type\*(Aq, \*(Aq#include "my_types\&.h"\*(Aq, \*(AqC++\*(Aq) .fi .if n \{\ .RE .\} .sp Returns an empty string on success, a string containing an error message on failure\&. .RE .PP SConf\&.\fBCheckCC\fR(\fIcontext\fR), \fIcontext\fR\&.CheckCC() .RS 4 Checks whether the C compiler (as defined by the \fICC\fR construction variable) works by trying to compile a small source file\&. Returns a boolean indicating success or failure\&. .sp By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler\&. .sp This uses the exact same command as the one used by the object builder for C source files, so it can be used to detect if a particular compiler flag works or not\&. .RE .PP SConf\&.\fBCheckCXX\fR(\fIcontext\fR), \fIcontext\fR\&.CheckCXX() .RS 4 Checks whether the C++ compiler (as defined by the \fICXX\fR construction variable) works by trying to compile a small source file\&. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler\&. Returns a boolean indicating success or failure\&. .sp This uses the exact same command as the one used by the object builder for C++ source files, so it can be used to detect if a particular compiler flag works or not\&. .RE .PP SConf\&.\fBCheckSHCC\fR(\fIcontext\fR), \fIcontext\fR\&.CheckSHCC() .RS 4 Checks whether the shared\-object C compiler (as defined by the \fISHCC\fR construction variable) works by trying to compile a small source file\&. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler\&. Returns a boolean indicating success or failure\&. .sp This uses the exact same command as the one used by the object builder for C source file, so it can be used to detect if a particular compiler flag works or not\&. This does not check whether the object code can be used to build a shared library, only that the compilation (not link) succeeds\&. .RE .PP SConf\&.\fBCheckSHCXX\fR(\fIcontext\fR), \fIcontext\fR\&.CheckSHCXX() .RS 4 Checks whether the shared\-object C++ compiler (as defined by the \fISHCXX\fR construction variable) works by trying to compile a small source file\&. By default, SCons only detects if there is a program with the correct name, not if it is a functioning compiler\&. Returns a boolean indicating success or failure\&. .sp This uses the exact same command as the one used by the object builder for C++ source files, so it can be used to detect if a particular compiler flag works or not\&. This does not check whether the object code can be used to build a shared library, only that the compilation (not link) succeeds\&. .RE .PP SConf\&.\fBCheckTypeSize\fR(\fIcontext, type_name, [header, language, expect]\fR), \fIcontext\fR\&.CheckTypeSize(\fItype_name, [header, language, expect]\fR) .RS 4 Checks for the size of a type defined by typedef\&. \fItype_name\fR specifies the typedef name to check for\&. The optional \fIheader\fR argument is a string that will be placed at the top of the test file that will be compiled to check if the type exists; the default is empty\&. If the optional \fIexpect\fR, is supplied, it should be an integer size; \fBCheckTypeSize\fR will fail unless \fItype_name\fR is actually that size\&. Returns the size in bytes, or zero if the type was not found (or if the size did not match \fIexpect\fR)\&. .sp For example, .sp .if n \{\ .RS 4 .\} .nf CheckTypeSize(\*(Aqshort\*(Aq, expect=2) .fi .if n \{\ .RE .\} .sp will return the size 2 only if short is actually two bytes\&. .RE .PP SConf\&.\fBCheckDeclaration\fR(\fIcontext, symbol, [includes, language]\fR), \fIcontext\fR\&.CheckDeclaration(\fIsymbol, [includes, language]\fR) .RS 4 Checks if the specified \fIsymbol\fR is declared\&. \fIincludes\fR is a string containing one or more #include lines that will be inserted into the program that will be run to test for the existence of the symbol\&. Returns a boolean indicating success or failure\&. .RE .PP SConf\&.\fBDefine\fR(\fIcontext, symbol, [value, comment]\fR), \fIcontext\fR\&.Define(\fIsymbol, [value, comment]\fR) .RS 4 This function does not check for anything, but defines a preprocessor symbol that will be added to the configuration header file\&. It is the equivalent of \fBAC_DEFINE\fR, and defines the symbol \fIname\fR with the optional \fIvalue\fR and the optional comment \fIcomment\fR\&. .sp Define Examples: .sp .if n \{\ .RS 4 .\} .nf env = Environment() conf = Configure(env) # Puts the following line in the config header file: # #define A_SYMBOL conf\&.Define("A_SYMBOL") # Puts the following line in the config header file: # #define A_SYMBOL 1 conf\&.Define("A_SYMBOL", 1) .fi .if n \{\ .RE .\} .sp Be careful about quoting string values, though: .sp .if n \{\ .RS 4 .\} .nf env = Environment() conf = Configure(env) # Puts the following line in the config header file: # #define A_SYMBOL YA conf\&.Define("A_SYMBOL", "YA") # Puts the following line in the config header file: # #define A_SYMBOL "YA" conf\&.Define("A_SYMBOL", \*(Aq"YA"\*(Aq) .fi .if n \{\ .RE .\} .sp For comment: .sp .if n \{\ .RS 4 .\} .nf env = Environment() conf = Configure(env) # Puts the following lines in the config header file: # /* Set to 1 if you have a symbol */ # #define A_SYMBOL 1 conf\&.Define("A_SYMBOL", 1, "Set to 1 if you have a symbol") .fi .if n \{\ .RE .\} .RE .PP You can define your own custom checks in addition to the predefined checks\&. You pass a dictionary of these to the \fBConfigure\fR function as the \fIcustom_tests\fR argument\&. This dictionary maps the names of the checks to the user defined Python callables (either Python functions or class instances implementing a __call__ method)\&. Each custom check will be called with a first argument of a \fICheckContext\fR, instance followed by the arguments, which must be supplied by the user of the check\&. A CheckContext instance defines the following methods: .PP \fIcontext\fR\&.Message(\fItext\fR) .RS 4 Displays a message, as an indicator of progess\&. \fItext\fR will be displayed, e\&.g\&. Checking for library X\&.\&.\&.\&. Usually called before the check is started\&. .RE .PP \fIcontext\fR\&.Result(\fIres\fR) .RS 4 Displays a \(lqresult\(rq message, as an indicator of progress\&. \fIres\fR can be either an integer or a string\&. If an integer, displays yes (if \fIres\fR evaluates \fBTrue\fR) or no (if \fIres\fR evaluates \fBFalse\fR)\&. If a string, it is displayed as\-is\&. Usually called after the check has completed\&. .RE .PP \fIcontext\fR\&.TryCompile(\fItext, extension=\*(Aq\*(Aq\fR) .RS 4 Checks if a file with the specified \fIextension\fR (e\&.g\&. \*(Aq\&.c\*(Aq) containing \fItext\fR can be compiled using the environment\*(Aqs \fBObject\fR builder\&. Returns a boolean indicating success or failure\&. .RE .PP \fIcontext\fR\&.TryLink(\fItext, extension=\*(Aq\*(Aq\fR) .RS 4 Checks, if a file with the specified \fIextension\fR (e\&.g\&. \*(Aq\&.c\*(Aq) containing \fItext\fR can be compiled using the environment\*(Aqs \fBProgram\fR builder\&. Returns a boolean indicating success or failure\&. .RE .PP \fIcontext\fR\&.TryRun(\fItext, extension=\*(Aq\*(Aq\fR) .RS 4 Checks if a file with the specified \fIextension\fR (e\&.g\&. \*(Aq\&.c\*(Aq) containing \fItext\fR can be compiled using the environment\*(Aqs \fBProgram\fR builder\&. On success, the program is run\&. If the program executes successfully (that is, its return status is 0), a tuple \fI(1, outputStr)\fR is returned, where \fIoutputStr\fR is the standard output of the program\&. If the program fails execution (its return status is non\-zero), then \fI(0, \*(Aq\*(Aq)\fR is returned\&. .RE .PP \fIcontext\fR\&.TryAction(\fIaction, [text, extension=\*(Aq\*(Aq]\fR) .RS 4 Checks if the specified \fIaction\fR with an optional source file (contents \fItext\fR, extension \fIextension\fR) can be executed\&. \fIaction\fR may be anything which can be converted to a \fBscons\fR Action\&. On success, \fI(1, outputStr)\fR is returned, where \fIoutputStr\fR is the content of the target file\&. On failure \fI(0, \*(Aq\*(Aq)\fR is returned\&. .RE .PP \fIcontext\fR\&.TryBuild(\fIbuilder[, text, extension=\*(Aq\*(Aq]\fR) .RS 4 Low level implementation for testing specific builds; the methods above are based on this method\&. Given the Builder instance \fIbuilder\fR and the optional \fItext\fR of a source file with optional \fIextension\fR, returns a boolean indicating success or failure\&. In addition, \fIcontext\&.lastTarget\fR is set to the build target node if the build was successful\&. .RE .PP Example of implementing and using custom tests: .sp .if n \{\ .RS 4 .\} .nf def CheckQt(context, qtdir): context\&.Message( \*(AqChecking for qt \&.\&.\&.\*(Aq ) lastLIBS = context\&.env[\*(AqLIBS\*(Aq] lastLIBPATH = context\&.env[\*(AqLIBPATH\*(Aq] lastCPPPATH= context\&.env[\*(AqCPPPATH\*(Aq] context\&.env\&.Append(LIBS=\*(Aqqt\*(Aq, LIBPATH=qtdir + \*(Aq/lib\*(Aq, CPPPATH=qtdir + \*(Aq/include\*(Aq) ret = context\&.TryLink(""" #include int main(int argc, char **argv) { QApplication qapp(argc, argv); return 0; } """) if not ret: context\&.env\&.Replace(LIBS=lastLIBS, LIBPATH=lastLIBPATH, CPPPATH=lastCPPPATH) context\&.Result( ret ) return ret env = Environment() conf = Configure(env, custom_tests={\*(AqCheckQt\*(Aq: CheckQt}) if not conf\&.CheckQt(\*(Aq/usr/lib/qt\*(Aq): print(\*(AqWe really need qt!\*(Aq) Exit(1) env = conf\&.Finish() .fi .if n \{\ .RE .\} .SS "Command\-Line Construction Variables" .PP Often when building software, some variables need to be specified at build time\&. For example, libraries needed for the build may be in non\-standard locations, or site\-specific compiler options may need to be passed to the compiler\&. SCons provides a \fBVariables\fR object to support overriding construction variables on the command line: .sp .if n \{\ .RS 4 .\} .nf \fBscons VARIABLE=foo\fR .fi .if n \{\ .RE .\} .PP The variable values can also be specified in an SConscript file\&. .PP To obtain the object for manipulating values, call the \fBVariables\fR function: .PP \fBVariables\fR([\fIfiles, [args]]\fR) .RS 4 If \fIfiles\fR is a file or list of files, those are executed as Python scripts, and the values of (global) Python variables set in those files are added as construction variables in the Default Environment\&. If no files are specified, or the \fIfiles\fR argument is \fBNone\fR, then no files will be read\&. The following example file contents could be used to set an alternative C compiler: .sp .if n \{\ .RS 4 .\} .nf CC = \*(Aqmy_cc\*(Aq .fi .if n \{\ .RE .\} .sp If \fIargs\fR is specified, it is a dictionary of values that will override anything read from \fIfiles\fR\&. it is primarily intended to be passed the \fIARGUMENTS\fR dictionary that holds variables specified on the command line\&. Example: .sp .if n \{\ .RS 4 .\} .nf vars = Variables(\*(Aqcustom\&.py\*(Aq) vars = Variables(\*(Aqoverrides\&.py\*(Aq, ARGUMENTS) vars = Variables(None, {FOO:\*(Aqexpansion\*(Aq, BAR:7}) .fi .if n \{\ .RE .\} .RE .PP Variables objects have the following methods: .PP \fIvars\fR\&.\fBAdd\fR(\fIkey, [help, default, validator, converter]\fR) .RS 4 Add a customizable construction variable to the Variables object\&. \fIkey\fR is the name of the variable\&. \fIhelp\fR is the help text for the variable\&. \fIdefault\fR is the default value of the variable; if the default value is \fBNone\fR and there is no explicit value specified, the construction variable will not be added to the construction environment\&. If set, \fIvalidator\fR is called to validate the value of the variable\&. A function supplied as a validator shall accept arguments: \fIkey\fR, \fIvalue\fR, and \fIenv\fR\&. The recommended way to handle an invalid value is to raise an exception (see example below)\&. If set, \fIconverter\fR is called to convert the value before putting it in the environment, and should take either a value, or the value and environment, as parameters\&. The converter function must return a value, which will be converted into a string before being validated by the \fIvalidator\fR (if any) and then added to the construction environment\&. .sp Examples: .sp .if n \{\ .RS 4 .\} .nf vars\&.Add(\*(AqCC\*(Aq, help=\*(AqThe C compiler\*(Aq) def valid_color(key, val, env): if not val in [\*(Aqred\*(Aq, \*(Aqblue\*(Aq, \*(Aqyellow\*(Aq]: raise Exception("Invalid color value \*(Aq%s\*(Aq" % val) vars\&.Add(\*(AqCOLOR\*(Aq, validator=valid_color) .fi .if n \{\ .RE .\} .RE .PP \fIvars\fR\&.\fBAddVariables\fR(\fIargs\fR) .RS 4 A convenience method that adds multiple customizable construction variables to a Variables object in one call; equivalent to calling \fBAdd\fR multiple times\&. The \fIargs\fR are tuples (or lists) that contain the arguments for an individual call to the \fBAdd\fR method\&. Since tuples are not Python mappings, the arguments cannot use the keyword form, but rather are positional arguments as documented for \fBAdd\fR: a required name, the rest optional but must be in the specified in order if used\&. .sp .if n \{\ .RS 4 .\} .nf opt\&.AddVariables( ("debug", "", 0), ("CC", "The C compiler"), ("VALIDATE", "An option for testing validation", "notset", validator, None), ) .fi .if n \{\ .RE .\} .RE .PP \fIvars\fR\&.\fBUpdate\fR(\fIenv, [args]\fR) .RS 4 Update a construction environment \fIenv\fR with the customized construction variables \&. Any specified variables that are not configured for the Variables object will be saved and may be retrieved using the \fBUnknownVariables\fR method, below\&. .sp Normally this method is not called directly, but rather invoked indirectly by passing the Variables object to the \fBEnvironment\fR function: .sp .if n \{\ .RS 4 .\} .nf env = Environment(variables=vars) .fi .if n \{\ .RE .\} .RE .PP \fIvars\fR\&.\fBUnknownVariables\fR() .RS 4 Returns a dictionary containing any variables that were specified either in the files or the dictionary with which the Variables object was initialized, but for which the Variables object was not configured\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment(variables=vars) for key, value in vars\&.UnknownVariables(): print("unknown variable: %s=%s" % (key, value)) .fi .if n \{\ .RE .\} .RE .PP \fIvars\fR\&.\fBSave\fR(\fIfilename, env\fR) .RS 4 Save the currently set variables into a script file named by \fIfilename\fR that can be used on the next invocation to automatically load the current settings\&. This method combined with the Variables method can be used to support caching of variables between runs\&. .sp .if n \{\ .RS 4 .\} .nf env = Environment() vars = Variables([\*(Aqvariables\&.cache\*(Aq, \*(Aqcustom\&.py\*(Aq]) vars\&.Add(\&.\&.\&.) vars\&.Update(env) vars\&.Save(\*(Aqvariables\&.cache\*(Aq, env) .fi .if n \{\ .RE .\} .RE .PP \fIvars\fR\&.\fBGenerateHelpText\fR(\fIenv, [sort]\fR) .RS 4 Generate help text documenting the customizable construction variables, suitable for passing in to the \fBHelp\fR function\&. \fIenv\fR is the construction environment that will be used to get the actual values of the customizable variables\&. If the (optional) value of \fIsort\fR is callable, it is used as a comparison function to determine how to sort the added variables\&. This function must accept two arguments, compare them, and return a negative integer if the first is less\-than the second, zero for equality, or a positive integer for greater\-than\&. Optionally a Boolean value of \fBTrue\fR for \fIsort\fR will cause a standard alphabetical sort to be performed\&. .sp .if n \{\ .RS 4 .\} .nf Help(vars\&.GenerateHelpText(env)) def cmp(a, b): return (a > b) \- (a < b) Help(vars\&.GenerateHelpText(env, sort=cmp)) .fi .if n \{\ .RE .\} .RE .PP \fIvars\fR\&.\fBFormatVariableHelpText\fR(\fIenv, opt, help, default, actual\fR) .RS 4 Returns a formatted string containing the printable help text for one option\&. It is normally not called directly, but is called by the \fBGenerateHelpText\fR method to create the returned help text\&. It may be overridden with your own function that takes the arguments specified above and returns a string of help text formatted to your liking\&. Note that \fBGenerateHelpText\fR will not put any blank lines or extra characters in between the entries, so you must add those characters to the returned string if you want the entries separated\&. .sp .if n \{\ .RS 4 .\} .nf def my_format(env, opt, help, default, actual): fmt = "\en%s: default=%s actual=%s (%s)\en" return fmt % (opt, default, actual, help) vars\&.FormatVariableHelpText = my_format .fi .if n \{\ .RE .\} .RE .PP To make it more convenient to work with customizable Variables, \fBscons\fR provides a number of functions that make it easy to set up various types of Variables\&. Each of these return a tuple ready to be passed to the \fBAdd\fR or \fBAddVariables\fR method: .PP \fBBoolVariable\fR(\fIkey, help, default\fR) .RS 4 Returns a tuple of arguments to set up a Boolean option\&. The option will use the specified name \fIkey\fR, have a default value of \fIdefault\fR, and \fIhelp\fR will form the descriptive part of the help text\&. The option will interpret the values \fBy\fR, \fByes\fR, \fBt\fR, \fBtrue\fR, \fB1\fR, \fBon\fR and \fBall\fR as true, and the values \fBn\fR, \fBno\fR, \fBf\fR, \fBfalse\fR, \fB0\fR, \fBoff\fR and \fBnone\fR as false\&. .RE .PP \fBEnumVariable\fR(\fIkey, help, default, allowed_values, [map, ignorecase]\fR) .RS 4 Returns a tuple of arguments to set up an option whose value may be one of a specified list of legal enumerated values\&. The option will use the specified name \fIkey\fR, have a default value of \fIdefault\fR, and \fIhelp\fR will form the descriptive part of the help text\&. The option will only support those values in the \fIallowed_values\fR list\&. The optional \fImap\fR argument is a dictionary that can be used to convert input values into specific legal values in the \fIallowed_values\fR list\&. If the value of \fIignore_case\fR is 0 (the default), then the values are case\-sensitive\&. If the value of \fIignore_case\fR is 1, then values will be matched case\-insensitively\&. If the value of \fIignore_case\fR is 2, then values will be matched case\-insensitively, and all input values will be converted to lower case\&. .RE .PP \fBListVariable\fR(\fIkey, help, default, names, [map]\fR) .RS 4 Returns a tuple of arguments to set up an option whose value may be one or more of a specified list of legal enumerated values\&. The option will use the specified name \fIkey\fR, have a default value of \fIdefault\fR, and \fIhelp\fR will form the descriptive part of the help text\&. The option will only accept the values \(lqall\(rq, \(lqnone\(rq, or the values in the \fInames\fR list\&. More than one value may be specified, separated by commas\&. The default may be a string of comma\-separated default values, or a list of the default values\&. The optional \fImap\fR argument is a dictionary that can be used to convert input values into specific legal values in the \fInames\fR list\&. (Note that the additional values accepted through the use of a \fImap\fR are not reflected in the generated help message)\&. .RE .PP \fBPackageVariable\fR(\fIkey, help, default\fR) .RS 4 Returns a tuple of arguments to set up an option whose value is a path name of a package that may be enabled, disabled or given an explicit path name\&. The option will use the specified name \fIkey\fR, have a default value of \fIdefault\fR, and \fIhelp\fR will form the descriptive part of the help text\&. The option will support the values \fByes\fR, \fBtrue\fR, \fBon\fR, \fBenable\fR or \fBsearch\fR, in which case the specified \fIdefault\fR will be used, or the option may be set to an arbitrary string (typically the path name to a package that is being enabled)\&. The option will also support the values \fBno\fR, \fBfalse\fR, \fBoff\fR or \fBdisable\fR to disable use of the specified option\&. .RE .PP \fBPathVariable\fR(\fIkey, help, default, [validator]\fR) .RS 4 Returns a tuple of arguments to set up an option whose value is expected to be a path name\&. The option will use the specified name \fIkey\fR, have a default value of \fIdefault\fR, and \fIhelp\fR will form the descriptive part of the help text\&. An additional \fIvalidator\fR may be specified that will be called to verify that the specified path is acceptable\&. SCons supplies the following ready\-made validators: .PP PathVariable\&.\fBPathExists\fR .RS 4 Verify that the specified path exists (this the default behavior if no \fIvalidator\fR is supplied)\&. .RE .PP PathVariable\&.\fBPathIsFile\fR .RS 4 Verify that the specified path exists and is a regular file\&. .RE .PP PathVariable\&.\fBPathIsDir\fR .RS 4 Verify that the specified path exists and is a directory\&. .RE .PP PathVariable\&.\fBPathIsDirCreate\fR .RS 4 Verify that the specified path exists and is a directory; if it does not exist, create the directory\&. .RE .PP PathVariable\&.\fBPathAccept\fR .RS 4 Accept the specific path name argument without validation, suitable for when you want your users to be able to specify a directory path that will be created as part of the build process, for example\&. .RE .sp You may supply your own \fIvalidator\fR function, which must accept three arguments (\fIkey\fR, the name of the variable to be set; \fIval\fR, the specified value being checked; and \fIenv\fR, the construction environment) and should raise an exception if the specified value is not acceptable\&. .RE .PP These functions make it convenient to create a number of variables with consistent behavior in a single call to the \fBAddVariables\fR method: .sp .if n \{\ .RS 4 .\} .nf vars\&.AddVariables( BoolVariable( "warnings", help="compilation with \-Wall and similar", default=1, ), EnumVariable( "debug", help="debug output and symbols", default="no", allowed_values=("yes", "no", "full"), map={}, ignorecase=0, # case sensitive ), ListVariable( "shared", help="libraries to build as shared libraries", default="all", names=list_of_libs, ), PackageVariable( "x11", help="use X11 installed here (yes = search some places)", default="yes", ), PathVariable( "qtdir", help="where the root of Qt is installed", default=qtdir), PathVariable( "foopath", help="where the foo library is installed", default=foopath, validator=PathVariable\&.PathIsDir, ), ) .fi .if n \{\ .RE .\} .SS "File and Directory Nodes" .PP The \fBFile\fR and \fBDir\fR functions/methods return File and Directory Nodes, respectively\&. Such nodes are Python objects with several user\-visible attributes and methods that are often useful to access in SConscript files: .PP \fIn\fR\&.\fIpath\fR .RS 4 The build path of the given file or directory\&. This path is relative to the top\-level directory (where the SConstruct file is found)\&. The build path is the same as the source path if \fIvariant_dir\fR is not being used\&. .RE .PP \fIn\fR\&.\fIabspath\fR .RS 4 The absolute build path of the given file or directory\&. .RE .PP \fIn\fR\&.\fBsrcnode\fR() .RS 4 The \fBsrcnode\fR method returns another File or Directory Node representing the source path of the given File or Directory Node\&. .RE .PP For example: .sp .if n \{\ .RS 4 .\} .nf # Get the current build dir\*(Aqs path, relative to top\&. Dir(\*(Aq\&.\*(Aq)\&.path # Current dir\*(Aqs absolute path Dir(\*(Aq\&.\*(Aq)\&.abspath # Next line is always \*(Aq\&.\*(Aq, because it is the top dir\*(Aqs path relative to itself\&. Dir(\*(Aq#\&.\*(Aq)\&.path File(\*(Aqfoo\&.c\*(Aq)\&.srcnode()\&.path # source path of the given source file\&. # Builders also return File objects: foo = env\&.Program(\*(Aqfoo\&.c\*(Aq) print("foo will be built in", foo\&.path) .fi .if n \{\ .RE .\} .PP File and Directory Node objects have methods to create File and Directory Nodes relative to the original Node\&. .PP If the object is a Directory Node, these methods will place the the new Node within the directory the Node represents: .PP \fId\fR\&.\fBDir\fR(\fIname\fR) .RS 4 Returns a directory Node for a subdirectory of \fId\fR named \fIname\fR\&. .RE .PP \fId\fR\&.\fBFile\fR(\fIname\fR) .RS 4 Returns a file Node for a file within \fId\fR named \fIname\fR\&. .RE .PP \fId\fR\&.\fBEntry\fR(\fIname\fR) .RS 4 Returns an unresolved Node within \fId\fR named \fIname\fR\&. .RE .PP If the object is a File Node, these methods will place the the new Node in the same directory as the one the Node represents: .PP \fIf\fR\&.\fBDir\fR(\fIname\fR) .RS 4 Returns a directory named \fIname\fR within the parent directory of \fIf\fR\&. .RE .PP \fIf\fR\&.\fBFile\fR(\fIname\fR) .RS 4 Returns a file named \fIname\fR within the parent directory of \fIf\fR\&. .RE .PP \fIf\fR\&.\fBEntry\fR(\fIname\fR) .RS 4 Returns an unresolved Node named \fIname\fR within the parent directory of \fIf\fR\&. .RE .PP For example: .sp .if n \{\ .RS 4 .\} .nf # Get a Node for a file within a directory incl = Dir(\*(Aqinclude\*(Aq) f = incl\&.File(\*(Aqheader\&.h\*(Aq) # Get a Node for a subdirectory within a directory dist = Dir(\*(Aqproject\-3\&.2\&.1\*(Aq) src = dist\&.Dir(\*(Aqsrc\*(Aq) # Get a Node for a file in the same directory cfile = File(\*(Aqsample\&.c\*(Aq) hfile = cfile\&.File(\*(Aqsample\&.h\*(Aq) # Combined example docs = Dir(\*(Aqdocs\*(Aq) html = docs\&.Dir(\*(Aqhtml\*(Aq) index = html\&.File(\*(Aqindex\&.html\*(Aq) css = index\&.File(\*(Aqapp\&.css\*(Aq) .fi .if n \{\ .RE .\} .SH "EXTENDING SCONS" .SS "Builder Objects" .PP \fBscons\fR can be extended to build different types of targets by adding new Builder objects to a construction environment\&. \fIIn general\fR, you should only need to add a new Builder object when you want to build a new type of file or other external target\&. If you just want to invoke a different compiler or other tool to build \fBProgram\fR, \fBObject\fR, \fBLibrary\fR, or any other type of output file for which \fBscons\fR already has an existing Builder, it is generally much easier to use those existing Builders in a construction environment that sets the appropriate construction variables (\fBCC\fR, \fBLINK\fR, etc\&.)\&. .PP Builder objects are created using the \fBBuilder\fR factory function\&. The \fBBuilder\fR function accepts the following keyword arguments: .PP \fIaction\fR .RS 4 The command line string used to build the target from the source\&. \fIaction\fR can also be: a list of strings representing the command to be executed and its arguments (suitable for enclosing white space in an argument), a dictionary mapping source file name suffixes to any combination of command line strings (if the builder should accept multiple source file extensions), a Python function; an Action object (see the next section); or a list of any of the above\&. .sp An action function takes three arguments: .RS 4 \fIsource\fR \- a list of source nodes;\&. .RE .RS 4 \fItarget\fR \- a list of target nodes;\&. .RE .RS 4 \fIenv\fR \- the construction environment\&. .RE The \fIaction\fR and \fIgenerator\fR arguments must not both be used for the same Builder\&. .RE .PP \fIprefix\fR .RS 4 The prefix that will be prepended to the target file name\&. \fIprefix\fR may be: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} a string .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} a callable object \- a function or other callable that takes two arguments (a construction environment and a list of sources) and returns a prefix .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} a dictionary \- specifies a mapping from a specific source suffix (of the first source specified) to a corresponding target prefix\&. Both the source suffix and target prefix specifications may use environment variable substitution, and the target prefix (the \*(Aqvalue\*(Aq entries in the dictionary) may also be a callable object\&. The default target prefix may be indicated by a dictionary entry with a key value of \fBNone\fR\&. .RE .sp .if n \{\ .RS 4 .\} .nf b = Builder("build_it < $SOURCE > $TARGET", prefix = "file\-") def gen_prefix(env, sources): return "file\-" + env[\*(AqPLATFORM\*(Aq] + \*(Aq\-\*(Aq b = Builder("build_it < $SOURCE > $TARGET", prefix = gen_prefix) b = Builder("build_it < $SOURCE > $TARGET", suffix = { None: "file\-", "$SRC_SFX_A": gen_prefix }) .fi .if n \{\ .RE .\} .RE .PP \fIsuffix\fR .RS 4 The suffix that will be appended to the target file name\&. This may be specified in the same manner as the prefix above\&. If the suffix is a string, then \fBscons\fR will append a \*(Aq\&.\*(Aq to the beginning of the suffix if it\*(Aqs not already there\&. The string returned by callable object (or obtained from the dictionary) is untouched and must append its own \*(Aq\&.\*(Aq to the beginning if one is desired\&. .sp .if n \{\ .RS 4 .\} .nf b = Builder("build_it < $SOURCE > $TARGET" suffix = "\-file") def gen_suffix(env, sources): return "\&." + env[\*(AqPLATFORM\*(Aq] + "\-file" b = Builder("build_it < $SOURCE > $TARGET", suffix = gen_suffix) b = Builder("build_it < $SOURCE > $TARGET", suffix = { None: "\&.sfx1", "$SRC_SFX_A": gen_suffix }) .fi .if n \{\ .RE .\} .RE .PP \fIensure_suffix\fR .RS 4 When set to any true value, causes \fBscons\fR to add the target suffix specified by the \fIsuffix\fR keyword to any target strings that have a different suffix\&. (The default behavior is to leave untouched any target file name that looks like it already has any suffix\&.) .sp .if n \{\ .RS 4 .\} .nf b1 = Builder("build_it < $SOURCE > $TARGET" suffix = "\&.out") b2 = Builder("build_it < $SOURCE > $TARGET" suffix = "\&.out", ensure_suffix) env = Environment() env[\*(AqBUILDERS\*(Aq][\*(AqB1\*(Aq] = b1 env[\*(AqBUILDERS\*(Aq][\*(AqB2\*(Aq] = b2 # Builds "foo\&.txt" because ensure_suffix is not set\&. env\&.B1(\*(Aqfoo\&.txt\*(Aq, \*(Aqfoo\&.in\*(Aq) # Builds "bar\&.txt\&.out" because ensure_suffix is set\&. env\&.B2(\*(Aqbar\&.txt\*(Aq, \*(Aqbar\&.in\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fIsrc_suffix\fR .RS 4 The expected source file name suffix\&. This may be a string or a list of strings\&. .RE .PP \fItarget_scanner\fR .RS 4 A Scanner object that will be invoked to find implicit dependencies for this target file\&. This keyword argument should be used for Scanner objects that find implicit dependencies based only on the target file and the construction environment, \fInot\fR for implicit dependencies based on source files\&. See the section called \(lqScanner Objects\(rq for information about creating Scanner objects\&. .RE .PP \fIsource_scanner\fR .RS 4 A Scanner object that will be invoked to find implicit dependencies in any source files used to build this target file\&. This is where you would specify a scanner to find things like #include lines in source files\&. The pre\-built DirScanner Scanner object may be used to indicate that this Builder should scan directory trees for on\-disk changes to files that \fBscons\fR does not know about from other Builder or function calls\&. See the section called \(lqScanner Objects\(rq for information about creating your own Scanner objects\&. .RE .PP \fItarget_factory\fR .RS 4 A factory function that the Builder will use to turn any targets specified as strings into SCons Nodes\&. By default, SCons assumes that all targets are files\&. Other useful target_factory values include \fBDir\fR, for when a Builder creates a directory target, and \fBEntry\fR, for when a Builder can create either a file or directory target\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf MakeDirectoryBuilder = Builder(action=my_mkdir, target_factory=Dir) env = Environment() env\&.Append(BUILDERS={\*(AqMakeDirectory\*(Aq: MakeDirectoryBuilder}) env\&.MakeDirectory(\*(Aqnew_directory\*(Aq, []) .fi .if n \{\ .RE .\} .sp Note that the call to this \fBMakeDirectory\fR Builder needs to specify an empty source list to make the string represent the builder\*(Aqs target; without that, it would assume the argument is the source, and would try to deduce the target name from it, which in the absence of an automatically\-added prefix or suffix would lead to a matching target and source name and a circular dependency\&. .RE .PP \fIsource_factory\fR .RS 4 A factory function that the Builder will use to turn any sources specified as strings into SCons Nodes\&. By default, SCons assumes that all source are files\&. Other useful source_factory values include \fBDir\fR, for when a Builder uses a directory as a source, and \fBEntry\fR, for when a Builder can use files or directories (or both) as sources\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf CollectBuilder = Builder(action=my_mkdir, source_factory=Entry) env = Environment() env\&.Append(BUILDERS={\*(AqCollect\*(Aq: CollectBuilder}) env\&.Collect(\*(Aqarchive\*(Aq, [\*(Aqdirectory_name\*(Aq, \*(Aqfile_name\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fIemitter\fR .RS 4 A function or list of functions to manipulate the target and source lists before dependencies are established and the target(s) are actually built\&. \fIemitter\fR can also be a string containing a construction variable to expand to an emitter function or list of functions, or a dictionary mapping source file suffixes to emitter functions\&. (Only the suffix of the first source file is used to select the actual emitter function from an emitter dictionary\&.) .sp An emitter function takes three arguments: .RS 4 \fIsource\fR \- a list of source nodes\&. .RE .RS 4 \fItarget\fR \- a list of target nodes\&. .RE .RS 4 \fIenv\fR \- the construction environment\&. .RE An emitter must return a tuple containing two lists, the list of targets to be built by this builder, and the list of sources for this builder\&. .sp Example: .sp .if n \{\ .RS 4 .\} .nf def e(target, source, env): return (target + [\*(Aqfoo\&.foo\*(Aq], source + [\*(Aqfoo\&.src\*(Aq]) # Simple association of an emitter function with a Builder\&. b = Builder("my_build < $TARGET > $SOURCE", emitter = e) def e2(target, source, env): return (target + [\*(Aqbar\&.foo\*(Aq], source + [\*(Aqbar\&.src\*(Aq]) # Simple association of a list of emitter functions with a Builder\&. b = Builder("my_build < $TARGET > $SOURCE", emitter = [e, e2]) # Calling an emitter function through a construction variable\&. env = Environment(MY_EMITTER=e) b = Builder("my_build < $TARGET > $SOURCE", emitter=\*(Aq$MY_EMITTER\*(Aq) # Calling a list of emitter functions through a construction variable\&. env = Environment(EMITTER_LIST=[e, e2]) b = Builder("my_build < $TARGET > $SOURCE", emitter=\*(Aq$EMITTER_LIST\*(Aq) # Associating multiple emitters with different file # suffixes using a dictionary\&. def e_suf1(target, source, env): return (target + [\*(Aqanother_target_file\*(Aq], source) def e_suf2(target, source, env): return (target, source + [\*(Aqanother_source_file\*(Aq]) b = Builder("my_build < $TARGET > $SOURCE", emitter={\*(Aq\&.suf1\*(Aq : e_suf1, \*(Aq\&.suf2\*(Aq : e_suf2}) .fi .if n \{\ .RE .\} .RE .PP \fImulti\fR .RS 4 Specifies whether this builder is allowed to be called multiple times for the same target file(s)\&. The default is \fB0\fR, which means the builder can not be called multiple times for the same target file(s)\&. Calling a builder multiple times for the same target simply adds additional source files to the target; it is not allowed to change the environment associated with the target, specify additional environment overrides, or associate a different builder with the target\&. .RE .PP \fIenv\fR .RS 4 A construction environment that can be used to fetch source code using this Builder\&. (Note that this environment is \fInot\fR used for normal builds of normal target files, which use the environment that was used to call the Builder for the target file\&.) .RE .PP \fIgenerator\fR .RS 4 A function that returns a list of actions that will be executed to build the target(s) from the source(s)\&. The returned action(s) may be an Action object, or anything that can be converted into an Action object (see the next section)\&. .sp The generator function takes four arguments: .RS 4 \fIsource\fR \- A list of source nodes;\&. .RE .RS 4 \fItarget\fR \- A list of target nodes;\&. .RE .RS 4 \fIenv\fR \- the construction environment\&. .RE .RS 4 \fIfor_signature\fR \- A Boolean value that specifies whether the generator is being called for generating a build signature (as opposed to actually executing the command)\&. .RE Example: .sp .if n \{\ .RS 4 .\} .nf def g(source, target, env, for_signature): return [["gcc", "\-c", "\-o"] + target + source] b = Builder(generator=g) .fi .if n \{\ .RE .\} .sp The \fIgenerator\fR and \fIaction\fR arguments must not both be used for the same Builder\&. .RE .PP \fIsrc_builder\fR .RS 4 Specifies a builder to use when a source file name suffix does not match any of the suffixes of the builder\&. Using this argument produces a multi\-stage builder\&. .RE .PP \fIsingle_source\fR .RS 4 Specifies that this builder expects exactly one source file per call\&. Giving more than one source file without target files results in implicitly calling the builder multiple times (once for each source given)\&. Giving multiple source files together with target files results in a UserError exception\&. .RE .PP \fIsource_ext_match\fR .RS 4 When the specified \fIaction\fR argument is a dictionary, the default behavior when a builder is passed multiple source files is to make sure that the extensions of all the source files match\&. If it is legal for this builder to be called with a list of source files with different extensions, this check can be suppressed by setting \fIsource_ext_match\fR to \fINone\fR or some other non\-true value\&. When \fIsource_ext_match\fR is disable, \fBscons\fR will use the suffix of the first specified source file to select the appropriate action from the \fIaction\fR dictionary\&. .sp In the following example, the setting of \fIsource_ext_match\fR prevents \fBscons\fR from exiting with an error due to the mismatched suffixes of foo\&.in and foo\&.extra\&. .sp .if n \{\ .RS 4 .\} .nf b = Builder(action={\*(Aq\&.in\*(Aq : \*(Aqbuild $SOURCES > $TARGET\*(Aq}, source_ext_match = None) env = Environment(BUILDERS={\*(AqMyBuild\*(Aq:b}) env\&.MyBuild(\*(Aqfoo\&.out\*(Aq, [\*(Aqfoo\&.in\*(Aq, \*(Aqfoo\&.extra\*(Aq]) .fi .if n \{\ .RE .\} .RE .PP \fIenv\fR .RS 4 A construction environment that can be used to fetch source code using this Builder\&. (Note that this environment is \fInot\fR used for normal builds of normal target files, which use the environment that was used to call the Builder for the target file\&.) .sp .if n \{\ .RS 4 .\} .nf b = Builder(action="build < $SOURCE > $TARGET") env = Environment(BUILDERS={\*(AqMyBuild\*(Aq : b}) env\&.MyBuild(\*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, my_arg=\*(Aqxyzzy\*(Aq) .fi .if n \{\ .RE .\} .RE .PP \fIchdir\fR .RS 4 A directory from which scons will execute the action(s) specified for this Builder\&. If the \fIchdir\fR argument is a string or a directory Node, scons will change to the specified directory\&. If the \fIchdir\fR is not a string or Node and is non\-zero, then scons will change to the target file\*(Aqs directory\&. .sp Note that scons will \fInot\fR automatically modify its expansion of construction variables like \fB$TARGET\fR and \fB$SOURCE\fR when using the \fIchdir\fR keyword argument\-\-that is, the expanded file names will still be relative to the top\-level directory containing the SConstruct file, and consequently incorrect relative to the chdir directory\&. Builders created using \fIchdir\fR keyword argument, will need to use construction variable expansions like ${TARGET\&.file} and ${SOURCE\&.file} to use just the filename portion of the targets and source\&. .sp .if n \{\ .RS 4 .\} .nf b = Builder(action="build < ${SOURCE\&.file} > ${TARGET\&.file}", chdir=1) env = Environment(BUILDERS={\*(AqMyBuild\*(Aq : b}) env\&.MyBuild(\*(Aqsub/dir/foo\&.out\*(Aq, \*(Aqsub/dir/foo\&.in\*(Aq) .fi .if n \{\ .RE .\} .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBWarning\fR .ps -1 .br Python only keeps one current directory location even if there are multiple threads\&. This means that use of the \fIchdir\fR argument will \fInot\fR work with the SCons \fB\-j\fR option, because individual worker threads spawned by SCons interfere with each other when they start changing directory\&. .sp .5v .RE .RE .PP Any additional keyword arguments supplied when a Builder object is created (that is, when the \fBBuilder\fR function is called) will be set in the executing construction environment when the Builder object is called\&. The canonical example here would be to set a construction variable to the repository of a source code system\&. .PP Any additional keyword arguments supplied when a Builder object is called will only be associated with the target created by that particular \fBBuilder\fR call (and any other files built as a result of the call)\&. .PP These extra keyword arguments are passed to the following functions: command generator functions, function Actions, and emitter functions\&. .SS "Action Objects" .PP The \fBBuilder\fR function will turn its \fIaction\fR keyword argument into an appropriate internal Action object\&. You can also explicitly create Action objects for passing to \fBBuilder\fR, or other functions that take actions as arguments, by calling the \fBAction\fR factory function\&. This can be used to configure an Action object more flexibly, or it may simply be more efficient than letting each separate Builder object create a separate Action when multiple Builder objects need to do the same thing\&. .PP The Action factory function returns an appropriate object for the action represented by the type of the action argument (the first positional parmeter): .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the action argument is already an Action object, the object is simply returned\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the action argument is a string, a command\-line Action is returned\&. If such a string begins with \fB@\fR, it indicates printing of the command line is to be suppressed\&. If the string begins with \fB\-\fR (hyphen), it indicates the exit status from the specified command is to be ignored, allowing execution to continue even if the command reports failure: .sp .if n \{\ .RS 4 .\} .nf Action(\*(Aq$CC \-c \-o $TARGET $SOURCES\*(Aq) # Doesn\*(Aqt print the line being executed\&. Action(\*(Aq@build $TARGET $SOURCES\*(Aq) # Ignores return value Action(\*(Aq\-build $TARGET $SOURCES\*(Aq) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the action argument is a list, then a list of Action objects is returned\&. An Action object is created as necessary for each element in the list\&. If an element \fIwithin\fR the list is itself a list, the internal list is taken as the command and arguments to be executed via the command line\&. This allows white space to be enclosed in an argument rather than taken as a separator by defining a command in a list within a list: .sp .if n \{\ .RS 4 .\} .nf Action([[\*(Aqcc\*(Aq, \*(Aq\-c\*(Aq, \*(Aq\-DWHITE SPACE\*(Aq, \*(Aq\-o\*(Aq, \*(Aq$TARGET\*(Aq, \*(Aq$SOURCES\*(Aq]]) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the action argument is a Python function, a function Action is returned\&. The Python function must accept three keyword arguments: .RS 4 \fItarget\fR \- a Node object representing the target file\&. .RE .RS 4 \fIsource\fR \- a Node object representing the source file\&. .RE .RS 4 \fIenv\fR \- the construction environment used for building the target file\&. .RE The \fItarget\fR and \fIsource\fR arguments may be lists of Node objects if there is more than one target file or source file\&. The actual target and source file name(s) may be retrieved from their Node objects via the built\-in Python \fBstr\fR function: .sp .if n \{\ .RS 4 .\} .nf target_file_name = str(target) source_file_names = [str(x) for x in source] .fi .if n \{\ .RE .\} .sp The function should return 0 or \fBNone\fR to indicate a successful build of the target file(s)\&. The function may raise an exception or return a non\-zero exit status to indicate an unsuccessful build\&. .sp .if n \{\ .RS 4 .\} .nf def build_it(target=None, source=None, env=None): # build the target from the source return 0 a = Action(build_it) .fi .if n \{\ .RE .\} .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the action argument is not one of the above types, \fBNone\fR is returned\&. .RE .PP As usual the environment method form \fBenv\&.Action\fR will expand construction variables in any argument strings, including the action argument, at the time it is called, using the construction variables in the construction environment through which it was called\&. The global function form \fBAction\fR \fIdelays\fR variable expansion until the Action object is actually used\&. .PP The second argument to \fBAction\fR is optional and is used to define the output which is printed when the Action is actually performed\&. In the absence of this parameter, or if it\*(Aqs an empty string, a default output depending on the type of the action is used\&. For example, a command\-line action will print the executed command\&. The argument must be either a Python function or a string: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the output argument is a function, it must return a string describing the action being executed\&. A function may also be specified using the \fIstrfunction\fR keyword argument\&. The function must accept these three keyword arguments: .RS 4 \fIsource\fR \- a Node object representing the source file\&. .RE .RS 4 \fItarget\fR \- a Node object representing the target file\&. .RE .RS 4 \fIenv\fR \- the construction environment\&. .RE The \fItarget\fR and \fIsource\fR arguments may be lists of Node objects if there is more than one target file or source file\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} If the output argument is a string, substitution is performed on it before it is printed\&. The output string may also be specified using the \fIcmdstr\fR keyword argument\&. The string typically contains variables, notably $TARGET(S) and $SOURCE(S), or consists of just a single variable, which is optionally defined somewhere else\&. SCons itself heavily uses the latter variant\&. .RE .PP Examples: .sp .if n \{\ .RS 4 .\} .nf def build_it(target, source, env): # build the target from the source return 0 def string_it(target, source, env): return "building \*(Aq%s\*(Aq from \*(Aq%s\*(Aq" % (target[0], source[0]) # Use a positional argument\&. f = Action(build_it, string_it) s = Action(build_it, "building \*(Aq$TARGET\*(Aq from \*(Aq$SOURCE\*(Aq") # Alternatively, use a keyword argument\&. f = Action(build_it, strfunction=string_it) s = Action(build_it, cmdstr="building \*(Aq$TARGET\*(Aq from \*(Aq$SOURCE\*(Aq") # You can provide a configurable variable\&. l = Action(build_it, \*(Aq$STRINGIT\*(Aq) .fi .if n \{\ .RE .\} .PP Any additional positional arguments, if present, may either be construction variables or lists of construction variables whose values will be included in the signature of the Action when deciding whether a target should be rebuilt because the action changed\&. Such variables may also be specified using the \fIvarlist\fR keyword parameter; both positional and keyword forms may be present, and will be combined\&. This is necessary whenever you want a target to be rebuilt when a specific construction variable changes\&. This is not often needed for a string action, as the expanded variables will normally be part of the command line, but may be needed if a Python function action uses the value of a construction variable when generating the command line\&. .sp .if n \{\ .RS 4 .\} .nf def build_it(target, source, env): # build the target from the \*(AqXXX\*(Aq construction variable with open(target[0], \*(Aqw\*(Aq) as f: f\&.write(env[\*(AqXXX\*(Aq]) return 0 # Use positional arguments\&. a = Action(build_it, \*(Aq$STRINGIT\*(Aq, [\*(AqXXX\*(Aq]) # Alternatively, use a keyword argument\&. a = Action(build_it, varlist=[\*(AqXXX\*(Aq]) .fi .if n \{\ .RE .\} .PP The Action factory function can be passed the following optional keyword arguments to modify the Action object\*(Aqs behavior: .PP \fIchdir\fR .RS 4 Specifies that scons will execute the action after changing to the specified directory\&. If the \fIchdir\fR argument is a string or a directory Node, scons will change to the specified directory\&. If the \fIchdir\fR argument is not a string or Node and is non\-zero, then scons will change to the target file\*(Aqs directory\&. .sp Note that scons will \fInot\fR automatically modify its expansion of construction variables like \fB$TARGET\fR and \fB$SOURCE\fR when using the \fIchdir\fR keyword argument\-\-that is, the expanded file names will still be relative to the top\-level directory containing the SConstruct file, and consequently incorrect relative to the chdir directory\&. Builders created using \fIchdir\fR keyword argument, will need to use construction variable expansions like ${TARGET\&.file} and ${SOURCE\&.file} to use just the filename portion of the targets and source\&. Example: .sp .if n \{\ .RS 4 .\} .nf a = Action("build < ${SOURCE\&.file} > ${TARGET\&.file}", chdir=1) .fi .if n \{\ .RE .\} .RE .PP \fIexitstatfunc\fR .RS 4 A function that is passed the exit status (or return value) from the specified action and can return an arbitrary or modified value\&. This can be used, for example, to specify that an Action object\*(Aqs return value should be ignored under special conditions and SCons should, therefore, consider that the action always succeeds\&. Example: .sp .if n \{\ .RS 4 .\} .nf def always_succeed(s): # Always return 0, which indicates success\&. return 0 a = Action("build < ${SOURCE\&.file} > ${TARGET\&.file}", exitstatfunc=always_succeed) .fi .if n \{\ .RE .\} .RE .PP \fIbatch_key\fR .RS 4 Specifies that the Action can create multiple target files by processing multiple independent source files simultaneously\&. (The canonical example is "batch compilation" of multiple object files by passing multiple source files to a single invocation of a compiler such as Microsoft\*(Aqs Visual C / C++ compiler\&.) If the \fIbatch_key\fR argument evaluates True and is not a callable object, the configured Action object will cause \fBscons\fR to collect all targets built with the Action object and configured with the same construction environment into single invocations of the Action object\*(Aqs command line or function\&. Command lines will typically want to use the \fB$CHANGED_SOURCES\fR construction variable (and possibly \fB$CHANGED_TARGETS\fR as well) to only pass to the command line those sources that have actually changed since their targets were built\&. Example: .sp .if n \{\ .RS 4 .\} .nf a = Action(\*(Aqbuild $CHANGED_SOURCES\*(Aq, batch_key=True) .fi .if n \{\ .RE .\} .sp The \fIbatch_key\fR argument may also be a callable function that returns a key that will be used to identify different "batches" of target files to be collected for batch building\&. A \fIbatch_key\fR function must accept the following arguments: .RS 4 \fIaction\fR \- The action object\&. .RE .RS 4 \fIenv\fR \- The construction environment configured for the target\&. .RE .RS 4 \fItarget\fR \- The list of targets for a particular configured action\&. .RE .RS 4 \fIsource\fR \- The list of source for a particular configured action\&. .RE The returned key should typically be a tuple of values derived from the arguments, using any appropriate logic to decide how multiple invocations should be batched\&. For example, a \fBbatch_key\fR function may decide to return the value of a specific construction variable from the \fIenv\fR argument which will cause \fBscons\fR to batch\-build targets with matching values of that variable, or perhaps return the Python \fBid\fR() of the entire construction environment, in which case \fBscons\fR will batch\-build all targets configured with the same construction environment\&. Returning \fBNone\fR indicates that the particular target should \fInot\fR be part of any batched build, but instead will be built by a separate invocation of action\*(Aqs command or function\&. Example: .sp .if n \{\ .RS 4 .\} .nf def batch_key(action, env, target, source): tdir = target[0]\&.dir if tdir\&.name == \*(Aqspecial\*(Aq: # Don\*(Aqt batch\-build any target # in the special/ subdirectory\&. return None return (id(action), id(env), tdir) a = Action(\*(Aqbuild $CHANGED_SOURCES\*(Aq, batch_key=batch_key) .fi .if n \{\ .RE .\} .RE .SS "Miscellaneous Action Functions" .PP \fBscons\fR supplies a number of functions that arrange for various common file and directory manipulations to be performed\&. These are similar in concept to "tasks" in the Ant build tool, although the implementation is slightly different\&. These functions do not actually perform the specified action at the time the function is called, but rather are factory functions which return an Action object that can be executed at the appropriate time\&. .PP In practice, there are two natural ways that these Action Functions are intended to be used\&. .PP First, if you need to perform the action at the time the SConscript file is being read, you can use the \fBExecute\fR global function to do so: .sp .if n \{\ .RS 4 .\} .nf Execute(Touch(\*(Aqfile\*(Aq)) .fi .if n \{\ .RE .\} .PP Second, you can use these functions to supply Actions in a list for use by the \fBenv\&.Command\fR method\&. This can allow you to perform more complicated sequences of file manipulation without relying on platform\-specific external commands: .sp .if n \{\ .RS 4 .\} .nf env = Environment(TMPBUILD=\*(Aq/tmp/builddir\*(Aq) env\&.Command( target=\*(Aqfoo\&.out\*(Aq, source=\*(Aqfoo\&.in\*(Aq, action=[ Mkdir(\*(Aq$TMPBUILD\*(Aq), Copy(\*(Aq$TMPBUILD\*(Aq, \*(Aq${SOURCE\&.dir}\*(Aq), "cd $TMPBUILD && make", Delete(\*(Aq$TMPBUILD\*(Aq), ], ) .fi .if n \{\ .RE .\} .PP \fBChmod\fR(\fIdest, mode\fR) .RS 4 Returns an Action object that changes the permissions on the specified \fIdest\fR file or directory to the specified \fImode\fR which can be octal or string, similar to the bash command\&. Examples: .sp .if n \{\ .RS 4 .\} .nf Execute(Chmod(\*(Aqfile\*(Aq, 0o755)) env\&.Command(\*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, [Copy(\*(Aq$TARGET\*(Aq, \*(Aq$SOURCE\*(Aq), Chmod(\*(Aq$TARGET\*(Aq, 0o755)]) Execute(Chmod(\*(Aqfile\*(Aq, "ugo+w")) env\&.Command(\*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, [Copy(\*(Aq$TARGET\*(Aq, \*(Aq$SOURCE\*(Aq), Chmod(\*(Aq$TARGET\*(Aq, "ugo+w")]) .fi .if n \{\ .RE .\} .RE .PP \fBCopy\fR(\fIdest, src\fR) .RS 4 Returns an Action object that will copy the \fIsrc\fR source file or directory to the \fIdest\fR destination file or directory\&. Examples: .sp .if n \{\ .RS 4 .\} .nf Execute(Copy(\*(Aqfoo\&.output\*(Aq, \*(Aqfoo\&.input\*(Aq)) env\&.Command(\*(Aqbar\&.out\*(Aq, \*(Aqbar\&.in\*(Aq, Copy(\*(Aq$TARGET\*(Aq, \*(Aq$SOURCE\*(Aq)) .fi .if n \{\ .RE .\} .RE .PP \fBDelete\fR(\fIentry, [must_exist]\fR) .RS 4 Returns an Action that deletes the specified \fIentry\fR, which may be a file or a directory tree\&. If a directory is specified, the entire directory tree will be removed\&. If the \fImust_exist\fR flag is set to a true value, then a Python error will be raised if the specified entry does not exist; the default is false, that is, the Action will silently do nothing if the entry does not exist\&. Examples: .sp .if n \{\ .RS 4 .\} .nf Execute(Delete(\*(Aq/tmp/buildroot\*(Aq)) env\&.Command( \*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, action=[ Delete(\*(Aq${TARGET\&.dir}\*(Aq), MyBuildAction, ], ) Execute(Delete(\*(Aqfile_that_must_exist\*(Aq, must_exist=True)) .fi .if n \{\ .RE .\} .RE .PP \fBMkdir\fR(\fIdir\fR) .RS 4 Returns an Action that creates the specified directory \fIdir\fR\&. Examples: .sp .if n \{\ .RS 4 .\} .nf Execute(Mkdir(\*(Aq/tmp/outputdir\*(Aq)) env\&.Command( \*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, action=[ Mkdir(\*(Aq/tmp/builddir\*(Aq), Copy(\*(Aq/tmp/builddir/foo\&.in\*(Aq, \*(Aq$SOURCE\*(Aq), "cd /tmp/builddir && make", Copy(\*(Aq$TARGET\*(Aq, \*(Aq/tmp/builddir/foo\&.out\*(Aq), ], ) .fi .if n \{\ .RE .\} .RE .PP \fBMove\fR(\fIdest, src\fR) .RS 4 Returns an Action that moves the specified \fIsrc\fR file or directory to the specified \fIdest\fR file or directory\&. Examples: .sp .if n \{\ .RS 4 .\} .nf Execute(Move(\*(Aqfile\&.destination\*(Aq, \*(Aqfile\&.source\*(Aq)) env\&.Command( \*(Aqoutput_file\*(Aq, \*(Aqinput_file\*(Aq, action=[MyBuildAction, Move(\*(Aq$TARGET\*(Aq, \*(Aqfile_created_by_MyBuildAction\*(Aq)], ) .fi .if n \{\ .RE .\} .RE .PP \fBTouch\fR(\fIfile\fR) .RS 4 Returns an Action that updates the modification time on the specified \fIfile\fR\&. Examples: .sp .if n \{\ .RS 4 .\} .nf Execute(Touch(\*(Aqfile_to_be_touched\*(Aq)) env\&.Command(\*(Aqmarker\*(Aq, \*(Aqinput_file\*(Aq, action=[MyBuildAction, Touch(\*(Aq$TARGET\*(Aq)]) .fi .if n \{\ .RE .\} .RE .SS "Variable Substitution" .PP Before executing a command, \fBscons\fR performs construction variable substitution on the string that makes up the command line of the builder\&. Construction variables to be interpolated are indicated in the string with a leading $, to distinguish them from plain text which is not to be substituted\&. Besides regular construction variables, scons provides the following special variables for each command execution: .PP \fB$CHANGED_SOURCES\fR .RS 4 The file names of all sources of the build command that have changed since the target was last built\&. .RE .PP \fB$CHANGED_TARGETS\fR .RS 4 The file names of all targets that would be built from sources that have changed since the target was last built\&. .RE .PP \fB$SOURCE\fR .RS 4 The file name of the source of the build command, or the file name of the first source if multiple sources are being built\&. .RE .PP \fB$SOURCES\fR .RS 4 The file names of the sources of the build command\&. .RE .PP \fB$TARGET\fR .RS 4 The file name of the target being built, or the file name of the first target if multiple targets are being built\&. .RE .PP \fB$TARGETS\fR .RS 4 The file names of all targets being built\&. .RE .PP \fB$UNCHANGED_SOURCES\fR .RS 4 The file names of all sources of the build command that have \fInot\fR changed since the target was last built\&. .RE .PP \fB$UNCHANGED_TARGETS\fR .RS 4 The file names of all targets that would be built from sources that have \fInot\fR changed since the target was last built\&. .RE .PP Note that the above variables are reserved and may not be assigned to in the construction environment\&. .PP For example, given the construction variables CC=\*(Aqcc\*(Aq, targets=[\*(Aqfoo\*(Aq] and sources=[\*(Aqfoo\&.c\*(Aq, \*(Aqbar\&.c\*(Aq]: .sp .if n \{\ .RS 4 .\} .nf action=\*(Aq$CC \-c \-o $TARGET $SOURCES\*(Aq .fi .if n \{\ .RE .\} .PP would produce the command line: .sp .if n \{\ .RS 4 .\} .nf cc \-c \-o foo foo\&.c bar\&.c .fi .if n \{\ .RE .\} .PP Variable names may be surrounded by curly braces (\fB{}\fR) to separate the name from surrounding characters which are not part of the name\&. Within the curly braces, a variable name may use Python list subscripting/slicing notation to select one or more items from a list\&. In the previous example, the string: ${SOURCES[1]} would produce: .sp .if n \{\ .RS 4 .\} .nf bar\&.c .fi .if n \{\ .RE .\} .PP Additionally, a variable name may have the following modifiers appended within the enclosing curly braces to access properties of the interpolated string: .RS 4 \fIbase\fR \- The base path of the file name, including the directory path but excluding any suffix\&. .RE .RS 4 \fIdir\fR \- The name of the directory in which the file exists\&. .RE .RS 4 \fIfile\fR \- The file name, minus any directory portion\&. .RE .RS 4 \fIfilebase\fR \- Like \fIfile\fR but minus its suffix\&. .RE .RS 4 \fIsuffix\fR \- Just the file suffix\&. .RE .RS 4 \fIabspath\fR \- The absolute path name of the file\&. .RE .RS 4 \fIposix\fR \- The path with directories separated by forward slashes (\fB/\fR)\&. Sometimes necessary on Windows systems when a path references a file on other (POSIX) systems\&. .RE .RS 4 \fIwindows\fR \- The path with directories separated by backslashes (\fB\e\e\fR)\&. Sometimes necessary on POSIX\-style systems when a path references a file on other (Windows) systems\&. \fIwin32\fR is a (deprecated) synonym for \fIwindows\fR\&. .RE .RS 4 \fIsrcpath\fR \- The directory and file name to the source file linked to this file through \fBVariantDir\fR()\&. If this file isn\*(Aqt linked, it just returns the directory and filename unchanged\&. .RE .RS 4 \fIsrcdir\fR \- The directory containing the source file linked to this file through \fBVariantDir\fR()\&. If this file isn\*(Aqt linked, it just returns the directory part of the filename\&. .RE .RS 4 \fIrsrcpath\fR \- The directory and file name to the source file linked to this file through \fBVariantDir\fR()\&. If the file does not exist locally but exists in a Repository, the path in the Repository is returned\&. If this file isn\*(Aqt linked, it just returns the directory and filename unchanged\&. .RE .RS 4 \fIrsrcdir\fR \- The Repository directory containing the source file linked to this file through \fBVariantDir\fR()\&. If this file isn\*(Aqt linked, it just returns the directory part of the filename\&. .RE .PP For example, the specified target will expand as follows for the corresponding modifiers: .sp .if n \{\ .RS 4 .\} .nf $TARGET => sub/dir/file\&.x ${TARGET\&.base} => sub/dir/file ${TARGET\&.dir} => sub/dir ${TARGET\&.file} => file\&.x ${TARGET\&.filebase} => file ${TARGET\&.suffix} => \&.x ${TARGET\&.abspath} => /top/dir/sub/dir/file\&.x SConscript(\*(Aqsrc/SConscript\*(Aq, variant_dir=\*(Aqsub/dir\*(Aq) $SOURCE => sub/dir/file\&.x ${SOURCE\&.srcpath} => src/file\&.x ${SOURCE\&.srcdir} => src Repository(\*(Aq/usr/repository\*(Aq) $SOURCE => sub/dir/file\&.x ${SOURCE\&.rsrcpath} => /usr/repository/src/file\&.x ${SOURCE\&.rsrcdir} => /usr/repository/src .fi .if n \{\ .RE .\} .PP Modifiers can be combined, like ${TARGET\&.base\&.windows}, ${TARGET\&.srcpath\&.base), ${TARGET\&.file\&.suffix}, etc\&. .PP Note that curly braces braces may also be used to enclose arbitrary Python code to be evaluated\&. (In fact, this is how the above modifiers are substituted, they are simply attributes of the Python objects that represent \fB$TARGET\fR, \fB$SOURCES\fR, etc\&.) See the section called \(lqPython Code Substitution\(rq below for more thorough examples of how this can be used\&. .PP Lastly, a variable name may be a callable Python function associated with a construction variable in the environment\&. The function should accept four arguments: .RS 4 \fItarget\fR \- a list of target nodes .RE .RS 4 \fIsource\fR \- a list of source nodes .RE .RS 4 \fIenv\fR \- the construction environment .RE .RS 4 \fIfor_signature\fR \- a Boolean value that specifies whether the function is being called for generating a build signature\&. .RE .PP SCons will insert whatever the called function returns into the expanded string: .sp .if n \{\ .RS 4 .\} .nf def foo(target, source, env, for_signature): return "bar" # Will expand $BAR to "bar baz" env=Environment(FOO=foo, BAR="$FOO baz") .fi .if n \{\ .RE .\} .PP You can use this feature to pass arguments to a Python function by creating a callable class that stores one or more arguments in an object, and then uses them when the __call__() method is called\&. Note that in this case, the entire variable expansion must be enclosed by curly braces so that the arguments will be associated with the instantiation of the class: .sp .if n \{\ .RS 4 .\} .nf class foo: def __init__(self, arg): self\&.arg = arg def __call__(self, target, source, env, for_signature): return self\&.arg + " bar" # Will expand $BAR to "my argument bar baz" env=Environment(FOO=foo, BAR="${FOO(\*(Aqmy argument\*(Aq)} baz") .fi .if n \{\ .RE .\} .PP The special pseudo\-variables \fB$(\fR and \fB$)\fR may be used to surround parts of a command line that may change \fIwithout\fR causing a rebuild\-\-that is, which are not included in the signature of target files built with this command\&. All text between \fB$(\fR and \fB$)\fR will be removed from the command line before it is added to file signatures, and the \fB$(\fR and \fB$)\fR will be removed before the command is executed\&. For example, the command line: .sp .if n \{\ .RS 4 .\} .nf echo Last build occurred $( $TODAY $)\&. > $TARGET .fi .if n \{\ .RE .\} .PP would execute the command: .sp .if n \{\ .RS 4 .\} .nf echo Last build occurred $TODAY\&. > $TARGET .fi .if n \{\ .RE .\} .PP but the command signature added to any target files would be: .sp .if n \{\ .RS 4 .\} .nf echo Last build occurred \&. > $TARGET .fi .if n \{\ .RE .\} .SS "Python Code Substitution" .PP Any Python code within curly braces (\fB{}\fR) and introduced by the variable prefix $ will be evaluated using the Python \fBeval\fR statement, with the Python globals set to the current environment\*(Aqs set of construction variables, and the result substituted in\&. So in the following case: .sp .if n \{\ .RS 4 .\} .nf env[\*(AqCOND\*(Aq] = 0 env\&.Command(\*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, \*(Aq\*(Aq\*(Aqecho ${COND==1 and \*(AqFOO\*(Aq or \*(AqBAR\*(Aq} > $TARGET\*(Aq\*(Aq\*(Aq) .fi .if n \{\ .RE .\} .PP the command executed will be either .sp .if n \{\ .RS 4 .\} .nf echo FOO > foo\&.out .fi .if n \{\ .RE .\} .PP or .sp .if n \{\ .RS 4 .\} .nf echo BAR > foo\&.out .fi .if n \{\ .RE .\} .PP according to the current value of env[\*(AqCOND\*(Aq] when the command is executed\&. The evaluation takes place when the target is being built, not when the SConscript is being read\&. So if env[\*(AqCOND\*(Aq] is changed later in the SConscript, the final value will be used\&. .PP Here\*(Aqs a more interesting example\&. Note that all of \fBCOND\fR, \fBFOO\fR, and \fBBAR\fR are construction variables, and their values are substituted into the final command\&. \fBFOO\fR is a list, so its elements are interpolated separated by spaces\&. .sp .if n \{\ .RS 4 .\} .nf env=Environment() env[\*(AqCOND\*(Aq] = 0 env[\*(AqFOO\*(Aq] = [\*(Aqfoo1\*(Aq, \*(Aqfoo2\*(Aq] env[\*(AqBAR\*(Aq] = \*(Aqbarbar\*(Aq env\&.Command(\*(Aqfoo\&.out\*(Aq, \*(Aqfoo\&.in\*(Aq, \*(Aqecho ${COND==1 and FOO or BAR} > $TARGET\*(Aq) # Will execute this: # echo foo1 foo2 > foo\&.out .fi .if n \{\ .RE .\} .PP SCons uses the following rules when converting construction variables into command lines: .PP string .RS 4 When the value is a string it is interpreted as a space delimited list of command line arguments\&. .RE .PP list .RS 4 When the value is a list it is interpreted as a list of command line arguments\&. Each element of the list is converted to a string\&. .RE .PP other .RS 4 Anything that is not a list or string is converted to a string and interpreted as a single command line argument\&. .RE .PP newline .RS 4 Newline characters (\en) delimit lines\&. The newline parsing is done after all other parsing, so it is not possible for arguments (e\&.g\&. file names) to contain embedded newline characters\&. .RE .SS "Scanner Objects" .PP You can use the \fBScanner\fR function to define objects to scan new file types for implicit dependencies\&. The \fBScanner\fR function accepts the following arguments: .PP \fIfunction\fR .RS 4 This can be either: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} a Python function that will process the Node (file) and return a list of File Nodes representing the implicit dependencies (file names) found in the contents; or: .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} a dictionary that maps keys (typically the file suffix, but see below for more discussion) to other Scanners that should be called\&. .RE .sp If the argument is a Python function, the function must accept three required arguments and an optional fourth: .RS 4 \fInode\fR \- The internal SCons node representing the file\&. Use \fBstr\fR(\fInode\fR) to fetch the name of the file, and \fInode\fR\&.\fBget_contents\fR() to fetch the contents of the file as bytes or \fInode\fR\&.\fBget_text_contents\fR() to fetch the contents as text\&. Note that the file is \fInot\fR guaranteed to exist before the scanner is called, so the scanner function should check that if there\*(Aqs any chance that the scanned file might not exist (for example, if it\*(Aqs built from other files)\&. .RE .RS 4 \fIenv\fR \- The construction environment for the scan\&. .RE .RS 4 \fIpath\fR \- A tuple (or list) of directories that can be searched for files\&. This will usually be the tuple returned by the \fIpath_function\fR argument (see below)\&. .RE .RS 4 \fIarg\fR \- The argument supplied when the scanner was created, if any (default \fBNone\fR\&. .RE .RE .PP \fIname\fR .RS 4 The name of the Scanner\&. This is mainly used to identify the Scanner internally\&. .RE .PP \fIargument\fR .RS 4 An optional argument that, if specified, will be passed to the scanner function (described above) and the path function (specified below)\&. .RE .PP \fIskeys\fR .RS 4 An optional list that can be used to determine which scanner should be used for a given Node\&. In the usual case of scanning for file names, this argument will be a list of suffixes for the different file types that this Scanner knows how to scan\&. If the argument is a string, then it will be expanded into a list by the current environment\&. .RE .PP \fIpath_function\fR .RS 4 A Python function that takes four or five arguments: a construction environment, a Node for the directory containing the SConscript file in which the first target was defined, a list of target nodes, a list of source nodes, and an optional argument supplied when the scanner was created\&. The \fIpath_function\fR returns a tuple of directories that can be searched for files to be returned by this Scanner object\&. (Note that the \fBFindPathDirs\fR function can be used to return a ready\-made \fIpath_function\fR for a given construction variable name, instead of having to write your own function from scratch\&.) .RE .PP \fInode_class\fR .RS 4 The class of Node that should be returned by this Scanner object\&. Any strings or other objects returned by the scanner function that are not of this class will be run through the function supplied by the \fInode_factory\fR argument\&. .RE .PP \fInode_factory\fR .RS 4 A Python function that will take a string or other object and turn it into the appropriate class of Node to be returned by this Scanner object\&. .RE .PP \fIscan_check\fR .RS 4 An optional Python function that takes two arguments, a Node (file) and a construction environment, and returns whether the Node should, in fact, be scanned for dependencies\&. This check can be used to eliminate unnecessary calls to the scanner function when, for example, the underlying file represented by a Node does not yet exist\&. .RE .PP \fIrecursive\fR .RS 4 An optional flag that specifies whether this scanner should be re\-invoked on the dependency files returned by the scanner\&. When this flag is not set, the Node subsystem will only invoke the scanner on the file being scanned, and not (for example) also on the files specified by the #include lines in the file being scanned\&. \fIrecursive\fR may be a callable function, in which case it will be called with a list of Nodes found and should return a list of Nodes that should be scanned recursively; this can be used to select a specific subset of Nodes for additional scanning\&. .RE .PP Note that \fBscons\fR has a global SourceFileScanner object that is used by the \fBObject\fR, \fBSharedObject\fR and \fBStaticObject\fR builders to decide which scanner should be used for different file extensions\&. You can use the SourceFileScanner\&.add_scanner() method to add your own Scanner object to the SCons infrastructure that builds target programs or libraries from a list of source files of different types: .sp .if n \{\ .RS 4 .\} .nf def xyz_scan(node, env, path): contents = node\&.get_text_contents() # Scan the contents and return the included files\&. XYZScanner = Scanner(xyz_scan) SourceFileScanner\&.add_scanner(\*(Aq\&.xyz\*(Aq, XYZScanner) env\&.Program(\*(Aqmy_prog\*(Aq, [\*(Aqfile1\&.c\*(Aq, \*(Aqfile2\&.f\*(Aq, \*(Aqfile3\&.xyz\*(Aq]) .fi .if n \{\ .RE .\} .SH "SYSTEM-SPECIFIC BEHAVIOR" .PP \fBscons\fR and its configuration files are very portable, due largely to its implementation in Python\&. There are, however, a few portability issues waiting to trap the unwary\&. .SS "\&.C file suffix" .PP \fBscons\fR handles the upper\-case \&.C file suffix differently, depending on the capabilities of the underlying system\&. On a case\-sensitive system such as Linux or UNIX, \fBscons\fR treats a file with a \&.C suffix as a C++ source file\&. On a case\-insensitive system such as Windows, \fBscons\fR treats a file with a \&.C suffix as a C source file\&. .SS "\&.F file suffix" .PP \fBscons\fR handles the upper\-case \&.F file suffix differently, depending on the capabilities of the underlying system\&. On a case\-sensitive system such as Linux or UNIX, \fBscons\fR treats a file with a \&.F suffix as a Fortran source file that is to be first run through the standard C preprocessor\&. On a case\-insensitive system such as Windows, \fBscons\fR treats a file with a \&.F suffix as a Fortran source file that should \fInot\fR be run through the C preprocessor\&. .SS "Windows: Cygwin Tools and Cygwin Python vs\&. Windows Pythons" .PP Cygwin supplies a set of tools and utilities that let users work on a Windows system using a more POSIX\-like environment\&. The Cygwin tools, including Cygwin Python, do this, in part, by sharing an ability to interpret UNIX\-like path names\&. For example, the Cygwin tools will internally translate a Cygwin path name like /cygdrive/c/mydir to an equivalent Windows pathname of C:/mydir (equivalent to C:\emydir)\&. .PP Versions of Python that are built for native Windows execution, such as the python\&.org and ActiveState versions, do not have the Cygwin path name semantics\&. This means that using a native Windows version of Python to build compiled programs using Cygwin tools (such as gcc, bison and flex) may yield unpredictable results\&. "Mixing and matching" in this way can be made to work, but it requires careful attention to the use of path names in your SConscript files\&. .PP In practice, users can sidestep the issue by adopting the following rules: When using gcc, use the Cygwin\-supplied Python interpreter to run \fBscons\fR; when using Microsoft Visual C/C++ (or some other Windows compiler) use the python\&.org or Microsoft Store or ActiveState version of Python to run \fBscons\fR\&. .SS "Windows: scons\&.bat file" .PP On Windows systems, \fBscons\fR is executed via a wrapper scons\&.bat file\&. This has (at least) two ramifications: .PP First, Windows command\-line users that want to use variable assignment on the command line may have to put double quotes around the assignments: .sp .if n \{\ .RS 4 .\} .nf \fBscons "FOO=BAR" "BAZ=BLEH"\fR .fi .if n \{\ .RE .\} .PP Second, the Cygwin shell does not recognize this file as being the same as an \fBscons\fR command issued at the command\-line prompt\&. You can work around this either by executing scons\&.bat from the Cygwin command line, or by creating a wrapper shell script named scons\&. .SS "MinGW" .PP The MinGW bin directory must be in your \fBPATH\fR environment variable or the \fBENV[\*(AqPATH\*(Aq]\fR construction variable for \fBscons\fR to detect and use the MinGW tools\&. When running under the native Windows Python interpreter, \fBscons\fR will prefer the MinGW tools over the Cygwin tools, if they are both installed, regardless of the order of the bin directories in the \fBPATH\fR variable\&. If you have both MSVC and MinGW installed and you want to use MinGW instead of MSVC, then you must explicitly tell \fBscons\fR to use MinGW by passing tools=[\*(Aqmingw\*(Aq] to the \fBEnvironment\fR function, because \fBscons\fR will prefer the MSVC tools over the MinGW tools\&. .SH "ENVIRONMENT" .PP In general, \fBscons\fR is not controlled by environment variables set in the shell used to invoke it, leaving it up to the SConscript file author to import those if desired\&. However the following variables are imported by \fBscons\fR itself if set: .PP \fBSCONS_LIB_DIR\fR .RS 4 Specifies the directory that contains the \fBscons\fR Python module directory\&. Normally \fBscons\fR can deduce this, but in some circumstances, such as working with a source release, it may be necessary to specify (for example, /home/aroach/scons\-src\-0\&.01/src/engine)\&. .RE .PP \fBSCONSFLAGS\fR .RS 4 A string of options that will be used by \fBscons\fR in addition to those passed on the command line\&. .RE .PP \fBSCONS_CACHE_MSVC_CONFIG\fR .RS 4 (Windows only)\&. If set, save the shell environment variables generated when setting up the Microsoft Visual C++ compiler (and/or Build Tools) to a file to give these settings, which are expensive to generate, persistence across \fBscons\fR invocations\&. Use of this option is primarily intended to aid performance in tightly controlled Continuous Integration setups\&. .sp If set to a True\-like value ("1", "true" or "True") will cache to a file named \&.scons_msvc_cache in the user\*(Aqs home directory\&. If set to a pathname, will use that pathname for the cache\&. .sp Note: use this cache with caution as it might be somewhat fragile: while each major toolset version (e\&.g\&. Visual Studio 2017 vs 2019) and architecture pair will get separate cache entries, if toolset updates cause a change to settings within a given release series, \fBscons\fR will not detect the change and will reuse old settings\&. Remove the cache file in case of problems with this\&. \fBscons\fR will ignore failures reading or writing the file and will silently revert to non\-cached behavior in such cases\&. .sp \fIAvailable since \fR\fI\fBscons\fR\fR\fI 3\&.1 (experimental)\fR\&. .RE .SH "SEE ALSO" .RS 4 The SCons User Guide at \m[blue]\fB\%https://scons.org/doc/production/HTML/scons-user.html\fR\m[] .RE .RS 4 The SCons Design Document (old) .RE .RS 4 The SCons Cookbook at \m[blue]\fB\%https://scons-cookbook.readthedocs.io\fR\m[] for examples of how to solve various problems with SCons\&. .RE .RS 4 SCons source code \m[blue]\fBon GitHub\fR\m[]\&\s-2\u[2]\d\s+2 .RE .RS 4 The SCons API Reference \m[blue]\fB\%https://scons.org/doc/production/HTML/scons-api/index.html\fR\m[] (for internal details) .RE .SH "AUTHORS" .PP Originally: Steven Knight knight@baldmt\&.com and Anthony Roach aroach@electriceyeball\&.com\&. .PP Since 2010: The SCons Development Team scons\-dev@scons\&.org\&. .SH "AUTHORS" .PP \fBSteven Knight\fR .RS 4 Author. .RE .PP \fBSteven Knight and the SCons Development Team\fR .SH "COPYRIGHT" .br Copyright \(co 2004 - 2020 The SCons Foundation .br .SH "NOTES" .IP " 1." 4 LLVM specification .RS 4 \%https://clang.llvm.org/docs/JSONCompilationDatabase.html .RE .IP " 2." 4 on GitHub .RS 4 \%https://github.com/SCons/scons .RE