mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
mkrunnable.rb: config directory names
* tool/mkrunnable.rb: collect directory names from config. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
58d0277775
commit
06d98b4d4d
1 changed files with 7 additions and 5 deletions
|
@ -42,7 +42,9 @@ config = RbConfig::CONFIG
|
|||
extout = ARGV[0] || config["EXTOUT"]
|
||||
version = config["ruby_version"]
|
||||
arch = config["arch"]
|
||||
["bin", "lib"].each do |dir|
|
||||
bindir = File.basename(config["bindir"])
|
||||
libdir = File.basename(config["libdir"])
|
||||
[bindir, libdir].each do |dir|
|
||||
File.directory?(dir) or mkdir_p(dir)
|
||||
end
|
||||
|
||||
|
@ -53,16 +55,16 @@ goruby_install_name = "go" + ruby_install_name
|
|||
[ruby_install_name, rubyw_install_name, goruby_install_name].map do |ruby|
|
||||
ruby += exeext
|
||||
if ruby and !ruby.empty?
|
||||
ln_safe("../#{ruby}", "bin/#{ruby}")
|
||||
ln_safe("../#{ruby}", "#{bindir}/#{ruby}")
|
||||
end
|
||||
end
|
||||
libruby = config.values_at("LIBRUBY_A", "LIBRUBY_SO")
|
||||
libruby.concat(config["LIBRUBY_ALIASES"].split)
|
||||
libruby.each {|lib|ln_safe("../#{lib}", "lib/#{lib}")}
|
||||
libruby.each {|lib|ln_safe("../#{lib}", "#{libdir}/#{lib}")}
|
||||
if File.expand_path(extout) == extout
|
||||
ln_dir_safe(extout, "lib/ruby")
|
||||
ln_dir_safe(extout, "#{libdir}/ruby")
|
||||
else
|
||||
ln_dir_safe(File.join("..", extout), "lib/ruby")
|
||||
ln_dir_safe(File.join("..", extout), "#{libdir}/ruby")
|
||||
cur = "#{extout}/".gsub(/(\A|\/)(?:\.\/)+/, '\1').tr_s('/', '/')
|
||||
nil while cur.sub!(/[^\/]+\/\.\.\//, '')
|
||||
if /(\A|\/)\.\.\// =~ cur
|
||||
|
|
Loading…
Add table
Reference in a new issue