diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-06 08:32:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-06 08:32:53 +0000 |
commit | 29c214e4a058fc4017ab0c0bf5c36b5bad203b5b (patch) | |
tree | ab2a45e9dc177e3f9b31d96588a922ba32d63aca /tool | |
parent | d32b122996778828f5d5f2ea58b0d2a8c0da7ede (diff) | |
download | ruby-29c214e4a058fc4017ab0c0bf5c36b5bad203b5b.tar.gz |
configure.in: arch dependent library directory options
* configure.in (rubyarchprefix, sitearchdir, vendorarchdir): add
options to customize architecture dependent library directories.
* template/ruby.pc.in, tool/mkconfig.rb, tool/rbinstall.rb: use
configured values.
* tool/mkconfig.rb: expand rubyarchdir to extract prefix.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/mkconfig.rb | 38 | ||||
-rwxr-xr-x | tool/rbinstall.rb | 2 |
2 files changed, 23 insertions, 17 deletions
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb index 08b8c22785..54b91a65a8 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb @@ -113,11 +113,10 @@ File.foreach "config.status" do |line| end end end + vars[name] = val if name == "configure_args" val.gsub!(/ +(?!-)/, "=") if win32 val.gsub!(/--with-out-ext/, "--without-ext") - elsif name == "libdir" - v_runtime[:libdir] = val[/\$(\(exec_prefix\)|\{exec_prefix\})\/(.*)/, 2] end val = val.gsub(/\$(?:\$|\{?(\w+)\}?)/) {$1 ? "$(#{$1})" : $&}.dump case name @@ -133,7 +132,6 @@ File.foreach "config.status" do |line| end end v = " CONFIG[\"#{name}\"] #{win32 && vars[name] ? '<< "\n"' : '='} #{val}\n" - vars[name] = true if fast[name] v_fast << v else @@ -149,7 +147,26 @@ end drive = File::PATH_SEPARATOR == ';' -prefix = "/#{v_runtime[:libdir] || 'lib'}/ruby/#{version}/#{arch}" +def vars.expand(val, config = self) + newval = val.gsub(/\$\$|\$\(([^()]+)\)|\$\{([^{}]+)\}/) { + var = $& + if !(v = $1 || $2) + '$' + elsif key = config[v = v[/\A[^:]+(?=(?::(.*?)=(.*))?\z)/]] + pat, sub = $1, $2 + config[v] = false + config[v] = expand(key, config) + key = key.gsub(/#{Regexp.quote(pat)}(?=\s|\z)/n) {sub} if pat + key + else + var + end + } + val.replace(newval) unless newval == val + val +end +vars["prefix"] = "" +prefix = vars.expand(vars["rubyarchdir"]) print " TOPDIR = File.dirname(__FILE__).chomp!(#{prefix.dump})\n" print " DESTDIR = ", (drive ? "TOPDIR && TOPDIR[/\\A[a-z]:/i] || " : ""), "'' unless defined? DESTDIR\n" print <<'ARCH' if universal @@ -207,18 +224,7 @@ end print(*v_fast) print(*v_others) print <<EOS - CONFIG["rubylibdir"] = "$(rubylibprefix)/$(ruby_version)" - CONFIG["archdir"] = "$(rubylibdir)/$(arch)" -EOS -print <<EOS unless v_disabled["sitedir"] - CONFIG["sitelibdir"] = "$(sitedir)/$(ruby_version)" - CONFIG["sitearchdir"] = "$(sitelibdir)/$(sitearch)" -EOS -print <<EOS unless v_disabled["vendordir"] - CONFIG["vendorlibdir"] = "$(vendordir)/$(ruby_version)" - CONFIG["vendorarchdir"] = "$(vendorlibdir)/$(sitearch)" -EOS -print <<EOS + CONFIG["archdir"] = "$(rubyarchdir)" CONFIG["topdir"] = File.dirname(__FILE__) MAKEFILE_CONFIG = {} CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup} diff --git a/tool/rbinstall.rb b/tool/rbinstall.rb index 7e8efe7686..5da5125ff3 100755 --- a/tool/rbinstall.rb +++ b/tool/rbinstall.rb @@ -308,7 +308,7 @@ libdir = CONFIG["libdir", true] archhdrdir = rubyhdrdir = CONFIG["rubyhdrdir", true] archhdrdir += "/" + CONFIG["arch", true] rubylibdir = CONFIG["rubylibdir", true] -archlibdir = CONFIG["archdir", true] +archlibdir = CONFIG["rubyarchdir", true] sitelibdir = CONFIG["sitelibdir"] sitearchlibdir = CONFIG["sitearchdir"] vendorlibdir = CONFIG["vendorlibdir"] |