summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 10:51:11 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-15 10:51:11 +0000
commit46ce7c436add4ce29953d810ecc8260f7112fc25 (patch)
tree196179a8720215f9b6e34c3298da49068d848093
parentc93dd36e0ef8bb07c96614ca6f3948eef72ca058 (diff)
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-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