###########################################################################
-SENFSCons.Binary(env, 'mcsniffer', SENFSCons.GlobSources(),
- LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ],
+SENFSCons.Binary(env, 'mcsniffer', SENFSCons.GlobSources(env),
OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o' ]);
###########################################################################
-SENFSCons.Binary(env, 'multimcloop', [ 'MultiMCLoop.cc' ],
- LIBS = [ 'Scheduler', 'Socket', 'Utils' ])
+SENFSCons.Binary(env, 'multimcloop', [ 'MultiMCLoop.cc' ])
###########################################################################
-SENFSCons.Binary( env, 'ratestuffer', SENFSCons.GlobSources(),
- LIBS = [ 'PPI', 'Scheduler', 'Packets', 'Socket', 'Utils' ] );
-
+SENFSCons.Binary(env, 'ratestuffer', SENFSCons.GlobSources(env));
SENFSCons.Doxygen(env, extra_sources=[
env.Dia2Png('ratestuffer.dia')
])
###########################################################################
-SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(), LIBS = [
- 'Packets_DefaultBundle', 'Packets_MPEGDVBBundle',
- 'Scheduler', 'Packets', 'Socket', 'Utils' ])
-
+SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(env))
SENFSCons.Doxygen(env)
###########################################################################
-SENFSCons.Binary(env, 'client', 'client.cc',
- LIBS = [ 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
-
-SENFSCons.Binary(env, 'server', 'server.cc',
- LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
+SENFSCons.Binary(env, 'client', 'client.cc');
+SENFSCons.Binary(env, 'server', 'server.cc');
###########################################################################
-SENFSCons.Binary(env, 'udpClient', 'udpClient.cc',
- LIBS = [ 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
-
-SENFSCons.Binary(env, 'udpServer', 'udpServer.cc',
- LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
-
+SENFSCons.Binary(env, 'udpClient', 'udpClient.cc');
+SENFSCons.Binary(env, 'udpServer', 'udpServer.cc',);
SENFSCons.Doxygen(env)
###########################################################################
-SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
- if f not in ('all_includes.hh','PPI.hh') and not f.endswith('.test.hh') ])
-
SConscript(glob.glob("*/SConscript"))
-sources = SENFSCons.GlobSources(subdirs=[ 'detail' ])
+SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
+ if f not in ('all_includes.hh','PPI.hh') \
+ and not f.endswith('.test.hh') ])
+sources, includes = SENFSCons.Glob(env, subdirs=[ 'detail' ])
SENFSCons.StandardTargets(env)
-
-SENFSCons.Lib(env,
- library = 'PPI',
- sources = sources,
- LIBS = [ 'Scheduler', 'Packets', 'Logger', 'Console', 'Socket', 'Utils' ])
-
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env, extra_sources=[
env.Dia2Png('scenario.dia'),
env.Dia2Png('classes.dia'),
env.Dia2Png('ratestuffer.dia'),
])
-
-SENFSCons.InstallIncludeFiles(env, [ 'PPI.hh', 'all_includes.hh' ])
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-sources = SENFSCons.GlobSources()
+sources, includes = SENFSCons.Glob(env)
SENFSCons.StandardTargets(env)
+SENFSCons.Object(env, target='80211Bundle', sources=sources)
+SENFSCons.Lib(env, sources=sources[0])
+SENFSCons.InstallIncludeFiles(env, includes)
-SENFSCons.Object(env,
- target = '80211Bundle',
- sources=sources,
- LIBS = ['Packets', 'Socket', 'Utils'])
-
-SENFSCons.Lib(env,
- library = 'Packets_80211Bundle',
- sources = sources[0],
- no_includes = 1)
-
SConscript(glob.glob("*/SConscript"))
###########################################################################
-sources = SENFSCons.GlobSources()
-
+sources, includes = SENFSCons.Glob(env)
SENFSCons.StandardTargets(env)
+SENFSCons.Object(env, target='DefaultBundle', sources=sources)
+SENFSCons.Lib(env, sources[0])
+SENFSCons.InstallIncludeFiles(env, includes)
-SENFSCons.Object(env,
- target = 'DefaultBundle',
- sources=sources,
- LIBS = ['Packets', 'Socket', 'Utils'])
-
-SENFSCons.Lib(env,
- library = 'Packets_DefaultBundle',
- sources = sources[0],
- no_includes = 1)
-
SConscript(glob.glob("*/SConscript"))
###########################################################################
-SENFSCons.Test(env, sources = glob.glob("*.test.cc"),
- LIBS = [ 'Packets_DefaultBundle', 'Packets', 'Socket', 'Utils' ])
+SENFSCons.Test(env, sources = glob.glob("*.test.cc"))
###########################################################################
-sources = SENFSCons.GlobSources()
+sources, includes = SENFSCons.Glob(env)
SENFSCons.StandardTargets(env)
-
-SENFSCons.Object(env,
- target = 'MPEGDVBBundle',
- sources = sources,
- LIBS = ['Packets_DefaultBundle', 'Packets', 'Socket', 'Utils'])
-
-SENFSCons.Lib(env,
- library = 'Packets_MPEGDVBBundle',
- sources = sources[0],
- no_includes = 1)
+SENFSCons.Object(env, target='MPEGDVBBundle', sources=sources)
+SENFSCons.Lib(env, sources[0])
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-#SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
-# if 'defined(HH_Packets__decls_)' in file(f).read() ])
+sources, includes = SENFSCons.Glob(env)
SENFSCons.StandardTargets(env)
-SENFSCons.Lib(env,
- library = 'Packets',
- sources = SENFSCons.GlobSources(),
- LIBS = [ 'Logger', 'Scheduler', 'Socket', 'Utils' ])
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png("structure.dia"),
env.Dia2Png("MPEGDVBBundle/TLV.dia")
])
+SENFSCons.InstallIncludeFiles(env, includes)
SConscript(glob.glob("*/SConscript"))
-SENFSCons.InstallIncludeFiles(env, [ 'parse_fixed_setup.hh' , 'parse_setup.hh' ])
###########################################################################
-sources = SENFSCons.GlobSources()
-SENFSCons.StandardTargets(env)
-
-SENFSCons.Lib(env,
- library = 'Scheduler',
- sources = sources,
- LIBS = [ 'Logger', 'Scheduler', 'Console', 'Utils' ])
+sources, includes = SENFSCons.Glob(env)
+SENFSCons.StandardTargets(env)
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
+SConscript(glob.glob("*/SConscript"))
+
SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
if f not in ('all_includes.hh','DVB.hh') and not f.endswith('.test.hh') ])
-sources = SENFSCons.GlobSources()
-
-allob = []
-
-allob.extend(
- SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
-
-for sc in glob.glob("*/SConscript"):
- ob = SConscript(sc)
- if ob : allob.extend(ob)
-
-SENFSCons.InstallIncludeFiles(env, [ 'DVB.hh', 'all_includes.hh' ])
+sources, includes = SENFSCons.Glob(env)
-Return('allob')
+SENFSCons.Lib(env, sources)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
+SConscript(glob.glob("*/SConscript"))
+
SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
if f not in ('all_includes.hh','INet.hh') and not f.endswith('.test.hh') ])
-sources = SENFSCons.GlobSources()
-
-allob = []
-
-allob.extend(
- SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
-
-for sc in glob.glob("*/SConscript"):
- ob = SConscript(sc)
- if ob : allob.extend(ob)
-
-SENFSCons.InstallIncludeFiles(env, [ 'INet.hh', 'all_includes.hh' ])
+sources, includes = SENFSCons.Glob(env)
-Return('allob')
+SENFSCons.Lib(env, sources)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
+SConscript(glob.glob("*/SConscript"))
+
SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
if f not in ('all_includes.hh','Raw.hh') and not f.endswith('.test.hh') ])
-sources = SENFSCons.GlobSources()
-
-allob = []
-
-allob.extend(
- SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
-
-for sc in glob.glob("*/SConscript"):
- ob = SConscript(sc)
- if ob : allob.extend(ob)
-
-SENFSCons.InstallIncludeFiles(env, [ 'Raw.hh', 'all_includes.hh' ])
+sources, includes = SENFSCons.Glob(env)
-Return('allob')
+SENFSCons.Lib(env, sources)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-SENFSCons.StandardTargets(env)
-
-sources = SENFSCons.GlobSources()
-objects = SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] )
+SConscript(glob.glob("*/SConscript"))
-for sc in glob.glob("*/SConscript"):
- ob = SConscript(sc)
- if ob : objects.extend(ob)
-
-SENFSCons.InstallIncludeFiles(env, [ 'INet.hh', 'Raw.hh', 'DVB.hh', 'UN.hh' ])
+SENFSCons.StandardTargets(env)
-Return('objects')
+sources, includes = SENFSCons.Glob(env)
+SENFSCons.Lib(env, sources)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
+SConscript(glob.glob("*/SConscript"))
+
SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
if f not in ('all_includes.hh','UN.hh') and not f.endswith('.test.hh') ])
-sources = SENFSCons.GlobSources()
-
-allob = []
-
-allob.extend(
- SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
-
-for sc in glob.glob("*/SConscript"):
- ob = SConscript(sc)
- if ob : allob.extend(ob)
-
-SENFSCons.InstallIncludeFiles(env, [ 'UN.hh', 'all_includes.hh' ])
+sources, includes = SENFSCons.Glob(env)
-Return('allob')
+SENFSCons.Lib( env, sources)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
+SConscript(glob.glob("*/SConscript"))
+
SENFSCons.AllIncludesHH(env, [ f for f in glob.glob("*.hh")
if f not in ('all_includes.hh','Socket.hh') and not f.endswith('.test.hh') ])
-sources, testSources = SENFSCons.GlobSources()
+sources, includes = SENFSCons.Glob(env)
SENFSCons.StandardTargets(env)
-
-subob = []
-for sc in glob.glob("*/SConscript"):
- ob = SConscript(sc)
- if ob : subob.extend(ob)
-
-SENFSCons.Lib(env,
- library = 'Socket',
- sources = sources + subob,
- testSources = testSources,
- LIBS = [ 'Utils' ])
-
+SENFSCons.Lib(env, sources = sources)
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png('SocketLibrary-classes.dia'),
env.Dia2Png('FhHierarchy.dia'),
env.Dia2Png('Protocols.dia'),
env.Dia2Png('Handle.dia'),
])
-
-SENFSCons.InstallIncludeFiles(env, [ 'Socket.hh', 'all_includes.hh' ])
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-sources = SENFSCons.GlobSources(exclude=['testServer.cc'])
-SENFSCons.StandardTargets(env)
-
-SENFSCons.Lib(env,
- library = 'Console',
- sources = sources,
- LIBS = [ 'Socket', 'Scheduler', 'Utils' ])
+sources, includes = SENFSCons.Glob(env, exclude=['testServer.cc'])
+SENFSCons.StandardTargets(env)
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-SENFSCons.StandardTargets(env)
-
-sources = SENFSCons.GlobSources()
-
-SENFSCons.Lib( env,
- library = 'Utils_Daemon',
- sources = sources,
- LIBS = [ 'Logger', 'Scheduler', 'Socket', 'Utils' ] )
+sources, includes = SENFSCons.Glob(env)
+SENFSCons.StandardTargets(env)
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-SENFSCons.StandardTargets(env)
-
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.Lib( env,
- library = 'Logger',
- sources = sources,
- LIBS = [ 'Scheduler', 'Socket', 'Utils' ] )
+sources, includes = SENFSCons.Glob(env)
+
+SENFSCons.StandardTargets(env)
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env)
+SENFSCons.InstallIncludeFiles(env, includes)
###########################################################################
-SENFSCons.StandardTargets(env)
-
-# OUCH ... another hack to work around a scons bug ...
-if not os.path.exists("Logger/all_includes.hh"):
- Execute(Touch("Logger/all_includes.hh"))
-
-sources, testSources = SENFSCons.GlobSources()
-objects = SENFSCons.Objects( env, sources = sources, testSources=testSources )
-
-lib = SENFSCons.Lib(env,
- library = 'Utils',
- sources = objects)
+sources, includes = SENFSCons.Glob(env, subdirs=[ 'impl' ])
+SENFSCons.StandardTargets(env)
+SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env)
-SENFSCons.InstallIncludeFiles(env, [ 'Logger.hh', 'Daemon.hh' ])
+SENFSCons.InstallIncludeFiles(env, includes)
SConscript(glob.glob("*/SConscript"))
+++ /dev/null
-## \file
-# \brief InstallIncludes builder
-
-## \package senfscons.InstallIncludes
-# \brief Install all include files which some targets depend upon
-#
-# \ingroup builder
-
-import SCons.Builder, SCons.Action, SCons.Environment, SCons.Node.FS
-try:
- from SCons.Tool.install import installFunc, stringFunc
-except:
- installFunc = SCons.Environment.installFunc
- stringFunc = SCons.Environment.installString
-
-def recursiveChildren(f):
- rv = {}
- map(rv.setdefault,f)
- for c in f:
- if c is not None : map(rv.setdefault,recursiveChildren(c.children()))
- return rv.keys()
-
-def filterIncludes(files, extensions):
- return [ f for f in files
- if f is not None and f.get_suffix() in extensions ]
-
-def filterIncludesInv(files, extensions):
- return [ f for f in files
- if f is not None and '.' + str(f).split('.',1)[-1] not in extensions ]
-
-def filterDirectory(files, dir):
- return [ f for f in files
- if f is not None and f.abspath.startswith(dir.abspath) ]
-
-def excludeDirectories(files, dirs):
- return [ f for f in files
- if not [ True for d in dirs if files.abspath.startswith(dirs.abspath) ] ]
-
-def emitter(target, source, env):
- source = recursiveChildren(source)
- source = filterIncludes(source, env['CPP_INCLUDE_EXTENSIONS'])
- source = filterIncludesInv(source, env['CPP_EXCLUDE_EXTENSIONS'])
- source = filterDirectory(source, env['INSTALL_BASE'])
- source = excludeDirectories(source, env['INCLUDE_IGNORED_DIRECTORIES'])
-
- # Build target file by appending the path of 'src' relative to INSTALL_BASE to target[0]
- target = [ target[0].File(src.get_path(env.Dir(env['INSTALL_BASE'])))
- for src in source ]
-
- return (target, source)
-
-class Installer:
- def __init__(self, target, source):
- self.target = target;
- self.source = source
-
- def __call__(self, target, source, env):
- installFunc([self.target], [self.source], env)
-
-def generator(target, source, env, for_signature):
- return [ SCons.Action.Action( Installer(trg, src),
- lambda a,b,c,s=stringFunc([trg], [src], env):s )
- for trg, src in zip(target,source) ]
-
-InstallIncludes = SCons.Builder.Builder(emitter = emitter,
- generator = generator,
- source_factory = SCons.Node.FS.Entry,
- target_factory = SCons.Node.FS.Dir,
- name = 'InstallIncludesBuilder',
- )
-
-def generate(env):
- env['BUILDERS']['InstallIncludes'] = InstallIncludes
- env['INSTALL_BASE'] = '#'
- env['INCLUDE_IGNORED_DIRECTORIES'] = []
-
-def exists(env):
- return 1
"Doxygen",
"Dia2Png",
"CopyToDir",
- "InstallIncludes",
"ProgramNoScan",
"CompileCheck",
]
# in the current directory. The sources will be returned as a tuple of
# sources, test-sources. The target helpers all accept such a tuple as
# their source argument.
-def GlobSources(exclude=[], subdirs=[]):
+def GlobSources(env, exclude=[], subdirs=[]):
testSources = glob.glob("*.test.cc")
sources = [ x for x in glob.glob("*.cc") if x not in testSources and x not in exclude ]
for subdir in subdirs:
if x not in testSources and x not in exclude ]
return (sources, testSources)
+def GlobIncludes(env, exclude=[], subdirs=[]):
+ includes = []
+ for d in [ '.' ] + subdirs:
+ for f in os.listdir(d):
+ ext = '.' + f.split('.',1)[-1]
+ p = os.path.join(d,f)
+ if ext in env['CPP_INCLUDE_EXTENSIONS'] \
+ and ext not in env['CPP_EXCLUDE_EXTENSIONS'] \
+ and p not in exclude:
+ includes.append(p)
+ return includes
+
+def Glob(env, exclude=[], subdirs=[]):
+ return ( GlobSources(env, exclude, subdirs),
+ GlobIncludes(env, exclude, subdirs) )
+
## \brief Add generic standard targets for every module
#
# This target helper should be called in the top-level \c SConstruct file
# provide both \a sources and \a testSources.
#
# \ingroup target
-def Objects(env, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
+def Objects(env, sources, testSources = None, OBJECTS = []):
if type(sources) == type(()):
testSources = sources[1]
sources = sources[0]
if env.GetOption('clean'):
return
target = env.Dir(env['INCLUDEINSTALLDIR'])
- base = env.Dir(env['INSTALL_BASE'])
+ base = env.Dir('#')
for f in files:
src = env.File(f)
env.Alias('install_all', env.Install(target.Dir(src.dir.get_path(base)), src))
-def InstallSourceIncludes(env, sources):
- target = env.Dir(env['INCLUDEINSTALLDIR']).Dir(
- env.Dir('.').get_path(env.Dir(env['INSTALL_BASE'])))
- install = env.InstallIncludes( target = target,
- source = [ type(x) is str and env.File(x) or x
- for x in sources ],
- INSTALL_BASE = env.Dir('.') )
- env.Alias( 'install_all', install )
-
-def InstallWithSources(env, targets, dir, sources, testSources = [], no_includes = False):
- if type(sources) is type(()):
- sources, testSources = sources
- if type(sources) is not type([]):
- sources = [ sources ]
- if type(testSources) is not type([]):
- testSources = [ testSources ]
-
- installs = [ env.Install(dir, targets) ]
- env.Alias( 'install_all', installs[:] )
-
- if not no_includes:
- sources = targets
- if testSources:
- sources.append( env.File('.test.bin') )
- installs.append(
- InstallSourceIncludes(env, sources))
-
- return installs
-
## \brief Build documentation with doxygen
#
# The doxygen target helper will build software documentation using
# The library is added to the list of default targets.
#
#\ingroup target
-def Lib(env, library, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
- objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
+def Lib(env, sources, testSources = None, OBJECTS = []):
+ objects = Objects(env,sources,testSources,OBJECTS=OBJECTS)
if objects:
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):
- objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
+def Object(env, target, sources, testSources = None, OBJECTS = []):
+ objects = Objects(env,sources,testSources,OBJECTS=OBJECTS)
ob = None
if objects:
ob = env.Command(target+"${OBJADDSUFFIX}${OBJSUFFIX}", objects, "ld -r -o $TARGET $SOURCES")
env.Default(ob)
env.Alias('default', ob)
- InstallSourceIncludes(env, sources)
+ env.Alias('install_all', env.Install("$OBJINSTALLDIR", ob))
return ob
## \brief Build executable
# construction environment parameters or the framework helpers.
#
# \ingroup target
-def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
- objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
+def Binary(env, binary, sources, testSources = None, OBJECTS = []):
+ objects = Objects(env,sources,testSources,OBJECTS=OBJECTS)
program = None
if objects:
progEnv = env.Clone()
env.Default(program)
env.Depends(program, [ env.File(LibPath(env['LIBSENF'])) ])
env.Alias('default', program)
- InstallWithSources(env, program, '$BININSTALLDIR', sources, testSources, no_includes)
+ env.Alias('install_all', env.Install('$BININSTALLDIR', program))
return program
def AllIncludesHH(env, headers):