aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-02-07 22:11:23 +0000
committerlloyd <[email protected]>2011-02-07 22:11:23 +0000
commit02ed4e271a6287a0c23b137e826e62d2be752b82 (patch)
treee50ccc16f91dc52671fdd24dd5d36d4685968511 /configure.py
parent80d591ec716fb6cea829db45b68da1af4afd1d0e (diff)
Add a new configure.py option --distribution-info which sets a macro
in build.h named BOTAN_DISTRIBUTION_INFO. The default value is 'unspecified'. People packaging botan could set this to another value, for instance 'Gentoo 1.9.13-r3' or 'Debian 1.9.13-1', or 'pristine' to indicate a completely unmodified/stock version. This was suggested by Zooko for Crypto++ in http://sourceforge.net/apps/trac/cryptopp/ticket/11 and seemed like an idea worth stealing. Don't default the version datestmap to the current day if unset, instead set to zero. This allows applications to detect unreleased versions. Document that version_datestamp will return zero for unreleased versions. Change the version_string function to return more information about the current version, including the release date and distribution information. It will now return strings like: Botan 1.9.13 (released 20110207, distribution Gentoo 1.9.13-r3) or for an unreleased version: Botan 1.9.13 (unreleased version, distribution unspecified)
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/configure.py b/configure.py
index b5422fdac..69381ef05 100755
--- a/configure.py
+++ b/configure.py
@@ -47,7 +47,7 @@ class BuildConfigurationInformation(object):
version_so_patch = 13
version_suffix = '-dev'
- version_datestamp = None
+ version_datestamp = 0
version_string = '%d.%d.%d%s' % (
version_major, version_minor, version_patch, version_suffix)
@@ -59,10 +59,6 @@ class BuildConfigurationInformation(object):
"""
def __init__(self, options, modules):
- # If not preset, use today
- if self.version_datestamp is None:
- self.version_datestamp = time.strftime("%Y%m%d", time.gmtime())
-
self.build_dir = os.path.join(options.with_build_dir, 'build')
self.checkobj_dir = os.path.join(self.build_dir, 'checks')
@@ -229,6 +225,10 @@ def process_command_line(args):
action='store_false', default=True,
help=SUPPRESS_HELP)
+ build_group.add_option('--distribution-info', metavar='STRING',
+ help='set distribution specific versioning',
+ default='unspecified')
+
wrapper_group = OptionGroup(parser, 'Wrapper options')
wrapper_group.add_option('--with-boost-python', dest='boost_python',
@@ -243,7 +243,7 @@ def process_command_line(args):
wrapper_group.add_option('--use-python-version', dest='python_version',
metavar='N.M',
default='.'.join(map(str, sys.version_info[0:2])),
- help='specify version of Python to build against (eg %default)')
+ help='specify Python to build against (eg %default)')
mods_group = OptionGroup(parser, 'Module selection')
@@ -943,6 +943,8 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
'version_patch': build_config.version_patch,
'version': build_config.version_string,
+ 'distribution_info': options.distribution_info,
+
'version_datestamp': build_config.version_datestamp,
'so_version': build_config.soversion_string,