Add libboost-signals library to build setup
[senf.git] / senfscons / senfutil.py
index ad80d8b..af58a20 100644 (file)
@@ -8,10 +8,16 @@ 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', 'iberty', 'boost_regex', 'boost_iostreams' ],
+    env.Append( LIBS           = [ 'senf', 'readline', 'rt', '$BOOSTREGEXLIB',
+                                   '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB' ],
+                BOOSTREGEXLIB  = 'boost_regex',
+                BOOSTIOSTREAMSLIB = 'boost_iostreams',
+                BOOSTSIGNALSLIB = 'boost_signals',
                 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' ],
@@ -21,7 +27,7 @@ def SetupForSENF(env):
     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 elts[1].split('::') )
+        if area : area = ''.join( '(%s)' % x for x in area.split('::') )
         else    : area = '(_)'
         return '(( %s,%s,%s ))' % (stream,area,level)
 
@@ -33,6 +39,8 @@ def SetupForSENF(env):
     opts.Add( 'LOGLEVELS', 'Special log levels. Syntax: <stream>|[<area>]|<level> ...',
               '${"$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'):
@@ -47,7 +55,9 @@ 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(