0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-29 00:32:18 +01:00
mongodb/SConscript.buildinfo
Andy Schwerin d67ce1cd31 SCons refactoring, cleans up building and testing the C++ client.
This patch does the following:

1.) Remove pcre.h dependencies in the C++ client, and remove some other
unnecessary dependencies.
2.) Clean up how we build the client from the client source tarball, so it's
more like how we build it from the git repo / full source tarball.
3.) Fix up our "scons" so you only have to write "scons ." to build all of our
binaries, the binary archive (zip or tgz) and client source archive (zip or
tgz).
4.) Fix up SCons aliases "core", "tools", and "all".
5.) Let user specify the name of the client tarball via a SCons command line
switch.

Resolves SERVER-4231, SERVER-5255.
2012-03-23 10:35:31 -04:00

46 lines
1.2 KiB
Python

# -*- mode: python; -*-
# This SConscript describes construction of buildinfo.cpp, which is independent of the
# build variant's target.
import os
import sys
import buildscripts.utils
Import('env windows')
def getSysInfo():
if windows:
return "windows " + str( sys.getwindowsversion() )
else:
return " ".join( os.uname() )
buildinfo_filename = '#build/buildinfo.cpp'
buildinfo_template = '''
#include <string>
#include <boost/version.hpp>
#include "mongo/util/version.h"
namespace mongo {
const char * gitVersion() { return "%(git_version)s"; }
std::string sysInfo() { return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }
} // namespace mongo
'''
def generate_buildinfo(env, target, source, **kw):
contents = str(source[0]) % dict(git_version=buildscripts.utils.getGitVersion(),
sys_info=getSysInfo())
out = open(str(target[0]), 'wb')
try:
out.write(contents)
finally:
out.close()
env.Command(buildinfo_filename, Value(buildinfo_template), generate_buildinfo)
env.AlwaysBuild(buildinfo_filename)
env.Install('$BUILD_DIR/mongo', buildinfo_filename)
env.Install('$BUILD_DIR/client_build/mongo', buildinfo_filename)