ruby-changes:28485
From: nobu <ko1@a...>
Date: Wed, 1 May 2013 16:18:04 +0900 (JST)
Subject: [ruby-changes:28485] nobu:r40537 (trunk): extmk.rb: always dynamic non-install extensions
nobu 2013-05-01 16:17:53 +0900 (Wed, 01 May 2013) New Revision: 40537 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40537 Log: extmk.rb: always dynamic non-install extensions * ext/extmk.rb (extmake): extensions not to be installed should not make static libraries, but make dynamic libraries always. Modified files: trunk/ChangeLog trunk/ext/extmk.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 40536) +++ ChangeLog (revision 40537) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed May 1 16:17:46 2013 Nobuyoshi Nakada <nobu@r...> + + * ext/extmk.rb (extmake): extensions not to be installed should not + make static libraries, but make dynamic libraries always. + Wed May 1 12:20:00 2013 Zachary Scott <zachary@z...> * lib/rake/version.rb: Fix RDoc warning with :include: [Bug #8347] Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 40536) +++ ext/extmk.rb (revision 40537) @@ -144,6 +144,8 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L144 $srcs = [] $compiled[target] = false makefile = "./Makefile" + static = $static + $static = nil if noinstall = File.fnmatch?("-*", target) ok = File.exist?(makefile) unless $ignore rbconfig0 = RbConfig::CONFIG @@ -216,7 +218,14 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L218 end ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]} ok = yield(ok) if block_given? - unless ok + if ok + open(makefile, "r+") do |f| + s = f.read.sub!(/^(static:)\s.*/, '\1 all') + f.rewind + f.print(s) + f.truncate(f.pos) + end + else open(makefile, "w") do |f| f.puts "# " + DUMMY_SIGNATURE f.print(*dummy_makefile(CONFIG["srcdir"])) @@ -236,7 +245,7 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L245 unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR") args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))] end - if $static and ok and !$objs.empty? and !File.fnmatch?("-*", target) + if $static and ok and !$objs.empty? and !noinstall args += ["static"] unless $clean $extlist.push [$static, target, $target, $preload] end @@ -279,6 +288,7 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L288 $top_srcdir = top_srcdir $topdir = topdir $hdrdir = hdrdir + $static = static Dir.chdir dir end begin -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/