Utils: Add singleton alive test member
[senf.git] / SConstruct
index fce3c2d..3ae0d5e 100644 (file)
@@ -140,9 +140,21 @@ if not logname:
 def configFilesOpts(target, source, env, for_signature):
     return [ '-I%s' % os.path.split(f)[1] for f in env['LOCAL_CONFIG_FILES'] ]
 
+# Options used to debug inlining:
+#
+# INLINE_OPTS = [ '-finline-limit=20000', '--param','large-function-growth=10000',
+#                 '--param', 'large-function-insns=10000', '--param','inline-unit-growth=10000',
+#                 '-fvisibility-inlines-hidden', '-fno-inline-functions', '-Winline' ]
+#
+# BEWARE: You need lots of ram to compile with these settings (approx 1G)
+#
+
+INLINE_OPTS = [ '-finline-limit=5000' ]
+
 env.Append(
    CPPPATH = [ '#/include' ],
-   LIBS = [ 'readline', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB' ],
+   CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long' ] + INLINE_OPTS,
+   LIBS = [ 'readline', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB' ],
    TEST_EXTRA_LIBS = [ '$BOOSTFSLIB' ],
    DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ],
    DOXY_HTML_XSL = '#/doclib/html-munge.xsl',
@@ -161,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"
 )