From 97a016ac8ae37e7880841179c10bff15163514d9 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 24 Sep 2016 13:26:21 +0000 Subject: install extra libraries * ext/extmk.rb (extract_makefile, extmake, configuration): store extra libraries to be installed. * tool/rbinstall.rb (ext-arch): install extra libraries. * ext/zlib/extconf.rb: install zlib if built. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/zlib/extconf.rb | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'ext/zlib') diff --git a/ext/zlib/extconf.rb b/ext/zlib/extconf.rb index 47a15b1b20..c59ef7fd44 100644 --- a/ext/zlib/extconf.rb +++ b/ext/zlib/extconf.rb @@ -21,11 +21,27 @@ else zsrc = dirs.max_by {|x| x.scan(/\d+/).map(&:to_i)} end if zsrc + addconf = [ + "ZSRC = $(srcdir)/#{File.basename(zsrc)}\n", + "all:\n", + ] $INCFLAGS << " -I$(ZSRC)" if $mswin or $mingw $libs = append_library($libs, "zdll") dll = "zlib1.dll" + $extso << dll + addconf.push( + "ZIMPLIB = zdll.lib\n", + "$(TARGET_SO): $(ZIMPLIB)\n", + "$(ZIMPLIB):\n", + "\t$(MAKE) -f $(ZSRC)/win32/Makefile.#{$nmake ? 'msc' : 'gcc'} TOP=$(ZSRC) $@\n", + "install-so: $(topdir)/#{dll}", + "$(topdir)/#{dll}: $(ZIMPLIB)\n", + "\t$(Q) $(COPY) #{dll} $(@D)\n", + ) end + Logging.message "using zlib in #{zsrc}\n" + $defs << "-DHAVE_ZLIB_H" have_zlib = true end end @@ -82,17 +98,7 @@ if have_zlib create_makefile('zlib') {|conf| if zsrc - conf << "ZSRC = $(srcdir)/#{File.basename(zsrc)}\n" - conf << "all:\n" - if $mingw or $mswin - conf << "ZIMPLIB = zdll.lib\n" - conf << "$(TARGET_SO): $(ZIMPLIB)\n" - conf << "$(ZIMPLIB):\n" - conf << "\t$(MAKE) -f $(ZSRC)/win32/Makefile.#{$nmake ? 'msc' : 'gcc'} TOP=$(ZSRC) $@\n" - conf << "install-so: $(topdir)/#{dll}" - conf << "$(topdir)/#{dll}: $(ZIMPLIB)\n" - conf << "\t$(Q) $(COPY) #{dll} $(@D)\n" - end + conf.concat addconf if addconf end conf } -- cgit v1.2.3