diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rwxr-xr-x | ext/extmk.rb | 18 | ||||
-rwxr-xr-x | tool/rbinstall.rb | 1 |
3 files changed, 24 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Wed Aug 31 17:39:19 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/extmk.rb (create_makefile): make gem.build_complete file + under TARGET_SO_DIR and install it only when the gem build + succeeded. [ruby-core:77057] [Bug #12681] + Wed Aug 31 15:36:10 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> * ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb. diff --git a/ext/extmk.rb b/ext/extmk.rb index 1b86ff0d71..97533219ee 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -568,6 +568,24 @@ Dir.chdir('..') FileUtils::makedirs('gems') Dir.chdir('gems') extout = $extout +unless gems.empty? + def self.create_makefile(*args, &block) + if super(*args, &block) + open("Makefile", "a") do |mf| + mf << %{ + +build_complete = $(TARGET_SO_DIR)gem.build_complete +install-so: build_complete +build_complete: $(build_complete) +$(build_complete): $(TARGET_SO) + $(Q) $(TOUCH) $@ + +} + end + true + end + end +end gems.each do |d| $extout = extout.dup $sodir = "$(extout)/gems/$(arch)/#{d[%r{\A[^/]+}]}" diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 83e5c7e020..5cab72fd2b 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -766,7 +766,6 @@ install?(:ext, :comm, :gem) do File.chmod($data_mode, File.join(install_dir, "specifications", "#{spec.full_name}.gemspec")) unless spec.extensions.empty? install_recursive(ext, spec.extension_dir) - open_for_install(spec.gem_build_complete_path, $data_mode) {""} end installed_gems[spec.full_name] = true end |