Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-09-27 15:07:54


Zbynek Winkler wrote:
> Hello!
>
> I've decided to extend bb2 to compile latex documents to pdf. This is
> what I have so far:
> [snip]
> 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?

Short answer: you can't! The boostbook.jam and xsltproc.jam have similar
issues. They pass the output directory as the target name, so for
example HTML output is generated to ./html.

> 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?

testing.jam would be your best bet for what you want to do here.
However, why not leave it alone and get everything outputted by
bjam/BBv2. Then you can grep for errors/warnings on the output that BBv2
generates. This will keep the implementation complexity down.

> 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.

As Alexey mentions, this is to be avoided if possible. A better approach
would be to pass a directory to the latex tool.

> 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?

You could try implementing a custom scanner similar to what it does for
header files in C/C++ source code. You need to dig around in builtin.jam
for the implementation of this scanner.

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

NOTE: You can use install to copy generated targets to a specific
location, so instead of redirecting the output directory, you could have:

pdflatex mydoc : ... ;

install pdf : mydoc ; # place mydoc.pdf in the ./pdf directory

The install rule is *very* useful :)!

HTH,
Reece

 


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