[前][次][番号順一覧][スレッド一覧]

ruby-changes:49106

From: nobu <ko1@a...>
Date: Thu, 14 Dec 2017 13:40:20 +0900 (JST)
Subject: [ruby-changes:49106] nobu:r61221 (trunk): bigdecimal: dependency

nobu	2017-12-14 13:40:15 +0900 (Thu, 14 Dec 2017)

  New Revision: 61221

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61221

  Log:
    bigdecimal: dependency
    
    * ext/bigdecimal/extconf.rb: extconf.h depends on the gemspec
      file.  [ruby-core:84247] [Bug #14180]

  Modified files:
    trunk/ext/bigdecimal/extconf.rb
Index: ext/bigdecimal/extconf.rb
===================================================================
--- ext/bigdecimal/extconf.rb	(revision 61220)
+++ ext/bigdecimal/extconf.rb	(revision 61221)
@@ -1,12 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/extconf.rb#L1
 # frozen_string_literal: false
 require 'mkmf'
 
-case
-when File.file?(File.expand_path('../bigdecimal.gemspec', __FILE__))
-  gemspec_path = File.expand_path('../bigdecimal.gemspec', __FILE__)
-when File.file?(File.expand_path('../../../bigdecimal.gemspec', __FILE__))
-  gemspec_path = File.expand_path('../../../bigdecimal.gemspec', __FILE__)
-else
+gemspec_name = gemspec_path = nil
+unless ['', '../../'].any? {|dir|
+         gemspec_name = "#{dir}bigdecimal.gemspec"
+         gemspec_path = File.expand_path("../#{gemspec_name}", __FILE__)
+         File.file?(gemspec_path)
+       }
   $stderr.puts "Unable to find bigdecimal.gemspec"
   abort
 end
@@ -30,4 +30,6 @@ have_func("rb_rational_den", "ruby.h") https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/extconf.rb#L30
 have_func("rb_array_const_ptr", "ruby.h")
 have_func("rb_sym2str", "ruby.h")
 
-create_makefile('bigdecimal')
+create_makefile('bigdecimal') {|mf|
+  mf << "\nall:\n\nextconf.h: $(srcdir)/#{gemspec_name}\n"
+}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]