diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-13 01:59:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-03-13 01:59:54 +0000 |
commit | 7e82db2e1e3b3c101988d6b01564529944cdef95 (patch) | |
tree | b6266e5f594ef69c78a7db5c6be368b4e4d51538 /tool | |
parent | 8a8936cbd0680db20357858f65f64ceb6d20d069 (diff) | |
download | ruby-7e82db2e1e3b3c101988d6b01564529944cdef95.tar.gz |
* tool/rbinstall.rb (prepare): skip if basedir is not defined.
[ruby-core:39135][Bug #5238]
* tool/rbinstall.rb (CONFIG.[]): check for mandatory
configurations.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/rbinstall.rb | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 6bfc73e0d1..8055f45a03 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -270,6 +270,7 @@ def with_destdir(dir) end def prepare(mesg, basedir, subdirs=nil) + return unless basedir case when !subdirs dirs = basedir @@ -286,31 +287,39 @@ def prepare(mesg, basedir, subdirs=nil) makedirs(dirs) end +def CONFIG.[](name, mandatory = false) + value = super(name) + if mandatory + raise "CONFIG['#{name}'] must be set" if !value or value.empty? + end + value +end + exeext = CONFIG["EXEEXT"] -ruby_install_name = CONFIG["ruby_install_name"] +ruby_install_name = CONFIG["ruby_install_name", true] rubyw_install_name = CONFIG["rubyw_install_name"] goruby_install_name = "go" + ruby_install_name -bindir = CONFIG["bindir"] -libdir = CONFIG["libdir"] -archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir"] -archhdrdir += "/" + CONFIG["arch"] -rubylibdir = CONFIG["rubylibdir"] -archlibdir = CONFIG["archdir"] +bindir = CONFIG["bindir", true] +libdir = CONFIG["libdir", true] +archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir", true] +archhdrdir += "/" + CONFIG["arch", true] +rubylibdir = CONFIG["rubylibdir", true] +archlibdir = CONFIG["archdir", true] sitelibdir = CONFIG["sitelibdir"] sitearchlibdir = CONFIG["sitearchdir"] vendorlibdir = CONFIG["vendorlibdir"] vendorarchlibdir = CONFIG["vendorarchdir"] -mandir = CONFIG["mandir"] -capidir = CONFIG["docdir"] +mandir = CONFIG["mandir", true] +capidir = CONFIG["docdir", true] configure_args = Shellwords.shellwords(CONFIG["configure_args"]) enable_shared = CONFIG["ENABLE_SHARED"] == 'yes' -dll = CONFIG["LIBRUBY_SO"] -lib = CONFIG["LIBRUBY"] -arc = CONFIG["LIBRUBY_A"] -major = CONFIG["MAJOR"] -minor = CONFIG["MINOR"] +dll = CONFIG["LIBRUBY_SO", enable_shared] +lib = CONFIG["LIBRUBY", true] +arc = CONFIG["LIBRUBY_A", true] +major = CONFIG["MAJOR", true] +minor = CONFIG["MINOR", true] load_relative = configure_args.include?("--enable-load-relative") install?(:local, :arch, :bin, :'bin-arch') do |