mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
d0b3651906
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
26 lines
538 B
Ruby
26 lines
538 B
Ruby
#!./miniruby -s
|
|
|
|
SYM = {}
|
|
objs = ARGV.collect {|s| s.tr('/', '\\')}
|
|
system("tdump -oiPUBDEF -oiPUBD32 #{objs.join(' ')} > pub.def")
|
|
|
|
IO.foreach('pub.def'){|l|
|
|
next unless /(PUBDEF|PUBD32)/ =~ l
|
|
/'(.*?)'/ =~ l
|
|
SYM[$1] = true
|
|
}
|
|
|
|
exports = []
|
|
if $name
|
|
exports << "Name " + $name
|
|
elsif $library
|
|
exports << "Library " + $library
|
|
end
|
|
exports << "Description " + $description.dump if $description
|
|
exports << "EXPORTS" << SYM.keys.sort
|
|
|
|
if $output
|
|
open($output, 'w') {|f| f.puts exports.join("\n")}
|
|
else
|
|
puts exports.join("\n")
|
|
end
|