From bffd6395d6cd29e153bd16c81ffda9d9a055cb92 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 27 Jun 2014 15:35:15 +0000 Subject: [PATCH] mkconfig.rb: fix empty prefix * tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when configured --with-rubyarchprefix, remove prefix from rubyarchdir after expansion for the case it does not start with '$(prefix)'. [fix GH-643] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ tool/mkconfig.rb | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index aef850636d..21e4e849b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Jun 28 00:35:10 2014 Lauri Tirkkonen + + * tool/mkconfig.rb: fix empty RbConfig::CONFIG["prefix"] when + configured --with-rubyarchprefix, remove prefix from rubyarchdir + after expansion for the case it does not start with '$(prefix)'. + [fix GH-643] + Fri Jun 27 15:20:12 2014 SHIBATA Hiroshi * lib/rubygems/test_case.rb: rescue Gem::LoadError in Gem::TestCase. diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb index d108a51c00..79c97fa490 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb @@ -167,10 +167,10 @@ def vars.expand(val, config = self) val.replace(newval) unless newval == val val end -vars["prefix"] = "" -vars["exec_prefix"] = "" -prefix = vars.expand(vars["rubyarchdir"]) -print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n" +prefix = vars.expand(vars["prefix"]) +rubyarchdir = vars.expand(vars["rubyarchdir"]) +relative_archdir = rubyarchdir.rindex(prefix, 0) ? rubyarchdir[prefix.size..-1] : rubyarchdir +print " TOPDIR = File.dirname(__FILE__).chomp!(#{relative_archdir.dump})\n" print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" print <<'ARCH' if universal arch_flag = ENV['ARCHFLAGS'] || ((e = ENV['RC_ARCHS']) && e.split.uniq.map {|a| "-arch #{a}"}.join(' '))