def shlib_emitter(target, source, env):
    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
    no_import_lib = env.get('no_import_lib', 0)

    if not dll or len(target) > 1:
        raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX"))

    # Remove any "lib" after the prefix
    pre = env.subst('$SHLIBPREFIX')
    if dll.name[len(pre):len(pre)+3] == 'lib':
        dll.name = pre + dll.name[len(pre)+3:]

    orig_target = target
    target = [env.fs.File(dll)]
    target[0].attributes.shared = 1

    # Append an import lib target
    if not no_import_lib:
        # Create list of target libraries as strings
        target_strings = env.ReplaceIxes(orig_target[0],
                                         'SHLIBPREFIX', 'SHLIBSUFFIX',
                                         'IMPLIBPREFIX', 'IMPLIBSUFFIX')

        implib_target = env.fs.File(target_strings)
        implib_target.attributes.shared = 1
        target.append(implib_target)

    return (target, source)
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/cyglink.py/shlib_emitter/original