import itertools


def possible_library_filenames(library_names):
    """Given a collection of library names like 'libfoo', generate the set of
    library filenames that may be found on the system (e.g. libfoo.so). This
    generates the library filenames that may appear on any OS.
    """
    lib_extensions = ['a', 'la', 'so', 'tbd', 'dylib']
    return set(
        '.'.join((lib, extension)) for lib, extension in
        itertools.product(library_names, lib_extensions))