Skip to content

Commit

Permalink
SCons refactoring, cleans up building and testing the C++ client.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Andy Schwerin authored and Andy Schwerin committed Mar 23, 2012
1 parent f9c8560 commit d67ce1c
Show file tree
Hide file tree
Showing 43 changed files with 3,328 additions and 2,920 deletions.
45 changes: 45 additions & 0 deletions SConscript.buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- 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)
Loading

0 comments on commit d67ce1c

Please sign in to comment.