ruby-changes:53976
From: nobu <ko1@a...>
Date: Tue, 4 Dec 2018 20:16:21 +0900 (JST)
Subject: [ruby-changes:53976] nobu:r66196 (trunk): Remove unnecessary linker flags
nobu 2018-12-04 20:16:15 +0900 (Tue, 04 Dec 2018) New Revision: 66196 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66196 Log: 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. Modified files: trunk/ext/bigdecimal/extconf.rb trunk/ext/bigdecimal/util/extconf.rb Index: ext/bigdecimal/extconf.rb =================================================================== --- ext/bigdecimal/extconf.rb (revision 66195) +++ ext/bigdecimal/extconf.rb (revision 66196) @@ -1,10 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/extconf.rb#L1 # 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") https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/extconf.rb#L28 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" } Index: ext/bigdecimal/util/extconf.rb =================================================================== --- ext/bigdecimal/util/extconf.rb (revision 66195) +++ ext/bigdecimal/util/extconf.rb (revision 66196) @@ -1,36 +1,20 @@ https://github.com/ruby/ruby/blob/trunk/ext/bigdecimal/util/extconf.rb#L1 # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/