summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--lib/mkmf.rb5
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d05ae448438..1ae6576d439 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Nov 15 19:48:59 2014 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * lib/mkmf.rb (depend_rules): support comments during a line.
+
+ * lib/mkmf.rb (depend_rules): apply RULE_SUBST even if the dependency
+ file contains path.
+
Sat Nov 15 19:25:46 2014 Tanaka Akira <akr@fsij.org>
* common.mk: Remove comments in Dependency lines.
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 1eb52047a38..513dff35837 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2051,7 +2051,10 @@ RULES
implicit = [[m[1], m[2]], [m.post_match]]
next
elsif RULE_SUBST and /\A(?!\s*\w+\s*=)[$\w][^#]*:/ =~ line
- line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ line.sub!(/\s*\#.*$/, '')
+ comment = $&
+ line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2}
+ line = line.chomp + comment + "\n" if comment
end
depout << line
end