X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2Fsenfutil.py;h=69f18e09159ad87f37e4d98ca3c8a7488909f6d8;hb=5443435c4c2b6e4386c5334b5b8358273f2bae93;hp=c704a1f9f4fa800de3d9395c06ce624a5b3023f4;hpb=925317c7f45c32b01ab9292023db3f372b74bf0f;p=senf.git diff --git a/senfscons/senfutil.py b/senfscons/senfutil.py index c704a1f..69f18e0 100644 --- a/senfscons/senfutil.py +++ b/senfscons/senfutil.py @@ -8,12 +8,18 @@ from SCons.Script import * # c) check for a local SENF, set options accordingly and update that SENF if needed def SetupForSENF(env): - env.Append( LIBS = [ 'senf', 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB' ], + env.Append( LIBS = [ 'senf', 'rt', '$BOOSTREGEXLIB', + '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB', + '$BOOSTFSLIB' ], BOOSTREGEXLIB = 'boost_regex', BOOSTIOSTREAMSLIB = 'boost_iostreams', + BOOSTSIGNALSLIB = 'boost_signals', + BOOSTFSLIB = 'boost_filesystem', CXXFLAGS = [ '-Wno-long-long', - '${"$CXXFLAGS_"+(final and "final" or "debug")}' ], - LINKFLAGS = [ '${"$LINKFLAGS_"+(final and "final" or "debug")}' ], + '${"$CXXFLAGS_"+(final and "final" or "debug")}', + '${profile and ("-g","-pg") or None}' ], + LINKFLAGS = [ '${"$LINKFLAGS_"+(final and "final" or "debug")}', + '${profile and "-pg" or None}' ], SENF_BUILDOPTS = [ '-j%s' % (env.GetOption('num_jobs') or "1") ], CXXFLAGS_debug = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS_debug = [ '-g', '-rdynamic' ], @@ -35,6 +41,8 @@ def SetupForSENF(env): opts.Add( 'LOGLEVELS', 'Special log levels. Syntax: |[]| ...', '${"$LOGLEVELS_"+(final and "final" or "debug")}' ) opts.Add( BoolOption('final', 'Build final (optimized) build', False) ) + opts.Add( BoolOption('debug', 'Link in debug symbols', False) ) + opts.Add( BoolOption('profile', 'Add profile information', False) ) opts.Update(env) if env.subst('$LOGLEVELS'): @@ -49,11 +57,13 @@ def SetupForSENF(env): print "\nUsing SENF in './senf'\n" env.Append( LIBPATH = [ 'senf' ], CPPPATH = [ 'senf/include' ], - SENF_BUILDOPTS = [ '${final and "final=1" or None}' ], + SENF_BUILDOPTS = [ '${final and "final=1" or None}', + '${debug and "debug=1" or None}', + '${profile and "profile=1" or None}' ], CPPDEFINES = [ '${not(final) and "SENF_DEBUG" or None}' ] ) - env.Default( - env.AlwaysBuild( - env.Command('senf/libsenf.a', [], [ 'scons -C %s $SENF_BUILDOPTS libsenf.a' % os.path.realpath('senf')]))) + #env.Default( + # env.AlwaysBuild( + # env.Command('senf/libsenf.a', [], [ 'scons -C %s $SENF_BUILDOPTS libsenf.a' % os.path.realpath('senf')]))) else: print '\nUsing global SENF\n'