diff options
-rw-r--r-- | SConstruct | 30 | ||||
-rw-r--r-- | client/clientOnly.cpp | 23 | ||||
-rw-r--r-- | db/database.h | 2 | ||||
-rw-r--r-- | stdafx.h | 2 | ||||
-rw-r--r-- | util/log.h | 2 |
5 files changed, 48 insertions, 11 deletions
diff --git a/SConstruct b/SConstruct index b4e4267af68..167582a82a4 100644 --- a/SConstruct +++ b/SConstruct @@ -25,9 +25,15 @@ env.Append( CPPPATH=[ "." ] ) boostLibs = [ "thread" , "filesystem" , "program_options" ] -commonFiles = Split( "stdafx.cpp db/jsobj.cpp db/json.cpp db/commands.cpp db/lasterror.cpp db/security.cpp " ) + Glob( "util/*.cpp" ) + Glob( "util/*.c" ) + Glob( "grid/*.cpp" ) + Glob( "client/*.cpp" ) +commonFiles = Split( "stdafx.cpp db/jsobj.cpp db/json.cpp db/commands.cpp db/lasterror.cpp db/security.cpp " ) +commonFiles += Glob( "util/*.cpp" ) + Glob( "util/*.c" ) + Glob( "grid/*.cpp" ) +commonFiles += Split( "client/connpool.cpp client/dbclient.cpp client/model.cpp" ) -coreDbFiles = Split( "db/query.cpp db/introspect.cpp db/btree.cpp db/clientcursor.cpp db/javajs.cpp db/tests.cpp db/repl.cpp db/btreecursor.cpp db/cloner.cpp db/namespace.cpp db/matcher.cpp db/dbcommands.cpp db/dbeval.cpp db/dbwebserver.cpp db/dbinfo.cpp db/dbhelpers.cpp db/instance.cpp db/pdfile.cpp db/cursor.cpp" ) +coreDbFiles = Split( "" ) + +serverOnlyFiles = Split( "db/query.cpp db/introspect.cpp db/btree.cpp db/clientcursor.cpp db/javajs.cpp db/tests.cpp db/repl.cpp db/btreecursor.cpp db/cloner.cpp db/namespace.cpp db/matcher.cpp db/dbcommands.cpp db/dbeval.cpp db/dbwebserver.cpp db/dbinfo.cpp db/dbhelpers.cpp db/instance.cpp db/pdfile.cpp db/cursor.cpp" ) + +allClientFiles = commonFiles + coreDbFiles + [ "client/clientOnly.cpp" ]; nix = False @@ -116,9 +122,14 @@ if nix: clientEnv = env.Clone(); clientEnv.Append( CPPPATH=["../"] ) -clientEnv.Append( LIBS=["unittest" , "libmongoclient.a"] ) +clientEnv.Append( LIBS=[ "libmongoclient.a"] ) clientEnv.Append( LIBPATH=["."] ) +testEnv = env.Clone() +testEnv.Append( CPPPATH=["../"] ) +testEnv.Append( LIBS=[ "unittest" , "libmongotestfiles.a" ] ) +testEnv.Append( LIBPATH=["."] ) + # SYSTEM CHECKS configure = env.Configure() @@ -128,24 +139,25 @@ configure = env.Configure() # main db target -Default( env.Program( "db/db" , commonFiles + coreDbFiles + [ "db/db.cpp" ] ) ) +Default( env.Program( "db/db" , commonFiles + coreDbFiles + serverOnlyFiles + [ "db/db.cpp" ] ) ) # tools -env.Program( "mongodump" , commonFiles + coreDbFiles + [ "tools/dump.cpp" ] ) -env.Program( "mongoimport" , commonFiles + coreDbFiles + [ "tools/import.cpp" ] ) +env.Program( "mongodump" , allClientFiles + [ "tools/dump.cpp" ] ) +env.Program( "mongoimport" , allClientFiles + [ "tools/import.cpp" ] ) # dbgrid -env.Program( "db/dbgrid" , commonFiles + Glob( "dbgrid/*.cpp" ) ) +env.Program( "db/dbgrid" , commonFiles + coreDbFiles + Glob( "dbgrid/*.cpp" ) ) # c++ library -env.Library( "mongoclient" , commonFiles + coreDbFiles ) +env.Library( "mongoclient" , allClientFiles ) +env.Library( "mongotestfiles" , commonFiles + coreDbFiles + serverOnlyFiles ) # examples clientEnv.Program( "firstExample" , [ "client/examples/first.cpp" ] ) clientEnv.Program( "secondExample" , [ "client/examples/second.cpp" ] ) # testing -clientEnv.Program( "test" , Glob( "dbtests/*.cpp" ) ) +testEnv.Program( "test" , Glob( "dbtests/*.cpp" ) ) clientEnv.Program( "clientTest" , [ "client/examples/clientTest.cpp" ] ) # ---- INSTALL ------- diff --git a/client/clientOnly.cpp b/client/clientOnly.cpp new file mode 100644 index 00000000000..eb5fec052da --- /dev/null +++ b/client/clientOnly.cpp @@ -0,0 +1,23 @@ + +#include <iostream> + +using namespace std; + +namespace mongo { + + const char * curNs = "in client mode"; + // Database* database = 0; + + void dbexit(int returnCode, const char *whyMsg ){ + cout << "dbexit called" << endl; + if ( whyMsg ) + cout << " b/c " << whyMsg << endl; + cout << "exiting" << endl; + exit( returnCode ); + } + + + string getDbContext(){ + return "in client only mode"; + } +} diff --git a/db/database.h b/db/database.h index 47bffbd62a6..fdb6f2f3ea8 100644 --- a/db/database.h +++ b/db/database.h @@ -130,4 +130,6 @@ private: bool _haveLogged; }; + extern Database *database; + } // namespace mongo @@ -256,7 +256,7 @@ typedef struct _OWS { } *OWS; class Database; -extern Database *database; + //extern Database *database; extern const char *curNs; /* for now, running on win32 means development not production -- diff --git a/util/log.h b/util/log.h index 4024f49be7c..06ab76758c8 100644 --- a/util/log.h +++ b/util/log.h @@ -93,7 +93,7 @@ public: boostlock lk(mutex); cout << now; - if ( withNs && database && curNs ) + if ( withNs && /*database && */curNs ) cout << curNs << ' '; return *this; } |