Boost logo

Boost-Build :

Subject: Re: [Boost-build] [boost.jam] Use full path to archive rather than searchable prebuilt libraries
From: Samuel Debionne (samuel.debionne_at_[hidden])
Date: 2014-07-11 05:39:51


I have tried to declare alternative libraries for static and shared linking. Here’s what I have so far :

 local rule boost_lib_std ( id : shared-lib-define )
 {
- lib $(id) : : : : <link>shared:<define>$(shared-lib-define) ;
+ local opt = [ property-set.create <link>static <target-os>darwin <toolset>clang <threading>multi ] ;
+ local lib = /opt/local/lib ;
+ local path = [ path.join $(lib) [ tag_std $(id) : STATIC_LIB : $(opt) ] ] ;
+
+ lib $(id) : : <link>static <file>$(path) ;
+ lib $(id) : : <link>shared <tag>@tag_std : : <define>$(shared-lib-define) ;
 }

The problem is that the lib properties are hardcoded and I can’t think of way to get them within boost_lib_std.

Is there any chance to have <tag> and <file> work together (resolving the file path the same way library name are resolved for shared libraries) ?

Hoping that makes sense...

Le 10 juil. 2014 à 14:43, Samuel Debionne <samuel.debionne_at_[hidden]> a écrit :

> Hello all,
> I'm using boost.jam contrib to use boost from my own boost-built
> projects. The default behavior is to define searchable libraries.
> On my system (darwin), both static and shared prebuilt libraries are
> installed. The thing with searchable libraries is there is no way to
> tell clang to choose the archive version vs the shared one when they are
> both in the same directory (eg /opt/local/lib), the shared library is
> always preferred. So my question is : is there a way to hack boost.jam
> to use full path to archive (eg <file>@tag_std ?) when building
> statically linked executables and the present behavior when building
> shared executables ?
> Regards,
> Samuel Debionne
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost-build


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