15
15
const std::string CLIENT_NAME (" Satoshi" );
16
16
17
17
18
- /* *
19
- * The following part of the code determines the CLIENT_BUILD variable.
20
- * Several mechanisms are used for this:
21
- * * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is
22
- * generated by the build environment, possibly containing the output
23
- * of git-describe in a macro called BUILD_DESC
24
- * * secondly, if this is an exported version of the code, GIT_ARCHIVE will
25
- * be defined (automatically using the export-subst git attribute), and
26
- * GIT_COMMIT will contain the commit id.
27
- * * then, three options exist for determining CLIENT_BUILD:
28
- * * if BUILD_DESC is defined, use that literally (output of git-describe)
29
- * * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
30
- * * otherwise, use v[maj].[min].[rev].[build]-unk
31
- */
32
-
33
- // ! First, include build.h if requested
34
18
#ifdef HAVE_BUILD_INFO
35
19
#include < obj/build.h>
20
+ // The <obj/build.h>, which is generated by the build environment (share/genbuild.sh),
21
+ // could contain only one line of the following:
22
+ // - "#define BUILD_GIT_TAG ...", if the top commit is tagged
23
+ // - "#define BUILD_GIT_COMMIT ...", if the top commit is not tagged
24
+ // - "// No build information available", if proper git information is not available
36
25
#endif
37
26
38
27
// ! git will put "#define GIT_ARCHIVE 1" on the next line inside archives. $Format:%n#define GIT_ARCHIVE 1$
@@ -50,9 +39,11 @@ const std::string CLIENT_NAME("Satoshi");
50
39
#define BUILD_DESC_FROM_UNKNOWN (maj, min, rev, build ) \
51
40
" v" DO_STRINGIZE(maj) " ." DO_STRINGIZE(min) " ." DO_STRINGIZE(rev) " ." DO_STRINGIZE(build) " -unk"
52
41
53
- #ifndef BUILD_DESC
54
- #ifdef BUILD_SUFFIX
55
- #define BUILD_DESC BUILD_DESC_WITH_SUFFIX (CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_SUFFIX)
42
+ #ifdef BUILD_GIT_TAG
43
+ #define BUILD_DESC BUILD_GIT_TAG
44
+ #else
45
+ #ifdef BUILD_GIT_COMMIT
46
+ #define BUILD_DESC BUILD_DESC_WITH_SUFFIX (CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, BUILD_GIT_COMMIT)
56
47
#elif defined(GIT_COMMIT_ID)
57
48
#define BUILD_DESC BUILD_DESC_FROM_COMMIT (CLIENT_VERSION_MAJOR, CLIENT_VERSION_MINOR, CLIENT_VERSION_REVISION, CLIENT_VERSION_BUILD, GIT_COMMIT_ID)
58
49
#else
0 commit comments