summaryrefslogtreecommitdiff
path: root/tool/make-snapshot
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-22 00:51:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-22 00:51:31 +0000
commitddc3997c5864d0e77e01cb1e2325a406f12f7d86 (patch)
tree29c71597237f6f641ec87f033d90d916aa11c9e0 /tool/make-snapshot
parenta77e89766bc753889d87242ea93a40a09b930d41 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-xtool/make-snapshot44
1 files changed, 27 insertions, 17 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot
index 2743743f58..c6782ea647 100755
--- a/tool/make-snapshot
+++ b/tool/make-snapshot
@@ -288,26 +288,36 @@ def package(vcs, rev, destdir, tmp = nil)
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