ruby-changes:46481
From: nobu <ko1@a...>
Date: Sun, 7 May 2017 22:06:41 +0900 (JST)
Subject: [ruby-changes:46481] nobu:r58600 (trunk): extract prereq.status
nobu 2017-05-07 22:06:34 +0900 (Sun, 07 May 2017) New Revision: 58600 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58600 Log: extract prereq.status * tool/make-snapshot (package): extract static config values for prereq and override dynamic values at runtime. Added files: trunk/tool/prereq.status Modified files: trunk/tool/make-snapshot Index: tool/prereq.status =================================================================== --- tool/prereq.status (nonexistent) +++ tool/prereq.status (revision 58600) @@ -0,0 +1,43 @@ https://github.com/ruby/ruby/blob/trunk/tool/prereq.status#L1 +s,@EXTOUT@,tmp,g +s,@ruby_version@,0.0.0,g +s,@NULLCMD@,:,g +s,@ARCH_FLAG@,,g +s,@BASERUBY@,ruby,g +s,@BOOTSTRAPRUBY@,$(BASERUBY),g +s,@CC@,false,g +s,@CFLAGS@,,g +s,@CHDIR@,cd,g +s,@CONFIGURE@,configure,g +s,@CP@,cp,g +s,@CPPFLAGS@,,g +s,@CXXFLAGS@,,g +s,@DLDFLAGS@,,g +s,@EXEEXT@,,g +s,@HAVE_BASERUBY@,yes,g +s,@IFCHANGE@,tool/ifchange,g +s,@LDFLAGS@,,g +s,@LIBEXT@,a,g +s,@LIBRUBY@,libruby.a,g +s,@LIBRUBY_A@,libruby.a,g +s,@MINIRUBY@,$(BASERUBY),g +s,@MKDIR_P@,mkdir -p,g +s,@OBJEXT@,o,g +s,@PATH_SEPARATOR@,:,g +s,@PWD@,.,g +s,@RM@,rm -f,g +s,@RMALL@,rm -fr,g +s,@RMDIR@,rmdir,g +s,@RMDIRS@,$(RMDIR) -p,g +s,@RUBY@,$(BASERUBY),g +s,@RUNRUBY@,$(MINIRUBY),g +s,@UNICODE_FILES@,,g +s,@arch@,noarch,g +s,@bindir@,,g +s,@configure_args@,,g +s,@ruby_install_name@,,g +s,@rubyarchdir@,,g +s,@rubylibprefix@,,g +s,@srcdir@,.,g + +s/@[A-Za-z][A-Za-z0-9_]*@//g +s/{\$([A-Za-z]*)}//g Property changes on: tool/prereq.status ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property Index: tool/make-snapshot =================================================================== --- tool/make-snapshot (revision 58599) +++ tool/make-snapshot (revision 58600) @@ -210,6 +210,7 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L210 end end + status = IO.read(File.dirname(__FILE__) + "/prereq.status") Dir.chdir(tmp) if tmp if !File.directory?(v) @@ -283,27 +284,13 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L284 if File.file?("common.mk") && /^prereq/ =~ commonmk = IO.read("common.mk") puts extout = clean.add('tmp') + begin + status = IO.read("tool/prereq.status") + rescue Errno::ENOENT + # use fallback file + end File.open(clean.add("config.status"), "w") {|f| - f.puts "s,@configure_args@,|#_!!_#|,g" - f.puts "s,@EXTOUT@,|#_!!_#|#{extout},g" - f.puts "s,@bindir@,|#_!!_#|,g" - f.puts "s,@ruby_install_name@,|#_!!_#|,g" - f.puts "s,@ARCH_FLAG@,|#_!!_#|,g" - f.puts "s,@CFLAGS@,|#_!!_#|,g" - f.puts "s,@CPPFLAGS@,|#_!!_#|,g" - f.puts "s,@CXXFLAGS@,|#_!!_#|,g" - f.puts "s,@LDFLAGS@,|#_!!_#|,g" - f.puts "s,@DLDFLAGS@,|#_!!_#|,g" - f.puts "s,@LIBEXT@,|#_!!_#|a,g" - f.puts "s,@OBJEXT@,|#_!!_#|o,g" - f.puts "s,@EXEEXT@,|#_!!_#|,g" - f.puts "s,@LIBRUBY@,|#_!!_#|libruby.a,g" - f.puts "s,@LIBRUBY_A@,|#_!!_#|libruby.a,g" - f.puts "s,@RM@,|#_!!_#|rm -f,g" - f.puts "s,@CP@,|#_!!_#|cp,g" - f.puts "s,@rubyarchdir@,|#_!!_#|,g" - f.puts "s,@rubylibprefix@,|#_!!_#|,g" - f.puts "s,@ruby_version@,|#_!!_#|#{version},g" + f.print status } FileUtils.mkpath(hdrdir = "#{extout}/include/ruby") File.open("#{hdrdir}/config.h", "w") {} @@ -314,24 +301,17 @@ def package(vcs, rev, destdir, tmp = nil https://github.com/ruby/ruby/blob/trunk/tool/make-snapshot#L301 baseruby = ENV["BASERUBY"] mk = IO.read("Makefile.in").gsub(/^@.*\n/, '') vars = { - "srcdir"=>".", - "CHDIR"=>"cd", - "NULLCMD"=>":", + "EXTOUT"=>extout, "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, - "CONFIGURE"=>"configure", - "arch"=>"noarch", - "UNICODE_FILES"=>"", + "ruby_version"=>version, } + status.scan(/^s([%,])@([A-Za-z_][A-Za-z_0-9]*)@\1(.*?)\1g$/) do + vars[$2] = $3 + end vars["UNICODE_VERSION"] = $unicode_version if $unicode_version args = vars.dup mk.gsub!(/@([A-Za-z_]\w*)@/) {args.delete($1); vars[$1] || ENV[$1]} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/