diff options
Diffstat (limited to 'ruby_1_8_6/bcc32/mkexports.rb')
-rwxr-xr-x | ruby_1_8_6/bcc32/mkexports.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ruby_1_8_6/bcc32/mkexports.rb b/ruby_1_8_6/bcc32/mkexports.rb new file mode 100755 index 0000000000..dc523e2541 --- /dev/null +++ b/ruby_1_8_6/bcc32/mkexports.rb @@ -0,0 +1,27 @@ +#!./miniruby -s + +$name = $library = $description = nil + +SYM = {} +STDIN.reopen(open("nul")) +ARGV.each do |obj| + IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l| + next unless /(?:PUBDEF|PUBD32)/ =~ l + SYM[$1] = true if /'(.*?)'/ =~ l + end +end + +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 |