Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are libtool's .la file for?

What are libtool's .la files for? How are they used with a shared object?

like image 323
chappar Avatar asked Aug 06 '09 10:08

chappar


People also ask

What is .LA file?

An LA file is an archive used by Libtool, a generic library support script used for creating portable compiled libraries. It contains a library description that may include a reference to a shared or dynamic library.

What is a Linux .a file?

Files with the “. a” extension are static libraries. These Libraries contain functions that are linked to the calling code at compile time and become part of the application.

What is a library file in Linux?

A Linux in its very simple terms is a collection of pre-compiled pieces of code which are known as functions. Libraries are very useful as they provide reusable functions, classes and data structures. Some examples of libraries in Linux are glibc (GNU version of standard C library), libc (the C standard library).

What is lib so?

so file is a compiled library file. It stands for "Shared Object" and is analogous to a Windows DLL. Often, package files will place these under /lib or /usr/lib or some place similar when they're installed.


1 Answers

It is a textual file that includes a description of the library.

It allows libtool to create platform-independent names.

For example, libfoo goes to:

Under Linux:

/lib/libfoo.so       # Symlink to shared object /lib/libfoo.so.1     # Symlink to shared object /lib/libfoo.so.1.0.1 # Shared object /lib/libfoo.a        # Static library /lib/libfoo.la       # 'libtool' library 

Under Cygwin:

/lib/libfoo.dll.a    # Import library /lib/libfoo.a        # Static library /lib/libfoo.la       # libtool library /bin/cygfoo_1.dll    # DLL 

Under Windows MinGW:

/lib/libfoo.dll.a    # Import library /lib/libfoo.a        # Static library /lib/libfoo.la       # 'libtool' library /bin/foo_1.dll       # DLL 

So libfoo.la is the only file that is preserved between platforms by libtool allowing to understand what happens with:

  • Library dependencies
  • Actual file names
  • Library version and revision

Without depending on a specific platform implementation of libraries.

like image 187
Artyom Avatar answered Sep 19 '22 03:09

Artyom