Boost logo

Boost-Build :

From: Zbynek Winkler (zw-bjam_at_[hidden])
Date: 2005-09-27 11:47:16


Hello!

I've decided to extend bb2 to compile latex documents to pdf. This is
what I have so far:

import type ;
import generators ;
import scanner ;

type.register PDF : pdf ;
type.register TEX : tex ;
type.register PNG : png ;
type.register JPG : jpg ;
type.register FIG : fig ;

actions pdflatex
{
cd bin/debug ;
TEXINPUT="../..::" pdflatex -interaction=batchmode $(>) > /dev/null
&& cd ../..
#grep log for errors and/or warnings
}

# add pdflatex
generators.register-composing pdflatex.pdflatex : TEX PDF PNG JPG : PDF ;
# add fig2dev
#generators.register-standard type.register FIG : PDF ;

# add scanner
class latex-scanner : common-scanner
{
rule pattern ( )
{
return "\\input{([^}]+)}" "\\includegraphics[^{]*{([^}]+)}" ;
}
}
scanner.register latex-scanner ;
type.set-scanner TEX : latex-scanner ;

Here are the problems I've encountered so far:

1) Why does bb2 expect the target to be in directory "bin/debug"? How
can I control this? I know I can change the 'bin' part by using 'project
: build-dir something ;' -- how do I 'remove' the 'debug' part?

2) I'd like to execute pdflatex and depending on its return value, grep
the resulting log file for the warnings and/or errors. How would I do that?

3) I'd like to unconditionaly change to the output directory before
executing pdflatex and then back again. If I do this bb2 does not notice
that pdflatex failed.

3) When using the example scanner from documentation I am missing the
proper extensions since they are not in the scanned file. When using the
\includegraphics{something} pdftex searches for file something.ext where
ext is taken form a list of extensions. The first one that matches is
used. How would I do this in bb2?

I have not found answers to these questions in the extenders manual.

Thanks.
Zbynek Winkler

 


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk