summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/util
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-04 11:16:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-04 11:16:15 +0000
commit49efa01579272d52d28bd361c498d96ca92e986e (patch)
treea969043d5e1ccd2eb7beb1e532ade327214187b4 /ext/bigdecimal/util
parentbfb64d476578eadd61a738149726da37840f068d (diff)
Remove unnecessary linker flags
Cygwin/mingw linker should be able to link against shared library itself. Mswin build sets -def:$(DEFFILE) option by the default. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/util')
-rw-r--r--ext/bigdecimal/util/extconf.rb30
1 files changed, 7 insertions, 23 deletions
diff --git a/ext/bigdecimal/util/extconf.rb b/ext/bigdecimal/util/extconf.rb
index 023b19ba7ea..8750db1c52c 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