env['BOOSTTESTLIB'] = 'boost_unit_test_framework' + env['BOOST_VARIANT']
env['BOOSTREGEXLIB'] = 'boost_regex' + env['BOOST_VARIANT']
env['BOOSTFSLIB'] = 'boost_filesystem' + env['BOOST_VARIANT']
+ env['BOOSTIOSTREAMSLIB'] = 'boost_iostreams' + env['BOOST_VARIANT']
env.Append(LIBPATH = [ '$BOOST_LIBDIR' ],
CPPPATH = [ '$BOOST_INCLUDES' ])
LIBPATH = [ '$LOCALLIBDIR' ])
if env['final']:
- env.Append(CXXFLAGS = [ '-O3' ],
- CPPDEFINES = [ 'NDEBUG' ])
+ env.Append(CXXFLAGS = [ '-O3' ])
else:
+ # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails:
+ # CPPDEFINES = [ '_GLIBCXX_DEBUG' ],
env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ],
- # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails.
- # CPPDEFINES = [ '_GLIBCXX_DEBUG' ],
+ CPPDEFINES = [ 'SENF_DEBUG' ],
LINKFLAGS = [ '-g' ])
env.Append(CPPDEFINES = [ '$EXTRA_DEFINES' ],
## \brief Return path of a built library within $LOCALLIBDIR
# \internal
-def LibPath(lib): return '$LOCALLIBDIR/lib%s.a' % lib
+def LibPath(lib): return '${LOCALLIBDIR}/${LIBPREFIX}%s${LIBADDSUFFIX}${LIBSUFFIX}' % lib
+
+def Test(env, sources, LIBS = [], OBJECTS = []):
+ test = env.BoostUnitTests(
+ target = 'test',
+ objects = [],
+ test_sources = sources,
+ LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ],
+ OBJECTS = OBJECTS,
+ DEPENDS = [ env.File(LibPath(x)) for x in LIBS ])
+ env.Alias('all_tests', test)
+ env.Alias(env.File('test'), test)
+
## \brief Build object files
#
target = 'test',
objects = objects,
test_sources = testSources,
- LIBS = LIBS,
+ LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ],
OBJECTS = OBJECTS,
DEPENDS = [ env.File(LibPath(x)) for x in LIBS ])
env.Alias('all_tests', test)
docs,
SCons.Action.Action(("for html in %s/*.html; do " +
" echo $$html;" +
- " sed -e 's/id=\"current\"/class=\"current\"/' $${html}" +
- " | tidy -ascii -q --show-warnings no --fix-uri no " +
- " | xsltproc --nonet --html --stringparam topdir %s -o $${html}.new %s - 2>&1" +
- " | grep '^-'" +
- " | grep -v 'ID .* already defined';" +
- " mv $${html}.new $${html}; " +
- "done")
+ " mv $${html} $${html}.orig;" +
+ " sed -e 's/id=\"current\"/class=\"current\"/' $${html}.orig" +
+ " | tidy -ascii -q --wrap 0 --show-warnings no --fix-uri no " +
+ " | sed -e 's/name=\"\([^\"]*\)\"\([^>]*\) id=\"\\1\"/name=\"\\1\"\\2/g'" +
+ " | xsltproc --novalid --nonet --html --stringparam topdir %s -o $${html} %s -;"
+ "done; true")
% (htmlnode.dir.abspath, reltopdir, xslfile.abspath)))
for doc in docs:
env.Depends(doc, xslfile)
objects = Objects(env,sources,testSources,LIBS=LIBS,OBJECTS=OBJECTS)
ob = None
if objects:
- ob = env.Command(target+".o", objects, "ld -r -o $TARGET $SOURCES")
+ 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)
program = None
if objects:
progEnv = env.Copy()
- progEnv.Prepend(LIBS = LIBS)
+ progEnv.Prepend(LIBS = [ x + '$LIBADDSUFFIX' for x in LIBS ])
program = progEnv.ProgramNoScan(target=binary,source=objects+OBJECTS)
env.Default(program)
env.Depends(program, [ env.File(LibPath(x)) for x in LIBS ])