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

ruby-changes:37679

From: nobu <ko1@a...>
Date: Thu, 26 Feb 2015 17:02:12 +0900 (JST)
Subject: [ruby-changes:37679] nobu:r49760 (trunk): configure.in: PRELOADENV

nobu	2015-02-26 17:01:54 +0900 (Thu, 26 Feb 2015)

  New Revision: 49760

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

  Log:
    configure.in: PRELOADENV
    
    * configure.in (PRELOADENV): platform specific environment to
      pre-load the given shared libraries.
    
    * tool/runruby.rb: use config['PRELOADENV'] instead of hardcoded
      LD_PRELOAD.

  Modified files:
    trunk/configure.in
    trunk/tool/runruby.rb
Index: configure.in
===================================================================
--- configure.in	(revision 49759)
+++ configure.in	(revision 49760)
@@ -2972,6 +2972,7 @@ if test "$with_dln_a_out" != yes; then https://github.com/ruby/ruby/blob/trunk/configure.in#L2972
 	[darwin*], [	: ${LDSHARED='$(CC) -dynamic -bundle'}
 			: ${LDFLAGS=""}
 			: ${LIBPATHENV=DYLD_LIBRARY_PATH}
+			: ${PRELOADENV=DYLD_INSERT_LIBRARIES}
 			rb_cv_dlopen=yes],
         [aix*], [	: ${LDSHARED='$(CC)'}
 			LDSHARED="$LDSHARED ${linker_flag}-G"
@@ -3080,6 +3081,7 @@ AC_SUBST(LINK_SO) https://github.com/ruby/ruby/blob/trunk/configure.in#L3081
 AC_SUBST(LIBPATHFLAG)
 AC_SUBST(RPATHFLAG)
 AC_SUBST(LIBPATHENV, "${LIBPATHENV-LD_LIBRARY_PATH}")
+AC_SUBST(PRELOADENV, "${PRELOADENV-LD_PRELOAD}")
 AC_SUBST(TRY_LINK)
 
 if test "x$OPT_DIR" != x; then
Index: tool/runruby.rb
===================================================================
--- tool/runruby.rb	(revision 49759)
+++ tool/runruby.rb	(revision 49760)
@@ -79,8 +79,12 @@ if File.file?(libruby_so) https://github.com/ruby/ruby/blob/trunk/tool/runruby.rb#L79
   if e = config['LIBPATHENV'] and !e.empty?
     env[e] = [abs_archdir, ENV[e]].compact.join(File::PATH_SEPARATOR)
   end
-  if /linux/ =~ RUBY_PLATFORM
-    env["LD_PRELOAD"] = [libruby_so, ENV["LD_PRELOAD"]].compact.join(' ')
+  if e = config['PRELOADENV']
+    e = nil if e.empty?
+    e ||= "LD_PRELOAD" if /linux/ =~ RUBY_PLATFORM
+  end
+  if e
+    env[e] = [libruby_so, ENV[e]].compact.join(' ')
   end
 end
 

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

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