From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2006-07-04 17:15:49


Vladimir Prus wrote:
> On Linux, you can't just link to static runtime. If your program links to any
> dynamic library, it will require dynamic runtime.

I might be wrong, but there is a "-static-libgcc" switch to gcc:

 From man page:
>>
-shared-libgcc
-static-libgcc
On systems that provide libgcc as a shared library, these options
force the use of either the shared or static version respectively.
If no shared version of libgcc was built when the compiler was con-
figured, these options have no effect.
<<

AFAIK this is the equivalent of the msvc /MD /MDd for the shared
runtime and /ML /MT ... for the static runtimes.

But the <runtime-link>static for gcc is not translated to
-static-libgcc (as I would guess), but to -static .

-static has different sematics, as I think it is just to modfiy
behaviour of the -l switch to prefer static over dynamic libraries
to search for.

>> The problem now is with the "s" tag of the boost libraries:
>> On windows this means I need to link with
>> e.g. libboost_thread-vc71-mt-s.lib while on Linux
>> libboost_thread-gcc-mt.a (without the "s")
>
> I'm sorry, I don't understand you. Can you explain?

Say one writes a exe that has the /MT in its compiler switches. This
e.g. is by putting <runtime-link>static in its requirements.
Consequently on Windows I need to specify a boost library that has
the -s- in its decorated name.

On Linux with the same settings in the requirements section this will
require me to link with a version that has no s in its decorated name.

While I do not argue that there is anything wrong with this, the
inconsistency does make it harder to write platform independent
Jamfiles. (I.e. specify the correct boost lib to link with.)

Roland