some clean-ups
[senf.git] / SConstruct
index 0e0f4d7..d1b492c 100644 (file)
@@ -154,7 +154,7 @@ INLINE_OPTS = [ '-finline-limit=5000' ]
 env.Append(
    CPPPATH = [ '#/include' ],
    CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long' ] + INLINE_OPTS,
-   LIBS = [ 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB' ],
+   LIBS = [ 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB' ],
    TEST_EXTRA_LIBS = [ '$BOOSTFSLIB' ],
    DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ],
    DOXY_HTML_XSL = '#/doclib/html-munge.xsl',
@@ -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"
 )
@@ -181,7 +196,7 @@ Export('env')
 
 # Create Doxyfile.local otherwise doxygen will barf on this non-existent file
 # Create it even when cleaning, to silence the doxygen builder warnings
-if not env.GetOption('clean') and not os.path.exists("Doxyfile.local"):
+if not os.path.exists("Doxyfile.local"):
     Execute(Touch("Doxyfile.local"))
 
 # Create local_config.h