X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FSENFSCons.py;h=90a04ffb72f617ee5d1ab669b5945f3f86d7f4ae;hb=e8217e1c096910e4cace3d22dbce9a257093ed18;hp=4c3f3b8626edb8444f7294da8b70c6eef575b76e;hpb=2ffca72ed06b10829071cd1b28d9047ff735f929;p=senf.git diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index 4c3f3b8..90a04ff 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -72,6 +72,7 @@ def InitOpts(): opts.Add('EXTRA_DEFINES', 'Additional preprocessor defines', '') opts.Add('EXTRA_LIBS', 'Additional libraries to link against', '') opts.Add(SCons.Options.BoolOption('final','Enable optimization',0)) + opts.Add(SCons.Options.BoolOption('debug','Enable debug symbols in binaries',0)) opts.Add('PREFIX', 'Installation prefix', '/usr/local') opts.Add('LIBINSTALLDIR', 'Library install dir', '$PREFIX/lib') opts.Add('BININSTALLDIR', 'Executable install dir', '$PREFIX/bin') @@ -267,8 +268,11 @@ def MakeEnvironment(): # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails: # CPPDEFINES = [ '_GLIBCXX_DEBUG' ], env.Append(CXXFLAGS = [ '-O0', '-g' ], - CPPDEFINES = { 'SENF_DEBUG': ''}, - LINKFLAGS = [ '-g', '-rdynamic' ]) + CPPDEFINES = { 'SENF_DEBUG': ''}) + if env['debug']: + env.Append(LINKFLAGS = [ '-g', '-rdynamic' ]) + else: + env.Append(LINKFLAGS = [ '-Wl,-S', '-rdynamic' ]) env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ], LIBS = [ '$EXTRA_LIBS' ],