aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-06-14 12:32:46 +0000
committerlloyd <[email protected]>2010-06-14 12:32:46 +0000
commit3a7b91163b8d1b6d0044b777b0e8ffce77c9d8c9 (patch)
treef8bb19776cb7b35f68f7c68a524cc397a4480e13
parenta68fb6c85bfc35a6eb5b7ed3a60c44eea68d9413 (diff)
Expose a datestamp in build.h, provide function in version.h for
getting runtime value.
-rw-r--r--checks/check.cpp3
-rwxr-xr-xconfigure.py5
-rw-r--r--src/build-data/buildh.in2
-rw-r--r--src/utils/version.cpp2
-rw-r--r--src/utils/version.h8
5 files changed, 19 insertions, 1 deletions
diff --git a/checks/check.cpp b/checks/check.cpp
index 952384a19..476886661 100644
--- a/checks/check.cpp
+++ b/checks/check.cpp
@@ -109,7 +109,8 @@ int main(int argc, char* argv[])
if(opts.is_set("help") || argc <= 1)
{
std::cerr << "Test driver for "
- << Botan::version_string() << "\n"
+ << Botan::version_string()
+ << " (released " << Botan::version_datestamp() << ")\n"
<< "Options:\n"
<< " --test || --validate: Run tests (do this at least once)\n"
<< " --benchmark: Benchmark everything\n"
diff --git a/configure.py b/configure.py
index 4c8aad17c..9814d75ee 100755
--- a/configure.py
+++ b/configure.py
@@ -44,6 +44,8 @@ class BuildConfigurationInformation(object):
version_so_patch = 8
version_suffix = '-dev'
+ version_datestamp = '20100614'
+
version_string = '%d.%d.%d%s' % (
version_major, version_minor, version_patch, version_suffix)
soversion_string = '%d.%d.%d%s' % (
@@ -933,6 +935,9 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
'version_minor': build_config.version_minor,
'version_patch': build_config.version_patch,
'version': build_config.version_string,
+
+ 'version_datestamp': build_config.version_datestamp,
+
'so_version': build_config.soversion_string,
'timestamp': build_config.timestamp(),
diff --git a/src/build-data/buildh.in b/src/build-data/buildh.in
index 2f5413113..6a203234a 100644
--- a/src/build-data/buildh.in
+++ b/src/build-data/buildh.in
@@ -8,6 +8,8 @@
#define BOTAN_VERSION_MINOR %{version_minor}
#define BOTAN_VERSION_PATCH %{version_patch}
+#define BOTAN_VERSION_DATESTAMP %{version_datestamp}
+
#ifndef BOTAN_DLL
#define BOTAN_DLL %{dll_import_flags}
#endif
diff --git a/src/utils/version.cpp b/src/utils/version.cpp
index d540864b2..22827cbe5 100644
--- a/src/utils/version.cpp
+++ b/src/utils/version.cpp
@@ -26,6 +26,8 @@ std::string version_string()
to_string(version_patch());
}
+u32bit version_datestamp() { return BOTAN_VERSION_DATESTAMP; }
+
/*
* Return parts of the version as integers
*/
diff --git a/src/utils/version.h b/src/utils/version.h
index 3cc44e806..9ed776ed7 100644
--- a/src/utils/version.h
+++ b/src/utils/version.h
@@ -24,6 +24,14 @@ namespace Botan {
BOTAN_DLL std::string version_string();
/**
+* Return the date this version of botan was released, in an
+* integer of the form YYYYMMDD. For instance a version released
+* on May 21, 2013 would return the integer 20130521
+* @return the release date
+*/
+BOTAN_DLL u32bit version_datestamp();
+
+/**
* Get the major version number.
* @return the major version number
*/