mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
9d014dc254
cross-compiling. * ext/extmk.rb, enc/make_encmake.rb, lib/mkmf.rb: need to be 1.8 compatible for cross-compiling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
29 lines
688 B
Ruby
29 lines
688 B
Ruby
#! ./miniruby
|
|
|
|
dir = File.expand_path("../..", __FILE__)
|
|
$:.unshift(dir)
|
|
$:.unshift(".")
|
|
$" << "mkmf.rb"
|
|
load File.expand_path("lib/mkmf.rb", dir)
|
|
require 'erb'
|
|
|
|
if /--builtin-encs=/ =~ ARGV[0]
|
|
BUILTIN_ENCS = $'.split.map {|e| File.basename(e, '.*') << '.c'}
|
|
ARGV.shift
|
|
else
|
|
BUILTIN_ENCS = []
|
|
end
|
|
|
|
if File.exist?(depend = File.join($srcdir, "depend"))
|
|
erb = ERB.new(File.read(depend), nil, '%')
|
|
erb.filename = depend
|
|
tmp = erb.result(binding)
|
|
dep = "\n#### depend ####\n\n" << depend_rules(tmp).join
|
|
else
|
|
dep = ""
|
|
end
|
|
mkin = File.read(File.join($srcdir, "Makefile.in"))
|
|
mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]}
|
|
open(ARGV[0], 'wb') {|f|
|
|
f.puts mkin, dep
|
|
}
|