def _versioned_lib_soname(env, libnode, version, prefix, suffix, name_func):
    """For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so.X'"""
    Verbose = False
    if Verbose:
        print("_versioned_lib_soname: version={:r}".format(version))
    name = name_func(env, libnode, version, prefix, suffix)
    if Verbose:
        print("_versioned_lib_soname: name={:r}".format(name))
    major = version.split('.')[0]
    soname = name + '.' + major
    if Verbose:
        print("_versioned_lib_soname: soname={:r}".format(soname))
    return soname