mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
7b4520374d
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
32 lines
1.1 KiB
Ruby
32 lines
1.1 KiB
Ruby
if $mingw or $mswin
|
|
dlntestlib = "dlntest.#{$LIBEXT}"
|
|
$LOCAL_LIBS << " #{dlntestlib}"
|
|
$srcs = ["dlntest.c"]
|
|
$objs = ["dlntest.o"]
|
|
testdll = "$(topdir)/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 << "$(topdir)/dlntest.dll: DEFFILE := $(srcdir)/libdlntest.def\n"
|
|
m << "$(topdir)/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
|