mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
bfb64d4765
commit
49efa01579
2 changed files with 7 additions and 53 deletions
|
@ -1,10 +1,6 @@
|
||||||
# frozen_string_literal: false
|
# frozen_string_literal: false
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
def windows_platform?
|
|
||||||
/cygwin|mingw|mswin/ === RUBY_PLATFORM
|
|
||||||
end
|
|
||||||
|
|
||||||
gemspec_name = gemspec_path = nil
|
gemspec_name = gemspec_path = nil
|
||||||
unless ['', '../../'].any? {|dir|
|
unless ['', '../../'].any? {|dir|
|
||||||
gemspec_name = "#{dir}bigdecimal.gemspec"
|
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_array_const_ptr", "ruby.h")
|
||||||
have_func("rb_sym2str", "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|
|
create_makefile('bigdecimal') {|mf|
|
||||||
mf << "GEMSPEC = #{gemspec_name}\n"
|
mf << "GEMSPEC = #{gemspec_name}\n"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +1,20 @@
|
||||||
# frozen_string_literal: false
|
# frozen_string_literal: false
|
||||||
require 'mkmf'
|
require 'mkmf'
|
||||||
|
|
||||||
def windows_platform?
|
checking_for(checking_message("Windows")) do
|
||||||
/cygwin|mingw|mswin/ === RUBY_PLATFORM
|
|
||||||
end
|
|
||||||
|
|
||||||
if windows_platform?
|
|
||||||
library_base_name = "ruby-bigdecimal"
|
|
||||||
case RUBY_PLATFORM
|
case RUBY_PLATFORM
|
||||||
when /cygwin|mingw/
|
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)
|
if defined?($extlist)
|
||||||
build_dir = "$(TARGET_SO_DIR)../"
|
build_dir = "$(TARGET_SO_DIR)../"
|
||||||
else
|
else
|
||||||
base_dir = File.expand_path('../../../..', __FILE__)
|
base_dir = File.expand_path('../../../..', __FILE__)
|
||||||
build_dir = File.join(base_dir, "tmp", RUBY_PLATFORM, "bigdecimal", RUBY_VERSION)
|
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
|
end
|
||||||
|
$libs << " #{build_dir}bigdecimal.so"
|
||||||
|
true
|
||||||
|
when /mswin/
|
||||||
|
$DLDFLAGS << " -libpath:.."
|
||||||
|
$libs << " bigdecimal-$(arch).lib"
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
false
|
false
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue