diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-06-23 10:50:54 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-07-02 17:35:19 +0200 |
commit | 774b2e4f5a77a7996f453b5d7d76514a80011c51 (patch) | |
tree | d5769b1a3b0a2931722e0551fc63ff465de23726 /lib/ldb | |
parent | b8b8439f1a7213d03e251ddc0279ae8a2be414d3 (diff) | |
download | samba-774b2e4f5a77a7996f453b5d7d76514a80011c51.tar.gz |
ldb:wscript: provide LDB_VERSION_{MAJOR,MINOR,RELEASE} in ldb_version.h
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/ldb')
-rw-r--r-- | lib/ldb/wscript | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/ldb/wscript b/lib/ldb/wscript index 1fce3b3ba57..d827775f5be 100644 --- a/lib/ldb/wscript +++ b/lib/ldb/wscript @@ -205,8 +205,24 @@ def build(bld): abi_match = abi_match) # generate a include/ldb_version.h + def generate_ldb_version_h(t): + '''generate a vscript file for our public libraries''' + + tgt = t.outputs[0].bldpath(t.env) + + v = t.env.LDB_VERSION.split('.') + + f = open(tgt, mode='w') + try: + f.write('#define LDB_VERSION "%s"\n' % t.env.LDB_VERSION) + f.write('#define LDB_VERSION_MAJOR %d\n' % int(v[0])) + f.write('#define LDB_VERSION_MINOR %d\n' % int(v[1])) + f.write('#define LDB_VERSION_RELEASE %d\n' % int(v[2])) + finally: + f.close() + return t = bld.SAMBA_GENERATOR('ldb_version.h', - rule='echo "#define LDB_VERSION \\"${LDB_VERSION}\\"" > ${TGT}', + rule=generate_ldb_version_h, dep_vars=['LDB_VERSION'], target='include/ldb_version.h', public_headers='include/ldb_version.h', |