def libs_for_binary(a_binary, visited=[])
    return [] if visited.include?(a_binary)
    visited << a_binary
    pre = Rake::Task[a_binary].prerequisites
    rv = []
    pre.each do |p|

      next if (File.extname(p) != '.a') && (File.extname(p) != '.so')
      next if p =~ /\-app\.a/

      rv << File.basename(p).gsub(/(\.a|\.so|^lib)/, '')
      rv += libs_for_binary(p, visited)   # Recursive call
    end

    reduce_libs_to_bare_minimum(rv.uniq)
  end
def libs_for_binary(a_binary, visited=[])
    return [] if visited.include?(a_binary)
    visited << a_binary
    pre = Rake::Task[a_binary].prerequisites
    rv = []
    pre.each do |p|

      next if (File.extname(p) != '.a') && (File.extname(p) != '.so')
      next if p =~ /\-app\.a/

      rv << File.basename(p).gsub(/(\.a|\.so|^lib)/, '')
      rv += libs_for_binary(p, visited)   # Recursive call
    end

    reduce_libs_to_bare_minimum(rv.uniq)
  end
Return array of library prerequisites for given file