[前][次][番号順一覧][スレッド一覧]

ruby-changes:27521

From: nobu <ko1@a...>
Date: Sun, 3 Mar 2013 12:35:23 +0900 (JST)
Subject: [ruby-changes:27521] nobu:r39573 (trunk): mkmf.rb: libpath_env

nobu	2013-03-03 12:35:11 +0900 (Sun, 03 Mar 2013)

  New Revision: 39573

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39573

  Log:
    mkmf.rb: libpath_env
    
    * lib/mkmf.rb (MakeMakefile#libpath_env): set runtime library path for
      the case rpath is disabled.

  Modified files:
    trunk/ChangeLog
    trunk/lib/mkmf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39572)
+++ ChangeLog	(revision 39573)
@@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Mar  3 12:35:08 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
+
+	* 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@r...>
 
 	* lib/rubygems/ext/ext_conf_builder.rb
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 39572)
+++ lib/mkmf.rb	(revision 39573)
@@ -350,6 +350,16 @@ module MakeMakefile https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L350
     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 https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L372
       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 https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L390
       else
         puts "| #{command}"
       end
-      IO.popen(command, *mode, &block)
+      IO.popen(libpath_env, command, *mode, &block)
     end
   end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]