summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/extconf.rb
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-13 15:28:30 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-13 15:28:30 +0000
commit61e58f7dc480f9833b6b2e4c71d58e016536ce76 (patch)
treec1fe649f9a3885ffe7795b867f65a4f5aa5dcec5 /ext/bigdecimal/extconf.rb
parente712ad9cd79dcedf3eea4b888faeeae8462c0a2b (diff)
bigdecimal: version 1.3.3
Import bigdecimal version 1.3.3. The full commit log is here: https://github.com/ruby/bigdecimal/compare/v1.3.2...v1.3.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/extconf.rb')
-rw-r--r--ext/bigdecimal/extconf.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index dccf2d2d83..4bef91eafe 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -1,6 +1,22 @@
# 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
+ $stderr.puts "Unable to find bigdecimal.gemspec"
+ abort
+end
+
+bigdecimal_version =
+ IO.readlines(gemspec_path)
+ .grep(/\Abigdecimal_version\s+=\s+/)[0][/\'([\d\.]+)\'/, 1]
+
+$defs << %Q[-DRUBY_BIGDECIMAL_VERSION=\\"#{bigdecimal_version}\\"]
+
alias __have_macro__ have_macro
have_func("labs", "stdlib.h")