diff options
Diffstat (limited to '3rdParty/SCons/scons-local/SCons/Tool/pdftex.py')
-rw-r--r-- | 3rdParty/SCons/scons-local/SCons/Tool/pdftex.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py b/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py index c6e2e30..ea21d33 100644 --- a/3rdParty/SCons/scons-local/SCons/Tool/pdftex.py +++ b/3rdParty/SCons/scons-local/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() @@ -9,7 +10,7 @@ selection method. """ # -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -31,8 +32,9 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdftex.py 4043 2009/02/23 09:06:45 scons" +__revision__ = "src/engine/SCons/Tool/pdftex.py 4761 2010/04/04 14:04:44 bdeegan" +import os import SCons.Action import SCons.Util import SCons.Tool.tex @@ -51,10 +53,17 @@ def PDFTeXLaTeXFunction(target = None, source= None, env=None): """A builder for TeX and LaTeX that scans the source file to decide the "flavor" of the source and then executes the appropriate program.""" - if SCons.Tool.tex.is_LaTeX(source): + basedir = os.path.split(str(source[0]))[0] + abspath = os.path.abspath(basedir) + + if SCons.Tool.tex.is_LaTeX(source,env,abspath): result = PDFLaTeXAuxAction(target,source,env) + if result != 0: + print env['PDFLATEX']," returned an error, check the log file" else: result = PDFTeXAction(target,source,env) + if result != 0: + print env['PDFTEX']," returned an error, check the log file" return result PDFTeXLaTeXAction = None @@ -74,6 +83,8 @@ def generate(env): PDFTeXLaTeXAction = SCons.Action.Action(PDFTeXLaTeXFunction, strfunction=SCons.Tool.tex.TeXLaTeXStrFunction) + env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes) + import pdf pdf.generate(env) @@ -85,15 +96,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') - 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') - 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') |