summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xext/extmk.rb6
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 91fc24e4d3f..bdd80a60d83 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 eda487c30e0..1ca5efd52cd 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