Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-09-07 05:43:01

Toon Knapen wrote:
> In the mipspro toolset for bjamv2 (which I'm working on) I need to add
> the path $(BOOST_ROOT)/boost/compatibility/cpp_c_headers to the
> C++FLAGS. But for that I need to know BOOST_ROOT. I was hoping a
> variable BOOST_ROOT would be defined that points to this location but I
> tried
> local boost_root = [ modules.peek : BOOST_ROOT ] ;
> ECHO $(boost_root) ;
> but it turns out to be empty (although another toolset uses the same
> trick). Any ideas about how i can do this ?

Hi Toon,

the first question is why you're trying to do this? Is the toolset just
completely broken without compatibility headers? What if someone tries to use
the toolset without Boost?

Assuming requiring Boost around is OK, you can do the same thing as boostbook

1. Take BOOST_ROOT from environment, if it's set there
2. Take BOOST_BUILD_PATH and add "../../.." to try getting boost root path
3. GLOB the resulting paths for boost/compatibility/cpp_c_headers

Here's the relevant code:

local boost-root = [ modules.peek : BOOST_ROOT ] ;
if $(boost-root)
boost-root = [ path.make $(boost-root) ] ;
local boost-build-root = [
sequence.transform path.make : [ modules.peek : BOOST_BUILD_PATH ]
] ;
local search-dirs = [ path.join $(boost-root) tools boostbook ]
$(boost-build-root)/../../boostbook ;

local boostbook-xsl-dir ;
for local dir in $(search-dirs) {
boostbook-xsl-dir += [ path.glob $(dir) : xsl ] ;

(Note that 'path.glob' accepts several paths, so the loop is not really

I'd suggest that you also provide a toolset parameter which the user can use
to specify the location of boost root, in case this auto-detection fails.



Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at