mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
a77e89766b
commit
ddc3997c58
2 changed files with 33 additions and 17 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Sun Mar 22 09:51:29 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Sun Mar 22 08:09:47 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c):
|
* common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c):
|
||||||
|
|
|
@ -288,26 +288,36 @@ def package(vcs, rev, destdir, tmp = nil)
|
||||||
File.open("#{defaults}/ruby.rb", "w") {}
|
File.open("#{defaults}/ruby.rb", "w") {}
|
||||||
miniruby = ENV['MINIRUBY'] + " -I. -I#{extout} -rcross"
|
miniruby = ENV['MINIRUBY'] + " -I. -I#{extout} -rcross"
|
||||||
baseruby = ENV["BASERUBY"]
|
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(/(?<!#)\{[^{}]*\}/, "")
|
mk << commonmk.gsub(/(?<!#)\{[^{}]*\}/, "")
|
||||||
cmd = %W[make -f -
|
mk << <<-'APPEND'
|
||||||
srcdir=. CHDIR=cd NULLCMD=:
|
|
||||||
PATH_SEPARATOR=#{File::PATH_SEPARATOR}
|
prereq: clean-cache $(CLEAN_CACHE)
|
||||||
IFCHANGE=tool/ifchange MAKEDIRS=mkdir\ -p
|
clean-cache $(CLEAN_CACHE): after-update
|
||||||
RMALL=rm\ -fr
|
after-update:: extract-gems
|
||||||
MINIRUBY=#{miniruby}
|
extract-gems:
|
||||||
RUNRUBY=#{miniruby}
|
APPEND
|
||||||
RUBY=#{ENV["RUBY"]}
|
open(clean.add("Makefile"), "w") do |f|
|
||||||
HAVE_BASERUBY=yes
|
|
||||||
BASERUBY=#{baseruby}
|
|
||||||
BOOTSTRAPRUBY=#{baseruby}
|
|
||||||
PWD=#{Dir.pwd}
|
|
||||||
prereq]
|
|
||||||
IO.popen(cmd, "w") do |f|
|
|
||||||
f.puts mk
|
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
|
end
|
||||||
|
system("make", "prereq")
|
||||||
clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk")
|
clean.push("rbconfig.rb", ".rbconfig.time", "enc.mk")
|
||||||
print "prerequisites"
|
print "prerequisites"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue