diff options
author | Steven Knight <knight@baldmt.com> | 2003-06-07 22:04:31 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-06-07 22:04:31 (GMT) |
commit | 418471d33635bb87b062ee77c565bc80c20b151c (patch) | |
tree | cd9f20892e13e3f4a237171dfcda708dd054fd20 /src | |
parent | 22ed0f721c935d4e5c3c7651d633c047bc98e19a (diff) | |
download | SCons-418471d33635bb87b062ee77c565bc80c20b151c.zip SCons-418471d33635bb87b062ee77c565bc80c20b151c.tar.gz SCons-418471d33635bb87b062ee77c565bc80c20b151c.tar.bz2 |
Handle library prefixes correctly if the subdirectory is named lib*. (Matt Balvin)
Diffstat (limited to 'src')
-rw-r--r-- | src/CHANGES.txt | 5 | ||||
-rw-r--r-- | src/engine/SCons/Builder.py | 5 | ||||
-rw-r--r-- | src/engine/SCons/BuilderTests.py | 3 |
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 |