Minimum required fields for pkg-config .pc file

Dan Nicholson dbn.lists at gmail.com
Thu Jul 22 16:57:23 PDT 2010


On Wed, Jul 21, 2010 at 3:08 AM, Adam Mercer <ramercer at gmail.com> wrote:
> Hi
>
> What are the minimum required fields for a pkg-config.pc file, I'm
> assuming Name, Description, Version, Cflags, and Libs?

Looking at the code, it seems just Name, Description and Version are
required. Everything else is assumed to be empty if the field isn't
there.

> If Cflags and Libs use complete paths, is prefix needed?

No, absolute paths are fine. However, the advantage of using the
variables is that you can override them if necessary.

pkg-config --cflags --define-variable=prefix=/foo bar

The other reason people typically use the variables is because
autoconf is already substituting them, so you get the flexibility
basically for free if you're using the autotools.

--
Dan


More information about the pkg-config mailing list