d840ed11d9
Reason for revert: Blocks roll https://codereview.chromium.org/2647183002/ Original issue's description: > [build] Introduce an embedder version string > > Sometimes, the embedder might want to merge a fix to an abandoned branch > or to a supported branch but the fix is not relevant to Chromium. > This adds a new version string that the embedder can set on compile time > and that will be appended to the official V8 version. > The separator must be provided in the string. For instance, to have a > full version string like "5.5.372.37.custom.1", the embedder must set > V8_EMBEDDER_STRING to ".custom.1". > > Related Node.js issue: https://github.com/nodejs/node/pull/9754 > > BUG=v8:5740 > R=machenbach@chromium.org,hablich@chromium.com,ofrobots@google.com > > CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_rel_ng > > Review-Url: https://codereview.chromium.org/2619213002 > Cr-Original-Commit-Position: refs/heads/master@{#42175} > Committed:fc86d4329b
> Review-Url: https://codereview.chromium.org/2619213002 > Cr-Commit-Position: refs/heads/master@{#42582} > Committed:2c1d1e6088
TBR=hablich@chromium.com,machenbach@chromium.org,ofrobots@google.com,mic.besace@gmail.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=v8:5740 Review-Url: https://codereview.chromium.org/2643393004 Cr-Commit-Position: refs/heads/master@{#42583}
67 lines
2.1 KiB
C++
67 lines
2.1 KiB
C++
// Copyright 2012 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "src/version.h"
|
|
|
|
#include "include/v8-version-string.h"
|
|
#include "include/v8-version.h"
|
|
#include "src/utils.h"
|
|
|
|
// Define SONAME to have the build system put a specific SONAME into the
|
|
// shared library instead the generic SONAME generated from the V8 version
|
|
// number. This define is mainly used by the build system script.
|
|
#define SONAME ""
|
|
|
|
namespace v8 {
|
|
namespace internal {
|
|
|
|
int Version::major_ = V8_MAJOR_VERSION;
|
|
int Version::minor_ = V8_MINOR_VERSION;
|
|
int Version::build_ = V8_BUILD_NUMBER;
|
|
int Version::patch_ = V8_PATCH_LEVEL;
|
|
bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
|
|
const char* Version::soname_ = SONAME;
|
|
const char* Version::version_string_ = V8_VERSION_STRING;
|
|
|
|
// Calculate the V8 version string.
|
|
void Version::GetString(Vector<char> str) {
|
|
const char* candidate = IsCandidate() ? " (candidate)" : "";
|
|
#ifdef USE_SIMULATOR
|
|
const char* is_simulator = " SIMULATOR";
|
|
#else
|
|
const char* is_simulator = "";
|
|
#endif // USE_SIMULATOR
|
|
if (GetPatch() > 0) {
|
|
SNPrintF(str, "%d.%d.%d.%d%s%s",
|
|
GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate,
|
|
is_simulator);
|
|
} else {
|
|
SNPrintF(str, "%d.%d.%d%s%s",
|
|
GetMajor(), GetMinor(), GetBuild(), candidate,
|
|
is_simulator);
|
|
}
|
|
}
|
|
|
|
|
|
// Calculate the SONAME for the V8 shared library.
|
|
void Version::GetSONAME(Vector<char> str) {
|
|
if (soname_ == NULL || *soname_ == '\0') {
|
|
// Generate generic SONAME if no specific SONAME is defined.
|
|
const char* candidate = IsCandidate() ? "-candidate" : "";
|
|
if (GetPatch() > 0) {
|
|
SNPrintF(str, "libv8-%d.%d.%d.%d%s.so",
|
|
GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
|
|
} else {
|
|
SNPrintF(str, "libv8-%d.%d.%d%s.so",
|
|
GetMajor(), GetMinor(), GetBuild(), candidate);
|
|
}
|
|
} else {
|
|
// Use specific SONAME.
|
|
SNPrintF(str, "%s", soname_);
|
|
}
|
|
}
|
|
|
|
} // namespace internal
|
|
} // namespace v8
|