diff options
author | Tom Tanner <ttanner2@bloomberg.net> | 2013-09-30 15:42:17 (GMT) |
---|---|---|
committer | Tom Tanner <ttanner2@bloomberg.net> | 2013-09-30 15:42:17 (GMT) |
commit | 81524478eeffbb8ea011f2362ddbdce1a47dd96a (patch) | |
tree | 637320b155746cbd59ba9d162056b4e5523727fb /src | |
parent | e014d3bfc6e5d07666361e9d3071d12617e1e2d5 (diff) | |
parent | 43f296c7c2a350de0c59a442e566c165420803e3 (diff) | |
download | SCons-81524478eeffbb8ea011f2362ddbdce1a47dd96a.zip SCons-81524478eeffbb8ea011f2362ddbdce1a47dd96a.tar.gz SCons-81524478eeffbb8ea011f2362ddbdce1a47dd96a.tar.bz2 |
Merged scons/scons into default
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 17 | ||||
-rw-r--r-- | src/engine/SCons/EnvironmentTests.py | 8 | ||||
-rw-r--r-- | src/engine/SCons/Node/FS.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Subst.py | 14 | ||||
-rw-r--r-- | src/engine/SCons/SubstTests.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/Tool/MSCommon/vc.py | 17 | ||||
-rw-r--r-- | src/engine/SCons/Tool/__init__.py | 26 |
7 files changed, 68 insertions, 21 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index e80a161..50a27dc 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -6,6 +6,23 @@ RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE + From Bogdan Tenea: + - Check for 8.3 filenames on cygwin as well as win32 to make variant_dir work properly. + + From Alexandre Feblot: + - Make sure SharedLibrary depends on all dependent libs (by depending on SHLINKCOM) + + From Stefan Sperling: + - Fixed the setup of linker flags for a versioned SharedLibrary + under OpenBSD (#2916). + + From Antonio Cavallo: + - Improve error if Visual Studio bat file not found. + + From Manuel Francisco Naranjo: + - Allow Subst.Literal string objects to be compared with each other, + so they work better in AddUnique() and Remove(). + From David Rothenberger: - Added cyglink linker that uses Cygwin naming conventions for shared libraries and automatically generates import libraries. diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 750266a..a4fbefb 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -1682,6 +1682,8 @@ def exists(env): CCC1 = '', CCC2 = '', DDD1 = ['a', 'b', 'c']) + env['LL1'] = [env.Literal('a literal'), env.Literal('b literal')] + env['LL2'] = [env.Literal('c literal'), env.Literal('b literal')] env.AppendUnique(AAA1 = 'a1', AAA2 = ['a2'], AAA3 = ['a3', 'b', 'c', 'c', 'b', 'a3'], # ignore dups @@ -1694,7 +1696,9 @@ def exists(env): BBB5 = ['b5.new'], CCC1 = 'c1', CCC2 = ['c2'], - DDD1 = 'b') + DDD1 = 'b', + LL1 = env.Literal('a literal'), + LL2 = env.Literal('a literal')) assert env['AAA1'] == 'a1a1', env['AAA1'] assert env['AAA2'] == ['a2'], env['AAA2'] @@ -1709,6 +1713,8 @@ def exists(env): assert env['CCC1'] == 'c1', env['CCC1'] assert env['CCC2'] == ['c2'], env['CCC2'] assert env['DDD1'] == ['a', 'b', 'c'], env['DDD1'] + assert env['LL1'] == [env.Literal('a literal'), env.Literal('b literal')], env['LL1'] + assert env['LL2'] == [env.Literal('c literal'), env.Literal('b literal'), env.Literal('a literal')], [str(x) for x in env['LL2']] env.AppendUnique(DDD1 = 'b', delete_existing=1) assert env['DDD1'] == ['a', 'c', 'b'], env['DDD1'] # b moves to end diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index f31ca83..4381697 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1841,7 +1841,7 @@ class Dir(Base): for entry in map(_my_normcase, entries): d[entry] = True self.on_disk_entries = d - if sys.platform == 'win32': + if sys.platform == 'win32' or sys.platform == 'cygwin': name = _my_normcase(name) result = d.get(name) if result is None: diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 98097dc..318d7d9 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -78,6 +78,14 @@ class Literal(object): def is_literal(self): return 1 + def __eq__(self, other): + if not isinstance(other, Literal): + return False + return self.lstr == other.lstr + + def __neq__(self, other): + return not self.__eq__(other) + class SpecialAttrWrapper(object): """This is a wrapper for what we call a 'Node special attribute.' This is any of the attributes of a Node that we can reference from @@ -172,7 +180,7 @@ class NLWrapper(object): In practice, this might be a wash performance-wise, but it's a little cleaner conceptually... """ - + def __init__(self, list, func): self.list = list self.func = func @@ -190,7 +198,7 @@ class NLWrapper(object): self._create_nodelist = self._return_nodelist return self.nodelist _create_nodelist = _gen_nodelist - + class Targets_or_Sources(collections.UserList): """A class that implements $TARGETS or $SOURCES expansions by in turn @@ -451,7 +459,7 @@ def scons_subst(strSubst, env, mode=SUBST_RAW, target=None, source=None, gvars={ raise_exception(NameError(key), lvars['TARGETS'], s) else: return '' - + # Before re-expanding the result, handle # recursive expansion by copying the local # variable dictionary and overwriting a null diff --git a/src/engine/SCons/SubstTests.py b/src/engine/SCons/SubstTests.py index 420fd73..ee9f3db 100644 --- a/src/engine/SCons/SubstTests.py +++ b/src/engine/SCons/SubstTests.py @@ -1147,6 +1147,11 @@ class LiteralTestCase(unittest.TestCase): cmd_list = escape_list(cmd_list[0], escape_func) assert cmd_list == ['BAZ', '**$BAR**'], cmd_list + def test_LiteralEqualsTest(self): + """Test that Literals compare for equality properly""" + assert Literal('a literal') == Literal('a literal') + assert Literal('a literal') != Literal('b literal') + class SpecialAttrWrapperTestCase(unittest.TestCase): def test_SpecialAttrWrapper(self): """Test the SpecialAttrWrapper() function.""" diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 1266ee8..c970118 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -258,15 +258,16 @@ def find_batch_file(env,msvc_version,host_arch,target_arch): installed_sdks=get_installed_sdks() for _sdk in installed_sdks: - sdk_bat_file=_sdk.get_sdk_vc_script(host_arch,target_arch) - sdk_bat_file_path=os.path.join(pdir,sdk_bat_file) - debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path) - if os.path.exists(sdk_bat_file_path): - return (batfilename,sdk_bat_file_path) + sdk_bat_file = _sdk.get_sdk_vc_script(host_arch,target_arch) + if not sdk_bat_file: + debug("vc.py:find_batch_file() not found:%s"%_sdk) else: - debug("vc.py:find_batch_file() not found:%s"%sdk_bat_file_path) - else: - return (batfilename,None) + sdk_bat_file_path = os.path.join(pdir,sdk_bat_file) + if os.path.exists(sdk_bat_file_path): + debug('vc.py:find_batch_file() sdk_bat_file_path:%s'%sdk_bat_file_path) + return (batfilename,sdk_bat_file_path) + return (batfilename,None) + __INSTALLED_VCS_RUN = None diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py index b80d6e4..7477f75 100644 --- a/src/engine/SCons/Tool/__init__.py +++ b/src/engine/SCons/Tool/__init__.py @@ -257,6 +257,10 @@ def VersionShLibLinkNames(version, libname, env): print "VersionShLibLinkNames: linkname = ",linkname linknames.append(linkname) elif platform == 'posix': + if sys.platform.startswith('openbsd'): + # OpenBSD uses x.y shared library versioning numbering convention + # and doesn't use symlinks to backwards-compatible libraries + return [] # For libfoo.so.x.y.z, linknames libfoo.so libfoo.so.x.y libfoo.so.x suffix_re = re.escape(shlib_suffix + '.' + version) # First linkname has no version number @@ -302,13 +306,17 @@ symlinks for the platform we are on""" if version: # set the shared library link flags if platform == 'posix': - suffix_re = re.escape(shlib_suffix + '.' + version) - (major, age, revision) = version.split(".") - # soname will have only the major version number in it - soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major - shlink_flags += [ '-Wl,-Bsymbolic', '-Wl,-soname=%s' % soname ] - if Verbose: - print " soname ",soname,", shlink_flags ",shlink_flags + shlink_flags += [ '-Wl,-Bsymbolic' ] + # OpenBSD doesn't usually use SONAME for libraries + if not sys.platform.startswith('openbsd'): + # continue setup of shlink flags for all other POSIX systems + suffix_re = re.escape(shlib_suffix + '.' + version) + (major, age, revision) = version.split(".") + # soname will have only the major version number in it + soname = re.sub(suffix_re, shlib_suffix, libname) + '.' + major + shlink_flags += [ '-Wl,-soname=%s' % soname ] + if Verbose: + print " soname ",soname,", shlink_flags ",shlink_flags elif platform == 'cygwin': shlink_flags += [ '-Wl,-Bsymbolic', '-Wl,--out-implib,${TARGET.base}.a' ] @@ -356,7 +364,9 @@ symlinks for the platform we are on""" print "VerShLib: made sym link of %s -> %s" % (linkname, lib_ver) return result -ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None) +# Fix http://scons.tigris.org/issues/show_bug.cgi?id=2903 : +# varlist=['$SHLINKCOM']: ensure we still depend on SCons.Defaults.ShLinkAction command line which is $SHLINKCOM +ShLibAction = SCons.Action.Action(VersionedSharedLibrary, None, varlist=['SHLINKCOM']) def createSharedLibBuilder(env): """This is a utility function that creates the SharedLibrary |