def METHOD_NAME(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