summaryrefslogtreecommitdiffstats
path: root/bcc32/mkexports.rb
diff options
context:
space:
mode:
authorH_Konishi <H_Konishi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-11 01:27:48 +0000
committerH_Konishi <H_Konishi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-11 01:27:48 +0000
commit0be64493584295d37016c15f821f6219e3d2568a (patch)
tree9d8c8beee149c50f44406ee8cd6dee4c3913c28f /bcc32/mkexports.rb
parent8f0b05258437cc12e4fb48171a638f4e98e74f10 (diff)
downloadruby-0be64493584295d37016c15f821f6219e3d2568a.tar.gz
ruby-0be64493584295d37016c15f821f6219e3d2568a.tar.xz
ruby-0be64493584295d37016c15f821f6219e3d2568a.zip
new platform [bccwin32] merged.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bcc32/mkexports.rb')
-rw-r--r--bcc32/mkexports.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
new file mode 100644
index 000000000..46edf190e
--- /dev/null
+++ b/bcc32/mkexports.rb
@@ -0,0 +1,26 @@
+#!./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