verconf.h.tmpl: separate RbConfig

* template/verconf.h.tmpl: load rbconfig.rb into a separate
  namespace get rid of conflict with the default RbConfig, to run
  with BASERUBY.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-09-03 16:30:40 +00:00
Родитель 91cdbaf44b
Коммит ebb03a0b82
1 изменённых файлов: 6 добавлений и 4 удалений

Просмотреть файл

@ -1,5 +1,7 @@
% require './rbconfig'
% C = RbConfig::MAKEFILE_CONFIG.dup
% config = File.read(conffile = 'rbconfig.rb')
% config.sub!(/^(\s*)RUBY_VERSION\b.*(\sor\s*)$/, '\1true\2')
% rbconfig = Module.new {module_eval(config, conffile)}::RbConfig
% C = rbconfig::MAKEFILE_CONFIG.dup
% def C.[](name) str = super and (str unless str.empty?); end
#define RUBY_BASE_NAME "${RUBY_BASE_NAME}"
#define RUBY_VERSION_NAME RUBY_BASE_NAME"-"RUBY_LIB_VERSION
@ -49,12 +51,12 @@
% R["rubysitearchprefix"] = '"RUBY_SITEARCH_PREFIX_FOR(arch)"'
% R["exec_prefix"] = '"RUBY_EXEC_PREFIX"'
% R["prefix"] = '"RUBY_EXEC_PREFIX"'
% exec_prefix_pat = /\A"#{Regexp.quote(RbConfig::CONFIG['exec_prefix'])}(?=\/|\z)/
% exec_prefix_pat = /\A"#{Regexp.quote(rbconfig::CONFIG['exec_prefix'])}(?=\/|\z)/
% _erbout.gsub!(/^(#define\s+(\S+)\s+)(.*)/) {
% pre, name, repl = $1, $2, $3
% pat = %["#{name}"]
% c = C.merge(R.reject {|key, value| key == name or value.include?(pat)})
% RbConfig.expand(repl, c)
% rbconfig.expand(repl, c)
% repl.gsub!(/^""(?!$)|(.)""$/, '\1')
% repl.sub!(exec_prefix_pat, 'RUBY_EXEC_PREFIX"')
% pre + repl