summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 15:22:01 (GMT)
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-25 15:22:01 (GMT)
commit7df1831bae12e3ff1018dd80eb30aec4d7b0a243 (patch)
tree42508623f90130f82b773fad42c4b579128fd8b1 /template
parentafe02a2f1970202c1b7bf7ea7f4a09e8e05134f4 (diff)
* template/prelude.c.tmpl: Don't expand RbConfig::Config[...].
It is not used now. * common.mk: prelude.c and golf_prelude.c doesn't depend on rbconfig. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template')
-rw-r--r--template/prelude.c.tmpl22
1 files changed, 3 insertions, 19 deletions
diff --git a/template/prelude.c.tmpl b/template/prelude.c.tmpl
index c2f41da..1f00bd6 100644
--- a/template/prelude.c.tmpl
+++ b/template/prelude.c.tmpl
@@ -28,9 +28,7 @@ class Prelude
def initialize(init_name, preludes, vpath)
@init_name = init_name
- @mkconf = nil
@have_sublib = false
- @need_ruby_prefix = false
@vpath = vpath
@preludes = {}
@mains = preludes.map {|filename| translate(filename)[0]}
@@ -45,20 +43,6 @@ class Prelude
@vpath.foreach(filename) do |line|
@preludes[filename] ||= result
line.sub!(/(?:^|\s+)\#(?:$|\s.*)/, '')
- line.gsub!(/RbConfig::CONFIG\["(\w+)"\]/) {
- key = $1
- unless @mkconf
- require './rbconfig'
- @mkconf = RbConfig::MAKEFILE_CONFIG.merge('prefix'=>'#{TMP_RUBY_PREFIX}')
- end
- if RbConfig::MAKEFILE_CONFIG.has_key? key
- val = RbConfig.expand("$(#{key})", @mkconf)
- @need_ruby_prefix ||= /\A\#\{TMP_RUBY_PREFIX\}/ =~ val
- c_esc(val)
- else
- "nil"
- end
- }
line.sub!(/require\s*\(?\s*(["'])(.*?)\1\)?/) do
orig, path = $&, $2
path = translate(path, true) rescue nil
@@ -98,7 +82,7 @@ static const char prelude_code<%=i%>[] =
#define PRELUDE_COUNT <%=@have_sublib ? preludes.size : 0%>
-% if @have_sublib or @need_ruby_prefix
+% if @have_sublib
struct prelude_env {
volatile VALUE prefix_path;
#if PRELUDE_COUNT > 0
@@ -153,7 +137,7 @@ prelude_require(VALUE self, VALUE nth)
void
Init_<%=@init_name%>(void)
{
-% if @have_sublib or @need_ruby_prefix
+% if @have_sublib
struct prelude_env memo;
ID name = rb_intern("TMP_RUBY_PREFIX");
VALUE prelude = Data_Wrap_Struct(rb_cData, 0, 0, &memo);
@@ -173,7 +157,7 @@ Init_<%=@init_name%>(void)
rb_usascii_str_new(prelude_name<%=i%>, sizeof(prelude_name<%=i%>) - 1),
INT2FIX(1));
% end
-% if @have_sublib or @need_ruby_prefix
+% if @have_sublib
rb_gc_force_recycle(prelude);
% end