The Samba-Bugzilla – Attachment 8902 Details for
Bug 9774
Shared library conventions are not respected on OpenBSD
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix issue via git format-patch
shared-libs-openbsd.patch (text/plain), 5.64 KB, created by
Vadim Zhukov
on 2013-05-17 09:00:53 UTC
(
hide
)
Description:
Patch to fix issue via git format-patch
Filename:
MIME Type:
Creator:
Vadim Zhukov
Created:
2013-05-17 09:00:53 UTC
Size:
5.64 KB
patch
obsolete
>From aaec32a20069f99e42055b0e6f49db89459fb426 Mon Sep 17 00:00:00 2001 >From: Vadim Zhukov <persgray@gmail.com> >Date: Fri, 17 May 2013 12:54:36 +0400 >Subject: [PATCH] Make Samba4 WAF respect OpenBSD shared libraries versioning > conventions > >On OpenBSD, build chain should respect the folowing override: if there >is a LIBfoo_VERSION environment variable, then its contents should be >used as a version number for libfoo.so. Also, OpenBSD policy is to have >two numbers in version (MAJOR.MINOR) and do not create symlinks to it. > >Also, versioned libraries should be put under ${PREFIX}/lib (PREFIX >defaults to /usr/local) unless there are VERY hard reasons to not >doing so. Actually, this patch allows Samba4 to find all of its shared >libraries on OpenBSD. > >This means that library "foo", if LIBfoo_VERSION is set, should become >/usr/local/lib/libfoo.so.0.0 (or whatever version will be there). > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=9774 >--- > buildtools/wafsamba/samba_install.py | 35 ++++++++++++++++++++++++++--------- > buildtools/wafsamba/wafsamba.py | 7 +++++++ > source4/heimdal_build/wscript_build | 5 +++++ > 3 files changed, 38 insertions(+), 9 deletions(-) > >diff --git a/buildtools/wafsamba/samba_install.py b/buildtools/wafsamba/samba_install.py >index aa7f143..9cafaf5 100644 >--- a/buildtools/wafsamba/samba_install.py >+++ b/buildtools/wafsamba/samba_install.py >@@ -67,17 +67,20 @@ def install_library(self): > self.env.RPATH = build_ldflags > return > >+ target_name = self.target >+ >+ # OpenBSD-like library handling >+ osvnum = os.getenv('LIB' + target_name.replace('-', '_') + '_VERSION') >+ > # setup the install path, expanding variables > install_path = getattr(self, 'samba_inst_path', None) > if install_path is None: >- if getattr(self, 'private_library', False): >+ if getattr(self, 'private_library', False) and not osvnum: > install_path = '${PRIVATELIBDIR}' > else: > install_path = '${LIBDIR}' > install_path = bld.EXPAND_VARIABLES(install_path) > >- target_name = self.target >- > if install_ldflags != build_ldflags: > # we will be creating a new target name, and using that for the > # install link. That stops us from overwriting the existing build >@@ -103,23 +106,37 @@ def install_library(self): > if getattr(self, 'samba_realname', None): > install_name = self.samba_realname > install_link = None >- if getattr(self, 'soname', ''): >+ if osvnum: >+ if getattr(self, 'soname', ''): >+ osname = self.soname >+ else: >+ osname = install_name >+ osname = re.sub(r'(\.[0-9]+)+$', '', osname) + '.' + osvnum >+ # OpenBSD requires "lib" prefix for all versioned shared libraries >+ osname = re.sub(r'^(.*/|)(?:lib)?(([^l]|l[^i]|li[^b])[^/]+)$', r'\1lib\2', osname) >+ install_name = osname >+ if getattr(self, 'soname', ''): >+ self.soname = osname >+ elif getattr(self, 'soname', ''): > install_link = self.soname > if getattr(self, 'samba_type', None) == 'PYTHON': > inst_name = bld.make_libname(t.target, nolibprefix=True, python=True) > else: > inst_name = bld.make_libname(t.target) > elif self.vnum: >- vnum_base = self.vnum.split('.')[0] >- install_name = bld.make_libname(target_name, version=self.vnum) >- install_link = bld.make_libname(target_name, version=vnum_base) >+ install_link = None >+ if osvnum: >+ install_name = bld.make_libname(target_name, version=osvnum) >+ else: >+ install_name = bld.make_libname(target_name, version=self.vnum) >+ vnum_base = self.vnum.split('.')[0] > inst_name = bld.make_libname(t.target) >- if not self.private_library: >+ if not self.private_library and not osvnum: > # only generate the dev link for non-bundled libs > dev_link = bld.make_libname(target_name) > elif getattr(self, 'soname', ''): > install_name = bld.make_libname(target_name) >- install_link = self.soname >+ install_link = None > inst_name = bld.make_libname(t.target) > else: > install_name = bld.make_libname(target_name) >diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py >index 3559cc1..a4eed01 100644 >--- a/buildtools/wafsamba/wafsamba.py >+++ b/buildtools/wafsamba/wafsamba.py >@@ -192,6 +192,13 @@ def SAMBA_LIBRARY(bld, libname, source, > deps = TO_LIST(deps) > deps.append(obj_target) > >+ osvnum = os.getenv('LIB' + libname.replace('-', '_') + '_VERSION') >+ if osvnum: >+ vnum = osvnum >+ if realname: realname = re.sub(r'(\.[0-9]+)+$', '.' + osvnum, realname) >+ if link_name: link_name = re.sub(r'(\.[0-9]+)+$', '.' + osvnum, link_name) >+ if soname: soname = re.sub(r'(\.[0-9]+)+$', '.' + osvnum, soname) >+ > realname = bld.map_shlib_extension(realname, python=(target_type=='PYTHON')) > link_name = bld.map_shlib_extension(link_name, python=(target_type=='PYTHON')) > >diff --git a/source4/heimdal_build/wscript_build b/source4/heimdal_build/wscript_build >index f447115..3a02541 100644 >--- a/source4/heimdal_build/wscript_build >+++ b/source4/heimdal_build/wscript_build >@@ -243,6 +243,11 @@ def HEIMDAL_LIBRARY(libname, source, deps, vnum, version_script, includes=''): > > features = 'cc cshlib symlink_lib install_lib' > >+ # OpenBSD-like error handling >+ osvnum = os.getenv('LIB' + bundled_name.replace('-', '_') + '_VERSION') >+ if osvnum: >+ vnum = osvnum >+ > bld.set_group('libraries') > t = bld( > features = features, >-- >1.8.2.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9774
:
8894
| 8902