summaryrefslogtreecommitdiff
path: root/trunk/bcc32/mkexports.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:02:05 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-25 15:02:05 +0000
commit0dc342de848a642ecce8db697b8fecd83a63e117 (patch)
tree2b7ed4724aff1f86073e4740134bda9c4aac1a39 /trunk/bcc32/mkexports.rb
parentef70cf7138ab8034b5b806f466e4b484b24f0f88 (diff)
added tag v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18845 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/bcc32/mkexports.rb')
-rwxr-xr-xtrunk/bcc32/mkexports.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/trunk/bcc32/mkexports.rb b/trunk/bcc32/mkexports.rb
new file mode 100755
index 0000000000..888ab2e2a6
--- /dev/null
+++ b/trunk/bcc32/mkexports.rb
@@ -0,0 +1,26 @@
+#!./miniruby -s
+
+$:.unshift(File.expand_path("../..", __FILE__))
+require 'win32/mkexports'
+
+class Exports::Bcc < Exports
+ def forwarding(internal, export)
+ internal[/\A_?/]+export
+ end
+
+ def each_line(objs, &block)
+ objs.each do |obj|
+ opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
+ IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul", &block)
+ end
+ end
+
+ def each_export(objs)
+ objdump(objs) do |l|
+ next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
+ yield $1 if /'(.*?)'/ =~ l
+ end
+ yield "_strcasecmp", "_stricmp"
+ yield "_strncasecmp", "_strnicmp"
+ end
+end