def METHOD_NAME(target, source, env, for_signature):
    """
    Get the basename for a library (so for libxyz.so, return xyz)
    :param target:
    :param source:
    :param env:
    :param for_signature:
    :return:
    """
    verbose = False
    target_name = str(target.name)
    shlibprefix = env.subst("$SHLIBPREFIX")
    shlibsuffix = env.subst("$_SHLIBSUFFIX")
    if verbose and not for_signature:
        print(
            "_get_shlib_stem: target_name:%s shlibprefix:%s shlibsuffix:%s"
            % (target_name, shlibprefix, shlibsuffix)
        )
    if target_name.startswith(shlibprefix):
        target_name = target_name[len(shlibprefix) :]
    if target_name.endswith(shlibsuffix):
        target_name = target_name[: -len(shlibsuffix)]
    if verbose and not for_signature:
        print("_get_shlib_stem: target_name:%s AFTER" % (target_name,))
    return target_name