|
Boost-Build : |
From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2007-08-02 14:23:40
On systems that support shared library version numbers, I believe that these
should be used even when building with --layout=system.
At present, when you build Boost with --layout=system, you end up with
libraries called libboost_xyz-mt.so that have this same value set at their
ELF SONAME (this is the shared library version number embedded into the
library itself).
The problem with these libraries is that you can never have multiple
versions of them installed side-by-side in the same place. Go too far down
this road and you end up with Windows-style 'DLL hell'.
If instead the BOOST_VERSION is appended to the target name as it is with
--layout=versioned, you end up with SONAME'd libraries that can live
side-by-side with earlier/later versions of Boost.
For example, by adding the version number to the libraries, you end up with
a lib directory that looks like:
lrwxrwxrwx 1 cepstein 33 Aug 2 13:44 libboost_date_time-mt-d.so ->
libboost_date_time-mt-d.so.1.35.0
-rwxrwxr-x 1 cepstein 388K Aug 2 13:44 libboost_date_time-mt-d.so.1.35.0
lrwxrwxrwx 1 cepstein 31 Aug 2 13:44 libboost_date_time-mt.so ->
libboost_date_time-mt.so.1.35.0
-rwxrwxr-x 1 cepstein 52K Aug 2 13:44 libboost_date_time-mt.so.1.35.0
...
Now when you link applications using -lboost_date_time-mt, the linker
records the dependency on the library's SONAME, which is
libboost_date_time_mt.so.1.35.0. No other name will satisfy this runtime
dependency. As a result, you can install the (hypothetical) Boost
1.36.0libs into the same directory and old applications will continue
to pick up
the *.so.1.35.0 libs correctly, while new applications built when the
symlink points to the new library versions will pick up *.so.1.36.0.
This is how Boost.Build v1 handled --layout=system and I believe this is the
most correct and desirable behavior for platforms that support versioned
shared libraries. Attached is my simple patch against the latest SVN trunk
to make this work.
-- Caleb Epstein
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