aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-11-26 21:00:18 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-11-26 22:16:05 +0200
commit07d7e87411ca411682344c945c006fd61fa7ab98 (patch)
tree6036289fe41f8960ed31ffa8ddbc2b3483cb6b0d /mesonbuild/backend
parentd651727208f36acd470e68721020fa996bb3737f (diff)
downloadmeson-07d7e87411ca411682344c945c006fd61fa7ab98.zip
meson-07d7e87411ca411682344c945c006fd61fa7ab98.tar.gz
meson-07d7e87411ca411682344c945c006fd61fa7ab98.tar.bz2
Allow soname to be an arbitrary string and fix symlink generation.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r--mesonbuild/backend/ninjabackend.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 659a53d..bd65cbe 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2004,14 +2004,21 @@ rule FORTRAN_DEP_HACK
def generate_shlib_aliases(self, target, outdir):
basename = target.get_filename()
aliases = target.get_aliaslist()
- for alias in aliases:
+ for i, alias in enumerate(aliases):
aliasfile = os.path.join(self.environment.get_build_dir(), outdir, alias)
try:
os.remove(aliasfile)
except Exception:
pass
+ # If both soversion and version are set and to different values,
+ # the .so symlink must point to the soversion symlink rather than the
+ # original file.
+ if i == 0 and len(aliases) > 1:
+ pointed_to_filename = aliases[1]
+ else:
+ pointed_to_filename = basename
try:
- os.symlink(basename, aliasfile)
+ os.symlink(pointed_to_filename, aliasfile)
except NotImplementedError:
mlog.debug("Library versioning disabled because symlinks are not supported.")
except OSError: