Socket: Add short docs to internal classes
[senf.git] / senfscons / Doxygen.py
index ea765c4..3b52795 100644 (file)
@@ -96,6 +96,7 @@
 import os, sys, traceback
 import os.path
 import glob, re
+import SCons.Action
 from fnmatch import fnmatch
 
 EnvVar = re.compile(r"\$\(([0-9A-Za-z_-]+)\)")
@@ -254,17 +255,22 @@ def DoxyEmitter(source, target, env):
       out_dir = '.'
 
    # add our output locations
+   html_dir = None
    for (k, v) in output_formats.iteritems():
       if data.get("GENERATE_" + k, v[0]).upper() == "YES":
          dir = env.Dir( os.path.join(source[0].dir.abspath, out_dir, data.get(k + "_OUTPUT", v[1])) )
+         if k == "HTML" : html_dir = dir
          dir.sources = source
          node = env.File( os.path.join(dir.abspath, k.lower()+".stamp" ) )
          targets.append(node)
          if env.GetOption('clean'): targets.append(dir)
 
-   if data.has_key("GENERATE_TAGFILE"):
+   if data.has_key("GENERATE_TAGFILE") and html_dir:
       targets.append(env.File( os.path.join(source[0].dir.abspath, data["GENERATE_TAGFILE"]) ))
 
+   if data.get("SEARCHENGINE","NO").upper() == "YES":
+      targets.append(env.File( os.path.join(html_dir.abspath, "search.idx") ))
+
    # don't clobber targets
    for node in targets:
       env.Precious(node)
@@ -295,8 +301,8 @@ def DoxyGenerator(source, target, env, for_signature):
 
    data = DoxyfileParse(env, source[0].abspath)
 
-   actions = [ env.Action("cd ${SOURCE.dir}  && TOPDIR=%s ${DOXYGEN} ${SOURCE.file}"
-                          % (relpath(source[0].dir.abspath, env.Dir('#').abspath),)) ]
+   actions = [ SCons.Action.Action("cd ${SOURCE.dir}  && TOPDIR=%s ${DOXYGEN} ${SOURCE.file}"
+                                   % (relpath(source[0].dir.abspath, env.Dir('#').abspath),)) ]
 
    # This will add automatic 'installdox' calls.
    #
@@ -335,16 +341,16 @@ def DoxyGenerator(source, target, env, for_signature):
          if args is not None and url:
             args.append("-l %s@%s" % ( os.path.basename(tagfile), url ))
       if args:
-         actions.append(env.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args))))
+         actions.append(SCons.Action.Action('cd %s && ./installdox %s' % (output_dir, " ".join(args))))
 
-   actions.append(env.Action([ "touch $TARGETS" ]))
+   actions.append(SCons.Action.Action([ "touch $TARGETS" ]))
 
    return actions
 
 def generate(env):
    """
    Add builders and construction variables for the
-   Doxygen tool.  This is currently for Doxygen 1.4.6.
+   Doxygen tool. This is currently for Doxygen 1.4.6.
    """
    doxyfile_scanner = env.Scanner(
       DoxySourceScan,