From: nobu.nakada@... Date: 2001-03-21T23:11:27+09:00 Subject: [ruby-dev:12598] Re: require 'win32api' なかだです。 At Tue, 20 Mar 2001 13:58:58 +0900, Nobuyoshi-Nakada wrote: > それと、Win32API.c には Init_Win32API() と Init_win32api() の > 両方のエントリポイントがあるのに、片方しか export されてないと > いうのが問題じゃないかという気もします。 という風にしてみました。とりあえず両方見えてはいますが、これ で果たして本当に解決する問題かどうかはちょっと疑問。 Index: ext/extmk.rb.in =================================================================== RCS file: /home/cvs/ruby/src/ruby/ext/extmk.rb.in,v retrieving revision 1.38 diff -u -2 -p -r1.38 extmk.rb.in --- ext/extmk.rb.in 2001/02/26 05:29:02 1.38 +++ ext/extmk.rb.in 2001/03/21 09:35:25 @@ -357,4 +357,9 @@ end def create_makefile(target) + if Array === target + target, = (entries = target) + else + entries = [target] + end $target = target if target.rindex(%r!/!) @@ -380,10 +385,16 @@ def create_makefile(target) end - defflag = '' - if RUBY_PLATFORM =~ /cygwin|mingw/ and not $static - open(target + '.def', 'wb') do |f| - f.print "EXPORTS\n", "Init_", target, "\n" + exports = defflag = '' + unless $static + case RUBY_PLATFORM + when /cygwin|mingw/ + open(target + '.def', 'wb') do |f| + f.puts "EXPORTS" + entries.each {|t| f.puts "Init_#{t}"} + end + defflag = "--def=" + target + ".def" + when /mswin/ + exports = ([""] + entries).join(" /EXPORT:") end - defflag = "--def=" + target + ".def" end @@ -435,5 +446,5 @@ archdir = $(pkglibdir)/@arch@ " - mfile.printf "LOCAL_LIBS = %s %s\n", $LOCAL_LIBS, $local_flags + mfile.printf "LOCAL_LIBS = %s %s%s\n", $LOCAL_LIBS, $local_flags, exports mfile.printf "LIBS = %s\n", $libs mfile.printf "OBJS = " @@ -584,5 +595,5 @@ def extmake(target) if /mswin32/ =~ RUBY_PLATFORM $LIBEXT = "lib" - $local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)" + $local_flags = "-link /INCREMENTAL:no" end $LOCAL_LIBS = "" # to be assigned in extconf.rb Index: lib/mkmf.rb =================================================================== RCS file: /home/cvs/ruby/src/ruby/lib/mkmf.rb,v retrieving revision 1.44 diff -u -2 -p -r1.44 mkmf.rb --- lib/mkmf.rb 2001/03/13 05:45:11 1.44 +++ lib/mkmf.rb 2001/03/21 09:49:05 @@ -360,4 +360,9 @@ def create_makefile(target, srcdir = Fil rm_f "conftest*" STDOUT.flush + if Array === target + target, = (entries = target) + else + entries = [target] + end if target.rindex(%r!/!) #/ target = $' @@ -379,10 +384,16 @@ def create_makefile(target, srcdir = Fil $LIBPATH |= [CONFIG["libdir"]] - defflag = '' - if RUBY_PLATFORM =~ /cygwin|mingw/ - open(target + '.def', 'wb') do |f| - f.print "EXPORTS\n", "Init_", target, "\n" + exports = defflag = '' + unless $static + case RUBY_PLATFORM + when /cygwin|mingw/ + open(target + '.def', 'wb') do |f| + f.puts "EXPORTS" + entries.each {|t| f.puts "Init_#{t}"} + end + defflag = "--def=" + target + ".def" + when /mswin/ + exports = ([""] + entries).join(" /EXPORT:") end - defflag = "--def=" + target + ".def" end @@ -447,5 +458,5 @@ sitearchdir = $(DESTDIR)#{$sitearchdir.s #### End of system configuration section. #### -LOCAL_LIBS = #{$LOCAL_LIBS} #{$local_flags} +LOCAL_LIBS = #{$LOCAL_LIBS} #{$local_flags}#{exports} LIBS = #{$libs} OBJS = #{$objs} @@ -553,5 +564,5 @@ $local_flags = "" case RUBY_PLATFORM when /mswin32/ - $local_flags = "-link /INCREMENTAL:no /EXPORT:Init_$(TARGET)" + $local_flags = "-link /INCREMENTAL:no" end $LOCAL_LIBS = "" Index: ext/Win32API/extconf.rb =================================================================== RCS file: /home/cvs/ruby/src/ruby/ext/Win32API/extconf.rb,v retrieving revision 1.3 diff -u -2 -p -r1.3 extconf.rb --- ext/Win32API/extconf.rb 2000/05/13 16:12:19 1.3 +++ ext/Win32API/extconf.rb 2001/03/19 07:52:16 @@ -2,6 +2,6 @@ case RUBY_PLATFORM when /cygwin/,/mingw/ $CFLAGS = "-fno-defer-pop" - create_makefile("Win32API") + create_makefile(["Win32API", "win32api"]) when /win32/ - create_makefile("Win32API") + create_makefile(["Win32API", "win32api"]) end -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦