mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-22 17:57:46 +03:00
Bug #456: The build process should take into account the LDFLAGS environment variable
(cherry picked from commit cd8731e18f31d5cd375bc59af80f610b70a3dbc9)
This commit is contained in:
parent
350c08530c
commit
995094aca1
@ -123,8 +123,10 @@ else:
|
||||
|
||||
if not main_env.GetOption('clean'):
|
||||
try:
|
||||
main_env.ParseConfig('share/scons/get_xmlrpc_config server')
|
||||
main_env.ParseConfig('share/scons/get_xmlrpc_config client')
|
||||
main_env.ParseConfig(("LDFLAGS='%s' share/scons/get_xmlrpc_config"+
|
||||
" server") % (os.environ['LDFLAGS'],))
|
||||
main_env.ParseConfig(("LDFLAGS='%s' share/scons/get_xmlrpc_config"+
|
||||
" client") % (os.environ['LDFLAGS'],))
|
||||
|
||||
if mysql=='yes':
|
||||
main_env.ParseConfig('mysql_config --cflags --libs')
|
||||
|
@ -189,7 +189,7 @@ Configs=[
|
||||
# Compiles test code with given arguments
|
||||
def compile(file, args)
|
||||
logfile="#{file}.log"
|
||||
command="g++ #{file} -o #{file}.out #{args} 1>>#{logfile} 2>&1"
|
||||
command="g++ #{file} -o #{file}.out #{ENV['LDFLAGS']} #{args} 1>>#{logfile} 2>&1"
|
||||
|
||||
open(logfile, "a") {|f|
|
||||
f.write(command+"\n")
|
||||
|
@ -16,6 +16,7 @@
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
import os
|
||||
Import('env')
|
||||
|
||||
lib_name='nebula_core'
|
||||
@ -63,6 +64,7 @@ if env['mysql']=='yes':
|
||||
|
||||
|
||||
if not env.GetOption('clean'):
|
||||
env.ParseConfig('../../share/scons/get_xmlrpc_config server')
|
||||
env.ParseConfig(("LDFLAGS='%s' ../../share/scons/get_xmlrpc_config"+
|
||||
" server") % (os.environ['LDFLAGS'],))
|
||||
|
||||
env.Program('oned.cc')
|
||||
|
@ -28,6 +28,19 @@ cwd=os.getcwd()
|
||||
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'])
|
||||
|
||||
# Add builders for flex and bison
|
||||
add_lex(main_env)
|
||||
add_bison(main_env)
|
||||
@ -70,7 +83,8 @@ 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')
|
||||
main_env.ParseConfig(("LDFLAGS='%s' ../../share/scons/get_xmlrpc_config"+
|
||||
" client") % (os.environ['LDFLAGS'],))
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# build lex/bison
|
||||
|
@ -77,7 +77,8 @@ 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')
|
||||
main_env.ParseConfig(("LDFLAGS='%s' ../../../../../share/scons/"+
|
||||
"get_xmlrpc_config client") % (os.environ['LDFLAGS'],))
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# build lex/bison
|
||||
|
@ -16,6 +16,7 @@
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
import os
|
||||
Import('env')
|
||||
|
||||
lib_name='scheduler_sched'
|
||||
@ -38,6 +39,7 @@ env.Append(LIBS=[
|
||||
])
|
||||
|
||||
if not env.GetOption('clean'):
|
||||
env.ParseConfig('../../../../share/scons/get_xmlrpc_config client')
|
||||
env.ParseConfig(("LDFLAGS='%s' ../../../../share/scons/get_xmlrpc_config"+
|
||||
" client") % (os.environ['LDFLAGS'],))
|
||||
|
||||
env.Program('mm_sched.cc')
|
||||
|
@ -72,8 +72,8 @@ 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')
|
||||
|
||||
main_env.ParseConfig(("LDFLAGS='%s' ../../../../../share/scons/"+
|
||||
"get_xmlrpc_config client") % (os.environ['LDFLAGS'],))
|
||||
#-------------------------------------------------------------------------------
|
||||
# build lex/bison
|
||||
#-------------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user