diff options
author | Steven Knight <knight@baldmt.com> | 2006-01-21 12:04:15 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2006-01-21 12:04:15 (GMT) |
commit | fcbe6204ad17af3c5b5fd138de734a45399cb839 (patch) | |
tree | 0b735d528b9b3eb82b4d6170e6ea89cf5f1e15cd /src/engine | |
parent | 8029f3079db3fcd71d4fc10e3d6cc28987349b56 (diff) | |
download | SCons-fcbe6204ad17af3c5b5fd138de734a45399cb839.zip SCons-fcbe6204ad17af3c5b5fd138de734a45399cb839.tar.gz SCons-fcbe6204ad17af3c5b5fd138de734a45399cb839.tar.bz2 |
Deprecate $WIN32 variables name in place of $WINDOWS* variables names, and eliminate other Win32 references.
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/ActionTests.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 17 | ||||
-rw-r--r-- | src/engine/SCons/Node/FSTests.py | 22 | ||||
-rw-r--r-- | src/engine/SCons/Platform/__init__.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/SConfTests.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/Script/Main.py | 6 | ||||
-rw-r--r-- | src/engine/SCons/Sig/MD5.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/Perforce.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/__init__.xml | 14 | ||||
-rw-r--r-- | src/engine/SCons/Tool/cvf.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Tool/dmd.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Tool/intelc.py | 32 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mingw.py | 12 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mslink.py | 48 | ||||
-rw-r--r-- | src/engine/SCons/Tool/mslink.xml | 83 | ||||
-rw-r--r-- | src/engine/SCons/Util.py | 4 | ||||
-rw-r--r-- | src/engine/SCons/dblite.py | 12 |
17 files changed, 170 insertions, 114 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index 3cc563b..63e86de 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -1053,10 +1053,10 @@ class CommandActionTestCase(unittest.TestCase): # 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) diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index 69936d2..d9282ea 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -405,7 +405,7 @@ class EntryProxy(SCons.Util.Proxy): 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 == '\\': @@ -413,7 +413,7 @@ class EntryProxy(SCons.Util.Proxy): 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()) @@ -436,7 +436,8 @@ class EntryProxy(SCons.Util.Proxy): 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, @@ -452,7 +453,7 @@ class EntryProxy(SCons.Util.Proxy): # 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) @@ -467,6 +468,8 @@ class EntryProxy(SCons.Util.Proxy): 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 @@ -907,12 +910,12 @@ class FS(LocalFS): __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('.\\') == '' # diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 8c95f87..96fa490 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -960,14 +960,14 @@ class FSTestCase(_tempdirTestCase): 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/') @@ -1132,7 +1132,7 @@ class FSTestCase(_tempdirTestCase): 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") @@ -2800,12 +2800,20 @@ class SpecialAttrTestCase(unittest.TestCase): 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) @@ -2814,6 +2822,8 @@ class SpecialAttrTestCase(unittest.TestCase): 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 diff --git a/src/engine/SCons/Platform/__init__.py b/src/engine/SCons/Platform/__init__.py index 7a2f1c3..b1a0a67 100644 --- a/src/engine/SCons/Platform/__init__.py +++ b/src/engine/SCons/Platform/__init__.py @@ -151,8 +151,8 @@ class TempFileMunge: 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 @@ -170,8 +170,8 @@ class TempFileMunge: 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') diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index 2685c2b..961dc21 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -78,9 +78,9 @@ class SConfTestCase(unittest.TestCase): # 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') )): diff --git a/src/engine/SCons/Script/Main.py b/src/engine/SCons/Script/Main.py index 16e790e..8b3058a 100644 --- a/src/engine/SCons/Script/Main.py +++ b/src/engine/SCons/Script/Main.py @@ -45,7 +45,7 @@ import time 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. @@ -590,8 +590,8 @@ class OptParser(OptionParser): 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__, diff --git a/src/engine/SCons/Sig/MD5.py b/src/engine/SCons/Sig/MD5.py index 501fec4..f8f349f 100644 --- a/src/engine/SCons/Sig/MD5.py +++ b/src/engine/SCons/Sig/MD5.py @@ -34,7 +34,7 @@ import imp 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: diff --git a/src/engine/SCons/Tool/Perforce.py b/src/engine/SCons/Tool/Perforce.py index 37115e9..de87dc2 100644 --- a/src/engine/SCons/Tool/Perforce.py +++ b/src/engine/SCons/Tool/Perforce.py @@ -74,7 +74,7 @@ def generate(env): # 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: diff --git a/src/engine/SCons/Tool/__init__.xml b/src/engine/SCons/Tool/__init__.xml index 0cce79b..cc7e145 100644 --- a/src/engine/SCons/Tool/__init__.xml +++ b/src/engine/SCons/Tool/__init__.xml @@ -100,7 +100,7 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) <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, @@ -123,7 +123,7 @@ Example: 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 @@ -141,7 +141,7 @@ builder method). &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. @@ -253,7 +253,7 @@ Source files must have one of the following extensions: .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 @@ -263,7 +263,7 @@ Source files must have one of the following extensions: .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 @@ -272,7 +272,7 @@ Source files must have one of the following extensions: .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 @@ -318,7 +318,7 @@ when generating C files from Lex (.l) or YACC (.y) input files. 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 diff --git a/src/engine/SCons/Tool/cvf.py b/src/engine/SCons/Tool/cvf.py index 2f70078..28a1915 100644 --- a/src/engine/SCons/Tool/cvf.py +++ b/src/engine/SCons/Tool/cvf.py @@ -40,10 +40,10 @@ def generate(env): 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:' diff --git a/src/engine/SCons/Tool/dmd.py b/src/engine/SCons/Tool/dmd.py index d850ab1..cae264b 100644 --- a/src/engine/SCons/Tool/dmd.py +++ b/src/engine/SCons/Tool/dmd.py @@ -7,7 +7,7 @@ Coded by Andy Friesen (andy@ikagames.com) 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 diff --git a/src/engine/SCons/Tool/intelc.py b/src/engine/SCons/Tool/intelc.py index 9499205..b247a38 100644 --- a/src/engine/SCons/Tool/intelc.py +++ b/src/engine/SCons/Tool/intelc.py @@ -36,10 +36,10 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" 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 @@ -72,7 +72,7 @@ def linux_ver_normalize(vstr): 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 @@ -85,7 +85,7 @@ def check_abi(abi): 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', @@ -113,7 +113,7 @@ def vercmp(a, b): 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 @@ -129,7 +129,7 @@ def get_version_from_list(v, vlist): 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() @@ -153,7 +153,7 @@ def get_all_compiler_versions(): 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, @@ -206,7 +206,7 @@ def get_intel_compiler_top(version, abi): 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) @@ -240,11 +240,11 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): 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) @@ -291,7 +291,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): 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, @@ -321,7 +321,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): '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'), @@ -340,7 +340,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): 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' @@ -358,7 +358,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): 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", '') @@ -389,7 +389,7 @@ def generate(env, version=None, abi=None, topdir=None, verbose=0): 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 @@ -400,7 +400,7 @@ def exists(env): 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') diff --git a/src/engine/SCons/Tool/mingw.py b/src/engine/SCons/Tool/mingw.py index 300198e..5765e25 100644 --- a/src/engine/SCons/Tool/mingw.py +++ b/src/engine/SCons/Tool/mingw.py @@ -60,7 +60,7 @@ def shlib_generator(target, source, env, for_signature): 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] @@ -84,12 +84,12 @@ def shlib_emitter(target, source, env): # 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) @@ -132,8 +132,12 @@ def generate(env): 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 diff --git a/src/engine/SCons/Tool/mslink.py b/src/engine/SCons/Tool/mslink.py index fe4e394..4458183 100644 --- a/src/engine/SCons/Tool/mslink.py +++ b/src/engine/SCons/Tool/mslink.py @@ -50,7 +50,7 @@ def pdbGenerator(env, target, source, for_signature): '/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)) @@ -60,10 +60,10 @@ def win32ShlinkTargets(target, source, env, 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. @@ -73,7 +73,7 @@ def win32ShlinkSources(target, source, env, for_signature): 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") @@ -82,20 +82,21 @@ def win32LibEmitter(target, source, env): 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']) @@ -109,7 +110,7 @@ def win32LibEmitter(target, source, env): # 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) @@ -121,11 +122,11 @@ def prog_emitter(target, source, env): 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']) @@ -154,14 +155,14 @@ def generate(env): 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']='' @@ -171,19 +172,24 @@ def generate(env): 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) diff --git a/src/engine/SCons/Tool/mslink.xml b/src/engine/SCons/Tool/mslink.xml index 6fac54e..58cfb1d 100644 --- a/src/engine/SCons/Tool/mslink.xml +++ b/src/engine/SCons/Tool/mslink.xml @@ -13,7 +13,7 @@ XXX <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. @@ -42,7 +42,7 @@ env['PDB'] = 'hello.pdb' <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>. @@ -51,7 +51,7 @@ 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>. @@ -68,7 +68,7 @@ If this is not set, then &cv-REGSVRCOM; (the command line) is displayed. <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 @@ -78,15 +78,48 @@ and requiring user attention. <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; @@ -96,54 +129,54 @@ files generated by Microsoft Visua C/C++ 8. </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> diff --git a/src/engine/SCons/Util.py b/src/engine/SCons/Util.py index b7fcec4..37f3c06 100644 --- a/src/engine/SCons/Util.py +++ b/src/engine/SCons/Util.py @@ -740,7 +740,7 @@ def AppendPath(oldpath, newpath, sep = os.pathsep): 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): @@ -865,7 +865,7 @@ class Selector(OrderedDict): 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: diff --git a/src/engine/SCons/dblite.py b/src/engine/SCons/dblite.py index 7a8846e..36840c3 100644 --- a/src/engine/SCons/dblite.py +++ b/src/engine/SCons/dblite.py @@ -78,12 +78,12 @@ class dblite: 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) |