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

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
This commit is contained in:
nobu 2013-01-11 07:56:32 +00:00
parent ffe2c179e4
commit fc81730154
2 changed files with 10 additions and 1 deletions

View file

@ -1,3 +1,9 @@
Fri Jan 11 16:56:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* 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]
Fri Jan 11 11:59:32 2013 NARUSE, Yui <naruse@ruby-lang.org>
* string.c (dispose_string): use rb_str_free for freeing string in

View file

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