On Mon, 21 May 2012, Werner LEMBERG wrote:

The question is what happens for static linking.  For example, in the
FreeType case, I get the following:

 > pkg-config --libs --static freetype2
 -L/usr/local/lib -lfreetype -lz -lbz2

 > pkg-config --libs freetype2
 -L/usr/local/lib -lfreetype

If I specify the .la flag for `libtool --mode=link', the above two
case are properly covered...

Without the .la file, libtool needs to primarily trust the behavior of the compiler and linker. Attempting to intuit what linking with -lfoo can and will do without a libfoo.la file is not reasonably possible. Due to this, libtool simply passes -lfoo to the compiler if libfoo.la is not found in the known linker search path.

While static linking is sometimes useful (and sometimes required), the trend is that libraries are always built as shared libraries and dynamic linking is used.

Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool

Reply via email to