python/buildtools/pkgconfig.py
def parse(packages):
    """
    Parse the output from pkg-config about the passed package or packages.

    Builds a dictionary containing the 'libraries', the 'library_dirs',
    the 'include_dirs', and the 'define_macros' that are presented by
    pkg-config. *package* is a string with space-delimited package names.
    """
    def parse_package(package):
        result = collections.defaultdict(set)

        # Execute the query to pkg-config and clean the result.
        out = _query(package, '--cflags --libs')
        out = out.replace('\\"', '')

        # Iterate through each token in the output.
        for token in out.split():
            key = _PARSE_MAP.get(token[:2])
            if key:
                result[key].add(token[2:].strip())

        # Iterate and clean define macros.
        macros = set()
        for declaration in result['define_macros']:
            macro = tuple(declaration.split('='))
            if len(macro) == 1:
                macro += '',

            macros.add(macro)

        result['define_macros'] = macros

        # Return parsed configuration.
        return result

    # Go through all package names and update the result dict accordingly.
    result = collections.defaultdict(set)

    for package in packages.split():
        for k, v in parse_package(package).items():
            result[k].update(v)

    return result

    Parse the output from pkg-config about the passed package or packages.

    Builds a dictionary containing the 'libraries', the 'library_dirs',
    the 'include_dirs', and the 'define_macros' that are presented by
    pkg-config. *package* is a string with space-delimited package names.
    
Parse the output from pkg-config about the passed package or packages.
Parse the output from pkg - config about the passed package or packages .
def parse(packages):
    def parse_package(package):
        result = collections.defaultdict(set)
        out = _query(package, '--cflags --libs')
        out = out.replace('\\"', '')
        for token in out.split():
            key = _PARSE_MAP.get(token[:2])
            if key:
                result[key].add(token[2:].strip())
        macros = set()
        for declaration in result['define_macros']:
            macro = tuple(declaration.split('='))
            if len(macro) == 1:
                macro += '',
            macros.add(macro)
        result['define_macros'] = macros
        return result
    result = collections.defaultdict(set)
    for package in packages.split():
        for k, v in parse_package(package).items():
            result[k].update(v)
    return result
def parse ( packages ) : def parse_package ( package ) : result = collections . defaultdict ( set ) out = _query ( package , '--cflags --libs' ) out = out . replace ( '\\"' , '' ) for token in out . split ( ) : key = _PARSE_MAP . get ( token [ : 2 ] ) if key : result [ key ] . add ( token [ 2 : ] . strip ( ) ) macros = set ( ) for declaration in result [ 'define_macros' ] : macro = tuple ( declaration . split ( '=' ) ) if len ( macro ) == 1 : macro += '' , macros . add ( macro ) result [ 'define_macros' ] = macros return result result = collections . defaultdict ( set ) for package in packages . split ( ) : for k , v in parse_package ( package ) . items ( ) : result [ k ] . update ( v ) return result
Parse the output from pkg-config about the passed package or packages.
Parse the output from pkg - config about the passed package or packages .
"""
    Parse the output from pkg-config about the passed package or packages.

    Builds a dictionary containing the 'libraries', the 'library_dirs',
    the 'include_dirs', and the 'define_macros' that are presented by
    pkg-config. *package* is a string with space-delimited package names.
    """ # Execute the query to pkg-config and clean the result. # Iterate through each token in the output. # Iterate and clean define macros. # Return parsed configuration. # Go through all package names and update the result dict accordingly.
packages