SCons.Platform package¶
Submodules¶
SCons.Platform.aix module¶
Platform-specific initialization for IBM AIX systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.cygwin module¶
Platform-specific initialization for Cygwin systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.darwin module¶
Platform-specific initialization for Mac OS X systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.hpux module¶
Platform-specific initialization for HP-UX systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.irix module¶
Platform-specific initialization for SGI IRIX systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.mingw module¶
Platform-specific initialization for the MinGW system.
SCons.Platform.os2 module¶
Platform-specific initialization for OS/2 systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.posix module¶
Platform-specific initialization for POSIX (Linux, UNIX, etc.) systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.sunos module¶
Platform-specific initialization for Sun systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
SCons.Platform.virtualenv module¶
‘Platform” support for a Python virtualenv.
-
SCons.Platform.virtualenv.
ImportVirtualenv
(env)[source]¶ Copies virtualenv-related environment variables from OS environment to
env['ENV']
and prepends virtualenv’s PATH toenv['ENV']['PATH']
.
-
SCons.Platform.virtualenv.
IsInVirtualenv
(path)[source]¶ Returns True, if path is under virtualenv’s home directory. If not, or if we don’t use virtualenv, returns False.
-
SCons.Platform.virtualenv.
Virtualenv
()[source]¶ Returns path to the virtualenv home if scons is executing within a virtualenv or None, if not.
-
SCons.Platform.virtualenv.
_inject_venv_path
(env, path_list=None)[source]¶ Modify environment such that SCons will take into account its virtualenv when running external tools.
-
SCons.Platform.virtualenv.
_is_path_in
(path, base)[source]¶ Returns true if path is located under the base directory.
SCons.Platform.win32 module¶
Platform-specific initialization for Win32 systems.
There normally shouldn’t be any need to import this module directly. It will usually be imported through the generic SCons.Platform.Platform() selection method.
-
class
SCons.Platform.win32.
ArchDefinition
(arch, synonyms=[])[source]¶ Bases:
object
Determine which windows CPU were running on. A class for defining architecture-specific settings and logic.
-
SCons.Platform.win32.
get_architecture
(arch=None)[source]¶ Returns the definition for the specified architecture string.
If no string is specified, the system default is returned (as defined by the PROCESSOR_ARCHITEW6432 or PROCESSOR_ARCHITECTURE environment variables).
Module contents¶
SCons platform selection.
Looks for modules that define a callable object that can modify a construction environment as appropriate for a given platform.
Note that we take a more simplistic view of “platform” than Python does. We’re looking for a single string that determines a set of tool-independent variables with which to initialize a construction environment. Consequently, we’ll examine both sys.platform and os.name (and anything else that might come in to play) in order to return some specification which is unique enough for our purposes.
Note that because this subsystem just selects a callable that can modify a construction environment, it’s possible for people to define their own “platform specification” in an arbitrary callable function. No one needs to use or tie in to this subsystem in order to roll their own platform definition.
-
SCons.Platform.
DefaultToolList
(platform, env)[source]¶ Select a default tool list for the specified platform.
-
class
SCons.Platform.
TempFileMunge
(cmd, cmdstr=None)[source]¶ Bases:
object
Convert long command lines to use a temporary file.
You can set an Environment variable (usually
TEMPFILE
) to this, then call it with a string argument, and it will perform temporary file substitution on it. This is used to circumvent limitations on the length of command lines. Example:env["TEMPFILE"] = TempFileMunge env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}"
By default, the name of the temporary file used begins with a prefix of ‘@’. This may be configured for other tool chains by setting the
TEMPFILEPREFIX
variable. Example:env["TEMPFILEPREFIX"] = '-@' # diab compiler env["TEMPFILEPREFIX"] = '-via' # arm tool chain env["TEMPFILEPREFIX"] = '' # (the empty string) PC Lint
You can configure the extension of the temporary file through the
TEMPFILESUFFIX
variable, which defaults to ‘.lnk’ (see comments in the code below). Example:env["TEMPFILESUFFIX"] = '.lnt' # PC Lint
Entries in the temporary file are separated by the value of the
TEMPFILEARGJOIN
variable, which defaults to an OS-appropriate value.A default argument escape function is
SCons.Subst.quote_spaces
. If you need to apply extra operations on a command argument before writing to a temporary file(fix Windows slashes, normalize paths, etc.), please set TEMPFILEARGESCFUNC variable to a custom function. Example:import sys import re from SCons.Subst import quote_spaces WINPATHSEP_RE = re.compile(r"\([^"'\]|$)") def tempfile_arg_esc_func(arg): arg = quote_spaces(arg) if sys.platform != "win32": return arg # GCC requires double Windows slashes, let's use UNIX separator return WINPATHSEP_RE.sub(r"/", arg) env["TEMPFILEARGESCFUNC"] = tempfile_arg_esc_func