summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/CHANGES.txt5
-rw-r--r--src/engine/SCons/Builder.py5
-rw-r--r--src/engine/SCons/BuilderTests.py3
3 files changed, 11 insertions, 2 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index aa18bf6..0986d16 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -10,6 +10,11 @@
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
diff --git a/src/engine/SCons/Builder.py b/src/engine/SCons/Builder.py
index 414c5de..6caf5d9 100644
--- a/src/engine/SCons/Builder.py
+++ b/src/engine/SCons/Builder.py
@@ -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:
diff --git a/src/engine/SCons/BuilderTests.py b/src/engine/SCons/BuilderTests.py
index f7b329d..b856b08 100644
--- a/src/engine/SCons/BuilderTests.py
+++ b/src/engine/SCons/BuilderTests.py
@@ -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