3 dir = File.expand_path("../..", __FILE__)
6 if $".grep(/mkmf/).empty?
8 load File.expand_path("lib/mkmf.rb", dir)
12 CONFIG["MAKEDIRS"] ||= '@$(MINIRUBY) -run -e mkdir -- -p'
20 when /\A--builtin-encs=/
21 BUILTIN_ENCS.concat $'.split.map {|e| File.basename(e, '.*') << '.c'}
24 ENC_PATTERNS.concat $'.split
27 NOENC_PATTERNS.concat $'.split
34 if File.exist?(depend = File.join($srcdir, "depend"))
35 erb = ERB.new(File.read(depend), nil, '%')
37 tmp = erb.result(binding)
38 dep = "\n#### depend ####\n\n" << depend_rules(tmp).join
42 mkin = File.read(File.join($srcdir, "Makefile.in"))
43 mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]}
44 open(ARGV[0], 'wb') {|f|