OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/version.h" | 5 #include "src/version.h" |
6 | 6 |
7 #include "include/v8-version.h" | 7 #include "include/v8-version.h" |
8 #include "src/utils.h" | 8 #include "src/utils.h" |
9 | 9 |
10 // Define SONAME to have the build system put a specific SONAME into the | 10 // Define SONAME to have the build system put a specific SONAME into the |
11 // shared library instead the generic SONAME generated from the V8 version | 11 // shared library instead the generic SONAME generated from the V8 version |
12 // number. This define is mainly used by the build system script. | 12 // number. This define is mainly used by the build system script. |
13 #define SONAME "" | 13 #define SONAME "" |
14 | 14 |
15 #if V8_IS_CANDIDATE_VERSION | 15 #if V8_IS_CANDIDATE_VERSION |
16 #define CANDIDATE_STRING " (candidate)" | 16 #define CANDIDATE_STRING " (candidate)" |
17 #else | 17 #else |
18 #define CANDIDATE_STRING "" | 18 #define CANDIDATE_STRING "" |
19 #endif | 19 #endif |
20 | 20 |
21 #define SX(x) #x | 21 #define SX(x) #x |
22 #define S(x) SX(x) | 22 #define S(x) SX(x) |
23 | 23 |
24 #if V8_PATCH_LEVEL > 0 | 24 #if V8_PATCH_LEVEL > 0 |
25 #define VERSION_STRING \ | 25 #define VERSION_STRING \ |
26 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \ | 26 S(V8_MAJOR_VERSION) \ |
27 V8_PATCH_LEVEL) CANDIDATE_STRING | 27 "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S(V8_PATCH_LEVEL) \ |
28 V8_EMBEDDER_STRING CANDIDATE_STRING | |
targos
2017/01/10 09:14:01
I forgot the S(), sorry. Running the tests locally
| |
28 #else | 29 #else |
29 #define VERSION_STRING \ | 30 #define VERSION_STRING \ |
30 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \ | 31 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \ |
31 CANDIDATE_STRING | 32 CANDIDATE_STRING |
32 #endif | 33 #endif |
33 | 34 |
34 namespace v8 { | 35 namespace v8 { |
35 namespace internal { | 36 namespace internal { |
36 | 37 |
37 int Version::major_ = V8_MAJOR_VERSION; | 38 int Version::major_ = V8_MAJOR_VERSION; |
38 int Version::minor_ = V8_MINOR_VERSION; | 39 int Version::minor_ = V8_MINOR_VERSION; |
39 int Version::build_ = V8_BUILD_NUMBER; | 40 int Version::build_ = V8_BUILD_NUMBER; |
40 int Version::patch_ = V8_PATCH_LEVEL; | 41 int Version::patch_ = V8_PATCH_LEVEL; |
42 const char* Version::embedder_ = V8_EMBEDDER_STRING; | |
41 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0); | 43 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0); |
42 const char* Version::soname_ = SONAME; | 44 const char* Version::soname_ = SONAME; |
43 const char* Version::version_string_ = VERSION_STRING; | 45 const char* Version::version_string_ = VERSION_STRING; |
44 | 46 |
45 // Calculate the V8 version string. | 47 // Calculate the V8 version string. |
46 void Version::GetString(Vector<char> str) { | 48 void Version::GetString(Vector<char> str) { |
47 const char* candidate = IsCandidate() ? " (candidate)" : ""; | 49 const char* candidate = IsCandidate() ? " (candidate)" : ""; |
48 #ifdef USE_SIMULATOR | 50 #ifdef USE_SIMULATOR |
49 const char* is_simulator = " SIMULATOR"; | 51 const char* is_simulator = " SIMULATOR"; |
50 #else | 52 #else |
51 const char* is_simulator = ""; | 53 const char* is_simulator = ""; |
52 #endif // USE_SIMULATOR | 54 #endif // USE_SIMULATOR |
53 if (GetPatch() > 0) { | 55 if (GetPatch() > 0) { |
54 SNPrintF(str, "%d.%d.%d.%d%s%s", | 56 SNPrintF(str, "%d.%d.%d.%d%s%s%s", GetMajor(), GetMinor(), GetBuild(), |
55 GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate, | 57 GetPatch(), GetEmbedder(), candidate, is_simulator); |
56 is_simulator); | |
57 } else { | 58 } else { |
58 SNPrintF(str, "%d.%d.%d%s%s", | 59 SNPrintF(str, "%d.%d.%d%s%s", |
59 GetMajor(), GetMinor(), GetBuild(), candidate, | 60 GetMajor(), GetMinor(), GetBuild(), candidate, |
60 is_simulator); | 61 is_simulator); |
61 } | 62 } |
62 } | 63 } |
63 | 64 |
64 | 65 |
65 // Calculate the SONAME for the V8 shared library. | 66 // Calculate the SONAME for the V8 shared library. |
66 void Version::GetSONAME(Vector<char> str) { | 67 void Version::GetSONAME(Vector<char> str) { |
67 if (soname_ == NULL || *soname_ == '\0') { | 68 if (soname_ == NULL || *soname_ == '\0') { |
68 // Generate generic SONAME if no specific SONAME is defined. | 69 // Generate generic SONAME if no specific SONAME is defined. |
69 const char* candidate = IsCandidate() ? "-candidate" : ""; | 70 const char* candidate = IsCandidate() ? "-candidate" : ""; |
70 if (GetPatch() > 0) { | 71 if (GetPatch() > 0) { |
71 SNPrintF(str, "libv8-%d.%d.%d.%d%s.so", | 72 SNPrintF(str, "libv8-%d.%d.%d.%d%s%s.so", GetMajor(), GetMinor(), |
72 GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate); | 73 GetBuild(), GetPatch(), GetEmbedder(), candidate); |
73 } else { | 74 } else { |
74 SNPrintF(str, "libv8-%d.%d.%d%s.so", | 75 SNPrintF(str, "libv8-%d.%d.%d%s.so", |
75 GetMajor(), GetMinor(), GetBuild(), candidate); | 76 GetMajor(), GetMinor(), GetBuild(), candidate); |
76 } | 77 } |
77 } else { | 78 } else { |
78 // Use specific SONAME. | 79 // Use specific SONAME. |
79 SNPrintF(str, "%s", soname_); | 80 SNPrintF(str, "%s", soname_); |
80 } | 81 } |
81 } | 82 } |
82 | 83 |
83 } // namespace internal | 84 } // namespace internal |
84 } // namespace v8 | 85 } // namespace v8 |
OLD | NEW |