summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-03 03:35:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-03-03 03:35:11 +0000
commitbb2551b41cacd2dfdcf3311625ec9e7eb1677072 (patch)
treeedb7b88551ce7b2b9483357a0eb101d805dfb771 /lib
parenta7a0b3ad52e264d08e1b26a6bad9b9bba2a99c1b (diff)
mkmf.rb: libpath_env
* lib/mkmf.rb (MakeMakefile#libpath_env): set runtime library path for the case rpath is disabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index dcf1de4242..23bb402c95 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -350,6 +350,16 @@ module MakeMakefile
end
end
+ def libpath_env
+ if libpathenv = CONFIG["LIBPATHENV"]
+ pathenv = ENV[libpathenv]
+ libpath = RbConfig.expand($DEFLIBPATH.join(File::PATH_SEPARATOR))
+ {libpathenv => [libpath, pathenv].compact.join(File::PATH_SEPARATOR)}
+ else
+ {}
+ end
+ end
+
def xsystem command, opts = nil
varpat = /\$\((\w+)\)|\$\{(\w+)\}/
if varpat =~ command
@@ -362,12 +372,12 @@ module MakeMakefile
if opts and opts[:werror]
result = nil
Logging.postpone do |log|
- result = (system(command) and File.zero?(log.path))
+ result = (system(libpath_env, command) and File.zero?(log.path))
""
end
result
else
- system(command)
+ system(libpath_env, command)
end
end
end
@@ -380,7 +390,7 @@ module MakeMakefile
else
puts "| #{command}"
end
- IO.popen(command, *mode, &block)
+ IO.popen(libpath_env, command, *mode, &block)
end
end