summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRobert Managan <managan1@llnl.gov>2009-08-21 21:31:26 (GMT)
committerRobert Managan <managan1@llnl.gov>2009-08-21 21:31:26 (GMT)
commit261ed88eaf34cfb993f1c5158b725a4dabd9fdd6 (patch)
treecc1cc8989fd5366c59055c94d4486b834e377dae /src
parent424e5d82767feb5b991597b1d964fcbf117baace (diff)
downloadSCons-261ed88eaf34cfb993f1c5158b725a4dabd9fdd6.zip
SCons-261ed88eaf34cfb993f1c5158b725a4dabd9fdd6.tar.gz
SCons-261ed88eaf34cfb993f1c5158b725a4dabd9fdd6.tar.bz2
As I set up the test case for the glossary and nomencl packages
I found that when only one tool (say pdftex) is initialized that some of the actions for bibtex... are not created. Moved most common actions and environment settings to one routine in tex.py that the other text tools (pdftex, pdflatex, latex) call. Also fixed a typo in the nomenclature action setup. There was a '$' that should not have been there.
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt10
-rw-r--r--src/engine/SCons/Tool/latex.py13
-rw-r--r--src/engine/SCons/Tool/pdflatex.py6
-rw-r--r--src/engine/SCons/Tool/pdftex.py11
-rw-r--r--src/engine/SCons/Tool/tex.py54
5 files changed, 47 insertions, 47 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index d8c6daf..84ab65a 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -93,9 +93,17 @@ RELEASE X.X.X - XXX
Latex output
- Remove LATEXSUFFIXES from environments that don't initialize Tex.
-
+
- Add support for the glosaaries package for glossaries and acronyms
+ - Fix problem that pdftex, latex, and pdflatex tools by themselves did
+ not create the actions for bibtex, makeindex,... by creating them
+ and other environment settings in one routine called by all four
+ tex tools.
+
+ - Fix problem with filenames of sideeffects when the user changes
+ the name of the output file from the latex default
+
RELEASE 1.2.0.d20090223 - Mon, 23 Feb 2009 08:41:06 -0800
From Stanislav Baranov:
diff --git a/src/engine/SCons/Tool/latex.py b/src/engine/SCons/Tool/latex.py
index 8712d74..90adbab 100644
--- a/src/engine/SCons/Tool/latex.py
+++ b/src/engine/SCons/Tool/latex.py
@@ -1,6 +1,7 @@
"""SCons.Tool.latex
Tool-specific initialization for LaTeX.
+Generates .dvi files from .latex or .ltx files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
@@ -40,10 +41,8 @@ import SCons.Util
import SCons.Tool
import SCons.Tool.tex
-LaTeXAction = None
-
def LaTeXAuxFunction(target = None, source= None, env=None):
- result = SCons.Tool.tex.InternalLaTeXAuxAction( LaTeXAction, target, source, env )
+ result = SCons.Tool.tex.InternalLaTeXAuxAction( SCons.Tool.tex.LaTeXAction, target, source, env )
if result != 0:
print env['LATEX']," returned an error, check the log file"
return result
@@ -53,9 +52,6 @@ LaTeXAuxAction = SCons.Action.Action(LaTeXAuxFunction,
def generate(env):
"""Add Builders and construction variables for LaTeX to an Environment."""
- global LaTeXAction
- if LaTeXAction is None:
- LaTeXAction = SCons.Action.Action('$LATEXCOM', '$LATEXCOMSTR')
env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
@@ -71,10 +67,7 @@ def generate(env):
bld.add_emitter('.ltx', SCons.Tool.tex.tex_eps_emitter)
bld.add_emitter('.latex', SCons.Tool.tex.tex_eps_emitter)
- env['LATEX'] = 'latex'
- env['LATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
- env['LATEXCOM'] = 'cd ${TARGET.dir} && $LATEX $LATEXFLAGS ${SOURCE.file}'
- env['LATEXRETRIES'] = 3
+ SCons.Tool.tex.generate_common(env)
def exists(env):
return env.Detect('latex')
diff --git a/src/engine/SCons/Tool/pdflatex.py b/src/engine/SCons/Tool/pdflatex.py
index c4a8264..167de51 100644
--- a/src/engine/SCons/Tool/pdflatex.py
+++ b/src/engine/SCons/Tool/pdflatex.py
@@ -1,6 +1,7 @@
"""SCons.Tool.pdflatex
Tool-specific initialization for pdflatex.
+Generates .pdf files from .latex or .ltx files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
@@ -70,10 +71,7 @@ def generate(env):
bld.add_emitter('.ltx', SCons.Tool.tex.tex_pdf_emitter)
bld.add_emitter('.latex', SCons.Tool.tex.tex_pdf_emitter)
- env['PDFLATEX'] = 'pdflatex'
- env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
- env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}'
- env['LATEXRETRIES'] = 3
+ SCons.Tool.tex.generate_common(env)
def exists(env):
return env.Detect('pdflatex')
diff --git a/src/engine/SCons/Tool/pdftex.py b/src/engine/SCons/Tool/pdftex.py
index b487a8d..01b7f85 100644
--- a/src/engine/SCons/Tool/pdftex.py
+++ b/src/engine/SCons/Tool/pdftex.py
@@ -1,6 +1,7 @@
"""SCons.Tool.pdftex
Tool-specific initialization for pdftex.
+Generates .pdf files from .tex files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
@@ -91,15 +92,7 @@ def generate(env):
# so pdftex is the default for no source suffix
pdf.generate2(env)
- env['PDFTEX'] = 'pdftex'
- env['PDFTEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
- env['PDFTEXCOM'] = 'cd ${TARGET.dir} && $PDFTEX $PDFTEXFLAGS ${SOURCE.file}'
-
- # Duplicate from latex.py. If latex.py goes away, then this is still OK.
- env['PDFLATEX'] = 'pdflatex'
- env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
- env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}'
- env['LATEXRETRIES'] = 3
+ SCons.Tool.tex.generate_common(env)
def exists(env):
return env.Detect('pdftex')
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py
index 7856f42..35022dc 100644
--- a/src/engine/SCons/Tool/tex.py
+++ b/src/engine/SCons/Tool/tex.py
@@ -1,6 +1,7 @@
"""SCons.Tool.tex
Tool-specific initialization for TeX.
+Generates .dvi files from .tex files
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
@@ -491,12 +492,12 @@ def tex_emitter_core(target, source, env, graphics_extensions):
are needed on subsequent runs of latex to finish tables of contents,
bibliographies, indices, lists of figures, and hyperlink references.
"""
- targetbase, targetext = SCons.Util.splitext(str(target[0]))
basename = SCons.Util.splitext(str(source[0]))[0]
basefile = os.path.split(str(basename))[1]
+ targetdir = os.path.split(str(target[0]))[0]
+ targetbase = os.path.join(targetdir, basefile)
basedir = os.path.split(str(source[0]))[0]
- targetdir = os.path.split(str(target[0]))[0]
abspath = os.path.abspath(basedir)
target[0].attributes.path = abspath
@@ -614,6 +615,25 @@ TeXLaTeXAction = None
def generate(env):
"""Add Builders and construction variables for TeX to an Environment."""
+ global TeXLaTeXAction
+ if TeXLaTeXAction is None:
+ TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction,
+ strfunction=TeXLaTeXStrFunction)
+
+ env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
+
+ generate_common(env)
+
+ import dvi
+ dvi.generate(env)
+
+ bld = env['BUILDERS']['DVI']
+ bld.add_action('.tex', TeXLaTeXAction)
+ bld.add_emitter('.tex', tex_eps_emitter)
+
+def generate_common(env):
+ """Add internal Builders and construction variables for LaTeX to an Environment."""
+
# A generic tex file Action, sufficient for all tex files.
global TeXAction
if TeXAction is None:
@@ -650,30 +670,23 @@ def generate(env):
if MakeAcronymsAction is None:
MakeAcronymsAction = SCons.Action.Action("$MAKEACRONYMSCOM", "$MAKEACRONYMSCOMSTR")
- global TeXLaTeXAction
- if TeXLaTeXAction is None:
- TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction,
- strfunction=TeXLaTeXStrFunction)
-
- env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
-
- import dvi
- dvi.generate(env)
-
- bld = env['BUILDERS']['DVI']
- bld.add_action('.tex', TeXLaTeXAction)
- bld.add_emitter('.tex', tex_eps_emitter)
-
env['TEX'] = 'tex'
env['TEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
env['TEXCOM'] = 'cd ${TARGET.dir} && $TEX $TEXFLAGS ${SOURCE.file}'
- # Duplicate from latex.py. If latex.py goes away, then this is still OK.
+ env['PDFTEX'] = 'pdftex'
+ env['PDFTEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
+ env['PDFTEXCOM'] = 'cd ${TARGET.dir} && $PDFTEX $PDFTEXFLAGS ${SOURCE.file}'
+
env['LATEX'] = 'latex'
env['LATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
env['LATEXCOM'] = 'cd ${TARGET.dir} && $LATEX $LATEXFLAGS ${SOURCE.file}'
env['LATEXRETRIES'] = 3
+ env['PDFLATEX'] = 'pdflatex'
+ env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
+ env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}'
+
env['BIBTEX'] = 'bibtex'
env['BIBTEXFLAGS'] = SCons.Util.CLVar('')
env['BIBTEXCOM'] = 'cd ${TARGET.dir} && $BIBTEX $BIBTEXFLAGS ${SOURCE.filebase}'
@@ -693,15 +706,10 @@ def generate(env):
env['MAKEACRONYMSCOM'] = 'cd ${TARGET.dir} && $MAKEACRONYMS ${SOURCE.filebase}.acn $MAKEACRONYMSFLAGS -o ${SOURCE.filebase}.acr'
env['MAKENCL'] = 'makeindex'
- env['MAKENCLSTYLE'] = '$nomencl.ist'
+ env['MAKENCLSTYLE'] = 'nomencl.ist'
env['MAKENCLFLAGS'] = '-s ${MAKENCLSTYLE} -t ${SOURCE.filebase}.nlg'
env['MAKENCLCOM'] = 'cd ${TARGET.dir} && $MAKENCL ${SOURCE.filebase}.nlo $MAKENCLFLAGS -o ${SOURCE.filebase}.nls'
- # Duplicate from pdflatex.py. If latex.py goes away, then this is still OK.
- env['PDFLATEX'] = 'pdflatex'
- env['PDFLATEXFLAGS'] = SCons.Util.CLVar('-interaction=nonstopmode -recorder')
- env['PDFLATEXCOM'] = 'cd ${TARGET.dir} && $PDFLATEX $PDFLATEXFLAGS ${SOURCE.file}'
-
def exists(env):
return env.Detect('tex')