X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FSENFSCons.py;h=4c3f3b8626edb8444f7294da8b70c6eef575b76e;hb=28489b2b034740ce21bcce6f38b8fa1701948b03;hp=c8ff57c4efe5a39aa331b2fcf4b5d1c46d271ec3;hpb=7baaacae27c02c86ceda5c7ee41d3172d1e23ffa;p=senf.git diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index c8ff57c..4c3f3b8 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -137,6 +137,8 @@ def UseBoost(): opts.Add('BOOST_RUNTIME', 'The boost runtime to use', '') opts.Add('BOOST_DEBUG_RUNTIME', 'The boost debug runtime to use', '') opts.Add('BOOST_LIBDIR', 'The directory of the boost libraries', '') + opts.Add('BOOST_PREFIX', 'The prefix into which boost is installed', '') + opts.Add('BOOST_VERSION', 'The version of boost to use', '') Finalizer(FinalizeBoost) ## \brief Finalize Boost environment @@ -152,14 +154,26 @@ def FinalizeBoost(env): if runtime: runtime = "-" + runtime env['BOOST_VARIANT'] = "-" + env['BOOST_TOOLSET'] + runtime + if env['BOOST_VARIANT'] and env['BOOST_VERSION']: + env['BOOST_VARIANT'] = env['BOOST_VARIANT'] + '-%s' % env['BOOST_VERSION'].replace('.','_') + env['BOOSTTESTLIB'] = 'boost_unit_test_framework' + env['BOOST_VARIANT'] env['BOOSTREGEXLIB'] = 'boost_regex' + env['BOOST_VARIANT'] env['BOOSTFSLIB'] = 'boost_filesystem' + env['BOOST_VARIANT'] env['BOOSTIOSTREAMSLIB'] = 'boost_iostreams' + env['BOOST_VARIANT'] + if env['BOOST_PREFIX']: + env['BOOST_LIBDIR'] = os.path.join(env['BOOST_PREFIX'], 'lib') + env['BOOST_INCLUDES'] = os.path.join(env['BOOST_PREFIX'], + 'include/boost-%s' + % env['BOOST_VERSION'].replace('.','_')) + env.Append(LIBPATH = [ '$BOOST_LIBDIR' ], CPPPATH = [ '$BOOST_INCLUDES' ]) + if env['BOOST_LIBDIR']: + env.Append(ENV = { 'LD_LIBRARY_PATH': env['BOOST_LIBDIR'] }) + ## \brief Use STLPort as STL replacement if available # # Use STLPort as a replacement @@ -253,7 +267,7 @@ def MakeEnvironment(): # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails: # CPPDEFINES = [ '_GLIBCXX_DEBUG' ], env.Append(CXXFLAGS = [ '-O0', '-g' ], - CPPDEFINES = [ 'SENF_DEBUG' ], + CPPDEFINES = { 'SENF_DEBUG': ''}, LINKFLAGS = [ '-g', '-rdynamic' ]) env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ], @@ -317,7 +331,8 @@ def Test(env, sources, LIBS = [], OBJECTS = []): if compileTestSources: test.extend(env.CompileCheck(source = compileTestSources)) env.Alias('all_tests', test) - env.Alias(env.File('test'), test) + env.Command(env.File('test'), test, []) + #env.Alias(env.File('test'), test) ## \brief Build object files @@ -348,10 +363,10 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = [], no_includ if sources: obsources = [ source for source in sources - if not str(source).endswith('.o') ] + if type(source) is type('') and not source.endswith('.o') ] objects = [ source for source in sources - if str(source).endswith('.o') ] + if type(source) is not type('') or source.endswith('.o') ] if obsources: objects += env.Object(obsources) @@ -371,7 +386,8 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = [], no_includ # Hmm ... here I'd like to use an Alias instead of a file # however the alias does not seem to live in the subdirectory # which breaks 'scons -u test' - env.Alias(env.File('test'), test) + env.Command(env.File('test'), test, []) + #env.Alias(env.File('test'), test) return objects @@ -652,7 +668,7 @@ def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = [], no objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS) program = None if objects: - progEnv = env.Copy() + progEnv = env.Clone() progEnv.Prepend(LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ]) program = progEnv.ProgramNoScan(target=binary,source=objects+OBJECTS) env.Default(program)