Fix sample bootstrap senfutil.py (Examples/Sniffer/site_scons/senfutil.py)
[senf.git] / site_scons / senfutil.py
index 2b570d2..1a2d4a1 100644 (file)
@@ -205,15 +205,17 @@ def DefaultOptions(env):
         env,
         BoolVariable('final', 'Build final (optimized) build', False),
         BoolVariable('debug', 'Link in debug symbols', False),
+        BoolVariable('profile', 'compile and link with the profiling enabled option', False),
     )
 
     # Set nice default options
     env.Append(
-        CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual' ],
+        CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual',  "${profile and '-pg' or None}" ],
         CXXFLAGS_final   = [ '-O3' ],
         CXXFLAGS_normal  = [ '-O2', '-g' ],
         CXXFLAGS_debug   = [ '-O0', '-g' ],
 
+        LINKFLAGS        = [ "${profile and '-pg' or None}" ],
         LINKFLAGS_normal = [ '-Wl,-S' ],
         LINKFLAGS_debug  = [ '-g' ],
     )