[Bf-committers] scons and static libs
Ken Hughes
khughes at pacific.edu
Fri Apr 18 06:15:23 CEST 2008
Ken Hughes wrote:
> Stephen Swaney wrote:
>
>> On Wed, Apr 16, 2008 at 09:54:38PM -0700, Ken Hughes wrote:
>>
>>
>>> (1) Specify the libs using a shared (".so") or static (".a") suffix.
>>> Parse each BF_*_LIB string and tack the lib into either a shared or
>>> static list, then send these to the linker separated by the appropriate
>>> platform-specific flags ("-Xlinker -Bstatic" for linux, for example). I
>>> played with the output of scons and found that this worked reliably,
>>> including the shared or static OpenGL libs.
>>>
>> Of the two solutions, #1 sounds the least hacky (at least before the
>> coffee kicks in!).
>>
>> Thinking out loud, maybe we need a separate BF_STATIC_LIBS to hold our
>> statically linked items.
>>
> I'm obviously open to either (any) good approach; for #1 I'm just unsure
> of how this would be handled in a non-gcc world (msvc, sun, irix, etc).
>
I researched this a little more today and looks like scons doesn't have
a way to handle separating static and dynamic libraries automatically.
I'm beginning to think the BF_STATIC_LIBS is a good idea, but I'm not
sure how it should work with the other BF_*_LIB variables. My first
thought that if a lib is defined one of the BF_*_LIB and is defined in
BF_STATIC_LIBS, then we use the static. BF_STATIC_LIB should just act
as a modifier for defined libs, not define libs itself. That way,
should WITH_BF_* be set false, the BF_STATIC_LIBS doesn't include that
library regardless.
Ken
More information about the Bf-committers
mailing list