summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/bigdecimal/extconf.rb30
-rw-r--r--ext/bigdecimal/util/extconf.rb30
2 files changed, 7 insertions, 53 deletions
diff --git a/ext/bigdecimal/extconf.rb b/ext/bigdecimal/extconf.rb
index a78e740aed..2ae5e1b720 100644
--- a/ext/bigdecimal/extconf.rb
+++ b/ext/bigdecimal/extconf.rb
@@ -1,10 +1,6 @@
# frozen_string_literal: false
require 'mkmf'
-def windows_platform?
- /cygwin|mingw|mswin/ === RUBY_PLATFORM
-end
-
gemspec_name = gemspec_path = nil
unless ['', '../../'].any? {|dir|
gemspec_name = "#{dir}bigdecimal.gemspec"
@@ -32,32 +28,6 @@ have_func("rb_rational_den", "ruby.h")
have_func("rb_array_const_ptr", "ruby.h")
have_func("rb_sym2str", "ruby.h")
-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?
- case RUBY_PLATFORM
- when /cygwin|mingw/
- $DLDFLAGS << " $(srcdir)/bigdecimal.def"
- $DLDFLAGS << " -Wl,--out-implib=$(TARGET_SO_DIR)#{import_library_name}"
- when /mswin/
- $DLDFLAGS << " /DEF:$(srcdir)/bigdecimal.def"
- end
- $cleanfiles << import_library_name
- true
- else
- false
- end
-end
-
create_makefile('bigdecimal') {|mf|
mf << "GEMSPEC = #{gemspec_name}\n"
}
diff --git a/ext/bigdecimal/util/extconf.rb b/ext/bigdecimal/util/extconf.rb
index 023b19ba7e..8750db1c52 100644
--- a/ext/bigdecimal/util/extconf.rb
+++ b/ext/bigdecimal/util/extconf.rb
@@ -1,36 +1,20 @@
# frozen_string_literal: false
require 'mkmf'
-def windows_platform?
- /cygwin|mingw|mswin/ === RUBY_PLATFORM
-end
-
-if windows_platform?
- library_base_name = "ruby-bigdecimal"
+checking_for(checking_message("Windows")) do
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}"
+ build_dir = File.join(base_dir, "tmp", RUBY_PLATFORM, "bigdecimal", RUBY_VERSION, "")
end
+ $libs << " #{build_dir}bigdecimal.so"
+ true
+ when /mswin/
+ $DLDFLAGS << " -libpath:.."
+ $libs << " bigdecimal-$(arch).lib"
true
else
false