summaryrefslogtreecommitdiff
path: root/enc/make_encmake.rb
diff options
context:
space:
mode:
Diffstat (limited to 'enc/make_encmake.rb')
-rwxr-xr-xenc/make_encmake.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index 4ab85f3..06979db 100755
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -121,7 +121,11 @@ ENCS, ENC_DEPS = target_encodings
ATRANS, TRANS = target_transcoders
if File.exist?(depend = File.join($srcdir, "depend"))
- erb = ERB.new(File.read(depend), nil, '%')
+ if RUBY_VERSION >= '2.6'
+ erb = ERB.new(File.read(depend), trim_mode: '%')
+ else
+ erb = ERB.new(File.read(depend), nil, '%')
+ end
erb.filename = depend
tmp = erb.result(binding)
dep = "\n#### depend ####\n\n" << depend_rules(tmp).join
@@ -135,7 +139,11 @@ open(ARGV[0], 'wb') {|f|
}
if MODULE_TYPE == :static
filename = "encinit.c.erb"
- erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')
+ if RUBY_VERSION >= '2.6'
+ erb = ERB.new(File.read(File.join($srcdir, filename)), trim_mode: '%-')
+ else
+ erb = ERB.new(File.read(File.join($srcdir, filename)), nil, '%-')
+ end
erb.filename = "enc/#{filename}"
tmp = erb.result(binding)
begin