diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rwxr-xr-x | ext/extmk.rb | 6 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Tue May 28 11:30:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * ext/extmk.rb (extmake): leave makefiles untouched if the content is + not changed, to get rid of unnecessary re-linking. + Tue May 28 03:11:02 2013 Koichi Sasada <ko1@atdot.net> * ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to diff --git a/ext/extmk.rb b/ext/extmk.rb index eda487c30e..1ca5efd52c 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -222,14 +222,14 @@ def extmake(target) ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]} ok = yield(ok) if block_given? if ok - open(makefile, "r+") do |f| - s = f.read.sub!(/^(static:)\s.*/, '\1 all') + open(makefile, "r+b") do |f| + s = f.read.sub!(/^(static:)\s(?!all\b).*/, '\1 all') or break f.rewind f.print(s) f.truncate(f.pos) end else - open(makefile, "w") do |f| + open(makefile, "wb") do |f| f.puts "# " + DUMMY_SIGNATURE f.print(*dummy_makefile(CONFIG["srcdir"])) end |