INLINE_OPTS_NORMAL = [ '-finline-limit=5000', '--param', 'inline-unit-growth=60' ],
INLINE_OPTS = [ '$INLINE_OPTS_NORMAL' ],
CXXFLAGS = [ '-Wall', '-Woverloaded-virtual', '-Wno-long-long', '$INLINE_OPTS',
- '-pipe', '$CXXFLAGS_', '-fno-strict-aliasing' ],
+ '-pipe', '$CXXFLAGS_', '-fno-strict-aliasing',
+ "${profile and '-pg' or None}" ],
CXXFLAGS_final = [ '-O3' ],
CXXFLAGS_normal = [ '-O2', '-g' ],
CXXFLAGS_debug = [ '-O0', '-g' ],
CPPDEFINES_normal = [ 'SENF_DEBUG' ],
CPPDEFINES_debug = [ '$CPPDEFINES_normal' ],
- LINKFLAGS = [ '-rdynamic', '$LINKFLAGS_' ],
+ LINKFLAGS = [ '-rdynamic', '$LINKFLAGS_', "${profile and '-pg' or None}" ],
LINKFLAGS_final = [ ],
LINKFLAGS_normal = [ '-Wl,-S' ],
LINKFLAGS_debug = [ '-g' ],
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),
BoolVariable('syslayout', 'Install in to system layout directories (lib/, include/ etc)', False),
BoolVariable('sparse_tests', 'Link tests against object files and not the senf lib', False)
)