From 30887efb8a658842991fd9c8077e024962860165 Mon Sep 17 00:00:00 2001 From: yugui Date: Fri, 31 Oct 2008 03:31:09 +0000 Subject: [PATCH] * spec/default.mspec: supports that the build directory != srcdir. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ spec/default.mspec | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) 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