docstr: Return true if 'ext' links to a dynamic lib in the same package
docstr_tok: ["Return","true","if","'ext","'","links","to","a","dynamic","lib","in","the","same","package"]
code: def links_to_dynamic(self, ext):
      """Return true if 'ext' links to a dynamic lib in the same package"""
      # XXX this should check to ensure the lib is actually being built
      # XXX as dynamic, and not just using a locally-found version or a
      # XXX static-compiled version
      libnames = dict.fromkeys([lib._full_name for lib in self.shlibs])
      pkg = ".".join(ext._full_name.split(".")[:-1] + [""])
      return any(pkg + libname in libnames for libname in ext.libraries)
  
imports: import os
  import sys
  import itertools
  from distutils.command.build_ext import build_ext
  from distutils.file_util import copy_file
  from distutils.ccompiler import new_compiler
  from distutils.sysconfig import customize_compiler, get_config_var
  from distutils.errors import DistutilsError
  from distutils import log
  from setuptools.extension import Library
  from setuptools.extern import six
  from distutils.sysconfig import _config_vars
label_desc: Use image node_id 9 for calling the build_ext obj's underlying member method code with example usage: obj.links_to_dynamic(ext) and returns: any