summaryrefslogtreecommitdiff
path: root/source3/wscript
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-10-25 06:33:39 +0000
committerStefan Metzmacher <metze@samba.org>2010-10-25 08:16:28 +0000
commit2b74cea5f0f3bdfc51f03cfb7641010c7954f222 (patch)
tree7c2ee8a99ba3e8d03ee996abdb4fe50c72fab1f7 /source3/wscript
parent8ea6f41ec9d3e2577432a8d9be100f1f42775787 (diff)
downloadsamba-2b74cea5f0f3bdfc51f03cfb7641010c7954f222.tar.gz
samba-2b74cea5f0f3bdfc51f03cfb7641010c7954f222.tar.bz2
samba-2b74cea5f0f3bdfc51f03cfb7641010c7954f222.zip
s3-waf: use git to calculate the version if available
metze
Diffstat (limited to 'source3/wscript')
-rw-r--r--source3/wscript24
1 files changed, 15 insertions, 9 deletions
diff --git a/source3/wscript b/source3/wscript
index 20975f7189..96571748a5 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -3,6 +3,9 @@
srcdir = '..'
blddir = 'bin'
+APPNAME='samba'
+VERSION=None
+
import sys, os
from optparse import SUPPRESS_HELP
sys.path.insert(0, srcdir+"/buildtools/wafsamba")
@@ -11,9 +14,16 @@ import build.charset
import samba_utils
import samba3
-version = wafsamba.samba_version_file("./VERSION")
-
-VERSION=version.STRING
+def load_version(have_git=False):
+ '''load samba versions either from ./VERSION or git
+ return a version object for detailed breakdown'''
+ import samba_utils, Utils
+ if not have_git:
+ env = samba_utils.LOAD_ENVIRONMENT()
+ have_git = 'GIT' in env
+ version = wafsamba.samba_version_file("./VERSION", have_git=have_git)
+ Utils.g_module.VERSION = version.STRING
+ return version
def set_options(opt):
opt.BUILTIN_DEFAULT('NONE')
@@ -57,16 +67,12 @@ def set_options(opt):
def configure(conf):
from samba_utils import TO_LIST
- conf.DEFINE('PACKAGE_NAME', 'Samba', quote=True)
- conf.DEFINE('PACKAGE_STRING', 'Samba %s' % version.MAJOR, quote=True)
- conf.DEFINE('PACKAGE_TARNAME', 'samba', quote=True)
- conf.DEFINE('PACKAGE_URL', "", quote=True)
- conf.DEFINE('PACKAGE_VERSION', "%s" % version.MAJOR, quote=True)
- conf.DEFINE('PACKAGE_BUGREPORT', 'samba-technical@samba.org', quote=True)
+ version = load_version(have_git=True)
conf.DEFINE('CONFIG_H_IS_FROM_SAMBA', 1)
conf.DEFINE('_SAMBA_BUILD_', version.MAJOR, add_to_cflags=True)
conf.DEFINE('HAVE_CONFIG_H', 1, add_to_cflags=True)
+
if Options.options.developer:
conf.ADD_CFLAGS('-DDEVELOPER -DDEBUG_PASSWORD')
conf.env['developer'] = True