A specification for pkg-config

Dan Nicholson dbn.lists at gmail.com
Tue Sep 18 20:31:45 PDT 2012

Sorry for the slow reply.

On Mon, Sep 3, 2012 at 2:11 PM, Michał Górny <mgorny at gentoo.org> wrote:
> Hello,
> Due to a lack of good documentation in pkg-config, I have decided to
> write a small specification based mostly on its source code, available
> documentation and a fair bit of common sense.
> I think it's fairly complete now, and thus I'd like to get some
> feedback on it. There were a few things that I was unsure about.
> I tried to follow the actual behavior but whenever I thought it's not
> something people should trust, I put an 'implementation-defined'
> behavior (not sure if it's the most correct way of stating that).
> The specification also explicitly states what I have omitted now. I'd
> appreciate an opinion whether the things mentioned there should be
> added and any comments relevant to them. I'd also like to know
> if I missed something.
> Thank you for your patience.
> The rendered version: http://dev.gentoo.org/~mgorny/pkg-config-spec.html
> Plain-text version:   http://dev.gentoo.org/~mgorny/pkg-config-spec.txt
> Project repository:   https://bitbucket.org/mgorny/pkg-config-spec

I think that's really great that you did that work. I've always wanted
a formal spec for pkg-config. The best we have is buried in
pkg-config(1). I'd love to carry a spec in the pkg-config repo and
publish it on the website. This seems like a great start. There are
certain bugs that I don't think can be fixed without small extensions
of the syntax, and without a spec it's difficult to roll those out.
Now to the specifics.

1. Most of the introduction is complaints about how the reference
implementation has been designed. I don't think that belongs in a

2. The specification seems to cover both the package file format and
the implementation. The file format I'm definitely interested in
specifying, but I'm not so interested in specing the implementation. I
understand you're trying to create a drop-in replacement for
pkg-config. I have no issue with that. However, I'm really not
interested in constraining the reference implementation in a spec. I
wouldn't want to have to bump a spec if I added a command line switch
or autoconf macro that someone found useful. I can't speak for Tollef,
but I'd only be interested in defining the package format and the
parts of the implementation that are vital to interpreting that
format. I hope you understand.

What do you think?


More information about the pkg-config mailing list