Boost logo

Boost-Build :

Subject: [Boost-build] best was to handle external libs on windows and unix
From: Jim Gallagher (jim_at_[hidden])
Date: 2009-03-31 16:37:25


Hi,

We are using boost-build as a build environment around customizations to a
COTS product. We extend the product using C/C++; the vendor supplies header
files and libraries with the product. The vendor libraries are named the
same on windows and unix, except for the platform conventions. For example,
on windows we may link against libfoo.lib, while on unix we link against
libfoo.so.

The problem is that the linker behaves differently with respect to passed
library names between windows and unix. For example, if I define libfoo like
so:

lib libfoo : : <name>foo <search>$(VEND_ROOT)/lib ;

Then the link works on unix, as the linker gets passed -lfoo, and it assumes
that there is a lib prefix. This does not work on windows, because there is
no prefix assumption. The linker gets passed foo.lib, which fails because
the name is really libfoo.lib.

If I leave the name property off, then the link works on windows but fails
on unix, because -llibfoo tells the linker to look for liblibfoo.so, which
is, of course, wrong.

Any suggestions on the best way to handle this? I have ~300 vendor libs to
deal with....

Thanks,
Jim Gallagher



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