[PATCH] waf: Fix the build on openbsd

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


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.

-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 2ed34c1e6565a75f2be8b972a9f6a5e0069f18bc 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..db34dfd 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -8,6 +8,7 @@ from samba_utils import SUBST_VARS_RECURSIVE
 TaskGen.task_gen.apply_verif = Utils.nada
 
 # bring in the other samba modules
+from samba_wafadmin_fixes import *
 from samba_optimisation import *
 from samba_utils import *
 from samba_version import *
-- 
1.9.3


From 52a147d166e9a21c30ddfa819126c55a27dfb04a 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