ext/zlib/extconf.rb in zlib-2.0.0 vs ext/zlib/extconf.rb in zlib-2.1.0
- old
+ new
@@ -8,15 +8,16 @@
require 'mkmf'
require 'rbconfig'
dir_config 'zlib'
-
+libs = $libs
if %w'z libz zlib1 zlib zdll zlibwapi'.find {|z| have_library(z, 'deflateReset')} and
have_header('zlib.h') then
have_zlib = true
else
+ $libs = libs
unless File.directory?(zsrc = "#{$srcdir}/zlib")
dirs = Dir.open($srcdir) {|z| z.grep(/\Azlib-\d+[.\d]*\z/) {|x|"#{$srcdir}/#{x}"}}
dirs.delete_if {|x| !File.directory?(x)}
zsrc = dirs.max_by {|x| x.scan(/\d+/).map(&:to_i)}
end
@@ -44,11 +45,11 @@
zmk << CONFIG['CC'][/(.*-)gcc([^\/]*)\z/, 1]
zmk << " CC=$(CC)" if $2
end
m = File.read(m)
zimplib = m[/^IMPLIB[ \t]*=[ \t]*(\S+)/, 1]
- $LOCAL_LIBS << " " << zimplib
+ ($LOCAL_LIBS << " ./" << zimplib).strip!
unless $nmake or /^TOP[ \t]/ =~ m
m.gsub!(/win32\/zlib\.def/, '$(TOP)/\&')
m.gsub!(/^(\t.*[ \t])(\S+\.rc)/, '\1-I$(<D) $<')
m = "TOP = .\n""VPATH=$(TOP)\n" + m
zmkfile = File.basename(zmkfile)
@@ -60,10 +61,10 @@
"ZIMPLIB = #{zimplib}\n",
"ZOPTS = #{zopts.join(' ')}\n",
"$(TARGET_SO): $(ZIMPLIB)\n",
"$(ZIMPLIB):\n",
"#{zmk} $(ZOPTS) $@\n",
- "install-so: $(topdir)/#{dll}",
+ "install-so static: $(topdir)/#{dll}",
"$(topdir)/#{dll}: $(ZIMPLIB)\n",
"\t$(Q) $(COPY) #{dll} $(@D)\n",
"clean: clean-zsrc\n",
"clean-zsrc:\n",
"#{zmk} clean\n",