summaryrefslogtreecommitdiff
path: root/SConscript.buildinfo
diff options
context:
space:
mode:
authorAndy Schwerin <Andy Schwerin schwerin@10gen.com>2012-03-07 12:09:42 -0500
committerAndy Schwerin <schwerin@10gen.com>2012-03-23 10:35:31 -0400
commitd67ce1cd31f6ea2e766d5c201ab5430735cbb3b8 (patch)
tree809d2a20ce0489d9f3fb5d390ea3a0f9686c9708 /SConscript.buildinfo
parentf9c8560b866b3b286dc67548cbb82975fd4add46 (diff)
downloadmongo-d67ce1cd31f6ea2e766d5c201ab5430735cbb3b8.tar.gz
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.
Diffstat (limited to 'SConscript.buildinfo')
-rw-r--r--SConscript.buildinfo45
1 files changed, 45 insertions, 0 deletions
diff --git a/SConscript.buildinfo b/SConscript.buildinfo
new file mode 100644
index 00000000000..3853adf2ba5
--- /dev/null
+++ b/SConscript.buildinfo
@@ -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)