[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Favoring static linking at configure time

From: Benoit Sigoure
Subject: Re: Favoring static linking at configure time
Date: Sun, 16 Dec 2007 16:23:41 +0100

On Dec 4, 2007, at 9:55 PM, Ralf Wildenhues wrote:


* Brian Dessent wrote on Tue, Dec 04, 2007 at 07:20:40PM CET:
Benoit Sigoure wrote:

Of course there is: -Wl,-Bstatic -lfoo -Wl,-Bdynamic

Hmm I didn't know this.  How portable is it?  I guess a gccism, but
is it even portable across versions/ports of GCC?
-B seems to be fairly portable; all of the following support it:

I implemented support for it in Libtool a while ago:
< focus=6730>

it was postponed due to "2.2 being out real soon now", and it being
possibly destabilizing to HEAD.

Maybe some data points to the end that it's rather stable (I think I
tested it pretty well at some point) would help.

OK So finally I solved the whole thing by adding /abs/path/to/libfoo. $libext (instead of -lfoo) in $LIBS ($libext is computed by libtool, most of the time it's .a but it happens to be .lib at least for MSVC). This is probably fragile but at least it works on GNU/Linux (GCC, ICC), OSX (Apple GCC) and Windows (Cygwin, MinGW, MSVC).

Cheers and thanks for the suggestions. By the way the reason why I didn't bother with -Bstatic and friends is that it doesn't play nicely with MSVC.

Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory

reply via email to

[Prev in Thread] Current Thread [Next in Thread]