.B scons
knows how to search for available programming tools
on various systems.
-On WIN32 systems,
+On Windows systems,
.B scons
searches in order for the
Microsoft Visual C++ tools,
(such as fetching source files from
external CVS repository specifications like
.BR :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons )
-will work on Win32 systems.
+will work on Windows systems.
The platform argument may be function or callable object,
in which case the Environment() method
On posix and cygwin platforms
the GNU tools (e.g. gcc) are preferred by SCons,
-on win32 the Microsoft tools (e.g. msvc)
+on Windows the Microsoft tools (e.g. msvc)
followed by MinGW are preferred by SCons,
and in OS/2 the IBM tools (e.g. icc) are preferred by SCons.
(such as fetching source files from
external CVS repository specifications like
.BR :pserver:anonymous@cvs.sourceforge.net:/cvsroot/scons )
-will work on Win32 systems.
+will work on Windows systems.
'\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.TP
or the user's current external PATH
(os.environ['PATH'])
by default.
-On Win32 systems, searches for executable
+On Windows systems, searches for executable
programs with any of the file extensions
listed in the specified
.I pathext,
.B /
(forward slashes)
not backslashes.
-This is sometimes necessary on Win32 systems
+This is sometimes necessary on Windows systems
when a path references a file on other (POSIX) systems.
.IP srcpath
suffix as a Fortran source file that should
.I not
be run through the C preprocessor.
-.SS WIN32: Cygwin Tools and Cygwin Python vs. Windows Pythons
+.SS Windows: Cygwin Tools and Cygwin Python vs. Windows Pythons
Cygwin supplies a set of tools and utilities
that let users work on a
Windows system using a more POSIX-like environment.
(or some other Windows compiler)
use the python.org or ActiveState version of Python
to run SCons.
-.SS WIN32: scons.bat file
-On WIN32 systems,
+.SS Windows: scons.bat file
+On Windows systems,
SCons is executed via a wrapper
.B scons.bat
file.
on a POSIX system
is <literal>/usr/local/bin:/bin:/usr/bin</literal>.
The default value of the &PATH; environment variable
- on a Win32 system comes from the Windows registry
+ on a Windows system comes from the Windows registry
value for the command interpreter.
If you want to execute any commands--compilers, linkers, etc.--that
are not in these default locations,
ENV => { 'PATH' => '/bin:/usr/bin' },
-And on a Win32 system (Windows NT), the default construction variables
+And on a Windows system (Windows NT), the default construction variables
are (unless the default rule style is set using the B<DefaultRules>
method):
<para>
- And on Win32:
+ And on Windows:
</para>
&SCons; has received contributions
from many other people, of course:
- Matt Balvin (extending long command-line support on Win32),
+ Matt Balvin (extending long command-line support on Windows),
Allen Bierbaum (extensions and fixes to Options),
Steve Christensen (help text sorting and function action signature fixes),
Michael Cook (avoiding losing signal bits from executed commands),
Derrick 'dman' Hudson (),
- Alex Jacques (work on the Win32 scons.bat file),
+ Alex Jacques (work on the Windows scons.bat file),
Stephen Kennedy (performance enhancements),
Lachlan O'Dea (SharedObject() support for masm
and normalized paths for the WhereIs() function),
- Add a --taskmastertrace=FILE option to give some insight on how
the taskmaster decides what Node to build next.
+ - Changed the names of the old $WIN32DEFPREFIX, $WIN32DEFSUFFIX,
+ $WIN32DLLPREFIX and $WIN32IMPLIBPREFIX construction variables to
+ new $WINDOWSDEFPREFIX, $WINDOWSDEFSUFFIX, $WINDOWSDLLPREFIX and
+ $WINDOWSIMPLIBPREFIX construction variables. The old names are now
+ deprecated, but preserved for backwards compatibility.
+
From Chen Lee:
- Handle Visual Studio project and solution files in Unicode.
- Add support for Visual Studio Express Editions.
- Add support for Visual Studio 8 *.manifest files, includng
- new $WIN32_INSERT_MANIFEST, $WIN32PROGMANIFESTSUFFIX,
- $WIN32PROGMANIFESTPREFIX, $WIN32PROGMANIFESTSUFFIX,
- $WIN32SHLIBMANIFESTPREFIX and $WIN32SHLIBMANIFESTSUFFIX construction
- variables.
+ new $WINDOWS_INSERT_MANIFEST, $WINDOWSPROGMANIFESTSUFFIX,
+ $WINDOWSPROGMANIFESTPREFIX, $WINDOWSPROGMANIFESTSUFFIX,
+ $WINDOWSSHLIBMANIFESTPREFIX and $WINDOWSSHLIBMANIFESTSUFFIX
+ construction variables.
From Sanjoy Mahajan:
# test redirection operators
def test_redirect(self, redir, stdout_msg, stderr_msg):
cmd = r'%s %s %s xyzzy %s' % (python, act_py, outfile, redir)
- # Write the output and error messages to files because Win32
- # can't handle strings that are too big in its external
- # environment (os.spawnve() returns EINVAL, "Invalid
- # argument").
+ # Write the output and error messages to files because
+ # Windows can't handle strings that are too big in its
+ # external environment (os.spawnve() returns EINVAL,
+ # "Invalid argument").
stdout_file = test.workpath('stdout_msg')
stderr_file = test.workpath('stderr_msg')
open(stdout_file, 'w').write(stdout_msg)
r = string.replace(entry.get_path(), os.sep, '/')
return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_posix")
- def __get_win32_path(self):
+ def __get_windows_path(self):
"""Return the path with \ as the path separator,
regardless of platform."""
if os.sep == '\\':
else:
entry = self.get()
r = string.replace(entry.get_path(), os.sep, '\\')
- return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_win32")
+ return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_windows")
def __get_srcnode(self):
return EntryProxy(self.get().srcnode())
dictSpecialAttrs = { "base" : __get_base_path,
"posix" : __get_posix_path,
- "win32" : __get_win32_path,
+ "windows" : __get_windows_path,
+ "win32" : __get_windows_path,
"srcpath" : __get_srcnode,
"srcdir" : __get_srcdir,
"dir" : __get_dir,
# This is how we implement the "special" attributes
# such as base, posix, srcdir, etc.
try:
- return self.dictSpecialAttrs[name](self)
+ attr_function = self.dictSpecialAttrs[name]
except KeyError:
try:
attr = SCons.Util.Proxy.__getattr__(self, name)
classname = classname[:-2]
raise AttributeError, "%s instance '%s' has no attribute '%s'" % (classname, entry.name, name)
return attr
+ else:
+ return attr_function(self)
class Base(SCons.Node.Node):
"""A generic class for file system entries. This class is for
__cacheable__"""
if not name:
- # This is a stupid hack to compensate for the fact that
- # the POSIX and Win32 versions of os.path.normpath() behave
+ # This is a stupid hack to compensate for the fact that the
+ # POSIX and Windows versions of os.path.normpath() behave
# differently in older versions of Python. In particular,
# in POSIX:
# os.path.normpath('./') == '.'
- # in Win32
+ # in Windows:
# os.path.normpath('./') == ''
# os.path.normpath('.\\') == ''
#
p = os.path.abspath(test.workpath('root_file'))
drive, path = os.path.splitdrive(p)
if drive:
- # The assert below probably isn't correct for the
- # general case, but it works for Win32, which covers a
- # lot of ground...
+ # The assert below probably isn't correct for the general
+ # case, but it works for Windows, which covers a lot
+ # of ground...
dir = fs.Dir(drive)
assert str(dir) == drive + os.sep, str(dir)
# Test for a bug in 0.04 that did not like looking up
- # dirs with a trailing slash on Win32.
+ # dirs with a trailing slash on Windows.
d=fs.Dir('./')
assert d.path == '.', d.abspath
d=fs.Dir('foo/')
f1.built()
assert not f1.exists()
- # For some reason, in Win32, the \x1a character terminates
+ # For some reason, in Windows, the \x1a character terminates
# the reading of files in text mode. This tests that
# get_contents() returns the binary contents.
test.write("binary_file", "Foo\x1aBar")
for_sig = f.posix.for_signature()
assert for_sig == 'baz.blat_posix', for_sig
+ s = str(f.windows)
+ assert s == 'foo\\bar\\baz.blat', repr(s)
+ assert f.windows.is_literal(), f.windows
+ if f.windows != f:
+ for_sig = f.windows.for_signature()
+ assert for_sig == 'baz.blat_windows', for_sig
+
+ # Deprecated synonym for the .windows suffix.
s = str(f.win32)
assert s == 'foo\\bar\\baz.blat', repr(s)
assert f.win32.is_literal(), f.win32
if f.win32 != f:
for_sig = f.win32.for_signature()
- assert for_sig == 'baz.blat_win32', for_sig
+ assert for_sig == 'baz.blat_windows', for_sig
# And now, combinations!!!
s = str(f.srcpath.base)
assert s == str(f.srcdir), s
s = str(f.srcpath.posix)
assert s == 'foo/bar/baz.blat', s
+ s = str(f.srcpath.windows)
+ assert s == 'foo\\bar\\baz.blat', s
s = str(f.srcpath.win32)
assert s == 'foo\\bar\\baz.blat', s
return self.cmd
# We do a normpath because mktemp() has what appears to be
- # a bug in Win32 that will use a forward slash as a path
- # delimiter. Win32's link mistakes that for a command line
+ # a bug in Windows that will use a forward slash as a path
+ # delimiter. Windows's link mistakes that for a command line
# switch and barfs.
#
# We use the .lnk suffix for the benefit of the Phar Lap
rm = env.Detect('rm') or 'del'
else:
# Don't use 'rm' if the shell is not sh, because rm won't
- # work with the win32 shells (cmd.exe or command.com) or
- # win32 path names.
+ # work with the Windows shells (cmd.exe or command.com) or
+ # Windows path names.
rm = 'del'
prefix = env.subst('$TEMPFILEPREFIX')
# we want to do some autodetection here
# this stuff works with
- # - cygwin on win32 (using cmd.exe, not bash)
+ # - cygwin on Windows (using cmd.exe, not bash)
# - posix
- # - msvc on win32 (hopefully)
+ # - msvc on Windows (hopefully)
if (not self.scons_env.Detect( self.scons_env.subst('$CXX') ) or
not self.scons_env.Detect( self.scons_env.subst('$CC') ) or
not self.scons_env.Detect( self.scons_env.subst('$LINK') )):
import traceback
# Strip the script directory from sys.path() so on case-insensitive
-# (WIN32) systems Python doesn't think that the "scons" script is the
+# (Windows) systems Python doesn't think that the "scons" script is the
# "SCons" package. Replace it with our own version directory so, if
# if they're there, we pick up the right version of the build engine
# modules.
except KeyboardInterrupt:
raise
except:
- # On win32 there is no scons.py, so there is no __main__.__version__,
- # hence there is no script version.
+ # On Windows there is no scons.py, so there is no
+ # __main__.__version__, hence there is no script version.
pass
parts.append("\tengine: v%s.%s, %s, by %s on %s\n" % (SCons.__version__,
SCons.__build__,
import string
# Force Python to load the builtin "md5" module. If we do this with a
-# normal import statement, then case-insensitive systems (Win32) get
+# normal import statement, then case-insensitive systems (Windows) get
# confused and thinks there's a case mismatch with *this* MD5.py module.
file, name, desc = imp.find_module('md5')
try:
# Perforce seems to use the PWD environment variable rather than
# calling getcwd() for itself, which is odd. If no PWD variable
# is present, p4 WILL call getcwd, but this seems to cause problems
- # with good ol' Win32's tilde-mangling for long file names.
+ # with good ol' Windows's tilde-mangling for long file names.
environ['PWD'] = env.Dir('#').get_abspath()
for var in _import_env:
<summary>
Builds a shared library
(<filename>.so</filename> on a POSIX system,
-<filename>.dll</filename> on WIN32)
+<filename>.dll</filename> on Windows)
given one or more object files
or C, C++, D or Fortran source files.
If any source files are given,
env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'])
</example>
-On WIN32 systems, the
+On Windows systems, the
&b-SharedLibrary;
builder method will always build an import
(<filename>.lib</filename>) library
&scons;
will raise an error if there is any mismatch.
-On WIN32 systems, specifying
+On Windows systems, specifying
<literal>register=1</literal>
will cause the <filename>.dll</filename> to be
registered after it is built using REGSVR32.
.asm assembly language file
.ASM assembly language file
.c C file
- .C WIN32: C file
+ .C Windows: C file
POSIX: C++ file
.cc C++ file
.cpp C++ file
.C++ C++ file
.d D file
.f Fortran file
- .F WIN32: Fortran file
+ .F Windows: Fortran file
POSIX: Fortran file + C pre-processor
.for Fortran file
.FOR Fortran file
.m Object C file
.mm Object C++ file
.s assembly language file
- .S WIN32: assembly language file
+ .S Windows: assembly language file
POSIX: assembly language file + C pre-processor
.spp assembly language file + C pre-processor
.SPP assembly language file + C pre-processor
The default suffix, of course, is
<filename>.c</filename>
(lower case).
-On case-insensitive systems (like Win32),
+On case-insensitive systems (like Windows),
SCons also treats
<filename>.C</filename>
(upper case) files
fortran.generate(env)
env['FORTRAN'] = 'f90'
- env['FORTRANCOM'] = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.win32} /object:${TARGET.win32}'
- env['FORTRANPPCOM'] = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.win32} /object:${TARGET.win32}'
- env['SHFORTRANCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.win32} /object:${TARGET.win32}'
- env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.win32} /object:${TARGET.win32}'
+ env['FORTRANCOM'] = '$FORTRAN $FORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
+ env['FORTRANPPCOM'] = '$FORTRAN $FORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
+ env['SHFORTRANCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
+ env['SHFORTRANPPCOM'] = '$SHFORTRAN $SHFORTRANFLAGS $CPPFLAGS $_CPPDEFFLAGS $_FORTRANMODFLAG $_FORTRANINCFLAGS /compile_only ${SOURCES.windows} /object:${TARGET.windows}'
env['OBJSUFFIX'] = '.obj'
env['FORTRANMODDIR'] = '${TARGET.dir}'
env['FORTRANMODDIRPREFIX'] = '/module:'
15 November 2003
There are a number of problems with this script at this point in time.
-The one that irritates me the most is the win32 linker setup. The D
+The one that irritates me the most is the Windows linker setup. The D
linker doesn't have a way to add lib paths on the commandline, as far
as I can see. You have to specify paths relative to the SConscript or
use absolute paths. To hack around it, add '#/blah'. This will link
import math, sys, os.path, glob, string, re
-is_win32 = sys.platform == 'win32'
+is_windows = sys.platform == 'win32'
is_linux = sys.platform == 'linux2'
-if is_win32:
+if is_windows:
import SCons.Tool.msvc
elif is_linux:
import SCons.Tool.gcc
Always returns an old-style float like 80 or 90 for compatibility with Windows.
Shades of Y2K!"""
f = float(vstr)
- if is_win32:
+ if is_windows:
return f
else:
if f < 60: return f * 10.0
return None
abi = abi.lower()
# valid_abis maps input name to canonical name
- if is_win32:
+ if is_windows:
valid_abis = {'ia32' : 'ia32',
'x86' : 'ia32',
'ia64' : 'ia64',
def get_version_from_list(v, vlist):
"""See if we can match v (string) in vlist (list of strings)
Linux has to match in a fuzzy way."""
- if is_win32:
+ if is_windows:
# Simple case, just find it in the list
if v in vlist: return v
else: return None
def get_intel_registry_value(valuename, version=None, abi=None):
"""
- Return a value from the Intel compiler registry tree. (Win32 only)
+ Return a value from the Intel compiler registry tree. (Windows only)
"""
# Open the key:
K = 'Software\\Intel\\Compilers\\C++\\' + version + '\\'+abi.upper()
with most recent compiler version first.
"""
versions=[]
- if is_win32:
+ if is_windows:
keyname = 'Software\\Intel\\Compilers\\C++'
try:
k = SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE,
The compiler will be in <top>/bin/icl.exe (icc on linux),
the include dir is <top>/include, etc.
"""
- if is_win32:
+ if is_windows:
if not SCons.Util.can_read_reg:
raise NoRegistryModuleError, "No Windows registry module was found"
top = get_intel_registry_value('ProductDir', version, abi)
If topdir is used, version and abi are ignored.
verbose: (int) if >0, prints compiler version used.
"""
- if not (is_linux or is_win32):
+ if not (is_linux or is_windows):
# can't handle this platform
return
- if is_win32:
+ if is_windows:
SCons.Tool.msvc.generate(env)
elif is_linux:
SCons.Tool.gcc.generate(env)
class ICLTopDirWarning(SCons.Warnings.Warning):
pass
if is_linux and not env.Detect('icc') or \
- is_win32 and not env.Detect('icl'):
+ is_windows and not env.Detect('icl'):
SCons.Warnings.enableWarningClass(ICLTopDirWarning)
SCons.Warnings.warn(ICLTopDirWarning,
'LD_LIBRARY_PATH' : 'lib'}
for p in paths:
env.PrependENVPath(p, os.path.join(topdir, paths[p]))
- if is_win32:
+ if is_windows:
# env key reg valname default subdir of top
paths=(('INCLUDE', 'IncludeDir', 'Include'),
('LIB' , 'LibDir', 'Lib'),
env.PrependENVPath(p[0], string.split(path, os.pathsep))
# print "ICL %s: %s, final=%s"%(p[0], path, str(env['ENV'][p[0]]))
- if is_win32:
+ if is_windows:
env['CC'] = 'icl'
env['CXX'] = 'icl'
env['LINK'] = 'xilink'
if version:
env['INTEL_C_COMPILER_VERSION']=linux_ver_normalize(version)
- if is_win32:
+ if is_windows:
# Look for license file dir
# in system environment, registry, and default location.
envlicdir = os.environ.get("INTEL_LICENSE_FILE", '')
env['ENV']['INTEL_LICENSE_FILE'] = licdir
def exists(env):
- if not (is_linux or is_win32):
+ if not (is_linux or is_windows):
# can't handle this platform
return 0
detected = versions is not None and len(versions) > 0
if not detected:
# try env.Detect, maybe that will work
- if is_win32:
+ if is_windows:
return env.Detect('icl')
elif is_linux:
return env.Detect('icc')
implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
- def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+ def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
return [cmd]
# or a def file source. There is no option to disable def file
# target emitting, because I can't figure out why someone would ever
# want to turn it off.
- def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
- def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+ def_source = env.FindIxes(source, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
+ def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX')
if not def_source and not def_target:
target.append(env.ReplaceIxes(dll,
'SHLIBPREFIX', 'SHLIBSUFFIX',
- 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX'))
+ 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX'))
return (target, source)
env.Append(SHLIBEMITTER = [shlib_emitter])
env['LINK'] = 'g++'
env['AS'] = 'as'
+
env['WIN32DEFPREFIX'] = ''
env['WIN32DEFSUFFIX'] = '.def'
+ env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'
+ env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'
+
env['SHOBJSUFFIX'] = '.o'
env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
'/DEBUG']
return None
-def win32ShlinkTargets(target, source, env, for_signature):
+def windowsShlinkTargets(target, source, env, for_signature):
listCmd = []
dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
return listCmd
-def win32ShlinkSources(target, source, env, for_signature):
+def windowsShlinkSources(target, source, env, for_signature):
listCmd = []
- deffile = env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX")
+ deffile = env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX")
for src in source:
if src == deffile:
# Treat this source as a .def file.
listCmd.append(src)
return listCmd
-def win32LibEmitter(target, source, env):
+def windowsLibEmitter(target, source, env):
SCons.Tool.msvc.validate_vars(env)
dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
if not dll:
raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
- if env.get("WIN32_INSERT_DEF", 0) and \
- not env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX"):
+ insert_def = env.subst("$WINDOWS_INSERT_DEF")
+ if not insert_def in ['', '0', 0] and \
+ not env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"):
# append a def file to the list of sources
source.append(env.ReplaceIxes(dll,
"SHLIBPREFIX", "SHLIBSUFFIX",
- "WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
+ "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"))
version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))
- if version_num >= 8.0 and env.get('WIN32_INSERT_MANIFEST', 0):
+ if version_num >= 8.0 and env.get('WINDOWS_INSERT_MANIFEST', 0):
# MSVC 8 automatically generates .manifest files that must be installed
target.append(env.ReplaceIxes(dll,
"SHLIBPREFIX", "SHLIBSUFFIX",
- "WIN32SHLIBMANIFESTPREFIX", "WIN32SHLIBMANIFESTSUFFIX"))
+ "WINDOWSSHLIBMANIFESTPREFIX", "WINDOWSSHLIBMANIFESTSUFFIX"))
if env.has_key('PDB') and env['PDB']:
target.append(env['PDB'])
# and .exp file is created if there are exports from a DLL
target.append(env.ReplaceIxes(dll,
"SHLIBPREFIX", "SHLIBSUFFIX",
- "WIN32EXPPREFIX", "WIN32EXPSUFFIX"))
+ "WINDOWSEXPPREFIX", "WINDOWSEXPSUFFIX"))
return (target, source)
raise SCons.Errors.UserError, "An executable should have exactly one target with the suffix: %s" % env.subst("$PROGSUFFIX")
version_num, suite = SCons.Tool.msvs.msvs_parse_version(env.get('MSVS_VERSION', '6.0'))
- if version_num >= 8.0 and env.get('WIN32_INSERT_MANIFEST', 0):
+ if version_num >= 8.0 and env.get('WINDOWS_INSERT_MANIFEST', 0):
# MSVC 8 automatically generates .manifest files that have to be installed
target.append(env.ReplaceIxes(exe,
"PROGPREFIX", "PROGSUFFIX",
- "WIN32PROGMANIFESTPREFIX", "WIN32PROGMANIFESTSUFFIX"))
+ "WINDOWSPROGMANIFESTPREFIX", "WINDOWSPROGMANIFESTSUFFIX"))
if env.has_key('PDB') and env['PDB']:
target.append(env['PDB'])
env['SHLINK'] = '$LINK'
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
- env['_SHLINK_TARGETS'] = win32ShlinkTargets
- env['_SHLINK_SOURCES'] = win32ShlinkSources
+ env['_SHLINK_TARGETS'] = windowsShlinkTargets
+ env['_SHLINK_SOURCES'] = windowsShlinkSources
env['SHLINKCOM'] = compositeLinkAction
- env.Append(SHLIBEMITTER = [win32LibEmitter])
+ env.Append(SHLIBEMITTER = [windowsLibEmitter])
env['LINK'] = 'link'
env['LINKFLAGS'] = SCons.Util.CLVar('/nologo')
env['_PDB'] = pdbGenerator
- env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.win32 $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES.win32")}'
+ env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET.windows $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES.windows")}'
env.Append(PROGEMITTER = [prog_emitter])
env['LIBDIRPREFIX']='/LIBPATH:'
env['LIBDIRSUFFIX']=''
env['WIN32DEFPREFIX'] = ''
env['WIN32DEFSUFFIX'] = '.def'
env['WIN32_INSERT_DEF'] = 0
+ env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}'
+ env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}'
+ env['WINDOWS_INSERT_DEF'] = '${WIN32_INSERT_DEF}'
env['WIN32EXPPREFIX'] = ''
env['WIN32EXPSUFFIX'] = '.exp'
+ env['WINDOWSEXPPREFIX'] = '${WIN32EXPPREFIX}'
+ env['WINDOWSEXPSUFFIX'] = '${WIN32EXPSUFFIX}'
- env['WIN32SHLIBMANIFESTPREFIX'] = ''
- env['WIN32SHLIBMANIFESTSUFFIX'] = env['SHLIBSUFFIX'] + '.manifest'
- env['WIN32PROGMANIFESTPREFIX'] = ''
- env['WIN32PROGMANIFESTSUFFIX'] = env['PROGSUFFIX'] + '.manifest'
+ env['WINDOWSSHLIBMANIFESTPREFIX'] = ''
+ env['WINDOWSSHLIBMANIFESTSUFFIX'] = env['SHLIBSUFFIX'] + '.manifest'
+ env['WINDOWSPROGMANIFESTPREFIX'] = ''
+ env['WINDOWSPROGMANIFESTSUFFIX'] = env['PROGSUFFIX'] + '.manifest'
env['REGSVRACTION'] = regServerCheck
env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
env['REGSVRFLAGS'] = '/s '
- env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.win32}'
+ env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS ${TARGET.windows}'
try:
version = SCons.Tool.msvs.get_default_visualstudio_version(env)
<cvar name="no_import_lib">
<summary>
When set to non-zero,
-suppresses creation of a corresponding Win32 static import lib by the
+suppresses creation of a corresponding Windows static import lib by the
<literal>SharedLibrary</literal>
builder when used with
MinGW, Microsoft Visual Studio or Metrowerks.
<cvar name="REGSVR">
<summary>
-The program used on WIN32 systems
+The program used on Windows systems
to register a newly-built DLL library
whenever the &b-SharedLibrary; builder
is passed a keyword argument of <literal>register=1</literal>.
<cvar name="REGSVRCOM">
<summary>
-The command line used on WIN32 systems
+The command line used on Windows systems
to register a newly-built DLL library
whenever the &b-SharedLibrary; builder
is passed a keyword argument of <literal>register=1</literal>.
<cvar name="REGSVRFLAGS">
<summary>
Flags passed to the DLL registration program
-on WIN32 systems when a newly-built DLL library is registered.
+on Windows systems when a newly-built DLL library is registered.
By default,
this includes the <option>/s</option>
that prevents dialog boxes from popping up
<cvar name="WIN32_INSERT_DEF">
<summary>
+A deprecated synonym for &cv-WINDOWS_INSERT_DEF;.
+</summary>
+</cvar>
+
+<cvar name="WIN32DEFPREFIX">
+<summary>
+A deprecated synonym for &cv-WINDOWSDEFPREFIX;.
+</summary>
+</cvar>
+
+<cvar name="WIN32DEFSUFFIX">
+<summary>
+A deprecated synonym for &cv-WINDOWSDEFSUFFIX;.
+</summary>
+</cvar>
+
+<cvar name="WIN32EXPPREFIX">
+<summary>
+A deprecated synonym for &cv-WINDOWSEXPSUFFIX;.
+</summary>
+</cvar>
+
+<cvar name="WIN32EXPSUFFIX">
+<summary>
+A deprecated synonym for &cv-WINDOWSEXPSUFFIX;.
+</summary>
+</cvar>
+
+<cvar name="WINDOWS_INSERT_DEF">
+<summary>
When this is set to true,
-a library build of a WIN32 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).
+a library build of a Windows shared library
+(<filename>.dll</filename>file)
+will also build a corresponding <filename>.def</filename> file
+at the same time,
+if a <filename>.def</filename> file
+is not already listed as a build target.
+The default is 0 (do not build a <filename>.def</filename> file).
</summary>
</cvar>
-<cvar name="WIN32_INSERT_MANIFEST">
+<cvar name="WINDOWS_INSERT_MANIFEST">
<summary>
When this is set to true,
&scons;
</summary>
</cvar>
-<cvar name="WIN32DEFPREFIX">
+<cvar name="WINDOWSDEFPREFIX">
<summary>
-The prefix used for WIN32 .def file names.
+The prefix used for Windows <filename>.def</filename>file names.
</summary>
</cvar>
-<cvar name="WIN32DEFSUFFIX">
+<cvar name="WINDOWSDEFSUFFIX">
<summary>
-The suffix used for WIN32 .def file names.
+The suffix used for Windows <filename>.def</filename> file names.
</summary>
</cvar>
-<cvar name="WIN32EXPPREFIX">
+<cvar name="WINDOWSEXPPREFIX">
<summary>
-XXX The prefix used for WIN32 .def file names.
+The prefix used for Windows <filename>.exp</filename> file names.
</summary>
</cvar>
-<cvar name="WIN32EXPSUFFIX">
+<cvar name="WINDOWSEXPSUFFIX">
<summary>
-XXX The suffix used for WIN32 .def file names.
+The suffix used for Windows <filename>.exp</filename> file names.
</summary>
</cvar>
-<cvar name="WIN32PROGMANIFESTPREFIX">
+<cvar name="WINDOWSPROGMANIFESTPREFIX">
<summary>
The prefix used for executable program <filename>.manifest</filename> files
-generated by Microsoft Visual C/C++ .NET 2005.
+generated by Microsoft Visual C/C++.
</summary>
</cvar>
-<cvar name="WIN32PROGMANIFESTSUFFIX">
+<cvar name="WINDOWSPROGMANIFESTSUFFIX">
<summary>
The suffix used for executable program <filename>.manifest</filename> files
-generated by Microsoft Visual C/C++ .NET 2005.
+generated by Microsoft Visual C/C++.
</summary>
</cvar>
-<cvar name="WIN32SHLIBMANIFESTPREFIX">
+<cvar name="WINDOWSSHLIBMANIFESTPREFIX">
<summary>
The prefix used for shared library <filename>.manifest</filename> files
-generated by Microsoft Visual C/C++ .NET 2005.
+generated by Microsoft Visual C/C++.
</summary>
</cvar>
-<cvar name="WIN32SHLIBMANIFESTSUFFIX">
+<cvar name="WINDOWSSHLIBMANIFESTSUFFIX">
<summary>
The suffix used for shared library <filename>.manifest</filename> files
-generated by Microsoft Visual C/C++ .NET 2005.
+generated by Microsoft Visual C/C++.
</summary>
</cvar>
if sys.platform == 'cygwin':
def get_native_path(path):
"""Transforms an absolute path into a native path for the system. In
- Cygwin, this converts from a Cygwin path to a Win32 one."""
+ Cygwin, this converts from a Cygwin path to a Windows one."""
return string.replace(os.popen('cygpath -w ' + path).read(), '\n', '')
else:
def get_native_path(path):
if sys.platform == 'cygwin':
# On Cygwin, os.path.normcase() lies, so just report back the
- # fact that the underlying Win32 OS is case-insensitive.
+ # fact that the underlying Windows OS is case-insensitive.
def case_sensitive_suffixes(s1, s2):
return 0
else:
f = _open(self._tmp_name, "wb", self._mode)
cPickle.dump(self._dict, f, 1)
f.close()
- # Win32 doesn't allow renaming if the file exists, so unlink it first,
- # chmod'ing it to make sure we can do so. On UNIX, we may not be able
- # to chmod the file if it's owned by someone else (e.g. from a previous
- # run as root). We should still be able to unlink() the file if the
- # directory's writable, though, so ignore any OSError exception thrown
- # by the chmod() call.
+ # Windows doesn't allow renaming if the file exists, so unlink
+ # it first, chmod'ing it to make sure we can do so. On UNIX, we
+ # may not be able to chmod the file if it's owned by someone else
+ # (e.g. from a previous run as root). We should still be able to
+ # unlink() the file if the directory's writable, though, so ignore
+ # any OSError exception thrown by the chmod() call.
try: os.chmod(self._file_name, 0777)
except OSError: pass
os.unlink(self._file_name)