Boost logo

Boost-Build :

From: Zbynek Winkler (zw-bjam_at_[hidden])
Date: 2005-09-27 17:48:23


Reece Dunn wrote:

>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.
>
>
Hmm. Those two *.jam you talk about - that is no good night reading...
I'll have to get back to it tomorrow. Just one question - if you
generate output to ./html and BB expects it in bin/debug - doesn't it
cause regeneration of the whole thing when you invoke BB again?

>>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.
>
>
Interesting. I think there is something I can use (mainly the "exit
$(STATUS)" thing).

>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.
>
>
What I really want to keep down is the usage complexity. I'd like to be
able just execute bjam and be done with it. I think that using the stuff
from testing.jam will help me to do that. I remember there was a
discussion about builtin CAT/GREP/READ and such. How did it end up? Do
we have a builtin GREP now?

>>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.
>
>
If only it would be that easy. There is no way how to tell that 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.
>
>
Ok, I will.

>>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 :)!
>
>
Yes, I know :). The thing is that latex generates all the junk files to
the current directory so it is more a question of putting unwanted files
away...

Thanks for the insights. When I have some progress (or problem ;-)) I'll
let you know.

Zbynek

 


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