summaryrefslogtreecommitdiff
path: root/distsrc/client/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'distsrc/client/SConstruct')
-rw-r--r--distsrc/client/SConstruct49
1 files changed, 39 insertions, 10 deletions
diff --git a/distsrc/client/SConstruct b/distsrc/client/SConstruct
index e1a3c71bc8e..a97699eb95f 100644
--- a/distsrc/client/SConstruct
+++ b/distsrc/client/SConstruct
@@ -1,6 +1,7 @@
import os
+# options
AddOption( "--extrapath",
dest="extrapath",
type="string",
@@ -8,6 +9,15 @@ AddOption( "--extrapath",
action="store",
help="comma separated list of add'l paths (--extrapath /opt/foo/,/foo) static linking" )
+AddOption( "--prefix",
+ dest="prefix",
+ type="string",
+ nargs=1,
+ action="store",
+ default="/usr/local",
+ help="installation root" )
+
+
env = Environment()
def addExtraLibs( s ):
@@ -36,6 +46,7 @@ elif "linux2" == os.sys.platform:
if nix:
env.Append( CPPFLAGS=" -O3" )
+ env.Append( LIBS=["pthread"] )
if linux:
env.Append( LINKFLAGS=" -Wl,--as-needed -Wl,-zdefs " )
@@ -44,19 +55,37 @@ conf = Configure(env)
for lib in boostLibs:
if not conf.CheckLib("boost_%s-mt" % lib):
conf.CheckLib("boost_%s" % lib)
+
+dirs = [ "" , "bson/" , "bson/util/" ,
+ "client/" , "s/" , "shell/" ,
+ "db/" ,
+ "scripting/" ,
+ "util/" , "util/concurrency/" , "util/mongoutils/" ]
+
allClientFiles = []
-allClientFiles += Glob( "mongo/*.cpp" )
-allClientFiles += Glob( "mongo/bson/*.cpp" )
-allClientFiles += Glob( "mongo/client/*.cpp" )
-allClientFiles += Glob( "mongo/s/*.cpp" )
-allClientFiles += Glob( "mongo/shell/*.cpp" )
-allClientFiles += Glob( "mongo/db/*.cpp" )
-allClientFiles += Glob( "mongo/scripting/*.cpp" )
-allClientFiles += Glob( "mongo/util/*.cpp" )
+for x in dirs:
+ allClientFiles += Glob( "mongo/" + x + "*.cpp" )
allClientFiles += Glob( "mongo/util/*.c" )
-env.SharedLibrary( "mongoclient" , allClientFiles )
-env.Library( "mongoclient" , allClientFiles )
+libs = []
+libs += env.SharedLibrary( "mongoclient" , allClientFiles )
+libs += env.Library( "mongoclient" , allClientFiles )
+
+# install
+
+prefix = GetOption( "prefix" )
+
+for x in libs:
+ env.Install( prefix + "/lib/" , str(x) )
+
+for x in dirs:
+ x = "mongo/" + x
+ env.Install( prefix + "/include/" + x , Glob( x + "*.h" ) )
+
+env.Alias( "install" , prefix )
+
+
+# example setup
clientTests = []
clientEnv = env.Clone();