Handle library prefixes correctly if the subdirectory is named lib*. (Matt Balvin)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 7 Jun 2003 22:04:31 +0000 (22:04 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 7 Jun 2003 22:04:31 +0000 (22:04 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@701 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Builder.py
src/engine/SCons/BuilderTests.py

index aa18bf64d71dc5ba6844581d91c97e144c1c9a35..0986d1636a7621ffd9c64efa49bf911c7fda64b2 100644 (file)
 
 RELEASE 0.15 - XXX
 
+  From Matt Balvin:
+
+  - Fix handling of library prefixes when the subdirectory matches
+    the prefix.
+
   From Steven Knight:
 
   - SCons now enforces (with an error) that construction variables
index 414c5de683c36a931258974b31733aff040ad65f..6caf5d9aa47b3ee094ab807ffcaaa0eff07ecb02 100644 (file)
@@ -290,9 +290,10 @@ class BuilderBase:
 
             for f in files:
                 if SCons.Util.is_String(f):
-                    if pre and f[:len(pre)] != pre:
+                    if pre:
                         path, fn = os.path.split(os.path.normpath(f))
-                        f = os.path.join(path, pre + fn)
+                        if fn[:len(pre)] != pre:
+                            f = os.path.join(path, pre + fn)
                     # Only append a suffix if the file does not have one.
                     if suf and not SCons.Util.splitext(f)[1]:
                         if f[-len(suf):] != suf:
index f7b329def68434a8510bbc1808fafcd374d2a10d..b856b08cbd4aa96c09dbfda24dc8f88811ed02b7 100644 (file)
@@ -303,6 +303,9 @@ class BuilderTestCase(unittest.TestCase):
         tgt = builder(env, source = 'src3')
         assert tgt.path == 'libsrc3', \
                 "Target has unexpected name: %s" % tgt.path
+        tgt = builder(env, target = 'lib/tgt4', source = 'lib/src4')
+        assert tgt.path == os.path.join('lib', 'libtgt4'), \
+                "Target has unexpected name: %s" % tgt.path
 
     def test_src_suffix(self):
         """Test Builder creation with a specified source file suffix