+# -*- python -*-
+
Import('env')
import SENFSCons
###########################################################################
-SENFSCons.Binary(env, 'mcsniffer', SENFSCons.GlobSources(env),
- OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o' ]);
+sources, tests, includes = SENFSCons.Glob(env)
+
+env.Default(env.Program('mcsniffer', sources + [ '#/Packets/DefaultBundle/DefaultBundle.o' ]))
###########################################################################
-SENFSCons.Binary(env, 'multimcloop', [ 'MultiMCLoop.cc' ])
+env.Default(env.Program('multimcloop', [ 'MultiMCLoop.cc' ]))
###########################################################################
-SENFSCons.Binary(env, 'ratestuffer', SENFSCons.GlobSources(env));
+sources, tests, includes = SENFSCons.Glob(env)
+
+env.Default(env.Program('ratestuffer', sources))
+
SENFSCons.Doxygen(env, extra_sources=[
env.Dia2Png('ratestuffer.dia')
])
+# -*- python -*-
+
Import('env')
import SENFSCons
###########################################################################
-SENFSCons.Binary(env, 'sniffer', SENFSCons.GlobSources(env),
- OBJECTS = [ '#/Packets/DefaultBundle/DefaultBundle.o',
- '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o',
- '#/Packets/80221Bundle/80221Bundle.o',
- '#/Packets/80211Bundle/80211Bundle.o' ] );
+sources, tests, includes = SENFSCons.Glob(env)
+
+env.Program('sniffer', sources + [ '#/Packets/DefaultBundle/DefaultBundle.o',
+ '#/Packets/MPEGDVBBundle/MPEGDVBBundle.o',
+ '#/Packets/80221Bundle/80221Bundle.o',
+ '#/Packets/80211Bundle/80211Bundle.o' ] )
SENFSCons.Doxygen(env)
###########################################################################
-SENFSCons.Binary(env, 'client', 'client.cc');
-SENFSCons.Binary(env, 'server', 'server.cc');
+env.Program('client', 'client.cc')
+env.Program('server', 'server.cc')
###########################################################################
-SENFSCons.Binary(env, 'udpClient', 'udpClient.cc');
-SENFSCons.Binary(env, 'udpServer', 'udpServer.cc',);
+env.Default(env.Program('udpClient', 'udpClient.cc'))
+env.Default(env.Program('udpServer', 'udpServer.cc'))
+
SENFSCons.Doxygen(env)
+# -*- python -*-
+
Import('env')
import SENFSCons, glob
if f not in ('all_includes.hh','PPI.hh') \
and not f.endswith('.test.hh') ])
-sources, includes = SENFSCons.Glob(env, subdirs=[ 'detail' ])
+sources, tests, includes = SENFSCons.Glob(env, subdirs=[ 'detail' ])
+
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
-SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env, extra_sources=[
env.Dia2Png('scenario.dia'),
env.Dia2Png('classes.dia'),
env.Dia2Png('ratestuffer.dia'),
])
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
###########################################################################
-(sources, tests), includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Object(env, target='80211Bundle', sources=sources,
- testSources = tests + [ '80211Bundle.o' ])
-SENFSCons.Lib(env, sources=sources)
+objects = env.Object(sources)
+cobject = env.CombinedObject('80211Bundle', objects)
+env.Append(ALLOBJECTS = objects)
+env.BoostUnitTest('test', tests + cobject)
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
SConscript(glob.glob("*/SConscript"))
###########################################################################
-(sources, tests), includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Object(env, target = '80221Bundle', sources=sources,
- testSources = tests + [ '80221Bundle.o' ])
-SENFSCons.Lib(env, sources)
+objects = env.Object(sources)
+env.Install('$OBJINSTALLDIR', env.Default( env.CombinedObject('80221Bundle', objects) ))
+env.Append(ALLOBJECTS = objects)
+env.BoostUnitTest('test', tests + ['80221Bundle.o'])
+
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
SConscript(glob.glob("*/SConscript"))
###########################################################################
-(sources, tests), includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Object(env, target='DefaultBundle', sources=sources,
- testSources=tests + [ 'DefaultBundle.o' ])
-SENFSCons.Lib(env, sources)
+objects = env.Object(sources)
+cobject = env.CombinedObject('DefaultBundle', objects)
+env.Append(ALLOBJECTS = objects)
+env.BoostUnitTest('test', tests + cobject)
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
SConscript(glob.glob("*/SConscript"))
###########################################################################
-SENFSCons.Test(env, sources = glob.glob("*.test.cc"))
+env.BoostUnitTest('test', glob.glob("*.test.cc"))
###########################################################################
-(sources, tests), includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Object(env, target='MPEGDVBBundle', sources=sources,
- testSources = tests + [ 'MPEGDVBBundle.o' ])
-SENFSCons.Lib(env, sources)
+objects = env.Object(sources)
+cobject = env.CombinedObject('MPEGDVBBundle', objects)
+env.Append(ALLOBJECTS = objects)
+env.BoostUnitTest('test', tests + cobject)
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
###########################################################################
-sources, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
+
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
-SENFSCons.Lib(env, sources)
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png("structure.dia"),
env.Dia2Png("80221Bundle/TLV.dia"),
env.PkgDraw("MPEGDVBBundle/TransportPacket.hh"),
])
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
SConscript(glob.glob("*/SConscript"))
env.Tool('Doxygen', [ 'senfscons' ])
env.Tool('Dia2Png', [ 'senfscons' ])
env.Tool('PkgDraw', [ 'senfscons' ])
+env.Tool('InstallSubdir', [ 'senfscons' ])
env.Tool('CopyToDir', [ 'senfscons' ])
-env.Tool('CompileCheck', [ 'senfscons' ])
env.Tool('Boost', [ 'senfscons' ])
-env.Tool('BoostUnitTest', [ 'senfscons' ])
-env.Tool('InstallSubdir', [ 'senfscons' ])
+env.Tool('CombinedObject', [ 'senfscons' ])
+env.Tool('PhonyTarget', [ 'senfscons' ])
env.Help("""
Additional top-level build targets:
type = env['final'] and "final" or env['debug'] and "debug" or "normal"
return env[self._var + "_" + type]
+env.Replace(
+ PKGDRAW = 'doclib/pkgdraw',
+)
+
env.Append(
ENV = { 'PATH' : os.environ.get('PATH') },
CLEAN_PATTERNS = [ '*~', '#*#', '*.pyc', 'semantic.cache', '.sconsign*', '.sconsign' ],
CPPPATH = [ '#/include' ],
LOCALLIBDIR = '#',
LIBPATH = [ '$LOCALLIBDIR' ],
- LIBS = [ 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB',
- '$BOOSTFSLIB' ],
- TEST_EXTRA_LIBS = [ '$LIBSENF$LIBADDSUFFIX' ],
+ LIBS = [ '$LIBSENF$LIBADDSUFFIX', 'rt', '$BOOSTREGEXLIB',
+ '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB', '$BOOSTFSLIB' ],
+ TEST_EXTRA_LIBS = [ ],
PREFIX = '/usr/local',
LIBINSTALLDIR = '$PREFIX/lib',
if not env.GetOption('clean') and not os.path.exists("local_config.hh"):
Execute(Touch("local_config.hh"))
-###########################################################################
-# Define build targets
-
-# Before defining any targets, check wether this is the first build in
-# pristine directory tree. If so, call 'scons prepare' so the dependencies
-# created later are correct (yes, this is a hack :-( )
-
if not env.GetOption('clean') and not os.path.exists(".prepare-stamp") \
and not os.environ.get("SCONS") and COMMAND_LINE_TARGETS != [ 'prepare' ]:
env.Execute([ "scons prepare" ])
-env.Clean('all', '.prepare-stamp')
# Load SConscripts. Need to load some first (they change the global environment)
initSConscripts = [
SConscript(list(set(glob.glob("*/SConscript")) - set(initSConscripts)))
-# Define the main targets
-env.Alias('all', [ 'default', 'all_tests', 'all_docs' ])
+###########################################################################
+# Define build targets
+#### doc
env.Depends(SENFSCons.Doxygen(env), env.Value(env['ENV']['REVISION']))
+#### libsenf.a
libsenf = env.Library(env.subst("$LIBSENF$LIBADDSUFFIX"), env['ALLOBJECTS'])
env.Default(libsenf)
-env.Clean('all', libsenf)
-env.Alias('default', libsenf)
env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = [ 'config.hh' ])
+env.Install('$LIBINSTALLDIR', libsenf)
-env.Alias('install_all', env.Install('$LIBINSTALLDIR', libsenf))
-
-if env.GetOption('clean'):
- env.Clean('all', [ os.path.join(path,f)
- for path, subdirs, files in os.walk('.')
- for pattern in env['CLEAN_PATTERNS']
- for f in fnmatch.filter(files,pattern) ])
+#### install_all, default, all_tests, all
+env.Alias('install_all', env.FindInstalledFiles())
+env.Alias('default', DEFAULT_TARGETS)
+env.Alias('all_tests', env.FindAllBoostUnitTests())
+env.Alias('all', [ 'default', 'all_tests', 'all_docs' ])
-SENFSCons.PhonyTarget(env, 'prepare', [ 'true' ])
+#### prepare
+env.PhonyTarget('prepare', [], [])
-SENFSCons.PhonyTarget(env, 'valgrind', [ """
+#### valgrind
+env.PhonyTarget('valgrind', [ 'all_tests' ], [ """
find -name .test.bin
| while read test; do
echo;
$$test $BOOSTTESTARGS;
[ $$? -ne 99 ] || exit 1;
done
-""".replace("\n"," ") ], [ 'all_tests' ])
+""".replace("\n"," ") ])
+
+#### clean
+env.Clean('all', '.prepare-stamp')
+env.Clean('all', libsenf)
+env.Clean('all', 'linklint')
+
+if env.GetOption('clean'):
+ env.Clean('all', [ os.path.join(path,f)
+ for path, subdirs, files in os.walk('.')
+ for pattern in env['CLEAN_PATTERNS']
+ for f in fnmatch.filter(files,pattern) ])
if not env.GetOption('clean') and not os.path.exists(".prepare-stamp"):
Execute(Touch(".prepare-stamp"))
###########################################################################
-sources, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
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, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
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, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
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, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
SConscript(glob.glob("*/SConscript"))
-sources, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
+sources, tests, includes = SENFSCons.Glob(env)
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
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, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib( env, sources)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
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, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources = sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png('SocketLibrary-classes.dia'),
env.Dia2Png('FhHierarchy.dia'),
env.Dia2Png('Protocols.dia'),
env.Dia2Png('Handle.dia'),
])
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
###########################################################################
-sources, includes = SENFSCons.Glob(env, exclude=['testServer.cc'])
+sources, tests, includes = SENFSCons.Glob(env, exclude=['testServer.cc'])
-SENFSCons.Lib(env, sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
-
-SENFSCons.Binary(env, "testServer", ['testServer.cc'])
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
+env.Program('testServer', ['testServer.cc'])
###########################################################################
-sources, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
if ( f not in ('all_includes.hh','Logger.hh','SenfLog.hh')
and not f.endswith('.test.hh') ) ])
-sources, includes = SENFSCons.Glob(env)
+sources, tests, includes = SENFSCons.Glob(env)
-SENFSCons.Lib(env, sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
###########################################################################
-sources, includes = SENFSCons.Glob(env, subdirs=[ 'impl' ])
+sources, tests, includes = SENFSCons.Glob(env, subdirs=[ 'impl' ])
-SENFSCons.Lib(env, sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
SConscript(glob.glob("*/SConscript"))
###########################################################################
-sources, includes = SENFSCons.Glob(env, exclude=[ 'telnetServer.cc'])
+sources, tests, includes = SENFSCons.Glob(env, exclude=[ 'telnetServer.cc'])
-SENFSCons.Lib(env, sources)
+env.Append(ALLOBJECTS = env.Object(sources))
+env.BoostUnitTest('test', tests)
SENFSCons.Doxygen(env)
-
-env.InstallSubdir(target = '$INCLUDEINSTALLDIR', source = includes)
-
-SENFSCons.Binary(env, "telnetServer", ['telnetServer.cc'])
+env.InstallSubdir('$INCLUDEINSTALLDIR', includes)
+env.Program('telnetSserver', ['telnetServer.cc'])
BUILDPACKAGE_COMMAND = "dpkg-buildpackage -us -uc -rfakeroot $DPKG_IGNORED_FILES_OPTS",
)
-SENFSCons.PhonyTarget(env, 'deb', [
+env.PhonyTarget('deb', [], [
checkLocalConf,
updateRevision,
"$BUILDPACKAGE_COMMAND",
"fakeroot ./debian/rules debclean"
])
-SENFSCons.PhonyTarget(env, 'debsrc', [
+env.PhonyTarget('debsrc', [], [
updateRevision,
"$BUILDPACKAGE_COMMAND -S",
])
-SENFSCons.PhonyTarget(env, 'debbin', [
+env.PhonyTarget('debbin', [], [
checkLocalConf,
updateRevision,
"$BUILDPACKAGE_COMMAND -b",
DOXYGENCOM = "doclib/doxygen.sh $DOXYOPTS $SOURCE",
)
-SENFSCons.PhonyTarget(env, 'linklint', [
+env.PhonyTarget('linklint', [], [
'rm -rf linklint',
'linklint -doc linklint -limit 99999999 `find -type d -name html -printf "/%P/@ "`',
'[ ! -r linklint/errorX.html ] || python doclib/linklint_addnames.py <linklint/errorX.html >linklint/errorX.html.new',
'echo -e "\\nLokal link check results: linklint/index.html\\nRemote link check results: linklint/urlindex.html\\n"',
])
-env.Clean('all', env.Dir('linklint'))
-
-SENFSCons.PhonyTarget(env, 'fixlinks', [
+env.PhonyTarget('fixlinks', [], [
'python doclib/fix-links.py -v -s .svn -s linklint -s debian linklint/errorX.txt linklint/errorAX.txt',
])
-# Provide environment variables for boost libraries
+import SCons.Script
+import SCons.Script.SConscript
+import SCons.Defaults
+import os.path
+import os
+import sys
+import tempfile
+import SCons.Scanner.C
+
+# ARGH ... Why do they put a '+' in the module name ????????
+SCons.Tool.cplusplus=getattr(__import__('SCons.Tool.c++', globals(), locals(), []).Tool, 'c++')
+
+_ALL_TESTS = []
+
+def scanTests(f):
+ tests = {}
+ name = start = None
+ linenr= 0
+ for line in f:
+ linenr += 1
+ if line.startswith('COMPILE_FAIL(') and ')' in line:
+ name = line.split('(',1)[-1].split(')',1)[0]
+ start = linenr
+ elif line.startswith('}') and name and start:
+ tests[name] = (start, linenr)
+ return tests
+
+def CompileCheck(target, source, env):
+ tests = scanTests(file(source[0].abspath))
+ cenv = env.Clone()
+ cenv.Append( CPPDEFINES = [ 'COMPILE_CHECK' ] )
+ out = tempfile.TemporaryFile()
+ cenv['SPAWN'] = lambda sh, escape, cmd, args, env, pspawn=cenv['PSPAWN'], out=out: \
+ pspawn(sh, escape, cmd, args, env, out, out)
+ SCons.Script.Action('$CXXCOM').execute(target, source, cenv)
+ passedTests = {}
+ delay_name = None
+ out.seek(0)
+ for error in out.read().splitlines():
+ elts = error.split(':',2)
+ if len(elts) != 3 : continue
+ filename, line, message = elts
+ if not os.path.exists(filename) : continue
+ try: line = int(line)
+ except ValueError : continue
+ message = message.strip()
+
+ if delay_name and not message.startswith('instantiated from '):
+ print "Passed test '%s': %s" % (delay_name, message)
+ delay_name = None
+ continue
+
+ filename = os.path.abspath(filename)
+ if filename != source[0].abspath : continue
+
+ for name,lines in tests.iteritems():
+ if line >= lines[0] and line <= lines[1]:
+ passedTests[name] = 1
+ if message.startswith('instantiated from '):
+ delay_name = name
+ else:
+ print "Passed test '%s': %s" % (name, message)
+ if delay_name:
+ print "Passed test '%s': <unknown message ??>" % delay_name
+ failedTests = set(tests.iterkeys()) - set(passedTests.iterkeys())
+ if failedTests:
+ for test in failedTests:
+ print "Test '%s' FAILED" % test
+ print
+ print "*** %d tests FAILED" % len(failedTests)
+ if os.path.exists(target[0].abspath):
+ os.unlink(target[0].abspath)
+ return 1
+ file(target[0].abspath,"w").close()
+ return 0
+
+CompileCheck = SCons.Script.Action(CompileCheck)
+
+def BoostUnitTest(env, target=None, source=None, **kw):
+ target = env.arg2nodes(target)[0]
+ source = env.arg2nodes(source)
+
+ binnode = target.dir.File('.' + target.name + '.bin')
+ stampnode = target.dir.File('.' + target.name + '.stamp')
+
+ bin = env.Program(binnode, source,
+ LIBS = env['LIBS'] + [ '$TEST_EXTRA_LIBS' ],
+ _LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -Wl,-Bdynamic ' + env['_LIBFLAGS'],
+ **kw)
+
+ stamp = env.Command(stampnode, bin,
+ [ '$SOURCE $BOOSTTESTARGS',
+ 'touch $TARGET' ],
+ **kw)
+
+ alias = env.Command(env.File(target), stamp, [])
+
+ compileTests = [ src for src in source
+ if src.suffix in SCons.Tool.cplusplus.CXXSuffixes \
+ and src.exists() \
+ and 'COMPILE_CHECK' in file(str(src)).read() ]
+ if compileTests:
+ env.Depends(alias, env.CompileCheck(source = compileTests))
+
+ _ALL_TESTS.append(alias)
+
+ return alias
+
+def FindAllBoostUnitTests(env, target, source):
+ return _ALL_TESTS
def generate(env):
env.SetDefault(
BOOSTFSLIB = 'boost_filesystem$BOOST_VARIANT',
BOOSTIOSTREAMSLIB = 'boost_iostreams$BOOST_VARIANT',
BOOSTSIGNALSLIB = 'boost_signals$BOOST_VARIANT',
+
+ BOOSTTESTARGS = [ '--build_info=yes', '--log_level=test_suite' ],
)
+ env['BUILDERS']['BoostUnitTest'] = BoostUnitTest
+ env['BUILDERS']['FindAllBoostUnitTests'] = FindAllBoostUnitTests
+ env['BUILDERS']['CompileCheck'] = env.Builder(
+ action = CompileCheck,
+ suffix = '.checked',
+ src_suffix = '.cc',
+ source_scanner = SCons.Scanner.C.CScanner(),
+ single_source=1
+ )
+
def exists(env):
return True
+++ /dev/null
-## \file
-# \brief BoostUnitTests build
-
-## \package senfscons.BoostUnitTests
-# \brief Builder utilizing the <a href="http://www.boost.org/libs/test/doc/index.html">Boost.Test</a> unit-test framework
-#
-# The BoostUnitTests builder will build a unit-test executable using
-# the <a
-# href="http://www.boost.org/libs/test/doc/index.html">Boost.Test</a>
-# library. After building, the unit-test will be executed.
-#
-# This builder is used by the SENFSCons.Object() helper to build the
-# unit test.
-#
-# \par Construction Envrionment Variables:
-# <table class="senf">
-# <tr><td>\c BOOSTTESTLIB</td><td>Name of the library to use, defaults to \c boost_unit_test_framework</td></tr>
-# <tr><td>\c BOOSTTESTARGS</td><td>Command line arguments of the test, defaults to <tt>--build_info=yes --log_level=test_suite</tt></td></tr>
-# </table>
-#
-# \todo This is not really a builder. This should be rewritten as one
-# \ingroup builder
-
-import SCons.Script.SConscript
-import SCons.Defaults
-import os.path
-import os
-
-# ARGH ... Why do they put a '+' in the module name ????????
-SCons.Tool.cplusplus=getattr(__import__('SCons.Tool.c++', globals(), locals(), []).Tool, 'c++')
-
-def BoostUnitTest(env, target=None, source=None, **kw):
- target = env.arg2nodes(target)[0]
- source = env.arg2nodes(source)
-
- binnode = target.dir.File('.' + target.name + '.bin')
- stampnode = target.dir.File('.' + target.name + '.stamp')
-
- bin = env.Program(binnode, source,
- LIBS = env['LIBS'] + [ '$TEST_EXTRA_LIBS' ],
- _LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -Wl,-Bdynamic ' + env['_LIBFLAGS'],
- **kw)
-
- stamp = env.Command(stampnode, bin,
- [ '$SOURCE $BOOSTTESTARGS',
- 'touch $TARGET' ],
- **kw)
-
- alias = env.Command(env.File(target), stamp, [ 'true' ])
-
- compileTests = [ src for src in source
- if src.suffix in SCons.Tool.cplusplus.CXXSuffixes \
- and src.exists() \
- and 'COMPILE_CHECK' in file(str(src)).read() ]
- if compileTests:
- env.Depends(alias, env.CompileCheck(source = compileTests))
-
- return alias
-
-def generate(env):
- env['BOOSTTESTLIB'] = 'boost_unit_test_framework'
- env['BOOSTTESTARGS'] = [ '--build_info=yes', '--log_level=test_suite' ]
- env['BUILDERS']['BoostUnitTest'] = BoostUnitTest
-
-def exists(env):
- return 1
--- /dev/null
+
+def generate(env):
+
+ builder = env.Builder(
+ action = [ '$LDCOMBINECOM $TARGET $SOURCES' ],
+ suffix = '.o',
+ ensure_suffix = 1,
+ src_suffix = '.o',
+ src_builder = 'Object')
+
+ env['BUILDERS']['CombinedObject'] = builder
+
+ env.SetDefault(LDCOMBINECOM = 'ld -r -o')
+
+def exists(env):
+ return True
+++ /dev/null
-import os, os.path, sys
-import tempfile
-from SCons.Script import *
-import SCons.Scanner.C
-
-def scanTests(f):
- tests = {}
- name = start = None
- linenr= 0
- for line in f:
- linenr += 1
- if line.startswith('COMPILE_FAIL(') and ')' in line:
- name = line.split('(',1)[-1].split(')',1)[0]
- start = linenr
- elif line.startswith('}') and name and start:
- tests[name] = (start, linenr)
- return tests
-
-def CompileCheck(target, source, env):
- tests = scanTests(file(source[0].abspath))
- cenv = env.Clone()
- cenv.Append( CPPDEFINES = [ 'COMPILE_CHECK' ] )
- out = tempfile.TemporaryFile()
- cenv['SPAWN'] = lambda sh, escape, cmd, args, env, pspawn=cenv['PSPAWN'], out=out: \
- pspawn(sh, escape, cmd, args, env, out, out)
- Action('$CXXCOM').execute(target, source, cenv)
- passedTests = {}
- delay_name = None
- out.seek(0)
- for error in out.read().splitlines():
- elts = error.split(':',2)
- if len(elts) != 3 : continue
- filename, line, message = elts
- if not os.path.exists(filename) : continue
- try: line = int(line)
- except ValueError : continue
- message = message.strip()
-
- if delay_name and not message.startswith('instantiated from '):
- print "Passed test '%s': %s" % (delay_name, message)
- delay_name = None
- continue
-
- filename = os.path.abspath(filename)
- if filename != source[0].abspath : continue
-
- for name,lines in tests.iteritems():
- if line >= lines[0] and line <= lines[1]:
- passedTests[name] = 1
- if message.startswith('instantiated from '):
- delay_name = name
- else:
- print "Passed test '%s': %s" % (name, message)
- if delay_name:
- print "Passed test '%s': <unknown message ??>" % delay_name
- failedTests = set(tests.iterkeys()) - set(passedTests.iterkeys())
- if failedTests:
- for test in failedTests:
- print "Test '%s' FAILED" % test
- print
- print "*** %d tests FAILED" % len(failedTests)
- if os.path.exists(target[0].abspath):
- os.unlink(target[0].abspath)
- return 1
- file(target[0].abspath,"w").close()
- return 0
-
-CompileCheck = Action(CompileCheck)
-
-def generate(env):
-
- builder = env.Builder(
- action = CompileCheck,
- suffix = '.checked',
- src_suffix = '.cc',
- source_scanner = SCons.Scanner.C.CScanner(),
- single_source=1
- )
-
- env.Append(BUILDERS = { 'CompileCheck': builder })
-
-def exists(env):
- return True
import SCons.Builder, SCons.Defaults
def emitter(source, target, env):
- return ([ os.path.join(str(target[0]),source[0].name) ], source)
+ source = env.arg2nodes(source, env.fs.File)
+ target = env.arg2nodes(target, env.fs.Dir)
+ return ([ target[0].File(src.name) for src in source ], source)
+
+def generator(source, target, env, for_signature):
+ return [ SCons.Defaults.Copy(t, s) for s, t in zip(source, target) ]
CopyToDir = SCons.Builder.Builder(emitter = emitter,
- action = SCons.Defaults.Copy("$TARGET","$SOURCE"),
- single_source = True)
+ generator = generator)
def generate(env):
env['BUILDERS']['CopyToDir'] = CopyToDir
--- /dev/null
+
+def PhonyTarget(env, target, source = None, action = None):
+ return env.AlwaysBuild(env.Alias(target, source, env.Action(action)))
+
+def generate(env):
+ env['BUILDERS']['PhonyTarget'] = PhonyTarget
+
+def exists(env):
+ return True
def generate(env):
env['BUILDERS']['PkgDraw'] = PkgDraw
- env['PKGDRAW'] = "doclib/pkgdraw"
+ env['PKGDRAW'] = "pkgdraw"
env['PKGDRAWCOM'] = "$PKGDRAW $SOURCE $TARGET $PKGDRAWPACKETS -- $CPPFLAGS $_CPPINCFLAGS $_CPPDEFFLAGS"
env['PKGDRAWPACKETS'] = ''
+++ /dev/null
-import sys, glob
-sys.path.append('senfscons')
-import SENFSCons
-
-###########################################################################
-
-SENFSCons.UseBoost();
-SENFSCons.UseSTLPort();
-env = SENFSCons.MakeEnvironment();
-
-env.Append(
- CPPPATH = [ '#' ]
-)
-
-Export('env')
-
-SConscript(glob.glob("*/SConscript"))
-
-SENFSCons.StandardTargets(env)
-SENFSCons.GlobalTargets(env)
import SCons.Defaults, SCons.Action
from SCons.Script import *
-def GlobSources(env, exclude=[], subdirs=[]):
+def Glob(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:
testSources += glob.glob(os.path.join(subdir,"*.test.cc"))
sources += [ x for x in glob.glob(os.path.join(subdir,"*.cc"))
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):
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) )
-
-def Test(env, sources):
- test=env.BoostUnitTest( target = 'test', source = sources )
- env.Alias('all_tests', test)
- return test
-
-def Objects(env, sources, testSources = None):
- if type(sources) == type(()):
- testSources = sources[1]
- sources = sources[0]
- if type(sources) is not type([]):
- sources = [ sources ]
-
- objects = env.Object(sources)
-
- if testSources:
- Test(env, testSources)
-
- return objects
+ return ( sources, testSources, includes )
def Doxygen(env, doxyfile = "Doxyfile", extra_sources = []):
# There is one small problem we need to solve with this builder: The Doxygen builder reads
# Module name is derived from the doxyfile path
# Utils/Console/Doxyfile -> Utils_Console
- module = doxyfile.dir.abspath[len(env.Dir('#').abspath)+1:].replace('/','_')
- if not module : module = "Main"
+ module = doxyfile.dir.get_path(env.Dir('#')).replace('/','_')
+ if module == '.' : module = "Main"
# Rule to generate tagfile
# (need to exclude the 'clean' case, otherwise we'll have duplicate nodes)
# (need to exclude the 'clean' case otherwise there are multiple ways to clean the copies)
if not env.GetOption('clean'):
if extra_sources:
- env.Depends(doc,
- [ env.CopyToDir( source=source, target=doc[0].dir )
- for source in extra_sources ])
+ env.Depends(doc, env.CopyToDir(doc[0].dir, extra_sources))
# Install documentation into DOCINSTALLDIR
l = len(env.Dir('#').abspath)
- env.Alias('install_all',
- env.Command('$DOCINSTALLDIR' + doc[0].dir.abspath[l:], doc[0].dir,
- [ SCons.Defaults.Copy('$TARGET','$SOURCE') ]))
+ env.Install(env.Dir('$DOCINSTALLDIR').Dir(doc[0].dir.get_path('#')), doc[0].dir)
# Useful aliases
env.Alias('all_docs', doc)
return doc
-def Lib(env, sources, testSources = None, OBJECTS = []):
- objects = Objects(env,sources,testSources)
- env.Append(ALLOBJECTS = objects)
- return objects
-
-def Object(env, target, sources, testSources = None, OBJECTS = []):
- objects = Objects(env,sources,testSources)
- ob = env.Command(target+"${OBJADDSUFFIX}${OBJSUFFIX}", objects+OBJECTS,
- [ "ld -r -o $TARGET $SOURCES" ])
- env.Default(ob)
- env.Alias('default', ob)
- env.Alias('install_all', env.Install("$OBJINSTALLDIR", ob))
- return ob
-
-def Binary(env, binary, sources, testSources = None, OBJECTS = []):
- objects = Objects(env, sources, testSources)
- program = env.Program(target = binary,
- source = objects+OBJECTS,
- LIBS = [ '$LIBSENF$LIBADDSUFFIX' ] + env['LIBS'])
- env.Default(program)
- env.Alias('default', program)
- env.Alias('install_all', env.Install('$BININSTALLDIR', program))
- return program
-
def AllIncludesHH(env, headers):
headers.sort()
target = env.File("all_includes.hh")
file(target.abspath,"w").write("".join([ '#include "%s"\n' % f
for f in headers ]))
env.Clean('all', target)
-
-def PhonyTarget(env, target, action, sources=[]):
- env.AlwaysBuild(env.Alias(target, sources, env.Action(action)))
+++ /dev/null
-<?xml version="1.0"?>\r
-<xsl:stylesheet \r
- version="1.0"\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:str="http://exslt.org/strings"\r
- xmlns:func="http://exslt.org/functions"\r
- xmlns:exsl="http://exslt.org/common"\r
- extension-element-prefixes="str exsl func">\r
- \r
-<func:function name="str:split">\r
- <xsl:param name="string" select="''" />\r
- <xsl:param name="pattern" select="' '" />\r
- <xsl:choose>\r
- <xsl:when test="not($string)">\r
- <func:result select="/.." />\r
- </xsl:when>\r
- <xsl:when test="not(function-available('exsl:node-set'))">\r
- <xsl:message terminate="yes">\r
- ERROR: EXSLT - Functions implementation of str:split relies on exsl:node-set().\r
- </xsl:message>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:variable name="tokens">\r
- <xsl:choose>\r
- <xsl:when test="not($pattern)">\r
- <xsl:call-template name="str:_split-characters">\r
- <xsl:with-param name="string" select="$string" />\r
- </xsl:call-template>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:call-template name="str:_split-pattern">\r
- <xsl:with-param name="string" select="$string" />\r
- <xsl:with-param name="pattern" select="$pattern" />\r
- </xsl:call-template>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </xsl:variable>\r
- <func:result select="exsl:node-set($tokens)/token" />\r
- </xsl:otherwise>\r
- </xsl:choose>\r
-</func:function>\r
-\r
-<xsl:template name="str:_split-characters">\r
- <xsl:param name="string" />\r
- <xsl:if test="$string">\r
- <token><xsl:value-of select="substring($string, 1, 1)" /></token>\r
- <xsl:call-template name="str:_split-characters">\r
- <xsl:with-param name="string" select="substring($string, 2)" />\r
- </xsl:call-template>\r
- </xsl:if>\r
-</xsl:template>\r
-\r
-<xsl:template name="str:_split-pattern">\r
- <xsl:param name="string" />\r
- <xsl:param name="pattern" />\r
- <xsl:choose>\r
- <xsl:when test="contains($string, $pattern)">\r
- <xsl:if test="not(starts-with($string, $pattern))">\r
- <token><xsl:value-of select="substring-before($string, $pattern)" /></token>\r
- </xsl:if>\r
- <xsl:call-template name="str:_split-pattern">\r
- <xsl:with-param name="string" select="substring-after($string, $pattern)" />\r
- <xsl:with-param name="pattern" select="$pattern" />\r
- </xsl:call-template>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <token><xsl:value-of select="$string" /></token>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
-</xsl:template>\r
-\r
- <!-- ==================================================================== -->\r
- <!-- node-set str:replace(string,object,object) -->\r
- <!-- -->\r
- <!-- This implements the EXSLT str:replace function -->\r
- <!-- -->\r
- <!-- Copyright Jeni Tenison -->\r
- <!-- ==================================================================== -->\r
-\r
- <func:function name="str:replace">\r
- <xsl:param name="string" select="''" />\r
- <xsl:param name="search" select="/.." />\r
- <xsl:param name="replace" select="/.." />\r
- <xsl:choose>\r
- <xsl:when test="not($string)">\r
- <func:result select="/.." />\r
- </xsl:when>\r
- <xsl:when test="function-available('exsl:node-set')">\r
- <!-- this converts the search and replace arguments to node sets\r
- if they are one of the other XPath types -->\r
- <xsl:variable name="search-nodes-rtf">\r
- <xsl:copy-of select="$search" />\r
- </xsl:variable>\r
- <xsl:variable name="replace-nodes-rtf">\r
- <xsl:copy-of select="$replace" />\r
- </xsl:variable>\r
- <xsl:variable name="replacements-rtf">\r
- <xsl:for-each select="exsl:node-set($search-nodes-rtf)/node()">\r
- <xsl:variable name="pos" select="position()" />\r
- <replace search="{.}">\r
- <xsl:copy-of select="exsl:node-set($replace-nodes-rtf)/node()[$pos]" />\r
- </replace>\r
- </xsl:for-each>\r
- </xsl:variable>\r
- <xsl:variable name="sorted-replacements-rtf">\r
- <xsl:for-each select="exsl:node-set($replacements-rtf)/replace">\r
- <xsl:sort select="string-length(@search)" data-type="number" order="descending" />\r
- <xsl:copy-of select="." />\r
- </xsl:for-each>\r
- </xsl:variable>\r
- <xsl:variable name="result">\r
- <xsl:choose>\r
- <xsl:when test="not($search)">\r
- <xsl:value-of select="$string" />\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:call-template name="str:_replace">\r
- <xsl:with-param name="string" select="$string" />\r
- <xsl:with-param name="replacements" select="exsl:node-set($sorted-replacements-rtf)/replace" />\r
- </xsl:call-template>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </xsl:variable>\r
- <func:result select="exsl:node-set($result)/node()" />\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:message terminate="yes">\r
- ERROR: function implementation of str:replace() relies on exsl:node-set().\r
- </xsl:message>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </func:function>\r
-\r
- <xsl:template name="str:_replace">\r
- <xsl:param name="string" select="''" />\r
- <xsl:param name="replacements" select="/.." />\r
- <xsl:choose>\r
- <xsl:when test="not($string)" />\r
- <xsl:when test="not($replacements)">\r
- <xsl:value-of select="$string" />\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:variable name="replacement" select="$replacements[1]" />\r
- <xsl:variable name="search" select="$replacement/@search" />\r
- <xsl:choose>\r
- <xsl:when test="not(string($search))">\r
- <xsl:value-of select="substring($string, 1, 1)" />\r
- <xsl:copy-of select="$replacement/node()" />\r
- <xsl:call-template name="str:_replace">\r
- <xsl:with-param name="string" select="substring($string, 2)" />\r
- <xsl:with-param name="replacements" select="$replacements" />\r
- </xsl:call-template>\r
- </xsl:when>\r
- <xsl:when test="contains($string, $search)">\r
- <xsl:call-template name="str:_replace">\r
- <xsl:with-param name="string" select="substring-before($string, $search)" />\r
- <xsl:with-param name="replacements" select="$replacements[position() > 1]" />\r
- </xsl:call-template> \r
- <xsl:copy-of select="$replacement/node()" />\r
- <xsl:call-template name="str:_replace">\r
- <xsl:with-param name="string" select="substring-after($string, $search)" />\r
- <xsl:with-param name="replacements" select="$replacements" />\r
- </xsl:call-template>\r
- </xsl:when>\r
- <xsl:otherwise>\r
- <xsl:call-template name="str:_replace">\r
- <xsl:with-param name="string" select="$string" />\r
- <xsl:with-param name="replacements" select="$replacements[position() > 1]" />\r
- </xsl:call-template>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </xsl:otherwise>\r
- </xsl:choose>\r
- </xsl:template>\r
-\r
-</xsl:stylesheet>
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<xsl:stylesheet\r
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- xmlns:fn="http://senf.berlios.de/xml/Extensions"\r
- xmlns:exsl="http://exslt.org/common"\r
- xmlns:str="http://exslt.org/strings"\r
- xmlns:func="http://exslt.org/functions"\r
- extension-element-prefixes="str fn exsl func"\r
- version="1.0">\r
-\r
- <xsl:include href="functions.xsl"/>\r
-\r
- <xsl:output method="html"/>\r
- <xsl:strip-space elements="*"/>\r
- <xsl:param name="title" select="''"/>\r
- <xsl:param name="types" select="'bug todo'"/>\r
-\r
- <xsl:template match="/">\r
- <div class="xref">\r
- <h1><xsl:value-of select="$title"/></h1>\r
- <xsl:variable name="doc" select="."/>\r
- <div class="nav">\r
- <xsl:text> -- </xsl:text>\r
- <xsl:for-each select="str:split($types)">\r
- <xsl:variable name="type" select="string(.)"/>\r
- <xsl:if test="$doc//xreflist[@type=$type]">\r
- <xsl:element name="a">\r
- <xsl:attribute name="href">#<xsl:value-of select="."/></xsl:attribute>\r
- <xsl:value-of select="translate(.,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/><xsl:text>S</xsl:text>\r
- </xsl:element>\r
- <xsl:text> -- </xsl:text>\r
- </xsl:if>\r
- </xsl:for-each>\r
- </div>\r
- <xsl:for-each select="str:split($types)">\r
- <xsl:variable name="type" select="string(.)"/>\r
- <xsl:if test="$doc//xreflist[@type=$type]">\r
- <xsl:element name="div">\r
- <xsl:attribute name="class"><xsl:value-of select="$type"/></xsl:attribute>\r
- <xsl:element name="a">\r
- <xsl:attribute name="name"><xsl:value-of select="$type"/></xsl:attribute>\r
- <h2>Open <xsl:value-of select="translate($type,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>s</h2>\r
- </xsl:element>\r
- <xsl:for-each select="$doc//xreflist[@type=$type]">\r
- <xsl:sort select="@module"/>\r
- <h3><xsl:value-of select="@module"/> module</h3>\r
- <dl>\r
- <xsl:apply-templates/>\r
- </dl>\r
- </xsl:for-each>\r
- </xsl:element>\r
- </xsl:if>\r
- </xsl:for-each>\r
- </div>\r
- </xsl:template>\r
-\r
- <xsl:template match="compound">\r
- <dt>\r
- <xsl:element name="a">\r
- <xsl:attribute name="href"><xsl:value-of select="fn:id2url(@id)"/></xsl:attribute>\r
- <b><xsl:value-of select="@name"/></b>\r
- </xsl:element>\r
- </dt>\r
- <dd>\r
- <xsl:apply-templates/>\r
- </dd>\r
- </xsl:template>\r
-\r
- <xsl:template match="item">\r
- <p><xsl:apply-templates/></p>\r
- </xsl:template>\r
- \r
- <!-- ====================================================================== -->\r
- <!-- Helper functions -->\r
-\r
- <fn:nsquote>\r
- <fn:replacement>\r
- <fn:match>_1_1</fn:match>\r
- <fn:replace>_2</fn:replace>\r
- </fn:replacement>\r
- </fn:nsquote>\r
-\r
- <xsl:variable name="nsquote" select="document('')//fn:nsquote/fn:replacement"/>\r
- \r
- <func:function name="fn:id2url">\r
- <xsl:param name="id"/>\r
- <!-- Yuck ... I HATE this .. why doesn't xsltproc support XPath 2.0 ... grmpf -->\r
- <xsl:variable name="quoted">\r
- <xsl:apply-templates select="str:replace($id,$nsquote/fn:match,$nsquote/fn:replace)"/>\r
- </xsl:variable>\r
- <xsl:variable name="anchor" select="substring-after($quoted,'_1')"/>\r
- <xsl:variable name="file">\r
- <xsl:apply-templates select="str:replace(substring($quoted,1,string-length($quoted) - number(boolean($anchor))*2 - string-length($anchor)),$nsquote/fn:replace,$nsquote/fn:match)"/>\r
- </xsl:variable>\r
- <xsl:variable name="sep" select="substring('#',2-number(boolean($anchor)))"/>\r
- <func:result>../../<xsl:value-of select="ancestor::xreflist/@module"/>/doc/html/<xsl:value-of select="$file"/>.html<xsl:value-of select="$sep"/><xsl:value-of select="$anchor"/></func:result>\r
- </func:function>\r
-\r
-</xsl:stylesheet>\r
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>\r
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
- version="1.0">\r
-\r
- <xsl:output method="xml" omit-xml-declaration="yes"/>\r
- <xsl:param name="module" select="''"/>\r
- <xsl:param name="type" select="'todo'"/>\r
- <xsl:strip-space elements="*"/>\r
-\r
- <xsl:template match="variablelist">\r
- <xsl:if test="string(preceding::variablelist[1]/varlistentry/term/ref/@refid)!=string(varlistentry/term/ref/@refid)">\r
- <xsl:element name="compound">\r
- <xsl:attribute name="id">\r
- <xsl:value-of select="varlistentry/term/ref/@refid"/>\r
- </xsl:attribute>\r
- <xsl:attribute name="name">\r
- <xsl:value-of select="string(varlistentry/term)"/>\r
- </xsl:attribute>\r
- <xsl:text>
</xsl:text>\r
- <xsl:variable name="curid" select="varlistentry/term/ref[1]/@refid"/>\r
- <xsl:apply-templates \r
- select="//variablelist[varlistentry/term/ref[1]/@refid=$curid]"\r
- mode="inlist"/>\r
- </xsl:element>\r
- <xsl:text>
</xsl:text>\r
- </xsl:if>\r
- </xsl:template>\r
- \r
- <xsl:template match="variablelist" mode="inlist">\r
- <item>\r
- <xsl:value-of select="string(listitem)"/>\r
- </item>\r
- <xsl:text>
</xsl:text>\r
- </xsl:template>\r
-\r
- <xsl:template match="/">\r
- <xsl:element name="xreflist">\r
- <xsl:attribute name="type">\r
- <xsl:value-of select="$type"/>\r
- </xsl:attribute>\r
- <xsl:attribute name="module">\r
- <xsl:value-of select="$module"/>\r
- </xsl:attribute>\r
- <xsl:text>
</xsl:text>\r
- <xsl:apply-templates/>\r
- </xsl:element>\r
- </xsl:template>\r
-\r
- <xsl:template match="compoundname"/>\r
- <xsl:template match="title"/>\r
- <xsl:template match="anchor"/>\r
-\r
-</xsl:stylesheet>\r