diff --git a/ChangeLog b/ChangeLog index be85a65f60..a02c4238fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Fri Oct 31 12:27:52 2008 Yuki Sonoda (Yugui) + + * spec/default.mspec: supports that the build directory != srcdir. + Fri Oct 31 11:35:38 2008 Nobuyoshi Nakada * encoding.c (rb_enc_set_default_internal): no alias "internal" if diff --git a/spec/default.mspec b/spec/default.mspec index e4b9dae523..a018b4020c 100644 --- a/spec/default.mspec +++ b/spec/default.mspec @@ -7,11 +7,14 @@ class MSpecScript spec/rubyspec/1.9/library ] - srcdir = File.expand_path(File.join(File.dirname(__FILE__), '..')) - config = proc{|name| `#{srcdir}/miniruby -I#{srcdir} -rrbconfig -e 'print Config::CONFIG["#{name}"]'`} + builddir = File.expand_path(File.join(File.dirname(__FILE__), '..')) + srcdir = ENV['SRCDIR'] + srcdir ||= $1 if File.read("#{builddir}/Makefile")[/^\s*srcdir\s*=\s*(.+)/i] + srcdir ||= builddir + config = proc{|name| `#{builddir}/miniruby -I#{srcdir} -rrbconfig -e 'print Config::CONFIG["#{name}"]'`} # The default implementation to run the specs. - set :target, File.join(srcdir, "miniruby#{config['exeext']}") + set :target, File.join(builddir, "miniruby#{config['exeext']}") set :flags, %W[ -I#{srcdir}/lib -I#{srcdir}/#{config['EXTOUT']}/common