summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMats Wichmann <mats@linux.com>2021-03-14 14:22:36 -0600
committerGitHub <noreply@github.com>2021-03-14 14:22:36 -0600
commit590e2d896a4c795a07a47ec915c7e14f482b2366 (patch)
tree17ba9b2831bd44bcea5b6db4a123584fb5bde203
parentdd0de0935302adbb2cb315a6246870c2434100e9 (diff)
parentf7a59bc22bcb53f68eacc4d109ce86ae1e4513cc (diff)
downloadscons-git-590e2d896a4c795a07a47ec915c7e14f482b2366.tar.gz
Merge pull request #4 from bdbaddog/shlib-tweaks
Handle library (or any files) named just they're *PREFIX for their type. Don't truncate them to blank string
-rw-r--r--SCons/Tool/linkCommon/SharedLibrary.py10
-rw-r--r--SCons/Util.py2
2 files changed, 7 insertions, 5 deletions
diff --git a/SCons/Tool/linkCommon/SharedLibrary.py b/SCons/Tool/linkCommon/SharedLibrary.py
index a79d78cfe..2a079bfdd 100644
--- a/SCons/Tool/linkCommon/SharedLibrary.py
+++ b/SCons/Tool/linkCommon/SharedLibrary.py
@@ -28,7 +28,7 @@ from . import lib_emitter, EmitLibSymlinks, StringizeLibSymlinks
def shlib_symlink_emitter(target, source, env, **kw):
- verbose = True
+ verbose = False
if "variable_prefix" in kw:
var_prefix = kw["variable_prefix"]
@@ -138,13 +138,15 @@ def _get_shlib_stem(target, source, env, for_signature: bool) -> str:
% (target_name, shlibprefix, shlibsuffix)
)
+
+ if shlibsuffix and target_name.endswith(shlibsuffix):
+ target_name = target_name[: -len(shlibsuffix)]
+
if shlibprefix and target_name.startswith(shlibprefix):
- # skip pathlogical case were target _is_ the prefix
+ # skip pathological case were target _is_ the prefix
if target_name != shlibprefix:
target_name = target_name[len(shlibprefix) :]
- if shlibsuffix and target_name.endswith(shlibsuffix):
- target_name = target_name[: -len(shlibsuffix)]
if verbose and not for_signature:
print("_get_shlib_stem: target_name:%s AFTER" % (target_name,))
diff --git a/SCons/Util.py b/SCons/Util.py
index 4dd70f780..a98f48bb4 100644
--- a/SCons/Util.py
+++ b/SCons/Util.py
@@ -1115,7 +1115,7 @@ else:
def adjustixes(fname, pre, suf, ensure_suffix=False):
if pre:
path, fn = os.path.split(os.path.normpath(fname))
- if fn[:len(pre)] != pre:
+ if fn[:len(pre)] != pre or fn == pre:
fname = os.path.join(path, pre + fn)
# Only append a suffix if the suffix we're going to add isn't already
# there, and if either we've been asked to ensure the specific suffix