Add libtool use to autotools package

Roumen Petrov
Sun Nov 7 18:40:39 GMT 2021

Hello Brian,

Brian Inglis wrote:
> Hi folks,
> I am trying to port:
> [SNIP]
> Should I run libtoolize with all defaults in the source package src directory and/or the x11 subdirectory?
Run libtoolize in directory if exist that uses libtool.

You may will to redirect project to use common "macro" directory.
Something like :
- top
- || in foo/bar
Remark: if subdir uses or prefer to use ||||||AC_CONFIG_MACRO_DIR([m4]) run ||||||||libtoolize as well.

> Should I add LT_INIT to
Yes if you want to use libtool.
No if is used AC_PROG_LIBTOOL but you may consider upgrade of macros.

> Should I add parameter [win32-dll]?
If project uses AC_LIBTOOL_WIN32_DLL you may consider to upgrade to macro, i.e.  LT_INIT([.... win32-dll ...])
If I remember well libtool  required to add -no-undefinedto LDFLAGS of binary.
Sorry but I forgot needs for "win32-dll". It seems to me harmless.

> Should I add ABI age and current version info and where to?

It depends from use.
If is a loadable module you could use  -avoid-version to skip versioning and -module to remove "lib".
For windows (mingw* or cygwin*) builds I don't think that libtool version scheme makes sense.

> Are there other files that need to be manually added or modified for libtool to work?
This is project dependent.

> Is there an approach documented somewhere for converting Linux library commands to generic libtool commands?
Question is not clear to me.
Lbtool documentation point how to use libtool to compile, link, install and etc. Actually this is way to write make "targets" that use libtool.
But if project uses automake there no need to know particular invocation.

Roumen Petrov

More information about the Cygwin mailing list