1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/buildtools/wafsamba/samba_patterns.py
Andrew Tridgell fe5c48cbed waf: added --git-local-changes configure option
if you use --git-local-changes then the version number that waf
extracts from git will have a '+' on the end if you have local
changes, as determined by running 'git diff'.

This used to be the default, but unfortunately it is far too slow on
some systems. On a NFS build system I was using the first line of
configure took about 2 minutes.

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Nov 16 01:51:54 UTC 2010 on sn-devel-104
2010-11-16 01:51:54 +00:00

30 lines
861 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, task.env.srcdir, env=task.env)
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,
always=True)
Build.BuildContext.SAMBA_MKVERSION = SAMBA_MKVERSION