summaryrefslogtreecommitdiff
path: root/distsrc
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-01-28 10:50:08 -0500
committerEliot Horowitz <eliot@10gen.com>2011-01-28 10:50:08 -0500
commitaef67c542f2f27d3770db617c9d3c5231d2e233e (patch)
treeba20adac5cce05224490fe87b9399063d7653b6d /distsrc
parent6b94c09f48d4632158eff0018c4c8b4f687c3b5c (diff)
downloadmongo-aef67c542f2f27d3770db617c9d3c5231d2e233e.tar.gz
better c++ client scons file
Diffstat (limited to 'distsrc')
-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();