Hi Stepan, * Stepan Kasal wrote on Thu, Nov 12, 2009 at 05:11:00PM CET: > A project contains sources for several libraries. Most of them > should be built as shared libraries only, but one of them is to be > built both as a shared library and as a static one. > > The user would like to use LT_INIT([disable-static])
That won't work portably. If you disable one of the types here, then possibly some (system-dependent) configure tests may be omitted, which means you may run into trouble enabling the type later. This remark definitely holds for disable-shared. With disable-static I'm not sure without checking the sources, but it's prudent to assume the same. Instead, I'd suggest to just add --tag=disable-static to AM_LIBTOOLFLAGS or the per-target special (such as libfoo_la_LIBTOOLFLAGS). > and then > override the *FLAGS in the subdirectory containing the library that > needs to be available in both forms. He tried to use -static and > -shared together, but it did not work. (This is the documented > behaviour; though an error message from libtool might help to get > this obvious.) > Is there an option that would tell libtool to "build both", even > though it was configured with --disable-static? Not portably; see above. > I invented a solution that should work: configure with > --enable-static and then use -shared in CFLAGS or AM_CFLAGS for all > but libraries but that one. I could recommend this solution to the > user, but I feel that the solution outlined above would be more > comfortable. Yeah, something like this seems necessary. Cheers, Ralf _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool