Commits

Tom Tanner committed 421e35b Merge

Merged scons/scons into default

Comments (0)

Files changed (13)

 
 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.

src/engine/SCons/EnvironmentTests.py

                           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
                          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']
         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

src/engine/SCons/Node/FS.py

                 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:

src/engine/SCons/Subst.py

     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
     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
         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
                             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

src/engine/SCons/SubstTests.py

         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."""

src/engine/SCons/Tool/MSCommon/vc.py

     
     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
 

src/engine/SCons/Tool/__init__.py

             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
     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' ]
                 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

test/Libs/SharedLibrary-update-deps.py

+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that SharedLibrary() updates when a different lib is linked, even if it has the same md5.
+This is Tigris bug #2909.
+"""
+
+import os.path
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.dir_fixture( "bug2909" )
+
+# Build the sub-libs (don't care about details of this)
+test.run(arguments='-f SConstruct-libs')
+# This should build the main lib, using libfoo.so
+test.run(arguments='libname=foo')
+# This should rebuild the main lib, using libbar.so;
+# it should NOT say it's already up to date.
+test.run(arguments='libname=bar')
+test.must_not_contain_any_line(test.stdout(), ["is up to date"])
+# Try it again, in reverse, to make sure:
+test.run(arguments='libname=foo')
+test.must_not_contain_any_line(test.stdout(), ["is up to date"])
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:

test/Libs/SharedLibrary.py

 Default(env.Library(target = 'foo', source = obj))
 """)
 
+test.write('SConstructBaz', """
+env=Environment()
+env['SHLIBVERSION'] = '1.0.0'
+obj = env.SharedObject('baz', 'foo.c')
+Default(env.SharedLibrary(target = 'baz', source = obj))
+""")
+
 test.write('foo.c', r"""
 #include <stdio.h>
 
     test.run(program = test.workpath('progbar'),
              stdout = "f4.c\nprogbar.c\n")
 
+if sys.platform.startswith('openbsd'):
+    # Make sure we don't link libraries with -Wl,-soname on OpenBSD.
+    test.run(arguments = '-f SConstructBaz')
+    for line in test.stdout().split('\n'):
+        test.fail_test(line.find('-Wl,-soname=libbaz.so') != -1)
+
 test.pass_test()
 
 # Local Variables:

test/Libs/bug2909/SConstruct

+env=Environment()
+libname=ARGUMENTS.get('libname', 'foo')
+env.SharedLibrary('myshared', ['main.c'], LIBS=[libname], LIBPATH='.')

test/Libs/bug2909/SConstruct-libs

+env=Environment()
+libfoo = env.SharedLibrary('foo', 'lib.c')
+env.InstallAs('${SHLIBPREFIX}bar${SHLIBSUFFIX}', libfoo)

test/Libs/bug2909/lib.c

+int i;

test/Libs/bug2909/main.c

+void func()
+{
+}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.