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

ruby-changes:37966

From: nobu <ko1@a...>
Date: Sun, 22 Mar 2015 09:51:42 +0900 (JST)
Subject: [ruby-changes:37966] nobu:r50047 (trunk): make-snapshot: substitute configuration variables

nobu	2015-03-22 09:51:31 +0900 (Sun, 22 Mar 2015)

  New Revision: 50047

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

  Log:
    make-snapshot: substitute configuration variables
    
    * tool/make-snapshot (package): substitute configuration variables
      in Makefile.in instead of passing by the command line, and make
      temporary Makefile instead of a pipe.

  Modified files:
    trunk/ChangeLog
    trunk/tool/make-snapshot
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50046)
+++ ChangeLog	(revision 50047)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Mar 22 09:51:29 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* tool/make-snapshot (package): substitute configuration variables
+	  in Makefile.in instead of passing by the command line, and make
+	  temporary Makefile instead of a pipe.
+
 Sun Mar 22 08:09:47 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c):
Index: tool/make-snapshot
===================================================================
--- tool/make-snapshot	(revision 50046)
+++ tool/make-snapshot	(revision 50047)
@@ -288,26 +288,36 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L288
       File.open("#{defaults}/ruby.rb", "w") {}
       miniruby = ENV['MINIRUBY'] + " -I. -I#{extout} -rcross"
       baseruby = ENV["BASERUBY"]
-      mk = IO.read("Makefile.in").gsub(/^@.*\n/, '').gsub(/@([A-Za-z_]\w*)@/) {ENV[$1]}
+      mk = IO.read("Makefile.in").gsub(/^@.*\n/, '')
+      vars = {
+        "srcdir"=>".",
+        "CHDIR"=>"cd",
+        "NULLCMD"=>":",
+        "PATH_SEPARATOR"=>File::PATH_SEPARATOR,
+        "IFCHANGE"=>"tool/ifchange",
+        "MKDIR_P"=>"mkdir -p",
+        "RMALL"=>"rm -fr",
+        "MINIRUBY"=>miniruby,
+        "RUNRUBY"=>miniruby,
+        "RUBY"=>ENV["RUBY"],
+        "HAVE_BASERUBY"=>"yes",
+        "BASERUBY"=>baseruby,
+        "BOOTSTRAPRUBY"=>baseruby,
+        "PWD"=>Dir.pwd,
+      }
+      mk.gsub!(/@([A-Za-z_]\w*)@/) {vars[$1] || ENV[$1]}
       mk << commonmk.gsub(/(?<!#)\{[^{}]*\}/, "")
-      cmd = %W[make -f -
-               srcdir=. CHDIR=cd NULLCMD=:
-               PATH_SEPARATOR=#{File::PATH_SEPARATOR}
-               IFCHANGE=tool/ifchange MAKEDIRS=mkdir\ -p
-               RMALL=rm\ -fr
-               MINIRUBY=#{miniruby}
-               RUNRUBY=#{miniruby}
-               RUBY=#{ENV["RUBY"]}
-               HAVE_BASERUBY=yes
-               BASERUBY=#{baseruby}
-               BOOTSTRAPRUBY=#{baseruby}
-               PWD=#{Dir.pwd}
-               prereq]
-      IO.popen(cmd, "w") do |f|
+      mk << <<-'APPEND'
+
+prereq: clean-cache $(CLEAN_CACHE)
+clean-cache $(CLEAN_CACHE): after-update
+after-update:: extract-gems
+extract-gems:
+      APPEND
+      open(clean.add("Makefile"), "w") do |f|
         f.puts mk
-        f.puts "after-update::", "clean-cache $(CLEAN_CACHE): after-update", "prereq: clean-cache $(CLEAN_CACHE)"
-        f.puts "extract-gems:", "after-update:: extract-gems"
       end
+      system("make", "prereq")
       clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk")
       print "prerequisites"
     else

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

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