Hello Charles, * Charles Wilson wrote on Sun, Jun 28, 2009 at 12:54:59AM CEST: > The best I could come up with is this: IN the source code for the object, do > > ----- top of file ----- > #if defined(BUILDING_MY_LIBRARY) && defined(DLL_EXPORT) > stuff > #endif > ----- end of file ----- > > This way, the object is included in both the static and shared > libraries, but in the former case it doesn't have any contents. > > Is there a better way?
Not that I know of. The current code might cause the object list for the static library to be a larger set than that for the shared library (because it won't add objects compiled with -static/--tag=disable-shared to $non_pic_objects), but not vice versa; but my guess is that was only done to avoid relocation errors. With a suitably smart linker, your approach shouldn't cause a larger final shared library product, however. Cheers, Ralf _______________________________________________ http://lists.gnu.org/mailman/listinfo/libtool