ldb: added a include/ldb_version.h
authorAndrew Tridgell <tridge@samba.org>
Thu, 10 Feb 2011 01:04:36 +0000 (12:04 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 10 Feb 2011 05:51:06 +0000 (06:51 +0100)
this fixes a problem with the installed ldb_modules.h header, which
depended on LDB_VERSION being defined.

Thanks to Simo for noticing this!

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/lib/ldb/include/ldb.h
source4/lib/ldb/wscript

index 4b1a5fb70888e1713d15db589269ab3af952e9e5..ff0ebe7c092e392496192dcc3fd81cd269c4b8e9 100644 (file)
@@ -49,6 +49,7 @@
 #include <stdbool.h>
 #include <talloc.h>
 #include <tevent.h>
+#include "ldb_version.h"
 #include "ldb_errors.h"
 
 /*
index 81d2adcfd3935fe2d76f9894f21dc2e1884b9a43..24d541b78caa3da13d8b2b1352398f41ab02aa75 100644 (file)
@@ -56,8 +56,6 @@ def configure(conf):
         if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
             conf.env.ENABLE_LDAP_BACKEND = True
 
-    conf.DEFINE('LDB_VERSION', VERSION, quote=True)
-
     conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
 
     # we don't want any libraries or modules to rely on runtime
@@ -135,6 +133,15 @@ def build(bld):
                           abi_directory = 'ABI',
                           abi_match = abi_match)
 
+        # generate a include/ldb_version.h
+        t = bld.SAMBA_GENERATOR('ldb_version.h',
+                                rule='echo "#define LDB_VERSION \\"${LDB_VERSION}\\"" > ${TGT}',
+                                target='include/ldb_version.h',
+                                public_headers='include/ldb_version.h')
+        t.env.LDB_VERSION = VERSION
+        bld.add_manual_dependency(bld.path.find_or_declare('include/ldb_version.h'), VERSION)
+
+
 
         bld.SAMBA_PYTHON('pyldb', 'pyldb.c',
                          deps='ldb pyldb-util',