1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-08 21:17:43 +03:00

bug #456: Fix some environment issues

This commit is contained in:
Ruben S. Montero 2011-01-13 11:50:38 +01:00
parent ab60275af5
commit 265f03ac94
2 changed files with 7 additions and 51 deletions

View File

@ -39,6 +39,8 @@ if os.environ.has_key('CXXFLAGS'):
main_env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
main_env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
else:
os.environ['LDFLAGS']=""
# Add builders for flex and bison
add_lex(main_env)

View File

@ -24,35 +24,22 @@ 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']
# snippet borrowed from http://dev.gentoo.org/~vapier/scons-blows.txt
# makes scons aware of build related environment variables
if os.environ.has_key('CC'):
main_env['CC'] = os.environ['CC']
if os.environ.has_key('CFLAGS'):
main_env['CCFLAGS'] += SCons.Util.CLVar(os.environ['CFLAGS'])
if os.environ.has_key('CXX'):
main_env['CXX'] = os.environ['CXX']
if os.environ.has_key('CXXFLAGS'):
main_env['CXXFLAGS'] += SCons.Util.CLVar(os.environ['CXXFLAGS'])
if os.environ.has_key('LDFLAGS'):
main_env['LINKFLAGS'] += SCons.Util.CLVar(os.environ['LDFLAGS'])
# Environment that will be applied to each scons child set in the main SConstruct
Import('env')
main_env=env
# Add builders for flex and bison
add_lex(main_env)
add_bison(main_env)
# Include dirs
main_env.Append(CPPPATH=[
main_env.Replace(CPPPATH=[
cwd + '/include/',
cwd + '../../../include/'
])
# Library dirs
main_env.Append(LIBPATH=[
main_env.Replace(LIBPATH=[
cwd+'/src/xml',
cwd+'/src/pool',
cwd+'/src/sched',
@ -60,43 +47,10 @@ main_env.Append(LIBPATH=[
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(("LDFLAGS='%s' ../../share/scons/get_xmlrpc_config"+
" client") % (os.environ['LDFLAGS'],))
#-------------------------------------------------------------------------------
# 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
#-------------------------------------------------------------------------------