Browse files

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
  • Loading branch information...
1 parent a7a0b3a commit bb2551b41cacd2dfdcf3311625ec9e7eb1677072 @nobu nobu committed Mar 3, 2013
Showing with 23 additions and 3 deletions.
  1. +10 −0 ChangeLog
  2. +13 −3 lib/mkmf.rb
View
10 ChangeLog
@@ -1,3 +1,13 @@
+Sun Mar 3 12:35:08 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#libpath_env): set runtime library path for
+ the case rpath is disabled.
+
+Sun Mar 3 12:34:29 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * lib/mkmf.rb (MakeMakefile#libpath_env): set runtime library path for
+ the case rpath is disabled.
+
Sun Mar 3 12:17:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/rubygems/ext/ext_conf_builder.rb
View
16 lib/mkmf.rb
@@ -350,6 +350,16 @@ class << self
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 @@ def xsystem command, opts = nil
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 @@ def xpopen command, *mode, &block
else
puts "| #{command}"
end
- IO.popen(command, *mode, &block)
+ IO.popen(libpath_env, command, *mode, &block)
end
end

0 comments on commit bb2551b

Please sign in to comment.