class PackageConfig

def collect_libs

def collect_libs
  all_libs = required_packages.collect do |package|
    self.class.new(package, @options).libs
  end
  all_libs = [declaration("Libs")] + all_libs
  all_libs = all_libs.join(" ").gsub(/-([Ll]) /, '\1').split.uniq
  path_flags, other_flags = all_libs.partition {|flag| /\A-L/ =~ flag}
  path_flags = path_flags.reject do |flag|
    /\A-L\/usr\/lib(?:64)?\z/ =~ flag
  end
  if @msvc_syntax
    path_flags = path_flags.collect do |flag|
      flag.gsub(/\A-L/, "/libpath:")
    end
    other_flags = other_flags.collect do |flag|
      if /\A-l/ =~ flag
        "#{$POSTMATCH}.lib"
      else
        flag
      end
    end
  end
  [path_flags, other_flags]
end