summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-17 14:22:43 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-17 14:22:43 +0000
commit8ff247aee71e590e05b0c85a352b0af66aa97578 (patch)
treeed22fc51c9598d8c80b9af75f7fc71fd00660af7 /lib
parentbbe800082102cebcc696cb76e528c03e8b146538 (diff)
merge revision(s) 39560,39562,39572: [Backport #7991]
* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.hack_for_obsolete_sytle_gems): remove circular dependencies for old style gems which locate extconf.rb on the toplevel. [ruby-core:53059] [ruby-trunk - Bug #7698] (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove * lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.hack_for_obsolete_style_gems): remove circular dependencies in install-so too. [ruby-core:52882] [Bug #7698] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rubygems/ext/ext_conf_builder.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/rubygems/ext/ext_conf_builder.rb b/lib/rubygems/ext/ext_conf_builder.rb
index e11a1cdfbc..7babf409a0 100644
--- a/lib/rubygems/ext/ext_conf_builder.rb
+++ b/lib/rubygems/ext/ext_conf_builder.rb
@@ -11,6 +11,21 @@ require 'tempfile'
class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
+ def self.hack_for_obsolete_style_gems(directory)
+ return unless directory and File.identical?(directory, ".")
+ mf = Gem.read_binary 'Makefile'
+ changed = false
+ changed |= mf.gsub!(/^(install-rb-default:)(.*)/) {
+ "#$1#{$2.gsub(/(?:^|\s+)\$\(RUBY(?:ARCH|LIB)DIR\)\/\S+(?=\s|$)/, '')}"
+ }
+ changed |= mf.gsub!(/^(install-so:.*DLLIB.*\n)((?:\t.*\n)+)/) {
+ "#$1#{$2.gsub(/.*INSTALL.*DLLIB.*\n/, '')}"
+ }
+ if changed
+ File.open('Makefile', 'wb') {|f| f.print mf}
+ end
+ end
+
def self.build(extension, directory, dest_path, results, args=[])
siteconf = Tempfile.open(%w"siteconf .rb", ".") do |f|
f.puts "require 'rbconfig'"
@@ -28,6 +43,8 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
run cmd, results
+ hack_for_obsolete_style_gems directory
+
make dest_path, results
results