|
Boost-Build : |
From: Jurko GospodnetiÄ (jurko.gospodnetic_at_[hidden])
Date: 2008-07-19 04:22:18
Hi Xavier.
> rule get_dependencies ( package ) {
> ECHO "Boos dependencies from: " $(package) ;
> SHELL "bcp --list --boost=/usr/local/include/boost-1_35 $(package)" ;
> }
>
> local boost_files = [ get_dependencies scoped_ptr ] ;
>
> local result ;
> for local b_file in $(boost_files) {
> result += "-----> /usr/local/include/$(b_file)" ;
> return $(result) ;
> }
>
> install dist-src
> :
> # [ glob-tree *.cpp *.h ] // This works correctly
> $(result)
> :
> <install-source-root>.
> <install-dependencies>on <install-type>H
> ;
> ===============
>
> The output is:
>
> ===============
> Testing with: scoped_ptr
> -----> /usr/local/include/boost/assert.hpp
> boost/checked_delete.hpp
> boost/config.hpp
> boost/config/abi/borland_prefix.hpp
> ...
> ===============
>
> So, seems that the "for" iteration only works correctly for the first
> element of $(boost_files). Why ?
I just now took a look at this and it is not that the "for iteration"
is processing only the first file on the list that is causing the
problem but the fact that your SHELL invocation actually returned only a
single item containing all the file names separated by new-lines.
Therefore the "for iteration" processed that single item and simply
added your -----> mark in front of it.
> And, is there any other way easier than this ?
I have tried playing around with splitting the SHELL result into
separate items but have been unsuccessful. I have been trying it on
Windows that use the \r\n end-of-line mark instead of \n so that might
have been the cause but I do not believe this can be done portably with
the current Boost Jam.
Its MATCH rule & therefore its regex.split rule does not seem to be
able to split text containing newlines into separate items - one per
line. It could be that could be made to work by adding support to Boost
Jam to directly represent end-of-line characters in code, but did not
take the time to try this out.
I guess it could be done in an unportable way by using a construct like:
local nl = "
" ;
local match = [ MATCH "^([^$(nl)]*)[$(nl)]?(.*)" : $(string) ] ;
But you would have to play around with that to see something like
that helps. Note just that this would consider \r\n to mean two
end-of-line characters.
Sorry if this was not helpful enough. Perhaps someone else can be of
more help and perhaps someone can test this for you on some *nix OS.
Best regards,
Jurko GospodnetiÄ
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