Boost logo

Boost-Build :

From: Dirk Griffioen (dirk.griffioen_at_[hidden])
Date: 2005-07-10 03:38:23


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?

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.

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?

Thanks in advance,

Dirk

 --------------010102020408040405030403 Content-Type: text/html; charset=windows-1251
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=windows-1251"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi All,<br>
<br>
How does bjam link libraries on platforms/compilers that do not support
"auto-link"? (For instance gcc)<br>
<br>
Do I need to specify the libraries in the jamfile?<br>
<br>
For instance:<br>
<br>
<font face="Courier New, Courier, monospace">lib bu : :
&lt;name&gt;libboost_unit_test_framework-gcc-mt-d-1_32 ;<br>
lib bt : : &lt;name&gt;boost_thread-gcc-mt-d-1_32 ;<br>
<br>
unit-test queueqz : queueqz.cpp bu bt ;<br>
</font><br>
This works for gcc (compile, link and run), but it will fail when I
want to run a vc7 build.<br>
<br>
I think I have 2 options:<br>
<br>
1)<br>
Do something with an alias (don't know if this is legal):<br>
<br>
<font face="Courier New, Courier, monospace">lib bu : :
&lt;toolset&gt;gcc:&lt;name&gt;libboost_unit_test_framework-gcc-mt-d-1_32
<br>
         </font><font face="Courier New, Courier, monospace">&lt;toolset&gt;vc71:&lt;name&gt;libboost_unit_test_framework-vc71-mt-d-1_32
</font><font face="Courier New, Courier, monospace">;</font><br>
<br>
then<br>
<br>
<font face="Courier New, Courier, monospace">unit-test queueqz :
queueqz.cpp bu bt ;<br>
<br>
</font>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.<br>
<br>
2)<br>
If I look at boost regression, linking is done by referencing to a
boost project:<br>
<br>
<font face="Courier New, Courier, monospace">alias date_time :
../build//boost_date_time ;<br>
</font><br>
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'.<br>
<br>
However, if I bring boost under my project-root and I did something
alike:<br>
<font face="Courier New, Courier, monospace"><br>
unit-test queueqz : queueqz.cpp /boost//boost_unit ;</font><br>
<br>
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?<br>
<br>
I feel it is plausible this problem has been addressed  already. So
maybe somebody can tell me where to look?<br>
<br>
Thanks in advance,<br>
<br>
Dirk<br>
<br>
<br>
<br>
<br>
</body>
</html>
 --------------010102020408040405030403--


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