code: def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw):
      
      Verbose = False
  
      if Verbose:
          print("_versioned_lib_name: libnode={:r}".format(libnode.get_path()))
          print("_versioned_lib_name: version={:r}".format(version))
          print("_versioned_lib_name: prefix={:r}".format(prefix))
          print("_versioned_lib_name: suffix={:r}".format(suffix))
          print("_versioned_lib_name: suffix_generator={:r}".format(suffix_generator))
  
      versioned_name = os.path.basename(libnode.get_path())
      if Verbose:
          print("_versioned_lib_name: versioned_name={:r}".format(versioned_name))
  
      versioned_prefix = prefix_generator(env, **kw)
      versioned_suffix = suffix_generator(env, **kw)
      if Verbose:
          print("_versioned_lib_name: versioned_prefix={:r}".format(versioned_prefix))
          print("_versioned_lib_name: versioned_suffix={:r}".format(versioned_suffix))
  
      versioned_prefix_re = '^' + re.escape(versioned_prefix)
      versioned_suffix_re = re.escape(versioned_suffix) + '$'
      name = re.sub(versioned_prefix_re, prefix, versioned_name)
      name = re.sub(versioned_suffix_re, suffix, name)
      if Verbose:
          print("_versioned_lib_name: name={:r}".format(name))
      return name
docs: For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so