Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] On the usefulness of .la files and .pc files
@ 2009-03-18 16:44 Thomas Petazzoni
  2009-03-18 17:24 ` Sven Neumann
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2009-03-18 16:44 UTC (permalink / raw)
  To: buildroot

Hi,

My question is slightly out of topic because it doesn't concern
Buildroot specifically, but as it concerns the autotools build system,
I thought I could share it with the list.

When compiling libraries using libtool, a .la file gets installed
in /usr/lib. It defines several informations such as :

 * The names of the library ;
 * The dependencies of the library ;
 * The directory where the library is installed ;
 * A few other informations.

Many libraries also install a .pc file in /usr/lib/pkgconfig/. It also
describe the dependencies, the library name, the flags to compile new
applications/libraries on top of the library, etc.

I can't figure out why there are two different mechanisms. From my
understanding, both of these files serve the same purpose : describe
how new applications/libraries can be built against the library. Am I
wrong ?

Let's take the example of libpng. It installs :

 * /usr/lib/libpng12.la, with things like

dlname='libpng12.so.0'
dependency_libs='-L/home/thomas/thirdparty/staging/usr/lib/ -lz -lm'
libdir='/usr/lib'

 * /usr/lib/pkgconfig/libpng12.pc, with :

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/libpng12

Name: libpng
Description: Loads and saves PNG files
Version: 1.2.35
Libs: -L${libdir} -lpng12
Libs.private: -lz -lm 
Cflags: -I${includedir} 

 * /usr/bin/libpng12-config, which is a shell script that also
   basically gives the same information.

While I understand that /usr/bin/libpng12-config is a legacy script
that predates the widespread usage of pkg-config, I can't figure out
why both the .pc file and .la file are needed.

Any insight ?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-18 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18 16:44 [Buildroot] On the usefulness of .la files and .pc files Thomas Petazzoni
2009-03-18 17:24 ` Sven Neumann
2009-03-18 18:47   ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox