summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-11-19 12:40:23 -0500
committerEliot Horowitz <eliot@10gen.com>2009-11-19 12:40:23 -0500
commit9173ffaf11c89c1d0f89b6c1daef066b185b9f5e (patch)
tree9718da1f59213172db41191241b770b15a7eb648 /SConstruct
parent420a7e51f07a92e35d4c6c78358b974ad0e6b582 (diff)
downloadmongo-9173ffaf11c89c1d0f89b6c1daef066b185b9f5e.tar.gz
modules can configure themselves
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct36
1 files changed, 12 insertions, 24 deletions
diff --git a/SConstruct b/SConstruct
index d6013e13cd6..764be411ff2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -12,6 +12,7 @@
import os
import sys
+import imp
import types
import re
import shutil
@@ -185,13 +186,6 @@ AddOption( "--pg",
nargs=0,
action="store" )
-AddOption( "--snmp",
- dest="snmp",
- type="string",
- nargs=0,
- action="store" )
-
-
# --- environment setup ---
def removeIfInList( lst , thing ):
@@ -237,8 +231,6 @@ usesm = not GetOption( "usesm" ) is None
usev8 = not GetOption( "usev8" ) is None
usejvm = not GetOption( "usejvm" ) is None
-enableSNMP = GetOption( "snmp" ) is not None
-
env = Environment( MSVS_ARCH=msarch , tools = ["default", "gch"], toolpath = '.' )
if GetOption( "cxx" ) is not None:
env["CC"] = GetOption( "cxx" )
@@ -328,10 +320,18 @@ shardServerFiles += [ "client/quorum.cpp" ]
serverOnlyFiles += coreShardFiles + [ "s/d_logic.cpp" ]
serverOnlyFiles += [ "db/module.cpp" ] + Glob( "db/modules/*.cpp" )
+
+modules = []
+
for x in os.listdir( "db/modules/" ):
if x.find( "." ) >= 0:
continue
- serverOnlyFiles += Glob( "db/modules/" + x + "/*.cpp" )
+ print( "adding module: " + x )
+ modRoot = "db/modules/" + x + "/"
+ serverOnlyFiles += Glob( modRoot + "src/*.cpp" )
+ modBuildFile = modRoot + "build.py"
+ if os.path.exists( modBuildFile ):
+ modules += [ imp.load_module( "module_" + x , open( modBuildFile , "r" ) , modBuildFile , ( ".py" , "r" , imp.PY_SOURCE ) ) ]
allClientFiles = commonFiles + coreDbFiles + [ "client/clientOnly.cpp" , "client/gridfs.cpp" , "s/d_util.cpp" ];
@@ -618,7 +618,6 @@ def getGitVersion():
return open( f , 'r' ).read().strip()
def getSysInfo():
- import os, sys
if windows:
return "windows " + str( sys.getwindowsversion() )
else:
@@ -744,19 +743,8 @@ def doConfigure( myenv , needJava=True , needPcre=True , shell=False ):
removeIfInList( myenv["LIBS"] , "pcap" )
removeIfInList( myenv["LIBS"] , "wpcap" )
- if enableSNMP and conf.CheckCXXHeader( "net-snmp/net-snmp-config.h" ):
-
- snmplibs = [ "netsnmp" + x for x in [ "mibs" , "agent" , "helpers" , "" ] ]
-
- gotAll = True
- for x in snmplibs:
- if not myCheckLib(x):
- gotAll = False
- if gotAll:
- myenv.Append( CPPDEFINES=[ "_HAVESNMP" ] )
- else:
- for x in snmplibs:
- removeIfInList( myenv["LIBS"] , x )
+ for m in modules:
+ m.configure( conf , myenv )
# this is outside of usesm block so don't have to rebuild for java
if windows: