X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=SConstruct;h=3ae0d5eac4362940a380bc4a527e3de24d51e8dd;hb=9a074ebd4b82022bfe686b40de8db80927def2b8;hp=0e0f4d7d2e9aa107bfd30548e953bcc7882a9c3b;hpb=10985d71f77b627bc4da543d7114feb7c4529329;p=senf.git diff --git a/SConstruct b/SConstruct index 0e0f4d7..3ae0d5e 100644 --- a/SConstruct +++ b/SConstruct @@ -173,6 +173,21 @@ env.Append( 'config.hh', 'local_config.hh' ], ) +def parseLogOption(value): + stream, area, level = ( x.strip() for x in value.strip().split('|') ) + if stream : stream = ''.join('(%s)' % x for x in stream.split('::') ) + else : stream = '(_)' + 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' } ) + env.SetDefault( LIBSENF = "senf" )