Boost logo

Boost-Build :

Subject: [Boost-build] --layout=system for *nix vendors
From: Steve M. Robbins (steve_at_[hidden])
Date: 2008-11-02 23:00:29

On Wed, Oct 29, 2008 at 07:27:59PM +0300, Vladimir Prus wrote:
> On Wednesday 29 October 2008 18:03:32 Philipp Thomas wrote:

> > Using layout=system isn't an option as that also results in sonames that
> > aren't really usable.

> I presume you actually want version in soname. Look how it's done in versioned branch:
> result = $(result).$(BOOST_VERSION) ;
> If you replicate this, you'll get:
> or something -- which seems about right.

That seems about right, except that the multithreaded variant will be
named libboost_whatever. On the other hand, the default Boost
installation (i.e. using --layout=versioned) includes <threading> so
that the single threaded variant (if built) is named libboost_whatever
while the multithreaded one is named libboost_whatever-mt.

This seems likely to cause confusion with Jamfiles, autoconf macros
and CMake macros that attempt to find the right library name. On
some systems -lboost_whatever is single-threaded while on others
it is multithreaded.

How about the following change, which retains <base> <threading>
<runtime> for --layout=system but also appends $(BOOST_VERSION) when

I'm putting the entire rule here, since the diff is actually larger
(and harder to read):

# This rule is called by Boost.Build to determine the name of target. We use it
# to encode the build variant, compiler name and boost version in the target
# name.
rule tag ( name : type ? : property-set )
        local result = [ common.format-name
            <base> <threading> <runtime> -$(BUILD_ID)
            : $(name) : $(type) : $(property-set) ] ;

        if $(layout) = versioned
            result = [ common.format-name
                <base> <toolset> <threading> <runtime> -$(BOOST_VERSION_TAG)
                : $(name) : $(type) : $(property-set) ] ;

        # Optionally add version suffix. On NT, library with version suffix
        # will not be recognized by linkers. On CYGWIN, we get strage
        # duplicate symbol errors when library is generated with version
        # suffix. On OSX, version suffix is not needed -- the linker expects
        # the libFoo.1.2.3.dylib format. AIX linkers do not accept version
        # suffixes either. Pgi compilers can not accept library with version
        # suffix.
        if $(type) = SHARED_LIB &&
          ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
            ! ( [ $(property-set).get <toolset> ] in pgi ) )
            result = $(result).$(BOOST_VERSION) ;

        return $(result) ;

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