Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 50 lines (37 sloc) 1.371 kb
d67ce1cd »
2012-03-07 SCons refactoring, cleans up building and testing the C++ client.
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):
09c5aff0 »
2012-07-05 discover and configure modules in db/modules/
34 git_version = buildscripts.utils.getGitVersion()
2716c546 »
2012-10-18 SERVER-7118 Change "mongo modules" to use SConscript files for modules.
35 if len(env["MONGO_MODULES"]):
36 git_version += " modules: " + ", ".join(env["MONGO_MODULES"])
09c5aff0 »
2012-07-05 discover and configure modules in db/modules/
37
38 contents = str(source[0]) % dict(git_version=git_version,
d67ce1cd »
2012-03-07 SCons refactoring, cleans up building and testing the C++ client.
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.