summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/extconf.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-02-19 18:45:06 +0900
committergit <svn-admin@ruby-lang.org>2023-02-21 09:50:02 +0000
commitd13879f862a98e718ba7ec40e8d43137efb97a8b (patch)
tree02945baaa60afc3a5fb8fb90fcb8d9c2065bb0c4 /ext/bigdecimal/extconf.rb
parentcb40432c74b9c5f785e8be53cbda981a64d47c72 (diff)
downloadruby-d13879f862a98e718ba7ec40e8d43137efb97a8b.tar.gz
[ruby/bigdecimal] Read version from bigdecimal.c
The dependency of extconf.h on bigdecimal.gemspec does not make sense as far as no rule is defined for it. Also, the relationship between extension library and gemspec file is various in default gems, and does not work well. https://github.com/ruby/bigdecimal/commit/7f99b28552
Diffstat (limited to 'ext/bigdecimal/extconf.rb')
-rw-r--r--ext/bigdecimal/extconf.rb25
1 files changed, 0 insertions, 25 deletions
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index 17e7905dd6..23904ed60e 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -1,18 +1,6 @@
# frozen_string_literal: false
require 'mkmf'
-def check_bigdecimal_version(gemspec_path)
- message "checking RUBY_BIGDECIMAL_VERSION... "
- bigdecimal_version = File.read(gemspec_path).match(/^\s*s\.version\s+=\s+['"]([^'"]+)['"]\s*$/)[1]
-
- version_components = bigdecimal_version.split('.')
- bigdecimal_version = version_components[0, 3].join('.')
- bigdecimal_version << "-#{version_components[3]}" if version_components[3]
- $defs << %Q[-DRUBY_BIGDECIMAL_VERSION=\\"#{bigdecimal_version}\\"]
-
- message "#{bigdecimal_version}\n"
-end
-
def have_builtin_func(name, check_expr, opt = "", &b)
checking_for checking_message(name.funcall_style, nil, opt) do
if try_compile(<<SRC, opt, &b)
@@ -27,18 +15,6 @@ SRC
end
end
-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
-
-check_bigdecimal_version(gemspec_path)
-
have_builtin_func("__builtin_clz", "__builtin_clz(0)")
have_builtin_func("__builtin_clzl", "__builtin_clzl(0)")
have_builtin_func("__builtin_clzll", "__builtin_clzll(0)")
@@ -82,6 +58,5 @@ else
end
create_makefile('bigdecimal') {|mf|
- mf << "GEMSPEC = #{gemspec_name}\n"
mf << "BIGDECIMAL_RB = #{bigdecimal_rb}\n"
}