mkmf.rb: architecture timestamp directories

* lib/mkmf.rb (timestamp_file): substitute TARGET_SO_DIR with
  RUBYARCHDIR seprately from other normal paths, to make timestamp
  files for architecture dependent directories separately.  and
  remove RUBYCOMMONDIR prefix.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-09-01 07:02:32 +00:00
Родитель c929094b31
Коммит cea6c9d2f5
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -2019,12 +2019,13 @@ preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
end
def timestamp_file(name, target_prefix = nil)
pat = {'TARGET_SO_DIR'=>'$(RUBYARCHDIR)'}
pat = {}
name = '$(RUBYARCHDIR)' if name == '$(TARGET_SO_DIR)'
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!(/\A\$\((?:extout|RUBYCOMMONDIR)\)\/*/, '')
name.sub!(/(\$\((?:site)?arch\))\/*/, '')
arch = $1 || ''
name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"}