summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-11 07:56:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-01-11 07:56:32 +0000
commitfc81730154a90b6460368194139eca05ecee757c (patch)
tree786e09e49241fd81e18e1e10fb1b3881077e69cb /tool
parentffe2c179e4efb1316436e2f05edaf305ef636333 (diff)
mkconfig.rb: use configured libdir value
* tool/mkconfig.rb: use configured libdir value to fix --enable-load-relative on systems where libdir is not default value, overridden in config.site files. [ruby-core:47267] [Bug #6903] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/mkconfig.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb
index a407ccfedb..e73cd29d62 100755
--- a/tool/mkconfig.rb
+++ b/tool/mkconfig.rb
@@ -39,6 +39,7 @@ win32 = /mswin/ =~ arch
universal = /universal.*darwin/ =~ arch
v_fast = []
v_others = []
+v_runtime = {}
vars = {}
continued_name = nil
continued_line = nil
@@ -115,6 +116,8 @@ File.foreach "config.status" do |line|
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
@@ -146,7 +149,7 @@ end
drive = File::PATH_SEPARATOR == ';'
-prefix = "/lib/ruby/#{version}/#{arch}"
+prefix = "/#{v_runtime[:libdir] || 'lib'}/ruby/#{version}/#{arch}"
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