summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--template/fake.rb.in7
-rw-r--r--test/ruby/test_rubyoptions.rb6
2 files changed, 6 insertions, 7 deletions
diff --git a/template/fake.rb.in b/template/fake.rb.in
index 5e95530..881e39c 100644
--- a/template/fake.rb.in
+++ b/template/fake.rb.in
@@ -7,12 +7,15 @@ while /\A(\w+)=(.*)/ =~ ARGV[0]
end
if inc = arg['i']
src = inc == '-' ? STDIN.read : File.read(inc)
+ def src.value(name)
+ eval(self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#'))
+ end
arg['versions'] = version = {}
File.read(File.join(arg['srcdir'], 'version.c')).
scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|STR)\(([^()]*)\)/m) do |n, v|
- version[n] =
- eval(src[/\bruby_#{v}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#'))
+ version[n] = src.value(v)
end
+ version['RUBY_DESCRIPTION'] = src.value('description_with_jit') if RubyVM::MJIT.enabled?
end
%>baseruby="<%=arg['BASERUBY']%>"
_\
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb
index 6e501a4..afaa8a2 100644
--- a/test/ruby/test_rubyoptions.rb
+++ b/test/ruby/test_rubyoptions.rb
@@ -116,11 +116,7 @@ class TestRubyOptions < Test::Unit::TestCase
def test_verbose
assert_in_out_err(["-vve", ""]) do |r, e|
assert_match(VERSION_PATTERN, r[0])
- if RbConfig::CONFIG.fetch('cppflags', '').match?(/(\A|\s)-DMJIT_FORCE_ENABLE\b/)
- assert_equal(RUBY_DESCRIPTION, r[0])
- else
- assert_equal(NO_JIT_DESCRIPTION, r[0])
- end
+ assert_equal(RUBY_DESCRIPTION, r[0])
assert_equal([], e)
end