Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create both static and shared library with GNU libtool?

I am using the GNU autotools (including automake!) for my project. I would like to know if I could create a static and a shared library using libtool? Or would the declarations be separate? Would this:

LT_INIT(shared static)

work?

like image 979
Mohit Deshpande Avatar asked Nov 29 '10 22:11

Mohit Deshpande


1 Answers

Nothing besides LT_INIT is needed, it defaults to building both static and shared libraries. If you like, you can again explicitly state the defaults (but it is sort of redundant)

LT_INIT
AC_ENABLE_SHARED
AC_ENABLE_STATIC

edit: manual says LT_INIT([shared]) and LT_INIT([static]) (combined to LT_INIT([shared static]) shall also work. Also manual's more precise wording on what's default when LT_INIT is given: this macro turns on shared libraries if they are available, and also enables static libraries if they don't conflict with the shared libraries.

like image 177
user502515 Avatar answered Nov 08 '22 20:11

user502515