TeX formatter and typesetter and the LaTeX structured formatter and
typesetter.
+.IP BIBTEXCOMSTR
+The string displayed when generating a bibliography
+for TeX or LaTeX.
+If this is not set, then $BIBTEXCOM (the command line) is displayed.
+
+.ES
+env = Environment(BIBTEXCOMSTR = "Generating bibliography $TARGET")
+.EE
+
+
.IP BIBTEXFLAGS
General options passed to the bibliography generator for the TeX formatter
and typesetter and the LaTeX structured formatter and typesetter.
.IP LATEXCOM
The command line used to call the LaTeX structured formatter and typesetter.
+.IP LATEXCOMSTR
+The string displayed when calling
+the LaTeX structured formatter and typesetter.
+If this is not set, then $LATEXCOM (the command line) is displayed.
+
+.ES
+env = Environment(LATEXCOMSTR = "Building $TARGET from LaTeX input $SOURCES")
+.EE
+
.IP LATEXFLAGS
General options passed to the LaTeX structured formatter and typesetter.
.IP TEXCOM
The command line used to call the TeX formatter and typesetter.
+.IP TEXCOMSTR
+The string displayed when calling
+the TeX formatter and typesetter.
+If this is not set, then $TEXCOM (the command line) is displayed.
+
+.ES
+env = Environment(TEXCOMSTR = "Building $TARGET from TeX input $SOURCES")
+.EE
+
.IP TEXFLAGS
General options passed to the TeX formatter and typesetter.
- Fix expansion of env.Command() overrides within target and
source file names.
- - Support easier customization of what's displayed by various default
- actions by adding new construction variables: $ARCOMSTR, $ASCOMSTR,
- $ASPPCOMSTR, $BITKEEPERCOMSTR, $CCCOMSTR, $CVSCOMSTR, $CXXCOMSTR,
- $F77COMSTR, $F90COMSTR, $F95COMSTR, $FORTRANCOMSTR, $JARCOMSTR,
- $JAVACCOMSTR, $JAVAHCOMSTR, $LEXCOMSTR, $LINKCOMSTR, $RCSCOMSTR,
+ - Support easier customization of what's displayed by various
+ default actions by adding lots of new construction variables:
+ $ARCOMSTR, $ASCOMSTR, $ASPPCOMSTR, $BIBTEXCOMSTR, $BITKEEPERCOMSTR,
+ $CCCOMSTR, $CVSCOMSTR, $CXXCOMSTR, $F77COMSTR, $F90COMSTR, $F95COMSTR,
+ $FORTRANCOMSTR, $JARCOMSTR, $JAVACCOMSTR, $JAVAHCOMSTR, $LATEXCOMSTR,
+ $LEXCOMSTR, $LINKCOMSTR, $PDFLATEXCOMSTR, $PDFTEXCOMSTR, $RCSCOMSTR,
$RMICCOMSTR, $SCCSCOMSTR, $SHCCCOMSTR, $SHCXXCOMSTR, $SHF77COMSTR,
$SHF90COMSTR, $SHF95COMSTR, $SHFORTRANCOMSTR, $SHLINKCOMSTR,
- $TARCOMSTR, $YACCCOMSTR and $ZIPCOMSTR.
+ $TARCOMSTR, $TEXCOMSTR, $YACCCOMSTR and $ZIPCOMSTR.
- Add an optional "map" keyword argument to ListOption() that takes a
dictionary to map user-specified values to legal values from the list
import SCons.Defaults
import SCons.Util
-LaTeXAction = SCons.Action.Action('$LATEXCOM')
+LaTeXAction = SCons.Action.Action('$LATEXCOM', '$LATEXCOMSTR')
def generate(env):
"""Add Builders and construction variables for LaTeX to an Environment."""
import SCons.Defaults
import SCons.Util
-PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM')
+PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')
def generate(env):
"""Add Builders and construction variables for pdflatex to an Environment."""
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import SCons.Action
import SCons.Defaults
import SCons.Util
+PDFTeXAction = SCons.Action.Action('$PDFTEXCOM', '$PDFTEXCOMSTR')
+
def generate(env):
"""Add Builders and construction variables for pdftex to an Environment."""
try:
bld = SCons.Defaults.PDF()
env['BUILDERS']['PDF'] = bld
- bld.add_action('.tex', '$PDFTEXCOM')
+ bld.add_action('.tex', PDFTeXAction)
env['PDFTEX'] = 'pdftex'
env['PDFTEXFLAGS'] = SCons.Util.CLVar('')
# Define an action to build a generic tex file. This is sufficient for all
# tex files.
-TeXAction = SCons.Action.CommandAction("$TEXCOM")
+TeXAction = SCons.Action.Action("$TEXCOM", "$TEXCOMSTR")
# Define an action to build a latex file. This action might be needed more
# than once if we are dealing with labels and bibtex
-LaTeXAction = SCons.Action.CommandAction("$LATEXCOM")
+LaTeXAction = SCons.Action.Action("$LATEXCOM", "$LATEXCOMSTR")
# Define an action to run BibTeX on a file.
-BibTeXAction = SCons.Action.CommandAction("$BIBTEXCOM")
+BibTeXAction = SCons.Action.Action("$BIBTEXCOM", "$BIBTEXCOMSTR")
def LaTeXAuxAction(target = None, source= None, env=None):
"""A builder for LaTeX files that checks the output in the aux file
LaTeXAction(target,source,env)
return 0
-def TeXLaTeXAction(target = None, source= None, env=None):
+LaTeX_re = re.compile("\\\\document(style|class)")
+
+def is_LaTeX(flist):
+ # Scan a file list to decide if it's TeX- or LaTeX-flavored.
+ for f in flist:
+ content = f.get_contents()
+ if LaTeX_re.search(content):
+ return 1
+ return 0
+
+def TeXLaTeXFunction(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."""
- LaTeXFile = None
- for src in source:
- content = src.get_contents()
- if re.search("\\\\document(style|class)",content):
- LaTeXFile = 1
- break
- if LaTeXFile:
+ if is_LaTeX(source):
LaTeXAuxAction(target,source,env)
else:
TeXAction(target,source,env)
return 0
+TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction,
+ strfunction=None)
+
def generate(env):
"""Add Builders and construction variables for TeX to an Environment."""
try:
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $LATEXCOM construction variable.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mylatex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['latex'],
+ LATEXCOM = r'%(python)s mylatex.py $TARGET $SOURCE')
+env.DVI('test1', 'test1.latex')
+""" % locals())
+
+test.write('test1.latex', """\
+test1.latex
+/*latex*/
+""")
+
+test.run()
+
+test.must_match('test1.dvi', "test1.latex\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $LATEXCOMSTR construction variable allows you to configure
+the C compilation output.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mylatex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['latex'],
+ LATEXCOM = r'%(python)s mylatex.py $TARGET $SOURCE',
+ LATEXCOMSTR = 'Building $TARGET from $SOURCE')
+env.DVI('test1', 'test1.latex')
+""" % locals())
+
+test.write('test1.latex', """\
+test1.latex
+/*latex*/
+""")
+
+test.run(stdout = test.wrap_stdout("""\
+Building test1.dvi from test1.latex
+""" % locals()))
+
+test.must_match('test1.dvi', "test1.latex\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $PDFLATEXCOM construction variable.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mypdflatex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['pdflatex'],
+ PDFLATEXCOM = r'%(python)s mypdflatex.py $TARGET $SOURCE')
+env.PDF('test1', 'test1.latex')
+""" % locals())
+
+test.write('test1.latex', """\
+test1.latex
+/*latex*/
+""")
+
+test.run()
+
+test.must_match('test1.pdf', "test1.latex\n")
+
+
+
+test.pass_test()
--- /dev/null
+
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $PDFLATEXCOMSTR construction variable allows you to configure
+the C compilation output.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mypdflatex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*latex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['pdflatex'],
+ PDFLATEXCOM = r'%(python)s mypdflatex.py $TARGET $SOURCE',
+ PDFLATEXCOMSTR = 'Building $TARGET from $SOURCE')
+env.PDF('test1', 'test1.latex')
+""" % locals())
+
+test.write('test1.latex', """\
+test1.latex
+/*latex*/
+""")
+
+test.run(stdout = test.wrap_stdout("""\
+Building test1.pdf from test1.latex
+""" % locals()))
+
+test.must_match('test1.pdf', "test1.latex\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $PDFTEXCOM construction variable.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mypdftex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['pdftex'],
+ PDFTEXCOM = r'%(python)s mypdftex.py $TARGET $SOURCE')
+env.PDF('test1')
+""" % locals())
+
+test.write('test1.tex', """\
+test1.tex
+/*tex*/
+""")
+
+test.run()
+
+test.must_match('test1.pdf', "test1.tex\n")
+
+
+
+test.pass_test()
--- /dev/null
+
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $PDFTEXCOMSTR construction variable allows you to configure
+the C compilation output.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mypdftex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['pdftex'],
+ PDFTEXCOM = r'%(python)s mypdftex.py $TARGET $SOURCE',
+ PDFTEXCOMSTR = 'Building $TARGET from $SOURCE')
+env.PDF('test1')
+""" % locals())
+
+test.write('test1.tex', """\
+test1.tex
+/*tex*/
+""")
+
+test.run(stdout = test.wrap_stdout("""\
+Building test1.pdf from test1.tex
+""" % locals()))
+
+test.must_match('test1.pdf', "test1.tex\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test the ability to configure the $TEXCOM construction variable.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mytex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['tex'],
+ TEXCOM = r'%(python)s mytex.py $TARGET $SOURCE')
+env.DVI('test1')
+""" % locals())
+
+test.write('test1.tex', """\
+test1.tex
+/*tex*/
+""")
+
+test.run()
+
+test.must_match('test1.dvi', "test1.tex\n")
+
+
+
+test.pass_test()
--- /dev/null
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test that the $TEXCOMSTR construction variable allows you to configure
+the C compilation output.
+"""
+
+import os
+import string
+import sys
+import TestSCons
+
+python = TestSCons.python
+_exe = TestSCons._exe
+
+test = TestSCons.TestSCons()
+
+
+
+test.write('mytex.py', r"""
+import sys
+outfile = open(sys.argv[1], 'wb')
+infile = open(sys.argv[2], 'rb')
+for l in filter(lambda l: l != '/*tex*/\n', infile.readlines()):
+ outfile.write(l)
+sys.exit(0)
+""")
+
+test.write('SConstruct', """
+env = Environment(TOOLS = ['tex'],
+ TEXCOM = r'%(python)s mytex.py $TARGET $SOURCE',
+ TEXCOMSTR = 'Building $TARGET from $SOURCE')
+env.DVI('test1')
+""" % locals())
+
+test.write('test1.tex', """\
+test1.tex
+/*tex*/
+""")
+
+test.run(stdout = test.wrap_stdout("""\
+Building test1.dvi from test1.tex
+""" % locals()))
+
+test.must_match('test1.dvi', "test1.tex\n")
+
+
+
+test.pass_test()