SENFSCons.Object(env, target = 'DefaultBundle', sources=sources,
LIBS = ['Packets', 'Socket', 'Utils'])
SENFSCons.Lib(env, library = 'Packets_DefaultBundle', sources = sources[0],
- LIBS = ['Packets', 'Socket', 'Utils'])
+ LIBS = ['Packets', 'Socket', 'Utils'], no_includes = 1)
SENFSCons.Doxygen(env)
SENFSCons.Object(env, target = 'MPEGDVBBundle', sources=sources,
LIBS = ['Packets', 'Socket', 'Utils'])
SENFSCons.Lib(env, library = 'Packets_MPEGDVBBundle', sources = sources[0],
- LIBS = ['Packets', 'Socket', 'Utils'])
+ LIBS = ['Packets', 'Socket', 'Utils'], no_includes = 1)
SENFSCons.Doxygen(env)
/** \file
\brief ParseArray non-inline template implementation */
-//#include "ParseArray.ih"
+#include "ParseArray.ih"
// Custom includes
(*i).init();
}
-
-
///////////////////////////////ct.e////////////////////////////////////////
#undef prefix_
#if !defined(SENF_PACKETS_DECL_ONLY) && !defined(HH_ParseArray_i_)
#define HH_ParseArray_i_
//#include "ParseArray.cci"
-//#include "ParseArray.ct"
+#include "ParseArray.ct"
#include "ParseArray.cti"
#endif
###########################################################################
-def makeAllIncludesHH(target = None, source = None, env = None):
- file(target[0].abspath,"w").write("".join([ '#include "%s"\n' % f
- for f in env['SOURCE_HEADERS']]))
-makeAllIncludesHH = env.Action(makeAllIncludesHH, varlist=['SOURCE_HEADERS'])
+def makeAllIncludesHH(target, headers):
+ file(env.File(target).abspath,"w").write("".join([ '#include "%s"\n' % f
+ for f in headers ]))
###########################################################################
-sources = SENFSCons.GlobSources()
+source_headers = [ f for f in glob.glob("*.hh")
+ if 'defined(SENF_PACKETS_DECL_ONLY)' in file(f).read() ]
+source_headers.sort()
+makeAllIncludesHH('all_includes.hh', source_headers)
SENFSCons.StandardTargets(env)
-
-env.Command('all_includes.hh', 'SConscript', makeAllIncludesHH,
- SOURCE_HEADERS = [ f for f in glob.glob("*.hh")
- if 'defined(SENF_PACKETS_DECL_ONLY)' in file(f).read() ])
-
SENFSCons.Lib(env,
library = 'Packets',
- sources = sources,
+ sources = SENFSCons.GlobSources(),
LIBS = [ 'Socket', 'Utils' ])
-
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png("structure.dia")
])
+++ /dev/null
-// $Id$
-//
-// Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-// Stefan Bund <stefan.bund@fokus.fraunhofer.de>
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the
-// Free Software Foundation, Inc.,
-// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/** \file
- \brief GenericSockAddr public header */
-
-/** \defgroup addr_group Socket Addressing
-
- To support the core socket functionality we need a collection of classing providing addressing
- for the different protocols.
-
- For all standard BSD socket protocols we base the address classes on the corresponding \c
- sockaddr structures, wrapped into appropriate C++ adapters. These Address classes are based on
- GenericSockAddr, the corresponding addressing policy is defined in GenericAddressingPolicy.
-
- You are however not limit to BSD type socket address classes as long as you implement the
- corresponding addressing policy.
- */
-
-#ifndef HH_GenericSockAddr_
-#define HH_GenericSockAddr_ 1
-
-// Custom includes
-#include <sys/socket.h>
-
-//#include "GenericSockAddr.mpp"
-///////////////////////////////hh.p////////////////////////////////////////
-
-namespace senf {
-
- /// \addtogroup addr_group
- /// @{
-
- /** \brief Generic protocol-independant socket address
-
- This address type does not depend on the protocol of the socket. It does nowever not support
- any protocol specific API, so access to the address is very limited.
- */
- class GenericSockAddr
- {
- public:
- GenericSockAddr();
-
- /// \name Generic Address Interface
- /// @{
-
- struct sockaddr * sockaddr_p(); ///< Return a pointer to sockaddr structure
- /**< The exact structure pointed to depends on the address
- family. The data pointed to must be \e mutable. The
- value must be changeable and any change of the value
- through this pointer must be reflected in the visible
- address interface.
- \returns non-const (!) pointer to sockaddr structure */
- struct sockaddr const * sockaddr_p() const; ///< Return a pointer to sockaddr structure
- /**< This member is like sockaddr_p(), however it does not
- allow changing the address.
- \returns const pointer to sockaddr structure */
- unsigned sockaddr_len() const; ///< Return size of address
- /**< This member return the size of the socket address
- structure as returned by sockaddr_p() in bytes.
- \returns size of respective sockaddr structure in bytes
- */
- /// @}
-
- private:
- struct ::sockaddr_storage addr_;
- };
-
- /// @}
-}
-
-///////////////////////////////hh.e////////////////////////////////////////
-#include "GenericSockAddr.cci"
-//#include "GenericSockAddr.ct"
-//#include "GenericSockAddr.cti"
-//#include "GenericSockAddr.mpp"
-#endif
-
-\f
-// Local Variables:
-// mode: c++
-// fill-column: 100
-// c-file-style: "senf"
-// indent-tabs-mode: nil
-// ispell-local-dictionary: "american"
-// compile-command: "scons -u test"
-// comment-column: 40
-// End:
-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
+ \brief Buffer.test unit tests */
+
+//#include "Buffer.test.hh"
+//#include "Buffer.test.ih"
// Custom includes
+#include "Buffer.hh"
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
+BOOST_AUTO_UNIT_TEST(buffer)
{
- return reinterpret_cast<sockaddr *>(&addr_);
-}
+ int size (128);
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
-{
- return reinterpret_cast<sockaddr const *>(&addr_);
+ // Just check for compile errors, the rest can't be checked
+ SENF_SCOPED_BUFFER(char, buf, size);
+ (void) buf;
}
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
-{
- return sizeof(addr_);
-}
-
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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:
-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
+ \brief SafeBool.test unit tests */
+
+//#include "SafeBool.test.hh"
+//#include "SafeBool.test.ih"
// Custom includes
+#include "SafeBool.hh"
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
-{
- return reinterpret_cast<sockaddr *>(&addr_);
-}
+namespace {
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
-{
- return reinterpret_cast<sockaddr const *>(&addr_);
+ class TestTrue : public senf::SafeBool<TestTrue>
+ {
+ public:
+ bool boolean_test() const {
+ return true;
+ }
+ };
+
+ class TestFalse : public senf::SafeBool<TestFalse>
+ {
+ public:
+ bool boolean_test() const {
+ return false;
+ }
+ };
}
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
+BOOST_AUTO_UNIT_TEST(safeBool)
{
- return sizeof(addr_);
+ BOOST_CHECK( TestTrue() );
+ BOOST_CHECK( ! TestFalse() );
}
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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:
//#include "TypeIdValue.ih"
// Custom includes
+#include "TypeInfo.hh"
#define prefix_ inline
///////////////////////////////cci.p///////////////////////////////////////
return std::string(value_->id().name());
}
+prefix_ std::type_info const & senf::TypeIdValue::id()
+ const
+{
+ return value_->id();
+}
+
prefix_ senf::TypeIdValue const senf::typeIdValue()
{
return TypeIdValue();
}
+prefix_ std::ostream & senf::operator<<(std::ostream & os, TypeIdValue const & v)
+{
+ os << prettyName(v.id());
+ return os;
+}
+
///////////////////////////////cci.e///////////////////////////////////////
#undef prefix_
bool operator<(TypeIdValue const & other) const;
std::string name() const;
+ std::type_info const & id() const;
protected:
template <class Type>
TypeIdValue const typeIdValue();
- inline std::ostream & operator<<(std::ostream & os, TypeIdValue const & v)
- { return os << v.name(); }
-
+ std::ostream & operator<<(std::ostream & os, TypeIdValue const & v);
}
///////////////////////////////hh.e////////////////////////////////////////
-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
-
-// Custom includes
+ \brief TypeIdValue.test unit tests */
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+//#include "TypeIdValue.test.hh"
+//#include "TypeIdValue.test.ih"
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+// Custom includes
+#include "TypeIdValue.hh"
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
-{
- return reinterpret_cast<sockaddr *>(&addr_);
-}
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
-{
- return reinterpret_cast<sockaddr const *>(&addr_);
-}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
+BOOST_AUTO_UNIT_TEST(typeIdValue)
{
- return sizeof(addr_);
+ // We don't care for the ordering, just that the following compiles
+ (void) ( senf::typeIdValue<int>() < senf::typeIdValue<float>() );
+ (void) ( senf::typeIdValue<int>() == senf::typeIdValue<float>() );
}
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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:
namespace senf {
- /** \brief write the contents from Iterator i to i_end to the output stream in hexadecimal format.
+ /** \brief Write range [ i, i_end ) to output stream in hexadecimal format
*/
template <class Iterator>
void hexdump(Iterator i, Iterator i_end, std::ostream & stream, unsigned block_size=16);
-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
-
-// Custom includes
+ \brief hexdump.test unit tests */
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+//#include "hexdump.test.hh"
+//#include "hexdump.test.ih"
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+// Custom includes
+#include "hexdump.hh"
+#include <sstream>
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
-{
- return reinterpret_cast<sockaddr *>(&addr_);
-}
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
-{
- return reinterpret_cast<sockaddr const *>(&addr_);
-}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
+BOOST_AUTO_UNIT_TEST(hExDuMp)
{
- return sizeof(addr_);
+ char data[] = { 0x18, 0x19, 0x20, 0x21, 0x7c, 0x7d, 0x7e, 0x7f };
+ std::stringstream s;
+ senf::hexdump(data, data+sizeof(data), s, 8);
+ BOOST_CHECK_EQUAL( s.str(), " 0000 18 19 20 21 7c 7d 7e 7f .. ! |}..\n" );
}
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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:
-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
+ \brief pool_alloc_mixin.test unit tests */
+
+//#include "pool_alloc_mixin.test.hh"
+//#include "pool_alloc_mixin.test.ih"
// Custom includes
+#include "pool_alloc_mixin.hh"
+#include <boost/scoped_ptr.hpp>
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
-{
- return reinterpret_cast<sockaddr *>(&addr_);
+namespace {
+ class Test : public senf::pool_alloc_mixin<Test>
+ {};
}
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
+BOOST_AUTO_UNIT_TEST(poolAllocMixin)
{
- return reinterpret_cast<sockaddr const *>(&addr_);
-}
+#ifndef NDEBUG
+ BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
-{
- return sizeof(addr_);
+ {
+ boost::scoped_ptr<Test> test (new Test());
+ BOOST_CHECK_EQUAL( Test::allocCounter(), 1u );
+ }
+
+ BOOST_CHECK_EQUAL( Test::allocCounter(), 0u );
+#endif
}
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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:
-// Copyright (C) 2007
+// $Id$
+//
+// Copyright (C) 2007
// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
// Stefan Bund <g0dil@berlios.de>
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/** \file
- \brief GenericSockAddr inline non-template implementation */
+ \brief singleton.test unit tests */
+
+//#include "singleton.test.hh"
+//#include "singleton.test.ih"
// Custom includes
+#include "singleton.hh"
-#define prefix_ inline
-///////////////////////////////cci.p///////////////////////////////////////
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/test/test_tools.hpp>
-prefix_ senf::GenericSockAddr::GenericSockAddr()
-{}
+#define prefix_
+///////////////////////////////cc.p////////////////////////////////////////
-prefix_ struct sockaddr * senf::GenericSockAddr::sockaddr_p()
-{
- return reinterpret_cast<sockaddr *>(&addr_);
-}
+namespace {
+
+ class Test : public senf::singleton<Test>
+ {
+ friend class senf::singleton<Test>;
+
+ Test() : foo_(1234) {}
-prefix_ struct sockaddr const * senf::GenericSockAddr::sockaddr_p()
- const
-{
- return reinterpret_cast<sockaddr const *>(&addr_);
+ int foo_;
+
+ public:
+ using senf::singleton<Test>::instance;
+
+ int foo() { return foo_; }
+ };
}
-prefix_ unsigned senf::GenericSockAddr::sockaddr_len()
- const
+BOOST_AUTO_UNIT_TEST(sInGlEtOn)
{
- return sizeof(addr_);
+ BOOST_CHECK_EQUAL( Test::instance().foo(), 1234 );
}
-///////////////////////////////cci.e///////////////////////////////////////
+///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
\f
// 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:
debian/tmp/usr/lib/libSocket.a
-debian/tmp/usr/include/Scheduler
-debian/README usr/share/doc/libsenf-scheduler-dev
+debian/tmp/usr/include/Socket
+debian/README usr/share/doc/libsenf-socket-dev
cond=""
if [ "$1" = "-c" ]; then
shift
- cond='( -name *.h -o -name *.hh -o -name *.ih -o -name *.c -o -name *.cc -o -name *.cci -o -name *.ct -o -name *.cti )'
+ cond='( -name *.h -o -name *.hh -o -name *.ih -o -name *.c -o -name *.cc -o -name *.cci -o -name *.ct -o -name *.cti -o -name *.mpp )'
fi
set -f
--- /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
+
+def recursiveChildren(f):
+ rv = {}
+ map(rv.setdefault,f)
+ for c in f:
+ map(rv.setdefault,recursiveChildren(c.children()))
+ return rv.keys()
+
+def filterIncludes(files, extensions):
+ return [ f for f in files
+ if f.get_suffix() in extensions ]
+
+def filterDirectory(files, dir):
+ return [ f for f in files
+ if 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 = 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):
+ SCons.Environment.installFunc([self.target], [self.source], env)
+
+def generator(target, source, env, for_signature):
+ return [ SCons.Action.Action( Installer(trg, src),
+ SCons.Environment.installString([trg], [src], env) )
+ 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",
]
opts = None
return objects
-def InstallWithSources(env, targets, dir, sources, testSources = []):
+def InstallWithSources(env, targets, dir, sources, testSources = [], no_includes = False):
if type(sources) is type(()):
- sources = sources[0] + sources[1]
- if testSources:
- sources += testSources
+ sources, testSources = sources
if type(sources) is not type([]):
sources = [ sources ]
+ if type(testSources) is not type([]):
+ testSources = [ testSources ]
installs = []
installs.append( env.Install(dir, targets) )
- for source in sources:
- l = len(env.Dir('#').abspath)
- source = str(source)
- while '.' in source:
- source = os.path.splitext(source)[0]
- for ext in env['CPP_INCLUDE_EXTENSIONS']:
- f = env.File(source+ext)
- if f.exists():
- installs.append(env.Install(
- '$INCLUDEINSTALLDIR' + f.dir.abspath[l:], f))
+ if not no_includes:
+ target = env.Dir(env['INCLUDEINSTALLDIR']).Dir(
+ env.Dir('.').get_path(env.Dir(env['INSTALL_BASE'])))
+ source = targets
+ if testSources:
+ source.append( env.File('.test.bin') )
+
+ installs.append(env.InstallIncludes(
+ target = target,
+ source = targets,
+ INSTALL_BASE = env.Dir('.') ))
return installs
# The library is added to the list of default targets.
#
#\ingroup target
-def Lib(env, library, sources, testSources = None, LIBS = [], OBJECTS = []):
+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)
- install = InstallWithSources(env, lib, '$LIBINSTALLDIR', sources)
+ install = InstallWithSources(env, lib, '$LIBINSTALLDIR', sources, testSources, no_includes)
env.Alias('install_all', install)
return lib
## \brief Build Object from multiple sources
-def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = []):
+def Object(env, target, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
ob = None
if objects:
ob = env.Command(target+".o", objects, "ld -r -o $TARGET $SOURCES")
env.Default(ob)
- install = InstallWithSources(env, ob, '$OBJINSTALLDIR', sources)
+ install = InstallWithSources(env, ob, '$OBJINSTALLDIR', sources, testSources, no_includes)
env.Alias('install_all', install)
return ob
# construction environment parameters or the framework helpers.
#
# \ingroup target
-def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = []):
+def Binary(env, binary, sources, testSources = None, LIBS = [], OBJECTS = [], no_includes = False):
objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
program = None
if objects:
program = progEnv.Program(target=binary,source=objects+OBJECTS)
env.Default(program)
env.Depends(program, [ env.File(LibPath(x)) for x in LIBS ])
- install = InstallWithSources(env, program, '$BININSTALLDIR',
- sources, testSources)
+ install = InstallWithSources(env, program, '$BININSTALLDIR', sources, testSources,
+ no_includes)
env.Alias('install_all', install)
return program
--- /dev/null
+#!/bin/sh
+
+cd "`dirname "$0"`"
+
+scons -n install_all PREFIX="non-existing-target" \
+ | awk -F \" '/^Install file:/ && $2~/\.(h|hh|ih|ct|cti|cci|mpp)$/ {print $2}' \
+ | sort > installed_includes
+
+./find-sources.sh -c ! -name "*.cc" ! -path "./debian/*" ! -name "*.test.*" -printf "%P\n" \
+ | sort > source_includes
+
+comm -13 installed_includes source_includes
+
+rm -f installed_includes source_includes