mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
modules can configure themselves
This commit is contained in:
parent
420a7e51f0
commit
9173ffaf11
36
SConstruct
36
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:
|
||||
|
Loading…
Reference in New Issue
Block a user