views:

79

answers:

2

How does libtool decide to build a shared library or not?

Chenz

A: 

From http://www.manpagez.com/man/1/libtool/

Libtool can create either dynamically linked shared libraries, with -dynamic, or statically linked (archive) libraries, with -static.

Epsilon Prime
+1  A: 

If you use Automake and Autoconf, then Libtool builds both shared and static by default if they are supported on your platform. To build only one kind, call configure with --disable-static or --disable-shared.

ptomato
but how does it determine if your setup supports shared or static linking?
Crazy Chenz
Including the `LT_INIT` macro (or `AM_PROG_LIBTOOL` on old versions) in your `configure.ac` makes it check what your system supports at configure-time.
ptomato