Hi Gary, * Gary Kumfert wrote on Thu, Jan 12, 2006 at 09:07:52PM CET: > > I'm learning that libtool 1.5.22 "fixed" the -static flag so that > static libraries are linked in the build directory, but > shared libraries in the install directory. But I don't > understand why this is considered "better" behavior.
The discussion was controversial: http://thread.gmane.org/gmane.comp.gnu.libtool.general/6573 http://thread.gmane.org/gmane.comp.gnu.libtool.patches/5636 and references therein. > The side-effect is that libtool behaves very > differently between "make check" and "make installcheck" > ...particularly in my case, since the libraries being linked > have #ifdef PIC preprocessor directives in their source. Yep. Not very nice. Matches the documentation though, and the pre-1.5 behavior of libtool, quoting (Link mode): | `-static' | If OUTPUT-FILE is a program, then do not link it against any | uninstalled shared libtool libraries. If OUTPUT-FILE is a | library, then only create a static library. > I thought the -all-static flag would be a solution, but it > seems to go too far... trying to link in *every* library (even > system libraries) statically. > glibc (and other libs that dlopen modules internally) protest > vociferously on the link line (how do they do that?) and > ultimately break my build. Yep, I see that in quite a few cases, too. Also, link_static_flag is not correctly determined for some systems (we have a TODO item about that). > I'm at the point of hacking in my own -lt-static flag to > reproduce the old behavior of -static.... but first I wanted > to do a sanity check. > > 1. Am I the only one who prefers the older behavior? See above. > 2. Is there another way to make just the libtool libraries static > after they've been installed? I don't understand this question. What is the reason that prevented you from creating just a static library for these ones in the first place? > 3. Could there be an alternative way to structure the libraries? I haven't yet fully grasped your needs. A couple of questions in return: - Would it be sufficient if libtool implemented per-deplib `-Bstatic/-Bdynamic' (whatever they're called) switches? - The former is not so easy to implement, so: as an easier measure, were the former 1.5.x semantics of `-static' exactly those you needed? Maybe we should just implement another option to get those semantics again, as you suggested above. I wouldn't name it `-lt-static' though. Maybe `-static-libtool-libs' would fit better, but it's rather long. Cheers, Ralf _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool