Boost logo

Boost-Build :

Subject: [Boost-build] what exactly does determine-target-name ?
From: Fabien CHÊNE (fabien.chene_at_[hidden])
Date: 2010-02-18 12:07:35


Hi,

I encounter an issue with a custom generator. It used to work with an
older boost build (2.0-m11), and unfortunately, it no longer works.
Depending where I invoke bjam, object files are written in different
directories. Invoking bjam in the top directory, a file is generated
here:

e_spnav/LDE/generated/src/bin/gcc-3.4/debug/address-model-32/architecture-x86/idl-typecode-any-nosplit/instruction-set-i686/omniidl-use-spn-wrapper-yes/threading-multi/GeneralConfigLDE.genSK.o

If I invoke bjam in a subdirectory, it generates the same file here:
e_spnav/LDE/generated/src/bin/gcc-3.4/debug/address-model-32/architecture-x86/idl-typecode-any-nosplit/instruction-set-i686/omniidl-use-spn-wrapper-yes/threading-multi/e_spnav/LDE/generated/src/GeneralConfigLDE.genSK.o

I have spent a hard time understanding why. My guilty is the function
determine-output-name, which calls determine-target-name.

rule determine-target-name ( fullname : prefix ? : postfix ? )
{
        # See if we need to add directory to the target name.
        local dir = $(fullname:D) ;
        local name = $(fullname:B) ;

        name = $(prefix:E=)$(name) ;
        name = $(name)$(postfix:E=) ;

        if $(dir) &&
          # Never append '..' to target path.
          ! [ MATCH .*(\\.\\.).* : $(dir) ]
            &&
          ! [ path.is-rooted $(dir) ]
        {
            # Relative path is always relative to the source
            # directory. Retain it, so that users can have files
            # with the same in two different subdirectories.
            name = $(dir)/$(name) ;
        }
        return $(name) ;
    }

I don't understand why, depending on the fact that the path is
relative or not, the target name should be prefixed by the directory.
2.0-m11 only made: name = $(name:D=)

-- 
Fab

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