1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/bigdecimal/util/extconf.rb
mrkn a0e438cd3c Import bigdecimal-1.4.0.pre-20181130a
* https://github.com/ruby/bigdecimal/compare/74d25ef..v1.4.0.pre.20181130a

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:54 +00:00

40 lines
972 B
Ruby

# frozen_string_literal: false
require 'mkmf'
def windows_platform?
/cygwin|mingw|mswin/ === RUBY_PLATFORM
end
if windows_platform?
library_base_name = "ruby-bigdecimal"
case RUBY_PLATFORM
when /cygwin|mingw/
import_library_name = "libruby-bigdecimal.a"
when /mswin/
import_library_name = "bigdecimal-$(arch).lib"
end
end
checking_for(checking_message("Windows")) do
if windows_platform?
if defined?($extlist)
build_dir = "$(TARGET_SO_DIR)../"
else
base_dir = File.expand_path('../../../..', __FILE__)
build_dir = File.join(base_dir, "tmp", RUBY_PLATFORM, "bigdecimal", RUBY_VERSION)
end
case RUBY_PLATFORM
when /cygwin|mingw/
$LDFLAGS << " -L#{build_dir} -L.. -L .."
$libs << " -l#{library_base_name}"
when /mswin/
$DLDFLAGS << " /libpath:#{build_dir} /libpath:.."
$libs << " #{import_library_name}"
end
true
else
false
end
end
create_makefile('bigdecimal/util')