[PATCH] waf: Fix the build on openbsd

Ralph Böhme rb at sernet.de
Tue Feb 3 05:46:39 MST 2015


On Tue, Feb 03, 2015 at 01:35:00PM +0100, Ralph Böhme wrote:
> On Tue, Feb 03, 2015 at 12:57:48PM +0100, Stefan (metze) Metzmacher wrote:
> > Am 03.02.2015 um 11:48 schrieb Ralph Böhme:
> > > On Tue, Feb 03, 2015 at 10:13:12AM +0100, Volker Lendecke wrote:
> > >> On Tue, Feb 03, 2015 at 10:10:08AM +0100, Ralph Böhme wrote:
> > >>> Hi Volker,
> > >>>
> > >>> On Mon, Feb 02, 2015 at 09:11:47PM +0100, Volker Lendecke wrote:
> > >>>> Review&push appreciated!
> > >>>> ...
> > >>>> diff --git a/buildtools/wafadmin/Tools/ccroot.py b/buildtools/wafadmin/Tools/ccroot.py
> > >>>> ...
> > >>>
> > >>> this modifies wafadmin, I'll try to come up with the corresponding fix
> > >>> for wafsamba.
> > >>
> > >> I know. But how do you want to fix it in wafsamba?
> > > 
> > > See attached patchset, untested. Unfortunately it seems like we need
> > > at least a minor modification to wafadmin in order to be able to hook
> > > the get_target_name function.
> > > 
> > > @metze: what do you think?
> > 
> > I think we need to use a trick like in commit
> > dc808a466ef835535a3d4bb87f19316eeff1c567
> > in order replace get_target_name() and to avoid
> > changes in wafadmin completely
> 
> awesome, thanks! Forgot about this handy trick. Let's see if I can
> apply it to this problem.

patch attached. Of course completely untested. :)

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de
-------------- next part --------------
From 143b4412bef5c650b50676eb52d364ab6998aa0c Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Tue, 3 Feb 2015 11:42:18 +0100
Subject: [PATCH] wafsamba: add workaround for library naming on OpenBSD

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 buildtools/wafsamba/wafsamba.py | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index c054315..6509996 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -34,6 +34,7 @@ import stale_files
 import symbols
 import pkgconfig
 import configure_file
+import ccroot
 
 # some systems have broken threading in python
 if os.environ.get('WAF_NOTHREADS') == '1':
@@ -967,3 +968,28 @@ def apply_bundle_remove_dynamiclib_patch(self):
                 self.env['LINKFLAGS'].remove('-single_module')
             except ValueError:
                 pass
+
+# Even though we won't call it, still remember it
+waf_ccroot_get_target_name = ccroot.get_target_name
+def samba_get_target_name(self):
+    tp = 'program'
+    for x in self.features:
+        if x in ['cshlib', 'cstaticlib']:
+            tp = x.lstrip('c')
+
+    pattern = self.env[tp + '_PATTERN']
+    if not pattern: pattern = '%s'
+
+    dir, name = os.path.split(self.target)
+
+    if 'cshlib' in self.features and getattr(self, 'vnum', None):
+        nums = self.vnum.split('.')
+        if self.env.DEST_BINFMT == 'pe':
+            # include the version in the dll file name,
+            # the import lib file name stays unversionned.
+            name = name + '-' + nums[0]
+        elif self.env.DEST_OS == 'openbsd':
+            pattern = '.'.join([pattern]+[str(d) for d in nums][:2])
+
+    return os.path.join(dir, pattern % name)
+ccroot.get_target_name = samba_get_target_name
-- 
1.9.3



More information about the samba-technical mailing list