Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2006-09-16 15:12:01


On Sunday 03 September 2006 22:16, John Maddock wrote:
> I've been trying to test the lib/dll naming schemes under bbv2 to check
> that everything is compatible with our existing auto-linking code, and just
> generally doing the right thing.
>
> Unfortunately I'm not getting to far :-(

Hi John,
sorry it took me a while to get back to you.

> If I place the Jamfile below in libs/config/test/link/test and try and
> build (with vc-7.1) it fails for a number of reasons:
>
> 1) If I place <link>static in the executables requirements, dependent
> lib's are *not* built as static libs, but as dll's. Consequently the build
> fails because of the conflict between the auto-link code looking for a
> static lib, and bbv2 insisting on building a dll.
>
> 2) If I place <link>static on the dependency name as in
> ..//link_test/<link>static I still get a dll built and not a static lib.

Is ".." in "..//link_test/<link>static" a typo? Did you mean "."? The problem
is that you have "link_test" target in libs/config/test/link/test/Jamfile.v2
and in Jamfile.v2 one directory up. Your
libs/config/test/link/test/Jamfile.v2 references link_test from upper-level
Jamfile.v2, and the definition there is:

   lib link_test : link_test.cpp
      : <link>shared <runtime-link>shared
        .....

This <link>shared is "final overrider" -- it overrides everything specified
everywhere else. I suspect you really wanted to just use "link_test",
without "..".

> 3) If I build with link=static on the command line then a static lib does
> get built, but it's completely the wrong variant: it builds and tries to
> link to the <runtime-link>dynamic <threading>multi variant, which would in
> any case be completely binary incompatible with the <runtime-link>static
> <threading>single executable.

Maybe it's also result of having two link_test libraries. Can you check what
happens when there's one library? You might want to add

  explicit link_test ;

to your Jamfile, so that only variant required by exe is built.

> 4) An executable built with <runtime-link>static should in any case link to
> a static lib by default: it's highly unlikely that linking to a dll will
> actually work, given all the problems with different runtimes etc.

Do you mean that:

   - <runtime-link>static should automatically switch <link>static
   - attempt to use <runtime-link>static together with <link>shared
     should result in error or warning.

- Volodya


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