Boost logo

Boost-Build :

From: Jürgen Hunold (hunold_at_[hidden])
Date: 2005-07-11 02:30:21


HI Dirk !

On Sunday, 10. July 2005 10:38, Dirk Griffioen wrote:
> Hi All,
>
> How does bjam link libraries on platforms/compilers that do not
> support "auto-link"? (For instance gcc)
>
> Do I need to specify the libraries in the jamfile?

Just add something like this to your Jamroot

project
: requirements
# is dependent on
<use>/boost
<library>/boost/signals
;

use-project /boost : $(BOOST_ROOT) ;

> For instance:
>
> lib bu : : <name>libboost_unit_test_framework-gcc-mt-d-1_32 ;
> lib bt : : <name>boost_thread-gcc-mt-d-1_32 ;
>
> unit-test queueqz : queueqz.cpp bu bt ;
>
> This works for gcc (compile, link and run), but it will fail when I
> want to run a vc7 build.
>
> I think I have 2 options:
>
> 1)
> Do something with an alias (don't know if this is legal):
>
> lib bu : :
> <toolset>gcc:<name>libboost_unit_test_framework-gcc-mt-d-1_32
> <toolset>vc71:<name>libboost_unit_test_framework-vc71-mt-d-1_32 ;
>
> then
>
> unit-test queueqz : queueqz.cpp bu bt ;
>
> will link depending on toolset. And maybe I can do this once in my
> sit-config.jam. The downside is I have to go over my source tree and
> add the lib-names everywhere.

Well, you really don't have to do this. Thats what BBv2 is about, to
keep this nightmare hidden ;-))

> 2)
> If I look at boost regression, linking is done by referencing to a
> boost project:
>
> alias date_time : ../build//boost_date_time ;
>
> This will work because now bjam knows where to look with a certain
> toolset (gcc, vc71 etc), it can even build the lib 'on demand'.
>
> However, if I bring boost under my project-root and I did something
> alike:
>
> unit-test queueqz : queueqz.cpp /boost//boost_unit ;
>
> then I still would have to edit all my unit-test lines - where the
> beauty was that 'it just worked'. And I might be able to extend the
> unit-test rule to do this, but, and here comes my real question, how
> is this, "multi platform builds", done in the community?
>
> I feel it is plausible this problem has been addressed already. So
> maybe somebody can tell me where to look?

Well, just add the needed Boost libraries to the "requirements" section
of your Jamroot and everything will work on all platforms.

You might have to add
  
<define>BOOST_ALL_NO_LIB=1

to your Jamroot in order to disable auto-link...

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold ! Institut für Verkehrswesen, Eisenbahnbau
* voice: ++49 511 762-2529 ! und -betrieb, Universität Hannover  
* fax : ++49 511 762-3001 ! Appelstrasse 9a, D-30167 Hannover
* hunold_at_[hidden] ! www.ive.uni-hannover.de
 

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