X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2Fsenfutil.py;fp=senfscons%2Fsenfutil.py;h=a2b1ce8b6f05c84c2d503c5cc064e9c50644a9f6;hb=a5428583d411aae9d768f55deea83b8a7abb25a1;hp=d1a2808dedf596e999b35206b2c28017b213094f;hpb=86b3d95df28c60c80ac852dc8356d814788366a7;p=senf.git diff --git a/senfscons/senfutil.py b/senfscons/senfutil.py index d1a2808..a2b1ce8 100644 --- a/senfscons/senfutil.py +++ b/senfscons/senfutil.py @@ -1,21 +1,18 @@ import os.path from SCons.Script import * -def setLogOption(env): - # Parse LOGLEVELS parameter - def parseLogOption(value): - stream, area, level = ( x.strip() for x in value.strip().split('|') ) - stream = ''.join('(%s)' % x for x in stream.split('::') ) - if area : area = ''.join( '(%s)' % x for x in area.split('::') ) - else : area = '(_)' - return '(( %s,%s,%s ))' % (stream,area,level) +def parseLogOption(value): + stream, area, level = ( x.strip() for x in value.strip().split('|') ) + stream = ''.join('(%s)' % x for x in stream.split('::') ) + if area : area = ''.join( '(%s)' % x for x in area.split('::') ) + else : area = '(_)' + return '((%s,%s,%s))' % (stream,area,level) - def expandLogOption(target, source, env, for_signature): - return ' '.join( parseLogOption(x) for x in env.subst('$LOGLEVELS').split() ) - - if env.subst('$LOGLEVELS'): - env.Append( expandLogOption=expandLogOption ) - env.Append( CPPDEFINES = { 'SENF_LOG_CONF': '$expandLogOption' } ) +def expandLogOption(target, source, env, for_signature): + if env.get('LOGLEVELS'): + return [ 'SENF_LOG_CONF="' + ''.join( parseLogOption(x) for x in env.subst('$LOGLEVELS').split() )+'"'] + else: + return [] ########################################################################### @@ -40,6 +37,9 @@ def SetupForSENF(env): SENF_BUILDOPTS = [ '-j%s' % (env.GetOption('num_jobs') or "1") ], CXXFLAGS_debug = [ '-O0', '-g', '-fno-inline' ], LINKFLAGS_debug = [ '-g', '-rdynamic' ], + + expandLogOption = expandLogOption, + CPPDEFINES = [ '$expandLogOptions' ], ) # Add command-line options: 'LOGLEVELS' and 'final' @@ -53,8 +53,6 @@ def SetupForSENF(env): env.Help(opts.GenerateHelpText(env)) - setLogOption(env) - # If we have a symbolic link (or directory) 'senf', we use it as our # senf repository if os.path.exists('senf'):