~ubuntu-branches/ubuntu/hardy/ruby1.8/hardy-updates

« back to all changes in this revision

Viewing changes to win32/mkexports.rb

  • Committer: Bazaar Package Importer
  • Author(s): akira yamada
  • Date: 2007-03-13 22:11:58 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070313221158-h3oql37brlaf2go2
Tags: 1.8.6-1
* new upstream version, 1.8.6.
* libruby1.8 conflicts with libopenssl-ruby1.8 (< 1.8.6) (closes: #410018)
* changed packaging style to cdbs from dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!./miniruby -s
 
2
 
 
3
$name = $library = $description = nil
 
4
 
 
5
SYM = {}
 
6
 
 
7
objs = ARGV.collect {|s| s.tr('/', '\\')}
 
8
IO.foreach("|dumpbin -symbols " + objs.join(' ')) do |l|
 
9
  next if /^[0-9A-F]+ 0+ UNDEF / =~ l
 
10
  next unless l.sub!(/.*\sExternal\s+\|\s+/, '')
 
11
  if l.sub!(/^_/, '')
 
12
    next if /@.*@/ =~ l || /@[0-9a-f]{16}$/ =~ l
 
13
  elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1')
 
14
    next
 
15
  end
 
16
  SYM[l.strip] = true
 
17
end
 
18
 
 
19
exports = []
 
20
if $name
 
21
  exports << "Name " + $name
 
22
elsif $library
 
23
  exports << "Library " + $library
 
24
end
 
25
exports << "Description " + $description.dump if $description
 
26
exports << "EXPORTS" << SYM.keys.sort
 
27
 
 
28
if $output
 
29
  open($output, 'w') {|f| f.puts exports.join("\n")}
 
30
else
 
31
  puts exports.join("\n")
 
32
end