diff options
Diffstat (limited to 'src/mongo/util/version.cpp')
-rw-r--r-- | src/mongo/util/version.cpp | 93 |
1 files changed, 11 insertions, 82 deletions
diff --git a/src/mongo/util/version.cpp b/src/mongo/util/version.cpp index 6c5f15be206..50ba5cc3fa1 100644 --- a/src/mongo/util/version.cpp +++ b/src/mongo/util/version.cpp @@ -15,25 +15,12 @@ * limitations under the License. */ +#include "mongo/platform/basic.h" -#include <cstdlib> -#include <iostream> -#include <iomanip> -#include <sstream> -#include <string> -#include <fstream> +#include "mongo/util/version.h" #include "mongo/base/parse_number.h" #include "mongo/db/jsobj.h" -#include "mongo/db/pdfile_version.h" -#include "mongo/db/storage_options.h" -#include "mongo/util/file.h" -#include "mongo/util/net/ssl_manager.h" -#include "mongo/util/processinfo.h" -#include "mongo/util/ramlog.h" -#include "mongo/util/stringutils.h" -#include "mongo/util/version.h" - namespace mongo { @@ -111,27 +98,16 @@ namespace mongo { } #ifndef _SCONS - // only works in scons + // + // The following implementations are provided for use when buildinfo.cpp is not autogenerated. + // + const char * gitVersion() { return "not-scons"; } const char * compiledJSEngine() { return ""; } const char * allocator() { return ""; } const char * loaderFlags() { return ""; } const char * compilerFlags() { return ""; } -#endif - - void printGitVersion() { log() << "git version: " << gitVersion() << endl; } - const std::string openSSLVersion(const std::string &prefix, const std::string &suffix) { - return getSSLVersion(prefix, suffix); - } - - void printOpenSSLVersion() { -#ifdef MONGO_SSL - log() << openSSLVersion("OpenSSL version: ") << endl; -#endif - } - -#ifndef _SCONS #if defined(_WIN32) string sysInfo() { stringstream ss; @@ -140,61 +116,14 @@ namespace mongo { ss << " boostver:" << BOOST_VERSION; #if( !defined(_MT) ) #error _MT is not defined -#endif +#endif // !defined(_MT) ss << (sizeof(char *) == 8 ? " 64bit" : " 32bit"); return ss.str(); } -#else +#else // defined(_WIN32) string sysInfo() { return ""; } -#endif -#endif - -#if defined(_WIN32) - std::string targetMinOS() { - stringstream ss; -#if (NTDDI_VERSION >= 0x06010000) - ss << "Windows 7/Windows Server 2008 R2"; -#elif (NTDDI_VERSION >= 0x05020200) - ss << "Windows Server 2003 SP2"; -#elif (NTDDI_VERSION >= 0x05010300) - ss << "Windows XP SP3"; -#else -#error This targetted Windows version is not supported -#endif // NTDDI_VERSION - return ss.str(); - } +#endif // defined(_WIN32) +#endif // !defined(_SCONS) - void printTargetMinOS() { - log() << "targetMinOS: " << targetMinOS(); - } -#endif // _WIN32 - - void printSysInfo() { - log() << "build info: " << sysInfo() << endl; - } - - void printAllocator() { - log() << "allocator: " << allocator() << endl; - } - - void appendBuildInfo(BSONObjBuilder& result) { - result << "version" << versionString - << "gitVersion" << gitVersion() -#if defined(_WIN32) - << "targetMinOS" << targetMinOS() -#endif - << "OpenSSLVersion" << openSSLVersion() - << "sysInfo" << sysInfo() - << "loaderFlags" << loaderFlags() - << "compilerFlags" << compilerFlags() - << "allocator" << allocator() - << "versionArray" << versionArray - << "javascriptEngine" << compiledJSEngine() -/*TODO: add this back once the module system is in place -- maybe once we do something like serverstatus with callbacks*/ -// << "interpreterVersion" << globalScriptEngine->getInterpreterVersionString() - << "bits" << ( sizeof( int* ) == 4 ? 32 : 64 ); - result.appendBool( "debug" , debug ); - result.appendNumber("maxBsonObjectSize", BSONObjMaxUserSize); - } -} +} // namespace mongo |