[前][次][番号順一覧][スレッド一覧]

ruby-changes:28152

From: nobu <ko1@a...>
Date: Tue, 9 Apr 2013 10:03:03 +0900 (JST)
Subject: [ruby-changes:28152] nobu:r40204 (trunk): mkmf.rb: timestamp directory

nobu	2013-04-09 10:02:53 +0900 (Tue, 09 Apr 2013)

  New Revision: 40204

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40204

  Log:
    mkmf.rb: timestamp directory
    
    * lib/mkmf.rb (timestamp_file): gather timestamp files in one
      directory from each extension directories, with considering
      target_prefix.

  Modified files:
    trunk/ChangeLog
    trunk/lib/mkmf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 40203)
+++ ChangeLog	(revision 40204)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Apr  9 10:02:39 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@h...>
 
 	* error.c: Capture EGAIN, EWOULDBLOCK, EINPROGRESS exceptions and
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 40203)
+++ lib/mkmf.rb	(revision 40204)
@@ -1920,7 +1920,14 @@ preload = #{defined?($preload) && $prelo https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1920
     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 ? " insta https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2223
         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 ? " insta https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2243
       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 ? " insta https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2273
     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 https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2309
     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"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]