expand-config.rb: expand config values

* tool/expand-config.rb: expand config values, extracted from
  win32/Makefile.sub.

* win32/Makefile.sub (ruby_pc): use tool/expand-config.rb script.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-12-27 05:46:10 +00:00
parent 07dcd43a0a
commit bb4a1ac9b0
2 changed files with 8 additions and 5 deletions

7
tool/expand-config.rb Executable file
View File

@ -0,0 +1,7 @@
STDOUT.binmode
ARGF.each do |line|
line.gsub!(/@([a-z_]\w*)@/i) {
(RbConfig::MAKEFILE_CONFIG[$1] or "").gsub(/\$\((.+?)\)/, %Q[${\\1}])
}
puts line
end

View File

@ -1053,11 +1053,7 @@ end
<<KEEP <<KEEP
$(ruby_pc): $(RBCONFIG) $(ruby_pc): $(RBCONFIG)
@$(MINIRUBY) -r./rbconfig -p \ @$(MINIRUBY) -r./rbconfig $(srcdir)/tool/expand-config.rb \
-e 'STDOUT.binmode' \
-e '$$_.gsub!(/@([a-z_]\w*)@/i) {' \
-e '(RbConfig::MAKEFILE_CONFIG[$$1] or "").gsub(/\$$\((.+?)\)/, %Q[$${\\1}])' \
-e '}' \
$(srcdir)/template/ruby.pc.in > $@ $(srcdir)/template/ruby.pc.in > $@
{$(srcdir)/enc}.c.obj: {$(srcdir)/enc}.c.obj: