site_scons: support for clang/llvm
tho [Wed, 7 Dec 2011 13:58:47 +0000 (13:58 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1834 270642c3-0616-0410-b53a-bc976706d245

senf/Utils/Statistics.cc
senf/Utils/Statistics.cci
senf/Utils/Statistics.hh
senf/Utils/signalnames.cc
site_scons/senfutil.py

index 43cc39f..6513828 100644 (file)
@@ -233,6 +233,7 @@ prefix_ senf::Statistics::Statistics()
 }
 
 prefix_ void senf::Statistics::consoleList(std::ostream & os)
+    const
 {
     os << "RANK        WIN       MIN          AVG                   MAX\n";
     StatisticsBase::consoleList(0, os);
index 8e7b093..c833615 100644 (file)
@@ -143,6 +143,7 @@ prefix_ std::string senf::StatisticsBase::path()
 }
 
 prefix_ senf::StatisticsData senf::StatisticsBase::data()
+    const
 {
     return StatisticsData(min_, avg_, max_, dev_, 0);
 }
@@ -184,7 +185,7 @@ prefix_ void senf::Statistics::operator()(float min, float avg, float max, float
 
 prefix_ void senf::Statistics::operator()(StatisticsData const & data)
 {
-  enter(1, data.min, data.avg, data.max, data.stddev);
+    enter(1, data.min, data.avg, data.max, data.stddev);
 }
 
 prefix_ void senf::Statistics::operator()(float value, float dev)
index cdea0da..4d64692 100644 (file)
@@ -74,6 +74,7 @@ namespace senf {
     {
         typedef std::map<unsigned, Collector> Children;
 
+        // why we can't use ::__gnu_cxx::select2nd instead?!?!
         struct Transform {
             typedef Children::value_type & first_argument_type;
             typedef Collector & result_type;
@@ -229,10 +230,9 @@ namespace senf {
                                              \param[in] n size of sliding average window */
 
         //\}
-        StatisticsData data();      ///< Get the Statistics data as senf::StatisticsData
-                                    /**< Return a Statistic Data object containing values
-                                         from this instance.
-                                     */
+        StatisticsData data() const;    ///< Get the Statistics data as senf::StatisticsData
+                                        /**< Return a Statistic Data object containing values
+                                             from this instance. */
 
 
         //-////////////////////////////////////////////////////////////////////////
@@ -491,7 +491,7 @@ namespace senf {
 
         StatisticsBase::OutputProxy<Statistics> output(unsigned n = 1u);
 
-        void consoleList(std::ostream & os);
+        void consoleList(std::ostream & os) const;
         void consoleCollect(std::vector<unsigned> & ranks);
         boost::shared_ptr<senf::console::DirectoryNode> consoleOutput(
             std::vector<unsigned> & ranks, unsigned window);
index 7545e72..eee2635 100644 (file)
     \brief signalnames non-inline non-template implementation */
 
 #include "signalnames.hh"
-//#include "signalnames.ih"
 
 // Custom includes
-#include <boost/format.hpp>
 
-//#include "signalnames.mpp"
 #define prefix_
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -54,7 +51,6 @@ prefix_ std::string const & senf::signalName(int signal)
 
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 #undef prefix_
-//#include "signalnames.mpp"
 
 \f
 // Local Variables:
index 8216902..da24b19 100644 (file)
@@ -225,7 +225,9 @@ def DefaultOptions(env):
 
     # Set nice default options
     env.Append(
-        CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual',  "${profile and '-pg' or None}" ],
+        CXXFLAGS_CLANG   = [ '-Wno-unneeded-internal-declaration' ], # needed for BOOST_PARAMETER_KEYWORD
+        CXXFLAGS         = [ '-Wall', '-Woverloaded-virtual',  "${profile and '-pg' or None}",
+                             '${str(CXX).split("/")[-1] == "clang++" and "$CXXFLAGS_CLANG" or None}' ],
         CXXFLAGS_final   = [ '-O3', '-fno-threadsafe-statics', '-fno-stack-protector',
                                "${profile and ' ' or '-ffunction-sections'}" ],
         CXXFLAGS_normal  = [ '-O2', '-g' ],