1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-10 13:57:47 +03:00
samba-mirror/buildtools/wafsamba/samba_patterns.py
Andrew Bartlett 892a4b24e7 waf Read VERSION file inside WAF to set package version
This replaces the call to mkversion.sh in both the Samba3 and Samba4
WAF builds.

Andrew Bartlett
2010-05-28 15:20:03 +10:00

29 lines
792 B
Python

# a waf tool to add extension based build patterns for Samba
import Task
from TaskGen import extension
from samba_utils import *
from wafsamba import samba_version_file
def write_version_header(task):
'''print version.h contents'''
src = task.inputs[0].srcpath(task.env)
tgt = task.outputs[0].bldpath(task.env)
version = samba_version_file(src)
string = str(version)
f = open(tgt, 'w')
s = f.write(string)
f.close()
return 0
def SAMBA_MKVERSION(bld, target):
'''generate the version.h header for Samba'''
t = bld.SAMBA_GENERATOR('VERSION',
rule=write_version_header,
source= 'VERSION',
target=target)
Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION