From ddc3997c5864d0e77e01cb1e2325a406f12f7d86 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 22 Mar 2015 00:51:31 +0000 Subject: [PATCH] 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 --- ChangeLog | 6 ++++++ tool/make-snapshot | 44 +++++++++++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19b9178dc4..338c555514 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Mar 22 09:51:29 2015 Nobuyoshi Nakada + + * 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 * common.mk (ext/ripper/ripper.c, ext/rbconfig/sizeof/sizes.c): 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(/(?