Logo Questions Linux Laravel Mysql Ubuntu Git Menu

What is the place of libtool, when to use it?

After getting used and comfortable to GNU autoconf and GNU automake. I decided to start learning about libtool. But still I cannot see clearly the benefit of using it in the real world.

As I read the main benefit is the main portability issue which is whether the system support dynamic libraries. However, nowadays as most of the UNIX-like OS are mainly GNU/Linux, BSD-flavors or Mac OS it's hardly possible to face an OS which does not support dynamic library or has an odd library standard.

So here is my question, is it worthy to use libtool?

like image 783
Vicente Bolea Avatar asked Mar 17 '23 10:03

Vicente Bolea

2 Answers

As an example, GNU ld and Darwin's native Mach-O ld have very different options. libtool takes care of that, and can also use .la files to manage dependencies, versioning information, etc.

Consider a build system that creates DSOs, or modules that can be loaded and resolved at run time. libtool provides platform-independent options to create these objects, and the ltdl API for the application.

like image 177
Brett Hale Avatar answered Mar 19 '23 00:03

Brett Hale

Yes. It's difficult to write a makefile for a shared library that will build properly, both on Linux and on Mac OS. With Libtool it works out of the box.

like image 33
ptomato Avatar answered Mar 18 '23 22:03