1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
nobu 2013-02-06 08:32:53 +00:00
parent d32b122996
commit 29c214e4a0
5 changed files with 69 additions and 26 deletions

View file

@ -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}