Move Console from Scheduler into Utils
g0dil [Fri, 19 Dec 2008 00:00:01 +0000 (00:00 +0000)]
Refactor build system to remove sub-library dependencies

git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1025 270642c3-0616-0410-b53a-bc976706d245

102 files changed:
HowTos/SConscript
PPI/SConscript
Packets/SConscript
SConstruct
Scheduler/ClockService.cc
Scheduler/ClockService.hh
Scheduler/Console/SConscript [deleted file]
Scheduler/EventManager.cc
Scheduler/EventManager.hh
Scheduler/SConscript
Utils/Console/Config.cc [moved from Scheduler/Console/Config.cc with 100% similarity]
Utils/Console/Config.cci [moved from Scheduler/Console/Config.cci with 100% similarity]
Utils/Console/Config.cti [moved from Scheduler/Console/Config.cti with 100% similarity]
Utils/Console/Config.hh [moved from Scheduler/Console/Config.hh with 100% similarity]
Utils/Console/Config.ih [moved from Scheduler/Console/Config.ih with 100% similarity]
Utils/Console/Config.test.cc [moved from Scheduler/Console/Config.test.cc with 100% similarity]
Utils/Console/ConfigFile.cc [moved from Scheduler/Console/ConfigFile.cc with 100% similarity]
Utils/Console/ConfigFile.cci [moved from Scheduler/Console/ConfigFile.cci with 100% similarity]
Utils/Console/ConfigFile.hh [moved from Scheduler/Console/ConfigFile.hh with 100% similarity]
Utils/Console/ConfigFile.ih [moved from Scheduler/Console/ConfigFile.ih with 100% similarity]
Utils/Console/ConfigFile.test.cc [moved from Scheduler/Console/ConfigFile.test.cc with 100% similarity]
Utils/Console/Console.hh [moved from Scheduler/Console/Console.hh with 100% similarity]
Utils/Console/Doxyfile [moved from Scheduler/Console/Doxyfile with 100% similarity]
Utils/Console/Example.dox [moved from Scheduler/Console/Example.dox with 100% similarity]
Utils/Console/Executor.cc [moved from Scheduler/Console/Executor.cc with 100% similarity]
Utils/Console/Executor.cci [moved from Scheduler/Console/Executor.cci with 100% similarity]
Utils/Console/Executor.hh [moved from Scheduler/Console/Executor.hh with 100% similarity]
Utils/Console/Executor.test.cc [moved from Scheduler/Console/Executor.test.cc with 100% similarity]
Utils/Console/LazyDirectory.cc [moved from Scheduler/Console/LazyDirectory.cc with 100% similarity]
Utils/Console/LazyDirectory.hh [moved from Scheduler/Console/LazyDirectory.hh with 100% similarity]
Utils/Console/Mainpage.dox [moved from Scheduler/Console/Mainpage.dox with 100% similarity]
Utils/Console/Node.cc [moved from Scheduler/Console/Node.cc with 100% similarity]
Utils/Console/Node.cci [moved from Scheduler/Console/Node.cci with 100% similarity]
Utils/Console/Node.cti [moved from Scheduler/Console/Node.cti with 100% similarity]
Utils/Console/Node.hh [moved from Scheduler/Console/Node.hh with 100% similarity]
Utils/Console/Node.ih [moved from Scheduler/Console/Node.ih with 100% similarity]
Utils/Console/Node.test.cc [moved from Scheduler/Console/Node.test.cc with 100% similarity]
Utils/Console/OverloadedCommand.cc [moved from Scheduler/Console/OverloadedCommand.cc with 100% similarity]
Utils/Console/OverloadedCommand.cci [moved from Scheduler/Console/OverloadedCommand.cci with 100% similarity]
Utils/Console/OverloadedCommand.cti [moved from Scheduler/Console/OverloadedCommand.cti with 100% similarity]
Utils/Console/OverloadedCommand.hh [moved from Scheduler/Console/OverloadedCommand.hh with 100% similarity]
Utils/Console/OverloadedCommand.test.cc [moved from Scheduler/Console/OverloadedCommand.test.cc with 100% similarity]
Utils/Console/Parse.cc [moved from Scheduler/Console/Parse.cc with 100% similarity]
Utils/Console/Parse.cci [moved from Scheduler/Console/Parse.cci with 100% similarity]
Utils/Console/Parse.hh [moved from Scheduler/Console/Parse.hh with 100% similarity]
Utils/Console/Parse.ih [moved from Scheduler/Console/Parse.ih with 100% similarity]
Utils/Console/Parse.test.cc [moved from Scheduler/Console/Parse.test.cc with 100% similarity]
Utils/Console/ParsedCommand.cc [moved from Scheduler/Console/ParsedCommand.cc with 100% similarity]
Utils/Console/ParsedCommand.cci [moved from Scheduler/Console/ParsedCommand.cci with 100% similarity]
Utils/Console/ParsedCommand.ct [moved from Scheduler/Console/ParsedCommand.ct with 97% similarity]
Utils/Console/ParsedCommand.cti [moved from Scheduler/Console/ParsedCommand.cti with 99% similarity]
Utils/Console/ParsedCommand.hh [moved from Scheduler/Console/ParsedCommand.hh with 99% similarity]
Utils/Console/ParsedCommand.ih [moved from Scheduler/Console/ParsedCommand.ih with 100% similarity]
Utils/Console/ParsedCommand.mpp [moved from Scheduler/Console/ParsedCommand.mpp with 100% similarity]
Utils/Console/ParsedCommand.test.cc [moved from Scheduler/Console/ParsedCommand.test.cc with 100% similarity]
Utils/Console/ProgramOptions.cc [moved from Scheduler/Console/ProgramOptions.cc with 100% similarity]
Utils/Console/ProgramOptions.cci [moved from Scheduler/Console/ProgramOptions.cci with 100% similarity]
Utils/Console/ProgramOptions.cti [moved from Scheduler/Console/ProgramOptions.cti with 100% similarity]
Utils/Console/ProgramOptions.hh [moved from Scheduler/Console/ProgramOptions.hh with 100% similarity]
Utils/Console/ProgramOptions.ih [moved from Scheduler/Console/ProgramOptions.ih with 100% similarity]
Utils/Console/ProgramOptions.test.cc [moved from Scheduler/Console/ProgramOptions.test.cc with 100% similarity]
Utils/Console/Readline.cc [moved from Scheduler/Console/Readline.cc with 98% similarity]
Utils/Console/Readline.cci [moved from Scheduler/Console/Readline.cci with 100% similarity]
Utils/Console/Readline.hh [moved from Scheduler/Console/Readline.hh with 99% similarity]
Utils/Console/SConscript [new file with mode: 0644]
Utils/Console/ScopedDirectory.cci [moved from Scheduler/Console/ScopedDirectory.cci with 100% similarity]
Utils/Console/ScopedDirectory.cti [moved from Scheduler/Console/ScopedDirectory.cti with 100% similarity]
Utils/Console/ScopedDirectory.hh [moved from Scheduler/Console/ScopedDirectory.hh with 100% similarity]
Utils/Console/ScopedDirectory.test.cc [moved from Scheduler/Console/ScopedDirectory.test.cc with 100% similarity]
Utils/Console/Server.cc [moved from Scheduler/Console/Server.cc with 100% similarity]
Utils/Console/Server.cci [moved from Scheduler/Console/Server.cci with 100% similarity]
Utils/Console/Server.hh [moved from Scheduler/Console/Server.hh with 99% similarity]
Utils/Console/Server.ih [moved from Scheduler/Console/Server.ih with 100% similarity]
Utils/Console/Server.test.cc [copied from Scheduler/Console/Server.test.cc with 100% similarity]
Utils/Console/Sysdir.cci [moved from Scheduler/Console/Sysdir.cci with 100% similarity]
Utils/Console/Sysdir.hh [moved from Scheduler/Console/Sysdir.hh with 100% similarity]
Utils/Console/Sysdir.ih [moved from Scheduler/Console/Sysdir.ih with 100% similarity]
Utils/Console/Traits.cc [moved from Scheduler/Console/Traits.cc with 100% similarity]
Utils/Console/Traits.cci [moved from Scheduler/Console/Traits.cci with 100% similarity]
Utils/Console/Traits.ct [moved from Scheduler/Console/Traits.ct with 100% similarity]
Utils/Console/Traits.cti [moved from Scheduler/Console/Traits.cti with 100% similarity]
Utils/Console/Traits.hh [moved from Scheduler/Console/Traits.hh with 100% similarity]
Utils/Console/Traits.ih [moved from Scheduler/Console/Traits.ih with 100% similarity]
Utils/Console/Traits.test.cc [moved from Scheduler/Console/Traits.test.cc with 100% similarity]
Utils/Console/Variables.cti [moved from Scheduler/Console/Variables.cti with 100% similarity]
Utils/Console/Variables.hh [moved from Scheduler/Console/Variables.hh with 100% similarity]
Utils/Console/Variables.ih [moved from Scheduler/Console/Variables.ih with 100% similarity]
Utils/Console/Variables.test.cc [moved from Scheduler/Console/Variables.test.cc with 100% similarity]
Utils/Console/main.test.cc [moved from Scheduler/Console/Server.test.cc with 88% similarity]
Utils/Console/testServer.cc [moved from Scheduler/Console/testServer.cc with 100% similarity]
Utils/Daemon/SConscript
Utils/Logger/IOStreamTarget.cc
Utils/Logger/SConscript
Utils/Logger/TimeSource.cc
Utils/Logger/TimeSource.hh
Utils/SConscript
Utils/impl/membind.hh
Utils/membind.hh
config.hh
include/senf/Console
include/senf/Console.hh
senfscons/SENFSCons.py

index 004509b..54a5098 100644 (file)
@@ -1,12 +1,12 @@
 # -*- python -*-
 
 Import('env')
-import SENFSCons, glob
+import SENFSCons, glob, sys
+sys.path.append(env.Dir('#/doclib').abspath)
+import yaptu
 
 ###########################################################################
 
-import yaptu
-
 HOWTOS = []
 for dox in sorted(glob.glob("*/Mainpage.dox")):
     title = ([None] + [ line.split('\\mainpage',1)[-1].strip() for line in file(dox)
index 6f021ce..1f4ac10 100644 (file)
@@ -15,7 +15,7 @@ SENFSCons.StandardTargets(env)
 SENFSCons.Lib(env,
              library = 'PPI',
              sources = sources,
-             LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ])
+             LIBS = [ 'Scheduler', 'Packets', 'Logger', 'Console', 'Socket', 'Utils' ])
 
 SENFSCons.Doxygen(env, extra_sources=[
     env.Dia2Png('scenario.dia'),
index c3b6dc1..287812c 100644 (file)
@@ -12,7 +12,7 @@ SENFSCons.StandardTargets(env)
 SENFSCons.Lib(env,
               library = 'Packets',
               sources = SENFSCons.GlobSources(),
-              LIBS = [ 'Utils' ])
+              LIBS = [ 'Logger', 'Scheduler', 'Socket', 'Utils' ])
 SENFSCons.Doxygen(env, extra_sources = [
     env.Dia2Png("structure.dia"),
     env.Dia2Png("MPEGDVBBundle/TLV.dia")
index d1b492c..5eee730 100644 (file)
@@ -68,43 +68,6 @@ def checkLocalConf(target, source, env):
         print
         return 1
 
-def getLibDepends(script):
-    # OUCH ...
-    return os.popen("perl -0777 -n -e '$,=\" \"; print $1=~m/'\"'\"'([^'\"'\"']*)'\"'\"'/g if /LIBS\s*=\s*\[([^\]]*)\]/' %s" % script).read().split()
-
-# Original topological sort code written by Ofer Faigon
-# (www.bitformation.com) and used with permission
-def topological_sort(items, partial_order):
-    """Perform topological sort.
-       items is a list of items to be sorted.
-       partial_order is a list of pairs. If pair (a,b) is in it, it means
-       that item a should appear before item b.
-       Returns a list of the items in one of the possible orders, or None
-       if partial_order contains a loop.
-    """
-    def add_node(graph, node):
-        if not graph.has_key(node):
-            graph[node] = [0] 
-    def add_arc(graph, fromnode, tonode):
-        graph[fromnode].append(tonode)
-        graph[tonode][0] = graph[tonode][0] + 1
-    graph = {}
-    for v in items:
-        add_node(graph, v)
-    for a,b in partial_order:
-        add_arc(graph, a, b)
-    roots = [node for (node,nodeinfo) in graph.items() if nodeinfo[0] == 0]
-    while len(roots) != 0:
-        root = roots.pop()
-        yield root
-        for child in graph[root][1:]:
-            graph[child][0] = graph[child][0] - 1
-            if graph[child][0] == 0:
-                roots.append(child)
-        del graph[root]
-    if len(graph.items()) != 0:
-        raise RuntimeError, "Loop detected in partial_order"
-
 ###########################################################################
 # Load utilities and setup libraries and configure build
 
@@ -137,8 +100,8 @@ logname = os.environ.get('LOGNAME')
 if not logname:
     logname = pwd.getpwuid(os.getuid()).pw_name
 
-def configFilesOpts(target, source, env, for_signature):
-    return [ '-I%s' % os.path.split(f)[1] for f in env['LOCAL_CONFIG_FILES'] ]
+def dpkgIgnoredFilesOpts(target, source, env, for_signature):
+    return [ '-I%s' % os.path.split(f)[1] for f in env.subst('$DPKG_IGNORED_FILES').split() ]
 
 # Options used to debug inlining:
 #
@@ -166,9 +129,10 @@ env.Append(
            'PATH' : os.environ.get('PATH')
          },
    LOCAL_CONFIG_FILES = [ 'Doxyfile.local', 'SConfig', 'local_config.hh' ],
-   CONFIG_FILES_OPTS = configFilesOpts,
+   DPKG_IGNORED_FILES = [ '$LOCAL_CONFIG_FILES', '.svn', '_tmplates' ],
+   DPKG_IGNORED_FILES_OPTS = dpkgIgnoredFilesOpts,
    CLEAN_PATTERNS = [ '*~', '#*#', '*.pyc', 'semantic.cache', '.sconsign', '.sconsign.dblite' ],
-   BUILDPACKAGE_COMMAND = "dpkg-buildpackage -us -uc -rfakeroot -I.svn -I_templates $CONFIG_FILES_OPTS",
+   BUILDPACKAGE_COMMAND = "dpkg-buildpackage -us -uc -rfakeroot $DPKG_IGNORED_FILES_OPTS",
    TOP_INCLUDES = [ 'Packets', 'PPI', 'Scheduler', 'Socket', 'Utils', 'Console',
                     'config.hh', 'local_config.hh' ],
 )
@@ -221,15 +185,8 @@ env.Clean('all', '.prepare-stamp')
 scripts = []
 dependencies = []
 
-for script in glob.glob("*/SConscript"):
-    depends = getLibDepends(script)
-    script = script.split('/',1)[0]
-    scripts.append(script)
-    dependencies += [ (dep, script) for dep in depends ]
+SConscript(glob.glob("*/SConscript"))
 
-for subdir in topological_sort(scripts, dependencies):
-    SConscript(os.path.join(subdir, "SConscript"))
-    
 SENFSCons.StandardTargets(env)
 SENFSCons.GlobalTargets(env)
 SENFSCons.Doxygen(env)
@@ -240,9 +197,7 @@ SENFSCons.DoxyXRef(env,
 SENFSCons.InstallIncludeFiles(env, [ 'config.hh' ])
 
 # Build combined library 'libsenf'
-libsenf = env.Library(
-    'senf${LIBADDSUFFIX}',
-    Flatten([ env.File(SENFSCons.LibPath(lib)).sources for lib in env['ALLLIBS'] ]))
+libsenf = env.Library(env['LIBSENF'], env['ALLOBJECTS'])
 env.Default(libsenf)
 env.Clean('all', libsenf)
 env.Alias('default', libsenf)
index 612a579..7bba90d 100644 (file)
@@ -28,7 +28,7 @@
 
 // Custom includes
 #include <boost/regex.hpp>
-#include "Console/Console.hh"
+#include "../Utils/Console/Console.hh"
 
 //#include "ClockService.mpp"
 #define prefix_
index 6067cec..68b4a44 100644 (file)
@@ -32,8 +32,9 @@
 #include <boost/date_time/posix_time/posix_time.hpp>
 #include <boost/scoped_ptr.hpp>
 #include <boost/cstdint.hpp>
+#include "../config.hh"
 #include "../Utils/singleton.hh"
-#include "Console/Parse.hh"
+#include "../Utils/Console/Parse.hh"
 
 //#include "ClockService.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -72,7 +73,7 @@ namespace senf {
             Unsigned integer type representing scheduler time. Scheduler time is measured in
             nanoseconds relative to some implementation defined reference time.
          */
-        typedef boost::int_fast64_t clock_type;
+        typedef config::time_type clock_type;
 
         /** \brief Supplementary integer type
 
diff --git a/Scheduler/Console/SConscript b/Scheduler/Console/SConscript
deleted file mode 100644 (file)
index 20e0cab..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-env.Command(env.File('test'), '../test', [])
-
-SENFSCons.Doxygen(env)
index 3f00cde..30ac6d2 100644 (file)
@@ -29,7 +29,7 @@
 // Custom includes
 #include <boost/format.hpp>
 #include "../Utils/membind.hh"
-#include "Console/Console.hh"
+#include "../Utils/Console/Console.hh"
 #include "FIFORunner.hh"
 
 //#include "EventManager.mpp"
index 3c156fe..7586556 100644 (file)
@@ -32,7 +32,7 @@
 #include "../boost/intrusive/ilist.hpp"
 #include "../boost/intrusive/ilist_hook.hpp"
 #include "../Utils/singleton.hh"
-#include "Console/LazyDirectory.hh"
+#include "../Utils/Console/LazyDirectory.hh"
 
 //#include "EventManager.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
index f9804fc..012f69e 100644 (file)
@@ -5,19 +5,12 @@ import SENFSCons
 
 ###########################################################################
 
-sources = SENFSCons.GlobSources(subdirs=[ 'Console' ], exclude=[ 'Console/testServer.cc' ])
+sources = SENFSCons.GlobSources()
 SENFSCons.StandardTargets(env)
 
 SENFSCons.Lib(env,
              library = 'Scheduler',
              sources = sources,
-             LIBS = [ 'Socket', 'Utils' ])
-
-SENFSCons.Binary(env, 'Console/testServer',
-                 sources = [ 'Console/testServer.cc' ],
-                 no_includes = True,
-                 LIBS = [ 'Scheduler', 'Socket', 'Utils' ])
+             LIBS = [ 'Logger', 'Scheduler', 'Console', 'Utils' ])
 
 SENFSCons.Doxygen(env)
-
-SConscript("Console/SConscript")
similarity index 97%
rename from Scheduler/Console/ParsedCommand.ct
rename to Utils/Console/ParsedCommand.ct
index b3acb01..61b6153 100644 (file)
@@ -34,7 +34,7 @@
 // senf::console::ParsedCommandOverload<FunctionTraits,n>
 
 #define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY,                       \
-                                         SENF_ABSOLUTE_INCLUDE_PATH(Scheduler/Console/ParsedCommand.mpp),   \
+                                         SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp),   \
                                          3))
 #include BOOST_PP_ITERATE()
 
similarity index 99%
rename from Scheduler/Console/ParsedCommand.cti
rename to Utils/Console/ParsedCommand.cti
index eeedd3a..c0d42a8 100644 (file)
@@ -69,7 +69,7 @@ prefix_ void senf::console::ParsedCommandOverloadBase::addParameter()
 // senf::console::ParsedCommandOverload<FunctionTraits,n>
 
 #define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY,                       \
-                                         SENF_ABSOLUTE_INCLUDE_PATH(Scheduler/Console/ParsedCommand.mpp),   \
+                                         SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp),   \
                                          2))
 #include BOOST_PP_ITERATE()
 
@@ -343,7 +343,7 @@ namespace detail {
     };
 
 #   define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY,                     \
-                                            SENF_ABSOLUTE_INCLUDE_PATH(Scheduler/Console/ParsedCommand.mpp), \
+                                            SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp), \
                                             4))
 #   include BOOST_PP_ITERATE()
 
similarity index 99%
rename from Scheduler/Console/ParsedCommand.hh
rename to Utils/Console/ParsedCommand.hh
index 4de6952..4d6cc0c 100644 (file)
@@ -183,7 +183,7 @@ namespace console {
 #ifndef DOXYGEN
 
 #   define BOOST_PP_ITERATION_PARAMS_1 (4, (0, SENF_CONSOLE_MAX_COMMAND_ARITY,                     \
-                                            SENF_ABSOLUTE_INCLUDE_PATH(Scheduler/Console/ParsedCommand.mpp), \
+                                            SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp), \
                                             1))
 #   include BOOST_PP_ITERATE()
 
@@ -492,7 +492,7 @@ namespace console {
 
 #       define BOOST_PP_ITERATION_PARAMS_1                                                        \
             (4, (1, BOOST_PARAMETER_MAX_ARITY,                                                    \
-                 SENF_ABSOLUTE_INCLUDE_PATH(Scheduler/Console/ParsedCommand.mpp),                 \
+                 SENF_ABSOLUTE_INCLUDE_PATH(Utils/Console/ParsedCommand.mpp),                 \
                  5))
 #       include BOOST_PP_ITERATE()
 
similarity index 98%
rename from Scheduler/Console/Readline.cc
rename to Utils/Console/Readline.cc
index 87efd87..4b7f724 100644 (file)
@@ -192,7 +192,8 @@ prefix_ void senf::console::detail::ReadlineClientReader::v_enablePrompt()
 
 prefix_ void senf::console::detail::ReadlineClientReader::v_translate(std::string & data)
 {
-    boost::replace_all(data, "\n", "\n\r");
+    boost::replace_all(data, "\n", "\r\n");
+    boost::replace_all(data, "\r", "\r\0");
     boost::replace_all(data, "\xff", "\xff\xff");
 }
 
similarity index 99%
rename from Scheduler/Console/Readline.hh
rename to Utils/Console/Readline.hh
index 2b6a672..7c26de6 100644 (file)
@@ -30,7 +30,7 @@
 #include <boost/scoped_ptr.hpp>
 #include "Server.hh"
 #include "../../Utils/Exception.hh"
-#include "../Scheduler.hh"
+#include "../../Scheduler/Scheduler.hh"
 
 //#include "Readline.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
diff --git a/Utils/Console/SConscript b/Utils/Console/SConscript
new file mode 100644 (file)
index 0000000..5386352
--- /dev/null
@@ -0,0 +1,16 @@
+# -*- python -*-
+
+Import('env')
+import SENFSCons
+
+###########################################################################
+
+sources = SENFSCons.GlobSources(exclude=['testServer.cc'])
+SENFSCons.StandardTargets(env)
+
+SENFSCons.Lib(env,
+             library = 'Console',
+             sources = sources,
+             LIBS = [ 'Socket', 'Scheduler', 'Utils' ])
+
+SENFSCons.Doxygen(env)
similarity index 99%
rename from Scheduler/Console/Server.hh
rename to Utils/Console/Server.hh
index dfd0cf3..ef38917 100644 (file)
@@ -34,8 +34,8 @@
 #include "../../Utils/intrusive_refcount.hh"
 #include "../../Socket/Protocols/INet/TCPSocketHandle.hh"
 #include "../../Socket/ServerSocketHandle.hh"
-#include "../Scheduler.hh"
-#include "../ReadHelper.hh"
+#include "../../Scheduler/Scheduler.hh"
+#include "../../Scheduler/ReadHelper.hh"
 #include "Parse.hh"
 #include "Executor.hh"
 #include "../../Socket/Protocols/INet/INetAddressing.hh"
similarity index 88%
rename from Scheduler/Console/Server.test.cc
rename to Utils/Console/main.test.cc
index 84599f0..c6b4f24 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 //
-// Copyright (C) 2008 
+// Copyright (C) 2006
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-/** \file
-    \brief Server.test unit tests */
+// Definition of non-inline non-template functions
 
-//#include "Server.test.hh"
-//#include "Server.test.ih"
+//#include "test.hh"
+//#include "test.ih"
 
 // Custom includes
-#include "Server.hh"
-
+#define BOOST_AUTO_TEST_MAIN
 #include "../../Utils/auto_unit_test.hh"
 #include <boost/test/test_tools.hpp>
 
 #define prefix_
 ///////////////////////////////cc.p////////////////////////////////////////
 
-BOOST_AUTO_UNIT_TEST(server)
-{}
 
 ///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_
@@ -45,9 +41,9 @@ BOOST_AUTO_UNIT_TEST(server)
 // Local Variables:
 // mode: c++
 // fill-column: 100
-// comment-column: 40
 // c-file-style: "senf"
 // indent-tabs-mode: nil
 // ispell-local-dictionary: "american"
 // compile-command: "scons -u test"
+// comment-column: 40
 // End:
index db6cfbe..2ca29de 100644 (file)
@@ -12,6 +12,6 @@ sources = SENFSCons.GlobSources()
 SENFSCons.Lib( env,
                library = 'Utils_Daemon',
                sources = sources,
-               LIBS = [ 'Scheduler', 'Socket', 'Utils' ] )
+               LIBS = [ 'Logger', 'Scheduler', 'Socket', 'Utils' ] )
 
 SENFSCons.Doxygen(env)
index 286f3ba..6441cf8 100644 (file)
@@ -33,6 +33,7 @@
 #include <boost/algorithm/string/trim.hpp>
 #include <boost/tokenizer.hpp>
 #include <boost/date_time/posix_time/posix_time.hpp>
+#include "../Scheduler/ClockService.hh"
 
 //#include "IOStreamTarget.mpp"
 #define prefix_
index 672c29b..c9e26fc 100644 (file)
@@ -11,8 +11,9 @@ SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
                                if ( f not in ('all_includes.hh','Logger.hh','SenfLog.hh')
                                     and not f.endswith('.test.hh') ) ])
 sources = SENFSCons.GlobSources()
-objects = SENFSCons.Objects( env, sources = sources, LIBS = [ 'Utils', 'Socket' ] )
+objects = SENFSCons.Lib( env,
+                         library = 'Logger',
+                         sources = sources,
+                         LIBS = [ 'Scheduler', 'Socket', 'Utils' ] )
 
 SENFSCons.Doxygen(env)
-
-Return('objects')
index 375cce6..f5baef9 100644 (file)
@@ -29,6 +29,7 @@
 // Custom includes
 #include <time.h>
 #include "../Exception.hh"
+#include "../../Scheduler/ClockService.hh"
 
 //#include "TimeSource.mpp"
 #define prefix_
index d6fa204..135230c 100644 (file)
@@ -29,7 +29,7 @@
 // Custom includes
 #include <boost/cstdint.hpp>
 #include <memory>
-#include "../../Scheduler/ClockService.hh"
+#include "../../config.hh"
 
 //#include "TimeSource.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -37,7 +37,7 @@
 namespace senf {
 namespace log {
 
-    typedef ClockService::clock_type time_type;
+    typedef config::time_type time_type;
 
     /** \brief Log message time source abstract base class
 
index a39e7f6..d17af8a 100644 (file)
@@ -14,16 +14,11 @@ if not os.path.exists("Logger/all_includes.hh"):
 sources, testSources = SENFSCons.GlobSources()
 objects = SENFSCons.Objects( env, sources = sources, testSources=testSources )
 
-for sc in glob.glob("*/SConscript"):
-    ob = SConscript(sc)
-    if ob : objects.extend(ob)
-
 lib = SENFSCons.Lib(env,
                     library = 'Utils',
-                    sources = objects,
-                    no_includes = True)
-
-SENFSCons.InstallSourceIncludes(env, Flatten([ lib, '.test.bin', 'Logger/.test.bin' ]))
+                    sources = objects)
 
 SENFSCons.Doxygen(env)
 SENFSCons.InstallIncludeFiles(env, [ 'Logger.hh', 'Daemon.hh' ])
+
+SConscript(glob.glob("*/SConscript"))
index fcf3eaf..3dad9bf 100644 (file)
@@ -27,7 +27,6 @@
 #include <boost/preprocessor/cat.hpp>
 #include <boost/preprocessor/repetition/enum_shifted.hpp>
 #include <boost/preprocessor/iteration/iterate.hpp>
-#include "../../config.hh"
 
 template <typename R, typename T>
 boost::function<R()> membind(R (T::* fn)(),scOBTYPE ob)
index 7429307..3ac24d3 100644 (file)
@@ -52,6 +52,7 @@
 // Custom includes
 #include <boost/bind.hpp>
 #include <boost/function.hpp>
+#include "../config.hh"
 
 ///////////////////////////////hh.p////////////////////////////////////////
 
index 976f691..a746626 100644 (file)
--- a/config.hh
+++ b/config.hh
 # define HH_config_ 1
 # 
 # // Custom includes
+# include <boost/cstdint.hpp>
 # 
 # ///////////////////////////////hh.p////////////////////////////////////////
-# 
+
+namespace senf {
+namespace config {
+
+    typedef boost::int_fast64_t time_type;
+
+}}
+
 # include "local_config.hh"
 #
 # ifndef SENF_ABSOLUTE_INCLUDE_PATH
index 47e3d9f..754ef40 120000 (symlink)
@@ -1 +1 @@
-../../Scheduler/Console
\ No newline at end of file
+../../Utils/Console
\ No newline at end of file
index 38936b1..95cf505 100644 (file)
@@ -20,7 +20,7 @@
 // Free Software Foundation, Inc.,
 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
-#include "Scheduler/Console/Console.hh"
+#include "Utils/Console/Console.hh"
 
 \f
 // Local Variables:
index b1bf0c4..edecb11 100644 (file)
@@ -330,12 +330,18 @@ def GlobalTargets(env):
 # \internal
 def LibPath(lib): return '${LOCALLIBDIR}/${LIBPREFIX}%s${LIBADDSUFFIX}${LIBSUFFIX}' % lib
 
+## \brief Add explicit test
+#
+# This target helper will add an explicit test. This is like a unit test but is
+# built directly against the completed library
+#
+# \ingroup target
 def Test(env, sources, LIBS = [], OBJECTS = []):
     test = [ env.BoostUnitTests(
         target = 'test',
         objects = [],
         test_sources = sources,
-        LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ],
+        LIBS = [ '$LIBSENF' ],
         OBJECTS = OBJECTS,
         DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) ]
     compileTestSources = [ src for src in sources
@@ -387,7 +393,7 @@ def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = [], no_includ
             target = 'test',
             objects = objects,
             test_sources = testSources,
-            LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ],
+            LIBS = [ '$LIBSENF' ],
             OBJECTS = OBJECTS,
             DEPENDS = [ env.File(LibPath(x)) for x in LIBS ]) ]
         compileTestSources = [ src for src in testSources
@@ -646,14 +652,10 @@ def DoxyXRef(env, docs=None,
 #\ingroup target
 def Lib(env, library, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
     objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
-    lib = None
     if objects:
-        lib = env.Library(env.File(LibPath(library)),objects)
-        env.Default(lib)
-        env.Append(ALLLIBS = library)
-        env.Alias('default', lib)
-        InstallWithSources(env, lib, '$LIBINSTALLDIR', sources, testSources, no_includes)
-    return lib
+        env.Append(ALLOBJECTS = objects)
+        InstallSourceIncludes(env, sources)
+    return objects
 
 ## \brief Build Object from multiple sources
 def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
@@ -663,7 +665,7 @@ def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = [], no
         ob = env.Command(target+"${OBJADDSUFFIX}${OBJSUFFIX}", objects, "ld -r -o $TARGET $SOURCES")
         env.Default(ob)
         env.Alias('default', ob)
-        InstallWithSources(env, ob, '$OBJINSTALLDIR', sources, testSources, no_includes)
+        InstallSourceIncludes(env, sources)
     return ob
 
 ## \brief Build executable
@@ -681,10 +683,10 @@ def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = [], no
     program = None
     if objects:
         progEnv = env.Clone()
-        progEnv.Prepend(LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ])
+        progEnv.Prepend(LIBS = [ '$LIBSENF' ])
         program = progEnv.ProgramNoScan(target=binary,source=objects+OBJECTS)
         env.Default(program)
-        env.Depends(program, [ env.File(LibPath(x)) for x in LIBS ])
+        env.Depends(program, [ '$LIBSENF' ])
         env.Alias('default', program)
         InstallWithSources(env, program, '$BININSTALLDIR', sources, testSources, no_includes)
     return program