summaryrefslogtreecommitdiff
path: root/enc/make_encmake.rb
diff options
context:
space:
mode:
Diffstat (limited to 'enc/make_encmake.rb')
-rwxr-xr-xenc/make_encmake.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index 96d1944bcb..e5ed4eb4b5 100755
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -1,8 +1,11 @@
#! ./miniruby
dir = File.expand_path("../..", __FILE__)
-$:.unshift(dir)
-$:.unshift(".")
+# The source lib directory provides the standard library for miniruby.
+# Don't add it when running with baseruby to avoid loading both
+# baseruby's cgi/escape.so and source cgi/escape.rb via erb.
+$:.unshift("#{dir}/lib") unless defined?(CROSS_COMPILING)
+$:.unshift(Dir.pwd, "#{dir}/tool/lib")
if $".grep(/mkmf/).empty?
$" << "mkmf.rb"
load File.expand_path("lib/mkmf.rb", dir)
@@ -147,6 +150,6 @@ if MODULE_TYPE == :static
Dir.mkdir 'enc'
rescue Errno::EEXIST
end
- require 'tool/lib/output'
+ require 'output'
Output.new(path: "enc/encinit.c", ifchange: true).write(tmp)
end