diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-03 16:30:40 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-09-03 16:30:40 +0000 |
commit | ebb03a0b82e6faec1941bedcdd610e68dc124ab5 (patch) | |
tree | 52da239c3ea51f9e27519e69954f02aea2019932 /template/verconf.h.tmpl | |
parent | 91cdbaf44bcedfaffd9d423efe64f64ad40632da (diff) | |
download | ruby-ebb03a0b82e6faec1941bedcdd610e68dc124ab5.tar.gz |
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
Diffstat (limited to 'template/verconf.h.tmpl')
-rw-r--r-- | template/verconf.h.tmpl | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/template/verconf.h.tmpl b/template/verconf.h.tmpl index 5ee8a0e472..9325aee0ff 100644 --- a/template/verconf.h.tmpl +++ b/template/verconf.h.tmpl @@ -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 |