From: g0dil Date: Fri, 19 Dec 2008 00:00:01 +0000 (+0000) Subject: Move Console from Scheduler into Utils X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=958bdb52c39fa39f4ef91cafd9628bcb4f85a03c Move Console from Scheduler into Utils 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 --- diff --git a/HowTos/SConscript b/HowTos/SConscript index 004509b..54a5098 100644 --- a/HowTos/SConscript +++ b/HowTos/SConscript @@ -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) diff --git a/PPI/SConscript b/PPI/SConscript index 6f021ce..1f4ac10 100644 --- a/PPI/SConscript +++ b/PPI/SConscript @@ -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'), diff --git a/Packets/SConscript b/Packets/SConscript index c3b6dc1..287812c 100644 --- a/Packets/SConscript +++ b/Packets/SConscript @@ -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") diff --git a/SConstruct b/SConstruct index d1b492c..5eee730 100644 --- a/SConstruct +++ b/SConstruct @@ -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) diff --git a/Scheduler/ClockService.cc b/Scheduler/ClockService.cc index 612a579..7bba90d 100644 --- a/Scheduler/ClockService.cc +++ b/Scheduler/ClockService.cc @@ -28,7 +28,7 @@ // Custom includes #include -#include "Console/Console.hh" +#include "../Utils/Console/Console.hh" //#include "ClockService.mpp" #define prefix_ diff --git a/Scheduler/ClockService.hh b/Scheduler/ClockService.hh index 6067cec..68b4a44 100644 --- a/Scheduler/ClockService.hh +++ b/Scheduler/ClockService.hh @@ -32,8 +32,9 @@ #include #include #include +#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 index 20e0cab..0000000 --- a/Scheduler/Console/SConscript +++ /dev/null @@ -1,10 +0,0 @@ -# -*- python -*- - -Import('env') -import SENFSCons - -########################################################################### - -env.Command(env.File('test'), '../test', []) - -SENFSCons.Doxygen(env) diff --git a/Scheduler/EventManager.cc b/Scheduler/EventManager.cc index 3f00cde..30ac6d2 100644 --- a/Scheduler/EventManager.cc +++ b/Scheduler/EventManager.cc @@ -29,7 +29,7 @@ // Custom includes #include #include "../Utils/membind.hh" -#include "Console/Console.hh" +#include "../Utils/Console/Console.hh" #include "FIFORunner.hh" //#include "EventManager.mpp" diff --git a/Scheduler/EventManager.hh b/Scheduler/EventManager.hh index 3c156fe..7586556 100644 --- a/Scheduler/EventManager.hh +++ b/Scheduler/EventManager.hh @@ -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//////////////////////////////////////// diff --git a/Scheduler/SConscript b/Scheduler/SConscript index f9804fc..012f69e 100644 --- a/Scheduler/SConscript +++ b/Scheduler/SConscript @@ -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") diff --git a/Scheduler/Console/Config.cc b/Utils/Console/Config.cc similarity index 100% rename from Scheduler/Console/Config.cc rename to Utils/Console/Config.cc diff --git a/Scheduler/Console/Config.cci b/Utils/Console/Config.cci similarity index 100% rename from Scheduler/Console/Config.cci rename to Utils/Console/Config.cci diff --git a/Scheduler/Console/Config.cti b/Utils/Console/Config.cti similarity index 100% rename from Scheduler/Console/Config.cti rename to Utils/Console/Config.cti diff --git a/Scheduler/Console/Config.hh b/Utils/Console/Config.hh similarity index 100% rename from Scheduler/Console/Config.hh rename to Utils/Console/Config.hh diff --git a/Scheduler/Console/Config.ih b/Utils/Console/Config.ih similarity index 100% rename from Scheduler/Console/Config.ih rename to Utils/Console/Config.ih diff --git a/Scheduler/Console/Config.test.cc b/Utils/Console/Config.test.cc similarity index 100% rename from Scheduler/Console/Config.test.cc rename to Utils/Console/Config.test.cc diff --git a/Scheduler/Console/ConfigFile.cc b/Utils/Console/ConfigFile.cc similarity index 100% rename from Scheduler/Console/ConfigFile.cc rename to Utils/Console/ConfigFile.cc diff --git a/Scheduler/Console/ConfigFile.cci b/Utils/Console/ConfigFile.cci similarity index 100% rename from Scheduler/Console/ConfigFile.cci rename to Utils/Console/ConfigFile.cci diff --git a/Scheduler/Console/ConfigFile.hh b/Utils/Console/ConfigFile.hh similarity index 100% rename from Scheduler/Console/ConfigFile.hh rename to Utils/Console/ConfigFile.hh diff --git a/Scheduler/Console/ConfigFile.ih b/Utils/Console/ConfigFile.ih similarity index 100% rename from Scheduler/Console/ConfigFile.ih rename to Utils/Console/ConfigFile.ih diff --git a/Scheduler/Console/ConfigFile.test.cc b/Utils/Console/ConfigFile.test.cc similarity index 100% rename from Scheduler/Console/ConfigFile.test.cc rename to Utils/Console/ConfigFile.test.cc diff --git a/Scheduler/Console/Console.hh b/Utils/Console/Console.hh similarity index 100% rename from Scheduler/Console/Console.hh rename to Utils/Console/Console.hh diff --git a/Scheduler/Console/Doxyfile b/Utils/Console/Doxyfile similarity index 100% rename from Scheduler/Console/Doxyfile rename to Utils/Console/Doxyfile diff --git a/Scheduler/Console/Example.dox b/Utils/Console/Example.dox similarity index 100% rename from Scheduler/Console/Example.dox rename to Utils/Console/Example.dox diff --git a/Scheduler/Console/Executor.cc b/Utils/Console/Executor.cc similarity index 100% rename from Scheduler/Console/Executor.cc rename to Utils/Console/Executor.cc diff --git a/Scheduler/Console/Executor.cci b/Utils/Console/Executor.cci similarity index 100% rename from Scheduler/Console/Executor.cci rename to Utils/Console/Executor.cci diff --git a/Scheduler/Console/Executor.hh b/Utils/Console/Executor.hh similarity index 100% rename from Scheduler/Console/Executor.hh rename to Utils/Console/Executor.hh diff --git a/Scheduler/Console/Executor.test.cc b/Utils/Console/Executor.test.cc similarity index 100% rename from Scheduler/Console/Executor.test.cc rename to Utils/Console/Executor.test.cc diff --git a/Scheduler/Console/LazyDirectory.cc b/Utils/Console/LazyDirectory.cc similarity index 100% rename from Scheduler/Console/LazyDirectory.cc rename to Utils/Console/LazyDirectory.cc diff --git a/Scheduler/Console/LazyDirectory.hh b/Utils/Console/LazyDirectory.hh similarity index 100% rename from Scheduler/Console/LazyDirectory.hh rename to Utils/Console/LazyDirectory.hh diff --git a/Scheduler/Console/Mainpage.dox b/Utils/Console/Mainpage.dox similarity index 100% rename from Scheduler/Console/Mainpage.dox rename to Utils/Console/Mainpage.dox diff --git a/Scheduler/Console/Node.cc b/Utils/Console/Node.cc similarity index 100% rename from Scheduler/Console/Node.cc rename to Utils/Console/Node.cc diff --git a/Scheduler/Console/Node.cci b/Utils/Console/Node.cci similarity index 100% rename from Scheduler/Console/Node.cci rename to Utils/Console/Node.cci diff --git a/Scheduler/Console/Node.cti b/Utils/Console/Node.cti similarity index 100% rename from Scheduler/Console/Node.cti rename to Utils/Console/Node.cti diff --git a/Scheduler/Console/Node.hh b/Utils/Console/Node.hh similarity index 100% rename from Scheduler/Console/Node.hh rename to Utils/Console/Node.hh diff --git a/Scheduler/Console/Node.ih b/Utils/Console/Node.ih similarity index 100% rename from Scheduler/Console/Node.ih rename to Utils/Console/Node.ih diff --git a/Scheduler/Console/Node.test.cc b/Utils/Console/Node.test.cc similarity index 100% rename from Scheduler/Console/Node.test.cc rename to Utils/Console/Node.test.cc diff --git a/Scheduler/Console/OverloadedCommand.cc b/Utils/Console/OverloadedCommand.cc similarity index 100% rename from Scheduler/Console/OverloadedCommand.cc rename to Utils/Console/OverloadedCommand.cc diff --git a/Scheduler/Console/OverloadedCommand.cci b/Utils/Console/OverloadedCommand.cci similarity index 100% rename from Scheduler/Console/OverloadedCommand.cci rename to Utils/Console/OverloadedCommand.cci diff --git a/Scheduler/Console/OverloadedCommand.cti b/Utils/Console/OverloadedCommand.cti similarity index 100% rename from Scheduler/Console/OverloadedCommand.cti rename to Utils/Console/OverloadedCommand.cti diff --git a/Scheduler/Console/OverloadedCommand.hh b/Utils/Console/OverloadedCommand.hh similarity index 100% rename from Scheduler/Console/OverloadedCommand.hh rename to Utils/Console/OverloadedCommand.hh diff --git a/Scheduler/Console/OverloadedCommand.test.cc b/Utils/Console/OverloadedCommand.test.cc similarity index 100% rename from Scheduler/Console/OverloadedCommand.test.cc rename to Utils/Console/OverloadedCommand.test.cc diff --git a/Scheduler/Console/Parse.cc b/Utils/Console/Parse.cc similarity index 100% rename from Scheduler/Console/Parse.cc rename to Utils/Console/Parse.cc diff --git a/Scheduler/Console/Parse.cci b/Utils/Console/Parse.cci similarity index 100% rename from Scheduler/Console/Parse.cci rename to Utils/Console/Parse.cci diff --git a/Scheduler/Console/Parse.hh b/Utils/Console/Parse.hh similarity index 100% rename from Scheduler/Console/Parse.hh rename to Utils/Console/Parse.hh diff --git a/Scheduler/Console/Parse.ih b/Utils/Console/Parse.ih similarity index 100% rename from Scheduler/Console/Parse.ih rename to Utils/Console/Parse.ih diff --git a/Scheduler/Console/Parse.test.cc b/Utils/Console/Parse.test.cc similarity index 100% rename from Scheduler/Console/Parse.test.cc rename to Utils/Console/Parse.test.cc diff --git a/Scheduler/Console/ParsedCommand.cc b/Utils/Console/ParsedCommand.cc similarity index 100% rename from Scheduler/Console/ParsedCommand.cc rename to Utils/Console/ParsedCommand.cc diff --git a/Scheduler/Console/ParsedCommand.cci b/Utils/Console/ParsedCommand.cci similarity index 100% rename from Scheduler/Console/ParsedCommand.cci rename to Utils/Console/ParsedCommand.cci diff --git a/Scheduler/Console/ParsedCommand.ct b/Utils/Console/ParsedCommand.ct similarity index 97% rename from Scheduler/Console/ParsedCommand.ct rename to Utils/Console/ParsedCommand.ct index b3acb01..61b6153 100644 --- a/Scheduler/Console/ParsedCommand.ct +++ b/Utils/Console/ParsedCommand.ct @@ -34,7 +34,7 @@ // senf::console::ParsedCommandOverload #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() diff --git a/Scheduler/Console/ParsedCommand.cti b/Utils/Console/ParsedCommand.cti similarity index 99% rename from Scheduler/Console/ParsedCommand.cti rename to Utils/Console/ParsedCommand.cti index eeedd3a..c0d42a8 100644 --- a/Scheduler/Console/ParsedCommand.cti +++ b/Utils/Console/ParsedCommand.cti @@ -69,7 +69,7 @@ prefix_ void senf::console::ParsedCommandOverloadBase::addParameter() // senf::console::ParsedCommandOverload #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() diff --git a/Scheduler/Console/ParsedCommand.hh b/Utils/Console/ParsedCommand.hh similarity index 99% rename from Scheduler/Console/ParsedCommand.hh rename to Utils/Console/ParsedCommand.hh index 4de6952..4d6cc0c 100644 --- a/Scheduler/Console/ParsedCommand.hh +++ b/Utils/Console/ParsedCommand.hh @@ -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() diff --git a/Scheduler/Console/ParsedCommand.ih b/Utils/Console/ParsedCommand.ih similarity index 100% rename from Scheduler/Console/ParsedCommand.ih rename to Utils/Console/ParsedCommand.ih diff --git a/Scheduler/Console/ParsedCommand.mpp b/Utils/Console/ParsedCommand.mpp similarity index 100% rename from Scheduler/Console/ParsedCommand.mpp rename to Utils/Console/ParsedCommand.mpp diff --git a/Scheduler/Console/ParsedCommand.test.cc b/Utils/Console/ParsedCommand.test.cc similarity index 100% rename from Scheduler/Console/ParsedCommand.test.cc rename to Utils/Console/ParsedCommand.test.cc diff --git a/Scheduler/Console/ProgramOptions.cc b/Utils/Console/ProgramOptions.cc similarity index 100% rename from Scheduler/Console/ProgramOptions.cc rename to Utils/Console/ProgramOptions.cc diff --git a/Scheduler/Console/ProgramOptions.cci b/Utils/Console/ProgramOptions.cci similarity index 100% rename from Scheduler/Console/ProgramOptions.cci rename to Utils/Console/ProgramOptions.cci diff --git a/Scheduler/Console/ProgramOptions.cti b/Utils/Console/ProgramOptions.cti similarity index 100% rename from Scheduler/Console/ProgramOptions.cti rename to Utils/Console/ProgramOptions.cti diff --git a/Scheduler/Console/ProgramOptions.hh b/Utils/Console/ProgramOptions.hh similarity index 100% rename from Scheduler/Console/ProgramOptions.hh rename to Utils/Console/ProgramOptions.hh diff --git a/Scheduler/Console/ProgramOptions.ih b/Utils/Console/ProgramOptions.ih similarity index 100% rename from Scheduler/Console/ProgramOptions.ih rename to Utils/Console/ProgramOptions.ih diff --git a/Scheduler/Console/ProgramOptions.test.cc b/Utils/Console/ProgramOptions.test.cc similarity index 100% rename from Scheduler/Console/ProgramOptions.test.cc rename to Utils/Console/ProgramOptions.test.cc diff --git a/Scheduler/Console/Readline.cc b/Utils/Console/Readline.cc similarity index 98% rename from Scheduler/Console/Readline.cc rename to Utils/Console/Readline.cc index 87efd87..4b7f724 100644 --- a/Scheduler/Console/Readline.cc +++ b/Utils/Console/Readline.cc @@ -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"); } diff --git a/Scheduler/Console/Readline.cci b/Utils/Console/Readline.cci similarity index 100% rename from Scheduler/Console/Readline.cci rename to Utils/Console/Readline.cci diff --git a/Scheduler/Console/Readline.hh b/Utils/Console/Readline.hh similarity index 99% rename from Scheduler/Console/Readline.hh rename to Utils/Console/Readline.hh index 2b6a672..7c26de6 100644 --- a/Scheduler/Console/Readline.hh +++ b/Utils/Console/Readline.hh @@ -30,7 +30,7 @@ #include #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 index 0000000..5386352 --- /dev/null +++ b/Utils/Console/SConscript @@ -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) diff --git a/Scheduler/Console/ScopedDirectory.cci b/Utils/Console/ScopedDirectory.cci similarity index 100% rename from Scheduler/Console/ScopedDirectory.cci rename to Utils/Console/ScopedDirectory.cci diff --git a/Scheduler/Console/ScopedDirectory.cti b/Utils/Console/ScopedDirectory.cti similarity index 100% rename from Scheduler/Console/ScopedDirectory.cti rename to Utils/Console/ScopedDirectory.cti diff --git a/Scheduler/Console/ScopedDirectory.hh b/Utils/Console/ScopedDirectory.hh similarity index 100% rename from Scheduler/Console/ScopedDirectory.hh rename to Utils/Console/ScopedDirectory.hh diff --git a/Scheduler/Console/ScopedDirectory.test.cc b/Utils/Console/ScopedDirectory.test.cc similarity index 100% rename from Scheduler/Console/ScopedDirectory.test.cc rename to Utils/Console/ScopedDirectory.test.cc diff --git a/Scheduler/Console/Server.cc b/Utils/Console/Server.cc similarity index 100% rename from Scheduler/Console/Server.cc rename to Utils/Console/Server.cc diff --git a/Scheduler/Console/Server.cci b/Utils/Console/Server.cci similarity index 100% rename from Scheduler/Console/Server.cci rename to Utils/Console/Server.cci diff --git a/Scheduler/Console/Server.hh b/Utils/Console/Server.hh similarity index 99% rename from Scheduler/Console/Server.hh rename to Utils/Console/Server.hh index dfd0cf3..ef38917 100644 --- a/Scheduler/Console/Server.hh +++ b/Utils/Console/Server.hh @@ -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" diff --git a/Scheduler/Console/Server.ih b/Utils/Console/Server.ih similarity index 100% rename from Scheduler/Console/Server.ih rename to Utils/Console/Server.ih diff --git a/Scheduler/Console/Server.test.cc b/Utils/Console/Server.test.cc similarity index 100% copy from Scheduler/Console/Server.test.cc copy to Utils/Console/Server.test.cc diff --git a/Scheduler/Console/Sysdir.cci b/Utils/Console/Sysdir.cci similarity index 100% rename from Scheduler/Console/Sysdir.cci rename to Utils/Console/Sysdir.cci diff --git a/Scheduler/Console/Sysdir.hh b/Utils/Console/Sysdir.hh similarity index 100% rename from Scheduler/Console/Sysdir.hh rename to Utils/Console/Sysdir.hh diff --git a/Scheduler/Console/Sysdir.ih b/Utils/Console/Sysdir.ih similarity index 100% rename from Scheduler/Console/Sysdir.ih rename to Utils/Console/Sysdir.ih diff --git a/Scheduler/Console/Traits.cc b/Utils/Console/Traits.cc similarity index 100% rename from Scheduler/Console/Traits.cc rename to Utils/Console/Traits.cc diff --git a/Scheduler/Console/Traits.cci b/Utils/Console/Traits.cci similarity index 100% rename from Scheduler/Console/Traits.cci rename to Utils/Console/Traits.cci diff --git a/Scheduler/Console/Traits.ct b/Utils/Console/Traits.ct similarity index 100% rename from Scheduler/Console/Traits.ct rename to Utils/Console/Traits.ct diff --git a/Scheduler/Console/Traits.cti b/Utils/Console/Traits.cti similarity index 100% rename from Scheduler/Console/Traits.cti rename to Utils/Console/Traits.cti diff --git a/Scheduler/Console/Traits.hh b/Utils/Console/Traits.hh similarity index 100% rename from Scheduler/Console/Traits.hh rename to Utils/Console/Traits.hh diff --git a/Scheduler/Console/Traits.ih b/Utils/Console/Traits.ih similarity index 100% rename from Scheduler/Console/Traits.ih rename to Utils/Console/Traits.ih diff --git a/Scheduler/Console/Traits.test.cc b/Utils/Console/Traits.test.cc similarity index 100% rename from Scheduler/Console/Traits.test.cc rename to Utils/Console/Traits.test.cc diff --git a/Scheduler/Console/Variables.cti b/Utils/Console/Variables.cti similarity index 100% rename from Scheduler/Console/Variables.cti rename to Utils/Console/Variables.cti diff --git a/Scheduler/Console/Variables.hh b/Utils/Console/Variables.hh similarity index 100% rename from Scheduler/Console/Variables.hh rename to Utils/Console/Variables.hh diff --git a/Scheduler/Console/Variables.ih b/Utils/Console/Variables.ih similarity index 100% rename from Scheduler/Console/Variables.ih rename to Utils/Console/Variables.ih diff --git a/Scheduler/Console/Variables.test.cc b/Utils/Console/Variables.test.cc similarity index 100% rename from Scheduler/Console/Variables.test.cc rename to Utils/Console/Variables.test.cc diff --git a/Scheduler/Console/Server.test.cc b/Utils/Console/main.test.cc similarity index 88% rename from Scheduler/Console/Server.test.cc rename to Utils/Console/main.test.cc index 84599f0..c6b4f24 100644 --- a/Scheduler/Console/Server.test.cc +++ b/Utils/Console/main.test.cc @@ -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 @@ -20,23 +20,19 @@ // 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 #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: diff --git a/Scheduler/Console/testServer.cc b/Utils/Console/testServer.cc similarity index 100% rename from Scheduler/Console/testServer.cc rename to Utils/Console/testServer.cc diff --git a/Utils/Daemon/SConscript b/Utils/Daemon/SConscript index db6cfbe..2ca29de 100644 --- a/Utils/Daemon/SConscript +++ b/Utils/Daemon/SConscript @@ -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) diff --git a/Utils/Logger/IOStreamTarget.cc b/Utils/Logger/IOStreamTarget.cc index 286f3ba..6441cf8 100644 --- a/Utils/Logger/IOStreamTarget.cc +++ b/Utils/Logger/IOStreamTarget.cc @@ -33,6 +33,7 @@ #include #include #include +#include "../Scheduler/ClockService.hh" //#include "IOStreamTarget.mpp" #define prefix_ diff --git a/Utils/Logger/SConscript b/Utils/Logger/SConscript index 672c29b..c9e26fc 100644 --- a/Utils/Logger/SConscript +++ b/Utils/Logger/SConscript @@ -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') diff --git a/Utils/Logger/TimeSource.cc b/Utils/Logger/TimeSource.cc index 375cce6..f5baef9 100644 --- a/Utils/Logger/TimeSource.cc +++ b/Utils/Logger/TimeSource.cc @@ -29,6 +29,7 @@ // Custom includes #include #include "../Exception.hh" +#include "../../Scheduler/ClockService.hh" //#include "TimeSource.mpp" #define prefix_ diff --git a/Utils/Logger/TimeSource.hh b/Utils/Logger/TimeSource.hh index d6fa204..135230c 100644 --- a/Utils/Logger/TimeSource.hh +++ b/Utils/Logger/TimeSource.hh @@ -29,7 +29,7 @@ // Custom includes #include #include -#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 diff --git a/Utils/SConscript b/Utils/SConscript index a39e7f6..d17af8a 100644 --- a/Utils/SConscript +++ b/Utils/SConscript @@ -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")) diff --git a/Utils/impl/membind.hh b/Utils/impl/membind.hh index fcf3eaf..3dad9bf 100644 --- a/Utils/impl/membind.hh +++ b/Utils/impl/membind.hh @@ -27,7 +27,6 @@ #include #include #include -#include "../../config.hh" template boost::function membind(R (T::* fn)(),scOBTYPE ob) diff --git a/Utils/membind.hh b/Utils/membind.hh index 7429307..3ac24d3 100644 --- a/Utils/membind.hh +++ b/Utils/membind.hh @@ -52,6 +52,7 @@ // Custom includes #include #include +#include "../config.hh" ///////////////////////////////hh.p//////////////////////////////////////// diff --git a/config.hh b/config.hh index 976f691..a746626 100644 --- a/config.hh +++ b/config.hh @@ -27,9 +27,17 @@ # define HH_config_ 1 # # // Custom includes +# include # # ///////////////////////////////hh.p//////////////////////////////////////// -# + +namespace senf { +namespace config { + + typedef boost::int_fast64_t time_type; + +}} + # include "local_config.hh" # # ifndef SENF_ABSOLUTE_INCLUDE_PATH diff --git a/include/senf/Console b/include/senf/Console index 47e3d9f..754ef40 120000 --- a/include/senf/Console +++ b/include/senf/Console @@ -1 +1 @@ -../../Scheduler/Console \ No newline at end of file +../../Utils/Console \ No newline at end of file diff --git a/include/senf/Console.hh b/include/senf/Console.hh index 38936b1..95cf505 100644 --- a/include/senf/Console.hh +++ b/include/senf/Console.hh @@ -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" // Local Variables: diff --git a/senfscons/SENFSCons.py b/senfscons/SENFSCons.py index b1bf0c4..edecb11 100644 --- a/senfscons/SENFSCons.py +++ b/senfscons/SENFSCons.py @@ -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