[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed for packaging a library

On Fri, 2008-03-28 at 21:06 -0300, Felipe Sateler wrote:
> Helmut Grohne wrote:
> >> Why is my library architecture-dependent? How can I make it
> >> architecture-independent, assuming the source code doesn't care about the
> >> architecture (I don't think a printf should be a problem)?

Take a look at /usr/share/pkgconfig/ - the pc files in there are icon
themes, mime data, doc preparation - those are the only things that
should have .pc files in /usr/share, basically build tools and system
data, not compiled libraries.

The packaged library (libfoo.so) must be architecture-dependent and
therefore the .pc file needs to be in /usr/lib/ with all the other
library .pc files.

If this is unclear, maybe you should not be packaging a library in the
first place as shared library packages are always more complex than a
typical application package.

> I'd say that in pretty much all non-trivial libraries the pc file is
> system-dependant, so I would go with /usr/lib by default even if in your case
> the pkgconfig file is trivial.

Most .pc files are trivial - they must be complete, that's the main


That may look like a template but there are various modes that will need
each and all of those to be specified in full. One or two packages seem
to think that these are expendable - they are *not*. The shortest a .pc
file can get would be:


Name: foo
Description: foo Library.
Version: 0.7.5
Requires: glib-2.0
Requires.private: bar
Libs: -L${libdir} -lfoo
Libs.private: -lm
Cflags: -I${includedir}/foo

Requires.private and Libs.private should be used wherever possible.


Neil Williams

Attachment: signature.asc
Description: This is a digitally signed message part

Reply to: