2008-06-17 20:27:32 +04:00
import os
import sys
sys . path . append ( " ./share/scons " )
from lex_bison import *
# 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 ' ]
# Add builders for flex and bison
add_lex ( main_env )
add_bison ( main_env )
# Include dirs
main_env . Append ( CPPPATH = [
2008-07-10 15:24:48 +04:00
cwd + ' /include ' ,
2008-06-17 20:27:32 +04:00
] )
# Library dirs
main_env . Append ( LIBPATH = [
2008-07-10 15:24:48 +04:00
cwd + ' /src/common ' ,
cwd + ' /src/host ' ,
cwd + ' /src/mad ' ,
cwd + ' /src/nebula ' ,
cwd + ' /src/pool ' ,
cwd + ' /src/template ' ,
cwd + ' /src/vm ' ,
cwd + ' /src/vmm ' ,
cwd + ' /src/lcm ' ,
cwd + ' /src/tm ' ,
cwd + ' /src/dm ' ,
cwd + ' /src/im ' ,
cwd + ' /src/rm ' ,
2008-11-13 19:21:17 +03:00
cwd + ' /src/vnm ' ,
2008-06-17 20:27:32 +04:00
] )
# Compile flags
main_env . Append ( CPPFLAGS = [
2008-07-10 15:24:48 +04:00
" -g " ,
" -Wall "
2008-06-17 20:27:32 +04:00
] )
# Linking flags
main_env . Append ( LDFLAGS = [ " -g " ] )
#######################
# EXTRA CONFIGURATION #
#######################
# SQLITE
sqlite_dir = ARGUMENTS . get ( ' sqlite ' , ' none ' )
if sqlite_dir != ' none ' :
main_env . Append ( LIBPATH = [ sqlite_dir + " /lib " ] )
main_env . Append ( CPPPATH = [ sqlite_dir + " /include " ] )
# 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 " ] )
# build lex/bison
build_parsers = ARGUMENTS . get ( ' parsers ' , ' no ' )
if build_parsers == ' yes ' :
2008-07-10 15:24:48 +04:00
main_env . Append ( parsers = ' yes ' )
2008-06-17 20:27:32 +04:00
else :
2008-07-10 15:24:48 +04:00
main_env . Append ( parsers = ' no ' )
2008-09-30 20:07:51 +04:00
try :
main_env . ParseConfig ( ' share/scons/get_xmlrpc_config server ' )
2008-09-30 20:07:52 +04:00
main_env . ParseConfig ( ' share/scons/get_xmlrpc_config client ' )
2008-09-30 20:07:51 +04:00
except Exception , e :
print " "
print " Error searching for xmlrpc-c libraries. Please check this things: "
print " "
print " * You have installed development libraries for xmlrpc-c. One way to check "
print " this is calling xmlrpc-c-config that is provided with the development "
print " package. "
print " * Check that the version of xmlrpc-c is at least 1.06. You can do this also "
print " calling: "
print " $ xmlrpc-c-config --version "
2008-09-30 20:07:52 +04:00
print " * If all this requirements are already met please send log files located in "
print " .xmlrpc_test to the mailing list. "
print " "
2008-09-30 20:07:51 +04:00
exit ( - 1 )
2008-06-17 20:27:32 +04:00
# SCONS scripts to build
build_scripts = [
2008-10-20 18:44:16 +04:00
' src/client/SConstruct ' ,
2008-06-17 20:27:32 +04:00
' src/common/SConstruct ' ,
' src/template/SConstruct ' ,
' src/host/SConstruct ' ,
' src/mad/SConstruct ' ,
' src/nebula/SConstruct ' ,
' src/pool/SConstruct ' ,
' src/vm/SConstruct ' ,
' src/vmm/SConstruct ' ,
' src/lcm/SConstruct ' ,
' src/rm/SConstruct ' ,
' src/tm/SConstruct ' ,
' src/im/SConstruct ' ,
' src/dm/SConstruct ' ,
2008-11-13 19:21:17 +03:00
' src/scheduler/SConstruct ' ,
' src/vnm/SConstruct ' ,
2008-06-17 20:27:32 +04:00
]
for script in build_scripts :
env = main_env . Clone ( )
SConscript ( script , exports = ' env ' )