summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Tool/tex.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-11-06 17:03:25 (GMT)
committerSteven Knight <knight@baldmt.com>2005-11-06 17:03:25 (GMT)
commit6100e6fec11023b5ee239b097d240b1cbd32a739 (patch)
treeb4ad541bd0361ccea3b838aa3dc3fa4d71c8438c /src/engine/SCons/Tool/tex.py
parent0113b86def554ddcd54b3b9eace409e16bf8a5a7 (diff)
downloadSCons-6100e6fec11023b5ee239b097d240b1cbd32a739.zip
SCons-6100e6fec11023b5ee239b097d240b1cbd32a739.tar.gz
SCons-6100e6fec11023b5ee239b097d240b1cbd32a739.tar.bz2
Correct $SOURCES on TeX command lines. (Sanjoy Mahajan) Add scanning of LaTeX files for implicit dependencies. (August Hörandl) Add support for generating indices from .idx files. (August Hörandl)
Diffstat (limited to 'src/engine/SCons/Tool/tex.py')
-rw-r--r--src/engine/SCons/Tool/tex.py21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py
index adb6c06..40a8211 100644
--- a/src/engine/SCons/Tool/tex.py
+++ b/src/engine/SCons/Tool/tex.py
@@ -54,6 +54,9 @@ LaTeXAction = SCons.Action.Action("$LATEXCOM", "$LATEXCOMSTR")
# Define an action to run BibTeX on a file.
BibTeXAction = SCons.Action.Action("$BIBTEXCOM", "$BIBTEXCOMSTR")
+# Define an action to run MakeIndex on a file.
+MakeIndexAction = SCons.Action.Action("$MAKEINDEXCOM", "$MAKEINDEXOMSTR")
+
def LaTeXAuxAction(target = None, source= None, env=None):
"""A builder for LaTeX files that checks the output in the aux file
and decides how many times to use LaTeXAction, and BibTeXAction."""
@@ -66,6 +69,14 @@ def LaTeXAuxAction(target = None, source= None, env=None):
if string.find(content, "bibdata") != -1:
bibfile = env.fs.File(basename)
BibTeXAction(None,bibfile,env)
+ # Now if makeindex will need to be run.
+ idxfilename = basename + ".idx"
+ if os.path.exists(idxfilename):
+ idxfile = env.fs.File(basename)
+ # TODO: if ( idxfile has changed) ...
+ MakeIndexAction(None,idxfile,env)
+ LaTeXAction(target,source,env)
+
# Now check if latex needs to be run yet again.
for trial in range(3):
content = open(basename + ".log","rb").read()
@@ -109,17 +120,21 @@ def generate(env):
env['TEX'] = 'tex'
env['TEXFLAGS'] = SCons.Util.CLVar('')
- env['TEXCOM'] = '$TEX $TEXFLAGS $SOURCES'
+ env['TEXCOM'] = '$TEX $TEXFLAGS $SOURCE'
# Duplicate from latex.py. If latex.py goes away, then this is still OK.
env['LATEX'] = 'latex'
env['LATEXFLAGS'] = SCons.Util.CLVar('')
- env['LATEXCOM'] = '$LATEX $LATEXFLAGS $SOURCES'
+ env['LATEXCOM'] = '$LATEX $LATEXFLAGS $SOURCE'
env['BIBTEX'] = 'bibtex'
env['BIBTEXFLAGS'] = SCons.Util.CLVar('')
- env['BIBTEXCOM'] = '$BIBTEX $BIBTEXFLAGS $SOURCES'
+ env['BIBTEXCOM'] = '$BIBTEX $BIBTEXFLAGS $SOURCE'
+ env['MAKEINDEX'] = 'makeindex'
+ env['MAKEINDEXFLAGS'] = SCons.Util.CLVar('')
+ env['MAKEINDEXCOM'] = '$MAKEINDEX $MAKEINDEXFLAGS $SOURCES'
+
def exists(env):
return env.Detect('tex')