diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-22 02:11:36 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2016-12-22 02:27:01 +0530 |
commit | 0ac965cc10094e81db87c2b921c1001e97ee6410 (patch) | |
tree | 75ea0705fff61044067e93f7c085498af7678ea7 /mesonbuild/build.py | |
parent | 18f581f2c47d3ba81ce753334830ac8ecd5e5a5c (diff) | |
download | meson-0ac965cc10094e81db87c2b921c1001e97ee6410.zip meson-0ac965cc10094e81db87c2b921c1001e97ee6410.tar.gz meson-0ac965cc10094e81db87c2b921c1001e97ee6410.tar.bz2 |
Fix shared library symlink aliasing on install
Set the rules for the symlinking on the target itself, and then reuse
that information while generating aliases during the build, and then
pass it to the install script too.
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r-- | mesonbuild/build.py | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index afd8b0a..3750f77 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -798,8 +798,8 @@ class BuildTarget(): else: self.extra_args[language] = args - def get_aliaslist(self): - return [] + def get_aliases(self): + return {} def get_clike_dynamic_linker(self): ''' @@ -1029,7 +1029,7 @@ class SharedLibrary(BuildTarget): First we determine the filename template (self.filename_tpl), then we set the output filename (self.filename). - The template is needed while creating aliases (self.get_aliaslist), + The template is needed while creating aliases (self.get_aliases), which are needed while generating .so shared libraries for Linux. Besides this, there's also the import library name, which is only used @@ -1175,25 +1175,30 @@ class SharedLibrary(BuildTarget): def get_all_link_deps(self): return [self] + self.get_transitive_link_deps() - def get_aliaslist(self): + def get_aliases(self): """ If the versioned library name is libfoo.so.0.100.0, aliases are: - * libfoo.so.0 (soversion) - * libfoo.so (unversioned; for linking) + * libfoo.so.0 (soversion) -> libfoo.so.0.100.0 + * libfoo.so (unversioned; for linking) -> libfoo.so.0 """ + aliases = {} # Aliases are only useful with .so libraries. Also if the .so library # ends with .so (no versioning), we don't need aliases. if self.suffix != 'so' or self.filename.endswith('.so'): - return [] - # Unversioned alias: libfoo.so - aliases = [self.basic_filename_tpl.format(self)] - # If ltversion != soversion we create an soversion alias: libfoo.so.X + return {} + # If ltversion != soversion we create an soversion alias: + # libfoo.so.0 -> libfoo.so.0.100.0 if self.ltversion and self.ltversion != self.soversion: if not self.soversion: # This is done in self.process_kwargs() raise AssertionError('BUG: If library version is defined, soversion must have been defined') alias_tpl = self.filename_tpl.replace('ltversion', 'soversion') - aliases.append(alias_tpl.format(self)) + ltversion_filename = alias_tpl.format(self) + aliases[ltversion_filename] = self.filename + else: + ltversion_filename = self.filename + # Unversioned alias: libfoo.so -> libfoo.so.0 + aliases[self.basic_filename_tpl.format(self)] = ltversion_filename return aliases def type_suffix(self): |