# -*- 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)
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'),
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")
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
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:
#
'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' ],
)
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)
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)
// Custom includes
#include <boost/regex.hpp>
-#include "Console/Console.hh"
+#include "../Utils/Console/Console.hh"
//#include "ClockService.mpp"
#define prefix_
#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////////////////////////////////////////
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
+++ /dev/null
-# -*- python -*-
-
-Import('env')
-import SENFSCons
-
-###########################################################################
-
-env.Command(env.File('test'), '../test', [])
-
-SENFSCons.Doxygen(env)
// 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"
#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////////////////////////////////////////
###########################################################################
-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")
// 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()
// 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()
};
# 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()
#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()
# 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()
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");
}
#include <boost/scoped_ptr.hpp>
#include "Server.hh"
#include "../../Utils/Exception.hh"
-#include "../Scheduler.hh"
+#include "../../Scheduler/Scheduler.hh"
//#include "Readline.mpp"
///////////////////////////////hh.p////////////////////////////////////////
--- /dev/null
+# -*- 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)
#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"
// $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_
// 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:
SENFSCons.Lib( env,
library = 'Utils_Daemon',
sources = sources,
- LIBS = [ 'Scheduler', 'Socket', 'Utils' ] )
+ LIBS = [ 'Logger', 'Scheduler', 'Socket', 'Utils' ] )
SENFSCons.Doxygen(env)
#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_
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')
// Custom includes
#include <time.h>
#include "../Exception.hh"
+#include "../../Scheduler/ClockService.hh"
//#include "TimeSource.mpp"
#define prefix_
// Custom includes
#include <boost/cstdint.hpp>
#include <memory>
-#include "../../Scheduler/ClockService.hh"
+#include "../../config.hh"
//#include "TimeSource.mpp"
///////////////////////////////hh.p////////////////////////////////////////
namespace senf {
namespace log {
- typedef ClockService::clock_type time_type;
+ typedef config::time_type time_type;
/** \brief Log message time source abstract base class
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"))
#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)
// Custom includes
#include <boost/bind.hpp>
#include <boost/function.hpp>
+#include "../config.hh"
///////////////////////////////hh.p////////////////////////////////////////
# 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
-../../Scheduler/Console
\ No newline at end of file
+../../Utils/Console
\ No newline at end of file
// 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:
# \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
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
#\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):
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
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