[PATCH] waf: Fix the build on openbsd

Ralph Böhme rb at sernet.de
Mon Feb 9 08:04:41 MST 2015


On Mon, Feb 09, 2015 at 04:02:23PM +0100, Ralph Böhme wrote:
> On Mon, Feb 09, 2015 at 03:57:08PM +0100, Ralph Böhme wrote:
> > On Mon, Feb 09, 2015 at 03:55:47PM +0100, Ralph Böhme wrote:
> > > Hi metze,
> > > 
> > > On Mon, Feb 09, 2015 at 01:43:26PM +0100, Stefan (metze) Metzmacher wrote:
> > > > > ...
> > > > 
> > > > We should start with an empty file...
> > > > 
> > > > > ...
> > > > 
> > > > This should be the first import (before
> > > > from samba_optimisation import *)
> > > > 
> > > > samba_get_target_name() checks self.env.DEST_OS more than once.
> > > 
> > > updated patchset attached.
> > 
> > here it is.
> 
> hold on, seems I messed up the commit ammend. Time for another cup of
> coffee.

this one should be ok.

-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 cd653ad0458fc20af8363d60d5151ea10f17dd8b Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Mon, 9 Feb 2015 12:02:12 +0100
Subject: [PATCH 1/2] waf: add new file for wafadmin bugfixes

In order to facilitate differentation between

1) pristine upstream waf in wafadmin
2) backported upstream commits/bugfixes in wafadmin
3) downstream bugfixes

add a new file samba_wafadmin_fixes.py which is restricted to only
containing pure wafadmin bugfixes.

Thereby on future waf upstream imports we can easily review our own
fixes with a git log buildtools/wafsamba/samba_wafadmin_fixes.py.

TODO: consolidate previous bugfixes that modify other parts of wafsamba
in this file.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 buildtools/wafsamba/samba_wafadmin_fixes.py | 12 ++++++++++++
 buildtools/wafsamba/wafsamba.py             |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 buildtools/wafsamba/samba_wafadmin_fixes.py

diff --git a/buildtools/wafsamba/samba_wafadmin_fixes.py b/buildtools/wafsamba/samba_wafadmin_fixes.py
new file mode 100644
index 0000000..4e26831
--- /dev/null
+++ b/buildtools/wafsamba/samba_wafadmin_fixes.py
@@ -0,0 +1,12 @@
+# This file contains *bugfixes* for wafadmin
+# In order to facilitate differentation between
+#
+# 1) prestine upstream waf in wafadmin
+# 2) backported upstream commits/bugfixes in wafadmin
+# 3) downstream bugfixes
+#
+# add a new file samba_wafadmin_fixes.py which is restricted to only
+# containing pure wafadmin bugfixes.
+#
+# Therefor on future waf upstream imports we can easily review our own
+# fixes with a git log buildtools/wafsamba/samba_wafadmin_fixes.py.
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index c054315..f8d131c 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -20,6 +20,7 @@ from samba_perl import *
 from samba_deps import *
 from samba_bundled import *
 from samba_third_party import *
+from samba_wafadmin_fixes import *
 import samba_install
 import samba_conftests
 import samba_abi
-- 
1.9.3


From a86671e0eaef03031b4a9bce4b52be736e510b29 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Mon, 9 Feb 2015 12:26:36 +0100
Subject: [PATCH 2/2] wafsamba: add workaround for library naming on OpenBSD

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

diff --git a/buildtools/wafsamba/samba_wafadmin_fixes.py b/buildtools/wafsamba/samba_wafadmin_fixes.py
index 4e26831..6b98977 100644
--- a/buildtools/wafsamba/samba_wafadmin_fixes.py
+++ b/buildtools/wafsamba/samba_wafadmin_fixes.py
@@ -10,3 +10,31 @@
 #
 # Therefor on future waf upstream imports we can easily review our own
 # fixes with a git log buildtools/wafsamba/samba_wafadmin_fixes.py.
+
+import os
+import Build, Utils, Node
+from TaskGen import feature, after, before
+import preproc
+import ccroot
+
+waf_ccroot_get_target_name = ccroot.get_target_name
+def samba_get_target_name(self):
+    if self.env.DEST_OS != 'openbsd':
+        return waf_ccroot_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('.')
+        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