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?
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?
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.
AC_DISABLE_STATIC
, it will build both by default. AC_DISABLE_STATIC
may be countered by using ./configure --enable-static
for example. So what's in configure.ac
really is a developer's suggestion to its users. –
Dromedary © 2022 - 2024 — McMap. All rights reserved.