diff --git a/Doxyfile b/Doxyfile index 59fb6de138051ff1bb946a3b2f81bb95b0b8682e..8b758e170b717156753007f694215ccd38ae13d7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1,14 +1,9 @@ +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" + PROJECT_NAME = Overview PROJECT_NUMBER = "(Revision $(REVISION), generated $(TODAY))" -OUTPUT_DIRECTORY = doc -INPUT = . -FILE_PATTERNS = *.dox -IMAGE_PATH = . EXAMPLE_PATH = Sniffer -HTML_HEADER = doclib/doxy-header-overview.html -HTML_FOOTER = doclib/doxy-footer.html -GENERATE_LATEX = NO -GENERATE_MAN = NO -@INCLUDE = "Doxyfile.local" +HTML_HEADER = doclib/doxy-header-overview.html +GENERATE_XML = NO diff --git a/Mainpage.dox b/Mainpage.dox index 2ded00706362e7ede21c325cbe3b5cb3ccd88508..02fc964740525cd148f8079b778d2a02a85b4253 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -65,6 +65,7 @@ \li Doxygen (http://www.doxygen.org) \li The \c dia diagram editor (http://www.gnome.org/projects/dia/) + \li \The c xsltproc XSLT processor (http://xmlsoft.org/XSLT/xsltproc2.html) The library is only tested with gcc-3.4 and 4.0 on Linux. On other @@ -251,8 +252,8 @@ \section new_conf Configuring SENFSCons To set up the build environment, copy the - <tt>senfscons/SConstruct.template</tt> to <tt>Satscons</tt> in the - project root. The default setup of this file is to build all + <tt>senfscons/SConstruct.template</tt> to <tt>SConstruct</tt> in + the project root. The default setup of this file is to build all subdirectories (using the \c SConscript files of the subdirectories). You can add additonal global targets and configuration parameters here. diff --git a/Packets/Doxyfile b/Packets/Doxyfile index 95d25b4efd73f5de5a42bada9d4e7f287d989635..2e7c41a30525e71c05777e99fd36da8417147aa5 100644 --- a/Packets/Doxyfile +++ b/Packets/Doxyfile @@ -1,5 +1,5 @@ -@INCLUDE = ../doclib/Doxyfile.global +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" PROJECT_NAME = libPackets -TAGFILES = ../Utils/doc/Utils.tag +TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag" GENERATE_TAGFILE = doc/Packets.tag \ No newline at end of file diff --git a/SConstruct b/SConstruct index 79462692f609b032571b7bf1bf58097065e9d692..a2a3eba83f112f422173b4249ed487c3dc28994b 100644 --- a/SConstruct +++ b/SConstruct @@ -1,11 +1,17 @@ # -*- python -*- -import sys, glob, os.path +import sys, glob, os.path, datetime sys.path.append('senfscons') import SENFSCons ########################################################################### +svninfo = dict( + [ tuple(map(lambda y:y.strip(),x.split(":",1))) + for x in os.popen("svn info").read().split("\n") + if ':' in x ] ) +svninfo['commited'] = not(os.popen("svn status").read()) + SENFSCons.UseBoost() SENFSCons.UseSTLPort() env = SENFSCons.MakeEnvironment() @@ -15,19 +21,9 @@ env.Append( LIBS = [ 'iberty' ], DOXY_XREF_TYPES = [ 'bug', 'fixme', 'todo', 'idea' ], DOXY_HTML_XSL = '#/doclib/html-munge.xsl', -) - -import datetime - -svninfo = dict( - [ tuple(map(lambda y:y.strip(),x.split(":",1))) - for x in os.popen("svn info").read().split("\n") - if ':' in x ] ) -svninfo['commited'] = not(os.popen("svn status").read()) - -env.Append( - ENV = { 'TODAY' : datetime.date.today(), - 'REVISION' : svninfo['Revision'] + (not(svninfo['commited']) and " + local changes" or "") } + ENV = { 'TODAY' : str(datetime.date.today()), + 'REVISION' : svninfo['Revision'] + (not(svninfo['commited']) and " + local changes" or ""), + }, ) Export('env') diff --git a/Scheduler/Doxyfile b/Scheduler/Doxyfile index 157f80892bb8f3cefa06bef343754f9711fc2e6f..38eada5b1f49a0a8813efada722a589e26070c16 100644 --- a/Scheduler/Doxyfile +++ b/Scheduler/Doxyfile @@ -1,5 +1,5 @@ -@INCLUDE = ../doclib/Doxyfile.global +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" PROJECT_NAME = libScheduler -TAGFILES = ../Utils/doc/Utils.tag +TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag" GENERATE_TAGFILE = doc/Scheduler.tag diff --git a/Socket/Doxyfile b/Socket/Doxyfile index 1a5a548d41e798f07f5cad3812cbcf1af445a9ba..76ad2bbb607318f4d3b2e5efc78eb58a7f41fd06 100644 --- a/Socket/Doxyfile +++ b/Socket/Doxyfile @@ -1,6 +1,6 @@ -@INCLUDE = ../doclib/Doxyfile.global +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" PROJECT_NAME = libSocket -TAGFILES = ../Utils/doc/Utils.tag +TAGFILES = "$(TOPDIR)/Utils/doc/Utils.tag" GENERATE_TAGFILE = doc/Socket.tag diff --git a/Utils/Doxyfile b/Utils/Doxyfile index 414df50ba7b494eab32983461ea67bac32c5fdeb..b193e9063e383b0ae6403871c1dcc4027095b5ec 100644 --- a/Utils/Doxyfile +++ b/Utils/Doxyfile @@ -1,4 +1,4 @@ -@INCLUDE = ../doclib/Doxyfile.global +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" PROJECT_NAME = libUtils GENERATE_TAGFILE = doc/Utils.tag diff --git a/doclib/Doxyfile.global b/doclib/Doxyfile.global index d2b544d2a7704291417f18a6dbba00c4f72d4c89..2e805893b13df54fb92f717ffe5c66a24d1475cb 100644 --- a/doclib/Doxyfile.global +++ b/doclib/Doxyfile.global @@ -1,7 +1,7 @@ OUTPUT_DIRECTORY = doc INPUT = . FILE_PATTERNS = *.c *.cc *.cci *.ct *.cti *.h *.hh *.ih *.mmc *.dox -EXCLUDE_PATTERNS = *.test.cc *.test.hh .* +EXCLUDE_PATTERNS = *.test.cc *.test.hh .* *~ "#*#" IMAGE_PATH = . ALIASES = "fixme=\xrefitem fixme \"Fix\" \"Fixmes\"" \ @@ -25,8 +25,8 @@ EXPAND_ONLY_PREDEF = YES PREDEFINED = DOXYGEN EXPAND_AS_DEFINED = prefix_ -HTML_HEADER = ../doclib/doxy-header.html -HTML_FOOTER = ../doclib/doxy-footer.html +HTML_HEADER = "$(TOPDIR)/doclib/doxy-header.html" +HTML_FOOTER = "$(TOPDIR)/doclib/doxy-footer.html" GENERATE_LATEX = NO GENERATE_MAN = NO GENERATE_XML = YES @@ -42,4 +42,4 @@ MAX_DOT_GRAPH_HEIGHT = 1200 MAX_DOT_GRAPH_DEPTH = 3 DOT_MULTI_TARGETS = YES -@INCLUDE = "../Doxyfile.local" +@INCLUDE = "$(TOPDIR)/Doxyfile.local" diff --git a/senfscons/Doxyfile b/senfscons/Doxyfile index b244b648801b7071245c6ffc8032ca2201ffe38a..a3f0a5eef3ac93aab02f6b90bc50133c33e2c65d 100644 --- a/senfscons/Doxyfile +++ b/senfscons/Doxyfile @@ -1,4 +1,3 @@ -@INCLUDE = ../doclib/Doxyfile.global +@INCLUDE = "$(TOPDIR)/doclib/Doxyfile.global" PROJECT_NAME = SENFSCons -PROJECT_NUMBER = "Version 0.0.1" diff --git a/senfscons/Doxygen.py b/senfscons/Doxygen.py index 9e8f1c684773586aec5e047a631c1a2692b35e29..f422aacd531ecf97aac9b22e14447d118a156a36 100644 --- a/senfscons/Doxygen.py +++ b/senfscons/Doxygen.py @@ -45,18 +45,23 @@ import os, sys, traceback import os.path -import glob +import glob, re from fnmatch import fnmatch -def DoxyfileParse(file): - data = DoxyfileParse_(file,{}) - for (k,v) in data.items(): +EnvVar = re.compile(r"\$\(([0-9A-Za-z_-]+)\)") + +def DoxyfileParse(env,file): + ENV = {} + ENV.update(env.get("ENV",{})) + ENV['TOPDIR'] = env.Dir('#').abspath + data = DoxyfileParse_(file,{},ENV) + for k,v in data.items(): if not v : del data[k] elif k in ("INPUT", "FILE_PATTERNS", "EXCLUDE_PATTERNS", "@INCLUDE", "TAGFILES") : continue elif len(v)==1 : data[k] = v[0] return data -def DoxyfileParse_(file, data): +def DoxyfileParse_(file, data, ENV): """ Parse a Doxygen source file and return a dictionary of all the values. Values will be strings and lists of strings. @@ -66,7 +71,7 @@ def DoxyfileParse_(file, data): import shlex lex = shlex.shlex(instream=open(file), posix=True) - lex.wordchars += "*+./-:@~" + lex.wordchars += "*+./-:@~$()" lex.whitespace = lex.whitespace.replace("\n", "") lex.escape = "\\" @@ -100,12 +105,13 @@ def DoxyfileParse_(file, data): elif token == "=": data[key] = [] else: + token = EnvVar.sub(lambda m,ENV=ENV: str(ENV.get(m.group(1),"")),token) append_data(data, key, new_data, token) new_data = True if key=='@INCLUDE': inc = os.path.join(dir,data['@INCLUDE'][-1]) if os.path.exists(inc) : - DoxyfileParse_(inc,data) + DoxyfileParse_(inc,data,ENV) last_token = token token = lex.get_token() @@ -140,7 +146,7 @@ def DoxySourceScan(node, env, path): sources = [] basedir = node.dir.abspath - data = DoxyfileParse(node.abspath) + data = DoxyfileParse(env, node.abspath) recursive = data.get("RECURSIVE", "NO").upper()=="YES" file_patterns = data.get("FILE_PATTERNS", default_file_patterns) exclude_patterns = data.get("EXCLUDE_PATTERNS", default_exclude_patterns) @@ -186,7 +192,7 @@ def DoxyEmitter(source, target, env): "XML" : ("NO", "xml"), } - data = DoxyfileParse(source[0].abspath) + data = DoxyfileParse(env, source[0].abspath) targets = [] if data.has_key("OUTPUT_DIRECTORY"): @@ -215,9 +221,9 @@ def DoxyEmitter(source, target, env): return (targets, source) -def doxyNodeHtmlDir(node): +def doxyNodeHtmlDir(env,node): if not node.sources : return None - data = DoxyfileParse(node.sources[0].abspath) + data = DoxyfileParse(env, node.sources[0].abspath) if data.get("GENERATE_HTML",'YES').upper() != 'YES' : return None return os.path.normpath(os.path.join( node.sources[0].dir.abspath, data.get("OUTPUT_DIRECTORY","."), @@ -237,9 +243,10 @@ def relpath(source, target): def DoxyGenerator(source, target, env, for_signature): - data = DoxyfileParse(source[0].abspath) + data = DoxyfileParse(env, source[0].abspath) - actions = [ env.Action("cd ${SOURCE.dir} && ${DOXYGEN} ${SOURCE.file}") ] + actions = [ env.Action("cd ${SOURCE.dir} && TOPDIR=%s ${DOXYGEN} ${SOURCE.file}" + % (relpath(source[0].dir.abspath, env.Dir('#').abspath),)) ] # This will add automatic 'installdox' calls. # @@ -269,6 +276,7 @@ def DoxyGenerator(source, target, env, for_signature): url = env.get(os.path.splitext(os.path.basename(tagfile))[0].upper()+"_DOXY_URL", None) if not url: url = doxyNodeHtmlDir( + env, env.File(os.path.normpath(os.path.join(str(source[0].dir), tagfile)))) if url : url = relpath(output_dir, url) if not url: