summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-07 10:59:01 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:40 +1000
commit5b9ca48d81a92a1b6c079654ce71038ab5f844b4 (patch)
treee59d5dece8980204482211edb8056095655eada7
parent88a138f373aa807079321a00e4f2dc083a17a422 (diff)
downloadsamba-5b9ca48d81a92a1b6c079654ce71038ab5f844b4.tar.gz
build: added generation of version.h
-rw-r--r--buildtools/wafsamba/samba_patterns.py13
-rw-r--r--source4/wscript_build2
2 files changed, 15 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index 868aa2874e7..ef89db69a66 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -21,3 +21,16 @@ def process_et(self, node):
self.create_task('et', node, [c_node, h_node])
self.allnodes.append(c_node)
+
+
+def SAMBA_MKVERSION(bld, target):
+ '''generate the version.h header for Samba'''
+ bld.SET_BUILD_GROUP('setup')
+ t = bld(rule="${SRC} ${TGT}",
+ source= [ "script/mkversion.sh", 'VERSION' ],
+ target=target,
+ before="cc")
+ # force this rule to be constructed now
+ t.post()
+Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION
+
diff --git a/source4/wscript_build b/source4/wscript_build
index 04fef67927c..831c3dcef7f 100644
--- a/source4/wscript_build
+++ b/source4/wscript_build
@@ -9,6 +9,8 @@ bld.env.TOPDIR = os.path.normpath(os.path.join(os.environ.get('PWD'), srcdir))
# building the C from ASN1 and IDL, and finally the main build process
bld.SETUP_BUILD_GROUPS()
+bld.SAMBA_MKVERSION('version.h')
+
bld.ENABLE_MAGIC_ORDERING()
bld.PREDECLARE('LIBNDR', 'LIBRARY')