diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-07 13:06:34 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-07 13:06:34 +0000 |
commit | 987508ce561fb943fdf29c9020b69aa8e82b2f81 (patch) | |
tree | 9ce1da63bd6a6a41169b87c593610a8f3a94dc63 /tool/make-snapshot | |
parent | a319225b4a4ba333a6cf6989b3111bd512ad4861 (diff) |
extract prereq.status
* tool/make-snapshot (package): extract static config values for
prereq and override dynamic values at runtime.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/make-snapshot')
-rwxr-xr-x | tool/make-snapshot | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/tool/make-snapshot b/tool/make-snapshot index d8e635af40..ca13cc91af 100755 --- a/tool/make-snapshot +++ b/tool/make-snapshot @@ -210,6 +210,7 @@ def package(vcs, rev, destdir, tmp = nil) 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) 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) 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]} |