summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Morrow <acm@mongodb.com>2014-04-23 12:08:55 -0400
committerAndrew Morrow <acm@mongodb.com>2014-07-12 16:50:51 -0400
commitef4f60e3951929a7b16cf8920216310ecc58cc49 (patch)
tree8e7c6419f6399fcf65a27e3536ce8b43f7702d05 /src
parentf6a6dec8f14ef75980d1512bb6d5e30fab6b73db (diff)
downloadmongo-ef4f60e3951929a7b16cf8920216310ecc58cc49.tar.gz
SERVER-14343 leaner include paths
Diffstat (limited to 'src')
-rw-r--r--src/SConscript13
-rw-r--r--src/mongo/SConscript48
-rw-r--r--src/mongo/db/commands.cpp2
-rw-r--r--src/mongo/db/fts/SConscript4
-rw-r--r--src/mongo/db/matcher/expression_leaf.cpp7
-rw-r--r--src/mongo/db/matcher/expression_leaf.h9
-rw-r--r--src/mongo/db/pipeline/document_source_group.cpp2
-rw-r--r--src/mongo/db/pipeline/document_source_sort.cpp16
-rw-r--r--src/mongo/db/pipeline/expression.cpp4
-rw-r--r--src/mongo/db/pipeline/value_internal.h10
-rw-r--r--src/mongo/db/sorter/SConscript4
-rw-r--r--src/mongo/shell/bench.cpp2
-rw-r--r--src/mongo/shell/bench.h5
-rw-r--r--src/mongo/unittest/unittest_main.cpp2
-rw-r--r--src/mongo/util/net/hostandport.h2
-rw-r--r--src/mongo/util/options_parser/SConscript5
-rw-r--r--src/mongo/util/processinfo_darwin.cpp6
-rw-r--r--src/mongo/util/processinfo_linux2.cpp2
-rw-r--r--src/third_party/SConscript263
-rw-r--r--src/third_party/s2/SConscript3
-rw-r--r--src/third_party/v8-3.25/SConscript4
-rw-r--r--src/third_party/v8/SConscript4
22 files changed, 284 insertions, 133 deletions
diff --git a/src/SConscript b/src/SConscript
index 4245c9a1c5e..2dc6110008d 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -3,8 +3,13 @@
# This is the principle SConscript file, invoked by the SConstruct. Its job is
# to delegate to any and all per-module SConscript files.
-Import('module_sconscripts')
+Import('env module_sconscripts')
-SConscript(['mongo/SConscript',
- 'third_party/SConscript'] +
- module_sconscripts)
+env.SConscript(
+ [
+ # NOTE: We must do third_party first as it adds methods to the environment
+ # that we need in the mongo sconscript
+ 'third_party/SConscript',
+ 'mongo/SConscript',
+ ] + module_sconscripts
+)
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index d10096cd17c..066b9aa0836 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -7,8 +7,6 @@ import itertools
from buildscripts import utils
Import("env")
-Import("shellEnv")
-Import("testEnv")
Import("has_option")
Import("get_option")
Import("usev8")
@@ -16,6 +14,11 @@ Import("v8suffix")
Import("enforce_glibc")
Import("darwin windows solaris linux nix")
+# Boost we need everywhere. 's2' is spammed in all over the place by
+# db/geo unfortunately. pcre is also used many places.
+env.InjectThirdPartyIncludePaths(libraries=['boost', 's2', 'pcre'])
+env.InjectMongoIncludePaths()
+
env.SConscript(['base/SConscript',
'db/auth/SConscript',
'db/catalog/SConscript',
@@ -419,7 +422,9 @@ tcmallocServerStatus = []
if get_option('allocator') == 'tcmalloc':
tcmallocServerStatus.append("util/tcmalloc_server_status_section.cpp")
-env.Library("coredb", [
+coredbEnv = env.Clone()
+coredbEnv.InjectThirdPartyIncludePaths(libraries=['snappy'])
+coredbEnv.Library("coredb", [
"client/parallel.cpp",
"db/audit.cpp",
"db/commands.cpp",
@@ -516,11 +521,13 @@ env.CppUnitTest('bson_template_evaluator_test', ['scripting/bson_template_evalua
LIBDEPS=['bson_template_evaluator'])
if usev8:
- env.Library('scripting', scripting_common_files + ['scripting/engine_v8' + v8suffix + '.cpp',
- 'scripting/v8' + v8suffix + '_db.cpp',
- 'scripting/v8' + v8suffix + '_utils.cpp',
- 'scripting/v8' + v8suffix +
- '_profiler.cpp'],
+ scriptingEnv = env.Clone()
+ scriptingEnv.InjectThirdPartyIncludePaths(libraries=['v8'])
+ scriptingEnv.Library('scripting',
+ scripting_common_files + ['scripting/engine_v8' + v8suffix + '.cpp',
+ 'scripting/v8' + v8suffix + '_db.cpp',
+ 'scripting/v8' + v8suffix + '_utils.cpp',
+ 'scripting/v8' + v8suffix + '_profiler.cpp'],
LIBDEPS=['bson_template_evaluator', '$BUILD_DIR/third_party/shim_v8'])
else:
env.Library('scripting', scripting_common_files + ['scripting/engine_none.cpp'],
@@ -900,6 +907,8 @@ env.CppUnitTest('range_deleter_test',
'range_deleter',
])
+serveronlyEnv = env.Clone()
+serveronlyEnv.InjectThirdPartyIncludePaths(libraries=['snappy'])
serveronlyLibdeps = ["coreshard",
"db/auth/authmongod",
"db/fts/ftsmongod",
@@ -931,8 +940,8 @@ serveronlyLibdeps = ["coreshard",
if has_option("rocksdb" ):
serveronlyLibdeps.append( 'db/storage/rocks/storage_rocks' )
-env.Library("serveronly", serverOnlyFiles,
- LIBDEPS=serveronlyLibdeps )
+serveronlyEnv.Library("serveronly", serverOnlyFiles,
+ LIBDEPS=serveronlyLibdeps )
env.Library("message_server_port", "util/net/message_server_port.cpp")
@@ -1080,9 +1089,9 @@ env.Library('mocklib', [
],
LIBDEPS=['clientdriver'])
-test = testEnv.Install(
+test = env.Install(
'#/',
- testEnv.Program("dbtest",
+ env.Program("dbtest",
[ f for f in Glob("dbtests/*.cpp")
if not str(f).endswith('framework.cpp') and
not str(f).endswith('framework_options.cpp') and
@@ -1105,10 +1114,10 @@ test = testEnv.Install(
"$BUILD_DIR/mongo/db/repl/repl_coordinator_global",
"$BUILD_DIR/mongo/db/repl/replmocks"]))
-if len(testEnv.subst('$PROGSUFFIX')):
- testEnv.Alias( "dbtest", "#/${PROGPREFIX}dbtest${PROGSUFFIX}" )
+if len(env.subst('$PROGSUFFIX')):
+ env.Alias( "dbtest", "#/${PROGPREFIX}dbtest${PROGSUFFIX}" )
-env.Install( '#/', testEnv.Program( "perftest", [ "dbtests/perf/perftest.cpp" ], LIBDEPS=["serveronly", "coreserver", "coredb", "testframework" ] ) )
+env.Install( '#/', env.Program( "perftest", [ "dbtests/perf/perftest.cpp" ], LIBDEPS=["serveronly", "coreserver", "coredb", "testframework" ] ) )
# --- sniffer ---
mongosniff_built = False
@@ -1167,7 +1176,8 @@ coreShellFiles = [ "shell/bench.cpp",
"shell/mk_wcwidth.cpp",
"shell/shell_options_init.cpp" ]
-if shellEnv is not None:
+if not has_option('noshell'):
+
env.Library("shell_core", coreShellFiles,
LIBDEPS=['clientandshell',
'db/index/external_key_generator',
@@ -1179,6 +1189,10 @@ if shellEnv is not None:
env.Library("shell_options", ["shell/shell_options.cpp"],
LIBDEPS=['$BUILD_DIR/mongo/util/options_parser/options_parser_init'])
+ shellEnv = env.Clone()
+ if windows:
+ shellEnv.Append(LIBS=["winmm.lib"])
+
mongo_shell = shellEnv.Program(
"mongo",
"shell/dbshell.cpp",
@@ -1242,7 +1256,7 @@ installBinary( env, "mongod" )
installBinary( env, "mongos" )
if shellEnv is not None:
- installBinary( env, "mongo" )
+ installBinary( shellEnv, "mongo" )
env.Alias( "core", [ '#/%s' % b for b in [ add_exe( "mongo" ), add_exe( "mongod" ), add_exe( "mongos" ) ] ] )
diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp
index 01153cf5323..67a1f730f3b 100644
--- a/src/mongo/db/commands.cpp
+++ b/src/mongo/db/commands.cpp
@@ -29,7 +29,7 @@
* then also delete it in the license file.
*/
-#include "pch.h"
+#include "mongo/pch.h"
#include "mongo/db/commands.h"
diff --git a/src/mongo/db/fts/SConscript b/src/mongo/db/fts/SConscript
index c922c15d14c..4b063c62db4 100644
--- a/src/mongo/db/fts/SConscript
+++ b/src/mongo/db/fts/SConscript
@@ -24,7 +24,9 @@ env.Command( [ "stop_words_list.h", "stop_words_list.cpp"],
[ "generate_stop_words.py"] + [ 'stop_words_%s.txt' % x for x in stop_word_languages ],
"$PYTHON $SOURCES $TARGETS" )
-env.Library('base', [
+baseEnv=env.Clone()
+baseEnv.InjectThirdPartyIncludePaths(libraries=['stemmer'])
+baseEnv.Library('base', [
'fts_index_format.cpp',
'fts_matcher.cpp',
'fts_query.cpp',
diff --git a/src/mongo/db/matcher/expression_leaf.cpp b/src/mongo/db/matcher/expression_leaf.cpp
index dc2c3d10d6e..4d171ed0e89 100644
--- a/src/mongo/db/matcher/expression_leaf.cpp
+++ b/src/mongo/db/matcher/expression_leaf.cpp
@@ -30,6 +30,8 @@
#include "mongo/db/matcher/expression_leaf.h"
+#include <pcrecpp.h>
+
#include "mongo/bson/bsonobjiterator.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonmisc.h"
@@ -218,6 +220,11 @@ namespace mongo {
return options;
}
+ RegexMatchExpression::RegexMatchExpression()
+ : LeafMatchExpression( REGEX ) {}
+
+ RegexMatchExpression::~RegexMatchExpression() {}
+
bool RegexMatchExpression::equivalent( const MatchExpression* other ) const {
if ( matchType() != other->matchType() )
return false;
diff --git a/src/mongo/db/matcher/expression_leaf.h b/src/mongo/db/matcher/expression_leaf.h
index a6ca073f068..f7ceb72e361 100644
--- a/src/mongo/db/matcher/expression_leaf.h
+++ b/src/mongo/db/matcher/expression_leaf.h
@@ -30,14 +30,16 @@
#pragma once
-#include <pcrecpp.h>
-
#include <boost/scoped_ptr.hpp>
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonmisc.h"
#include "mongo/db/matcher/expression.h"
+namespace pcrecpp {
+ class RE;
+} // namespace pcrecpp;
+
namespace mongo {
/**
@@ -188,7 +190,8 @@ namespace mongo {
*/
static const size_t MaxPatternSize = 32764;
- RegexMatchExpression() : LeafMatchExpression( REGEX ){}
+ RegexMatchExpression();
+ ~RegexMatchExpression();
Status init( const StringData& path, const StringData& regex, const StringData& options );
Status init( const StringData& path, const BSONElement& e );
diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp
index 73f5e7cd11f..04c09bad97d 100644
--- a/src/mongo/db/pipeline/document_source_group.cpp
+++ b/src/mongo/db/pipeline/document_source_group.cpp
@@ -621,5 +621,5 @@ namespace mongo {
}
}
-#include "db/sorter/sorter.cpp"
+#include "mongo/db/sorter/sorter.cpp"
// Explicit instantiation unneeded since we aren't exposing Sorter outside of this file.
diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp
index 0a51b8b5b28..cbb18780cf1 100644
--- a/src/mongo/db/pipeline/document_source_sort.cpp
+++ b/src/mongo/db/pipeline/document_source_sort.cpp
@@ -26,15 +26,15 @@
* it in the license file.
*/
-#include "pch.h"
+#include "mongo/pch.h"
-#include "db/pipeline/document_source.h"
+#include "mongo/db/pipeline/document_source.h"
-#include "db/jsobj.h"
-#include "db/pipeline/document.h"
-#include "db/pipeline/expression.h"
-#include "db/pipeline/expression_context.h"
-#include "db/pipeline/value.h"
+#include "mongo/db/jsobj.h"
+#include "mongo/db/pipeline/document.h"
+#include "mongo/db/pipeline/expression.h"
+#include "mongo/db/pipeline/expression_context.h"
+#include "mongo/db/pipeline/value.h"
namespace mongo {
const char DocumentSourceSort::sortName[] = "$sort";
@@ -355,5 +355,5 @@ namespace mongo {
}
}
-#include "db/sorter/sorter.cpp"
+#include "mongo/db/sorter/sorter.cpp"
// Explicit instantiation unneeded since we aren't exposing Sorter outside of this file.
diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp
index 12f700a290e..342bab211f9 100644
--- a/src/mongo/db/pipeline/expression.cpp
+++ b/src/mongo/db/pipeline/expression.cpp
@@ -26,9 +26,9 @@
* it in the license file.
*/
-#include "pch.h"
+#include "mongo/pch.h"
-#include "db/pipeline/expression.h"
+#include "mongo/db/pipeline/expression.h"
#include <boost/algorithm/string.hpp>
#include <boost/preprocessor/cat.hpp> // like the ## operator but works with __LINE__
diff --git a/src/mongo/db/pipeline/value_internal.h b/src/mongo/db/pipeline/value_internal.h
index d124892282a..818c8c8454a 100644
--- a/src/mongo/db/pipeline/value_internal.h
+++ b/src/mongo/db/pipeline/value_internal.h
@@ -29,11 +29,11 @@
#pragma once
#include <algorithm>
-#include "bson/bsonobj.h"
-#include "bson/bsontypes.h"
-#include "bson/bsonmisc.h"
-#include "bson/oid.h"
-#include "util/intrusive_counter.h"
+#include "mongo/bson/bsonobj.h"
+#include "mongo/bson/bsontypes.h"
+#include "mongo/bson/bsonmisc.h"
+#include "mongo/bson/oid.h"
+#include "mongo/util/intrusive_counter.h"
#include "mongo/bson/optime.h"
diff --git a/src/mongo/db/sorter/SConscript b/src/mongo/db/sorter/SConscript
index 2379412b2ed..38ac55fafb8 100644
--- a/src/mongo/db/sorter/SConscript
+++ b/src/mongo/db/sorter/SConscript
@@ -1,3 +1,5 @@
Import("env")
-env.CppUnitTest('sorter_test', 'sorter_test.cpp', LIBDEPS=['$BUILD_DIR/third_party/shim_snappy'])
+sorterEnv = env.Clone()
+sorterEnv.InjectThirdPartyIncludePaths(libraries=['snappy'])
+sorterEnv.CppUnitTest('sorter_test', 'sorter_test.cpp', LIBDEPS=['$BUILD_DIR/third_party/shim_snappy'])
diff --git a/src/mongo/shell/bench.cpp b/src/mongo/shell/bench.cpp
index f85371ecefb..541716be1f3 100644
--- a/src/mongo/shell/bench.cpp
+++ b/src/mongo/shell/bench.cpp
@@ -32,6 +32,8 @@
#include "mongo/shell/bench.h"
+#include <pcrecpp.h>
+
#include <boost/thread/thread.hpp>
#include "mongo/db/namespace_string.h"
diff --git a/src/mongo/shell/bench.h b/src/mongo/shell/bench.h
index 83f674896bb..18784b4457d 100644
--- a/src/mongo/shell/bench.h
+++ b/src/mongo/shell/bench.h
@@ -33,13 +33,16 @@
#include <boost/shared_ptr.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/mutex.hpp>
-#include <pcrecpp.h>
#include "mongo/bson/util/atomic_int.h"
#include "mongo/client/dbclientinterface.h"
#include "mongo/db/jsobj.h"
#include "mongo/util/timer.h"
+namespace pcrecpp {
+ class RE;
+} // namespace pcrecpp;
+
namespace mongo {
/**
diff --git a/src/mongo/unittest/unittest_main.cpp b/src/mongo/unittest/unittest_main.cpp
index 608d630a96c..831ea4be49c 100644
--- a/src/mongo/unittest/unittest_main.cpp
+++ b/src/mongo/unittest/unittest_main.cpp
@@ -30,7 +30,7 @@
#include <string>
#include <vector>
-#include "base/initializer.h"
+#include "mongo/base/initializer.h"
#include "mongo/unittest/unittest.h"
#include "mongo/util/exception_filter_win32.h"
diff --git a/src/mongo/util/net/hostandport.h b/src/mongo/util/net/hostandport.h
index 14125e41f49..16a2f01b2b9 100644
--- a/src/mongo/util/net/hostandport.h
+++ b/src/mongo/util/net/hostandport.h
@@ -30,7 +30,7 @@
#include <iosfwd>
#include <string>
-#include "bson/util/builder.h"
+#include "mongo/bson/util/builder.h"
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
diff --git a/src/mongo/util/options_parser/SConscript b/src/mongo/util/options_parser/SConscript
index 7e22ee43b62..dfa3df31bfb 100644
--- a/src/mongo/util/options_parser/SConscript
+++ b/src/mongo/util/options_parser/SConscript
@@ -2,7 +2,10 @@
Import("env")
-env.Library('options_parser', ['environment.cpp',
+optsEnv = env.Clone()
+optsEnv.InjectThirdPartyIncludePaths(libraries=['yaml'])
+
+optsEnv.Library('options_parser', ['environment.cpp',
'value.cpp',
'constraints.cpp',
'option_section.cpp',
diff --git a/src/mongo/util/processinfo_darwin.cpp b/src/mongo/util/processinfo_darwin.cpp
index 8948e124f8d..2c674f66322 100644
--- a/src/mongo/util/processinfo_darwin.cpp
+++ b/src/mongo/util/processinfo_darwin.cpp
@@ -28,9 +28,9 @@
*/
#include "mongo/pch.h"
-#include "processinfo.h"
-#include "log.h"
-#include <db/jsobj.h>
+#include "mongo/util/processinfo.h"
+#include "mongo/util/log.h"
+#include "mongo/db/jsobj.h"
#include <mach/vm_statistics.h>
#include <mach/task_info.h>
diff --git a/src/mongo/util/processinfo_linux2.cpp b/src/mongo/util/processinfo_linux2.cpp
index b5c0088fb21..53d1ab90b6d 100644
--- a/src/mongo/util/processinfo_linux2.cpp
+++ b/src/mongo/util/processinfo_linux2.cpp
@@ -37,7 +37,7 @@
#include "processinfo.h"
#include "boost/filesystem.hpp"
-#include <util/file.h>
+#include <mongo/util/file.h>
using namespace std;
diff --git a/src/third_party/SConscript b/src/third_party/SConscript
index dd899f75571..8ca97359bcc 100644
--- a/src/third_party/SConscript
+++ b/src/third_party/SConscript
@@ -2,101 +2,212 @@
Import("env use_system_version_of_library windows darwin usev8 v8suffix solaris boostSuffix")
-env.SConscript( [
- "murmurhash3/SConscript",
- "s2/SConscript",
- ] )
-env.Append(CPPPATH='$BUILD_DIR/third_party/s2')
+thirdPartyIncludePathMap = {
+ 'boost' : '#/src/third_party/boost' + boostSuffix,
+ 'gperftools' : '#/src/third_party/gperftools-2.2',
+ 'pcre' : '#/src/third_party/pcre-${PCRE_VERSION}',
+ 's2' : '#/src/third_party/s2',
+ 'snappy' : '#/src/third_party/snappy',
+ 'stemmer' : '#/src/third_party/libstemmer_c/include',
+ 'tz' : '#/src/third_party/tz',
+ 'v8' : '#/src/third_party/v8' + v8suffix + '/include',
+ 'yaml' : '#/src/third_party/yaml-cpp-0.5.1/include',
+}
+
+def injectAllThirdPartyIncludePaths(thisEnv):
+ thisEnv.AppendUnique(CPPPATH=thirdPartyIncludePathMap.values())
+
+def injectThirdPartyIncludePaths(thisEnv, libraries):
+ thisEnv.AppendUnique(CPPPATH=[thirdPartyIncludePathMap[lib] for lib in libraries])
+
+env.AddMethod(injectAllThirdPartyIncludePaths, 'InjectAllThirdPartyIncludePaths')
+env.AddMethod(injectThirdPartyIncludePaths, 'InjectThirdPartyIncludePaths')
+
+
+murmurEnv = env.Clone()
+murmurEnv.SConscript('murmurhash3/SConscript', exports={ 'env' : murmurEnv })
+
+
+s2Env = env.Clone()
+s2Env.InjectThirdPartyIncludePaths(libraries=['s2', 'boost'])
+s2Env.InjectMongoIncludePaths()
+s2Env.SConscript('s2/SConscript', exports={'env' : s2Env})
+
if use_system_version_of_library("pcre"):
- env.Library( "shim_pcrecpp", ['shim_pcrecpp.cc'],
- SYSLIBDEPS=[
- env['LIBDEPS_PCRE_SYSLIBDEP'],
- env['LIBDEPS_PCRECPP_SYSLIBDEP']
- ] )
+ pcreEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_PCRE_SYSLIBDEP'],
+ env['LIBDEPS_PCRECPP_SYSLIBDEP'],
+ ])
else:
- env.SConscript('pcre-${PCRE_VERSION}/SConscript')
- env.Library( "shim_pcrecpp", ['shim_pcrecpp.cc'],
- LIBDEPS=[ 'pcre-${PCRE_VERSION}/pcrecpp' ] )
+ pcreEnv = env.Clone()
+ pcreEnv.InjectThirdPartyIncludePaths(libraries=['pcre'])
+ pcreEnv.SConscript('pcre-${PCRE_VERSION}/SConscript', exports={ 'env' : pcreEnv })
+ pcreEnv = pcreEnv.Clone(
+ LIBDEPS=[
+ 'pcre-${PCRE_VERSION}/pcrecpp',
+ ])
+
+pcreEnv.Library(
+ target="shim_pcrecpp",
+ source=[
+ 'shim_pcrecpp.cc',
+ ])
+
+boostEnv = env
if use_system_version_of_library("boost"):
- if windows:
- # On Windows, we use the autolib feature of boost to link in the
- # libraries we need, so we can't use SCons to detect them at configure time.
- env.Library("shim_boost", ['shim_boost.cpp'])
- else:
- env.Library("shim_boost", ['shim_boost.cpp'],
- SYSLIBDEPS=[
- env['LIBDEPS_BOOST_PROGRAM_OPTIONS_SYSLIBDEP'],
- env['LIBDEPS_BOOST_FILESYSTEM_SYSLIBDEP'],
- env['LIBDEPS_BOOST_THREAD_SYSLIBDEP'],
- env['LIBDEPS_BOOST_SYSTEM_SYSLIBDEP']
- ] )
+ # On windows, we don't need the syslibdeps because autolib will select the right libraries
+ # for us automatically.
+ if not windows:
+ boostEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_BOOST_PROGRAM_OPTIONS_SYSLIBDEP'],
+ env['LIBDEPS_BOOST_FILESYSTEM_SYSLIBDEP'],
+ env['LIBDEPS_BOOST_THREAD_SYSLIBDEP'],
+ env['LIBDEPS_BOOST_SYSTEM_SYSLIBDEP'],
+ ])
else:
boostDirectory = 'boost' + boostSuffix
- env.SConscript(boostDirectory + '/SConscript')
- env.Library( "shim_boost", ['shim_boost.cpp'],
- LIBDEPS=[ boostDirectory + '/boost_program_options',
- boostDirectory + '/boost_filesystem',
- boostDirectory + '/boost_thread',
- boostDirectory + '/boost_system',
- ] )
+ boostEnv = env.Clone()
+ boostEnv.InjectThirdPartyIncludePaths(libraries=['boost'])
+ boostEnv.SConscript(boostDirectory + '/SConscript', exports={ 'env' : boostEnv })
+ boostEnv = boostEnv.Clone(
+ LIBDEPS=[
+ boostDirectory + '/boost_program_options',
+ boostDirectory + '/boost_filesystem',
+ boostDirectory + '/boost_thread',
+ boostDirectory + '/boost_system',
+ ])
+
+boostEnv.Library(
+ target="shim_boost",
+ source=[
+ 'shim_boost.cpp',
+ ])
+
if use_system_version_of_library("snappy"):
- env.Library("shim_snappy", ['shim_snappy.cpp'],
- SYSLIBDEPS=[
- env['LIBDEPS_SNAPPY_SYSLIBDEP']
- ] )
+ snappyEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_SNAPPY_SYSLIBDEP'],
+ ])
else:
- env.Append(CPPPATH='$BUILD_DIR/third_party/snappy')
- env.SConscript('snappy/SConscript')
- env.Library('shim_snappy', ['shim_snappy.cpp'], LIBDEPS=['snappy/snappy'])
+ snappyEnv = env.Clone()
+ snappyEnv.InjectThirdPartyIncludePaths(libraries=['snappy'])
+ snappyEnv.SConscript('snappy/SConscript', exports={ 'env' : snappyEnv })
+ snappyEnv = snappyEnv.Clone(
+ LIBDEPS=[
+ 'snappy/snappy',
+ ])
+
+snappyEnv.Library(
+ target="shim_snappy",
+ source=[
+ 'shim_snappy.cpp',
+ ])
+
if usev8:
if use_system_version_of_library("v8"):
- env.Library("shim_v8", ['shim_v8.cpp'], SYSLIBDEPS=[
- env['LIBDEPS_V8_SYSLIBDEP'] ])
+ v8Env = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_v8_SYSLIBDEP'],
+ ])
else:
- env.Append(CPPPATH='$BUILD_DIR/third_party/v8' + v8suffix + '/include')
- env.SConscript('v8' + v8suffix + '/SConscript')
- env.Library('shim_v8', ['shim_v8.cpp'], LIBDEPS=['v8' + v8suffix + '/v8'])
-
-if (GetOption("allocator") != "tcmalloc"):
- env.Library("shim_allocator", "shim_allocator.cpp")
-elif use_system_version_of_library("tcmalloc"):
- env.Library("shim_allocator", "shim_allocator.cpp",
- SYSLIBDEPS=[
- env['LIBDEPS_TCMALLOC_SYSLIBDEP']
- ] )
-else:
- env.SConscript('gperftools-2.2/SConscript')
- env.Library('shim_allocator', 'shim_allocator.cpp',
- LIBDEPS=['gperftools-2.2/tcmalloc_minimal'])
+ v8Env = env.Clone()
+ v8Env.InjectThirdPartyIncludePaths(libraries=['v8'])
+ v8Env.SConscript('v8' + v8suffix + '/SConscript', exports={'env' : v8Env })
+ v8Env = v8Env.Clone(
+ LIBDEPS=[
+ 'v8' + v8suffix + '/v8'
+ ])
+
+ v8Env.Library(
+ target="shim_v8",
+ source=[
+ 'shim_v8.cpp',
+ ])
+
+
+gperftoolsEnv = env
+if (GetOption("allocator") == "tcmalloc"):
+ if use_system_version_of_library("tcmalloc"):
+ gperftoolsEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_TCMALLOC_SYSLIBDEP'],
+ ])
+ else:
+ gperftoolsEnv = env.Clone()
+ gperftoolsEnv.InjectThirdPartyIncludePaths(libraries=['gperftools'])
+ gperftoolsEnv.InjectMongoIncludePaths()
+ gperftoolsEnv.SConscript('gperftools-2.2/SConscript', exports={ 'env' : gperftoolsEnv })
+ gperftoolsEnv = gperftoolsEnv.Clone(
+ LIBDEPS=[
+ 'gperftools-2.2/tcmalloc_minimal',
+ ])
+
+gperftoolsEnv.Library(
+ target="shim_allocator",
+ source=[
+ "shim_allocator.cpp",
+ ])
+
if use_system_version_of_library("stemmer"):
- env.Library("shim_stemmer", ['shim_stemmer.cpp'],
- SYSLIBDEPS=[
- env['LIBDEPS_STEMMER_SYSLIBDEP']
- ] )
+ stemmerEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_STEMMER_SYSLIBDEP'],
+ ])
else:
- env.SConscript('libstemmer_c/SConscript')
- env.Library("shim_stemmer", ['shim_stemmer.cpp'],
- LIBDEPS=['libstemmer_c/stemmer'])
+ stemmerEnv = env.Clone()
+ stemmerEnv.InjectThirdPartyIncludePaths(libraries=['stemmer'])
+ stemmerEnv.SConscript('libstemmer_c/SConscript', exports={ 'env' : stemmerEnv })
+ stemmerEnv = stemmerEnv.Clone(
+ LIBDEPS=[
+ 'libstemmer_c/stemmer',
+ ])
+
+stemmerEnv.Library(
+ target="shim_stemmer",
+ source=[
+ 'shim_stemmer.cpp'
+ ])
+
if use_system_version_of_library("yaml"):
- env.Library("shim_yaml", ['shim_yaml.cpp'],
- SYSLIBDEPS=[
- env['LIBDEPS_YAML_SYSLIBDEP']
- ] )
+ yamlEnv = env.Clone(
+ SYSLIBDEPS=[
+ env['LIBDEPS_YAML_SYSLIBDEP'],
+ ])
else:
- env.Append(CPPPATH='$BUILD_DIR/third_party/yaml-cpp-0.5.1/include')
- env.SConscript('yaml-cpp-0.5.1/SConscript')
- env.Library("shim_yaml", ['shim_yaml.cpp'],
- LIBDEPS=['yaml-cpp-0.5.1/yaml'])
+ yamlEnv = env.Clone()
+ yamlEnv.InjectThirdPartyIncludePaths(libraries=['yaml', 'boost'])
+ yamlEnv.SConscript('yaml-cpp-0.5.1/SConscript', exports={ 'env' : yamlEnv })
+ yamlEnv = yamlEnv.Clone(
+ LIBDEPS=[
+ 'yaml-cpp-0.5.1/yaml',
+ ])
+
+yamlEnv.Library(
+ target="shim_yaml",
+ source=[
+ 'shim_yaml.cpp',
+ ])
+
+tzEnv = env.Clone()
if solaris:
- env.Append(CPPPATH='$BUILD_DIR/third_party/tz')
- env.SConscript('tz/SConscript')
- env.Library('shim_tz', ['shim_tz.cpp'], LIBDEPS=['tz/tz'])
-else:
- env.Library('shim_tz', ['shim_tz.cpp'], LIBDEPS=[])
+ tzEnv.InjectThirdPartyIncludePaths(libraries=['tz'])
+ tzEnv.SConscript('tz/SConscript', exports={ 'env' : tzEnv })
+ tzEnv = tzEnv.Clone(
+ LIBDEPS=[
+ 'tz/tz',
+ ])
+
+tzEnv.Library(
+ target='shim_tz',
+ source=[
+ 'shim_tz.cpp',
+ ])
diff --git a/src/third_party/s2/SConscript b/src/third_party/s2/SConscript
index 4397cdf0f89..3c57cdb1d58 100644
--- a/src/third_party/s2/SConscript
+++ b/src/third_party/s2/SConscript
@@ -9,9 +9,8 @@ env.SConscript( [
"strings/SConscript",
"util/coding/SConscript",
"util/math/SConscript",
- ] )
+ ], exports={ 'env' : env })
-env.Append(CCFLAGS=['-Isrc/third_party/s2'])
env.Append(CCFLAGS=['-DDEBUG_MODE=false'])
# Clang warns about struct/class tag mismatch, but as long as this is
diff --git a/src/third_party/v8-3.25/SConscript b/src/third_party/v8-3.25/SConscript
index 73482e4e613..8b07efa709f 100644
--- a/src/third_party/v8-3.25/SConscript
+++ b/src/third_party/v8-3.25/SConscript
@@ -424,8 +424,8 @@ env = env.Clone()
# in addition, v8 source needs to compile with src/parser.h, which
# is being placed here earlier in the search path than windows sdk's
# Include/parser.h (v8 doesn't even use any of those header files)
-env['CPPPATH'].remove('$BUILD_DIR/third_party/v8-3.25/include')
-env.Prepend(CPPPATH='$BUILD_DIR/third_party/v8-3.25/src')
+env['CPPPATH'].remove('#/src/third_party/v8-3.25/include')
+env.Prepend(CPPPATH='#/src/third_party/v8-3.25/src')
# add v8 ccflags and cppdefines to environment if they're not already
# present
diff --git a/src/third_party/v8/SConscript b/src/third_party/v8/SConscript
index 3566bd63ffd..956bab19b38 100644
--- a/src/third_party/v8/SConscript
+++ b/src/third_party/v8/SConscript
@@ -354,8 +354,8 @@ env = env.Clone()
# in addition, v8 source needs to compile with src/parser.h, which
# is being placed here earlier in the search path than windows sdk's
# Include/parser.h (v8 doesn't even use any of those header files)
-env['CPPPATH'].remove('$BUILD_DIR/third_party/v8/include')
-env.Prepend(CPPPATH='$BUILD_DIR/third_party/v8/src')
+env['CPPPATH'].remove('#/src/third_party/v8/include')
+env.Prepend(CPPPATH='#/src/third_party/v8/src')
# add v8 ccflags and cppdefines to environment if they're not already
# present