Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 50 lines (37 sloc) 1.377 kB
d67ce1c SCons refactoring, cleans up building and testing the C++ client.
Andy Schwerin authored
1 # -*- mode: python; -*-
2
3 # This SConscript describes construction of buildinfo.cpp, which is independent of the
4 # build variant's target.
5
6 import os
7 import sys
8
9 import buildscripts.utils
10
11 Import('env windows')
12
13 def getSysInfo():
14 if windows:
15 return "windows " + str( sys.getwindowsversion() )
16 else:
17 return " ".join( os.uname() )
18
19 buildinfo_filename = '#build/buildinfo.cpp'
20
21 buildinfo_template = '''
22 #include <string>
23 #include <boost/version.hpp>
24
25 #include "mongo/util/version.h"
26
27 namespace mongo {
28 const char * gitVersion() { return "%(git_version)s"; }
29 std::string sysInfo() { return "%(sys_info)s BOOST_LIB_VERSION=" BOOST_LIB_VERSION ; }
30 } // namespace mongo
31 '''
32
33 def generate_buildinfo(env, target, source, **kw):
09c5aff discover and configure modules in db/modules/
Dan Crosta authored
34 git_version = buildscripts.utils.getGitVersion()
35 if env["MONGO_MODULES"]:
36 git_version += " modules: %s" % (", ".join(env["MONGO_MODULES"].keys()))
37
38 contents = str(source[0]) % dict(git_version=git_version,
d67ce1c SCons refactoring, cleans up building and testing the C++ client.
Andy Schwerin authored
39 sys_info=getSysInfo())
40 out = open(str(target[0]), 'wb')
41 try:
42 out.write(contents)
43 finally:
44 out.close()
45
46 env.Command(buildinfo_filename, Value(buildinfo_template), generate_buildinfo)
47 env.AlwaysBuild(buildinfo_filename)
48 env.Install('$BUILD_DIR/mongo', buildinfo_filename)
49 env.Install('$BUILD_DIR/client_build/mongo', buildinfo_filename)
Something went wrong with that request. Please try again.