aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-31 02:41:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-31 02:41:31 +0000
commit7406a91202a3824cb2194cc4c4ec4d5bfcbec94c (patch)
treee368790d1d218617b2ab7caa302246d638e08c85 /lib
parent9ba00bc248e009638e01224d7e570ad89ad58b05 (diff)
downloadruby-7406a91202a3824cb2194cc4c4ec4d5bfcbec94c.tar.gz
mkmf.rb: separate timestamp files
* lib/mkmf.rb (timestamp_file): separate timestamp files for each architectures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index db461ad07d..c20e431978 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2028,15 +2028,16 @@ preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
end
def timestamp_file(name, target_prefix = nil)
- if target_prefix
- pat = []
- install_dirs.each do |n, d|
- pat << n if /\$\(target_prefix\)\z/ =~ d
- end
- name = name.gsub(/\$\((#{pat.join("|")})\)/) {$&+target_prefix}
- end
+ pat = {}
+ install_dirs.each do |n, d|
+ pat[n] = $` if /\$\(target_prefix\)\z/ =~ d
+ end
+ name = name.gsub(/\$\((#{pat.keys.join("|")})\)/) {pat[$1]+target_prefix}
+ name.sub!(/\A\$\(extout\)\//, '')
+ name.sub!(/(\$\((?:site)?arch\))\/*/, '')
+ arch = $1 || ''
name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"}
- "$(TIMESTAMP_DIR)/.#{name}.time"
+ File.join("$(TIMESTAMP_DIR)", arch, "#{name.sub(/\A(?=.)/, '.')}.time")
end
# :startdoc: