From: nobu.nakada@... Date: 2002-01-24T15:35:02+09:00 Subject: [ruby-dev:15756] Re: Win32API enhancement なかだです。 At Thu, 24 Jan 2002 12:32:39 +0900, Takaaki Tateishi wrote: > > こんなのとか(謎)。動くかどうかどころか、コンパイルできるかどう > > かも保証の限りじゃありませんが。 > > なかださんのような凝った仕組みではないですが,Ruby/DLでは単純に > すべての型に対する関数を予め定義して,Rubyスクリプト中で,Procオ > ブジェクトと対応させるという安易な方法をとっています. > このため,簡単に実装できますし,ほとんどのマシン上で動きます. > > # そのうち,なかださんが提案したような方法は採りたいところです. まぁあれは半ば冗談ですが…。 ところでrough/ext/dlを久しぶりにコンパイルしてみたんですが、ソー スディレクトリ以外でコンパイルできなくなってます。 Index: depend =================================================================== RCS file: /cvs/ruby/src/rough/ext/dl/depend,v retrieving revision 1.16 diff -u -2 -p -u -r1.16 depend --- depend 2001/09/14 05:53:25 1.16 +++ depend 2002/01/24 06:14:33 @@ -1,2 +1,3 @@ +RUBY = $(RUBY_INSTALL_NAME)$(EXEEXT) CLEANFILES = DISTCLEANFILES = call.func callback.func cbtable.func dlconfig.rb dlconfig.h \ @@ -6,5 +7,5 @@ libtest.so: test/libtest.so test/libtest.so: test/test.o test/libtest.def - $(RUBY_INSTALL_NAME) -rftools -e 'ARGV.each{|d|File.mkpath(File.dirname(d))}' $@ + $(RUBY) -rftools -e 'ARGV.each{|d|File.mkpath(File.dirname(d))}' $@ `$(RUBY) -e 'print ARGV.join(" ").gsub("--def=dl.def","--def=test/libtest.def")' $(LDSHARED)` $(LDFLAGS) test/test.o -o test/libtest.so @@ -13,5 +14,5 @@ test/test.o: test/test.c test:: dl.so libtest.so - $(RUBY_INSTALL_NAME) -I. $(srcdir)/test/test.rb + $(RUBY) -I. $(srcdir)/test/test.rb allclean: distclean @@ -24,13 +25,13 @@ dl.o: callback.func cbtable.func call.func: mkcall.rb dlconfig.rb @echo "Generating call.func" - @$(RUBY_INSTALL_NAME) mkcall.rb > $@ + @$(RUBY) $< > $@ callback.func: mkcallback.rb dlconfig.rb @echo "Generating callback.func" - @$(RUBY_INSTALL_NAME) mkcallback.rb > $@ + @$(RUBY) $< > $@ cbtable.func: mkcbtable.rb dlconfig.rb @echo "Generating cbtable.func" - @$(RUBY_INSTALL_NAME) mkcbtable.rb > $@ + @$(RUBY) $< > $@ debug: Index: extconf.rb =================================================================== RCS file: /cvs/ruby/src/rough/ext/dl/extconf.rb,v retrieving revision 1.32 diff -u -2 -p -u -r1.32 extconf.rb --- extconf.rb 2001/12/03 01:12:37 1.32 +++ extconf.rb 2002/01/24 06:00:12 @@ -1,4 +1,5 @@ require 'mkmf' -require './type' +$:.unshift File.dirname(__FILE__) +require 'type' if( ARGV.include?("--help") ) Index: mkcall.rb =================================================================== RCS file: /cvs/ruby/src/rough/ext/dl/mkcall.rb,v retrieving revision 1.6 diff -u -2 -p -u -r1.6 mkcall.rb --- mkcall.rb 2001/08/12 15:01:45 1.6 +++ mkcall.rb 2002/01/24 06:05:41 @@ -2,6 +2,7 @@ require 'mkmf' -require './type' -require './dlconfig' +$:.unshift File.dirname(__FILE__) +require 'type' +require 'dlconfig' $int_eq_long = try_run(<