diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-09 01:02:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-09 01:02:53 +0000 |
commit | 0a4ed02461f9a7fee0da33282a6ede600b90e928 (patch) | |
tree | 34328b10e7852a2d9840fef1419078168cbe03e6 | |
parent | 74ba9c248890b2395131bccb92fb099a8512ab63 (diff) | |
download | ruby-0a4ed02461f9a7fee0da33282a6ede600b90e928.tar.gz |
mkmf.rb: timestamp directory
* lib/mkmf.rb (timestamp_file): gather timestamp files in one
directory from each extension directories, with considering
target_prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/mkmf.rb | 21 |
2 files changed, 20 insertions, 7 deletions
@@ -1,3 +1,9 @@ +Tue Apr 9 10:02:39 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/mkmf.rb (timestamp_file): gather timestamp files in one + directory from each extension directories, with considering + target_prefix. + Tue Apr 9 04:57:59 JST 2013 Charles Oliver Nutter <headius@headius.com> * error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and diff --git a/lib/mkmf.rb b/lib/mkmf.rb index a02c3cd039..9ee27f5a91 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1920,7 +1920,14 @@ preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''} mk end - def timestamp_file(name) + 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 name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"} "./.#{name}.time" end @@ -2216,7 +2223,7 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""} mfile.print "\t-$(Q)$(RM) #{fseprepl[dest]}\n" mfile.print "\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n" else - mfile.print "#{f} #{timestamp_file(dir)}\n" + mfile.print "#{f} #{timestamp_file(dir, target_prefix)}\n" mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} #{dir}\n" if defined?($installed_list) mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n" @@ -2236,12 +2243,12 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""} for dir, *files in files unless dirs.include?(dir) dirs << dir - mfile.print "pre-install-rb#{sfx}: #{timestamp_file(dir)}\n" + mfile.print "pre-install-rb#{sfx}: #{timestamp_file(dir, target_prefix)}\n" end for f in files dest = "#{dir}/#{File.basename(f)}" mfile.print("install-rb#{sfx}: #{dest}\n") - mfile.print("#{dest}: #{f} #{timestamp_file(dir)}\n") + mfile.print("#{dest}: #{f} #{timestamp_file(dir, target_prefix)}\n") mfile.print("\t$(Q) $(#{$extout ? 'COPY' : 'INSTALL_DATA'}) #{f} $(@D#{sep})\n") if defined?($installed_list) and !$extout mfile.print("\t@echo #{dest}>>$(INSTALLED_LIST)\n") @@ -2266,8 +2273,8 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""} end dirs.unshift(sodir) if target and !dirs.include?(sodir) dirs.each do |d| - t = timestamp_file(d) - mfile.print "#{t}:\n\t$(Q) $(MAKEDIRS) #{d}\n\t$(Q) $(TOUCH) $@\n" + t = timestamp_file(d, target_prefix) + mfile.print "#{t}:\n\t$(Q) $(MAKEDIRS) $(@D) #{d}\n\t$(Q) $(TOUCH) $@\n" end mfile.print <<-SITEINSTALL @@ -2302,7 +2309,7 @@ site-install-rb: install-rb mfile.print "$(DLLIB): " mfile.print "$(DEFFILE) " if makedef mfile.print "$(OBJS) Makefile" - mfile.print " #{timestamp_file('$(RUBYARCHDIR)')}" if $extout + mfile.print " #{timestamp_file('$(RUBYARCHDIR)', target_prefix)}" if $extout mfile.print "\n" mfile.print "\t$(ECHO) linking shared-object #{target_prefix.sub(/\A\/(.*)/, '\1/')}$(DLLIB)\n" mfile.print "\t-$(Q)$(RM) $(@#{sep})\n" |