From 8d8d36c15cb2d113a9ff50ba6c3ea0bfabb86eb8 Mon Sep 17 00:00:00 2001 From: yugui Date: Thu, 1 Jan 2009 13:30:25 +0000 Subject: [PATCH] * spec/default.mspec: fix for builddir != srcdir * Makefile.in: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ Makefile.in | 2 +- spec/default.mspec | 11 +++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2585b84d1..44137eb3de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jan 1 22:27:55 2009 Yuki Sonoda (Yugui) + + * spec/default.mspec: fix for builddir != srcdir + + * Makefile.in: ditto. + Thu Jan 1 21:26:05 2009 Tanaka Akira * ext/socket/socket.c (sock_s_getnameinfo): use family_to_int. diff --git a/Makefile.in b/Makefile.in index 4c3651ff45..8b9a12af56 100644 --- a/Makefile.in +++ b/Makefile.in @@ -268,4 +268,4 @@ update-rubyspec: test-rubyspec: @if [ ! -d $(srcdir)/spec/rubyspec ]; then echo No rubyspec here. make update-rubyspec first.; exit 1; fi - $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec $(MSPECOPT) + $(RUNRUBY) $(srcdir)/spec/mspec/bin/mspec -B $(srcdir)/spec/default.mspec $(MSPECOPT) diff --git a/spec/default.mspec b/spec/default.mspec index b94807d6d5..50cc6b0920 100644 --- a/spec/default.mspec +++ b/spec/default.mspec @@ -1,14 +1,17 @@ load File.dirname(__FILE__) + '/rubyspec/ruby.1.9.mspec' class MSpecScript - builddir = File.expand_path(File.join(File.dirname(__FILE__), '..')) + builddir = Dir.pwd srcdir = ENV['SRCDIR'] - srcdir ||= $1 if File.read("#{builddir}/Makefile")[/^\s*srcdir\s*=\s*(.+)/i] - srcdir ||= builddir + if !srcdir and File.exist?("#{builddir}/Makefile") then + File.open("#{builddir}/Makefile", "r:US-ASCII") {|f| + f.read[/^\s*srcdir\s*=\s*(.+)/i] and srcdir = $1 + } + end config = proc{|name| `#{builddir}/miniruby -I#{srcdir} -rrbconfig -e 'print Config::CONFIG["#{name}"]'`} # The default implementation to run the specs. set :target, File.join(builddir, "miniruby#{config['exeext']}") - set :prefix, 'spec/rubyspec' + set :prefix, File.expand_path('rubyspec', File.dirname(__FILE__)) set :flags, %W[ -I#{srcdir}/lib -I#{srcdir}/#{config['EXTOUT']}/common