astropy/astropy — pull request #801 by mdboom (2013-02-20 16:47:10+00:00)
Title: Improve pkg-config support

In investigating #799, I also found a related problem with the
pkg-config support.

Macro defines returned by pkg-config were not being handled. Rather
than proliferating more arguments to the pkg_config function (which
already had too many), I updated it to return a dictionary that's
useful as keyword arguments to `distutils.Extension`. Since the
values are all lists that will likely need to be "merged" with other
lists, I added a new dict subclass `DistutilsExtensionArgs` that has
default values of `[]`, and has an `update` that knows how to merge in
lists from another dictionary. This makes the code that uses
`pkg_config()` much more straightforward than it otherwise would be.

Also fixes #799, by properly decoding the output of pkg-config.