aboutsummaryrefslogtreecommitdiff
path: root/src/version.cpp
diff options
context:
space:
mode:
authorWarren Togami <wtogami@gmail.com>2014-04-12 14:06:07 -1000
committerWarren Togami <wtogami@gmail.com>2014-04-15 21:48:44 -1000
commit3d20cd5f61fff33fe5fffd6efddf2c942c8dd2f9 (patch)
tree6e3c302e70bc8ce063d473448ae40895aa62f7da /src/version.cpp
parent74dd52a9fc13851a6ec847da985388a6bfb70be7 (diff)
VERSION obtained from source instead of the previous git tag.
Drawback: The version string is no longer a valid git identifier. For this reason the 'g' short hash prefix has been removed. Exception: When building directly from a tag this behaves exactly like the previous behavior. This allows formatting release versions with precision i.e. v0.9.2 This also allows arbitrary topicbranch names i.e. v0.9.1-glibc-compat
Diffstat (limited to 'src/version.cpp')
-rw-r--r--src/version.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/version.cpp b/src/version.cpp
index 904451ac59..51e34aa9c9 100644
--- a/src/version.cpp
+++ b/src/version.cpp
@@ -40,6 +40,9 @@ const std::string CLIENT_NAME("Satoshi");
# define GIT_COMMIT_DATE "$Format:%cD$"
#endif
+#define BUILD_DESC_WITH_SUFFIX(maj,min,rev,build,suffix) \
+ "v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-" DO_STRINGIZE(suffix)
+
#define BUILD_DESC_FROM_COMMIT(maj,min,rev,build,commit) \
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit
@@ -47,7 +50,9 @@ const std::string CLIENT_NAME("Satoshi");
"v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"
#ifndef BUILD_DESC
-# ifdef GIT_COMMIT_ID
+# ifdef BUILD_SUFFIX
+# define BUILD_DESC BUILD_DESC_WITH_SUFFIX(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX)
+# elif defined(GIT_COMMIT_ID)
# define BUILD_DESC BUILD_DESC_FROM_COMMIT(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID)
# else
# define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD)