1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/-test-/win32/dln/extconf.rb
nobu 958c04898c dlntest.dll: move
* ext/-test-/win32/dln/{depend,extconf.rb} (dlntest.dll): make
  under the extension directory, instead of the top directory.

* test/-ext-/win32/test_dln.rb (test_check_imported): explicit
  PATH environment variable to load the DLL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-22 06:35:27 +00:00

33 lines
1.1 KiB
Ruby

# frozen_string_literal: false
if $mingw or $mswin
dlntestlib = "dlntest.#{$LIBEXT}"
$LOCAL_LIBS << " #{dlntestlib}"
$srcs = ["dlntest.c"]
$objs = ["dlntest.o"]
testdll = "dlntest.dll"
$cleanfiles << testdll
$cleanfiles << "dlntest.#{$LIBEXT}"
config_string('cleanobjs') {|t| $cleanfiles.concat(t.gsub(/\$\*/, 'dlntest').split)}
create_makefile("-test-/win32/dln") do |m|
m << "\n""DLNTESTLIB = #{dlntestlib}\n"
if $mingw
m << "\n"
m << "dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def\n"
m << "dlntest.dll: DLDFLAGS += -Wl,--out-implib,$(DLNTESTLIB)\n"
end
m
end
m = File.read("Makefile")
m.sub!(/(.*)\$\(DLNTEST_LDSHARED\)$/) do
pre = $1
link_so = LINK_SO.gsub(/^/) {pre}
link_so.sub!(/\$\(LOCAL_LIBS\)/, '')
link_so.gsub!(/-\$\(arch\)/, '')
link_so.gsub!(/:.so=/, ':.dll=')
link_so.sub!(/\$\(OBJS\)/, "libdlntest.#{$OBJEXT}")
link_so.sub!(/\$\(DEFFILE\)/, "$(srcdir)/libdlntest.def")
link_so
end and File.binwrite("Makefile", m)
FileUtils.rm_f(RbConfig.expand(testdll.dup))
end