From: nobu@... Date: 2004-08-19T01:21:02+09:00 Subject: [ruby-dev:24118] tcltk stubs なかだです。 --with-tcltk_stubsを指定しても、-ltclstub -ltkstubではなく-ltcl -ltkのままになっているため、lib{tcl,tk}X.Y.soがリンクされていま す。また、stubを使う場合はコンパイル時のpthread_checkは無意味で はないかと思うのですが。 ついでに、tcktk-stubsじゃなくてtcltk_stubsというのも違和感があ るので、-と_を同一視するようにしてみました。 Index: ext/tcltklib/extconf.rb =================================================================== RCS file: /cvs/ruby/src/ruby/ext/tcltklib/extconf.rb,v retrieving revision 1.19 diff -U2 -p -d -r1.19 extconf.rb --- ext/tcltklib/extconf.rb 1 Jul 2004 09:38:05 -0000 1.19 +++ ext/tcltklib/extconf.rb 18 Aug 2004 14:53:32 -0000 @@ -29,8 +29,14 @@ stubs = enable_config("tcltk_stubs") || def find_tcl(tcllib, stubs) paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"] - func = stubs ? "Tcl_InitStubs" : "Tcl_FindExecutable" + if stubs + func = "Tcl_InitStubs" + lib = "tclstub" + else + func = "Tcl_FindExecutable" + lib = "tcl" + end if tcllib find_library(tcllib, func, *paths) - elsif find_library("tcl", func, *paths) + elsif find_library(lib, func, *paths) true else @@ -44,8 +50,14 @@ end def find_tk(tklib, stubs) paths = ["/usr/local/lib", "/usr/pkg/lib", "/usr/lib"] - func = stubs ? "Tk_InitStubs" : "Tk_Init" + if stubs + func = "Tk_InitStubs" + lib = "tkstub" + else + func = "Tk_Init" + lib = "tk" + end if tklib find_library(tklib, func, *paths) - elsif find_library("tk", func, *paths) + elsif find_library(lib, func, *paths) true else @@ -231,4 +243,4 @@ if mac_need_framework || end - create_makefile("tcltklib") if pthread_check + create_makefile("tcltklib") if stubs or pthread_check end Index: lib/mkmf.rb =================================================================== RCS file: /cvs/ruby/src/ruby/lib/mkmf.rb,v retrieving revision 1.194 diff -U2 -p -d -r1.194 mkmf.rb --- lib/mkmf.rb 13 Jul 2004 06:51:26 -0000 1.194 +++ lib/mkmf.rb 18 Aug 2004 16:14:31 -0000 @@ -21,4 +21,5 @@ unless defined? $configure_args arg, val = arg.split('=', 2) next unless arg + arg.tr!('_', '-') if arg.sub!(/^(?!--)/, '--') val or next @@ -31,4 +32,5 @@ unless defined? $configure_args arg, val = arg.split('=', 2) next unless arg + arg.tr!('_', '-') if arg.sub!(/^(?!--)/, '--') val or next @@ -624,9 +626,9 @@ end def arg_config(config, default=nil) - $configure_args.fetch(config, default) + $configure_args.fetch(config.tr('_', '-'), default) end def with_config(config, default=nil) - unless /^--with-/ =~ config + unless /^--with[-_]/ =~ config config = '--with-' + config end -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦