Boost logo

Boost-Build :

From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-01-04 18:18:34


On 2002-01-04 at 05:44 PM, david.abrahams_at_[hidden] (David Abrahams) wrote:

>Hmm; we could dispense with ABSOLUTE altogether and just supply PWD. From
>there, we can turn any relative path into an absolute one ourselves, by
>prepending the value of PWD:
>
>$(some-path:R=$(PWD))

Sure, that also seems reasonable :-) But I'm not sure I would use "PWD" as the
name. Even though it's a very recognized name and concept, it would collide
with the import of environment variables. But then again it's not like it will
collide with a different value, so sure PWD it is.

>We could even do this in build actions to induce absolute paths there.
>
>> PROJECT_CONFIG ?= project-config.jam ;
>> SEARCH on $(PROJECT_CONFIG) : . ;
>> ABSOLUTE $(PROJECT_CONFIG) ;
>> BIND $(PROJECT_CONFIG) ;
>> if $(PROJECT_CONFIG)
>> {
>> ECHO $(PROJECT_CONFIG) ;
>> }
>>
>> Prints "/home/user/something/project-config.jam", if it's found.
>
>That's pretty complicated. What do you think of my suggestions?

Yea, but even using $(PWD) doesn't simplify it much. It just eliminates the
ABSOLUTE call. The loop for finding the top project file is a little easier to
look at:

local d_ = $(PWD) ;
while ($(d_) != $(d_:P))
{
SEARCH on $(PROJECT_CONFIG) : $(d_) ;
BIND $(PROJECT_CONFIG) ;
if $(PROJECT_CONFIG)
{
include $(PROJECT_CONFIG) ;
}
d_ = $(d_:P) ;
}

-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]

 


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