%scons; %builders-mod; %functions-mod; %tools-mod; %variables-mod; ]> Controls whether or not &SCons; will add implicit dependencies for the commands executed to build targets. 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 PATH variable in the ENV dictionary in the &consenv; used to execute the command. The default is the same as setting the &consvar; &cv-IMPLICIT_COMMAND_DEPENDENCIES; to a True-like value (true, yes, or 1 - but not a number greater than one, as that has a different meaning). Action strings can be segmented by the use of an AND operator, &&. In a segemented string, each segment is a separate command line, 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 &cv-IMPLICIT_COMMAND_DEPENDENCIES; is applied to each segment. If &cv-IMPLICIT_COMMAND_DEPENDENCIES; is set to a False-like value (none, false, no, 0, etc.), then the implicit dependency will not be added to the targets built with that &consenv;. If &cv-IMPLICIT_COMMAND_DEPENDENCIES; is set to 2 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 &consenv;. The first argument in the command line will be searched for using the PATH variable in the ENV dictionary in the &consenv; 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. If &cv-IMPLICIT_COMMAND_DEPENDENCIES; is set to all, 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 &consenv;. The first argument in the command line will be searched for using the PATH variable in the ENV dictionary in the &consenv; 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. env = Environment(IMPLICIT_COMMAND_DEPENDENCIES=False) A Python function used to print the command lines as they are executed (assuming command printing is not disabled by the or options or their equivalents). The function must accept four arguments: s, target, source and env. s is a string showing the command being executed, target, is the target being built (file node, list, or string name(s)), source, is the source(s) used (file node, list, or string name(s)), and env is the environment being used. The function must do the printing itself. The default implementation, used if this variable is not set or is None, is to just print the string, as in: def print_cmd_line(s, target, source, env): sys.stdout.write(s + "\n") Here is an example of a more interesting function: def print_cmd_line(s, target, source, env): sys.stdout.write( "Building %s -> %s...\n" % ( ' and '.join([str(x) for x in source]), ' and '.join([str(x) for x in target]), ) ) env = Environment(PRINT_CMD_LINE_FUNC=print_cmd_line) env.Program('foo', ['foo.c', 'bar.c']) This prints: ... scons: Building targets ... Building bar.c -> bar.o... Building foo.c -> foo.o... Building foo.o and bar.o -> foo... scons: done building targets. Another example could be a function that logs the actual commands to a file. A command interpreter function that will be called to execute command line strings. The function must accept five arguments: def spawn(shell, escape, cmd, args, env): shell is a string naming the shell program to use, escape is a function that can be called to escape shell special characters in the command line, cmd is the path to the command to be executed, args holds the arguments to the command and env is a dictionary of environment variables defining the execution environment in which the command should be executed. A hook allowing the execution environment to be modified prior to the actual execution of a command line from an action via the spawner function defined by &cv-link-SPAWN;. Allows substitution based on targets and sources, as well as values from the &consenv;, adding extra environment variables, etc. The value must be a list (or other iterable) of functions which each generate or alter the execution environment dictionary. The first function will be passed a copy of the initial execution environment (&cv-link-ENV; in the current &consenv;); the dictionary returned by that function is passed to the next, until the iterable is exhausted and the result returned for use by the command spawner. The original execution environment is not modified. Each function provided in &cv-SHELL_ENV_GENERATORS; must accept four arguments and return a dictionary: env is the &consenv; for this action; target is the list of targets associated with this action; source is the list of sources associated with this action; and shell_env is the current dictionary after iterating any previous &cv-SHELL_ENV_GENERATORS; functions (this can be compared to the original execution environment, which is available as env['ENV'], to detect any changes). Example: def custom_shell_env(env, target, source, shell_env): """customize shell_env if desired""" if str(target[0]) == 'special_target': shell_env['SPECIAL_VAR'] = env.subst('SOME_VAR', target=target, source=source) return shell_env env["SHELL_ENV_GENERATORS"] = [custom_shell_env] Available since 4.4