[PATCH] waf: Fix the build on openbsd
Ralph Böhme
rb at sernet.de
Tue Feb 3 03:48:41 MST 2015
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?
-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 5ceebaa3cb91c0e5e51da0cc97e3fd7cfa86be1d Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Tue, 3 Feb 2015 11:41:21 +0100
Subject: [PATCH 1/2] wafadmin: allow get_target_name to be hooked with @before
and @after
Signed-off-by: Ralph Boehme <slow at samba.org>
---
buildtools/wafadmin/Tools/ccroot.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/buildtools/wafadmin/Tools/ccroot.py b/buildtools/wafadmin/Tools/ccroot.py
index d59cf26..7170848 100644
--- a/buildtools/wafadmin/Tools/ccroot.py
+++ b/buildtools/wafadmin/Tools/ccroot.py
@@ -166,6 +166,7 @@ class ccroot_abstract(TaskGen.task_gen):
k[1] = 'c' + k[1]
TaskGen.task_gen.__init__(self, *k, **kw)
+ at feature('cshlib', 'cstaticlib')
def get_target_name(self):
tp = 'program'
for x in self.features:
--
1.9.3
From bb4938aee35082f5a8fafe7d5b1047fa3ad0227e 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 2/2] wafsamba: add workaround for library naming on OpenBSD
Signed-off-by: Ralph Boehme <slow at samba.org>
---
buildtools/wafsamba/wafsamba.py | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index c054315..13c8a10 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -967,3 +967,27 @@ def apply_bundle_remove_dynamiclib_patch(self):
self.env['LINKFLAGS'].remove('-single_module')
except ValueError:
pass
+
+ at after('get_target_name')
+ at feature('cshlib', 'cstaticlib')
+def after_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)
--
1.9.3
More information about the samba-technical
mailing list