def get_info(pkgname, dirs=None):
from numpy.distutils.npy_pkg_config import parse_flags<EOL>pkg_info = get_pkg_info(pkgname, dirs)<EOL>info = parse_flags(pkg_info.cflags())<EOL>for k, v in parse_flags(pkg_info.libs()).items():<EOL><INDENT>info[k].extend(v)<EOL><DEDENT>info['<STR_LIT>'] = info['<STR_LIT>']<EOL>del info['<STR_LIT>']<EOL>del info['<STR_LIT>']<EOL>return info<EOL>
Return an info dict for a given C library.

The info dict contains the necessary options to use the C library.

Parameters
----------
pkgname : str
    Name of the package (should match the name of the .ini file, without
    the extension, e.g. foo for the file foo.ini).
dirs : sequence, optional
    If given, should be a sequence of additional directories where to look
    for npy-pkg-config files. Those directories are searched prior to the
    NumPy directory.

Returns
-------
info : dict
    The dictionary with build information.

Raises
------
PkgNotFound
    If the package is not found.

See Also
--------
Configuration.add_npy_pkg_config, Configuration.add_installed_library,
get_pkg_info

Examples
--------
To get the necessary information for the npymath library from NumPy:

>>> npymath_info = np.distutils.misc_util.get_info('npymath')
>>> npymath_info                                    #doctest: +SKIP
{'define_macros': [], 'libraries': ['npymath'], 'library_dirs':
['.../numpy/core/lib'], 'include_dirs': ['.../numpy/core/include']}

This info dict can then be used as input to a `Configuration` instance::

  config.add_extension('foo', sources=['foo.c'], extra_info=npymath_info)