| 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-string.h" |   7 #include "include/v8-version-string.h" | 
|   8 #include "include/v8-version.h" |   8 #include "include/v8-version.h" | 
|   9 #include "src/utils.h" |   9 #include "src/utils.h" | 
|  10  |  10  | 
|  11 // Define SONAME to have the build system put a specific SONAME into the |  11 // Define SONAME to have the build system put a specific SONAME into the | 
|  12 // shared library instead the generic SONAME generated from the V8 version |  12 // shared library instead the generic SONAME generated from the V8 version | 
|  13 // number. This define is mainly used by the build system script. |  13 // number. This define is mainly used by the build system script. | 
|  14 #define SONAME            "" |  14 #define SONAME            "" | 
|  15  |  15  | 
|  16 namespace v8 { |  16 namespace v8 { | 
|  17 namespace internal { |  17 namespace internal { | 
|  18  |  18  | 
|  19 int Version::major_ = V8_MAJOR_VERSION; |  19 int Version::major_ = V8_MAJOR_VERSION; | 
|  20 int Version::minor_ = V8_MINOR_VERSION; |  20 int Version::minor_ = V8_MINOR_VERSION; | 
|  21 int Version::build_ = V8_BUILD_NUMBER; |  21 int Version::build_ = V8_BUILD_NUMBER; | 
|  22 int Version::patch_ = V8_PATCH_LEVEL; |  22 int Version::patch_ = V8_PATCH_LEVEL; | 
|  23 const char* Version::embedder_ = V8_EMBEDDER_STRING; |  | 
|  24 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0); |  23 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0); | 
|  25 const char* Version::soname_ = SONAME; |  24 const char* Version::soname_ = SONAME; | 
|  26 const char* Version::version_string_ = V8_VERSION_STRING; |  25 const char* Version::version_string_ = V8_VERSION_STRING; | 
|  27  |  26  | 
|  28 // Calculate the V8 version string. |  27 // Calculate the V8 version string. | 
|  29 void Version::GetString(Vector<char> str) { |  28 void Version::GetString(Vector<char> str) { | 
|  30   const char* candidate = IsCandidate() ? " (candidate)" : ""; |  29   const char* candidate = IsCandidate() ? " (candidate)" : ""; | 
|  31 #ifdef USE_SIMULATOR |  30 #ifdef USE_SIMULATOR | 
|  32   const char* is_simulator = " SIMULATOR"; |  31   const char* is_simulator = " SIMULATOR"; | 
|  33 #else |  32 #else | 
|  34   const char* is_simulator = ""; |  33   const char* is_simulator = ""; | 
|  35 #endif  // USE_SIMULATOR |  34 #endif  // USE_SIMULATOR | 
|  36   if (GetPatch() > 0) { |  35   if (GetPatch() > 0) { | 
|  37     SNPrintF(str, "%d.%d.%d.%d%s%s%s", GetMajor(), GetMinor(), GetBuild(), |  36     SNPrintF(str, "%d.%d.%d.%d%s%s", | 
|  38              GetPatch(), GetEmbedder(), candidate, is_simulator); |  37              GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate, | 
 |  38              is_simulator); | 
|  39   } else { |  39   } else { | 
|  40     SNPrintF(str, "%d.%d.%d%s%s", |  40     SNPrintF(str, "%d.%d.%d%s%s", | 
|  41              GetMajor(), GetMinor(), GetBuild(), candidate, |  41              GetMajor(), GetMinor(), GetBuild(), candidate, | 
|  42              is_simulator); |  42              is_simulator); | 
|  43   } |  43   } | 
|  44 } |  44 } | 
|  45  |  45  | 
|  46  |  46  | 
|  47 // Calculate the SONAME for the V8 shared library. |  47 // Calculate the SONAME for the V8 shared library. | 
|  48 void Version::GetSONAME(Vector<char> str) { |  48 void Version::GetSONAME(Vector<char> str) { | 
|  49   if (soname_ == NULL || *soname_ == '\0') { |  49   if (soname_ == NULL || *soname_ == '\0') { | 
|  50     // Generate generic SONAME if no specific SONAME is defined. |  50     // Generate generic SONAME if no specific SONAME is defined. | 
|  51     const char* candidate = IsCandidate() ? "-candidate" : ""; |  51     const char* candidate = IsCandidate() ? "-candidate" : ""; | 
|  52     if (GetPatch() > 0) { |  52     if (GetPatch() > 0) { | 
|  53       SNPrintF(str, "libv8-%d.%d.%d.%d%s%s.so", GetMajor(), GetMinor(), |  53       SNPrintF(str, "libv8-%d.%d.%d.%d%s.so", | 
|  54                GetBuild(), GetPatch(), GetEmbedder(), candidate); |  54                GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate); | 
|  55     } else { |  55     } else { | 
|  56       SNPrintF(str, "libv8-%d.%d.%d%s.so", |  56       SNPrintF(str, "libv8-%d.%d.%d%s.so", | 
|  57                GetMajor(), GetMinor(), GetBuild(), candidate); |  57                GetMajor(), GetMinor(), GetBuild(), candidate); | 
|  58     } |  58     } | 
|  59   } else { |  59   } else { | 
|  60     // Use specific SONAME. |  60     // Use specific SONAME. | 
|  61     SNPrintF(str, "%s", soname_); |  61     SNPrintF(str, "%s", soname_); | 
|  62   } |  62   } | 
|  63 } |  63 } | 
|  64  |  64  | 
|  65 }  // namespace internal |  65 }  // namespace internal | 
|  66 }  // namespace v8 |  66 }  // namespace v8 | 
| OLD | NEW |