docs: def findLibrary(name):
      """
      Look for a library in the system.
  
      Emulate the algorithm used by dlopen.
      `name`must include the prefix, e.g. ``libpython2.4.so``
      """
      assert is_unix, "Current implementation for Unix only (Linux, Solaris, AIX)"
  
      lib = None
  
      # Look in the LD_LIBRARY_PATH
      lp = compat.getenv('LD_LIBRARY_PATH', '')
      for path in lp.split(os.pathsep):
          libs = glob(os.path.join(path, name + '*'))
          if libs:
              lib = libs[0]
              break
  
      # Look in /etc/ld.so.cache
      if lib is None:
          expr = r'/[^\(\)\s]*%s\.[^\(\)\s]*' % re.escape(name)
          m = re.search(expr, compat.exec_command('/sbin/ldconfig', '-p'))
          if m:
              lib = m.group(0)
  
      # Look in the known safe paths
      if lib is None:
          paths = ['/lib', '/usr/lib']
          if is_aix:
              paths.append('/opt/freeware/lib')
          for path in paths:
              libs = glob(os.path.join(path, name + '*'))
              if libs:
                  lib = libs[0]
                  break
  
      # give up :(
      if lib is None:
          return None
  
      # Resolve the file name into the soname
      dir, file = os.path.split(lib)
      return os.path.join(dir, getSoname(lib))