1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

feature #457: Refactor Sconstruct files

This commit is contained in:
Ruben S. Montero 2011-01-27 23:12:48 +01:00
parent 43b4340177
commit 3433820b94
22 changed files with 71 additions and 426 deletions

View File

@ -96,6 +96,7 @@ sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes': if sqlite=='yes':
main_env.Append(sqlite='yes') main_env.Append(sqlite='yes')
main_env.Append(CPPFLAGS=["-DSQLITE_DB"]) main_env.Append(CPPFLAGS=["-DSQLITE_DB"])
main_env.Append(LIBS=['sqlite3'])
else: else:
main_env.Append(sqlite='no') main_env.Append(sqlite='no')
@ -104,13 +105,10 @@ mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes': if mysql=='yes':
main_env.Append(mysql='yes') main_env.Append(mysql='yes')
main_env.Append(CPPFLAGS=["-DMYSQL_DB"]) main_env.Append(CPPFLAGS=["-DMYSQL_DB"])
main_env.Append(LIBS=['mysqlclient'])
else: else:
main_env.Append(mysql='no') main_env.Append(mysql='no')
# Testing
testing=ARGUMENTS.get('testing', 'no')
# xmlrpc # xmlrpc
xmlrpc_dir=ARGUMENTS.get('xmlrpc', 'none') xmlrpc_dir=ARGUMENTS.get('xmlrpc', 'none')
if xmlrpc_dir!='none': if xmlrpc_dir!='none':
@ -187,17 +185,23 @@ build_scripts=[
'src/authm/SConstruct', 'src/authm/SConstruct',
] ]
# Testing
testing=ARGUMENTS.get('tests', 'no')
if testing=='yes': if testing=='yes':
main_env.Append(testing='yes')
main_env.ParseConfig('cppunit-config --cflags --libs')
main_env.Append(CPPPATH=[ main_env.Append(CPPPATH=[
cwd+'/include/test', cwd+'/include/test',
'/usr/include/cppunit/' '/usr/include/cppunit/' #not provided by cppunit-config command
]) ])
main_env.Append(LIBPATH=[ main_env.Append(LIBPATH=[
cwd+'/src/test', cwd+'/src/test',
]) ])
main_env.Append(LIBS=[ main_env.Append(LIBS=[
'nebula_test_common', 'nebula_test_common',
]) ])
@ -209,17 +213,16 @@ if testing=='yes':
'src/image/test/SConstruct', 'src/image/test/SConstruct',
'src/lcm/test/SConstruct', 'src/lcm/test/SConstruct',
'src/pool/test/SConstruct', 'src/pool/test/SConstruct',
'src/scheduler/src/pool/test/SConstruct',
'src/scheduler/src/xml/test/SConstruct',
'src/template/test/SConstruct', 'src/template/test/SConstruct',
'src/test/SConstruct', 'src/test/SConstruct',
'src/um/test/SConstruct', 'src/um/test/SConstruct',
'src/vm/test/SConstruct', 'src/vm/test/SConstruct',
'src/vnm/test/SConstruct', 'src/vnm/test/SConstruct',
]) ])
else:
main_env.Append(testing='no')
for script in build_scripts: for script in build_scripts:
env=main_env.Clone() env=main_env.Clone()
SConscript(script, exports='env') SConscript(script, exports='env')

View File

@ -17,7 +17,7 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_template', 'nebula_template',
'nebula_common', 'nebula_common',
'nebula_core', 'nebula_core',
@ -25,22 +25,7 @@ env.Append(LIBS=[
'nebula_authm', 'nebula_authm',
'nebula_sql', 'nebula_sql',
'nebula_log', 'nebula_log',
'cppunit', 'crypto'
'dl',
'pthread',
'ssl'
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.Program('test','AuthManagerTest.cc') env.Program('test','AuthManagerTest.cc')
#

View File

@ -17,12 +17,9 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_common', 'nebula_common',
'nebula_log', 'nebula_log',
'cppunit',
'dl',
'pthread'
]) ])
env.Program('test_sa','single_attribute.cc') env.Program('test_sa','single_attribute.cc')

View File

@ -26,8 +26,6 @@ source_files=[
'HookManagerDriver.cc' 'HookManagerDriver.cc'
] ]
test_names=[]
# Build library # Build library
env.StaticLibrary(lib_name, source_files) env.StaticLibrary(lib_name, source_files)

View File

@ -18,9 +18,8 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_core_test', 'nebula_core_test',
'nebula_host', 'nebula_host',
'nebula_vmm', 'nebula_vmm',
'nebula_im', 'nebula_im',
@ -36,21 +35,12 @@ env.Append(LIBS=[
'nebula_hm', 'nebula_hm',
'nebula_authm', 'nebula_authm',
'nebula_common', 'nebula_common',
'nebula_lcm',
'nebula_dm',
'nebula_sql', 'nebula_sql',
'nebula_log', 'nebula_log',
'crypto'
'nebula_lcm_dm',
'crypto',
'cppunit',
]) ])
# Sources to generate the library
if env['sqlite']=='yes':
env.Append(LIBS=['sqlite3'])
if env['mysql']=='yes':
env.Append(LIBS=['mysqlclient'])
env.Program('test','HostPoolTest.cc') env.Program('test','HostPoolTest.cc')
env.Program('test_hook','HostHookTest.cc') env.Program('test_hook','HostHookTest.cc')

View File

@ -26,8 +26,6 @@ source_files=[
'InformationManagerDriver.cc' 'InformationManagerDriver.cc'
] ]
test_names=[]
# Build library # Build library
env.StaticLibrary(lib_name, source_files) env.StaticLibrary(lib_name, source_files)

View File

@ -16,7 +16,7 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_image', 'nebula_image',
'nebula_um', 'nebula_um',
'nebula_vm', 'nebula_vm',
@ -27,25 +27,11 @@ env.Append(LIBS=[
'nebula_pool', 'nebula_pool',
'nebula_mad', 'nebula_mad',
'nebula_common', 'nebula_common',
'nebula_log',
'nebula_core', 'nebula_core',
'nebula_sql', 'nebula_sql',
'cppunit', 'nebula_log',
'dl', 'crypto'
'pthread',
'crypto',
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.Program('test','ImagePoolTest.cc') env.Program('test','ImagePoolTest.cc')

View File

@ -18,9 +18,8 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_core_test', 'nebula_core_test',
'nebula_host', 'nebula_host',
'nebula_vmm', 'nebula_vmm',
'nebula_im', 'nebula_im',
@ -38,18 +37,9 @@ env.Append(LIBS=[
'nebula_common', 'nebula_common',
'nebula_sql', 'nebula_sql',
'nebula_log', 'nebula_log',
'nebula_lcm',
'nebula_lcm_dm', 'nebula_dm',
'crypto'
'crypto',
'cppunit',
]) ])
# Sources to generate the library
if env['sqlite']=='yes':
env.Append(LIBS=['sqlite3'])
if env['mysql']=='yes':
env.Append(LIBS=['mysqlclient'])
env.Program('test','LifeCycleManagerTest.cc') env.Program('test','LifeCycleManagerTest.cc')

View File

@ -30,7 +30,7 @@ source_files=[
env.StaticLibrary(lib_name, source_files) env.StaticLibrary(lib_name, source_files)
# Build daemon # Build daemon
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_core', 'nebula_core',
'nebula_vmm', 'nebula_vmm',
'nebula_lcm', 'nebula_lcm',
@ -54,15 +54,4 @@ env.Append(LIBS=[
'crypto' 'crypto'
]) ])
# Sources to generate the library
if env['sqlite']=='yes':
env.Append(LIBS=['sqlite3'])
if env['mysql']=='yes':
env.Append(LIBS=['mysqlclient'])
if not env.GetOption('clean'):
env.ParseConfig('../../share/scons/get_xmlrpc_config server')
env.Program('oned.cc') env.Program('oned.cc')

View File

@ -21,30 +21,14 @@ env.Append(LIBPATH=[
'.' '.'
]) ])
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_pool', 'nebula_pool',
'nebula_common', 'nebula_common',
'nebula_log', 'nebula_log',
'nebula_core', 'nebula_core',
'nebula_sql', 'nebula_sql',
'cppunit',
'dl',
'pthread',
'test_object' 'test_object'
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.StaticLibrary('test_object', ['TestPoolSQL.cc', 'TestPoolSQL.h']) env.StaticLibrary('test_object', ['TestPoolSQL.cc', 'TestPoolSQL.h'])
env.Program('test','pool.cc') env.Program('test','pool.cc')

View File

@ -14,81 +14,24 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
Import('env')
import os import os
import sys
import shutil
sys.path.append("../../share/scons")
from lex_bison import *
# This is the absolute path where the project is located # This is the absolute path where the project is located
cwd=os.getcwd() cwd=os.getcwd()
# Environment that will be applied to each scons child
main_env=Environment()
main_env['ENV']['PATH']=os.environ['PATH']
# Add builders for flex and bison
add_lex(main_env)
add_bison(main_env)
# Include dirs # Include dirs
main_env.Append(CPPPATH=[ env.Append(CPPPATH=[
cwd + '/include/', cwd + '/include/',
cwd + '../../../include/'
]) ])
# Library dirs # Library dirs
main_env.Append(LIBPATH=[ env.Append(LIBPATH=[
cwd+'/src/xml', cwd+'/src/xml',
cwd+'/src/pool', cwd+'/src/pool',
cwd+'/src/sched', cwd+'/src/sched'
cwd+'/../log',
cwd+'/../common',
]) ])
# Compile flags
main_env.Append(CPPFLAGS=[
"-g",
"-Wall"
])
# Linking flags
main_env.Append(LINKFLAGS=['-g', '-pthread'])
################################################################################
# EXTRA CONFIGURATION
################################################################################
#-------------------------------------------------------------------------------
# xmlrpc
#-------------------------------------------------------------------------------
xmlrpc_dir=ARGUMENTS.get('xmlrpc', 'none')
if xmlrpc_dir!='none':
main_env.Append(LIBPATH=[xmlrpc_dir+"/lib"])
main_env.Append(CPPPATH=[xmlrpc_dir+"/include"])
main_env.ParseConfig('../../share/scons/get_xmlrpc_config client')
#-------------------------------------------------------------------------------
# build lex/bison
#-------------------------------------------------------------------------------
build_parsers=ARGUMENTS.get('parsers', 'no')
if build_parsers=='yes':
main_env.Append(parsers='yes')
else:
main_env.Append(parsers='no')
#-------------------------------------------------------------------------------
# libxml2
#-------------------------------------------------------------------------------
main_env.ParseConfig('xml2-config --libs --cflags')
################################################################################ ################################################################################
# SCONS scripts to build # SCONS scripts to build
################################################################################ ################################################################################
@ -99,6 +42,12 @@ build_scripts=[
'src/sched/SConstruct' 'src/sched/SConstruct'
] ]
if env['testing']=='yes':
build_scripts.extend([
'src/pool/test/SConstruct',
'src/xml/test/SConstruct',
])
for script in build_scripts: for script in build_scripts:
env=main_env.Clone() sched_env=env.Clone()
SConscript(script, exports='env') SConscript(script, exports='sched_env')

View File

@ -16,7 +16,7 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
Import('env') Import('sched_env')
lib_name='scheduler_pool' lib_name='scheduler_pool'
@ -27,4 +27,4 @@ source_files=[
'VirtualMachineXML.cc'] 'VirtualMachineXML.cc']
# Build library # Build library
env.StaticLibrary(lib_name, source_files) sched_env.StaticLibrary(lib_name, source_files)

View File

@ -14,47 +14,10 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
import os Import('sched_env')
import sys
import shutil
sys.path.append("../../../../../share/scons")
# This is the absolute path where the project is located
cwd=os.getcwd()
# Environment that will be applied to each scons child
main_env=Environment()
main_env['ENV']['PATH']=os.environ['PATH']
# Include dirs
main_env.Append(CPPPATH=[
cwd+'/../../../include',
cwd+'/../../../../../include',
'/usr/include/cppunit/'
])
# Library dirs
main_env.Append(LIBPATH=[
cwd+'/..',
cwd+'/../../xml',
cwd+'/../../../../log',
cwd+'/../../../../common',
cwd+'/../../../../test',
])
# Compile flags
main_env.Append(CPPFLAGS=[
"-g",
"-Wall",
"-Werror"
])
# Linking flags
main_env.Append(LDFLAGS=["-g"])
# Libraries # Libraries
main_env.Append(LIBS=[ sched_env.Prepend(LIBS=[
'cppunit',
'scheduler_xml', 'scheduler_xml',
'scheduler_pool', 'scheduler_pool',
'nebula_log', 'nebula_log',
@ -62,38 +25,5 @@ main_env.Append(LIBS=[
'nebula_test_common', 'nebula_test_common',
]) ])
main_env.Program('test_vm','VirtualMachineXMLTest.cc') sched_env.Program('test_vm','VirtualMachineXMLTest.cc')
main_env.Program('test_host','HostXMLTest.cc') sched_env.Program('test_host','HostXMLTest.cc')
################################################################################
# EXTRA CONFIGURATION
################################################################################
#-------------------------------------------------------------------------------
# xmlrpc
#-------------------------------------------------------------------------------
xmlrpc_dir=ARGUMENTS.get('xmlrpc', 'none')
if xmlrpc_dir!='none':
main_env.Append(LIBPATH=[xmlrpc_dir+"/lib"])
main_env.Append(CPPPATH=[xmlrpc_dir+"/include"])
main_env.ParseConfig('../../../../../share/scons/get_xmlrpc_config client')
#-------------------------------------------------------------------------------
# build lex/bison
#-------------------------------------------------------------------------------
build_parsers=ARGUMENTS.get('parsers', 'no')
if build_parsers=='yes':
main_env.Append(parsers='yes')
else:
main_env.Append(parsers='no')
#-------------------------------------------------------------------------------
# libxml2
#-------------------------------------------------------------------------------
main_env.ParseConfig('xml2-config --libs --cflags')

View File

@ -16,28 +16,23 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
Import('env') Import('sched_env')
lib_name='scheduler_sched' lib_name='scheduler_sched'
source_files=['Scheduler.cc'] source_files=['Scheduler.cc']
# Build library # Build library
env.StaticLibrary(lib_name, source_files) sched_env.StaticLibrary(lib_name, source_files)
# Build daemon # Build daemon
env.Append(LIBS=[ sched_env.Prepend(LIBS=[
'scheduler_sched', 'scheduler_sched',
'scheduler_pool', 'scheduler_pool',
'nebula_log', 'nebula_log',
'scheduler_xml', 'scheduler_xml',
'nebula_common', 'nebula_common',
'crypto', 'crypto',
'pthread'
]) ])
if not env.GetOption('clean'): sched_env.Program('mm_sched.cc')
env.ParseConfig('../../../../share/scons/get_xmlrpc_config client')
env.Program('mm_sched.cc')

View File

@ -16,27 +16,27 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
Import('env') Import('sched_env')
lib_name='scheduler_xml' lib_name='scheduler_xml'
if env['parsers']=='yes': if sched_env['parsers']=='yes':
# LEX # LEX
parser=env.Lex( parser=sched_env.Lex(
source='expr_parser.l' source='expr_parser.l'
) )
env.NoClean(parser) sched_env.NoClean(parser)
# BISON # BISON
parser=env.Bison( parser=sched_env.Bison(
source='expr_arith.y' source='expr_arith.y'
) )
env.NoClean(parser) sched_env.NoClean(parser)
parser=env.Bison( parser=sched_env.Bison(
source='expr_bool.y' source='expr_bool.y'
) )
env.NoClean(parser) sched_env.NoClean(parser)
source_files=['ObjectXML.cc', source_files=['ObjectXML.cc',
'Client.cc', 'Client.cc',
@ -45,4 +45,4 @@ source_files=['ObjectXML.cc',
'expr_arith.cc'] 'expr_arith.cc']
# Build library # Build library
env.StaticLibrary(lib_name, source_files) sched_env.StaticLibrary(lib_name, source_files)

View File

@ -14,83 +14,14 @@
# limitations under the License. # # limitations under the License. #
#--------------------------------------------------------------------------- # #--------------------------------------------------------------------------- #
import os Import('sched_env')
import sys
import shutil
sys.path.append("../../../../../share/scons")
# This is the absolute path where the project is located
cwd=os.getcwd()
# Environment that will be applied to each scons child
main_env=Environment()
main_env['ENV']['PATH']=os.environ['PATH']
# Include dirs
main_env.Append(CPPPATH=[
cwd+'/../../../include',
cwd+'/../../../../../include',
'/usr/include/cppunit/'
])
# Library dirs
main_env.Append(LIBPATH=[
cwd+'/../../../../common',
cwd+'/../../../../log',
'../',
cwd+'/../../../../test',
])
# Compile flags
main_env.Append(CPPFLAGS=[
"-g",
"-Wall",
"-Werror"
])
# Linking flags
main_env.Append(LDFLAGS=["-g"])
# Libraries # Libraries
main_env.Append(LIBS=[ sched_env.Prepend(LIBS=[
'cppunit',
'nebula_log', 'nebula_log',
'scheduler_xml', 'scheduler_xml',
'nebula_common', 'nebula_common',
'nebula_test_common', 'nebula_test_common',
]) ])
main_env.Program('test_xml','ObjectXMLTest.cc') sched_env.Program('test_xml','ObjectXMLTest.cc')
################################################################################
# EXTRA CONFIGURATION
################################################################################
#-------------------------------------------------------------------------------
# xmlrpc
#-------------------------------------------------------------------------------
xmlrpc_dir=ARGUMENTS.get('xmlrpc', 'none')
if xmlrpc_dir!='none':
main_env.Append(LIBPATH=[xmlrpc_dir+"/lib"])
main_env.Append(CPPPATH=[xmlrpc_dir+"/include"])
main_env.ParseConfig('../../../../../share/scons/get_xmlrpc_config client')
#-------------------------------------------------------------------------------
# build lex/bison
#-------------------------------------------------------------------------------
build_parsers=ARGUMENTS.get('parsers', 'no')
if build_parsers=='yes':
main_env.Append(parsers='yes')
else:
main_env.Append(parsers='no')
#-------------------------------------------------------------------------------
# libxml2
#-------------------------------------------------------------------------------
main_env.ParseConfig('xml2-config --libs --cflags')

View File

@ -30,4 +30,4 @@ if env['mysql']=='yes':
source_files.append('MySqlDB.cc') source_files.append('MySqlDB.cc')
# Build library # Build library
env.StaticLibrary(lib_name, source_files) env.StaticLibrary(lib_name, source_files)

View File

@ -21,22 +21,7 @@ env.Append(LIBS=[
'nebula_template', 'nebula_template',
'nebula_common', 'nebula_common',
'nebula_core', 'nebula_core',
'nebula_log', 'nebula_log'
'cppunit',
'dl',
'pthread'
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.Program('test','template.cc') env.Program('test','template.cc')
#

View File

@ -18,37 +18,18 @@
Import('env') Import('env')
# Build LCM and DM toguether in a lib
lib_name='nebula_lcm_dm'
# Sources to generate the library
source_files=[
'../lcm/LifeCycleManager.cc',
'../lcm/LifeCycleActions.cc',
'../lcm/LifeCycleStates.cc',
'../dm/DispatchManager.cc',
'../dm/DispatchManagerActions.cc',
'../dm/DispatchManagerStates.cc',
]
# Build library
env.StaticLibrary(lib_name, source_files)
# Build a modified Nebula lib # Build a modified Nebula lib
lib_name='nebula_core_test' lib_name='nebula_core_test'
# Sources to generate the library # Sources to generate the library
source_files=[ source_files=[
'Nebula.cc', 'Nebula.cc',
'NebulaTest.cc', 'NebulaTest.cc'
'../nebula/NebulaTemplate.cc',
] ]
# Build library # Build library
env.StaticLibrary(lib_name, source_files) env.StaticLibrary(lib_name, source_files)
# Build a modified Nebula lib # Build a modified Nebula lib
lib_name='nebula_test_common' lib_name='nebula_test_common'
@ -59,5 +40,3 @@ source_files=[
# Build library # Build library
env.StaticLibrary(lib_name, source_files) env.StaticLibrary(lib_name, source_files)

View File

@ -16,7 +16,7 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_um', 'nebula_um',
'nebula_pool', 'nebula_pool',
'nebula_log', 'nebula_log',
@ -25,21 +25,7 @@ env.Append(LIBS=[
'nebula_mad', 'nebula_mad',
'nebula_core', 'nebula_core',
'nebula_sql', 'nebula_sql',
'cppunit',
'dl',
'pthread',
'crypto' 'crypto'
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.Program('test','UserPoolTest.cc') env.Program('test','UserPoolTest.cc')

View File

@ -16,7 +16,7 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_um', 'nebula_um',
'nebula_vm', 'nebula_vm',
'nebula_hm', 'nebula_hm',
@ -30,22 +30,7 @@ env.Append(LIBS=[
'nebula_log', 'nebula_log',
'nebula_core', 'nebula_core',
'nebula_sql', 'nebula_sql',
'cppunit', 'crypto'
'dl',
'pthread',
'crypto',
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.Program('test','VirtualMachinePoolTest.cc') env.Program('test','VirtualMachinePoolTest.cc')

View File

@ -16,7 +16,7 @@
Import('env') Import('env')
env.Append(LIBS=[ env.Prepend(LIBS=[
'nebula_log', 'nebula_log',
'nebula_um', 'nebula_um',
'nebula_vnm', 'nebula_vnm',
@ -27,22 +27,7 @@ env.Append(LIBS=[
'nebula_core', 'nebula_core',
'nebula_common', 'nebula_common',
'nebula_sql', 'nebula_sql',
'cppunit', 'crypto'
'dl',
'pthread',
'crypto',
]) ])
sqlite=ARGUMENTS.get('sqlite', 'yes')
if sqlite=='yes':
env.Append(CPPFLAGS=["-DSQLITE_DB"])
env.Append(LIBS=[ 'sqlite3', ])
# MySQL
mysql=ARGUMENTS.get('mysql', 'no')
if mysql=='yes':
env.Append(CPPFLAGS=["-DMYSQL_DB"])
env.Append(LIBS=[ 'mysqlclient', ])
env.Program('test','VirtualNetworkPoolTest.cc') env.Program('test','VirtualNetworkPoolTest.cc')