From: g0dil Date: Fri, 21 Nov 2008 09:32:48 +0000 (+0000) Subject: Utils/Daemon: Remove now obsolete argv argument cast in unit test X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=e8217e1c096910e4cace3d22dbce9a257093ed18;p=senf.git Utils/Daemon: Remove now obsolete argv argument cast in unit test Add '-Wl,-S' to default build options to hugely increase link performance git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@969 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Utils/Daemon/Daemon.test.cc b/Utils/Daemon/Daemon.test.cc index 584761f..f3dfc1e 100644 --- a/Utils/Daemon/Daemon.test.cc +++ b/Utils/Daemon/Daemon.test.cc @@ -88,7 +88,7 @@ namespace { ::kill(::getpid(), SIGABRT); }; - int run(int argc, char ** argv) + int run(int argc, char const ** argv) { pid = ::fork(); if (pid < 0) throw senf::SystemException("::fork()"); @@ -124,7 +124,7 @@ BOOST_AUTO_UNIT_TEST(testDaemon) "--console-log=testDaemon.log", "--pid-file=testDaemon.pid" }; - SENF_CHECK_NO_THROW( BOOST_CHECK_EQUAL( run(sizeof(args)/sizeof(*args), const_cast(args)), 0 ) ); + SENF_CHECK_NO_THROW( BOOST_CHECK_EQUAL( run(sizeof(args)/sizeof(*args), args), 0 ) ); BOOST_CHECK( ! boost::filesystem::exists("invalid.log") ); BOOST_CHECK( ! boost::filesystem::exists("invalid.pid") ); 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' ],