[PATCH] waf: Fix the build on openbsd
Ralph Böhme
rb at sernet.de
Mon Feb 9 08:38:11 MST 2015
On Mon, Feb 09, 2015 at 04:04:41PM +0100, Ralph Böhme wrote:
> 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.
sadly, it wasn't. Next try. :) Sorry for the noise!
Fwiw, this is more of a proof of concept and I really wished those
that are working with waf longer then I am would share their thought
on the valid concerns Volker raised.
Thanks!
-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 b7fb45afaa6435064958642dbfc4d09b2a6c220a 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 8cf995fedae30f59d6f105b24b4abeca65356020 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 | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/buildtools/wafsamba/samba_wafadmin_fixes.py b/buildtools/wafsamba/samba_wafadmin_fixes.py
index 4e26831..c6f40c0 100644
--- a/buildtools/wafsamba/samba_wafadmin_fixes.py
+++ b/buildtools/wafsamba/samba_wafadmin_fixes.py
@@ -10,3 +10,28 @@
#
# 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 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