なかだです。

ext/extmk.rb.inで-L$libdirが直接入ってますが、VCでは認識しない
ので警告が出ます。また、$libdirの$(exec_prefix)を展開してますが、
exec_prefix自体が$(prefix)だったりすると、xsystemでは結局意味が
ありません。


Index: mkconfig.rb =================================================================== RCS file: /cvs/ruby/src/ruby/mkconfig.rb,v retrieving revision 1.18 diff -u -2 -p -u -r1.18 mkconfig.rb --- mkconfig.rb 2001/11/13 08:19:52 1.18 +++ mkconfig.rb 2002/02/10 17:13:06 @@ -97,8 +97,7 @@ print <<EOS CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup} def Config::expand(val) - val.gsub!(/\\$\\(([^()]+)\\)/) do |var| - key = $1 - if CONFIG.key? key - Config::expand(CONFIG[key]) + val.gsub!(/\\$\\(([^()]+)\\)|\\$\\{([^{}]+)\\}/) do |var| + if key = CONFIG[$1 || $2] + Config::expand(key) else var Index: extmk.rb.in =================================================================== RCS file: /cvs/ruby/src/ruby/ext/extmk.rb.in,v retrieving revision 1.62 diff -u -2 -p -u -r1.62 extmk.rb.in --- extmk.rb.in 2002/01/25 08:22:09 1.62 +++ extmk.rb.in 2002/02/10 17:04:31 @@ -26,6 +26,6 @@ SRC_EXT = ["c", "cc", "m", "cxx", "cpp", $extlist = [] -$includedir = "@includedir@".gsub(/\$\{prefix\}|\$\(prefix\)/,'@prefix@') -$libdir = "@libdir@".gsub(/\$\{exec_prefix\}|\$\(exec_prefix\)/,'@exec_prefix@') +$includedir = "@includedir@" +$libdir = "@libdir@" $top_srcdir = "@top_srcdir@" @@ -37,6 +37,7 @@ end $topdir = File.expand_path("..") -$:.replace [$top_srcdir, $top_srcdir+"/lib", "."] +$:.replace [$topdir, $top_srcdir, $top_srcdir+"/lib", "."] +require 'rbconfig.rb' require 'find' @@ -65,8 +66,7 @@ def older(file1, file2) end +CFLAGS = "@CFLAGS@" if RUBY_PLATFORM == "m68k-human" - CFLAGS = "@CFLAGS@".gsub(/-c..-stack=[0-9]+ */, '') -else - CFLAGS = "@CFLAGS@" + CFLAGS.gsub!(/-c..-stack=[0-9]+ */, '') end if /mswin32/ =~ RUBY_PLATFORM @@ -75,5 +75,5 @@ else OUTFLAG = '-o ' end -LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir -L#$libdir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@" +LINK = "@CC@ #{OUTFLAG}conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@" CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c" @@ -104,11 +104,10 @@ def try_link0(src, opt="") ENV['LIB'] = ($LIBPATH + [ORIG_LIBPATH]).compact.join(';') else - $LDFLAGS = ldflags.dup - $LIBPATH.each {|d| $LDFLAGS << " -L" + d} + ldflags = ldflags.dup + $LIBPATH.each {|d| ldflags << " -L" + d} end begin - xsystem(format(LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS)) + xsystem(Config::expand(format(LINK, $CFLAGS, $CPPFLAGS, ldflags, opt, $LOCAL_LIBS))) ensure - $LDFLAGS = ldflags ENV['LIB'] = ORIG_LIBPATH if /mswin32/ =~ RUBY_PLATFORM end @@ -128,5 +127,5 @@ def try_cpp(src, opt="") cfile.close begin - xsystem(format(CPP, $CFLAGS, $CPPFLAGS, opt)) + xsystem(Config::expand(format(CPP, $CFLAGS, $CPPFLAGS, opt))) ensure rm_f "conftest*" @@ -139,5 +138,5 @@ def egrep_cpp(pat, src, opt="") cfile.close begin - xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, $CPPFLAGS, opt)) + xsystem(Config::expand(format(CPP, $CFLAGS, $CPPFLAGS, opt))+"|egrep #{pat}") ensure rm_f "conftest*" @@ -299,9 +298,6 @@ def arg_config(config, default=nil) for arg in args.split next unless /^--/ =~ arg - if /=/ =~ arg - $configure_args[$`] = $' - else - $configure_args[arg] = true - end + arg, val = arg.split('=', 2) + $configure_args[arg] = val || true end end @@ -630,5 +626,5 @@ def extmake(target) $CPPFLAGS = "" $LDFLAGS = "" - $LIBPATH = [] + $LIBPATH = [$libdir] dir_config("opt")
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦