diff options
author | Andy Schwerin <Andy Schwerin schwerin@10gen.com> | 2012-03-07 12:09:42 -0500 |
---|---|---|
committer | Andy Schwerin <schwerin@10gen.com> | 2012-03-23 10:35:31 -0400 |
commit | d67ce1cd31f6ea2e766d5c201ab5430735cbb3b8 (patch) | |
tree | 809d2a20ce0489d9f3fb5d390ea3a0f9686c9708 /src/SConscript.client | |
parent | f9c8560b866b3b286dc67548cbb82975fd4add46 (diff) | |
download | mongo-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 'src/SConscript.client')
-rw-r--r-- | src/SConscript.client | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/src/SConscript.client b/src/SConscript.client new file mode 100644 index 00000000000..cb62622808a --- /dev/null +++ b/src/SConscript.client @@ -0,0 +1,133 @@ +# -*- mode: python -*- + +# This SConscript describes build and install rules for the Mongo C++ driver and associated exmaple +# programs. + +Import('env clientEnv') + +clientSource = [ + 'mongo/bson/oid.cpp', + 'mongo/buildinfo.cpp', + 'mongo/client/clientAndShell.cpp', + 'mongo/client/clientOnly.cpp', + 'mongo/client/connpool.cpp', + 'mongo/client/dbclient.cpp', + 'mongo/client/dbclient_rs.cpp', + 'mongo/client/dbclientcursor.cpp', + 'mongo/client/distlock.cpp', + 'mongo/client/gridfs.cpp', + 'mongo/client/model.cpp', + 'mongo/client/syncclusterconnection.cpp', + 'mongo/db/jsobj.cpp', + 'mongo/db/json.cpp', + 'mongo/db/lasterror.cpp', + 'mongo/db/namespace.cpp', + 'mongo/db/nonce.cpp', + 'mongo/pch.cpp', + 'mongo/util/assert_util.cpp', + 'mongo/util/background.cpp', + 'mongo/util/base64.cpp', + 'mongo/util/concurrency/rwlockimpl.cpp', + 'mongo/util/concurrency/spin_lock.cpp', + 'mongo/util/concurrency/synchronization.cpp', + 'mongo/util/concurrency/task.cpp', + 'mongo/util/concurrency/thread_pool.cpp', + 'mongo/util/concurrency/vars.cpp', + 'mongo/util/debug_util.cpp', + 'mongo/util/file_allocator.cpp', + 'mongo/util/histogram.cpp', + 'mongo/util/intrusive_counter.cpp', + 'mongo/util/log.cpp', + 'mongo/util/md5.cpp', + 'mongo/util/md5main.cpp', + 'mongo/util/net/httpclient.cpp', + 'mongo/util/net/listen.cpp', + 'mongo/util/net/message.cpp', + 'mongo/util/net/message_port.cpp', + 'mongo/util/net/sock.cpp', + 'mongo/util/password.cpp', + 'mongo/util/ramlog.cpp', + 'mongo/util/signal_handlers.cpp', + 'mongo/util/stringutils.cpp', + 'mongo/util/text.cpp', + 'mongo/util/trace.cpp', + 'mongo/util/util.cpp', + ] + +exampleSourceMap = [ + ('firstExample', 'mongo/client/examples/first.cpp'), + ('rsExample', 'mongo/client/examples/rs.cpp'), + ('secondExample', 'mongo/client/examples/second.cpp'), + ('whereExample', 'mongo/client/examples/whereExample.cpp'), + ('authTest', 'mongo/client/examples/authTest.cpp'), + ('httpClientTest', 'mongo/client/examples/httpClientTest.cpp'), + ('bsondemo', 'mongo/bson/bsondemo/bsondemo.cpp'), + ('clientTest', 'mongo/client/examples/clientTest.cpp'), + ] + +clientHeaders = [] +for id in ["", + "util/", + "util/net/", + "util/mongoutils/", + "util/concurrency/", + "db/", + "db/stats/", + "db/repl/", + "db/ops/", + "client/", + "bson/", + "bson/util/", + "s/", + "scripting/"]: + clientHeaders.extend(Glob('mongo/%s/*.h' % id)) + clientHeaders.extend(Glob('mongo/%s/*.hpp' % id)) + +env.Install('#/', [ + env.Library('mongoclient', clientSource), + #env.SharedLibrary('mongoclient', clientSource), + ]) + +clientTests = clientEnv.Install('#/', [ + clientEnv.Program(target, [source]) for (target, source) in exampleSourceMap]) + +clientEnv.Alias('clientTests', clientTests, []) + +env.Install( + '#/', + env.Command('$CLIENT_ARCHIVE', + ['#buildscripts/make_archive.py', + '$CLIENT_SCONSTRUCT', + '$CLIENT_LICENSE', + 'SConscript.client', + '#buildscripts/make_archive.py', + clientSource, + clientHeaders, + [source for (target, source) in exampleSourceMap]], + '${PYTHON} ${SOURCES[0]} -o $TARGET ' + '--transform ${str(Dir(BUILD_DIR))}/client_build=$CLIENT_DIST_BASENAME/src ' + '--transform ${str(Dir(BUILD_DIR))}=$CLIENT_DIST_BASENAME/src ' + '--transform distsrc/client=$CLIENT_DIST_BASENAME ' + '--transform =$CLIENT_DIST_BASENAME/ ' + '${TEMPFILE(SOURCES[1:])}')) + +# install +prefix = GetOption("prefix") + +env.Install(prefix + "/lib", '${LIBPREFIX}mongoclient${LIBSUFFIX}') + +for x in ["", + "bson/", + "bson/util/", + "client/", + "s/", + "shell/", + "db/", + "scripting/", + "util/", + "util/concurrency/", + "util/mongoutils/", + "util/net/" ]: + env.Install(prefix + "/include/mongo/" + x, + [Glob('mongo/%s*.h' % x), Glob('mongo/%s*.hpp' % x)]) + |