On Sun, Dec 16, 2007 at 04:23:41PM +0100, Benoit Sigoure wrote: > On Dec 4, 2007, at 9:55 PM, Ralf Wildenhues wrote: > > >Hello, > > > >* 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: > ><http://thread.gmane.org/gmane.comp.gnu.libtool.patches/6727/ > >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).
It is fragile. There are several ways to use MSVC with libtool. The patches I have worked on does not name the static library according to your pattern, so your scheme would break with them. I don't know if you care though... Cheers, Peter _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool