ctdb-build: Add generation of Samba-style version.h
authorMartin Schwenke <martin@meltin.net>
Mon, 25 Aug 2014 03:28:30 +0000 (13:28 +1000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 7 Nov 2014 19:58:10 +0000 (20:58 +0100)
This is needed by fault.c.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 43266be94552fe0c364e12d3c44fb54e453c123a)

ctdb/wscript

index 97cd84c255dd548de7e412047bcef2fc3d900b77..969c034c518008e592551c513fe797e7e280541b 100755 (executable)
@@ -202,6 +202,15 @@ def build(bld):
                             dep_vars=['VERSION'])
     t.env.VERSION = VERSION
 
+    version_h = samba_utils.os_path_relpath(os.path.join(Options.launch_dir,
+                                                         "version.h"),
+                                            bld.curdir)
+    t.bld.SAMBA_GENERATOR('ctdb-samba-version-header',
+                          target=version_h,
+                          rule='printf "#include \\"ctdb_version.h\\" \\n#define SAMBA_VERSION_STRING CTDB_VERSION_STRING\\n" > ${TGT}',
+                          dep_vars=['VERSION'])
+    t.env.VERSION = VERSION
+
     bld.RECURSE('lib/replace')
     if bld.CHECK_FOR_THIRD_PARTY():
         bld.RECURSE('third_party/popt')