Update CMakeLists.txt - play with openssl
[novacoin.git] / src / version.cpp
1 // Copyright (c) 2012 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 #include <string>
5
6 #include "version.h"
7
8 // Name of client reported in the 'version' message. Report the same name
9 // for both bitcoind and bitcoin-qt, to make it harder for attackers to
10 // target servers or GUI users specifically.
11 const std::string CLIENT_NAME("Satoshi");
12
13 // Client version number
14 #define CLIENT_VERSION_SUFFIX   "-leveldb"
15
16 // Compiler name
17 #ifdef __INTEL_COMPILER
18 //code specific to intel compiler
19 #define CL_NAME   "-icpc"
20 #elif _MSC_VER
21 //code specific to MSVC compiler
22 #define CL_NAME   "-msvc"
23 #elif __clang__
24 //code specific to clang compiler
25 #define CL_NAME   "-clang"
26 #elif __MINGW32__
27 //code specific to mingw compiler
28 #define CL_NAME   "-mingw"
29 #elif __GNUC__
30 //code specific to gnu compiler
31 #define CL_NAME   "-gcc"
32 #else
33 #define CL_NAME   "-genericcl"
34 //others
35 #endif
36
37 // The following part of the code determines the CLIENT_BUILD variable.
38 // Several mechanisms are used for this:
39 // * first, if HAVE_BUILD_INFO is defined, include build.h, a file that is
40 //   generated by the build environment, possibly containing the output
41 //   of git-describe in a macro called BUILD_DESC
42 // * secondly, if this is an exported version of the code, GIT_ARCHIVE will
43 //   be defined (automatically using the export-subst git attribute), and
44 //   GIT_COMMIT will contain the commit id.
45 // * then, three options exist for determining CLIENT_BUILD:
46 //   * if BUILD_DESC is defined, use that literally (output of git-describe)
47 //   * if not, but GIT_COMMIT is defined, use v[maj].[min].[rev].[build]-g[commit]
48 //   * otherwise, use v[maj].[min].[rev].[build]-unk
49 // finally CLIENT_VERSION_SUFFIX is added
50
51 // First, include build.h if requested
52 #ifdef HAVE_BUILD_INFO
53 #    include "build.h"
54 #endif
55
56 // git will put "#define GIT_ARCHIVE 1" on the next line inside archives.
57 #ifdef GIT_ARCHIVE
58 #define GIT_COMMIT_DATE "$Format:%cD$"
59 #endif
60
61 #define GIT_ARCHIVE 1
62 #ifdef GIT_ARCHIVE
63 #define GIT_COMMIT_ID "32a928e"
64 #endif
65
66 #define BUILD_DESC_FROM_COMMIT(maj,min,rev,commit) \
67     "nvc-v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-g" commit
68
69 #define BUILD_DESC_FROM_UNKNOWN(maj,min,rev) \
70     "nvc-v" DO_STRINGIZE(maj) "." DO_STRINGIZE(min) "." DO_STRINGIZE(rev) "." DO_STRINGIZE(build) "-unk"
71
72 #ifndef BUILD_DESC
73 #    ifdef GIT_COMMIT_ID
74 #        define BUILD_DESC BUILD_DESC_FROM_COMMIT(DISPLAY_VERSION_MAJOR, DISPLAY_VERSION_MINOR, DISPLAY_VERSION_REVISION, GIT_COMMIT_ID)
75 #    else
76 #        define BUILD_DESC BUILD_DESC_FROM_UNKNOWN(DISPLAY_VERSION_MAJOR, DISPLAY_VERSION_MINOR, DISPLAY_VERSION_REVISION)
77 #    endif
78 #endif
79
80 #ifdef _MSC_VER
81 #undef GIT_COMMIT_DATE
82 #endif
83
84 #ifndef BUILD_DATE
85 #    ifdef GIT_COMMIT_DATE
86 #        define BUILD_DATE GIT_COMMIT_DATE
87 #    else
88 #        define BUILD_DATE __DATE__ ", " __TIME__
89 #    endif
90 #endif
91
92 const std::string CLIENT_BUILD(BUILD_DESC CLIENT_VERSION_SUFFIX CL_NAME);
93 const std::string CLIENT_DATE(BUILD_DATE);